diff options
Diffstat (limited to 'arch')
367 files changed, 8679 insertions, 3740 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index 830c16a2b801..dc81b34c5d82 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -6,6 +6,7 @@ config OPROFILE | |||
6 | tristate "OProfile system profiling (EXPERIMENTAL)" | 6 | tristate "OProfile system profiling (EXPERIMENTAL)" |
7 | depends on PROFILING | 7 | depends on PROFILING |
8 | depends on HAVE_OPROFILE | 8 | depends on HAVE_OPROFILE |
9 | depends on TRACING_SUPPORT | ||
9 | select TRACING | 10 | select TRACING |
10 | select RING_BUFFER | 11 | select RING_BUFFER |
11 | help | 12 | help |
diff --git a/arch/alpha/include/asm/ftrace.h b/arch/alpha/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/alpha/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/alpha/include/asm/hardirq.h b/arch/alpha/include/asm/hardirq.h index d953e234daa8..88971460fa6c 100644 --- a/arch/alpha/include/asm/hardirq.h +++ b/arch/alpha/include/asm/hardirq.h | |||
@@ -14,17 +14,4 @@ typedef struct { | |||
14 | 14 | ||
15 | void ack_bad_irq(unsigned int irq); | 15 | void ack_bad_irq(unsigned int irq); |
16 | 16 | ||
17 | #define HARDIRQ_BITS 12 | ||
18 | |||
19 | /* | ||
20 | * The hardirq mask has to be large enough to have | ||
21 | * space for potentially nestable IRQ sources in the system | ||
22 | * to nest on a single CPU. On Alpha, interrupts are masked at the CPU | ||
23 | * by IPL as well as at the system level. We only have 8 IPLs (UNIX PALcode) | ||
24 | * so we really only have 8 nestable IRQs, but allow some overhead | ||
25 | */ | ||
26 | #if (1 << HARDIRQ_BITS) < 16 | ||
27 | #error HARDIRQ_BITS is too low! | ||
28 | #endif | ||
29 | |||
30 | #endif /* _ALPHA_HARDIRQ_H */ | 17 | #endif /* _ALPHA_HARDIRQ_H */ |
diff --git a/arch/alpha/include/asm/spinlock.h b/arch/alpha/include/asm/spinlock.h index aeeb125f6851..e38fb95cb335 100644 --- a/arch/alpha/include/asm/spinlock.h +++ b/arch/alpha/include/asm/spinlock.h | |||
@@ -166,6 +166,9 @@ static inline void __raw_write_unlock(raw_rwlock_t * lock) | |||
166 | lock->lock = 0; | 166 | lock->lock = 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
170 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
171 | |||
169 | #define _raw_spin_relax(lock) cpu_relax() | 172 | #define _raw_spin_relax(lock) cpu_relax() |
170 | #define _raw_read_relax(lock) cpu_relax() | 173 | #define _raw_read_relax(lock) cpu_relax() |
171 | #define _raw_write_relax(lock) cpu_relax() | 174 | #define _raw_write_relax(lock) cpu_relax() |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 8d0097f10208..3a2fb7a02db4 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -272,7 +272,7 @@ alpha_vfork(struct pt_regs *regs) | |||
272 | */ | 272 | */ |
273 | 273 | ||
274 | int | 274 | int |
275 | copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 275 | copy_thread(unsigned long clone_flags, unsigned long usp, |
276 | unsigned long unused, | 276 | unsigned long unused, |
277 | struct task_struct * p, struct pt_regs * regs) | 277 | struct task_struct * p, struct pt_regs * regs) |
278 | { | 278 | { |
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index 393c81641314..9e6e512f0117 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c | |||
@@ -18,7 +18,10 @@ | |||
18 | 18 | ||
19 | unsigned int __machine_arch_type; | 19 | unsigned int __machine_arch_type; |
20 | 20 | ||
21 | #include <linux/string.h> | 21 | #include <linux/compiler.h> /* for inline */ |
22 | #include <linux/types.h> /* for size_t */ | ||
23 | #include <linux/stddef.h> /* for NULL */ | ||
24 | #include <asm/string.h> | ||
22 | 25 | ||
23 | #ifdef STANDALONE_DEBUG | 26 | #ifdef STANDALONE_DEBUG |
24 | #define putstr printf | 27 | #define putstr printf |
diff --git a/arch/arm/configs/omap_ldp_defconfig b/arch/arm/configs/omap_ldp_defconfig index aa9d34feddc6..679a4a3e265e 100644 --- a/arch/arm/configs/omap_ldp_defconfig +++ b/arch/arm/configs/omap_ldp_defconfig | |||
@@ -474,14 +474,34 @@ CONFIG_NETDEVICES=y | |||
474 | # CONFIG_EQUALIZER is not set | 474 | # CONFIG_EQUALIZER is not set |
475 | # CONFIG_TUN is not set | 475 | # CONFIG_TUN is not set |
476 | # CONFIG_VETH is not set | 476 | # CONFIG_VETH is not set |
477 | # CONFIG_PHYLIB is not set | 477 | CONFIG_PHYLIB=y |
478 | |||
479 | # | ||
480 | # MII PHY device drivers | ||
481 | # | ||
482 | # CONFIG_MARVELL_PHY is not set | ||
483 | # CONFIG_DAVICOM_PHY is not set | ||
484 | # CONFIG_QSEMI_PHY is not set | ||
485 | # CONFIG_LXT_PHY is not set | ||
486 | # CONFIG_CICADA_PHY is not set | ||
487 | # CONFIG_VITESSE_PHY is not set | ||
488 | CONFIG_SMSC_PHY=y | ||
489 | # CONFIG_BROADCOM_PHY is not set | ||
490 | # CONFIG_ICPLUS_PHY is not set | ||
491 | # CONFIG_REALTEK_PHY is not set | ||
492 | # CONFIG_NATIONAL_PHY is not set | ||
493 | # CONFIG_STE10XP is not set | ||
494 | # CONFIG_LSI_ET1011C_PHY is not set | ||
495 | # CONFIG_FIXED_PHY is not set | ||
496 | # CONFIG_MDIO_BITBANG is not set | ||
478 | CONFIG_NET_ETHERNET=y | 497 | CONFIG_NET_ETHERNET=y |
479 | CONFIG_MII=y | 498 | CONFIG_MII=y |
480 | # CONFIG_AX88796 is not set | 499 | # CONFIG_AX88796 is not set |
481 | # CONFIG_SMC91X is not set | 500 | # CONFIG_SMC91X is not set |
482 | # CONFIG_DM9000 is not set | 501 | # CONFIG_DM9000 is not set |
483 | # CONFIG_ENC28J60 is not set | 502 | # CONFIG_ENC28J60 is not set |
484 | CONFIG_SMC911X=y | 503 | # CONFIG_SMC911X is not set |
504 | CONFIG_SMSC911X=y | ||
485 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | 505 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
486 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 506 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
487 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 507 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
diff --git a/arch/arm/configs/pcm037_defconfig b/arch/arm/configs/pcm037_defconfig index 627474586470..6e37c77c4760 100644 --- a/arch/arm/configs/pcm037_defconfig +++ b/arch/arm/configs/pcm037_defconfig | |||
@@ -465,12 +465,33 @@ CONFIG_NETDEVICES=y | |||
465 | # CONFIG_EQUALIZER is not set | 465 | # CONFIG_EQUALIZER is not set |
466 | # CONFIG_TUN is not set | 466 | # CONFIG_TUN is not set |
467 | # CONFIG_VETH is not set | 467 | # CONFIG_VETH is not set |
468 | # CONFIG_PHYLIB is not set | 468 | CONFIG_PHYLIB=y |
469 | |||
470 | # | ||
471 | # MII PHY device drivers | ||
472 | # | ||
473 | # CONFIG_MARVELL_PHY is not set | ||
474 | # CONFIG_DAVICOM_PHY is not set | ||
475 | # CONFIG_QSEMI_PHY is not set | ||
476 | # CONFIG_LXT_PHY is not set | ||
477 | # CONFIG_CICADA_PHY is not set | ||
478 | # CONFIG_VITESSE_PHY is not set | ||
479 | CONFIG_SMSC_PHY=y | ||
480 | # CONFIG_BROADCOM_PHY is not set | ||
481 | # CONFIG_ICPLUS_PHY is not set | ||
482 | # CONFIG_REALTEK_PHY is not set | ||
483 | # CONFIG_NATIONAL_PHY is not set | ||
484 | # CONFIG_STE10XP is not set | ||
485 | # CONFIG_LSI_ET1011C_PHY is not set | ||
486 | # CONFIG_FIXED_PHY is not set | ||
487 | # CONFIG_MDIO_BITBANG is not set | ||
469 | CONFIG_NET_ETHERNET=y | 488 | CONFIG_NET_ETHERNET=y |
470 | CONFIG_MII=y | 489 | CONFIG_MII=y |
471 | # CONFIG_AX88796 is not set | 490 | # CONFIG_AX88796 is not set |
472 | CONFIG_SMC91X=y | 491 | CONFIG_SMC91X=y |
473 | # CONFIG_DM9000 is not set | 492 | # CONFIG_DM9000 is not set |
493 | # CONFIG_SMC911X is not set | ||
494 | CONFIG_SMSC911X=y | ||
474 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | 495 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
475 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 496 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
476 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 497 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
diff --git a/arch/arm/configs/realview-smp_defconfig b/arch/arm/configs/realview-smp_defconfig index cd29824d791c..21db4b3ec8ff 100644 --- a/arch/arm/configs/realview-smp_defconfig +++ b/arch/arm/configs/realview-smp_defconfig | |||
@@ -496,13 +496,33 @@ CONFIG_NETDEVICES=y | |||
496 | # CONFIG_EQUALIZER is not set | 496 | # CONFIG_EQUALIZER is not set |
497 | # CONFIG_TUN is not set | 497 | # CONFIG_TUN is not set |
498 | # CONFIG_VETH is not set | 498 | # CONFIG_VETH is not set |
499 | # CONFIG_PHYLIB is not set | 499 | CONFIG_PHYLIB=y |
500 | |||
501 | # | ||
502 | # MII PHY device drivers | ||
503 | # | ||
504 | # CONFIG_MARVELL_PHY is not set | ||
505 | # CONFIG_DAVICOM_PHY is not set | ||
506 | # CONFIG_QSEMI_PHY is not set | ||
507 | # CONFIG_LXT_PHY is not set | ||
508 | # CONFIG_CICADA_PHY is not set | ||
509 | # CONFIG_VITESSE_PHY is not set | ||
510 | CONFIG_SMSC_PHY=y | ||
511 | # CONFIG_BROADCOM_PHY is not set | ||
512 | # CONFIG_ICPLUS_PHY is not set | ||
513 | # CONFIG_REALTEK_PHY is not set | ||
514 | # CONFIG_NATIONAL_PHY is not set | ||
515 | # CONFIG_STE10XP is not set | ||
516 | # CONFIG_LSI_ET1011C_PHY is not set | ||
517 | # CONFIG_FIXED_PHY is not set | ||
518 | # CONFIG_MDIO_BITBANG is not set | ||
500 | CONFIG_NET_ETHERNET=y | 519 | CONFIG_NET_ETHERNET=y |
501 | CONFIG_MII=y | 520 | CONFIG_MII=y |
502 | # CONFIG_AX88796 is not set | 521 | # CONFIG_AX88796 is not set |
503 | CONFIG_SMC91X=y | 522 | CONFIG_SMC91X=y |
504 | # CONFIG_DM9000 is not set | 523 | # CONFIG_DM9000 is not set |
505 | CONFIG_SMC911X=y | 524 | # CONFIG_SMC911X is not set |
525 | CONFIG_SMSC911X=y | ||
506 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | 526 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
507 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 527 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
508 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 528 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
diff --git a/arch/arm/configs/realview_defconfig b/arch/arm/configs/realview_defconfig index 7e253f58ed18..9a75c30b910d 100644 --- a/arch/arm/configs/realview_defconfig +++ b/arch/arm/configs/realview_defconfig | |||
@@ -490,13 +490,33 @@ CONFIG_NETDEVICES=y | |||
490 | # CONFIG_EQUALIZER is not set | 490 | # CONFIG_EQUALIZER is not set |
491 | # CONFIG_TUN is not set | 491 | # CONFIG_TUN is not set |
492 | # CONFIG_VETH is not set | 492 | # CONFIG_VETH is not set |
493 | # CONFIG_PHYLIB is not set | 493 | CONFIG_PHYLIB=y |
494 | |||
495 | # | ||
496 | # MII PHY device drivers | ||
497 | # | ||
498 | # CONFIG_MARVELL_PHY is not set | ||
499 | # CONFIG_DAVICOM_PHY is not set | ||
500 | # CONFIG_QSEMI_PHY is not set | ||
501 | # CONFIG_LXT_PHY is not set | ||
502 | # CONFIG_CICADA_PHY is not set | ||
503 | # CONFIG_VITESSE_PHY is not set | ||
504 | CONFIG_SMSC_PHY=y | ||
505 | # CONFIG_BROADCOM_PHY is not set | ||
506 | # CONFIG_ICPLUS_PHY is not set | ||
507 | # CONFIG_REALTEK_PHY is not set | ||
508 | # CONFIG_NATIONAL_PHY is not set | ||
509 | # CONFIG_STE10XP is not set | ||
510 | # CONFIG_LSI_ET1011C_PHY is not set | ||
511 | # CONFIG_FIXED_PHY is not set | ||
512 | # CONFIG_MDIO_BITBANG is not set | ||
494 | CONFIG_NET_ETHERNET=y | 513 | CONFIG_NET_ETHERNET=y |
495 | CONFIG_MII=y | 514 | CONFIG_MII=y |
496 | # CONFIG_AX88796 is not set | 515 | # CONFIG_AX88796 is not set |
497 | CONFIG_SMC91X=y | 516 | CONFIG_SMC91X=y |
498 | # CONFIG_DM9000 is not set | 517 | # CONFIG_DM9000 is not set |
499 | CONFIG_SMC911X=y | 518 | # CONFIG_SMC911X is not set |
519 | CONFIG_SMSC911X=y | ||
500 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | 520 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
501 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 521 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
502 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 522 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h index 2b41ebbfa7ff..c13681ac1ede 100644 --- a/arch/arm/include/asm/spinlock.h +++ b/arch/arm/include/asm/spinlock.h | |||
@@ -217,6 +217,9 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw) | |||
217 | /* read_can_lock - would read_trylock() succeed? */ | 217 | /* read_can_lock - would read_trylock() succeed? */ |
218 | #define __raw_read_can_lock(x) ((x)->lock < 0x80000000) | 218 | #define __raw_read_can_lock(x) ((x)->lock < 0x80000000) |
219 | 219 | ||
220 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
221 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
222 | |||
220 | #define _raw_spin_relax(lock) cpu_relax() | 223 | #define _raw_spin_relax(lock) cpu_relax() |
221 | #define _raw_read_relax(lock) cpu_relax() | 224 | #define _raw_read_relax(lock) cpu_relax() |
222 | #define _raw_write_relax(lock) cpu_relax() | 225 | #define _raw_write_relax(lock) cpu_relax() |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 2de14e2afdc5..c3265a2e7cd4 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -301,7 +301,7 @@ void release_thread(struct task_struct *dead_task) | |||
301 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); | 301 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); |
302 | 302 | ||
303 | int | 303 | int |
304 | copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start, | 304 | copy_thread(unsigned long clone_flags, unsigned long stack_start, |
305 | unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs) | 305 | unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs) |
306 | { | 306 | { |
307 | struct thread_info *thread = task_thread_info(p); | 307 | struct thread_info *thread = task_thread_info(p); |
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 7ac812dc055a..e26c4fe61fae 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -198,17 +198,17 @@ static int at91_pm_verify_clocks(void) | |||
198 | /* USB must not be using PLLB */ | 198 | /* USB must not be using PLLB */ |
199 | if (cpu_is_at91rm9200()) { | 199 | if (cpu_is_at91rm9200()) { |
200 | if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) { | 200 | if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) { |
201 | pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); | 201 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); |
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
204 | } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) { | 204 | } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) { |
205 | if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) { | 205 | if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) { |
206 | pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); | 206 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); |
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
209 | } else if (cpu_is_at91cap9()) { | 209 | } else if (cpu_is_at91cap9()) { |
210 | if ((scsr & AT91CAP9_PMC_UHP) != 0) { | 210 | if ((scsr & AT91CAP9_PMC_UHP) != 0) { |
211 | pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); | 211 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); |
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
214 | } | 214 | } |
@@ -223,7 +223,7 @@ static int at91_pm_verify_clocks(void) | |||
223 | 223 | ||
224 | css = at91_sys_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS; | 224 | css = at91_sys_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS; |
225 | if (css != AT91_PMC_CSS_SLOW) { | 225 | if (css != AT91_PMC_CSS_SLOW) { |
226 | pr_debug("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); | 226 | pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); |
227 | return 0; | 227 | return 0; |
228 | } | 228 | } |
229 | } | 229 | } |
diff --git a/arch/arm/mach-gemini/include/mach/system.h b/arch/arm/mach-gemini/include/mach/system.h index bbbd72767a02..4d9c1f872472 100644 --- a/arch/arm/mach-gemini/include/mach/system.h +++ b/arch/arm/mach-gemini/include/mach/system.h | |||
@@ -28,7 +28,7 @@ static inline void arch_idle(void) | |||
28 | cpu_do_idle(); | 28 | cpu_do_idle(); |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline void arch_reset(char mode) | 31 | static inline void arch_reset(char mode, const char *cmd) |
32 | { | 32 | { |
33 | __raw_writel(RESET_GLOBAL | RESET_CPU1, | 33 | __raw_writel(RESET_GLOBAL | RESET_CPU1, |
34 | IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET); | 34 | IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET); |
diff --git a/arch/arm/mach-mmp/include/mach/system.h b/arch/arm/mach-mmp/include/mach/system.h index 001edfefec19..4f5b0e0ce6cf 100644 --- a/arch/arm/mach-mmp/include/mach/system.h +++ b/arch/arm/mach-mmp/include/mach/system.h | |||
@@ -14,7 +14,7 @@ static inline void arch_idle(void) | |||
14 | cpu_do_idle(); | 14 | cpu_do_idle(); |
15 | } | 15 | } |
16 | 16 | ||
17 | static inline void arch_reset(char mode) | 17 | static inline void arch_reset(char mode, const char *cmd) |
18 | { | 18 | { |
19 | cpu_reset(0); | 19 | cpu_reset(0); |
20 | } | 20 | } |
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c index 5fce022114de..c3648eff5137 100644 --- a/arch/arm/mach-mx3/pcm037.c +++ b/arch/arm/mach-mx3/pcm037.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/mtd/plat-ram.h> | 24 | #include <linux/mtd/plat-ram.h> |
25 | #include <linux/memory.h> | 25 | #include <linux/memory.h> |
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/smc911x.h> | 27 | #include <linux/smsc911x.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/i2c.h> | 29 | #include <linux/i2c.h> |
30 | #include <linux/i2c/at24.h> | 30 | #include <linux/i2c/at24.h> |
@@ -70,7 +70,7 @@ static struct imxuart_platform_data uart_pdata = { | |||
70 | .flags = IMXUART_HAVE_RTSCTS, | 70 | .flags = IMXUART_HAVE_RTSCTS, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static struct resource smc911x_resources[] = { | 73 | static struct resource smsc911x_resources[] = { |
74 | [0] = { | 74 | [0] = { |
75 | .start = CS1_BASE_ADDR + 0x300, | 75 | .start = CS1_BASE_ADDR + 0x300, |
76 | .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1, | 76 | .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1, |
@@ -79,22 +79,25 @@ static struct resource smc911x_resources[] = { | |||
79 | [1] = { | 79 | [1] = { |
80 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), | 80 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), |
81 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), | 81 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), |
82 | .flags = IORESOURCE_IRQ, | 82 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
83 | }, | 83 | }, |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static struct smc911x_platdata smc911x_info = { | 86 | static struct smsc911x_platform_config smsc911x_info = { |
87 | .flags = SMC911X_USE_32BIT, | 87 | .flags = SMSC911X_USE_32BIT | SMSC911X_FORCE_INTERNAL_PHY | |
88 | .irq_flags = IRQF_SHARED | IRQF_TRIGGER_LOW, | 88 | SMSC911X_SAVE_MAC_ADDRESS, |
89 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
90 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
91 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
89 | }; | 92 | }; |
90 | 93 | ||
91 | static struct platform_device pcm037_eth = { | 94 | static struct platform_device pcm037_eth = { |
92 | .name = "smc911x", | 95 | .name = "smsc911x", |
93 | .id = -1, | 96 | .id = -1, |
94 | .num_resources = ARRAY_SIZE(smc911x_resources), | 97 | .num_resources = ARRAY_SIZE(smsc911x_resources), |
95 | .resource = smc911x_resources, | 98 | .resource = smsc911x_resources, |
96 | .dev = { | 99 | .dev = { |
97 | .platform_data = &smc911x_info, | 100 | .platform_data = &smsc911x_info, |
98 | }, | 101 | }, |
99 | }; | 102 | }; |
100 | 103 | ||
diff --git a/arch/arm/mach-netx/include/mach/netx-regs.h b/arch/arm/mach-netx/include/mach/netx-regs.h index 08c60ff227be..5a03e7ccb01a 100644 --- a/arch/arm/mach-netx/include/mach/netx-regs.h +++ b/arch/arm/mach-netx/include/mach/netx-regs.h | |||
@@ -80,7 +80,7 @@ | |||
80 | #define NETX_PA_XPEC(no) (NETX_IO_PHYS + NETX_OFS_XPEC(no)) | 80 | #define NETX_PA_XPEC(no) (NETX_IO_PHYS + NETX_OFS_XPEC(no)) |
81 | #define NETX_PA_VIC (NETX_IO_PHYS + NETX_OFS_VIC) | 81 | #define NETX_PA_VIC (NETX_IO_PHYS + NETX_OFS_VIC) |
82 | 82 | ||
83 | /* virual addresses */ | 83 | /* virtual addresses */ |
84 | #define NETX_VA_SYSTEM (NETX_IO_VIRT + NETX_OFS_SYSTEM) | 84 | #define NETX_VA_SYSTEM (NETX_IO_VIRT + NETX_OFS_SYSTEM) |
85 | #define NETX_VA_MEMCR (NETX_IO_VIRT + NETX_OFS_MEMCR) | 85 | #define NETX_VA_MEMCR (NETX_IO_VIRT + NETX_OFS_MEMCR) |
86 | #define NETX_VA_DPMAS (NETX_IO_VIRT + NETX_OFS_DPMAS) | 86 | #define NETX_VA_DPMAS (NETX_IO_VIRT + NETX_OFS_DPMAS) |
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 3f325d3718a9..cd8de89c5fad 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig | |||
@@ -109,7 +109,7 @@ config MACH_OMAP_PALMZ71 | |||
109 | help | 109 | help |
110 | Support for the Palm Zire71 PDA. To boot the kernel, | 110 | Support for the Palm Zire71 PDA. To boot the kernel, |
111 | you'll need a PalmOS compatible bootloader; check out | 111 | you'll need a PalmOS compatible bootloader; check out |
112 | http://hackndev.com/palm/z71 for more informations. | 112 | http://hackndev.com/palm/z71 for more information. |
113 | Say Y here if you have such a PDA, say N otherwise. | 113 | Say Y here if you have such a PDA, say N otherwise. |
114 | 114 | ||
115 | config MACH_OMAP_PALMTT | 115 | config MACH_OMAP_PALMTT |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index a2c3fcc27a22..c49d9bfa3abd 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -47,6 +47,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ | |||
47 | 47 | ||
48 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ | 48 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ |
49 | board-rx51-peripherals.o \ | 49 | board-rx51-peripherals.o \ |
50 | mmc-twl4030.o | ||
51 | |||
50 | # Platform specific device init code | 52 | # Platform specific device init code |
51 | ifeq ($(CONFIG_USB_MUSB_SOC),y) | 53 | ifeq ($(CONFIG_USB_MUSB_SOC),y) |
52 | obj-y += usb-musb.o | 54 | obj-y += usb-musb.o |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index e096f776f996..da57b0fcda14 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/spi/ads7846.h> | 23 | #include <linux/spi/ads7846.h> |
24 | #include <linux/i2c/twl4030.h> | 24 | #include <linux/i2c/twl4030.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/smsc911x.h> | ||
26 | 27 | ||
27 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
@@ -41,12 +42,12 @@ | |||
41 | 42 | ||
42 | #include "mmc-twl4030.h" | 43 | #include "mmc-twl4030.h" |
43 | 44 | ||
44 | #define LDP_SMC911X_CS 1 | 45 | #define LDP_SMSC911X_CS 1 |
45 | #define LDP_SMC911X_GPIO 152 | 46 | #define LDP_SMSC911X_GPIO 152 |
46 | #define DEBUG_BASE 0x08000000 | 47 | #define DEBUG_BASE 0x08000000 |
47 | #define LDP_ETHR_START DEBUG_BASE | 48 | #define LDP_ETHR_START DEBUG_BASE |
48 | 49 | ||
49 | static struct resource ldp_smc911x_resources[] = { | 50 | static struct resource ldp_smsc911x_resources[] = { |
50 | [0] = { | 51 | [0] = { |
51 | .start = LDP_ETHR_START, | 52 | .start = LDP_ETHR_START, |
52 | .end = LDP_ETHR_START + SZ_4K, | 53 | .end = LDP_ETHR_START + SZ_4K, |
@@ -59,40 +60,50 @@ static struct resource ldp_smc911x_resources[] = { | |||
59 | }, | 60 | }, |
60 | }; | 61 | }; |
61 | 62 | ||
62 | static struct platform_device ldp_smc911x_device = { | 63 | static struct smsc911x_platform_config ldp_smsc911x_config = { |
63 | .name = "smc911x", | 64 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
65 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
66 | .flags = SMSC911X_USE_32BIT, | ||
67 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
68 | }; | ||
69 | |||
70 | static struct platform_device ldp_smsc911x_device = { | ||
71 | .name = "smsc911x", | ||
64 | .id = -1, | 72 | .id = -1, |
65 | .num_resources = ARRAY_SIZE(ldp_smc911x_resources), | 73 | .num_resources = ARRAY_SIZE(ldp_smsc911x_resources), |
66 | .resource = ldp_smc911x_resources, | 74 | .resource = ldp_smsc911x_resources, |
75 | .dev = { | ||
76 | .platform_data = &ldp_smsc911x_config, | ||
77 | }, | ||
67 | }; | 78 | }; |
68 | 79 | ||
69 | static struct platform_device *ldp_devices[] __initdata = { | 80 | static struct platform_device *ldp_devices[] __initdata = { |
70 | &ldp_smc911x_device, | 81 | &ldp_smsc911x_device, |
71 | }; | 82 | }; |
72 | 83 | ||
73 | static inline void __init ldp_init_smc911x(void) | 84 | static inline void __init ldp_init_smsc911x(void) |
74 | { | 85 | { |
75 | int eth_cs; | 86 | int eth_cs; |
76 | unsigned long cs_mem_base; | 87 | unsigned long cs_mem_base; |
77 | int eth_gpio = 0; | 88 | int eth_gpio = 0; |
78 | 89 | ||
79 | eth_cs = LDP_SMC911X_CS; | 90 | eth_cs = LDP_SMSC911X_CS; |
80 | 91 | ||
81 | if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { | 92 | if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { |
82 | printk(KERN_ERR "Failed to request GPMC mem for smc911x\n"); | 93 | printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n"); |
83 | return; | 94 | return; |
84 | } | 95 | } |
85 | 96 | ||
86 | ldp_smc911x_resources[0].start = cs_mem_base + 0x0; | 97 | ldp_smsc911x_resources[0].start = cs_mem_base + 0x0; |
87 | ldp_smc911x_resources[0].end = cs_mem_base + 0xff; | 98 | ldp_smsc911x_resources[0].end = cs_mem_base + 0xff; |
88 | udelay(100); | 99 | udelay(100); |
89 | 100 | ||
90 | eth_gpio = LDP_SMC911X_GPIO; | 101 | eth_gpio = LDP_SMSC911X_GPIO; |
91 | 102 | ||
92 | ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); | 103 | ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); |
93 | 104 | ||
94 | if (gpio_request(eth_gpio, "smc911x irq") < 0) { | 105 | if (gpio_request(eth_gpio, "smsc911x irq") < 0) { |
95 | printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", | 106 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", |
96 | eth_gpio); | 107 | eth_gpio); |
97 | return; | 108 | return; |
98 | } | 109 | } |
@@ -104,7 +115,7 @@ static void __init omap_ldp_init_irq(void) | |||
104 | omap2_init_common_hw(NULL); | 115 | omap2_init_common_hw(NULL); |
105 | omap_init_irq(); | 116 | omap_init_irq(); |
106 | omap_gpio_init(); | 117 | omap_gpio_init(); |
107 | ldp_init_smc911x(); | 118 | ldp_init_smsc911x(); |
108 | } | 119 | } |
109 | 120 | ||
110 | static struct omap_uart_config ldp_uart_config __initdata = { | 121 | static struct omap_uart_config ldp_uart_config __initdata = { |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index b3f6e9d81807..b1f23bea863f 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -57,6 +57,9 @@ | |||
57 | #define GPMC_CS0_BASE 0x60 | 57 | #define GPMC_CS0_BASE 0x60 |
58 | #define GPMC_CS_SIZE 0x30 | 58 | #define GPMC_CS_SIZE 0x30 |
59 | 59 | ||
60 | #define OVERO_SMSC911X_CS 5 | ||
61 | #define OVERO_SMSC911X_GPIO 176 | ||
62 | |||
60 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | 63 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ |
61 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | 64 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
62 | 65 | ||
@@ -116,6 +119,67 @@ static void __init overo_ads7846_init(void) | |||
116 | static inline void __init overo_ads7846_init(void) { return; } | 119 | static inline void __init overo_ads7846_init(void) { return; } |
117 | #endif | 120 | #endif |
118 | 121 | ||
122 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | ||
123 | |||
124 | #include <linux/smsc911x.h> | ||
125 | |||
126 | static struct resource overo_smsc911x_resources[] = { | ||
127 | { | ||
128 | .name = "smsc911x-memory", | ||
129 | .flags = IORESOURCE_MEM, | ||
130 | }, | ||
131 | { | ||
132 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
133 | }, | ||
134 | }; | ||
135 | |||
136 | static struct smsc911x_platform_config overo_smsc911x_config = { | ||
137 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
138 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
139 | .flags = SMSC911X_USE_32BIT , | ||
140 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
141 | }; | ||
142 | |||
143 | static struct platform_device overo_smsc911x_device = { | ||
144 | .name = "smsc911x", | ||
145 | .id = -1, | ||
146 | .num_resources = ARRAY_SIZE(overo_smsc911x_resources), | ||
147 | .resource = &overo_smsc911x_resources, | ||
148 | .dev = { | ||
149 | .platform_data = &overo_smsc911x_config, | ||
150 | }, | ||
151 | }; | ||
152 | |||
153 | static inline void __init overo_init_smsc911x(void) | ||
154 | { | ||
155 | unsigned long cs_mem_base; | ||
156 | |||
157 | if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { | ||
158 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); | ||
159 | return; | ||
160 | } | ||
161 | |||
162 | overo_smsc911x_resources[0].start = cs_mem_base + 0x0; | ||
163 | overo_smsc911x_resources[0].end = cs_mem_base + 0xff; | ||
164 | |||
165 | if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) && | ||
166 | (gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) { | ||
167 | gpio_export(OVERO_SMSC911X_GPIO, 0); | ||
168 | } else { | ||
169 | printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n"); | ||
170 | return; | ||
171 | } | ||
172 | |||
173 | overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); | ||
174 | overo_smsc911x_resources[1].end = 0; | ||
175 | |||
176 | platform_device_register(&overo_smsc911x_device); | ||
177 | } | ||
178 | |||
179 | #else | ||
180 | static inline void __init overo_init_smsc911x(void) { return; } | ||
181 | #endif | ||
182 | |||
119 | static struct mtd_partition overo_nand_partitions[] = { | 183 | static struct mtd_partition overo_nand_partitions[] = { |
120 | { | 184 | { |
121 | .name = "xloader", | 185 | .name = "xloader", |
@@ -290,6 +354,7 @@ static void __init overo_init(void) | |||
290 | overo_flash_init(); | 354 | overo_flash_init(); |
291 | usb_musb_init(); | 355 | usb_musb_init(); |
292 | overo_ads7846_init(); | 356 | overo_ads7846_init(); |
357 | overo_init_smsc911x(); | ||
293 | 358 | ||
294 | if ((gpio_request(OVERO_GPIO_W2W_NRESET, | 359 | if ((gpio_request(OVERO_GPIO_W2W_NRESET, |
295 | "OVERO_GPIO_W2W_NRESET") == 0) && | 360 | "OVERO_GPIO_W2W_NRESET") == 0) && |
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index d6766685cfc7..9ab947c14f26 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/clocksource.h> | 28 | #include <linux/clocksource.h> |
29 | #include <linux/clockchips.h> | 29 | #include <linux/clockchips.h> |
30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
31 | #include <linux/smc911x.h> | 31 | #include <linux/smsc911x.h> |
32 | #include <linux/ata_platform.h> | 32 | #include <linux/ata_platform.h> |
33 | 33 | ||
34 | #include <asm/clkdev.h> | 34 | #include <asm/clkdev.h> |
@@ -128,14 +128,15 @@ int realview_flash_register(struct resource *res, u32 num) | |||
128 | return platform_device_register(&realview_flash_device); | 128 | return platform_device_register(&realview_flash_device); |
129 | } | 129 | } |
130 | 130 | ||
131 | static struct smc911x_platdata realview_smc911x_platdata = { | 131 | static struct smsc911x_platform_config smsc911x_config = { |
132 | .flags = SMC911X_USE_32BIT, | 132 | .flags = SMSC911X_USE_32BIT, |
133 | .irq_flags = IRQF_SHARED, | 133 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, |
134 | .irq_polarity = 1, | 134 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
135 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
135 | }; | 136 | }; |
136 | 137 | ||
137 | static struct platform_device realview_eth_device = { | 138 | static struct platform_device realview_eth_device = { |
138 | .name = "smc911x", | 139 | .name = "smsc911x", |
139 | .id = 0, | 140 | .id = 0, |
140 | .num_resources = 2, | 141 | .num_resources = 2, |
141 | }; | 142 | }; |
@@ -145,8 +146,8 @@ int realview_eth_register(const char *name, struct resource *res) | |||
145 | if (name) | 146 | if (name) |
146 | realview_eth_device.name = name; | 147 | realview_eth_device.name = name; |
147 | realview_eth_device.resource = res; | 148 | realview_eth_device.resource = res; |
148 | if (strcmp(realview_eth_device.name, "smc911x") == 0) | 149 | if (strcmp(realview_eth_device.name, "smsc911x") == 0) |
149 | realview_eth_device.dev.platform_data = &realview_smc911x_platdata; | 150 | realview_eth_device.dev.platform_data = &smsc911x_config; |
150 | 151 | ||
151 | return platform_device_register(&realview_eth_device); | 152 | return platform_device_register(&realview_eth_device); |
152 | } | 153 | } |
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c index 67d6d9cc68b2..d0d39adf6407 100644 --- a/arch/arm/mach-realview/localtimer.c +++ b/arch/arm/mach-realview/localtimer.c | |||
@@ -191,6 +191,7 @@ void __cpuinit local_timer_setup(void) | |||
191 | clk->name = "dummy_timer"; | 191 | clk->name = "dummy_timer"; |
192 | clk->features = CLOCK_EVT_FEAT_DUMMY; | 192 | clk->features = CLOCK_EVT_FEAT_DUMMY; |
193 | clk->rating = 200; | 193 | clk->rating = 200; |
194 | clk->mult = 1; | ||
194 | clk->set_mode = dummy_timer_set_mode; | 195 | clk->set_mode = dummy_timer_set_mode; |
195 | clk->broadcast = smp_timer_broadcast; | 196 | clk->broadcast = smp_timer_broadcast; |
196 | clk->cpumask = cpumask_of(cpu); | 197 | clk->cpumask = cpumask_of(cpu); |
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 94077fbd96b7..6f7e70907e44 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -29,10 +29,10 @@ ENTRY(v6_early_abort) | |||
29 | mrc p15, 0, r1, c5, c0, 0 @ get FSR | 29 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
30 | mrc p15, 0, r0, c6, c0, 0 @ get FAR | 30 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |
31 | /* | 31 | /* |
32 | * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR. | 32 | * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR (erratum 326103). |
33 | * The test below covers all the write situations, including Java bytecodes | 33 | * The test below covers all the write situations, including Java bytecodes |
34 | */ | 34 | */ |
35 | bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR | 35 | bic r1, r1, #1 << 11 @ clear bit 11 of FSR |
36 | tst r3, #PSR_J_BIT @ Java? | 36 | tst r3, #PSR_J_BIT @ Java? |
37 | movne pc, lr | 37 | movne pc, lr |
38 | do_thumb_abort | 38 | do_thumb_abort |
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c index d6dd83826f8a..6e77c042d8e9 100644 --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c | |||
@@ -115,6 +115,10 @@ static inline void l2_inv_pa_range(unsigned long start, unsigned long end) | |||
115 | raw_local_irq_restore(flags); | 115 | raw_local_irq_restore(flags); |
116 | } | 116 | } |
117 | 117 | ||
118 | static inline void l2_inv_all(void) | ||
119 | { | ||
120 | __asm__("mcr p15, 1, %0, c15, c11, 0" : : "r" (0)); | ||
121 | } | ||
118 | 122 | ||
119 | /* | 123 | /* |
120 | * Linux primitives. | 124 | * Linux primitives. |
@@ -254,9 +258,7 @@ static void __init enable_dcache(void) | |||
254 | 258 | ||
255 | static void __init __invalidate_icache(void) | 259 | static void __init __invalidate_icache(void) |
256 | { | 260 | { |
257 | int dummy; | 261 | __asm__("mcr p15, 0, %0, c7, c5, 0" : : "r" (0)); |
258 | |||
259 | __asm__ __volatile__("mcr p15, 0, %0, c7, c5, 0" : "=r" (dummy)); | ||
260 | } | 262 | } |
261 | 263 | ||
262 | static int __init invalidate_and_disable_icache(void) | 264 | static int __init invalidate_and_disable_icache(void) |
@@ -321,6 +323,7 @@ static void __init enable_l2(void) | |||
321 | 323 | ||
322 | d = flush_and_disable_dcache(); | 324 | d = flush_and_disable_dcache(); |
323 | i = invalidate_and_disable_icache(); | 325 | i = invalidate_and_disable_icache(); |
326 | l2_inv_all(); | ||
324 | write_extra_features(u | 0x00400000); | 327 | write_extra_features(u | 0x00400000); |
325 | if (i) | 328 | if (i) |
326 | enable_icache(); | 329 | enable_icache(); |
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S index ba592a9e6fb3..a2bed62aec21 100644 --- a/arch/arm/vfp/entry.S +++ b/arch/arm/vfp/entry.S | |||
@@ -15,13 +15,16 @@ | |||
15 | * r10 = thread_info structure | 15 | * r10 = thread_info structure |
16 | * lr = failure return | 16 | * lr = failure return |
17 | */ | 17 | */ |
18 | #include <linux/linkage.h> | 18 | #include <asm/thread_info.h> |
19 | #include <linux/init.h> | ||
20 | #include <asm/asm-offsets.h> | ||
21 | #include <asm/assembler.h> | ||
22 | #include <asm/vfpmacros.h> | 19 | #include <asm/vfpmacros.h> |
20 | #include "../kernel/entry-header.S" | ||
23 | 21 | ||
24 | ENTRY(do_vfp) | 22 | ENTRY(do_vfp) |
23 | #ifdef CONFIG_PREEMPT | ||
24 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | ||
25 | add r11, r4, #1 @ increment it | ||
26 | str r11, [r10, #TI_PREEMPT] | ||
27 | #endif | ||
25 | enable_irq | 28 | enable_irq |
26 | ldr r4, .LCvfp | 29 | ldr r4, .LCvfp |
27 | ldr r11, [r10, #TI_CPU] @ CPU number | 30 | ldr r11, [r10, #TI_CPU] @ CPU number |
@@ -30,6 +33,12 @@ ENTRY(do_vfp) | |||
30 | ENDPROC(do_vfp) | 33 | ENDPROC(do_vfp) |
31 | 34 | ||
32 | ENTRY(vfp_null_entry) | 35 | ENTRY(vfp_null_entry) |
36 | #ifdef CONFIG_PREEMPT | ||
37 | get_thread_info r10 | ||
38 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | ||
39 | sub r11, r4, #1 @ decrement it | ||
40 | str r11, [r10, #TI_PREEMPT] | ||
41 | #endif | ||
33 | mov pc, lr | 42 | mov pc, lr |
34 | ENDPROC(vfp_null_entry) | 43 | ENDPROC(vfp_null_entry) |
35 | 44 | ||
@@ -41,6 +50,12 @@ ENDPROC(vfp_null_entry) | |||
41 | 50 | ||
42 | __INIT | 51 | __INIT |
43 | ENTRY(vfp_testing_entry) | 52 | ENTRY(vfp_testing_entry) |
53 | #ifdef CONFIG_PREEMPT | ||
54 | get_thread_info r10 | ||
55 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | ||
56 | sub r11, r4, #1 @ decrement it | ||
57 | str r11, [r10, #TI_PREEMPT] | ||
58 | #endif | ||
44 | ldr r0, VFP_arch_address | 59 | ldr r0, VFP_arch_address |
45 | str r5, [r0] @ known non-zero value | 60 | str r5, [r0] @ known non-zero value |
46 | mov pc, r9 @ we have handled the fault | 61 | mov pc, r9 @ we have handled the fault |
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index a5a4e57763c3..83c4e384b16d 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S | |||
@@ -137,6 +137,12 @@ check_for_exception: | |||
137 | VFPFMXR FPEXC, r1 @ restore FPEXC last | 137 | VFPFMXR FPEXC, r1 @ restore FPEXC last |
138 | sub r2, r2, #4 | 138 | sub r2, r2, #4 |
139 | str r2, [sp, #S_PC] @ retry the instruction | 139 | str r2, [sp, #S_PC] @ retry the instruction |
140 | #ifdef CONFIG_PREEMPT | ||
141 | get_thread_info r10 | ||
142 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | ||
143 | sub r11, r4, #1 @ decrement it | ||
144 | str r11, [r10, #TI_PREEMPT] | ||
145 | #endif | ||
140 | mov pc, r9 @ we think we have handled things | 146 | mov pc, r9 @ we think we have handled things |
141 | 147 | ||
142 | 148 | ||
@@ -155,6 +161,12 @@ look_for_VFP_exceptions: | |||
155 | @ not recognised by VFP | 161 | @ not recognised by VFP |
156 | 162 | ||
157 | DBGSTR "not VFP" | 163 | DBGSTR "not VFP" |
164 | #ifdef CONFIG_PREEMPT | ||
165 | get_thread_info r10 | ||
166 | ldr r4, [r10, #TI_PREEMPT] @ get preempt count | ||
167 | sub r11, r4, #1 @ decrement it | ||
168 | str r11, [r10, #TI_PREEMPT] | ||
169 | #endif | ||
158 | mov pc, lr | 170 | mov pc, lr |
159 | 171 | ||
160 | process_exception: | 172 | process_exception: |
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 75457b30d813..01599c4ef726 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
@@ -266,7 +266,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) | |||
266 | * on VFP subarch 1. | 266 | * on VFP subarch 1. |
267 | */ | 267 | */ |
268 | vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr, regs); | 268 | vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr, regs); |
269 | return; | 269 | goto exit; |
270 | } | 270 | } |
271 | 271 | ||
272 | /* | 272 | /* |
@@ -297,7 +297,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) | |||
297 | * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1. | 297 | * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1. |
298 | */ | 298 | */ |
299 | if (fpexc ^ (FPEXC_EX | FPEXC_FP2V)) | 299 | if (fpexc ^ (FPEXC_EX | FPEXC_FP2V)) |
300 | return; | 300 | goto exit; |
301 | 301 | ||
302 | /* | 302 | /* |
303 | * The barrier() here prevents fpinst2 being read | 303 | * The barrier() here prevents fpinst2 being read |
@@ -310,6 +310,8 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) | |||
310 | exceptions = vfp_emulate_instruction(trigger, orig_fpscr, regs); | 310 | exceptions = vfp_emulate_instruction(trigger, orig_fpscr, regs); |
311 | if (exceptions) | 311 | if (exceptions) |
312 | vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs); | 312 | vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs); |
313 | exit: | ||
314 | preempt_enable(); | ||
313 | } | 315 | } |
314 | 316 | ||
315 | static void vfp_enable(void *unused) | 317 | static void vfp_enable(void *unused) |
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index 05fe3053dcae..35e3bd9858df 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig | |||
@@ -127,13 +127,13 @@ config BOARD_HAMMERHEAD | |||
127 | select CPU_AT32AP7000 | 127 | select CPU_AT32AP7000 |
128 | select USB_ARCH_HAS_HCD | 128 | select USB_ARCH_HAS_HCD |
129 | help | 129 | help |
130 | The Hammerhead platform is built around a AVR32 32-bit microcontroller from Atmel. | 130 | The Hammerhead platform is built around an AVR32 32-bit microcontroller from Atmel. |
131 | It offers versatile peripherals, such as ethernet, usb device, usb host etc. | 131 | It offers versatile peripherals, such as ethernet, usb device, usb host etc. |
132 | 132 | ||
133 | The board also incooperates a power supply and is a Power over Ethernet (PoE) Powered | 133 | The board also incorporates a power supply and is a Power over Ethernet (PoE) Powered |
134 | Device (PD). | 134 | Device (PD). |
135 | 135 | ||
136 | Additonally, a Cyclone III FPGA from Altera is integrated on the board. The FPGA is | 136 | Additionally, a Cyclone III FPGA from Altera is integrated on the board. The FPGA is |
137 | mapped into the 32-bit AVR memory bus. The FPGA offers two DDR2 SDRAM interfaces, which | 137 | mapped into the 32-bit AVR memory bus. The FPGA offers two DDR2 SDRAM interfaces, which |
138 | will cover even the most exceptional need of memory bandwidth. Together with the onboard | 138 | will cover even the most exceptional need of memory bandwidth. Together with the onboard |
139 | video decoder the board is ready for video processing. | 139 | video decoder the board is ready for video processing. |
@@ -144,6 +144,19 @@ config BOARD_FAVR_32 | |||
144 | bool "Favr-32 LCD-board" | 144 | bool "Favr-32 LCD-board" |
145 | select CPU_AT32AP7000 | 145 | select CPU_AT32AP7000 |
146 | 146 | ||
147 | config BOARD_MERISC | ||
148 | bool "Merisc board" | ||
149 | select CPU_AT32AP7000 | ||
150 | help | ||
151 | Merisc is the family name for a range of AVR32-based boards. | ||
152 | |||
153 | The boards are designed to be used in a man-machine | ||
154 | interfacing environment, utilizing a touch-based graphical | ||
155 | user interface. They host a vast range of I/O peripherals as | ||
156 | well as a large SDRAM & Flash memory bank. | ||
157 | |||
158 | For more information see: http://www.martinsson.se/merisc | ||
159 | |||
147 | config BOARD_MIMC200 | 160 | config BOARD_MIMC200 |
148 | bool "MIMC200 CPU board" | 161 | bool "MIMC200 CPU board" |
149 | select CPU_AT32AP7000 | 162 | select CPU_AT32AP7000 |
@@ -153,6 +166,7 @@ source "arch/avr32/boards/atstk1000/Kconfig" | |||
153 | source "arch/avr32/boards/atngw100/Kconfig" | 166 | source "arch/avr32/boards/atngw100/Kconfig" |
154 | source "arch/avr32/boards/hammerhead/Kconfig" | 167 | source "arch/avr32/boards/hammerhead/Kconfig" |
155 | source "arch/avr32/boards/favr-32/Kconfig" | 168 | source "arch/avr32/boards/favr-32/Kconfig" |
169 | source "arch/avr32/boards/merisc/Kconfig" | ||
156 | 170 | ||
157 | choice | 171 | choice |
158 | prompt "Boot loader type" | 172 | prompt "Boot loader type" |
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile index f3ef3bbf797c..0b97e14f73f6 100644 --- a/arch/avr32/Makefile +++ b/arch/avr32/Makefile | |||
@@ -35,6 +35,7 @@ core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/ | |||
35 | core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/ | 35 | core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/ |
36 | core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/ | 36 | core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/ |
37 | core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/ | 37 | core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/ |
38 | core-$(CONFIG_BOARD_MERISC) += arch/avr32/boards/merisc/ | ||
38 | core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/ | 39 | core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/ |
39 | core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ | 40 | core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ |
40 | core-y += arch/avr32/kernel/ | 41 | core-y += arch/avr32/kernel/ |
diff --git a/arch/avr32/boards/atngw100/evklcd10x.c b/arch/avr32/boards/atngw100/evklcd10x.c index 8140b22b3461..00337112c5ac 100644 --- a/arch/avr32/boards/atngw100/evklcd10x.c +++ b/arch/avr32/boards/atngw100/evklcd10x.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <linux/gpio.h> | ||
14 | #include <linux/fb.h> | 15 | #include <linux/fb.h> |
15 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
16 | 17 | ||
@@ -19,26 +20,26 @@ | |||
19 | #include <asm/setup.h> | 20 | #include <asm/setup.h> |
20 | 21 | ||
21 | #include <mach/at32ap700x.h> | 22 | #include <mach/at32ap700x.h> |
23 | #include <mach/portmux.h> | ||
22 | #include <mach/board.h> | 24 | #include <mach/board.h> |
23 | 25 | ||
26 | #include <sound/atmel-ac97c.h> | ||
27 | |||
24 | static struct ac97c_platform_data __initdata ac97c0_data = { | 28 | static struct ac97c_platform_data __initdata ac97c0_data = { |
25 | .dma_rx_periph_id = 3, | 29 | .reset_pin = GPIO_PIN_PB(19), |
26 | .dma_tx_periph_id = 4, | ||
27 | .dma_controller_id = 0, | ||
28 | .reset_pin = GPIO_PIN_PB(19), | ||
29 | }; | 30 | }; |
30 | 31 | ||
31 | #ifdef CONFIG_BOARD_ATNGW100_EVKLCD10X_VGA | 32 | #ifdef CONFIG_BOARD_ATNGW100_EVKLCD10X_VGA |
32 | static struct fb_videomode __initdata tcg057vglad_modes[] = { | 33 | static struct fb_videomode __initdata tcg057vglad_modes[] = { |
33 | { | 34 | { |
34 | .name = "640x480 @ 60", | 35 | .name = "640x480 @ 50", |
35 | .refresh = 60, | 36 | .refresh = 50, |
36 | .xres = 640, .yres = 480, | 37 | .xres = 640, .yres = 480, |
37 | .pixclock = KHZ2PICOS(25180), | 38 | .pixclock = KHZ2PICOS(25180), |
38 | 39 | ||
39 | .left_margin = 64, .right_margin = 31, | 40 | .left_margin = 64, .right_margin = 96, |
40 | .upper_margin = 34, .lower_margin = 2, | 41 | .upper_margin = 34, .lower_margin = 11, |
41 | .hsync_len = 96, .vsync_len = 4, | 42 | .hsync_len = 64, .vsync_len = 15, |
42 | 43 | ||
43 | .sync = 0, | 44 | .sync = 0, |
44 | .vmode = FB_VMODE_NONINTERLACED, | 45 | .vmode = FB_VMODE_NONINTERLACED, |
@@ -69,14 +70,14 @@ static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { | |||
69 | #elif CONFIG_BOARD_ATNGW100_EVKLCD10X_QVGA | 70 | #elif CONFIG_BOARD_ATNGW100_EVKLCD10X_QVGA |
70 | static struct fb_videomode __initdata tcg057qvlad_modes[] = { | 71 | static struct fb_videomode __initdata tcg057qvlad_modes[] = { |
71 | { | 72 | { |
72 | .name = "320x240 @ 60", | 73 | .name = "320x240 @ 50", |
73 | .refresh = 60, | 74 | .refresh = 50, |
74 | .xres = 320, .yres = 240, | 75 | .xres = 320, .yres = 240, |
75 | .pixclock = KHZ2PICOS(6300), | 76 | .pixclock = KHZ2PICOS(6300), |
76 | 77 | ||
77 | .left_margin = 52, .right_margin = 28, | 78 | .left_margin = 34, .right_margin = 46, |
78 | .upper_margin = 7, .lower_margin = 2, | 79 | .upper_margin = 7, .lower_margin = 15, |
79 | .hsync_len = 96, .vsync_len = 4, | 80 | .hsync_len = 64, .vsync_len = 12, |
80 | 81 | ||
81 | .sync = 0, | 82 | .sync = 0, |
82 | .vmode = FB_VMODE_NONINTERLACED, | 83 | .vmode = FB_VMODE_NONINTERLACED, |
@@ -144,12 +145,29 @@ static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { | |||
144 | }; | 145 | }; |
145 | #endif | 146 | #endif |
146 | 147 | ||
148 | static void atevklcd10x_lcdc_power_control(int on) | ||
149 | { | ||
150 | gpio_set_value(GPIO_PIN_PB(15), on); | ||
151 | } | ||
152 | |||
147 | static int __init atevklcd10x_init(void) | 153 | static int __init atevklcd10x_init(void) |
148 | { | 154 | { |
149 | at32_add_device_ac97c(0, &ac97c0_data); | 155 | /* PB15 is connected to the enable line on the boost regulator |
156 | * controlling the backlight for the LCD panel. | ||
157 | */ | ||
158 | at32_select_gpio(GPIO_PIN_PB(15), AT32_GPIOF_OUTPUT); | ||
159 | gpio_request(GPIO_PIN_PB(15), "backlight"); | ||
160 | gpio_direction_output(GPIO_PIN_PB(15), 0); | ||
161 | |||
162 | atevklcd10x_lcdc_data.atmel_lcdfb_power_control = | ||
163 | atevklcd10x_lcdc_power_control; | ||
150 | 164 | ||
151 | at32_add_device_lcdc(0, &atevklcd10x_lcdc_data, | 165 | at32_add_device_lcdc(0, &atevklcd10x_lcdc_data, |
152 | fbmem_start, fbmem_size, 1); | 166 | fbmem_start, fbmem_size, |
167 | ATMEL_LCDC_ALT_18BIT | ATMEL_LCDC_PE_DVAL); | ||
168 | |||
169 | at32_add_device_ac97c(0, &ac97c0_data, AC97C_BOTH); | ||
170 | |||
153 | return 0; | 171 | return 0; |
154 | } | 172 | } |
155 | postcore_initcall(atevklcd10x_init); | 173 | postcore_initcall(atevklcd10x_init); |
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index 05d3722fff18..5b022aad4bd9 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c | |||
@@ -56,13 +56,8 @@ static struct spi_board_info spi0_board_info[] __initdata = { | |||
56 | static struct mci_platform_data __initdata mci0_data = { | 56 | static struct mci_platform_data __initdata mci0_data = { |
57 | .slot[0] = { | 57 | .slot[0] = { |
58 | .bus_width = 4, | 58 | .bus_width = 4, |
59 | #ifndef CONFIG_BOARD_ATNGW100_EVKLCD10X | ||
60 | .detect_pin = GPIO_PIN_PC(25), | 59 | .detect_pin = GPIO_PIN_PC(25), |
61 | .wp_pin = GPIO_PIN_PE(0), | 60 | .wp_pin = GPIO_PIN_PE(0), |
62 | #else | ||
63 | .detect_pin = GPIO_PIN_NONE, | ||
64 | .wp_pin = GPIO_PIN_NONE, | ||
65 | #endif | ||
66 | }, | 61 | }, |
67 | }; | 62 | }; |
68 | 63 | ||
@@ -123,7 +118,7 @@ static void __init set_hw_addr(struct platform_device *pdev) | |||
123 | 118 | ||
124 | void __init setup_board(void) | 119 | void __init setup_board(void) |
125 | { | 120 | { |
126 | at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */ | 121 | at32_map_usart(1, 0, 0); /* USART 1: /dev/ttyS0, DB9 */ |
127 | at32_setup_serial_console(0); | 122 | at32_setup_serial_console(0); |
128 | } | 123 | } |
129 | 124 | ||
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 1f33a106905c..2adc261c9e3d 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -252,12 +252,12 @@ static void __init atstk1002_setup_extdac(void) | |||
252 | void __init setup_board(void) | 252 | void __init setup_board(void) |
253 | { | 253 | { |
254 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | 254 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
255 | at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ | 255 | at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */ |
256 | #else | 256 | #else |
257 | at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ | 257 | at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */ |
258 | #endif | 258 | #endif |
259 | /* USART 2/unused: expansion connector */ | 259 | /* USART 2/unused: expansion connector */ |
260 | at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ | 260 | at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */ |
261 | 261 | ||
262 | at32_setup_serial_console(0); | 262 | at32_setup_serial_console(0); |
263 | } | 263 | } |
diff --git a/arch/avr32/boards/atstk1000/atstk1003.c b/arch/avr32/boards/atstk1000/atstk1003.c index b3a23c88bcfe..ff7e23298827 100644 --- a/arch/avr32/boards/atstk1000/atstk1003.c +++ b/arch/avr32/boards/atstk1000/atstk1003.c | |||
@@ -115,12 +115,12 @@ static void __init atstk1003_setup_extdac(void) | |||
115 | void __init setup_board(void) | 115 | void __init setup_board(void) |
116 | { | 116 | { |
117 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | 117 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
118 | at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ | 118 | at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */ |
119 | #else | 119 | #else |
120 | at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ | 120 | at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */ |
121 | #endif | 121 | #endif |
122 | /* USART 2/unused: expansion connector */ | 122 | /* USART 2/unused: expansion connector */ |
123 | at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ | 123 | at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */ |
124 | 124 | ||
125 | at32_setup_serial_console(0); | 125 | at32_setup_serial_console(0); |
126 | } | 126 | } |
diff --git a/arch/avr32/boards/atstk1000/atstk1004.c b/arch/avr32/boards/atstk1000/atstk1004.c index 29b35aca96cd..69a9f0f08c6e 100644 --- a/arch/avr32/boards/atstk1000/atstk1004.c +++ b/arch/avr32/boards/atstk1000/atstk1004.c | |||
@@ -120,12 +120,12 @@ static void __init atstk1004_setup_extdac(void) | |||
120 | void __init setup_board(void) | 120 | void __init setup_board(void) |
121 | { | 121 | { |
122 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | 122 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
123 | at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */ | 123 | at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */ |
124 | #else | 124 | #else |
125 | at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */ | 125 | at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */ |
126 | #endif | 126 | #endif |
127 | /* USART 2/unused: expansion connector */ | 127 | /* USART 2/unused: expansion connector */ |
128 | at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */ | 128 | at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */ |
129 | 129 | ||
130 | at32_setup_serial_console(0); | 130 | at32_setup_serial_console(0); |
131 | } | 131 | } |
diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c index 745c408c2ac5..46c9b0a224cf 100644 --- a/arch/avr32/boards/favr-32/setup.c +++ b/arch/avr32/boards/favr-32/setup.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
23 | #include <linux/spi/ads7846.h> | 23 | #include <linux/spi/ads7846.h> |
24 | 24 | ||
25 | #include <sound/atmel-abdac.h> | ||
26 | |||
25 | #include <video/atmel_lcdc.h> | 27 | #include <video/atmel_lcdc.h> |
26 | 28 | ||
27 | #include <asm/setup.h> | 29 | #include <asm/setup.h> |
@@ -41,6 +43,9 @@ unsigned long at32_board_osc_rates[3] = { | |||
41 | /* Initialized by bootloader-specific startup code. */ | 43 | /* Initialized by bootloader-specific startup code. */ |
42 | struct tag *bootloader_tags __initdata; | 44 | struct tag *bootloader_tags __initdata; |
43 | 45 | ||
46 | static struct atmel_abdac_pdata __initdata abdac0_data = { | ||
47 | }; | ||
48 | |||
44 | struct eth_addr { | 49 | struct eth_addr { |
45 | u8 addr[6]; | 50 | u8 addr[6]; |
46 | }; | 51 | }; |
@@ -245,7 +250,7 @@ static void __init favr32_setup_atmel_pwm_bl(void) | |||
245 | 250 | ||
246 | void __init setup_board(void) | 251 | void __init setup_board(void) |
247 | { | 252 | { |
248 | at32_map_usart(3, 0); /* USART 3 => /dev/ttyS0 */ | 253 | at32_map_usart(3, 0, 0); /* USART 3 => /dev/ttyS0 */ |
249 | at32_setup_serial_console(0); | 254 | at32_setup_serial_console(0); |
250 | } | 255 | } |
251 | 256 | ||
@@ -326,7 +331,7 @@ static int __init favr32_init(void) | |||
326 | 331 | ||
327 | spi1_board_info[0].irq = gpio_to_irq(GPIO_PIN_PB(3)); | 332 | spi1_board_info[0].irq = gpio_to_irq(GPIO_PIN_PB(3)); |
328 | 333 | ||
329 | set_abdac_rate(at32_add_device_abdac(0)); | 334 | set_abdac_rate(at32_add_device_abdac(0, &abdac0_data)); |
330 | 335 | ||
331 | at32_add_device_pwm(1 << atmel_pwm_bl_pdata.pwm_channel); | 336 | at32_add_device_pwm(1 << atmel_pwm_bl_pdata.pwm_channel); |
332 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | 337 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); |
diff --git a/arch/avr32/boards/hammerhead/setup.c b/arch/avr32/boards/hammerhead/setup.c index 4d2fe82b2029..dd009875a405 100644 --- a/arch/avr32/boards/hammerhead/setup.c +++ b/arch/avr32/boards/hammerhead/setup.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <mach/init.h> | 29 | #include <mach/init.h> |
30 | #include <mach/portmux.h> | 30 | #include <mach/portmux.h> |
31 | 31 | ||
32 | #include <sound/atmel-ac97c.h> | ||
33 | |||
32 | #include "../../mach-at32ap/clock.h" | 34 | #include "../../mach-at32ap/clock.h" |
33 | #include "flash.h" | 35 | #include "flash.h" |
34 | 36 | ||
@@ -163,7 +165,7 @@ static void __init set_hw_addr(struct platform_device *pdev) | |||
163 | 165 | ||
164 | void __init setup_board(void) | 166 | void __init setup_board(void) |
165 | { | 167 | { |
166 | at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */ | 168 | at32_map_usart(1, 0, 0); /* USART 1: /dev/ttyS0, DB9 */ |
167 | at32_setup_serial_console(0); | 169 | at32_setup_serial_console(0); |
168 | } | 170 | } |
169 | 171 | ||
@@ -233,7 +235,7 @@ static int __init hammerhead_init(void) | |||
233 | i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); | 235 | i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); |
234 | 236 | ||
235 | #ifdef CONFIG_BOARD_HAMMERHEAD_SND | 237 | #ifdef CONFIG_BOARD_HAMMERHEAD_SND |
236 | at32_add_device_ac97c(0, &ac97c_data); | 238 | at32_add_device_ac97c(0, &ac97c_data, AC97C_BOTH); |
237 | #endif | 239 | #endif |
238 | 240 | ||
239 | /* Select the Touchscreen interrupt pin mode */ | 241 | /* Select the Touchscreen interrupt pin mode */ |
diff --git a/arch/avr32/boards/merisc/Kconfig b/arch/avr32/boards/merisc/Kconfig new file mode 100644 index 000000000000..7e043275d5a9 --- /dev/null +++ b/arch/avr32/boards/merisc/Kconfig | |||
@@ -0,0 +1,5 @@ | |||
1 | # Merisc customization | ||
2 | |||
3 | if BOARD_MERISC | ||
4 | |||
5 | endif # BOARD_MERISC | ||
diff --git a/arch/avr32/boards/merisc/Makefile b/arch/avr32/boards/merisc/Makefile new file mode 100644 index 000000000000..d24c78729bd1 --- /dev/null +++ b/arch/avr32/boards/merisc/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-y += setup.o flash.o display.o merisc_sysfs.o | |||
diff --git a/arch/avr32/boards/merisc/display.c b/arch/avr32/boards/merisc/display.c new file mode 100644 index 000000000000..85a543cd4abc --- /dev/null +++ b/arch/avr32/boards/merisc/display.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * Display setup code for the Merisc board | ||
3 | * | ||
4 | * Copyright (C) 2008 Martinsson Elektronik AB | ||
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 | #include <linux/init.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/fb.h> | ||
13 | #include <video/atmel_lcdc.h> | ||
14 | #include <asm/setup.h> | ||
15 | #include <mach/board.h> | ||
16 | #include "merisc.h" | ||
17 | |||
18 | static struct fb_videomode merisc_fb_videomode[] = { | ||
19 | { | ||
20 | .refresh = 44, | ||
21 | .xres = 640, | ||
22 | .yres = 480, | ||
23 | .left_margin = 96, | ||
24 | .right_margin = 96, | ||
25 | .upper_margin = 34, | ||
26 | .lower_margin = 8, | ||
27 | .hsync_len = 64, | ||
28 | .vsync_len = 64, | ||
29 | .name = "640x480 @ 44", | ||
30 | .pixclock = KHZ2PICOS(25180), | ||
31 | .sync = 0, | ||
32 | .vmode = FB_VMODE_NONINTERLACED, | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | static struct fb_monspecs merisc_fb_monspecs = { | ||
37 | .manufacturer = "Kyo", | ||
38 | .monitor = "TCG075VG2AD", | ||
39 | .modedb = merisc_fb_videomode, | ||
40 | .modedb_len = ARRAY_SIZE(merisc_fb_videomode), | ||
41 | .hfmin = 30000, | ||
42 | .hfmax = 33333, | ||
43 | .vfmin = 60, | ||
44 | .vfmax = 90, | ||
45 | .dclkmax = 30000000, | ||
46 | }; | ||
47 | |||
48 | struct atmel_lcdfb_info merisc_lcdc_data = { | ||
49 | .default_bpp = 24, | ||
50 | .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, | ||
51 | .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT | ||
52 | | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE | ||
53 | | ATMEL_LCDC_MEMOR_BIG), | ||
54 | .default_monspecs = &merisc_fb_monspecs, | ||
55 | .guard_time = 2, | ||
56 | }; | ||
57 | |||
58 | static int __init merisc_display_init(void) | ||
59 | { | ||
60 | at32_add_device_lcdc(0, &merisc_lcdc_data, fbmem_start, | ||
61 | fbmem_size, 0); | ||
62 | |||
63 | return 0; | ||
64 | } | ||
65 | device_initcall(merisc_display_init); | ||
diff --git a/arch/avr32/boards/merisc/flash.c b/arch/avr32/boards/merisc/flash.c new file mode 100644 index 000000000000..8e856fd6f013 --- /dev/null +++ b/arch/avr32/boards/merisc/flash.c | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * Merisc board-specific flash initialization | ||
3 | * | ||
4 | * Copyright (C) 2008 Martinsson Elektronik AB | ||
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 | #include <linux/init.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/mtd/mtd.h> | ||
13 | #include <linux/mtd/partitions.h> | ||
14 | #include <linux/mtd/physmap.h> | ||
15 | #include <mach/smc.h> | ||
16 | |||
17 | /* Will be translated to units of 14.3 ns, rounded up */ | ||
18 | static struct smc_timing flash_timing __initdata = { | ||
19 | .ncs_read_setup = 1 * 14, | ||
20 | .nrd_setup = 5 * 14, | ||
21 | .ncs_write_setup = 1 * 14, | ||
22 | .nwe_setup = 2 * 14, | ||
23 | |||
24 | .ncs_read_pulse = 12 * 14, | ||
25 | .nrd_pulse = 7 * 14, | ||
26 | .ncs_write_pulse = 8 * 14, | ||
27 | .nwe_pulse = 4 * 14, | ||
28 | |||
29 | .read_cycle = 14 * 14, | ||
30 | .write_cycle = 10 * 14, | ||
31 | }; | ||
32 | |||
33 | static struct smc_config flash_config __initdata = { | ||
34 | .bus_width = 2, | ||
35 | .nrd_controlled = 1, | ||
36 | .nwe_controlled = 1, | ||
37 | .byte_write = 1, | ||
38 | .tdf_cycles = 3, | ||
39 | }; | ||
40 | |||
41 | static struct mtd_partition flash_0_parts[] = { | ||
42 | { | ||
43 | .name = "boot", | ||
44 | .offset = 0x00000000, | ||
45 | .size = 0x00060000, | ||
46 | .mask_flags = 0, | ||
47 | }, | ||
48 | { | ||
49 | .name = "kernel", | ||
50 | .offset = 0x00060000, | ||
51 | .size = 0x00200000, | ||
52 | .mask_flags = 0, | ||
53 | }, | ||
54 | { | ||
55 | .name = "root", | ||
56 | .offset = 0x00260000, | ||
57 | .size = MTDPART_SIZ_FULL, | ||
58 | .mask_flags = 0, | ||
59 | }, | ||
60 | }; | ||
61 | |||
62 | static struct mtd_partition flash_1_parts[] = { | ||
63 | { | ||
64 | .name = "2ndflash", | ||
65 | .offset = 0x00000000, | ||
66 | .size = MTDPART_SIZ_FULL, | ||
67 | .mask_flags = 0, | ||
68 | }, | ||
69 | }; | ||
70 | |||
71 | static struct physmap_flash_data flash_data[] = { | ||
72 | { | ||
73 | .width = 2, | ||
74 | .nr_parts = ARRAY_SIZE(flash_0_parts), | ||
75 | .parts = flash_0_parts, | ||
76 | }, | ||
77 | { | ||
78 | .width = 2, | ||
79 | .nr_parts = ARRAY_SIZE(flash_1_parts), | ||
80 | .parts = flash_1_parts, | ||
81 | } | ||
82 | }; | ||
83 | |||
84 | static struct resource flash_resource[] = { | ||
85 | { | ||
86 | .start = 0x00000000, | ||
87 | .end = 0x03ffffff, | ||
88 | .flags = IORESOURCE_MEM, | ||
89 | }, | ||
90 | { | ||
91 | .start = 0x04000000, | ||
92 | .end = 0x07ffffff, | ||
93 | .flags = IORESOURCE_MEM, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | static struct platform_device flash_device[] = { | ||
98 | { | ||
99 | .name = "physmap-flash", | ||
100 | .id = 0, | ||
101 | .resource = &flash_resource[0], | ||
102 | .num_resources = 1, | ||
103 | .dev = { | ||
104 | .platform_data = &flash_data[0], | ||
105 | }, | ||
106 | }, | ||
107 | { | ||
108 | .name = "physmap-flash", | ||
109 | .id = 1, | ||
110 | .resource = &flash_resource[1], | ||
111 | .num_resources = 1, | ||
112 | .dev = { | ||
113 | .platform_data = &flash_data[1], | ||
114 | }, | ||
115 | }, | ||
116 | }; | ||
117 | |||
118 | static int __init merisc_flash_init(void) | ||
119 | { | ||
120 | int ret; | ||
121 | smc_set_timing(&flash_config, &flash_timing); | ||
122 | |||
123 | ret = smc_set_configuration(0, &flash_config); | ||
124 | if (ret < 0) { | ||
125 | printk(KERN_ERR "Merisc: failed to set NOR flash timing #0\n"); | ||
126 | return ret; | ||
127 | } | ||
128 | |||
129 | ret = smc_set_configuration(4, &flash_config); | ||
130 | if (ret < 0) { | ||
131 | printk(KERN_ERR "Merisc: failed to set NOR flash timing #1\n"); | ||
132 | return ret; | ||
133 | } | ||
134 | |||
135 | platform_device_register(&flash_device[0]); | ||
136 | platform_device_register(&flash_device[1]); | ||
137 | return 0; | ||
138 | } | ||
139 | device_initcall(merisc_flash_init); | ||
diff --git a/arch/avr32/boards/merisc/merisc.h b/arch/avr32/boards/merisc/merisc.h new file mode 100644 index 000000000000..50ffb2f3fcbf --- /dev/null +++ b/arch/avr32/boards/merisc/merisc.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Merisc exports | ||
3 | * | ||
4 | * Copyright (C) 2008 Martinsson Elektronik AB | ||
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 __ARCH_AVR32_BOARDS_MERISC_MERISC_H | ||
11 | #define __ARCH_AVR32_BOARDS_MERISC_MERISC_H | ||
12 | |||
13 | const char *merisc_revision(void); | ||
14 | const char *merisc_model(void); | ||
15 | |||
16 | extern struct class merisc_class; | ||
17 | |||
18 | #endif /* __ARCH_AVR32_BOARDS_MERISC_MERISC_H */ | ||
diff --git a/arch/avr32/boards/merisc/merisc_sysfs.c b/arch/avr32/boards/merisc/merisc_sysfs.c new file mode 100644 index 000000000000..df431fdba9ad --- /dev/null +++ b/arch/avr32/boards/merisc/merisc_sysfs.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * Merisc sysfs exports | ||
3 | * | ||
4 | * Copyright (C) 2008 Martinsson Elektronik AB | ||
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 | #include <linux/module.h> | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/list.h> | ||
14 | #include <linux/spinlock.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <linux/sysdev.h> | ||
17 | #include <linux/timer.h> | ||
18 | #include <linux/err.h> | ||
19 | #include <linux/ctype.h> | ||
20 | #include "merisc.h" | ||
21 | |||
22 | static ssize_t merisc_model_show(struct class *class, char *buf) | ||
23 | { | ||
24 | ssize_t ret = 0; | ||
25 | |||
26 | sprintf(buf, "%s\n", merisc_model()); | ||
27 | ret = strlen(buf) + 1; | ||
28 | |||
29 | return ret; | ||
30 | } | ||
31 | |||
32 | static ssize_t merisc_revision_show(struct class *class, char *buf) | ||
33 | { | ||
34 | ssize_t ret = 0; | ||
35 | |||
36 | sprintf(buf, "%s\n", merisc_revision()); | ||
37 | ret = strlen(buf) + 1; | ||
38 | |||
39 | return ret; | ||
40 | } | ||
41 | |||
42 | static struct class_attribute merisc_class_attrs[] = { | ||
43 | __ATTR(model, S_IRUGO, merisc_model_show, NULL), | ||
44 | __ATTR(revision, S_IRUGO, merisc_revision_show, NULL), | ||
45 | __ATTR_NULL, | ||
46 | }; | ||
47 | |||
48 | struct class merisc_class = { | ||
49 | .name = "merisc", | ||
50 | .owner = THIS_MODULE, | ||
51 | .class_attrs = merisc_class_attrs, | ||
52 | }; | ||
53 | |||
54 | static int __init merisc_sysfs_init(void) | ||
55 | { | ||
56 | int status; | ||
57 | |||
58 | status = class_register(&merisc_class); | ||
59 | if (status < 0) | ||
60 | return status; | ||
61 | |||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | postcore_initcall(merisc_sysfs_init); | ||
diff --git a/arch/avr32/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c new file mode 100644 index 000000000000..20b300cf105a --- /dev/null +++ b/arch/avr32/boards/merisc/setup.c | |||
@@ -0,0 +1,297 @@ | |||
1 | /* | ||
2 | * Board-specific setup code for the Merisc | ||
3 | * | ||
4 | * Copyright (C) 2008 Martinsson Elektronik AB | ||
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 | #include <linux/clk.h> | ||
11 | #include <linux/etherdevice.h> | ||
12 | #include <linux/i2c.h> | ||
13 | #include <linux/i2c-gpio.h> | ||
14 | #include <linux/gpio.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/linkage.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <linux/leds.h> | ||
20 | #include <linux/spi/spi.h> | ||
21 | #include <linux/spi/ads7846.h> | ||
22 | #include <linux/irq.h> | ||
23 | #include <linux/fb.h> | ||
24 | #include <linux/atmel-mci.h> | ||
25 | |||
26 | #include <asm/io.h> | ||
27 | #include <asm/setup.h> | ||
28 | #include <asm/gpio.h> | ||
29 | |||
30 | #include <mach/at32ap700x.h> | ||
31 | #include <mach/board.h> | ||
32 | #include <mach/init.h> | ||
33 | #include <mach/portmux.h> | ||
34 | |||
35 | #include "merisc.h" | ||
36 | |||
37 | /* Holds the autodetected board model and revision */ | ||
38 | static int merisc_board_id; | ||
39 | |||
40 | /* Initialized by bootloader-specific startup code. */ | ||
41 | struct tag *bootloader_tags __initdata; | ||
42 | |||
43 | /* Oscillator frequencies. These are board specific */ | ||
44 | unsigned long at32_board_osc_rates[3] = { | ||
45 | [0] = 32768, /* 32.768 kHz on RTC osc */ | ||
46 | [1] = 20000000, /* 20 MHz on osc0 */ | ||
47 | [2] = 12000000, /* 12 MHz on osc1 */ | ||
48 | }; | ||
49 | |||
50 | struct eth_addr { | ||
51 | u8 addr[6]; | ||
52 | }; | ||
53 | |||
54 | static struct eth_addr __initdata hw_addr[2]; | ||
55 | static struct eth_platform_data __initdata eth_data[2]; | ||
56 | |||
57 | static int ads7846_get_pendown_state_PB26(void) | ||
58 | { | ||
59 | return !gpio_get_value(GPIO_PIN_PB(26)); | ||
60 | } | ||
61 | |||
62 | static int ads7846_get_pendown_state_PB28(void) | ||
63 | { | ||
64 | return !gpio_get_value(GPIO_PIN_PB(28)); | ||
65 | } | ||
66 | |||
67 | static struct ads7846_platform_data __initdata ads7846_data = { | ||
68 | .model = 7846, | ||
69 | .vref_delay_usecs = 100, | ||
70 | .vref_mv = 0, | ||
71 | .keep_vref_on = 0, | ||
72 | .settle_delay_usecs = 150, | ||
73 | .penirq_recheck_delay_usecs = 1, | ||
74 | .x_plate_ohms = 800, | ||
75 | .debounce_rep = 4, | ||
76 | .debounce_max = 10, | ||
77 | .debounce_tol = 50, | ||
78 | .get_pendown_state = ads7846_get_pendown_state_PB26, | ||
79 | .filter_init = NULL, | ||
80 | .filter = NULL, | ||
81 | .filter_cleanup = NULL, | ||
82 | }; | ||
83 | |||
84 | static struct spi_board_info __initdata spi0_board_info[] = { | ||
85 | { | ||
86 | .modalias = "ads7846", | ||
87 | .max_speed_hz = 3250000, | ||
88 | .chip_select = 0, | ||
89 | .bus_num = 0, | ||
90 | .platform_data = &ads7846_data, | ||
91 | .mode = SPI_MODE_0, | ||
92 | }, | ||
93 | }; | ||
94 | |||
95 | static struct mci_platform_data __initdata mci0_data = { | ||
96 | .slot[0] = { | ||
97 | .bus_width = 4, | ||
98 | .detect_pin = GPIO_PIN_PE(19), | ||
99 | .wp_pin = GPIO_PIN_PE(20), | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | static int __init parse_tag_ethernet(struct tag *tag) | ||
104 | { | ||
105 | int i; | ||
106 | |||
107 | i = tag->u.ethernet.mac_index; | ||
108 | if (i < ARRAY_SIZE(hw_addr)) { | ||
109 | memcpy(hw_addr[i].addr, tag->u.ethernet.hw_address, | ||
110 | sizeof(hw_addr[i].addr)); | ||
111 | } | ||
112 | |||
113 | return 0; | ||
114 | } | ||
115 | __tagtable(ATAG_ETHERNET, parse_tag_ethernet); | ||
116 | |||
117 | static void __init set_hw_addr(struct platform_device *pdev) | ||
118 | { | ||
119 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
120 | const u8 *addr; | ||
121 | void __iomem *regs; | ||
122 | struct clk *pclk; | ||
123 | |||
124 | if (!res) | ||
125 | return; | ||
126 | |||
127 | if (pdev->id >= ARRAY_SIZE(hw_addr)) | ||
128 | return; | ||
129 | |||
130 | addr = hw_addr[pdev->id].addr; | ||
131 | if (!is_valid_ether_addr(addr)) | ||
132 | return; | ||
133 | |||
134 | regs = (void __iomem __force *)res->start; | ||
135 | pclk = clk_get(&pdev->dev, "pclk"); | ||
136 | if (!pclk) | ||
137 | return; | ||
138 | |||
139 | clk_enable(pclk); | ||
140 | __raw_writel((addr[3] << 24) | (addr[2] << 16) | ||
141 | | (addr[1] << 8) | addr[0], regs + 0x98); | ||
142 | __raw_writel((addr[5] << 8) | addr[4], regs + 0x9c); | ||
143 | clk_disable(pclk); | ||
144 | clk_put(pclk); | ||
145 | } | ||
146 | |||
147 | static struct i2c_gpio_platform_data i2c_gpio_data = { | ||
148 | .sda_pin = GPIO_PIN_PA(6), | ||
149 | .scl_pin = GPIO_PIN_PA(7), | ||
150 | .sda_is_open_drain = 1, | ||
151 | .scl_is_open_drain = 1, | ||
152 | .udelay = 2, | ||
153 | }; | ||
154 | |||
155 | static struct platform_device i2c_gpio_device = { | ||
156 | .name = "i2c-gpio", | ||
157 | .id = 0, | ||
158 | .dev = { | ||
159 | .platform_data = &i2c_gpio_data, | ||
160 | }, | ||
161 | }; | ||
162 | |||
163 | static struct i2c_board_info __initdata i2c_info[] = { | ||
164 | { | ||
165 | I2C_BOARD_INFO("pcf8563", 0x51) | ||
166 | }, | ||
167 | }; | ||
168 | |||
169 | #ifdef CONFIG_LEDS_ATMEL_PWM | ||
170 | static struct gpio_led stk_pwm_led[] = { | ||
171 | { | ||
172 | .name = "backlight", | ||
173 | .gpio = 0, /* PWM channel 0 (LCD backlight) */ | ||
174 | }, | ||
175 | }; | ||
176 | |||
177 | static struct gpio_led_platform_data stk_pwm_led_data = { | ||
178 | .num_leds = ARRAY_SIZE(stk_pwm_led), | ||
179 | .leds = stk_pwm_led, | ||
180 | }; | ||
181 | |||
182 | static struct platform_device stk_pwm_led_dev = { | ||
183 | .name = "leds-atmel-pwm", | ||
184 | .id = -1, | ||
185 | .dev = { | ||
186 | .platform_data = &stk_pwm_led_data, | ||
187 | }, | ||
188 | }; | ||
189 | #endif | ||
190 | |||
191 | const char *merisc_model(void) | ||
192 | { | ||
193 | switch (merisc_board_id) { | ||
194 | case 0: | ||
195 | case 1: | ||
196 | return "500-01"; | ||
197 | case 2: | ||
198 | return "BT"; | ||
199 | default: | ||
200 | return "Unknown"; | ||
201 | } | ||
202 | } | ||
203 | |||
204 | const char *merisc_revision(void) | ||
205 | { | ||
206 | switch (merisc_board_id) { | ||
207 | case 0: | ||
208 | return "B"; | ||
209 | case 1: | ||
210 | return "D"; | ||
211 | case 2: | ||
212 | return "A"; | ||
213 | default: | ||
214 | return "Unknown"; | ||
215 | } | ||
216 | } | ||
217 | |||
218 | static void detect_merisc_board_id(void) | ||
219 | { | ||
220 | /* Board ID pins MUST be set as input or the board may be damaged */ | ||
221 | at32_select_gpio(GPIO_PIN_PA(24), AT32_GPIOF_PULLUP); | ||
222 | at32_select_gpio(GPIO_PIN_PA(25), AT32_GPIOF_PULLUP); | ||
223 | at32_select_gpio(GPIO_PIN_PA(26), AT32_GPIOF_PULLUP); | ||
224 | at32_select_gpio(GPIO_PIN_PA(27), AT32_GPIOF_PULLUP); | ||
225 | |||
226 | merisc_board_id = !gpio_get_value(GPIO_PIN_PA(24)) + | ||
227 | !gpio_get_value(GPIO_PIN_PA(25)) * 2 + | ||
228 | !gpio_get_value(GPIO_PIN_PA(26)) * 4 + | ||
229 | !gpio_get_value(GPIO_PIN_PA(27)) * 8; | ||
230 | } | ||
231 | |||
232 | void __init setup_board(void) | ||
233 | { | ||
234 | at32_map_usart(0, 0, 0); | ||
235 | at32_map_usart(1, 1, 0); | ||
236 | at32_map_usart(3, 3, 0); | ||
237 | at32_setup_serial_console(1); | ||
238 | } | ||
239 | |||
240 | static int __init merisc_init(void) | ||
241 | { | ||
242 | detect_merisc_board_id(); | ||
243 | |||
244 | printk(KERN_NOTICE "BOARD: Merisc %s revision %s\n", merisc_model(), | ||
245 | merisc_revision()); | ||
246 | |||
247 | /* Reserve pins for SDRAM */ | ||
248 | at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL | (1 << 26)); | ||
249 | |||
250 | if (merisc_board_id >= 1) | ||
251 | at32_map_usart(2, 2, 0); | ||
252 | |||
253 | at32_add_device_usart(0); | ||
254 | at32_add_device_usart(1); | ||
255 | if (merisc_board_id >= 1) | ||
256 | at32_add_device_usart(2); | ||
257 | at32_add_device_usart(3); | ||
258 | set_hw_addr(at32_add_device_eth(0, ð_data[0])); | ||
259 | |||
260 | /* ADS7846 PENIRQ */ | ||
261 | if (merisc_board_id == 0) { | ||
262 | ads7846_data.get_pendown_state = ads7846_get_pendown_state_PB26; | ||
263 | at32_select_periph(GPIO_PIOB_BASE, 1 << 26, | ||
264 | GPIO_PERIPH_A, AT32_GPIOF_PULLUP); | ||
265 | spi0_board_info[0].irq = AT32_EXTINT(1); | ||
266 | } else { | ||
267 | ads7846_data.get_pendown_state = ads7846_get_pendown_state_PB28; | ||
268 | at32_select_periph(GPIO_PIOB_BASE, 1 << 28, GPIO_PERIPH_A, | ||
269 | AT32_GPIOF_PULLUP); | ||
270 | spi0_board_info[0].irq = AT32_EXTINT(3); | ||
271 | } | ||
272 | |||
273 | /* ADS7846 busy pin */ | ||
274 | at32_select_gpio(GPIO_PIN_PA(4), AT32_GPIOF_PULLUP); | ||
275 | |||
276 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); | ||
277 | |||
278 | at32_add_device_mci(0, &mci0_data); | ||
279 | |||
280 | #ifdef CONFIG_LEDS_ATMEL_PWM | ||
281 | at32_add_device_pwm((1 << 0) | (1 << 2)); | ||
282 | platform_device_register(&stk_pwm_led_dev); | ||
283 | #else | ||
284 | at32_add_device_pwm((1 << 2)); | ||
285 | #endif | ||
286 | |||
287 | at32_select_gpio(i2c_gpio_data.sda_pin, | ||
288 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); | ||
289 | at32_select_gpio(i2c_gpio_data.scl_pin, | ||
290 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); | ||
291 | platform_device_register(&i2c_gpio_device); | ||
292 | |||
293 | i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); | ||
294 | |||
295 | return 0; | ||
296 | } | ||
297 | postcore_initcall(merisc_init); | ||
diff --git a/arch/avr32/boards/mimc200/setup.c b/arch/avr32/boards/mimc200/setup.c index 2b58d61f0afc..c1b2175b4fea 100644 --- a/arch/avr32/boards/mimc200/setup.c +++ b/arch/avr32/boards/mimc200/setup.c | |||
@@ -175,10 +175,10 @@ static void __init set_hw_addr(struct platform_device *pdev) | |||
175 | 175 | ||
176 | void __init setup_board(void) | 176 | void __init setup_board(void) |
177 | { | 177 | { |
178 | at32_map_usart(0, 0); /* USART 0: /dev/ttyS0 (TTL --> Altera) */ | 178 | at32_map_usart(0, 0, 0); /* USART 0: /dev/ttyS0 (TTL --> Altera) */ |
179 | at32_map_usart(1, 1); /* USART 1: /dev/ttyS1 (RS232) */ | 179 | at32_map_usart(1, 1, 0); /* USART 1: /dev/ttyS1 (RS232) */ |
180 | at32_map_usart(2, 2); /* USART 2: /dev/ttyS2 (RS485) */ | 180 | at32_map_usart(2, 2, 0); /* USART 2: /dev/ttyS2 (RS485) */ |
181 | at32_map_usart(3, 3); /* USART 3: /dev/ttyS3 (RS422 Multidrop) */ | 181 | at32_map_usart(3, 3, 0); /* USART 3: /dev/ttyS3 (RS422 Multidrop) */ |
182 | } | 182 | } |
183 | 183 | ||
184 | static struct i2c_gpio_platform_data i2c_gpio_data = { | 184 | static struct i2c_gpio_platform_data i2c_gpio_data = { |
diff --git a/arch/avr32/configs/merisc_defconfig b/arch/avr32/configs/merisc_defconfig new file mode 100644 index 000000000000..41554db4877f --- /dev/null +++ b/arch/avr32/configs/merisc_defconfig | |||
@@ -0,0 +1,1237 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.29-rc1 | ||
4 | # Wed Mar 25 14:06:15 2009 | ||
5 | # | ||
6 | CONFIG_AVR32=y | ||
7 | CONFIG_GENERIC_GPIO=y | ||
8 | CONFIG_GENERIC_HARDIRQS=y | ||
9 | CONFIG_STACKTRACE_SUPPORT=y | ||
10 | CONFIG_LOCKDEP_SUPPORT=y | ||
11 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
12 | CONFIG_HARDIRQS_SW_RESEND=y | ||
13 | CONFIG_GENERIC_IRQ_PROBE=y | ||
14 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
15 | CONFIG_GENERIC_TIME=y | ||
16 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
17 | # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set | ||
18 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | ||
19 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | ||
20 | CONFIG_GENERIC_HWEIGHT=y | ||
21 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
22 | CONFIG_GENERIC_BUG=y | ||
23 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
24 | |||
25 | # | ||
26 | # General setup | ||
27 | # | ||
28 | CONFIG_EXPERIMENTAL=y | ||
29 | CONFIG_BROKEN_ON_SMP=y | ||
30 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
31 | CONFIG_LOCALVERSION="" | ||
32 | # CONFIG_LOCALVERSION_AUTO is not set | ||
33 | CONFIG_SWAP=y | ||
34 | CONFIG_SYSVIPC=y | ||
35 | CONFIG_SYSVIPC_SYSCTL=y | ||
36 | CONFIG_POSIX_MQUEUE=y | ||
37 | CONFIG_BSD_PROCESS_ACCT=y | ||
38 | CONFIG_BSD_PROCESS_ACCT_V3=y | ||
39 | # CONFIG_TASKSTATS is not set | ||
40 | # CONFIG_AUDIT is not set | ||
41 | # CONFIG_IKCONFIG is not set | ||
42 | CONFIG_LOG_BUF_SHIFT=14 | ||
43 | CONFIG_GROUP_SCHED=y | ||
44 | CONFIG_FAIR_GROUP_SCHED=y | ||
45 | # CONFIG_RT_GROUP_SCHED is not set | ||
46 | CONFIG_USER_SCHED=y | ||
47 | # CONFIG_CGROUP_SCHED is not set | ||
48 | # CONFIG_CGROUPS is not set | ||
49 | CONFIG_SYSFS_DEPRECATED=y | ||
50 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
51 | # CONFIG_RELAY is not set | ||
52 | # CONFIG_NAMESPACES is not set | ||
53 | CONFIG_BLK_DEV_INITRD=y | ||
54 | CONFIG_INITRAMFS_SOURCE="" | ||
55 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
56 | CONFIG_SYSCTL=y | ||
57 | CONFIG_EMBEDDED=y | ||
58 | # CONFIG_SYSCTL_SYSCALL is not set | ||
59 | CONFIG_KALLSYMS=y | ||
60 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
61 | CONFIG_HOTPLUG=y | ||
62 | CONFIG_PRINTK=y | ||
63 | CONFIG_BUG=y | ||
64 | CONFIG_ELF_CORE=y | ||
65 | CONFIG_COMPAT_BRK=y | ||
66 | # CONFIG_BASE_FULL is not set | ||
67 | CONFIG_FUTEX=y | ||
68 | CONFIG_ANON_INODES=y | ||
69 | CONFIG_EPOLL=y | ||
70 | CONFIG_SIGNALFD=y | ||
71 | CONFIG_TIMERFD=y | ||
72 | CONFIG_EVENTFD=y | ||
73 | CONFIG_SHMEM=y | ||
74 | CONFIG_AIO=y | ||
75 | CONFIG_VM_EVENT_COUNTERS=y | ||
76 | CONFIG_SLUB_DEBUG=y | ||
77 | # CONFIG_SLAB is not set | ||
78 | CONFIG_SLUB=y | ||
79 | # CONFIG_SLOB is not set | ||
80 | # CONFIG_PROFILING is not set | ||
81 | CONFIG_HAVE_OPROFILE=y | ||
82 | # CONFIG_KPROBES is not set | ||
83 | CONFIG_HAVE_KPROBES=y | ||
84 | CONFIG_HAVE_CLK=y | ||
85 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
86 | CONFIG_SLABINFO=y | ||
87 | CONFIG_RT_MUTEXES=y | ||
88 | CONFIG_BASE_SMALL=1 | ||
89 | CONFIG_MODULES=y | ||
90 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
91 | CONFIG_MODULE_UNLOAD=y | ||
92 | CONFIG_MODULE_FORCE_UNLOAD=y | ||
93 | # CONFIG_MODVERSIONS is not set | ||
94 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
95 | CONFIG_BLOCK=y | ||
96 | # CONFIG_LBD is not set | ||
97 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
98 | # CONFIG_BLK_DEV_BSG is not set | ||
99 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
100 | |||
101 | # | ||
102 | # IO Schedulers | ||
103 | # | ||
104 | CONFIG_IOSCHED_NOOP=y | ||
105 | # CONFIG_IOSCHED_AS is not set | ||
106 | # CONFIG_IOSCHED_DEADLINE is not set | ||
107 | CONFIG_IOSCHED_CFQ=y | ||
108 | # CONFIG_DEFAULT_AS is not set | ||
109 | # CONFIG_DEFAULT_DEADLINE is not set | ||
110 | CONFIG_DEFAULT_CFQ=y | ||
111 | # CONFIG_DEFAULT_NOOP is not set | ||
112 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
113 | CONFIG_CLASSIC_RCU=y | ||
114 | # CONFIG_TREE_RCU is not set | ||
115 | # CONFIG_PREEMPT_RCU is not set | ||
116 | # CONFIG_TREE_RCU_TRACE is not set | ||
117 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
118 | # CONFIG_FREEZER is not set | ||
119 | |||
120 | # | ||
121 | # System Type and features | ||
122 | # | ||
123 | CONFIG_TICK_ONESHOT=y | ||
124 | CONFIG_NO_HZ=y | ||
125 | CONFIG_HIGH_RES_TIMERS=y | ||
126 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
127 | CONFIG_SUBARCH_AVR32B=y | ||
128 | CONFIG_MMU=y | ||
129 | CONFIG_PERFORMANCE_COUNTERS=y | ||
130 | CONFIG_PLATFORM_AT32AP=y | ||
131 | CONFIG_CPU_AT32AP700X=y | ||
132 | CONFIG_CPU_AT32AP7000=y | ||
133 | # CONFIG_BOARD_ATSTK1000 is not set | ||
134 | # CONFIG_BOARD_ATNGW100 is not set | ||
135 | # CONFIG_BOARD_HAMMERHEAD is not set | ||
136 | # CONFIG_BOARD_FAVR_32 is not set | ||
137 | # CONFIG_BOARD_MIMC200 is not set | ||
138 | CONFIG_BOARD_MERISC=y | ||
139 | CONFIG_LOADER_U_BOOT=y | ||
140 | |||
141 | # | ||
142 | # Atmel AVR32 AP options | ||
143 | # | ||
144 | CONFIG_AP700X_32_BIT_SMC=y | ||
145 | # CONFIG_AP700X_16_BIT_SMC is not set | ||
146 | # CONFIG_AP700X_8_BIT_SMC is not set | ||
147 | CONFIG_LOAD_ADDRESS=0x10000000 | ||
148 | CONFIG_ENTRY_ADDRESS=0x90000000 | ||
149 | CONFIG_PHYS_OFFSET=0x10000000 | ||
150 | CONFIG_PREEMPT_NONE=y | ||
151 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
152 | # CONFIG_PREEMPT is not set | ||
153 | CONFIG_QUICKLIST=y | ||
154 | # CONFIG_HAVE_ARCH_BOOTMEM_NODE is not set | ||
155 | # CONFIG_ARCH_HAVE_MEMORY_PRESENT is not set | ||
156 | # CONFIG_NEED_NODE_MEMMAP_SIZE is not set | ||
157 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
158 | # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set | ||
159 | # CONFIG_ARCH_SPARSEMEM_ENABLE is not set | ||
160 | CONFIG_SELECT_MEMORY_MODEL=y | ||
161 | CONFIG_FLATMEM_MANUAL=y | ||
162 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
163 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
164 | CONFIG_FLATMEM=y | ||
165 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
166 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
167 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
168 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
169 | CONFIG_ZONE_DMA_FLAG=0 | ||
170 | CONFIG_NR_QUICK=2 | ||
171 | CONFIG_VIRT_TO_BUS=y | ||
172 | CONFIG_UNEVICTABLE_LRU=y | ||
173 | # CONFIG_OWNERSHIP_TRACE is not set | ||
174 | # CONFIG_NMI_DEBUGGING is not set | ||
175 | # CONFIG_HZ_100 is not set | ||
176 | CONFIG_HZ_250=y | ||
177 | # CONFIG_HZ_300 is not set | ||
178 | # CONFIG_HZ_1000 is not set | ||
179 | CONFIG_HZ=250 | ||
180 | CONFIG_SCHED_HRTICK=y | ||
181 | CONFIG_CMDLINE="" | ||
182 | |||
183 | # | ||
184 | # Power management options | ||
185 | # | ||
186 | # CONFIG_PM is not set | ||
187 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
188 | |||
189 | # | ||
190 | # CPU Frequency scaling | ||
191 | # | ||
192 | # CONFIG_CPU_FREQ is not set | ||
193 | |||
194 | # | ||
195 | # Bus options | ||
196 | # | ||
197 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
198 | # CONFIG_PCCARD is not set | ||
199 | |||
200 | # | ||
201 | # Executable file formats | ||
202 | # | ||
203 | CONFIG_BINFMT_ELF=y | ||
204 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
205 | # CONFIG_HAVE_AOUT is not set | ||
206 | # CONFIG_BINFMT_MISC is not set | ||
207 | CONFIG_NET=y | ||
208 | |||
209 | # | ||
210 | # Networking options | ||
211 | # | ||
212 | CONFIG_COMPAT_NET_DEV_OPS=y | ||
213 | CONFIG_PACKET=y | ||
214 | CONFIG_PACKET_MMAP=y | ||
215 | CONFIG_UNIX=y | ||
216 | CONFIG_XFRM=y | ||
217 | CONFIG_XFRM_USER=y | ||
218 | # CONFIG_XFRM_SUB_POLICY is not set | ||
219 | # CONFIG_XFRM_MIGRATE is not set | ||
220 | # CONFIG_XFRM_STATISTICS is not set | ||
221 | CONFIG_XFRM_IPCOMP=y | ||
222 | CONFIG_NET_KEY=y | ||
223 | # CONFIG_NET_KEY_MIGRATE is not set | ||
224 | CONFIG_INET=y | ||
225 | CONFIG_IP_MULTICAST=y | ||
226 | CONFIG_IP_ADVANCED_ROUTER=y | ||
227 | CONFIG_ASK_IP_FIB_HASH=y | ||
228 | # CONFIG_IP_FIB_TRIE is not set | ||
229 | CONFIG_IP_FIB_HASH=y | ||
230 | # CONFIG_IP_MULTIPLE_TABLES is not set | ||
231 | # CONFIG_IP_ROUTE_MULTIPATH is not set | ||
232 | # CONFIG_IP_ROUTE_VERBOSE is not set | ||
233 | CONFIG_IP_PNP=y | ||
234 | CONFIG_IP_PNP_DHCP=y | ||
235 | # CONFIG_IP_PNP_BOOTP is not set | ||
236 | # CONFIG_IP_PNP_RARP is not set | ||
237 | # CONFIG_NET_IPIP is not set | ||
238 | # CONFIG_NET_IPGRE is not set | ||
239 | CONFIG_IP_MROUTE=y | ||
240 | CONFIG_IP_PIMSM_V1=y | ||
241 | # CONFIG_IP_PIMSM_V2 is not set | ||
242 | # CONFIG_ARPD is not set | ||
243 | CONFIG_SYN_COOKIES=y | ||
244 | CONFIG_INET_AH=y | ||
245 | CONFIG_INET_ESP=y | ||
246 | CONFIG_INET_IPCOMP=y | ||
247 | CONFIG_INET_XFRM_TUNNEL=y | ||
248 | CONFIG_INET_TUNNEL=y | ||
249 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | ||
250 | CONFIG_INET_XFRM_MODE_TUNNEL=y | ||
251 | CONFIG_INET_XFRM_MODE_BEET=y | ||
252 | # CONFIG_INET_LRO is not set | ||
253 | CONFIG_INET_DIAG=y | ||
254 | CONFIG_INET_TCP_DIAG=y | ||
255 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
256 | CONFIG_TCP_CONG_CUBIC=y | ||
257 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
258 | # CONFIG_TCP_MD5SIG is not set | ||
259 | # CONFIG_IPV6 is not set | ||
260 | # CONFIG_NETWORK_SECMARK is not set | ||
261 | # CONFIG_NETFILTER is not set | ||
262 | # CONFIG_IP_DCCP is not set | ||
263 | # CONFIG_IP_SCTP is not set | ||
264 | # CONFIG_TIPC is not set | ||
265 | # CONFIG_ATM is not set | ||
266 | # CONFIG_BRIDGE is not set | ||
267 | # CONFIG_NET_DSA is not set | ||
268 | # CONFIG_VLAN_8021Q is not set | ||
269 | # CONFIG_DECNET is not set | ||
270 | # CONFIG_LLC2 is not set | ||
271 | # CONFIG_IPX is not set | ||
272 | # CONFIG_ATALK is not set | ||
273 | # CONFIG_X25 is not set | ||
274 | # CONFIG_LAPB is not set | ||
275 | # CONFIG_ECONET is not set | ||
276 | # CONFIG_WAN_ROUTER is not set | ||
277 | # CONFIG_NET_SCHED is not set | ||
278 | # CONFIG_DCB is not set | ||
279 | |||
280 | # | ||
281 | # Network testing | ||
282 | # | ||
283 | # CONFIG_NET_PKTGEN is not set | ||
284 | # CONFIG_HAMRADIO is not set | ||
285 | CONFIG_CAN=y | ||
286 | CONFIG_CAN_RAW=y | ||
287 | CONFIG_CAN_BCM=y | ||
288 | |||
289 | # | ||
290 | # CAN Device Drivers | ||
291 | # | ||
292 | # CONFIG_CAN_VCAN is not set | ||
293 | # CONFIG_CAN_DEBUG_DEVICES is not set | ||
294 | # CONFIG_IRDA is not set | ||
295 | # CONFIG_BT is not set | ||
296 | # CONFIG_AF_RXRPC is not set | ||
297 | # CONFIG_PHONET is not set | ||
298 | # CONFIG_WIRELESS is not set | ||
299 | # CONFIG_WIMAX is not set | ||
300 | # CONFIG_RFKILL is not set | ||
301 | # CONFIG_NET_9P is not set | ||
302 | |||
303 | # | ||
304 | # Device Drivers | ||
305 | # | ||
306 | |||
307 | # | ||
308 | # Generic Driver Options | ||
309 | # | ||
310 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
311 | CONFIG_STANDALONE=y | ||
312 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | ||
313 | # CONFIG_FW_LOADER is not set | ||
314 | # CONFIG_SYS_HYPERVISOR is not set | ||
315 | # CONFIG_CONNECTOR is not set | ||
316 | CONFIG_MTD=y | ||
317 | # CONFIG_MTD_DEBUG is not set | ||
318 | CONFIG_MTD_CONCAT=y | ||
319 | CONFIG_MTD_PARTITIONS=y | ||
320 | # CONFIG_MTD_TESTS is not set | ||
321 | # CONFIG_MTD_REDBOOT_PARTS is not set | ||
322 | # CONFIG_MTD_CMDLINE_PARTS is not set | ||
323 | # CONFIG_MTD_AR7_PARTS is not set | ||
324 | |||
325 | # | ||
326 | # User Modules And Translation Layers | ||
327 | # | ||
328 | CONFIG_MTD_CHAR=y | ||
329 | CONFIG_MTD_BLKDEVS=y | ||
330 | CONFIG_MTD_BLOCK=y | ||
331 | # CONFIG_FTL is not set | ||
332 | # CONFIG_NFTL is not set | ||
333 | # CONFIG_INFTL is not set | ||
334 | # CONFIG_RFD_FTL is not set | ||
335 | # CONFIG_SSFDC is not set | ||
336 | # CONFIG_MTD_OOPS is not set | ||
337 | |||
338 | # | ||
339 | # RAM/ROM/Flash chip drivers | ||
340 | # | ||
341 | CONFIG_MTD_CFI=y | ||
342 | CONFIG_MTD_JEDECPROBE=y | ||
343 | CONFIG_MTD_GEN_PROBE=y | ||
344 | # CONFIG_MTD_CFI_ADV_OPTIONS is not set | ||
345 | CONFIG_MTD_MAP_BANK_WIDTH_1=y | ||
346 | CONFIG_MTD_MAP_BANK_WIDTH_2=y | ||
347 | CONFIG_MTD_MAP_BANK_WIDTH_4=y | ||
348 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | ||
349 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | ||
350 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | ||
351 | CONFIG_MTD_CFI_I1=y | ||
352 | CONFIG_MTD_CFI_I2=y | ||
353 | # CONFIG_MTD_CFI_I4 is not set | ||
354 | # CONFIG_MTD_CFI_I8 is not set | ||
355 | # CONFIG_MTD_CFI_INTELEXT is not set | ||
356 | CONFIG_MTD_CFI_AMDSTD=y | ||
357 | # CONFIG_MTD_CFI_STAA is not set | ||
358 | CONFIG_MTD_CFI_UTIL=y | ||
359 | # CONFIG_MTD_RAM is not set | ||
360 | # CONFIG_MTD_ROM is not set | ||
361 | CONFIG_MTD_ABSENT=y | ||
362 | |||
363 | # | ||
364 | # Mapping drivers for chip access | ||
365 | # | ||
366 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | ||
367 | CONFIG_MTD_PHYSMAP=y | ||
368 | # CONFIG_MTD_PHYSMAP_COMPAT is not set | ||
369 | # CONFIG_MTD_PLATRAM is not set | ||
370 | |||
371 | # | ||
372 | # Self-contained MTD device drivers | ||
373 | # | ||
374 | # CONFIG_MTD_DATAFLASH is not set | ||
375 | # CONFIG_MTD_M25P80 is not set | ||
376 | # CONFIG_MTD_SLRAM is not set | ||
377 | # CONFIG_MTD_PHRAM is not set | ||
378 | # CONFIG_MTD_MTDRAM is not set | ||
379 | CONFIG_MTD_BLOCK2MTD=y | ||
380 | |||
381 | # | ||
382 | # Disk-On-Chip Device Drivers | ||
383 | # | ||
384 | # CONFIG_MTD_DOC2000 is not set | ||
385 | # CONFIG_MTD_DOC2001 is not set | ||
386 | # CONFIG_MTD_DOC2001PLUS is not set | ||
387 | # CONFIG_MTD_NAND is not set | ||
388 | # CONFIG_MTD_ONENAND is not set | ||
389 | |||
390 | # | ||
391 | # LPDDR flash memory drivers | ||
392 | # | ||
393 | # CONFIG_MTD_LPDDR is not set | ||
394 | # CONFIG_MTD_QINFO_PROBE is not set | ||
395 | |||
396 | # | ||
397 | # UBI - Unsorted block images | ||
398 | # | ||
399 | # CONFIG_MTD_UBI is not set | ||
400 | # CONFIG_PARPORT is not set | ||
401 | CONFIG_BLK_DEV=y | ||
402 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
403 | CONFIG_BLK_DEV_LOOP=y | ||
404 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
405 | # CONFIG_BLK_DEV_NBD is not set | ||
406 | # CONFIG_BLK_DEV_RAM is not set | ||
407 | # CONFIG_CDROM_PKTCDVD is not set | ||
408 | # CONFIG_ATA_OVER_ETH is not set | ||
409 | CONFIG_MISC_DEVICES=y | ||
410 | CONFIG_ATMEL_PWM=y | ||
411 | # CONFIG_ATMEL_TCLIB is not set | ||
412 | # CONFIG_EEPROM_93CX6 is not set | ||
413 | # CONFIG_ICS932S401 is not set | ||
414 | CONFIG_ATMEL_SSC=y | ||
415 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
416 | # CONFIG_C2PORT is not set | ||
417 | |||
418 | # | ||
419 | # SCSI device support | ||
420 | # | ||
421 | # CONFIG_RAID_ATTRS is not set | ||
422 | CONFIG_SCSI=y | ||
423 | CONFIG_SCSI_DMA=y | ||
424 | # CONFIG_SCSI_TGT is not set | ||
425 | # CONFIG_SCSI_NETLINK is not set | ||
426 | CONFIG_SCSI_PROC_FS=y | ||
427 | |||
428 | # | ||
429 | # SCSI support type (disk, tape, CD-ROM) | ||
430 | # | ||
431 | CONFIG_BLK_DEV_SD=y | ||
432 | # CONFIG_CHR_DEV_ST is not set | ||
433 | # CONFIG_CHR_DEV_OSST is not set | ||
434 | # CONFIG_BLK_DEV_SR is not set | ||
435 | # CONFIG_CHR_DEV_SG is not set | ||
436 | # CONFIG_CHR_DEV_SCH is not set | ||
437 | |||
438 | # | ||
439 | # Some SCSI devices (e.g. CD jukebox) support multiple LUNs | ||
440 | # | ||
441 | # CONFIG_SCSI_MULTI_LUN is not set | ||
442 | # CONFIG_SCSI_CONSTANTS is not set | ||
443 | # CONFIG_SCSI_LOGGING is not set | ||
444 | # CONFIG_SCSI_SCAN_ASYNC is not set | ||
445 | CONFIG_SCSI_WAIT_SCAN=m | ||
446 | |||
447 | # | ||
448 | # SCSI Transports | ||
449 | # | ||
450 | # CONFIG_SCSI_SPI_ATTRS is not set | ||
451 | # CONFIG_SCSI_FC_ATTRS is not set | ||
452 | # CONFIG_SCSI_ISCSI_ATTRS is not set | ||
453 | # CONFIG_SCSI_SAS_LIBSAS is not set | ||
454 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
455 | # CONFIG_SCSI_LOWLEVEL is not set | ||
456 | # CONFIG_SCSI_DH is not set | ||
457 | # CONFIG_ATA is not set | ||
458 | # CONFIG_MD is not set | ||
459 | CONFIG_NETDEVICES=y | ||
460 | # CONFIG_DUMMY is not set | ||
461 | # CONFIG_BONDING is not set | ||
462 | # CONFIG_MACVLAN is not set | ||
463 | # CONFIG_EQUALIZER is not set | ||
464 | # CONFIG_TUN is not set | ||
465 | # CONFIG_VETH is not set | ||
466 | CONFIG_PHYLIB=y | ||
467 | |||
468 | # | ||
469 | # MII PHY device drivers | ||
470 | # | ||
471 | # CONFIG_MARVELL_PHY is not set | ||
472 | # CONFIG_DAVICOM_PHY is not set | ||
473 | # CONFIG_QSEMI_PHY is not set | ||
474 | # CONFIG_LXT_PHY is not set | ||
475 | # CONFIG_CICADA_PHY is not set | ||
476 | # CONFIG_VITESSE_PHY is not set | ||
477 | # CONFIG_SMSC_PHY is not set | ||
478 | # CONFIG_BROADCOM_PHY is not set | ||
479 | # CONFIG_ICPLUS_PHY is not set | ||
480 | # CONFIG_REALTEK_PHY is not set | ||
481 | # CONFIG_NATIONAL_PHY is not set | ||
482 | # CONFIG_STE10XP is not set | ||
483 | # CONFIG_LSI_ET1011C_PHY is not set | ||
484 | # CONFIG_FIXED_PHY is not set | ||
485 | # CONFIG_MDIO_BITBANG is not set | ||
486 | CONFIG_NET_ETHERNET=y | ||
487 | # CONFIG_MII is not set | ||
488 | CONFIG_MACB=y | ||
489 | # CONFIG_ENC28J60 is not set | ||
490 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
491 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
492 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
493 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
494 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | ||
495 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | ||
496 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | ||
497 | # CONFIG_B44 is not set | ||
498 | # CONFIG_NETDEV_1000 is not set | ||
499 | # CONFIG_NETDEV_10000 is not set | ||
500 | |||
501 | # | ||
502 | # Wireless LAN | ||
503 | # | ||
504 | # CONFIG_WLAN_PRE80211 is not set | ||
505 | # CONFIG_WLAN_80211 is not set | ||
506 | # CONFIG_IWLWIFI_LEDS is not set | ||
507 | |||
508 | # | ||
509 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
510 | # | ||
511 | # CONFIG_WAN is not set | ||
512 | # CONFIG_PPP is not set | ||
513 | # CONFIG_SLIP is not set | ||
514 | # CONFIG_NETCONSOLE is not set | ||
515 | # CONFIG_NETPOLL is not set | ||
516 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
517 | # CONFIG_ISDN is not set | ||
518 | # CONFIG_PHONE is not set | ||
519 | |||
520 | # | ||
521 | # Input device support | ||
522 | # | ||
523 | CONFIG_INPUT=y | ||
524 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
525 | # CONFIG_INPUT_POLLDEV is not set | ||
526 | |||
527 | # | ||
528 | # Userland interfaces | ||
529 | # | ||
530 | # CONFIG_INPUT_MOUSEDEV is not set | ||
531 | # CONFIG_INPUT_JOYDEV is not set | ||
532 | CONFIG_INPUT_EVDEV=y | ||
533 | # CONFIG_INPUT_EVBUG is not set | ||
534 | |||
535 | # | ||
536 | # Input Device Drivers | ||
537 | # | ||
538 | CONFIG_INPUT_KEYBOARD=y | ||
539 | # CONFIG_KEYBOARD_ATKBD is not set | ||
540 | # CONFIG_KEYBOARD_SUNKBD is not set | ||
541 | # CONFIG_KEYBOARD_LKKBD is not set | ||
542 | # CONFIG_KEYBOARD_XTKBD is not set | ||
543 | # CONFIG_KEYBOARD_NEWTON is not set | ||
544 | # CONFIG_KEYBOARD_STOWAWAY is not set | ||
545 | # CONFIG_KEYBOARD_GPIO is not set | ||
546 | # CONFIG_INPUT_MOUSE is not set | ||
547 | # CONFIG_INPUT_JOYSTICK is not set | ||
548 | # CONFIG_INPUT_TABLET is not set | ||
549 | CONFIG_INPUT_TOUCHSCREEN=y | ||
550 | CONFIG_TOUCHSCREEN_ADS7846=y | ||
551 | # CONFIG_TOUCHSCREEN_FUJITSU is not set | ||
552 | # CONFIG_TOUCHSCREEN_GUNZE is not set | ||
553 | # CONFIG_TOUCHSCREEN_ELO is not set | ||
554 | # CONFIG_TOUCHSCREEN_WACOM_W8001 is not set | ||
555 | # CONFIG_TOUCHSCREEN_MTOUCH is not set | ||
556 | # CONFIG_TOUCHSCREEN_INEXIO is not set | ||
557 | # CONFIG_TOUCHSCREEN_MK712 is not set | ||
558 | # CONFIG_TOUCHSCREEN_PENMOUNT is not set | ||
559 | # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set | ||
560 | # CONFIG_TOUCHSCREEN_TOUCHWIN is not set | ||
561 | # CONFIG_TOUCHSCREEN_TOUCHIT213 is not set | ||
562 | # CONFIG_TOUCHSCREEN_TSC2007 is not set | ||
563 | CONFIG_INPUT_MISC=y | ||
564 | CONFIG_INPUT_UINPUT=y | ||
565 | |||
566 | # | ||
567 | # Hardware I/O ports | ||
568 | # | ||
569 | # CONFIG_SERIO is not set | ||
570 | # CONFIG_GAMEPORT is not set | ||
571 | |||
572 | # | ||
573 | # Character devices | ||
574 | # | ||
575 | CONFIG_VT=y | ||
576 | # CONFIG_CONSOLE_TRANSLATIONS is not set | ||
577 | CONFIG_VT_CONSOLE=y | ||
578 | CONFIG_HW_CONSOLE=y | ||
579 | CONFIG_VT_HW_CONSOLE_BINDING=y | ||
580 | # CONFIG_DEVKMEM is not set | ||
581 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
582 | |||
583 | # | ||
584 | # Serial drivers | ||
585 | # | ||
586 | # CONFIG_SERIAL_8250 is not set | ||
587 | |||
588 | # | ||
589 | # Non-8250 serial port support | ||
590 | # | ||
591 | CONFIG_SERIAL_ATMEL=y | ||
592 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
593 | CONFIG_SERIAL_ATMEL_PDC=y | ||
594 | # CONFIG_SERIAL_ATMEL_TTYAT is not set | ||
595 | CONFIG_SERIAL_CORE=y | ||
596 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
597 | CONFIG_UNIX98_PTYS=y | ||
598 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
599 | # CONFIG_LEGACY_PTYS is not set | ||
600 | # CONFIG_IPMI_HANDLER is not set | ||
601 | # CONFIG_HW_RANDOM is not set | ||
602 | # CONFIG_R3964 is not set | ||
603 | # CONFIG_RAW_DRIVER is not set | ||
604 | # CONFIG_TCG_TPM is not set | ||
605 | CONFIG_I2C=y | ||
606 | CONFIG_I2C_BOARDINFO=y | ||
607 | CONFIG_I2C_CHARDEV=y | ||
608 | CONFIG_I2C_HELPER_AUTO=y | ||
609 | CONFIG_I2C_ALGOBIT=y | ||
610 | |||
611 | # | ||
612 | # I2C Hardware Bus support | ||
613 | # | ||
614 | |||
615 | # | ||
616 | # I2C system bus drivers (mostly embedded / system-on-chip) | ||
617 | # | ||
618 | CONFIG_I2C_GPIO=y | ||
619 | # CONFIG_I2C_OCORES is not set | ||
620 | # CONFIG_I2C_SIMTEC is not set | ||
621 | |||
622 | # | ||
623 | # External I2C/SMBus adapter drivers | ||
624 | # | ||
625 | # CONFIG_I2C_PARPORT_LIGHT is not set | ||
626 | # CONFIG_I2C_TAOS_EVM is not set | ||
627 | |||
628 | # | ||
629 | # Other I2C/SMBus bus drivers | ||
630 | # | ||
631 | # CONFIG_I2C_PCA_PLATFORM is not set | ||
632 | # CONFIG_I2C_STUB is not set | ||
633 | |||
634 | # | ||
635 | # Miscellaneous I2C Chip support | ||
636 | # | ||
637 | # CONFIG_DS1682 is not set | ||
638 | # CONFIG_AT24 is not set | ||
639 | # CONFIG_SENSORS_EEPROM is not set | ||
640 | # CONFIG_SENSORS_PCF8574 is not set | ||
641 | # CONFIG_PCF8575 is not set | ||
642 | # CONFIG_SENSORS_PCA9539 is not set | ||
643 | # CONFIG_SENSORS_PCF8591 is not set | ||
644 | # CONFIG_SENSORS_MAX6875 is not set | ||
645 | # CONFIG_SENSORS_TSL2550 is not set | ||
646 | # CONFIG_I2C_DEBUG_CORE is not set | ||
647 | # CONFIG_I2C_DEBUG_ALGO is not set | ||
648 | # CONFIG_I2C_DEBUG_BUS is not set | ||
649 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
650 | CONFIG_SPI=y | ||
651 | CONFIG_SPI_MASTER=y | ||
652 | |||
653 | # | ||
654 | # SPI Master Controller Drivers | ||
655 | # | ||
656 | CONFIG_SPI_ATMEL=y | ||
657 | # CONFIG_SPI_BITBANG is not set | ||
658 | # CONFIG_SPI_GPIO is not set | ||
659 | |||
660 | # | ||
661 | # SPI Protocol Masters | ||
662 | # | ||
663 | # CONFIG_SPI_AT25 is not set | ||
664 | CONFIG_SPI_SPIDEV=y | ||
665 | # CONFIG_SPI_TLE62X0 is not set | ||
666 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
667 | CONFIG_GPIOLIB=y | ||
668 | CONFIG_GPIO_SYSFS=y | ||
669 | |||
670 | # | ||
671 | # Memory mapped GPIO expanders: | ||
672 | # | ||
673 | |||
674 | # | ||
675 | # I2C GPIO expanders: | ||
676 | # | ||
677 | # CONFIG_GPIO_MAX732X is not set | ||
678 | # CONFIG_GPIO_PCA953X is not set | ||
679 | # CONFIG_GPIO_PCF857X is not set | ||
680 | |||
681 | # | ||
682 | # PCI GPIO expanders: | ||
683 | # | ||
684 | |||
685 | # | ||
686 | # SPI GPIO expanders: | ||
687 | # | ||
688 | # CONFIG_GPIO_MAX7301 is not set | ||
689 | # CONFIG_GPIO_MCP23S08 is not set | ||
690 | # CONFIG_W1 is not set | ||
691 | # CONFIG_POWER_SUPPLY is not set | ||
692 | # CONFIG_HWMON is not set | ||
693 | # CONFIG_THERMAL is not set | ||
694 | # CONFIG_THERMAL_HWMON is not set | ||
695 | CONFIG_WATCHDOG=y | ||
696 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
697 | |||
698 | # | ||
699 | # Watchdog Device Drivers | ||
700 | # | ||
701 | # CONFIG_SOFT_WATCHDOG is not set | ||
702 | # CONFIG_AT32AP700X_WDT is not set | ||
703 | CONFIG_SSB_POSSIBLE=y | ||
704 | |||
705 | # | ||
706 | # Sonics Silicon Backplane | ||
707 | # | ||
708 | # CONFIG_SSB is not set | ||
709 | |||
710 | # | ||
711 | # Multifunction device drivers | ||
712 | # | ||
713 | # CONFIG_MFD_CORE is not set | ||
714 | # CONFIG_MFD_SM501 is not set | ||
715 | # CONFIG_HTC_PASIC3 is not set | ||
716 | # CONFIG_TPS65010 is not set | ||
717 | # CONFIG_TWL4030_CORE is not set | ||
718 | # CONFIG_MFD_TMIO is not set | ||
719 | # CONFIG_PMIC_DA903X is not set | ||
720 | # CONFIG_MFD_WM8400 is not set | ||
721 | # CONFIG_MFD_WM8350_I2C is not set | ||
722 | # CONFIG_MFD_PCF50633 is not set | ||
723 | # CONFIG_REGULATOR is not set | ||
724 | |||
725 | # | ||
726 | # Multimedia devices | ||
727 | # | ||
728 | |||
729 | # | ||
730 | # Multimedia core support | ||
731 | # | ||
732 | # CONFIG_VIDEO_DEV is not set | ||
733 | # CONFIG_DVB_CORE is not set | ||
734 | # CONFIG_VIDEO_MEDIA is not set | ||
735 | |||
736 | # | ||
737 | # Multimedia drivers | ||
738 | # | ||
739 | # CONFIG_DAB is not set | ||
740 | |||
741 | # | ||
742 | # Graphics support | ||
743 | # | ||
744 | # CONFIG_VGASTATE is not set | ||
745 | CONFIG_VIDEO_OUTPUT_CONTROL=y | ||
746 | CONFIG_FB=y | ||
747 | # CONFIG_FIRMWARE_EDID is not set | ||
748 | # CONFIG_FB_DDC is not set | ||
749 | # CONFIG_FB_BOOT_VESA_SUPPORT is not set | ||
750 | CONFIG_FB_CFB_FILLRECT=y | ||
751 | CONFIG_FB_CFB_COPYAREA=y | ||
752 | CONFIG_FB_CFB_IMAGEBLIT=y | ||
753 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
754 | # CONFIG_FB_SYS_FILLRECT is not set | ||
755 | # CONFIG_FB_SYS_COPYAREA is not set | ||
756 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
757 | # CONFIG_FB_FOREIGN_ENDIAN is not set | ||
758 | # CONFIG_FB_SYS_FOPS is not set | ||
759 | # CONFIG_FB_SVGALIB is not set | ||
760 | # CONFIG_FB_MACMODES is not set | ||
761 | # CONFIG_FB_BACKLIGHT is not set | ||
762 | # CONFIG_FB_MODE_HELPERS is not set | ||
763 | # CONFIG_FB_TILEBLITTING is not set | ||
764 | |||
765 | # | ||
766 | # Frame buffer hardware drivers | ||
767 | # | ||
768 | # CONFIG_FB_S1D13XXX is not set | ||
769 | CONFIG_FB_ATMEL=y | ||
770 | # CONFIG_FB_VIRTUAL is not set | ||
771 | # CONFIG_FB_METRONOME is not set | ||
772 | # CONFIG_FB_MB862XX is not set | ||
773 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
774 | # CONFIG_LCD_CLASS_DEVICE is not set | ||
775 | # CONFIG_BACKLIGHT_CLASS_DEVICE is not set | ||
776 | |||
777 | # | ||
778 | # Display device support | ||
779 | # | ||
780 | CONFIG_DISPLAY_SUPPORT=y | ||
781 | |||
782 | # | ||
783 | # Display hardware drivers | ||
784 | # | ||
785 | |||
786 | # | ||
787 | # Console display driver support | ||
788 | # | ||
789 | CONFIG_DUMMY_CONSOLE=y | ||
790 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
791 | # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set | ||
792 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
793 | # CONFIG_FONTS is not set | ||
794 | CONFIG_FONT_8x8=y | ||
795 | CONFIG_FONT_8x16=y | ||
796 | CONFIG_LOGO=y | ||
797 | CONFIG_LOGO_LINUX_MONO=y | ||
798 | CONFIG_LOGO_LINUX_VGA16=y | ||
799 | CONFIG_LOGO_LINUX_CLUT224=y | ||
800 | # CONFIG_SOUND is not set | ||
801 | CONFIG_HID_SUPPORT=y | ||
802 | CONFIG_HID=y | ||
803 | # CONFIG_HID_DEBUG is not set | ||
804 | # CONFIG_HIDRAW is not set | ||
805 | # CONFIG_HID_PID is not set | ||
806 | |||
807 | # | ||
808 | # Special HID drivers | ||
809 | # | ||
810 | CONFIG_HID_COMPAT=y | ||
811 | CONFIG_USB_SUPPORT=y | ||
812 | # CONFIG_USB_ARCH_HAS_HCD is not set | ||
813 | # CONFIG_USB_ARCH_HAS_OHCI is not set | ||
814 | # CONFIG_USB_ARCH_HAS_EHCI is not set | ||
815 | # CONFIG_USB_OTG_WHITELIST is not set | ||
816 | # CONFIG_USB_OTG_BLACKLIST_HUB is not set | ||
817 | |||
818 | # | ||
819 | # Enable Host or Gadget support to see Inventra options | ||
820 | # | ||
821 | |||
822 | # | ||
823 | # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; | ||
824 | # | ||
825 | # CONFIG_USB_GADGET is not set | ||
826 | |||
827 | # | ||
828 | # OTG and related infrastructure | ||
829 | # | ||
830 | CONFIG_MMC=y | ||
831 | # CONFIG_MMC_DEBUG is not set | ||
832 | # CONFIG_MMC_UNSAFE_RESUME is not set | ||
833 | |||
834 | # | ||
835 | # MMC/SD/SDIO Card Drivers | ||
836 | # | ||
837 | CONFIG_MMC_BLOCK=y | ||
838 | CONFIG_MMC_BLOCK_BOUNCE=y | ||
839 | # CONFIG_SDIO_UART is not set | ||
840 | # CONFIG_MMC_TEST is not set | ||
841 | |||
842 | # | ||
843 | # MMC/SD/SDIO Host Controller Drivers | ||
844 | # | ||
845 | # CONFIG_MMC_SDHCI is not set | ||
846 | CONFIG_MMC_ATMELMCI=y | ||
847 | CONFIG_MMC_ATMELMCI_DMA=y | ||
848 | # CONFIG_MMC_SPI is not set | ||
849 | # CONFIG_MEMSTICK is not set | ||
850 | CONFIG_NEW_LEDS=y | ||
851 | CONFIG_LEDS_CLASS=y | ||
852 | |||
853 | # | ||
854 | # LED drivers | ||
855 | # | ||
856 | CONFIG_LEDS_ATMEL_PWM=y | ||
857 | # CONFIG_LEDS_PCA9532 is not set | ||
858 | # CONFIG_LEDS_GPIO is not set | ||
859 | # CONFIG_LEDS_PCA955X is not set | ||
860 | |||
861 | # | ||
862 | # LED Triggers | ||
863 | # | ||
864 | # CONFIG_LEDS_TRIGGERS is not set | ||
865 | # CONFIG_ACCESSIBILITY is not set | ||
866 | CONFIG_RTC_LIB=y | ||
867 | CONFIG_RTC_CLASS=y | ||
868 | # CONFIG_RTC_HCTOSYS is not set | ||
869 | # CONFIG_RTC_DEBUG is not set | ||
870 | |||
871 | # | ||
872 | # RTC interfaces | ||
873 | # | ||
874 | CONFIG_RTC_INTF_SYSFS=y | ||
875 | CONFIG_RTC_INTF_PROC=y | ||
876 | CONFIG_RTC_INTF_DEV=y | ||
877 | # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set | ||
878 | # CONFIG_RTC_DRV_TEST is not set | ||
879 | |||
880 | # | ||
881 | # I2C RTC drivers | ||
882 | # | ||
883 | # CONFIG_RTC_DRV_DS1307 is not set | ||
884 | # CONFIG_RTC_DRV_DS1374 is not set | ||
885 | # CONFIG_RTC_DRV_DS1672 is not set | ||
886 | # CONFIG_RTC_DRV_MAX6900 is not set | ||
887 | # CONFIG_RTC_DRV_RS5C372 is not set | ||
888 | # CONFIG_RTC_DRV_ISL1208 is not set | ||
889 | # CONFIG_RTC_DRV_X1205 is not set | ||
890 | CONFIG_RTC_DRV_PCF8563=y | ||
891 | # CONFIG_RTC_DRV_PCF8583 is not set | ||
892 | # CONFIG_RTC_DRV_M41T80 is not set | ||
893 | # CONFIG_RTC_DRV_S35390A is not set | ||
894 | # CONFIG_RTC_DRV_FM3130 is not set | ||
895 | # CONFIG_RTC_DRV_RX8581 is not set | ||
896 | |||
897 | # | ||
898 | # SPI RTC drivers | ||
899 | # | ||
900 | # CONFIG_RTC_DRV_M41T94 is not set | ||
901 | # CONFIG_RTC_DRV_DS1305 is not set | ||
902 | # CONFIG_RTC_DRV_DS1390 is not set | ||
903 | # CONFIG_RTC_DRV_MAX6902 is not set | ||
904 | # CONFIG_RTC_DRV_R9701 is not set | ||
905 | # CONFIG_RTC_DRV_RS5C348 is not set | ||
906 | # CONFIG_RTC_DRV_DS3234 is not set | ||
907 | |||
908 | # | ||
909 | # Platform RTC drivers | ||
910 | # | ||
911 | # CONFIG_RTC_DRV_DS1286 is not set | ||
912 | # CONFIG_RTC_DRV_DS1511 is not set | ||
913 | # CONFIG_RTC_DRV_DS1553 is not set | ||
914 | # CONFIG_RTC_DRV_DS1742 is not set | ||
915 | # CONFIG_RTC_DRV_STK17TA8 is not set | ||
916 | # CONFIG_RTC_DRV_M48T86 is not set | ||
917 | # CONFIG_RTC_DRV_M48T35 is not set | ||
918 | # CONFIG_RTC_DRV_M48T59 is not set | ||
919 | # CONFIG_RTC_DRV_BQ4802 is not set | ||
920 | # CONFIG_RTC_DRV_V3020 is not set | ||
921 | |||
922 | # | ||
923 | # on-CPU RTC drivers | ||
924 | # | ||
925 | # CONFIG_RTC_DRV_AT32AP700X is not set | ||
926 | CONFIG_DMADEVICES=y | ||
927 | |||
928 | # | ||
929 | # DMA Devices | ||
930 | # | ||
931 | CONFIG_DW_DMAC=y | ||
932 | CONFIG_DMA_ENGINE=y | ||
933 | |||
934 | # | ||
935 | # DMA Clients | ||
936 | # | ||
937 | # CONFIG_NET_DMA is not set | ||
938 | # CONFIG_DMATEST is not set | ||
939 | CONFIG_UIO=y | ||
940 | # CONFIG_UIO_PDRV is not set | ||
941 | # CONFIG_UIO_PDRV_GENIRQ is not set | ||
942 | # CONFIG_UIO_SMX is not set | ||
943 | # CONFIG_UIO_SERCOS3 is not set | ||
944 | # CONFIG_STAGING is not set | ||
945 | |||
946 | # | ||
947 | # File systems | ||
948 | # | ||
949 | CONFIG_EXT2_FS=y | ||
950 | # CONFIG_EXT2_FS_XATTR is not set | ||
951 | # CONFIG_EXT2_FS_XIP is not set | ||
952 | # CONFIG_EXT3_FS is not set | ||
953 | # CONFIG_EXT4_FS is not set | ||
954 | # CONFIG_REISERFS_FS is not set | ||
955 | # CONFIG_JFS_FS is not set | ||
956 | # CONFIG_FS_POSIX_ACL is not set | ||
957 | CONFIG_FILE_LOCKING=y | ||
958 | # CONFIG_XFS_FS is not set | ||
959 | # CONFIG_OCFS2_FS is not set | ||
960 | # CONFIG_BTRFS_FS is not set | ||
961 | # CONFIG_DNOTIFY is not set | ||
962 | CONFIG_INOTIFY=y | ||
963 | CONFIG_INOTIFY_USER=y | ||
964 | # CONFIG_QUOTA is not set | ||
965 | # CONFIG_AUTOFS_FS is not set | ||
966 | # CONFIG_AUTOFS4_FS is not set | ||
967 | CONFIG_FUSE_FS=y | ||
968 | |||
969 | # | ||
970 | # CD-ROM/DVD Filesystems | ||
971 | # | ||
972 | # CONFIG_ISO9660_FS is not set | ||
973 | # CONFIG_UDF_FS is not set | ||
974 | |||
975 | # | ||
976 | # DOS/FAT/NT Filesystems | ||
977 | # | ||
978 | CONFIG_FAT_FS=y | ||
979 | CONFIG_MSDOS_FS=y | ||
980 | CONFIG_VFAT_FS=y | ||
981 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
982 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | ||
983 | # CONFIG_NTFS_FS is not set | ||
984 | |||
985 | # | ||
986 | # Pseudo filesystems | ||
987 | # | ||
988 | CONFIG_PROC_FS=y | ||
989 | # CONFIG_PROC_KCORE is not set | ||
990 | CONFIG_PROC_SYSCTL=y | ||
991 | CONFIG_PROC_PAGE_MONITOR=y | ||
992 | CONFIG_SYSFS=y | ||
993 | CONFIG_TMPFS=y | ||
994 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
995 | # CONFIG_HUGETLB_PAGE is not set | ||
996 | CONFIG_CONFIGFS_FS=y | ||
997 | CONFIG_MISC_FILESYSTEMS=y | ||
998 | # CONFIG_ADFS_FS is not set | ||
999 | # CONFIG_AFFS_FS is not set | ||
1000 | # CONFIG_HFS_FS is not set | ||
1001 | # CONFIG_HFSPLUS_FS is not set | ||
1002 | # CONFIG_BEFS_FS is not set | ||
1003 | # CONFIG_BFS_FS is not set | ||
1004 | # CONFIG_EFS_FS is not set | ||
1005 | CONFIG_JFFS2_FS=y | ||
1006 | CONFIG_JFFS2_FS_DEBUG=0 | ||
1007 | CONFIG_JFFS2_FS_WRITEBUFFER=y | ||
1008 | CONFIG_JFFS2_FS_WBUF_VERIFY=y | ||
1009 | # CONFIG_JFFS2_SUMMARY is not set | ||
1010 | # CONFIG_JFFS2_FS_XATTR is not set | ||
1011 | # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set | ||
1012 | CONFIG_JFFS2_ZLIB=y | ||
1013 | # CONFIG_JFFS2_LZO is not set | ||
1014 | CONFIG_JFFS2_RTIME=y | ||
1015 | # CONFIG_JFFS2_RUBIN is not set | ||
1016 | CONFIG_CRAMFS=y | ||
1017 | # CONFIG_SQUASHFS is not set | ||
1018 | # CONFIG_VXFS_FS is not set | ||
1019 | # CONFIG_MINIX_FS is not set | ||
1020 | # CONFIG_OMFS_FS is not set | ||
1021 | # CONFIG_HPFS_FS is not set | ||
1022 | # CONFIG_QNX4FS_FS is not set | ||
1023 | # CONFIG_ROMFS_FS is not set | ||
1024 | # CONFIG_SYSV_FS is not set | ||
1025 | # CONFIG_UFS_FS is not set | ||
1026 | CONFIG_NETWORK_FILESYSTEMS=y | ||
1027 | CONFIG_NFS_FS=y | ||
1028 | CONFIG_NFS_V3=y | ||
1029 | # CONFIG_NFS_V3_ACL is not set | ||
1030 | # CONFIG_NFS_V4 is not set | ||
1031 | CONFIG_ROOT_NFS=y | ||
1032 | # CONFIG_NFSD is not set | ||
1033 | CONFIG_LOCKD=y | ||
1034 | CONFIG_LOCKD_V4=y | ||
1035 | CONFIG_NFS_COMMON=y | ||
1036 | CONFIG_SUNRPC=y | ||
1037 | # CONFIG_SUNRPC_REGISTER_V4 is not set | ||
1038 | # CONFIG_RPCSEC_GSS_KRB5 is not set | ||
1039 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
1040 | # CONFIG_SMB_FS is not set | ||
1041 | # CONFIG_CIFS is not set | ||
1042 | # CONFIG_NCP_FS is not set | ||
1043 | # CONFIG_CODA_FS is not set | ||
1044 | # CONFIG_AFS_FS is not set | ||
1045 | |||
1046 | # | ||
1047 | # Partition Types | ||
1048 | # | ||
1049 | # CONFIG_PARTITION_ADVANCED is not set | ||
1050 | CONFIG_MSDOS_PARTITION=y | ||
1051 | CONFIG_NLS=y | ||
1052 | CONFIG_NLS_DEFAULT="iso8859-1" | ||
1053 | CONFIG_NLS_CODEPAGE_437=y | ||
1054 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
1055 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
1056 | CONFIG_NLS_CODEPAGE_850=y | ||
1057 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
1058 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
1059 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
1060 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
1061 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
1062 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
1063 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
1064 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
1065 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
1066 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
1067 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
1068 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
1069 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
1070 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
1071 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
1072 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
1073 | # CONFIG_NLS_ISO8859_8 is not set | ||
1074 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
1075 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
1076 | # CONFIG_NLS_ASCII is not set | ||
1077 | CONFIG_NLS_ISO8859_1=y | ||
1078 | # CONFIG_NLS_ISO8859_2 is not set | ||
1079 | # CONFIG_NLS_ISO8859_3 is not set | ||
1080 | # CONFIG_NLS_ISO8859_4 is not set | ||
1081 | # CONFIG_NLS_ISO8859_5 is not set | ||
1082 | # CONFIG_NLS_ISO8859_6 is not set | ||
1083 | # CONFIG_NLS_ISO8859_7 is not set | ||
1084 | # CONFIG_NLS_ISO8859_9 is not set | ||
1085 | # CONFIG_NLS_ISO8859_13 is not set | ||
1086 | # CONFIG_NLS_ISO8859_14 is not set | ||
1087 | # CONFIG_NLS_ISO8859_15 is not set | ||
1088 | # CONFIG_NLS_KOI8_R is not set | ||
1089 | # CONFIG_NLS_KOI8_U is not set | ||
1090 | CONFIG_NLS_UTF8=y | ||
1091 | # CONFIG_DLM is not set | ||
1092 | |||
1093 | # | ||
1094 | # Kernel hacking | ||
1095 | # | ||
1096 | # CONFIG_PRINTK_TIME is not set | ||
1097 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
1098 | CONFIG_ENABLE_MUST_CHECK=y | ||
1099 | CONFIG_FRAME_WARN=1024 | ||
1100 | # CONFIG_MAGIC_SYSRQ is not set | ||
1101 | # CONFIG_UNUSED_SYMBOLS is not set | ||
1102 | # CONFIG_DEBUG_FS is not set | ||
1103 | # CONFIG_HEADERS_CHECK is not set | ||
1104 | # CONFIG_DEBUG_KERNEL is not set | ||
1105 | # CONFIG_SLUB_DEBUG_ON is not set | ||
1106 | # CONFIG_SLUB_STATS is not set | ||
1107 | # CONFIG_DEBUG_BUGVERBOSE is not set | ||
1108 | # CONFIG_DEBUG_MEMORY_INIT is not set | ||
1109 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
1110 | |||
1111 | # | ||
1112 | # Tracers | ||
1113 | # | ||
1114 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | ||
1115 | # CONFIG_SAMPLES is not set | ||
1116 | |||
1117 | # | ||
1118 | # Security options | ||
1119 | # | ||
1120 | # CONFIG_KEYS is not set | ||
1121 | # CONFIG_SECURITY is not set | ||
1122 | # CONFIG_SECURITYFS is not set | ||
1123 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
1124 | CONFIG_CRYPTO=y | ||
1125 | |||
1126 | # | ||
1127 | # Crypto core or helper | ||
1128 | # | ||
1129 | # CONFIG_CRYPTO_FIPS is not set | ||
1130 | CONFIG_CRYPTO_ALGAPI=y | ||
1131 | CONFIG_CRYPTO_ALGAPI2=y | ||
1132 | CONFIG_CRYPTO_AEAD=y | ||
1133 | CONFIG_CRYPTO_AEAD2=y | ||
1134 | CONFIG_CRYPTO_BLKCIPHER=y | ||
1135 | CONFIG_CRYPTO_BLKCIPHER2=y | ||
1136 | CONFIG_CRYPTO_HASH=y | ||
1137 | CONFIG_CRYPTO_HASH2=y | ||
1138 | CONFIG_CRYPTO_RNG2=y | ||
1139 | CONFIG_CRYPTO_MANAGER=y | ||
1140 | CONFIG_CRYPTO_MANAGER2=y | ||
1141 | # CONFIG_CRYPTO_GF128MUL is not set | ||
1142 | # CONFIG_CRYPTO_NULL is not set | ||
1143 | # CONFIG_CRYPTO_CRYPTD is not set | ||
1144 | CONFIG_CRYPTO_AUTHENC=y | ||
1145 | # CONFIG_CRYPTO_TEST is not set | ||
1146 | |||
1147 | # | ||
1148 | # Authenticated Encryption with Associated Data | ||
1149 | # | ||
1150 | # CONFIG_CRYPTO_CCM is not set | ||
1151 | # CONFIG_CRYPTO_GCM is not set | ||
1152 | # CONFIG_CRYPTO_SEQIV is not set | ||
1153 | |||
1154 | # | ||
1155 | # Block modes | ||
1156 | # | ||
1157 | CONFIG_CRYPTO_CBC=y | ||
1158 | # CONFIG_CRYPTO_CTR is not set | ||
1159 | # CONFIG_CRYPTO_CTS is not set | ||
1160 | # CONFIG_CRYPTO_ECB is not set | ||
1161 | # CONFIG_CRYPTO_LRW is not set | ||
1162 | # CONFIG_CRYPTO_PCBC is not set | ||
1163 | # CONFIG_CRYPTO_XTS is not set | ||
1164 | |||
1165 | # | ||
1166 | # Hash modes | ||
1167 | # | ||
1168 | CONFIG_CRYPTO_HMAC=y | ||
1169 | # CONFIG_CRYPTO_XCBC is not set | ||
1170 | |||
1171 | # | ||
1172 | # Digest | ||
1173 | # | ||
1174 | # CONFIG_CRYPTO_CRC32C is not set | ||
1175 | # CONFIG_CRYPTO_MD4 is not set | ||
1176 | CONFIG_CRYPTO_MD5=y | ||
1177 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
1178 | # CONFIG_CRYPTO_RMD128 is not set | ||
1179 | # CONFIG_CRYPTO_RMD160 is not set | ||
1180 | # CONFIG_CRYPTO_RMD256 is not set | ||
1181 | # CONFIG_CRYPTO_RMD320 is not set | ||
1182 | CONFIG_CRYPTO_SHA1=y | ||
1183 | # CONFIG_CRYPTO_SHA256 is not set | ||
1184 | # CONFIG_CRYPTO_SHA512 is not set | ||
1185 | # CONFIG_CRYPTO_TGR192 is not set | ||
1186 | # CONFIG_CRYPTO_WP512 is not set | ||
1187 | |||
1188 | # | ||
1189 | # Ciphers | ||
1190 | # | ||
1191 | # CONFIG_CRYPTO_AES is not set | ||
1192 | # CONFIG_CRYPTO_ANUBIS is not set | ||
1193 | # CONFIG_CRYPTO_ARC4 is not set | ||
1194 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
1195 | # CONFIG_CRYPTO_CAMELLIA is not set | ||
1196 | # CONFIG_CRYPTO_CAST5 is not set | ||
1197 | # CONFIG_CRYPTO_CAST6 is not set | ||
1198 | CONFIG_CRYPTO_DES=y | ||
1199 | # CONFIG_CRYPTO_FCRYPT is not set | ||
1200 | # CONFIG_CRYPTO_KHAZAD is not set | ||
1201 | # CONFIG_CRYPTO_SALSA20 is not set | ||
1202 | # CONFIG_CRYPTO_SEED is not set | ||
1203 | # CONFIG_CRYPTO_SERPENT is not set | ||
1204 | # CONFIG_CRYPTO_TEA is not set | ||
1205 | # CONFIG_CRYPTO_TWOFISH is not set | ||
1206 | |||
1207 | # | ||
1208 | # Compression | ||
1209 | # | ||
1210 | CONFIG_CRYPTO_DEFLATE=y | ||
1211 | # CONFIG_CRYPTO_LZO is not set | ||
1212 | |||
1213 | # | ||
1214 | # Random Number Generation | ||
1215 | # | ||
1216 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
1217 | # CONFIG_CRYPTO_HW is not set | ||
1218 | |||
1219 | # | ||
1220 | # Library routines | ||
1221 | # | ||
1222 | CONFIG_BITREVERSE=y | ||
1223 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
1224 | # CONFIG_CRC_CCITT is not set | ||
1225 | # CONFIG_CRC16 is not set | ||
1226 | # CONFIG_CRC_T10DIF is not set | ||
1227 | # CONFIG_CRC_ITU_T is not set | ||
1228 | CONFIG_CRC32=y | ||
1229 | # CONFIG_CRC7 is not set | ||
1230 | # CONFIG_LIBCRC32C is not set | ||
1231 | CONFIG_ZLIB_INFLATE=y | ||
1232 | CONFIG_ZLIB_DEFLATE=y | ||
1233 | CONFIG_GENERIC_ALLOCATOR=y | ||
1234 | CONFIG_PLIST=y | ||
1235 | CONFIG_HAS_IOMEM=y | ||
1236 | CONFIG_HAS_IOPORT=y | ||
1237 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/avr32/include/asm/ftrace.h b/arch/avr32/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/avr32/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/avr32/include/asm/hardirq.h b/arch/avr32/include/asm/hardirq.h index 267354356f60..015bc75ea798 100644 --- a/arch/avr32/include/asm/hardirq.h +++ b/arch/avr32/include/asm/hardirq.h | |||
@@ -20,15 +20,4 @@ void ack_bad_irq(unsigned int irq); | |||
20 | 20 | ||
21 | #endif /* __ASSEMBLY__ */ | 21 | #endif /* __ASSEMBLY__ */ |
22 | 22 | ||
23 | #define HARDIRQ_BITS 12 | ||
24 | |||
25 | /* | ||
26 | * The hardirq mask has to be large enough to have | ||
27 | * space for potentially all IRQ sources in the system | ||
28 | * nesting on a single CPU: | ||
29 | */ | ||
30 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
31 | # error HARDIRQ_BITS is too low! | ||
32 | #endif | ||
33 | |||
34 | #endif /* __ASM_AVR32_HARDIRQ_H */ | 23 | #endif /* __ASM_AVR32_HARDIRQ_H */ |
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index 43ae555ecb33..1bbe1da54869 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c | |||
@@ -332,7 +332,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
332 | 332 | ||
333 | asmlinkage void ret_from_fork(void); | 333 | asmlinkage void ret_from_fork(void); |
334 | 334 | ||
335 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 335 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
336 | unsigned long unused, | 336 | unsigned long unused, |
337 | struct task_struct *p, struct pt_regs *regs) | 337 | struct task_struct *p, struct pt_regs *regs) |
338 | { | 338 | { |
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 3fbfd1e32a9e..7cc653798327 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -26,6 +26,9 @@ | |||
26 | #include <mach/portmux.h> | 26 | #include <mach/portmux.h> |
27 | #include <mach/sram.h> | 27 | #include <mach/sram.h> |
28 | 28 | ||
29 | #include <sound/atmel-abdac.h> | ||
30 | #include <sound/atmel-ac97c.h> | ||
31 | |||
29 | #include <video/atmel_lcdc.h> | 32 | #include <video/atmel_lcdc.h> |
30 | 33 | ||
31 | #include "clock.h" | 34 | #include "clock.h" |
@@ -963,56 +966,68 @@ static struct resource atmel_usart3_resource[] = { | |||
963 | DEFINE_DEV_DATA(atmel_usart, 3); | 966 | DEFINE_DEV_DATA(atmel_usart, 3); |
964 | DEV_CLK(usart, atmel_usart3, pba, 6); | 967 | DEV_CLK(usart, atmel_usart3, pba, 6); |
965 | 968 | ||
966 | static inline void configure_usart0_pins(void) | 969 | static inline void configure_usart0_pins(int flags) |
967 | { | 970 | { |
968 | u32 pin_mask = (1 << 8) | (1 << 9); /* RXD & TXD */ | 971 | u32 pin_mask = (1 << 8) | (1 << 9); /* RXD & TXD */ |
972 | if (flags & ATMEL_USART_RTS) pin_mask |= (1 << 6); | ||
973 | if (flags & ATMEL_USART_CTS) pin_mask |= (1 << 7); | ||
974 | if (flags & ATMEL_USART_CLK) pin_mask |= (1 << 10); | ||
969 | 975 | ||
970 | select_peripheral(PIOA, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP); | 976 | select_peripheral(PIOA, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP); |
971 | } | 977 | } |
972 | 978 | ||
973 | static inline void configure_usart1_pins(void) | 979 | static inline void configure_usart1_pins(int flags) |
974 | { | 980 | { |
975 | u32 pin_mask = (1 << 17) | (1 << 18); /* RXD & TXD */ | 981 | u32 pin_mask = (1 << 17) | (1 << 18); /* RXD & TXD */ |
982 | if (flags & ATMEL_USART_RTS) pin_mask |= (1 << 19); | ||
983 | if (flags & ATMEL_USART_CTS) pin_mask |= (1 << 20); | ||
984 | if (flags & ATMEL_USART_CLK) pin_mask |= (1 << 16); | ||
976 | 985 | ||
977 | select_peripheral(PIOA, pin_mask, PERIPH_A, AT32_GPIOF_PULLUP); | 986 | select_peripheral(PIOA, pin_mask, PERIPH_A, AT32_GPIOF_PULLUP); |
978 | } | 987 | } |
979 | 988 | ||
980 | static inline void configure_usart2_pins(void) | 989 | static inline void configure_usart2_pins(int flags) |
981 | { | 990 | { |
982 | u32 pin_mask = (1 << 26) | (1 << 27); /* RXD & TXD */ | 991 | u32 pin_mask = (1 << 26) | (1 << 27); /* RXD & TXD */ |
992 | if (flags & ATMEL_USART_RTS) pin_mask |= (1 << 30); | ||
993 | if (flags & ATMEL_USART_CTS) pin_mask |= (1 << 29); | ||
994 | if (flags & ATMEL_USART_CLK) pin_mask |= (1 << 28); | ||
983 | 995 | ||
984 | select_peripheral(PIOB, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP); | 996 | select_peripheral(PIOB, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP); |
985 | } | 997 | } |
986 | 998 | ||
987 | static inline void configure_usart3_pins(void) | 999 | static inline void configure_usart3_pins(int flags) |
988 | { | 1000 | { |
989 | u32 pin_mask = (1 << 18) | (1 << 17); /* RXD & TXD */ | 1001 | u32 pin_mask = (1 << 18) | (1 << 17); /* RXD & TXD */ |
1002 | if (flags & ATMEL_USART_RTS) pin_mask |= (1 << 16); | ||
1003 | if (flags & ATMEL_USART_CTS) pin_mask |= (1 << 15); | ||
1004 | if (flags & ATMEL_USART_CLK) pin_mask |= (1 << 19); | ||
990 | 1005 | ||
991 | select_peripheral(PIOB, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP); | 1006 | select_peripheral(PIOB, pin_mask, PERIPH_B, AT32_GPIOF_PULLUP); |
992 | } | 1007 | } |
993 | 1008 | ||
994 | static struct platform_device *__initdata at32_usarts[4]; | 1009 | static struct platform_device *__initdata at32_usarts[4]; |
995 | 1010 | ||
996 | void __init at32_map_usart(unsigned int hw_id, unsigned int line) | 1011 | void __init at32_map_usart(unsigned int hw_id, unsigned int line, int flags) |
997 | { | 1012 | { |
998 | struct platform_device *pdev; | 1013 | struct platform_device *pdev; |
999 | 1014 | ||
1000 | switch (hw_id) { | 1015 | switch (hw_id) { |
1001 | case 0: | 1016 | case 0: |
1002 | pdev = &atmel_usart0_device; | 1017 | pdev = &atmel_usart0_device; |
1003 | configure_usart0_pins(); | 1018 | configure_usart0_pins(flags); |
1004 | break; | 1019 | break; |
1005 | case 1: | 1020 | case 1: |
1006 | pdev = &atmel_usart1_device; | 1021 | pdev = &atmel_usart1_device; |
1007 | configure_usart1_pins(); | 1022 | configure_usart1_pins(flags); |
1008 | break; | 1023 | break; |
1009 | case 2: | 1024 | case 2: |
1010 | pdev = &atmel_usart2_device; | 1025 | pdev = &atmel_usart2_device; |
1011 | configure_usart2_pins(); | 1026 | configure_usart2_pins(flags); |
1012 | break; | 1027 | break; |
1013 | case 3: | 1028 | case 3: |
1014 | pdev = &atmel_usart3_device; | 1029 | pdev = &atmel_usart3_device; |
1015 | configure_usart3_pins(); | 1030 | configure_usart3_pins(flags); |
1016 | break; | 1031 | break; |
1017 | default: | 1032 | default: |
1018 | return; | 1033 | return; |
@@ -1753,7 +1768,7 @@ at32_add_device_usba(unsigned int id, struct usba_platform_data *data) | |||
1753 | if (platform_device_add_data(pdev, data, sizeof(usba_data))) | 1768 | if (platform_device_add_data(pdev, data, sizeof(usba_data))) |
1754 | goto out_free_pdev; | 1769 | goto out_free_pdev; |
1755 | 1770 | ||
1756 | if (data->vbus_pin >= 0) | 1771 | if (gpio_is_valid(data->vbus_pin)) |
1757 | at32_select_gpio(data->vbus_pin, 0); | 1772 | at32_select_gpio(data->vbus_pin, 0); |
1758 | 1773 | ||
1759 | usba0_pclk.dev = &pdev->dev; | 1774 | usba0_pclk.dev = &pdev->dev; |
@@ -1980,11 +1995,14 @@ static struct clk atmel_ac97c0_pclk = { | |||
1980 | }; | 1995 | }; |
1981 | 1996 | ||
1982 | struct platform_device *__init | 1997 | struct platform_device *__init |
1983 | at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data) | 1998 | at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data, |
1999 | unsigned int flags) | ||
1984 | { | 2000 | { |
1985 | struct platform_device *pdev; | 2001 | struct platform_device *pdev; |
1986 | struct ac97c_platform_data _data; | 2002 | struct dw_dma_slave *rx_dws; |
1987 | u32 pin_mask; | 2003 | struct dw_dma_slave *tx_dws; |
2004 | struct ac97c_platform_data _data; | ||
2005 | u32 pin_mask; | ||
1988 | 2006 | ||
1989 | if (id != 0) | 2007 | if (id != 0) |
1990 | return NULL; | 2008 | return NULL; |
@@ -1995,37 +2013,52 @@ at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data) | |||
1995 | 2013 | ||
1996 | if (platform_device_add_resources(pdev, atmel_ac97c0_resource, | 2014 | if (platform_device_add_resources(pdev, atmel_ac97c0_resource, |
1997 | ARRAY_SIZE(atmel_ac97c0_resource))) | 2015 | ARRAY_SIZE(atmel_ac97c0_resource))) |
1998 | goto fail; | 2016 | goto out_free_resources; |
1999 | 2017 | ||
2000 | if (!data) { | 2018 | if (!data) { |
2001 | data = &_data; | 2019 | data = &_data; |
2002 | memset(data, 0, sizeof(struct ac97c_platform_data)); | 2020 | memset(data, 0, sizeof(struct ac97c_platform_data)); |
2003 | data->reset_pin = GPIO_PIN_NONE; | 2021 | data->reset_pin = -ENODEV; |
2004 | } | 2022 | } |
2005 | 2023 | ||
2006 | data->dma_rx_periph_id = 3; | 2024 | rx_dws = &data->rx_dws; |
2007 | data->dma_tx_periph_id = 4; | 2025 | tx_dws = &data->tx_dws; |
2008 | data->dma_controller_id = 0; | 2026 | |
2027 | /* Check if DMA slave interface for capture should be configured. */ | ||
2028 | if (flags & AC97C_CAPTURE) { | ||
2029 | rx_dws->dma_dev = &dw_dmac0_device.dev; | ||
2030 | rx_dws->reg_width = DW_DMA_SLAVE_WIDTH_16BIT; | ||
2031 | rx_dws->cfg_hi = DWC_CFGH_SRC_PER(3); | ||
2032 | rx_dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL); | ||
2033 | } | ||
2034 | |||
2035 | /* Check if DMA slave interface for playback should be configured. */ | ||
2036 | if (flags & AC97C_PLAYBACK) { | ||
2037 | tx_dws->dma_dev = &dw_dmac0_device.dev; | ||
2038 | tx_dws->reg_width = DW_DMA_SLAVE_WIDTH_16BIT; | ||
2039 | tx_dws->cfg_hi = DWC_CFGH_DST_PER(4); | ||
2040 | tx_dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL); | ||
2041 | } | ||
2009 | 2042 | ||
2010 | if (platform_device_add_data(pdev, data, | 2043 | if (platform_device_add_data(pdev, data, |
2011 | sizeof(struct ac97c_platform_data))) | 2044 | sizeof(struct ac97c_platform_data))) |
2012 | goto fail; | 2045 | goto out_free_resources; |
2013 | 2046 | ||
2014 | pin_mask = (1 << 20) | (1 << 21); /* SDO & SYNC */ | 2047 | /* SDO | SYNC | SCLK | SDI */ |
2015 | pin_mask |= (1 << 22) | (1 << 23); /* SCLK & SDI */ | 2048 | pin_mask = (1 << 20) | (1 << 21) | (1 << 22) | (1 << 23); |
2016 | 2049 | ||
2017 | select_peripheral(PIOB, pin_mask, PERIPH_B, 0); | 2050 | select_peripheral(PIOB, pin_mask, PERIPH_B, 0); |
2018 | 2051 | ||
2019 | /* TODO: gpio_is_valid(data->reset_pin) with kernel 2.6.26. */ | 2052 | if (gpio_is_valid(data->reset_pin)) |
2020 | if (data->reset_pin != GPIO_PIN_NONE) | 2053 | at32_select_gpio(data->reset_pin, AT32_GPIOF_OUTPUT |
2021 | at32_select_gpio(data->reset_pin, 0); | 2054 | | AT32_GPIOF_HIGH); |
2022 | 2055 | ||
2023 | atmel_ac97c0_pclk.dev = &pdev->dev; | 2056 | atmel_ac97c0_pclk.dev = &pdev->dev; |
2024 | 2057 | ||
2025 | platform_device_add(pdev); | 2058 | platform_device_add(pdev); |
2026 | return pdev; | 2059 | return pdev; |
2027 | 2060 | ||
2028 | fail: | 2061 | out_free_resources: |
2029 | platform_device_put(pdev); | 2062 | platform_device_put(pdev); |
2030 | return NULL; | 2063 | return NULL; |
2031 | } | 2064 | } |
@@ -2053,21 +2086,34 @@ static struct clk abdac0_sample_clk = { | |||
2053 | .index = 6, | 2086 | .index = 6, |
2054 | }; | 2087 | }; |
2055 | 2088 | ||
2056 | struct platform_device *__init at32_add_device_abdac(unsigned int id) | 2089 | struct platform_device *__init |
2090 | at32_add_device_abdac(unsigned int id, struct atmel_abdac_pdata *data) | ||
2057 | { | 2091 | { |
2058 | struct platform_device *pdev; | 2092 | struct platform_device *pdev; |
2059 | u32 pin_mask; | 2093 | struct dw_dma_slave *dws; |
2094 | u32 pin_mask; | ||
2060 | 2095 | ||
2061 | if (id != 0) | 2096 | if (id != 0 || !data) |
2062 | return NULL; | 2097 | return NULL; |
2063 | 2098 | ||
2064 | pdev = platform_device_alloc("abdac", id); | 2099 | pdev = platform_device_alloc("atmel_abdac", id); |
2065 | if (!pdev) | 2100 | if (!pdev) |
2066 | return NULL; | 2101 | return NULL; |
2067 | 2102 | ||
2068 | if (platform_device_add_resources(pdev, abdac0_resource, | 2103 | if (platform_device_add_resources(pdev, abdac0_resource, |
2069 | ARRAY_SIZE(abdac0_resource))) | 2104 | ARRAY_SIZE(abdac0_resource))) |
2070 | goto err_add_resources; | 2105 | goto out_free_resources; |
2106 | |||
2107 | dws = &data->dws; | ||
2108 | |||
2109 | dws->dma_dev = &dw_dmac0_device.dev; | ||
2110 | dws->reg_width = DW_DMA_SLAVE_WIDTH_32BIT; | ||
2111 | dws->cfg_hi = DWC_CFGH_DST_PER(2); | ||
2112 | dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL); | ||
2113 | |||
2114 | if (platform_device_add_data(pdev, data, | ||
2115 | sizeof(struct atmel_abdac_pdata))) | ||
2116 | goto out_free_resources; | ||
2071 | 2117 | ||
2072 | pin_mask = (1 << 20) | (1 << 22); /* DATA1 & DATAN1 */ | 2118 | pin_mask = (1 << 20) | (1 << 22); /* DATA1 & DATAN1 */ |
2073 | pin_mask |= (1 << 21) | (1 << 23); /* DATA0 & DATAN0 */ | 2119 | pin_mask |= (1 << 21) | (1 << 23); /* DATA0 & DATAN0 */ |
@@ -2080,7 +2126,7 @@ struct platform_device *__init at32_add_device_abdac(unsigned int id) | |||
2080 | platform_device_add(pdev); | 2126 | platform_device_add(pdev); |
2081 | return pdev; | 2127 | return pdev; |
2082 | 2128 | ||
2083 | err_add_resources: | 2129 | out_free_resources: |
2084 | platform_device_put(pdev); | 2130 | platform_device_put(pdev); |
2085 | return NULL; | 2131 | return NULL; |
2086 | } | 2132 | } |
diff --git a/arch/avr32/mach-at32ap/include/mach/at32ap700x.h b/arch/avr32/mach-at32ap/include/mach/at32ap700x.h index 5c4c971eed8e..b9222bf895bc 100644 --- a/arch/avr32/mach-at32ap/include/mach/at32ap700x.h +++ b/arch/avr32/mach-at32ap/include/mach/at32ap700x.h | |||
@@ -171,25 +171,49 @@ | |||
171 | ATMEL_LCDC(PE, DATA20) | ATMEL_LCDC(PE, DATA21) | \ | 171 | ATMEL_LCDC(PE, DATA20) | ATMEL_LCDC(PE, DATA21) | \ |
172 | ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23)) | 172 | ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23)) |
173 | 173 | ||
174 | #define ATMEL_LCDC_PRI_15B_DATA ( \ | 174 | #define ATMEL_LCDC_PRI_18B_DATA ( \ |
175 | ATMEL_LCDC(PC, DATA0) | ATMEL_LCDC(PC, DATA1) | \ | ||
176 | ATMEL_LCDC(PC, DATA2) | ATMEL_LCDC(PC, DATA3) | \ | 175 | ATMEL_LCDC(PC, DATA2) | ATMEL_LCDC(PC, DATA3) | \ |
177 | ATMEL_LCDC(PC, DATA4) | ATMEL_LCDC(PC, DATA5) | \ | 176 | ATMEL_LCDC(PC, DATA4) | ATMEL_LCDC(PC, DATA5) | \ |
178 | ATMEL_LCDC(PD, DATA8) | ATMEL_LCDC(PD, DATA9) | \ | 177 | ATMEL_LCDC(PD, DATA6) | ATMEL_LCDC(PD, DATA7) | \ |
179 | ATMEL_LCDC(PD, DATA10) | ATMEL_LCDC(PD, DATA11) | \ | 178 | ATMEL_LCDC(PD, DATA10) | ATMEL_LCDC(PD, DATA11) | \ |
180 | ATMEL_LCDC(PD, DATA12) | ATMEL_LCDC(PD, DATA16) | \ | 179 | ATMEL_LCDC(PD, DATA12) | ATMEL_LCDC(PD, DATA13) | \ |
181 | ATMEL_LCDC(PD, DATA17) | ATMEL_LCDC(PD, DATA18) | \ | 180 | ATMEL_LCDC(PD, DATA14) | ATMEL_LCDC(PD, DATA15) | \ |
182 | ATMEL_LCDC(PD, DATA19) | ATMEL_LCDC(PD, DATA20)) | 181 | ATMEL_LCDC(PD, DATA18) | ATMEL_LCDC(PD, DATA19) | \ |
182 | ATMEL_LCDC(PD, DATA20) | ATMEL_LCDC(PD, DATA21) | \ | ||
183 | ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23)) | ||
183 | 184 | ||
184 | #define ATMEL_LCDC_ALT_15B_DATA ( \ | 185 | #define ATMEL_LCDC_ALT_18B_DATA ( \ |
185 | ATMEL_LCDC(PE, DATA0) | ATMEL_LCDC(PE, DATA1) | \ | ||
186 | ATMEL_LCDC(PE, DATA2) | ATMEL_LCDC(PE, DATA3) | \ | 186 | ATMEL_LCDC(PE, DATA2) | ATMEL_LCDC(PE, DATA3) | \ |
187 | ATMEL_LCDC(PE, DATA4) | ATMEL_LCDC(PC, DATA5) | \ | 187 | ATMEL_LCDC(PE, DATA4) | ATMEL_LCDC(PC, DATA5) | \ |
188 | ATMEL_LCDC(PE, DATA8) | ATMEL_LCDC(PE, DATA9) | \ | 188 | ATMEL_LCDC(PD, DATA6) | ATMEL_LCDC(PD, DATA7) | \ |
189 | ATMEL_LCDC(PE, DATA10) | ATMEL_LCDC(PE, DATA11) | \ | 189 | ATMEL_LCDC(PE, DATA10) | ATMEL_LCDC(PE, DATA11) | \ |
190 | ATMEL_LCDC(PE, DATA12) | ATMEL_LCDC(PE, DATA16) | \ | 190 | ATMEL_LCDC(PE, DATA12) | ATMEL_LCDC(PD, DATA13) | \ |
191 | ATMEL_LCDC(PE, DATA17) | ATMEL_LCDC(PE, DATA18) | \ | 191 | ATMEL_LCDC(PD, DATA14) | ATMEL_LCDC(PD, DATA15) | \ |
192 | ATMEL_LCDC(PE, DATA19) | ATMEL_LCDC(PE, DATA20)) | 192 | ATMEL_LCDC(PE, DATA18) | ATMEL_LCDC(PE, DATA19) | \ |
193 | ATMEL_LCDC(PE, DATA20) | ATMEL_LCDC(PE, DATA21) | \ | ||
194 | ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23)) | ||
195 | |||
196 | #define ATMEL_LCDC_PRI_15B_DATA ( \ | ||
197 | ATMEL_LCDC(PC, DATA3) | ATMEL_LCDC(PC, DATA4) | \ | ||
198 | ATMEL_LCDC(PC, DATA5) | ATMEL_LCDC(PD, DATA6) | \ | ||
199 | ATMEL_LCDC(PD, DATA7) | \ | ||
200 | ATMEL_LCDC(PD, DATA11) | ATMEL_LCDC(PD, DATA12) | \ | ||
201 | ATMEL_LCDC(PD, DATA13) | ATMEL_LCDC(PD, DATA14) | \ | ||
202 | ATMEL_LCDC(PD, DATA15) | \ | ||
203 | ATMEL_LCDC(PD, DATA19) | ATMEL_LCDC(PD, DATA20) | \ | ||
204 | ATMEL_LCDC(PD, DATA21) | ATMEL_LCDC(PD, DATA22) | \ | ||
205 | ATMEL_LCDC(PD, DATA23)) | ||
206 | |||
207 | #define ATMEL_LCDC_ALT_15B_DATA ( \ | ||
208 | ATMEL_LCDC(PE, DATA3) | ATMEL_LCDC(PE, DATA4) | \ | ||
209 | ATMEL_LCDC(PC, DATA5) | ATMEL_LCDC(PD, DATA6) | \ | ||
210 | ATMEL_LCDC(PD, DATA7) | \ | ||
211 | ATMEL_LCDC(PE, DATA11) | ATMEL_LCDC(PE, DATA12) | \ | ||
212 | ATMEL_LCDC(PD, DATA13) | ATMEL_LCDC(PD, DATA14) | \ | ||
213 | ATMEL_LCDC(PD, DATA15) | \ | ||
214 | ATMEL_LCDC(PE, DATA19) | ATMEL_LCDC(PE, DATA20) | \ | ||
215 | ATMEL_LCDC(PE, DATA21) | ATMEL_LCDC(PD, DATA22) | \ | ||
216 | ATMEL_LCDC(PD, DATA23)) | ||
193 | 217 | ||
194 | #define ATMEL_LCDC_PRI_CONTROL ( \ | 218 | #define ATMEL_LCDC_PRI_CONTROL ( \ |
195 | ATMEL_LCDC(PC, CC) | ATMEL_LCDC(PC, DVAL) | \ | 219 | ATMEL_LCDC(PC, CC) | ATMEL_LCDC(PC, DVAL) | \ |
@@ -207,6 +231,10 @@ | |||
207 | 231 | ||
208 | #define ATMEL_LCDC_ALT_24BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_24B_DATA) | 232 | #define ATMEL_LCDC_ALT_24BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_24B_DATA) |
209 | 233 | ||
234 | #define ATMEL_LCDC_PRI_18BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_PRI_18B_DATA) | ||
235 | |||
236 | #define ATMEL_LCDC_ALT_18BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_18B_DATA) | ||
237 | |||
210 | #define ATMEL_LCDC_PRI_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_PRI_15B_DATA) | 238 | #define ATMEL_LCDC_PRI_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_PRI_15B_DATA) |
211 | 239 | ||
212 | #define ATMEL_LCDC_ALT_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_15B_DATA) | 240 | #define ATMEL_LCDC_ALT_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_15B_DATA) |
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index cff8e84f78f2..0b8164281899 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -13,7 +13,7 @@ | |||
13 | * in this array is chip-dependent. | 13 | * in this array is chip-dependent. |
14 | */ | 14 | */ |
15 | extern unsigned long at32_board_osc_rates[]; | 15 | extern unsigned long at32_board_osc_rates[]; |
16 | 16 | ||
17 | /* | 17 | /* |
18 | * This used to add essential system devices, but this is now done | 18 | * This used to add essential system devices, but this is now done |
19 | * automatically. Please don't use it in new board code. | 19 | * automatically. Please don't use it in new board code. |
@@ -26,12 +26,17 @@ static inline void __deprecated at32_add_system_devices(void) | |||
26 | #define ATMEL_MAX_UART 4 | 26 | #define ATMEL_MAX_UART 4 |
27 | extern struct platform_device *atmel_default_console_device; | 27 | extern struct platform_device *atmel_default_console_device; |
28 | 28 | ||
29 | /* Flags for selecting USART extra pins */ | ||
30 | #define ATMEL_USART_RTS 0x01 | ||
31 | #define ATMEL_USART_CTS 0x02 | ||
32 | #define ATMEL_USART_CLK 0x03 | ||
33 | |||
29 | struct atmel_uart_data { | 34 | struct atmel_uart_data { |
30 | short use_dma_tx; /* use transmit DMA? */ | 35 | short use_dma_tx; /* use transmit DMA? */ |
31 | short use_dma_rx; /* use receive DMA? */ | 36 | short use_dma_rx; /* use receive DMA? */ |
32 | void __iomem *regs; /* virtual base address, if any */ | 37 | void __iomem *regs; /* virtual base address, if any */ |
33 | }; | 38 | }; |
34 | void at32_map_usart(unsigned int hw_id, unsigned int line); | 39 | void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); |
35 | struct platform_device *at32_add_device_usart(unsigned int id); | 40 | struct platform_device *at32_add_device_usart(unsigned int id); |
36 | 41 | ||
37 | struct eth_platform_data { | 42 | struct eth_platform_data { |
@@ -88,16 +93,15 @@ struct mci_platform_data; | |||
88 | struct platform_device * | 93 | struct platform_device * |
89 | at32_add_device_mci(unsigned int id, struct mci_platform_data *data); | 94 | at32_add_device_mci(unsigned int id, struct mci_platform_data *data); |
90 | 95 | ||
91 | struct ac97c_platform_data { | 96 | struct ac97c_platform_data; |
92 | unsigned short dma_rx_periph_id; | 97 | struct platform_device * |
93 | unsigned short dma_tx_periph_id; | 98 | at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data, |
94 | unsigned short dma_controller_id; | 99 | unsigned int flags); |
95 | int reset_pin; | 100 | |
96 | }; | 101 | struct atmel_abdac_pdata; |
97 | struct platform_device * | 102 | struct platform_device * |
98 | at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data); | 103 | at32_add_device_abdac(unsigned int id, struct atmel_abdac_pdata *data); |
99 | 104 | ||
100 | struct platform_device *at32_add_device_abdac(unsigned int id); | ||
101 | struct platform_device *at32_add_device_psif(unsigned int id); | 105 | struct platform_device *at32_add_device_psif(unsigned int id); |
102 | 106 | ||
103 | struct cf_platform_data { | 107 | struct cf_platform_data { |
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index 0c1f86e3e44a..3640cdc38aac 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -777,7 +777,7 @@ config CACHELINE_ALIGNED_L1 | |||
777 | default n if BF54x | 777 | default n if BF54x |
778 | depends on !BF531 | 778 | depends on !BF531 |
779 | help | 779 | help |
780 | If enabled, cacheline_anligned data is linked | 780 | If enabled, cacheline_aligned data is linked |
781 | into L1 data memory. (less latency) | 781 | into L1 data memory. (less latency) |
782 | 782 | ||
783 | config SYSCALL_TAB_L1 | 783 | config SYSCALL_TAB_L1 |
@@ -957,7 +957,7 @@ config MPU | |||
957 | memory they do not own. This comes at a performance penalty | 957 | memory they do not own. This comes at a performance penalty |
958 | and is recommended only for debugging. | 958 | and is recommended only for debugging. |
959 | 959 | ||
960 | comment "Asynchonous Memory Configuration" | 960 | comment "Asynchronous Memory Configuration" |
961 | 961 | ||
962 | menu "EBIU_AMGCTL Global Control" | 962 | menu "EBIU_AMGCTL Global Control" |
963 | config C_AMCKEN | 963 | config C_AMCKEN |
@@ -989,7 +989,7 @@ config C_B3PEN | |||
989 | default n | 989 | default n |
990 | 990 | ||
991 | choice | 991 | choice |
992 | prompt"Enable Asynchonous Memory Banks" | 992 | prompt "Enable Asynchronous Memory Banks" |
993 | default C_AMBEN_ALL | 993 | default C_AMBEN_ALL |
994 | 994 | ||
995 | config C_AMBEN | 995 | config C_AMBEN |
diff --git a/arch/blackfin/include/asm/ftrace.h b/arch/blackfin/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/blackfin/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index 33e2e8993f7f..f49427293ca1 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c | |||
@@ -193,7 +193,7 @@ asmlinkage int bfin_clone(struct pt_regs *regs) | |||
193 | } | 193 | } |
194 | 194 | ||
195 | int | 195 | int |
196 | copy_thread(int nr, unsigned long clone_flags, | 196 | copy_thread(unsigned long clone_flags, |
197 | unsigned long usp, unsigned long topstk, | 197 | unsigned long usp, unsigned long topstk, |
198 | struct task_struct *p, struct pt_regs *regs) | 198 | struct task_struct *p, struct pt_regs *regs) |
199 | { | 199 | { |
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 3462245fe9fb..7adac388a771 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -438,7 +438,7 @@ config ETRAX_SERIAL_PORT0_DMA1_IN | |||
438 | help | 438 | help |
439 | Enables the DMA1 input channel for ser0 (ttyS0). | 439 | Enables the DMA1 input channel for ser0 (ttyS0). |
440 | If you do not enable DMA, an interrupt for each character will be | 440 | If you do not enable DMA, an interrupt for each character will be |
441 | used when receiveing data. | 441 | used when receiving data. |
442 | Normally you want to use DMA, unless you use the DMA channel for | 442 | Normally you want to use DMA, unless you use the DMA channel for |
443 | something else. | 443 | something else. |
444 | 444 | ||
@@ -565,7 +565,7 @@ config ETRAX_SERIAL_PORT2_DMA7_IN | |||
565 | help | 565 | help |
566 | Enables the DMA7 input channel for ser2 (ttyS2). | 566 | Enables the DMA7 input channel for ser2 (ttyS2). |
567 | If you do not enable DMA, an interrupt for each character will be | 567 | If you do not enable DMA, an interrupt for each character will be |
568 | used when receiveing data. | 568 | used when receiving data. |
569 | Normally you want to use DMA, unless you use the DMA channel for | 569 | Normally you want to use DMA, unless you use the DMA channel for |
570 | something else. | 570 | something else. |
571 | 571 | ||
@@ -604,7 +604,7 @@ config ETRAX_SERIAL_PORT3_DMA3_IN | |||
604 | help | 604 | help |
605 | Enables the DMA3 input channel for ser3 (ttyS3). | 605 | Enables the DMA3 input channel for ser3 (ttyS3). |
606 | If you do not enable DMA, an interrupt for each character will be | 606 | If you do not enable DMA, an interrupt for each character will be |
607 | used when receiveing data. | 607 | used when receiving data. |
608 | Normally you want to use DMA, unless you use the DMA channel for | 608 | Normally you want to use DMA, unless you use the DMA channel for |
609 | something else. | 609 | something else. |
610 | 610 | ||
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index bd9b3ff63f6c..c4c69cf721e5 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c | |||
@@ -115,7 +115,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
115 | */ | 115 | */ |
116 | asmlinkage void ret_from_fork(void); | 116 | asmlinkage void ret_from_fork(void); |
117 | 117 | ||
118 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 118 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
119 | unsigned long unused, | 119 | unsigned long unused, |
120 | struct task_struct *p, struct pt_regs *regs) | 120 | struct task_struct *p, struct pt_regs *regs) |
121 | { | 121 | { |
diff --git a/arch/cris/arch-v32/Kconfig b/arch/cris/arch-v32/Kconfig index 005ed2b3f7f4..21bbd93be34f 100644 --- a/arch/cris/arch-v32/Kconfig +++ b/arch/cris/arch-v32/Kconfig | |||
@@ -28,7 +28,7 @@ config ETRAX_NBR_LED_GRP_ONE | |||
28 | help | 28 | help |
29 | Select this if you want one Ethernet LED group. This LED group | 29 | Select this if you want one Ethernet LED group. This LED group |
30 | can be used for one or more Ethernet interfaces. However, it is | 30 | can be used for one or more Ethernet interfaces. However, it is |
31 | recomended that each Ethernet interface use a dedicated LED group. | 31 | recommended that each Ethernet interface use a dedicated LED group. |
32 | 32 | ||
33 | config ETRAX_NBR_LED_GRP_TWO | 33 | config ETRAX_NBR_LED_GRP_TWO |
34 | bool "Use two LED groups" | 34 | bool "Use two LED groups" |
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig index 7a64fcef9d07..b9e328e688be 100644 --- a/arch/cris/arch-v32/drivers/Kconfig +++ b/arch/cris/arch-v32/drivers/Kconfig | |||
@@ -342,7 +342,7 @@ config ETRAX_SERIAL_PORT4_DMA9_IN | |||
342 | help | 342 | help |
343 | Enables the DMA9 input channel for ser4 (ttyS4). | 343 | Enables the DMA9 input channel for ser4 (ttyS4). |
344 | If you do not enable DMA, an interrupt for each character will be | 344 | If you do not enable DMA, an interrupt for each character will be |
345 | used when receiveing data. | 345 | used when receiving data. |
346 | Normally you want to use DMA, unless you use the DMA channel for | 346 | Normally you want to use DMA, unless you use the DMA channel for |
347 | something else. | 347 | something else. |
348 | 348 | ||
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c index ced5b725d9bd..120e7f796fea 100644 --- a/arch/cris/arch-v32/kernel/process.c +++ b/arch/cris/arch-v32/kernel/process.c | |||
@@ -131,7 +131,7 @@ kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
131 | extern asmlinkage void ret_from_fork(void); | 131 | extern asmlinkage void ret_from_fork(void); |
132 | 132 | ||
133 | int | 133 | int |
134 | copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 134 | copy_thread(unsigned long clone_flags, unsigned long usp, |
135 | unsigned long unused, | 135 | unsigned long unused, |
136 | struct task_struct *p, struct pt_regs *regs) | 136 | struct task_struct *p, struct pt_regs *regs) |
137 | { | 137 | { |
diff --git a/arch/cris/arch-v32/mach-fs/Kconfig b/arch/cris/arch-v32/mach-fs/Kconfig index f6d74475f1c6..774de82abef6 100644 --- a/arch/cris/arch-v32/mach-fs/Kconfig +++ b/arch/cris/arch-v32/mach-fs/Kconfig | |||
@@ -59,7 +59,7 @@ config ETRAX_SDRAM_GRP1_CONFIG | |||
59 | depends on ETRAX_ARCH_V32 | 59 | depends on ETRAX_ARCH_V32 |
60 | default "0" | 60 | default "0" |
61 | help | 61 | help |
62 | SDRAM configuration for group 1. The defult value is 0 | 62 | SDRAM configuration for group 1. The default value is 0 |
63 | because group 1 is not used in the default configuration, | 63 | because group 1 is not used in the default configuration, |
64 | described in the help for SDRAM_GRP0_CONFIG. | 64 | described in the help for SDRAM_GRP0_CONFIG. |
65 | 65 | ||
diff --git a/arch/cris/include/arch-v32/arch/spinlock.h b/arch/cris/include/arch-v32/arch/spinlock.h index 0d5709b983a1..129756b96661 100644 --- a/arch/cris/include/arch-v32/arch/spinlock.h +++ b/arch/cris/include/arch-v32/arch/spinlock.h | |||
@@ -121,6 +121,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
121 | return 1; | 121 | return 1; |
122 | } | 122 | } |
123 | 123 | ||
124 | #define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock) | ||
125 | #define _raw_write_lock_flags(lock, flags) _raw_write_lock(lock) | ||
124 | 126 | ||
125 | #define _raw_spin_relax(lock) cpu_relax() | 127 | #define _raw_spin_relax(lock) cpu_relax() |
126 | #define _raw_read_relax(lock) cpu_relax() | 128 | #define _raw_read_relax(lock) cpu_relax() |
diff --git a/arch/cris/include/asm/ftrace.h b/arch/cris/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/cris/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c index 60816e876455..4df0b320d524 100644 --- a/arch/cris/kernel/process.c +++ b/arch/cris/kernel/process.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <asm/system.h> | 19 | #include <asm/system.h> |
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
22 | #include <linux/fs_struct.h> | ||
23 | #include <linux/init_task.h> | 22 | #include <linux/init_task.h> |
24 | #include <linux/sched.h> | 23 | #include <linux/sched.h> |
25 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index 9583a338e9d6..0de50df74970 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c | |||
@@ -204,7 +204,7 @@ void prepare_to_copy(struct task_struct *tsk) | |||
204 | /* | 204 | /* |
205 | * set up the kernel stack and exception frames for a new process | 205 | * set up the kernel stack and exception frames for a new process |
206 | */ | 206 | */ |
207 | int copy_thread(int nr, unsigned long clone_flags, | 207 | int copy_thread(unsigned long clone_flags, |
208 | unsigned long usp, unsigned long topstk, | 208 | unsigned long usp, unsigned long topstk, |
209 | struct task_struct *p, struct pt_regs *regs) | 209 | struct task_struct *p, struct pt_regs *regs) |
210 | { | 210 | { |
diff --git a/arch/h8300/include/asm/ftrace.h b/arch/h8300/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/h8300/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index a8ef654a5a0b..e2f33d0f9969 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
@@ -191,7 +191,7 @@ asmlinkage int h8300_clone(struct pt_regs *regs) | |||
191 | 191 | ||
192 | } | 192 | } |
193 | 193 | ||
194 | int copy_thread(int nr, unsigned long clone_flags, | 194 | int copy_thread(unsigned long clone_flags, |
195 | unsigned long usp, unsigned long topstk, | 195 | unsigned long usp, unsigned long topstk, |
196 | struct task_struct * p, struct pt_regs * regs) | 196 | struct task_struct * p, struct pt_regs * regs) |
197 | { | 197 | { |
diff --git a/arch/h8300/kernel/timer/tpu.c b/arch/h8300/kernel/timer/tpu.c index ad383caae196..e7c6e614a758 100644 --- a/arch/h8300/kernel/timer/tpu.c +++ b/arch/h8300/kernel/timer/tpu.c | |||
@@ -67,7 +67,7 @@ static struct irqaction tpu_irq = { | |||
67 | .flags = IRQF_DISABLED | IRQF_TIMER, | 67 | .flags = IRQF_DISABLED | IRQF_TIMER, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | const static int __initdata divide_rate[] = { | 70 | static const int __initdata divide_rate[] = { |
71 | #if CONFIG_H8300_TPU_CH == 0 | 71 | #if CONFIG_H8300_TPU_CH == 0 |
72 | 1,4,16,64,0,0,0,0, | 72 | 1,4,16,64,0,0,0,0, |
73 | #elif (CONFIG_H8300_TPU_CH == 1) || (CONFIG_H8300_TPU_CH == 5) | 73 | #elif (CONFIG_H8300_TPU_CH == 1) || (CONFIG_H8300_TPU_CH == 5) |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 153e727a6e8e..294a3b13ecac 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -22,6 +22,9 @@ config IA64 | |||
22 | select HAVE_OPROFILE | 22 | select HAVE_OPROFILE |
23 | select HAVE_KPROBES | 23 | select HAVE_KPROBES |
24 | select HAVE_KRETPROBES | 24 | select HAVE_KRETPROBES |
25 | select HAVE_FTRACE_MCOUNT_RECORD | ||
26 | select HAVE_DYNAMIC_FTRACE if (!ITANIUM) | ||
27 | select HAVE_FUNCTION_TRACER | ||
25 | select HAVE_DMA_ATTRS | 28 | select HAVE_DMA_ATTRS |
26 | select HAVE_KVM | 29 | select HAVE_KVM |
27 | select HAVE_ARCH_TRACEHOOK | 30 | select HAVE_ARCH_TRACEHOOK |
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig index a109db30ce55..75645495c2dd 100644 --- a/arch/ia64/configs/generic_defconfig +++ b/arch/ia64/configs/generic_defconfig | |||
@@ -193,7 +193,6 @@ CONFIG_BOUNCE=y | |||
193 | CONFIG_NR_QUICK=1 | 193 | CONFIG_NR_QUICK=1 |
194 | CONFIG_VIRT_TO_BUS=y | 194 | CONFIG_VIRT_TO_BUS=y |
195 | CONFIG_UNEVICTABLE_LRU=y | 195 | CONFIG_UNEVICTABLE_LRU=y |
196 | CONFIG_MMU_NOTIFIER=y | ||
197 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | 196 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y |
198 | CONFIG_ARCH_DISCONTIGMEM_ENABLE=y | 197 | CONFIG_ARCH_DISCONTIGMEM_ENABLE=y |
199 | CONFIG_ARCH_FLATMEM_ENABLE=y | 198 | CONFIG_ARCH_FLATMEM_ENABLE=y |
@@ -416,8 +415,6 @@ CONFIG_SGI_IOC4=y | |||
416 | # CONFIG_ENCLOSURE_SERVICES is not set | 415 | # CONFIG_ENCLOSURE_SERVICES is not set |
417 | CONFIG_SGI_XP=m | 416 | CONFIG_SGI_XP=m |
418 | # CONFIG_HP_ILO is not set | 417 | # CONFIG_HP_ILO is not set |
419 | CONFIG_SGI_GRU=m | ||
420 | # CONFIG_SGI_GRU_DEBUG is not set | ||
421 | # CONFIG_C2PORT is not set | 418 | # CONFIG_C2PORT is not set |
422 | CONFIG_HAVE_IDE=y | 419 | CONFIG_HAVE_IDE=y |
423 | CONFIG_IDE=y | 420 | CONFIG_IDE=y |
diff --git a/arch/ia64/include/asm/ftrace.h b/arch/ia64/include/asm/ftrace.h new file mode 100644 index 000000000000..d20db3c2a656 --- /dev/null +++ b/arch/ia64/include/asm/ftrace.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef _ASM_IA64_FTRACE_H | ||
2 | #define _ASM_IA64_FTRACE_H | ||
3 | |||
4 | #ifdef CONFIG_FUNCTION_TRACER | ||
5 | #define MCOUNT_INSN_SIZE 32 /* sizeof mcount call */ | ||
6 | |||
7 | #ifndef __ASSEMBLY__ | ||
8 | extern void _mcount(unsigned long pfs, unsigned long r1, unsigned long b0, unsigned long r0); | ||
9 | #define mcount _mcount | ||
10 | |||
11 | #include <asm/kprobes.h> | ||
12 | /* In IA64, MCOUNT_ADDR is set in link time, so it's not a constant at compile time */ | ||
13 | #define MCOUNT_ADDR (((struct fnptr *)mcount)->ip) | ||
14 | #define FTRACE_ADDR (((struct fnptr *)ftrace_caller)->ip) | ||
15 | |||
16 | static inline unsigned long ftrace_call_adjust(unsigned long addr) | ||
17 | { | ||
18 | /* second bundle, insn 2 */ | ||
19 | return addr - 0x12; | ||
20 | } | ||
21 | |||
22 | struct dyn_arch_ftrace { | ||
23 | }; | ||
24 | #endif | ||
25 | |||
26 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
27 | |||
28 | #endif /* _ASM_IA64_FTRACE_H */ | ||
diff --git a/arch/ia64/include/asm/hardirq.h b/arch/ia64/include/asm/hardirq.h index 140e495b8e0e..d514cd9edb49 100644 --- a/arch/ia64/include/asm/hardirq.h +++ b/arch/ia64/include/asm/hardirq.h | |||
@@ -20,16 +20,6 @@ | |||
20 | 20 | ||
21 | #define local_softirq_pending() (local_cpu_data->softirq_pending) | 21 | #define local_softirq_pending() (local_cpu_data->softirq_pending) |
22 | 22 | ||
23 | #define HARDIRQ_BITS 14 | ||
24 | |||
25 | /* | ||
26 | * The hardirq mask has to be large enough to have space for potentially all IRQ sources | ||
27 | * in the system nesting on a single CPU: | ||
28 | */ | ||
29 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
30 | # error HARDIRQ_BITS is too low! | ||
31 | #endif | ||
32 | |||
33 | extern void __iomem *ipi_base_addr; | 23 | extern void __iomem *ipi_base_addr; |
34 | 24 | ||
35 | void ack_bad_irq(unsigned int irq); | 25 | void ack_bad_irq(unsigned int irq); |
diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h index 0229fb95fb38..13ab71576bc7 100644 --- a/arch/ia64/include/asm/spinlock.h +++ b/arch/ia64/include/asm/spinlock.h | |||
@@ -120,6 +120,38 @@ do { \ | |||
120 | #define __raw_read_can_lock(rw) (*(volatile int *)(rw) >= 0) | 120 | #define __raw_read_can_lock(rw) (*(volatile int *)(rw) >= 0) |
121 | #define __raw_write_can_lock(rw) (*(volatile int *)(rw) == 0) | 121 | #define __raw_write_can_lock(rw) (*(volatile int *)(rw) == 0) |
122 | 122 | ||
123 | #ifdef ASM_SUPPORTED | ||
124 | |||
125 | static __always_inline void | ||
126 | __raw_read_lock_flags(raw_rwlock_t *lock, unsigned long flags) | ||
127 | { | ||
128 | __asm__ __volatile__ ( | ||
129 | "tbit.nz p6, p0 = %1,%2\n" | ||
130 | "br.few 3f\n" | ||
131 | "1:\n" | ||
132 | "fetchadd4.rel r2 = [%0], -1;;\n" | ||
133 | "(p6) ssm psr.i\n" | ||
134 | "2:\n" | ||
135 | "hint @pause\n" | ||
136 | "ld4 r2 = [%0];;\n" | ||
137 | "cmp4.lt p7,p0 = r2, r0\n" | ||
138 | "(p7) br.cond.spnt.few 2b\n" | ||
139 | "(p6) rsm psr.i\n" | ||
140 | ";;\n" | ||
141 | "3:\n" | ||
142 | "fetchadd4.acq r2 = [%0], 1;;\n" | ||
143 | "cmp4.lt p7,p0 = r2, r0\n" | ||
144 | "(p7) br.cond.spnt.few 1b\n" | ||
145 | : : "r"(lock), "r"(flags), "i"(IA64_PSR_I_BIT) | ||
146 | : "p6", "p7", "r2", "memory"); | ||
147 | } | ||
148 | |||
149 | #define __raw_read_lock(lock) __raw_read_lock_flags(lock, 0) | ||
150 | |||
151 | #else /* !ASM_SUPPORTED */ | ||
152 | |||
153 | #define __raw_read_lock_flags(rw, flags) __raw_read_lock(rw) | ||
154 | |||
123 | #define __raw_read_lock(rw) \ | 155 | #define __raw_read_lock(rw) \ |
124 | do { \ | 156 | do { \ |
125 | raw_rwlock_t *__read_lock_ptr = (rw); \ | 157 | raw_rwlock_t *__read_lock_ptr = (rw); \ |
@@ -131,6 +163,8 @@ do { \ | |||
131 | } \ | 163 | } \ |
132 | } while (0) | 164 | } while (0) |
133 | 165 | ||
166 | #endif /* !ASM_SUPPORTED */ | ||
167 | |||
134 | #define __raw_read_unlock(rw) \ | 168 | #define __raw_read_unlock(rw) \ |
135 | do { \ | 169 | do { \ |
136 | raw_rwlock_t *__read_lock_ptr = (rw); \ | 170 | raw_rwlock_t *__read_lock_ptr = (rw); \ |
@@ -138,20 +172,33 @@ do { \ | |||
138 | } while (0) | 172 | } while (0) |
139 | 173 | ||
140 | #ifdef ASM_SUPPORTED | 174 | #ifdef ASM_SUPPORTED |
141 | #define __raw_write_lock(rw) \ | 175 | |
142 | do { \ | 176 | static __always_inline void |
143 | __asm__ __volatile__ ( \ | 177 | __raw_write_lock_flags(raw_rwlock_t *lock, unsigned long flags) |
144 | "mov ar.ccv = r0\n" \ | 178 | { |
145 | "dep r29 = -1, r0, 31, 1;;\n" \ | 179 | __asm__ __volatile__ ( |
146 | "1:\n" \ | 180 | "tbit.nz p6, p0 = %1, %2\n" |
147 | "ld4 r2 = [%0];;\n" \ | 181 | "mov ar.ccv = r0\n" |
148 | "cmp4.eq p0,p7 = r0,r2\n" \ | 182 | "dep r29 = -1, r0, 31, 1\n" |
149 | "(p7) br.cond.spnt.few 1b \n" \ | 183 | "br.few 3f;;\n" |
150 | "cmpxchg4.acq r2 = [%0], r29, ar.ccv;;\n" \ | 184 | "1:\n" |
151 | "cmp4.eq p0,p7 = r0, r2\n" \ | 185 | "(p6) ssm psr.i\n" |
152 | "(p7) br.cond.spnt.few 1b;;\n" \ | 186 | "2:\n" |
153 | :: "r"(rw) : "ar.ccv", "p7", "r2", "r29", "memory"); \ | 187 | "hint @pause\n" |
154 | } while(0) | 188 | "ld4 r2 = [%0];;\n" |
189 | "cmp4.eq p0,p7 = r0, r2\n" | ||
190 | "(p7) br.cond.spnt.few 2b\n" | ||
191 | "(p6) rsm psr.i\n" | ||
192 | ";;\n" | ||
193 | "3:\n" | ||
194 | "cmpxchg4.acq r2 = [%0], r29, ar.ccv;;\n" | ||
195 | "cmp4.eq p0,p7 = r0, r2\n" | ||
196 | "(p7) br.cond.spnt.few 1b;;\n" | ||
197 | : : "r"(lock), "r"(flags), "i"(IA64_PSR_I_BIT) | ||
198 | : "ar.ccv", "p6", "p7", "r2", "r29", "memory"); | ||
199 | } | ||
200 | |||
201 | #define __raw_write_lock(rw) __raw_write_lock_flags(rw, 0) | ||
155 | 202 | ||
156 | #define __raw_write_trylock(rw) \ | 203 | #define __raw_write_trylock(rw) \ |
157 | ({ \ | 204 | ({ \ |
@@ -174,6 +221,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *x) | |||
174 | 221 | ||
175 | #else /* !ASM_SUPPORTED */ | 222 | #else /* !ASM_SUPPORTED */ |
176 | 223 | ||
224 | #define __raw_write_lock_flags(l, flags) __raw_write_lock(l) | ||
225 | |||
177 | #define __raw_write_lock(l) \ | 226 | #define __raw_write_lock(l) \ |
178 | ({ \ | 227 | ({ \ |
179 | __u64 ia64_val, ia64_set_val = ia64_dep_mi(-1, 0, 31, 1); \ | 228 | __u64 ia64_val, ia64_set_val = ia64_dep_mi(-1, 0, 31, 1); \ |
diff --git a/arch/ia64/include/asm/uv/uv_hub.h b/arch/ia64/include/asm/uv/uv_hub.h index f607018af4a1..53e9dfacd073 100644 --- a/arch/ia64/include/asm/uv/uv_hub.h +++ b/arch/ia64/include/asm/uv/uv_hub.h | |||
@@ -305,5 +305,11 @@ static inline int uv_num_possible_blades(void) | |||
305 | return 1; | 305 | return 1; |
306 | } | 306 | } |
307 | 307 | ||
308 | static inline void uv_hub_send_ipi(int pnode, int apicid, int vector) | ||
309 | { | ||
310 | /* not currently needed on ia64 */ | ||
311 | } | ||
312 | |||
313 | |||
308 | #endif /* __ASM_IA64_UV_HUB__ */ | 314 | #endif /* __ASM_IA64_UV_HUB__ */ |
309 | 315 | ||
diff --git a/arch/ia64/include/asm/uv/uv_mmrs.h b/arch/ia64/include/asm/uv/uv_mmrs.h index c149ef085437..fe0b8f05e1a8 100644 --- a/arch/ia64/include/asm/uv/uv_mmrs.h +++ b/arch/ia64/include/asm/uv/uv_mmrs.h | |||
@@ -8,8 +8,8 @@ | |||
8 | * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. | 8 | * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef __ASM_IA64_UV_MMRS__ | 11 | #ifndef _ASM_IA64_UV_UV_MMRS_H |
12 | #define __ASM_IA64_UV_MMRS__ | 12 | #define _ASM_IA64_UV_UV_MMRS_H |
13 | 13 | ||
14 | #define UV_MMR_ENABLE (1UL << 63) | 14 | #define UV_MMR_ENABLE (1UL << 63) |
15 | 15 | ||
@@ -243,6 +243,158 @@ union uvh_event_occurred0_u { | |||
243 | #define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0 | 243 | #define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0 |
244 | 244 | ||
245 | /* ========================================================================= */ | 245 | /* ========================================================================= */ |
246 | /* UVH_GR0_TLB_INT0_CONFIG */ | ||
247 | /* ========================================================================= */ | ||
248 | #define UVH_GR0_TLB_INT0_CONFIG 0x61b00UL | ||
249 | |||
250 | #define UVH_GR0_TLB_INT0_CONFIG_VECTOR_SHFT 0 | ||
251 | #define UVH_GR0_TLB_INT0_CONFIG_VECTOR_MASK 0x00000000000000ffUL | ||
252 | #define UVH_GR0_TLB_INT0_CONFIG_DM_SHFT 8 | ||
253 | #define UVH_GR0_TLB_INT0_CONFIG_DM_MASK 0x0000000000000700UL | ||
254 | #define UVH_GR0_TLB_INT0_CONFIG_DESTMODE_SHFT 11 | ||
255 | #define UVH_GR0_TLB_INT0_CONFIG_DESTMODE_MASK 0x0000000000000800UL | ||
256 | #define UVH_GR0_TLB_INT0_CONFIG_STATUS_SHFT 12 | ||
257 | #define UVH_GR0_TLB_INT0_CONFIG_STATUS_MASK 0x0000000000001000UL | ||
258 | #define UVH_GR0_TLB_INT0_CONFIG_P_SHFT 13 | ||
259 | #define UVH_GR0_TLB_INT0_CONFIG_P_MASK 0x0000000000002000UL | ||
260 | #define UVH_GR0_TLB_INT0_CONFIG_T_SHFT 15 | ||
261 | #define UVH_GR0_TLB_INT0_CONFIG_T_MASK 0x0000000000008000UL | ||
262 | #define UVH_GR0_TLB_INT0_CONFIG_M_SHFT 16 | ||
263 | #define UVH_GR0_TLB_INT0_CONFIG_M_MASK 0x0000000000010000UL | ||
264 | #define UVH_GR0_TLB_INT0_CONFIG_APIC_ID_SHFT 32 | ||
265 | #define UVH_GR0_TLB_INT0_CONFIG_APIC_ID_MASK 0xffffffff00000000UL | ||
266 | |||
267 | union uvh_gr0_tlb_int0_config_u { | ||
268 | unsigned long v; | ||
269 | struct uvh_gr0_tlb_int0_config_s { | ||
270 | unsigned long vector_ : 8; /* RW */ | ||
271 | unsigned long dm : 3; /* RW */ | ||
272 | unsigned long destmode : 1; /* RW */ | ||
273 | unsigned long status : 1; /* RO */ | ||
274 | unsigned long p : 1; /* RO */ | ||
275 | unsigned long rsvd_14 : 1; /* */ | ||
276 | unsigned long t : 1; /* RO */ | ||
277 | unsigned long m : 1; /* RW */ | ||
278 | unsigned long rsvd_17_31: 15; /* */ | ||
279 | unsigned long apic_id : 32; /* RW */ | ||
280 | } s; | ||
281 | }; | ||
282 | |||
283 | /* ========================================================================= */ | ||
284 | /* UVH_GR0_TLB_INT1_CONFIG */ | ||
285 | /* ========================================================================= */ | ||
286 | #define UVH_GR0_TLB_INT1_CONFIG 0x61b40UL | ||
287 | |||
288 | #define UVH_GR0_TLB_INT1_CONFIG_VECTOR_SHFT 0 | ||
289 | #define UVH_GR0_TLB_INT1_CONFIG_VECTOR_MASK 0x00000000000000ffUL | ||
290 | #define UVH_GR0_TLB_INT1_CONFIG_DM_SHFT 8 | ||
291 | #define UVH_GR0_TLB_INT1_CONFIG_DM_MASK 0x0000000000000700UL | ||
292 | #define UVH_GR0_TLB_INT1_CONFIG_DESTMODE_SHFT 11 | ||
293 | #define UVH_GR0_TLB_INT1_CONFIG_DESTMODE_MASK 0x0000000000000800UL | ||
294 | #define UVH_GR0_TLB_INT1_CONFIG_STATUS_SHFT 12 | ||
295 | #define UVH_GR0_TLB_INT1_CONFIG_STATUS_MASK 0x0000000000001000UL | ||
296 | #define UVH_GR0_TLB_INT1_CONFIG_P_SHFT 13 | ||
297 | #define UVH_GR0_TLB_INT1_CONFIG_P_MASK 0x0000000000002000UL | ||
298 | #define UVH_GR0_TLB_INT1_CONFIG_T_SHFT 15 | ||
299 | #define UVH_GR0_TLB_INT1_CONFIG_T_MASK 0x0000000000008000UL | ||
300 | #define UVH_GR0_TLB_INT1_CONFIG_M_SHFT 16 | ||
301 | #define UVH_GR0_TLB_INT1_CONFIG_M_MASK 0x0000000000010000UL | ||
302 | #define UVH_GR0_TLB_INT1_CONFIG_APIC_ID_SHFT 32 | ||
303 | #define UVH_GR0_TLB_INT1_CONFIG_APIC_ID_MASK 0xffffffff00000000UL | ||
304 | |||
305 | union uvh_gr0_tlb_int1_config_u { | ||
306 | unsigned long v; | ||
307 | struct uvh_gr0_tlb_int1_config_s { | ||
308 | unsigned long vector_ : 8; /* RW */ | ||
309 | unsigned long dm : 3; /* RW */ | ||
310 | unsigned long destmode : 1; /* RW */ | ||
311 | unsigned long status : 1; /* RO */ | ||
312 | unsigned long p : 1; /* RO */ | ||
313 | unsigned long rsvd_14 : 1; /* */ | ||
314 | unsigned long t : 1; /* RO */ | ||
315 | unsigned long m : 1; /* RW */ | ||
316 | unsigned long rsvd_17_31: 15; /* */ | ||
317 | unsigned long apic_id : 32; /* RW */ | ||
318 | } s; | ||
319 | }; | ||
320 | |||
321 | /* ========================================================================= */ | ||
322 | /* UVH_GR1_TLB_INT0_CONFIG */ | ||
323 | /* ========================================================================= */ | ||
324 | #define UVH_GR1_TLB_INT0_CONFIG 0x61f00UL | ||
325 | |||
326 | #define UVH_GR1_TLB_INT0_CONFIG_VECTOR_SHFT 0 | ||
327 | #define UVH_GR1_TLB_INT0_CONFIG_VECTOR_MASK 0x00000000000000ffUL | ||
328 | #define UVH_GR1_TLB_INT0_CONFIG_DM_SHFT 8 | ||
329 | #define UVH_GR1_TLB_INT0_CONFIG_DM_MASK 0x0000000000000700UL | ||
330 | #define UVH_GR1_TLB_INT0_CONFIG_DESTMODE_SHFT 11 | ||
331 | #define UVH_GR1_TLB_INT0_CONFIG_DESTMODE_MASK 0x0000000000000800UL | ||
332 | #define UVH_GR1_TLB_INT0_CONFIG_STATUS_SHFT 12 | ||
333 | #define UVH_GR1_TLB_INT0_CONFIG_STATUS_MASK 0x0000000000001000UL | ||
334 | #define UVH_GR1_TLB_INT0_CONFIG_P_SHFT 13 | ||
335 | #define UVH_GR1_TLB_INT0_CONFIG_P_MASK 0x0000000000002000UL | ||
336 | #define UVH_GR1_TLB_INT0_CONFIG_T_SHFT 15 | ||
337 | #define UVH_GR1_TLB_INT0_CONFIG_T_MASK 0x0000000000008000UL | ||
338 | #define UVH_GR1_TLB_INT0_CONFIG_M_SHFT 16 | ||
339 | #define UVH_GR1_TLB_INT0_CONFIG_M_MASK 0x0000000000010000UL | ||
340 | #define UVH_GR1_TLB_INT0_CONFIG_APIC_ID_SHFT 32 | ||
341 | #define UVH_GR1_TLB_INT0_CONFIG_APIC_ID_MASK 0xffffffff00000000UL | ||
342 | |||
343 | union uvh_gr1_tlb_int0_config_u { | ||
344 | unsigned long v; | ||
345 | struct uvh_gr1_tlb_int0_config_s { | ||
346 | unsigned long vector_ : 8; /* RW */ | ||
347 | unsigned long dm : 3; /* RW */ | ||
348 | unsigned long destmode : 1; /* RW */ | ||
349 | unsigned long status : 1; /* RO */ | ||
350 | unsigned long p : 1; /* RO */ | ||
351 | unsigned long rsvd_14 : 1; /* */ | ||
352 | unsigned long t : 1; /* RO */ | ||
353 | unsigned long m : 1; /* RW */ | ||
354 | unsigned long rsvd_17_31: 15; /* */ | ||
355 | unsigned long apic_id : 32; /* RW */ | ||
356 | } s; | ||
357 | }; | ||
358 | |||
359 | /* ========================================================================= */ | ||
360 | /* UVH_GR1_TLB_INT1_CONFIG */ | ||
361 | /* ========================================================================= */ | ||
362 | #define UVH_GR1_TLB_INT1_CONFIG 0x61f40UL | ||
363 | |||
364 | #define UVH_GR1_TLB_INT1_CONFIG_VECTOR_SHFT 0 | ||
365 | #define UVH_GR1_TLB_INT1_CONFIG_VECTOR_MASK 0x00000000000000ffUL | ||
366 | #define UVH_GR1_TLB_INT1_CONFIG_DM_SHFT 8 | ||
367 | #define UVH_GR1_TLB_INT1_CONFIG_DM_MASK 0x0000000000000700UL | ||
368 | #define UVH_GR1_TLB_INT1_CONFIG_DESTMODE_SHFT 11 | ||
369 | #define UVH_GR1_TLB_INT1_CONFIG_DESTMODE_MASK 0x0000000000000800UL | ||
370 | #define UVH_GR1_TLB_INT1_CONFIG_STATUS_SHFT 12 | ||
371 | #define UVH_GR1_TLB_INT1_CONFIG_STATUS_MASK 0x0000000000001000UL | ||
372 | #define UVH_GR1_TLB_INT1_CONFIG_P_SHFT 13 | ||
373 | #define UVH_GR1_TLB_INT1_CONFIG_P_MASK 0x0000000000002000UL | ||
374 | #define UVH_GR1_TLB_INT1_CONFIG_T_SHFT 15 | ||
375 | #define UVH_GR1_TLB_INT1_CONFIG_T_MASK 0x0000000000008000UL | ||
376 | #define UVH_GR1_TLB_INT1_CONFIG_M_SHFT 16 | ||
377 | #define UVH_GR1_TLB_INT1_CONFIG_M_MASK 0x0000000000010000UL | ||
378 | #define UVH_GR1_TLB_INT1_CONFIG_APIC_ID_SHFT 32 | ||
379 | #define UVH_GR1_TLB_INT1_CONFIG_APIC_ID_MASK 0xffffffff00000000UL | ||
380 | |||
381 | union uvh_gr1_tlb_int1_config_u { | ||
382 | unsigned long v; | ||
383 | struct uvh_gr1_tlb_int1_config_s { | ||
384 | unsigned long vector_ : 8; /* RW */ | ||
385 | unsigned long dm : 3; /* RW */ | ||
386 | unsigned long destmode : 1; /* RW */ | ||
387 | unsigned long status : 1; /* RO */ | ||
388 | unsigned long p : 1; /* RO */ | ||
389 | unsigned long rsvd_14 : 1; /* */ | ||
390 | unsigned long t : 1; /* RO */ | ||
391 | unsigned long m : 1; /* RW */ | ||
392 | unsigned long rsvd_17_31: 15; /* */ | ||
393 | unsigned long apic_id : 32; /* RW */ | ||
394 | } s; | ||
395 | }; | ||
396 | |||
397 | /* ========================================================================= */ | ||
246 | /* UVH_INT_CMPB */ | 398 | /* UVH_INT_CMPB */ |
247 | /* ========================================================================= */ | 399 | /* ========================================================================= */ |
248 | #define UVH_INT_CMPB 0x22080UL | 400 | #define UVH_INT_CMPB 0x22080UL |
@@ -670,4 +822,4 @@ union uvh_si_alias2_overlay_config_u { | |||
670 | }; | 822 | }; |
671 | 823 | ||
672 | 824 | ||
673 | #endif /* __ASM_IA64_UV_MMRS__ */ | 825 | #endif /* _ASM_IA64_UV_UV_MMRS_H */ |
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile index 5628e9a990a6..6b7edcab0cb5 100644 --- a/arch/ia64/kernel/Makefile +++ b/arch/ia64/kernel/Makefile | |||
@@ -2,6 +2,10 @@ | |||
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | ifdef CONFIG_DYNAMIC_FTRACE | ||
6 | CFLAGS_REMOVE_ftrace.o = -pg | ||
7 | endif | ||
8 | |||
5 | extra-y := head.o init_task.o vmlinux.lds | 9 | extra-y := head.o init_task.o vmlinux.lds |
6 | 10 | ||
7 | obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ | 11 | obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ |
@@ -28,6 +32,7 @@ obj-$(CONFIG_IA64_CYCLONE) += cyclone.o | |||
28 | obj-$(CONFIG_CPU_FREQ) += cpufreq/ | 32 | obj-$(CONFIG_CPU_FREQ) += cpufreq/ |
29 | obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o | 33 | obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o |
30 | obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o | 34 | obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o |
35 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | ||
31 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o | 36 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o |
32 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 37 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
33 | obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o | 38 | obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index ccfdeee9d89f..8dc69669586a 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <asm/processor.h> | 47 | #include <asm/processor.h> |
48 | #include <asm/thread_info.h> | 48 | #include <asm/thread_info.h> |
49 | #include <asm/unistd.h> | 49 | #include <asm/unistd.h> |
50 | #include <asm/ftrace.h> | ||
50 | 51 | ||
51 | #include "minstate.h" | 52 | #include "minstate.h" |
52 | 53 | ||
@@ -1404,6 +1405,105 @@ GLOBAL_ENTRY(unw_init_running) | |||
1404 | br.ret.sptk.many rp | 1405 | br.ret.sptk.many rp |
1405 | END(unw_init_running) | 1406 | END(unw_init_running) |
1406 | 1407 | ||
1408 | #ifdef CONFIG_FUNCTION_TRACER | ||
1409 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
1410 | GLOBAL_ENTRY(_mcount) | ||
1411 | br ftrace_stub | ||
1412 | END(_mcount) | ||
1413 | |||
1414 | .here: | ||
1415 | br.ret.sptk.many b0 | ||
1416 | |||
1417 | GLOBAL_ENTRY(ftrace_caller) | ||
1418 | alloc out0 = ar.pfs, 8, 0, 4, 0 | ||
1419 | mov out3 = r0 | ||
1420 | ;; | ||
1421 | mov out2 = b0 | ||
1422 | add r3 = 0x20, r3 | ||
1423 | mov out1 = r1; | ||
1424 | br.call.sptk.many b0 = ftrace_patch_gp | ||
1425 | //this might be called from module, so we must patch gp | ||
1426 | ftrace_patch_gp: | ||
1427 | movl gp=__gp | ||
1428 | mov b0 = r3 | ||
1429 | ;; | ||
1430 | .global ftrace_call; | ||
1431 | ftrace_call: | ||
1432 | { | ||
1433 | .mlx | ||
1434 | nop.m 0x0 | ||
1435 | movl r3 = .here;; | ||
1436 | } | ||
1437 | alloc loc0 = ar.pfs, 4, 4, 2, 0 | ||
1438 | ;; | ||
1439 | mov loc1 = b0 | ||
1440 | mov out0 = b0 | ||
1441 | mov loc2 = r8 | ||
1442 | mov loc3 = r15 | ||
1443 | ;; | ||
1444 | adds out0 = -MCOUNT_INSN_SIZE, out0 | ||
1445 | mov out1 = in2 | ||
1446 | mov b6 = r3 | ||
1447 | |||
1448 | br.call.sptk.many b0 = b6 | ||
1449 | ;; | ||
1450 | mov ar.pfs = loc0 | ||
1451 | mov b0 = loc1 | ||
1452 | mov r8 = loc2 | ||
1453 | mov r15 = loc3 | ||
1454 | br ftrace_stub | ||
1455 | ;; | ||
1456 | END(ftrace_caller) | ||
1457 | |||
1458 | #else | ||
1459 | GLOBAL_ENTRY(_mcount) | ||
1460 | movl r2 = ftrace_stub | ||
1461 | movl r3 = ftrace_trace_function;; | ||
1462 | ld8 r3 = [r3];; | ||
1463 | ld8 r3 = [r3];; | ||
1464 | cmp.eq p7,p0 = r2, r3 | ||
1465 | (p7) br.sptk.many ftrace_stub | ||
1466 | ;; | ||
1467 | |||
1468 | alloc loc0 = ar.pfs, 4, 4, 2, 0 | ||
1469 | ;; | ||
1470 | mov loc1 = b0 | ||
1471 | mov out0 = b0 | ||
1472 | mov loc2 = r8 | ||
1473 | mov loc3 = r15 | ||
1474 | ;; | ||
1475 | adds out0 = -MCOUNT_INSN_SIZE, out0 | ||
1476 | mov out1 = in2 | ||
1477 | mov b6 = r3 | ||
1478 | |||
1479 | br.call.sptk.many b0 = b6 | ||
1480 | ;; | ||
1481 | mov ar.pfs = loc0 | ||
1482 | mov b0 = loc1 | ||
1483 | mov r8 = loc2 | ||
1484 | mov r15 = loc3 | ||
1485 | br ftrace_stub | ||
1486 | ;; | ||
1487 | END(_mcount) | ||
1488 | #endif | ||
1489 | |||
1490 | GLOBAL_ENTRY(ftrace_stub) | ||
1491 | mov r3 = b0 | ||
1492 | movl r2 = _mcount_ret_helper | ||
1493 | ;; | ||
1494 | mov b6 = r2 | ||
1495 | mov b7 = r3 | ||
1496 | br.ret.sptk.many b6 | ||
1497 | |||
1498 | _mcount_ret_helper: | ||
1499 | mov b0 = r42 | ||
1500 | mov r1 = r41 | ||
1501 | mov ar.pfs = r40 | ||
1502 | br b7 | ||
1503 | END(ftrace_stub) | ||
1504 | |||
1505 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
1506 | |||
1407 | .rodata | 1507 | .rodata |
1408 | .align 8 | 1508 | .align 8 |
1409 | .globl sys_call_table | 1509 | .globl sys_call_table |
diff --git a/arch/ia64/kernel/ftrace.c b/arch/ia64/kernel/ftrace.c new file mode 100644 index 000000000000..7fc8c961b1f7 --- /dev/null +++ b/arch/ia64/kernel/ftrace.c | |||
@@ -0,0 +1,206 @@ | |||
1 | /* | ||
2 | * Dynamic function tracing support. | ||
3 | * | ||
4 | * Copyright (C) 2008 Shaohua Li <shaohua.li@intel.com> | ||
5 | * | ||
6 | * For licencing details, see COPYING. | ||
7 | * | ||
8 | * Defines low-level handling of mcount calls when the kernel | ||
9 | * is compiled with the -pg flag. When using dynamic ftrace, the | ||
10 | * mcount call-sites get patched lazily with NOP till they are | ||
11 | * enabled. All code mutation routines here take effect atomically. | ||
12 | */ | ||
13 | |||
14 | #include <linux/uaccess.h> | ||
15 | #include <linux/ftrace.h> | ||
16 | |||
17 | #include <asm/cacheflush.h> | ||
18 | #include <asm/patch.h> | ||
19 | |||
20 | /* In IA64, each function will be added below two bundles with -pg option */ | ||
21 | static unsigned char __attribute__((aligned(8))) | ||
22 | ftrace_orig_code[MCOUNT_INSN_SIZE] = { | ||
23 | 0x02, 0x40, 0x31, 0x10, 0x80, 0x05, /* alloc r40=ar.pfs,12,8,0 */ | ||
24 | 0xb0, 0x02, 0x00, 0x00, 0x42, 0x40, /* mov r43=r0;; */ | ||
25 | 0x05, 0x00, 0xc4, 0x00, /* mov r42=b0 */ | ||
26 | 0x11, 0x48, 0x01, 0x02, 0x00, 0x21, /* mov r41=r1 */ | ||
27 | 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* nop.i 0x0 */ | ||
28 | 0x08, 0x00, 0x00, 0x50 /* br.call.sptk.many b0 = _mcount;; */ | ||
29 | }; | ||
30 | |||
31 | struct ftrace_orig_insn { | ||
32 | u64 dummy1, dummy2, dummy3; | ||
33 | u64 dummy4:64-41+13; | ||
34 | u64 imm20:20; | ||
35 | u64 dummy5:3; | ||
36 | u64 sign:1; | ||
37 | u64 dummy6:4; | ||
38 | }; | ||
39 | |||
40 | /* mcount stub will be converted below for nop */ | ||
41 | static unsigned char ftrace_nop_code[MCOUNT_INSN_SIZE] = { | ||
42 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0x0 */ | ||
43 | 0x30, 0x00, 0x00, 0x60, 0x00, 0x00, /* mov r3=ip */ | ||
44 | 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0 */ | ||
45 | 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0x0 */ | ||
46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* nop.x 0x0;; */ | ||
47 | 0x00, 0x00, 0x04, 0x00 | ||
48 | }; | ||
49 | |||
50 | static unsigned char *ftrace_nop_replace(void) | ||
51 | { | ||
52 | return ftrace_nop_code; | ||
53 | } | ||
54 | |||
55 | /* | ||
56 | * mcount stub will be converted below for call | ||
57 | * Note: Just the last instruction is changed against nop | ||
58 | * */ | ||
59 | static unsigned char __attribute__((aligned(8))) | ||
60 | ftrace_call_code[MCOUNT_INSN_SIZE] = { | ||
61 | 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0x0 */ | ||
62 | 0x30, 0x00, 0x00, 0x60, 0x00, 0x00, /* mov r3=ip */ | ||
63 | 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0 */ | ||
64 | 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0x0 */ | ||
65 | 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, /* brl.many .;;*/ | ||
66 | 0xf8, 0xff, 0xff, 0xc8 | ||
67 | }; | ||
68 | |||
69 | struct ftrace_call_insn { | ||
70 | u64 dummy1, dummy2; | ||
71 | u64 dummy3:48; | ||
72 | u64 imm39_l:16; | ||
73 | u64 imm39_h:23; | ||
74 | u64 dummy4:13; | ||
75 | u64 imm20:20; | ||
76 | u64 dummy5:3; | ||
77 | u64 i:1; | ||
78 | u64 dummy6:4; | ||
79 | }; | ||
80 | |||
81 | static unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | ||
82 | { | ||
83 | struct ftrace_call_insn *code = (void *)ftrace_call_code; | ||
84 | unsigned long offset = addr - (ip + 0x10); | ||
85 | |||
86 | code->imm39_l = offset >> 24; | ||
87 | code->imm39_h = offset >> 40; | ||
88 | code->imm20 = offset >> 4; | ||
89 | code->i = offset >> 63; | ||
90 | return ftrace_call_code; | ||
91 | } | ||
92 | |||
93 | static int | ||
94 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, | ||
95 | unsigned char *new_code, int do_check) | ||
96 | { | ||
97 | unsigned char replaced[MCOUNT_INSN_SIZE]; | ||
98 | |||
99 | /* | ||
100 | * Note: Due to modules and __init, code can | ||
101 | * disappear and change, we need to protect against faulting | ||
102 | * as well as code changing. We do this by using the | ||
103 | * probe_kernel_* functions. | ||
104 | * | ||
105 | * No real locking needed, this code is run through | ||
106 | * kstop_machine, or before SMP starts. | ||
107 | */ | ||
108 | |||
109 | if (!do_check) | ||
110 | goto skip_check; | ||
111 | |||
112 | /* read the text we want to modify */ | ||
113 | if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) | ||
114 | return -EFAULT; | ||
115 | |||
116 | /* Make sure it is what we expect it to be */ | ||
117 | if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) | ||
118 | return -EINVAL; | ||
119 | |||
120 | skip_check: | ||
121 | /* replace the text with the new text */ | ||
122 | if (probe_kernel_write(((void *)ip), new_code, MCOUNT_INSN_SIZE)) | ||
123 | return -EPERM; | ||
124 | flush_icache_range(ip, ip + MCOUNT_INSN_SIZE); | ||
125 | |||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | static int ftrace_make_nop_check(struct dyn_ftrace *rec, unsigned long addr) | ||
130 | { | ||
131 | unsigned char __attribute__((aligned(8))) replaced[MCOUNT_INSN_SIZE]; | ||
132 | unsigned long ip = rec->ip; | ||
133 | |||
134 | if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) | ||
135 | return -EFAULT; | ||
136 | if (rec->flags & FTRACE_FL_CONVERTED) { | ||
137 | struct ftrace_call_insn *call_insn, *tmp_call; | ||
138 | |||
139 | call_insn = (void *)ftrace_call_code; | ||
140 | tmp_call = (void *)replaced; | ||
141 | call_insn->imm39_l = tmp_call->imm39_l; | ||
142 | call_insn->imm39_h = tmp_call->imm39_h; | ||
143 | call_insn->imm20 = tmp_call->imm20; | ||
144 | call_insn->i = tmp_call->i; | ||
145 | if (memcmp(replaced, ftrace_call_code, MCOUNT_INSN_SIZE) != 0) | ||
146 | return -EINVAL; | ||
147 | return 0; | ||
148 | } else { | ||
149 | struct ftrace_orig_insn *call_insn, *tmp_call; | ||
150 | |||
151 | call_insn = (void *)ftrace_orig_code; | ||
152 | tmp_call = (void *)replaced; | ||
153 | call_insn->sign = tmp_call->sign; | ||
154 | call_insn->imm20 = tmp_call->imm20; | ||
155 | if (memcmp(replaced, ftrace_orig_code, MCOUNT_INSN_SIZE) != 0) | ||
156 | return -EINVAL; | ||
157 | return 0; | ||
158 | } | ||
159 | } | ||
160 | |||
161 | int ftrace_make_nop(struct module *mod, | ||
162 | struct dyn_ftrace *rec, unsigned long addr) | ||
163 | { | ||
164 | int ret; | ||
165 | char *new; | ||
166 | |||
167 | ret = ftrace_make_nop_check(rec, addr); | ||
168 | if (ret) | ||
169 | return ret; | ||
170 | new = ftrace_nop_replace(); | ||
171 | return ftrace_modify_code(rec->ip, NULL, new, 0); | ||
172 | } | ||
173 | |||
174 | int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | ||
175 | { | ||
176 | unsigned long ip = rec->ip; | ||
177 | unsigned char *old, *new; | ||
178 | |||
179 | old= ftrace_nop_replace(); | ||
180 | new = ftrace_call_replace(ip, addr); | ||
181 | return ftrace_modify_code(ip, old, new, 1); | ||
182 | } | ||
183 | |||
184 | /* in IA64, _mcount can't directly call ftrace_stub. Only jump is ok */ | ||
185 | int ftrace_update_ftrace_func(ftrace_func_t func) | ||
186 | { | ||
187 | unsigned long ip; | ||
188 | unsigned long addr = ((struct fnptr *)ftrace_call)->ip; | ||
189 | |||
190 | if (func == ftrace_stub) | ||
191 | return 0; | ||
192 | ip = ((struct fnptr *)func)->ip; | ||
193 | |||
194 | ia64_patch_imm64(addr + 2, ip); | ||
195 | |||
196 | flush_icache_range(addr, addr + 16); | ||
197 | return 0; | ||
198 | } | ||
199 | |||
200 | /* run from kstop_machine */ | ||
201 | int __init ftrace_dyn_arch_init(void *data) | ||
202 | { | ||
203 | *(unsigned long *)data = 0; | ||
204 | |||
205 | return 0; | ||
206 | } | ||
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c index 6da1f20d7372..2d311864e359 100644 --- a/arch/ia64/kernel/ia64_ksyms.c +++ b/arch/ia64/kernel/ia64_ksyms.c | |||
@@ -112,3 +112,9 @@ EXPORT_SYMBOL_GPL(esi_call_phys); | |||
112 | #endif | 112 | #endif |
113 | extern char ia64_ivt[]; | 113 | extern char ia64_ivt[]; |
114 | EXPORT_SYMBOL(ia64_ivt); | 114 | EXPORT_SYMBOL(ia64_ivt); |
115 | |||
116 | #include <asm/ftrace.h> | ||
117 | #ifdef CONFIG_FUNCTION_TRACER | ||
118 | /* mcount is defined in assembly */ | ||
119 | EXPORT_SYMBOL(_mcount); | ||
120 | #endif | ||
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index c57162705147..5d7c0e5b9e76 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -413,7 +413,7 @@ ia64_load_extra (struct task_struct *task) | |||
413 | * so there is nothing to worry about. | 413 | * so there is nothing to worry about. |
414 | */ | 414 | */ |
415 | int | 415 | int |
416 | copy_thread (int nr, unsigned long clone_flags, | 416 | copy_thread(unsigned long clone_flags, |
417 | unsigned long user_stack_base, unsigned long user_stack_size, | 417 | unsigned long user_stack_base, unsigned long user_stack_size, |
418 | struct task_struct *p, struct pt_regs *regs) | 418 | struct task_struct *p, struct pt_regs *regs) |
419 | { | 419 | { |
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index 7103d91e1a2f..3e876f0baebc 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c | |||
@@ -225,7 +225,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
225 | return 0; /* Task didn't use the fpu at all. */ | 225 | return 0; /* Task didn't use the fpu at all. */ |
226 | } | 226 | } |
227 | 227 | ||
228 | int copy_thread(int nr, unsigned long clone_flags, unsigned long spu, | 228 | int copy_thread(unsigned long clone_flags, unsigned long spu, |
229 | unsigned long unused, struct task_struct *tsk, struct pt_regs *regs) | 229 | unsigned long unused, struct task_struct *tsk, struct pt_regs *regs) |
230 | { | 230 | { |
231 | struct pt_regs *childregs = task_pt_regs(tsk); | 231 | struct pt_regs *childregs = task_pt_regs(tsk); |
diff --git a/arch/m68k/include/asm/bootinfo.h b/arch/m68k/include/asm/bootinfo.h index fedf3e326121..fb8a06b9ab6a 100644 --- a/arch/m68k/include/asm/bootinfo.h +++ b/arch/m68k/include/asm/bootinfo.h | |||
@@ -1,5 +1,378 @@ | |||
1 | #ifdef __uClinux__ | 1 | /* |
2 | #include "bootinfo_no.h" | 2 | ** asm/bootinfo.h -- Definition of the Linux/m68k boot information structure |
3 | #else | 3 | ** |
4 | #include "bootinfo_mm.h" | 4 | ** Copyright 1992 by Greg Harp |
5 | ** | ||
6 | ** This file is subject to the terms and conditions of the GNU General Public | ||
7 | ** License. See the file COPYING in the main directory of this archive | ||
8 | ** for more details. | ||
9 | ** | ||
10 | ** Created 09/29/92 by Greg Harp | ||
11 | ** | ||
12 | ** 5/2/94 Roman Hodek: | ||
13 | ** Added bi_atari part of the machine dependent union bi_un; for now it | ||
14 | ** contains just a model field to distinguish between TT and Falcon. | ||
15 | ** 26/7/96 Roman Zippel: | ||
16 | ** Renamed to setup.h; added some useful macros to allow gcc some | ||
17 | ** optimizations if possible. | ||
18 | ** 5/10/96 Geert Uytterhoeven: | ||
19 | ** Redesign of the boot information structure; renamed to bootinfo.h again | ||
20 | ** 27/11/96 Geert Uytterhoeven: | ||
21 | ** Backwards compatibility with bootinfo interface version 1.0 | ||
22 | */ | ||
23 | |||
24 | #ifndef _M68K_BOOTINFO_H | ||
25 | #define _M68K_BOOTINFO_H | ||
26 | |||
27 | |||
28 | /* | ||
29 | * Bootinfo definitions | ||
30 | * | ||
31 | * This is an easily parsable and extendable structure containing all | ||
32 | * information to be passed from the bootstrap to the kernel. | ||
33 | * | ||
34 | * This way I hope to keep all future changes back/forewards compatible. | ||
35 | * Thus, keep your fingers crossed... | ||
36 | * | ||
37 | * This structure is copied right after the kernel bss by the bootstrap | ||
38 | * routine. | ||
39 | */ | ||
40 | |||
41 | #ifndef __ASSEMBLY__ | ||
42 | |||
43 | struct bi_record { | ||
44 | unsigned short tag; /* tag ID */ | ||
45 | unsigned short size; /* size of record (in bytes) */ | ||
46 | unsigned long data[0]; /* data */ | ||
47 | }; | ||
48 | |||
49 | #endif /* __ASSEMBLY__ */ | ||
50 | |||
51 | |||
52 | /* | ||
53 | * Tag Definitions | ||
54 | * | ||
55 | * Machine independent tags start counting from 0x0000 | ||
56 | * Machine dependent tags start counting from 0x8000 | ||
57 | */ | ||
58 | |||
59 | #define BI_LAST 0x0000 /* last record (sentinel) */ | ||
60 | #define BI_MACHTYPE 0x0001 /* machine type (u_long) */ | ||
61 | #define BI_CPUTYPE 0x0002 /* cpu type (u_long) */ | ||
62 | #define BI_FPUTYPE 0x0003 /* fpu type (u_long) */ | ||
63 | #define BI_MMUTYPE 0x0004 /* mmu type (u_long) */ | ||
64 | #define BI_MEMCHUNK 0x0005 /* memory chunk address and size */ | ||
65 | /* (struct mem_info) */ | ||
66 | #define BI_RAMDISK 0x0006 /* ramdisk address and size */ | ||
67 | /* (struct mem_info) */ | ||
68 | #define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */ | ||
69 | /* (string) */ | ||
70 | |||
71 | /* | ||
72 | * Amiga-specific tags | ||
73 | */ | ||
74 | |||
75 | #define BI_AMIGA_MODEL 0x8000 /* model (u_long) */ | ||
76 | #define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */ | ||
77 | /* (struct ConfigDev) */ | ||
78 | #define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */ | ||
79 | #define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */ | ||
80 | #define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */ | ||
81 | #define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */ | ||
82 | #define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */ | ||
83 | #define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */ | ||
84 | |||
85 | /* | ||
86 | * Atari-specific tags | ||
87 | */ | ||
88 | |||
89 | #define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */ | ||
90 | #define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */ | ||
91 | /* (values are ATARI_MACH_* defines */ | ||
92 | |||
93 | /* mch_cookie values (upper word) */ | ||
94 | #define ATARI_MCH_ST 0 | ||
95 | #define ATARI_MCH_STE 1 | ||
96 | #define ATARI_MCH_TT 2 | ||
97 | #define ATARI_MCH_FALCON 3 | ||
98 | |||
99 | /* mch_type values */ | ||
100 | #define ATARI_MACH_NORMAL 0 /* no special machine type */ | ||
101 | #define ATARI_MACH_MEDUSA 1 /* Medusa 040 */ | ||
102 | #define ATARI_MACH_HADES 2 /* Hades 040 or 060 */ | ||
103 | #define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */ | ||
104 | |||
105 | /* | ||
106 | * VME-specific tags | ||
107 | */ | ||
108 | |||
109 | #define BI_VME_TYPE 0x8000 /* VME sub-architecture (u_long) */ | ||
110 | #define BI_VME_BRDINFO 0x8001 /* VME board information (struct) */ | ||
111 | |||
112 | /* BI_VME_TYPE codes */ | ||
113 | #define VME_TYPE_TP34V 0x0034 /* Tadpole TP34V */ | ||
114 | #define VME_TYPE_MVME147 0x0147 /* Motorola MVME147 */ | ||
115 | #define VME_TYPE_MVME162 0x0162 /* Motorola MVME162 */ | ||
116 | #define VME_TYPE_MVME166 0x0166 /* Motorola MVME166 */ | ||
117 | #define VME_TYPE_MVME167 0x0167 /* Motorola MVME167 */ | ||
118 | #define VME_TYPE_MVME172 0x0172 /* Motorola MVME172 */ | ||
119 | #define VME_TYPE_MVME177 0x0177 /* Motorola MVME177 */ | ||
120 | #define VME_TYPE_BVME4000 0x4000 /* BVM Ltd. BVME4000 */ | ||
121 | #define VME_TYPE_BVME6000 0x6000 /* BVM Ltd. BVME6000 */ | ||
122 | |||
123 | /* BI_VME_BRDINFO is a 32 byte struct as returned by the Bug code on | ||
124 | * Motorola VME boards. Contains board number, Bug version, board | ||
125 | * configuration options, etc. See include/asm/mvme16xhw.h for details. | ||
126 | */ | ||
127 | |||
128 | |||
129 | /* | ||
130 | * Macintosh-specific tags (all u_long) | ||
131 | */ | ||
132 | |||
133 | #define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */ | ||
134 | #define BI_MAC_VADDR 0x8001 /* Mac video base address */ | ||
135 | #define BI_MAC_VDEPTH 0x8002 /* Mac video depth */ | ||
136 | #define BI_MAC_VROW 0x8003 /* Mac video rowbytes */ | ||
137 | #define BI_MAC_VDIM 0x8004 /* Mac video dimensions */ | ||
138 | #define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */ | ||
139 | #define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */ | ||
140 | #define BI_MAC_BTIME 0x8007 /* Mac boot time */ | ||
141 | #define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */ | ||
142 | #define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */ | ||
143 | #define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */ | ||
144 | #define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */ | ||
145 | |||
146 | /* | ||
147 | * Macintosh hardware profile data - unused, see macintosh.h for | ||
148 | * resonable type values | ||
149 | */ | ||
150 | |||
151 | #define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */ | ||
152 | #define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */ | ||
153 | #define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */ | ||
154 | #define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */ | ||
155 | #define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */ | ||
156 | #define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */ | ||
157 | #define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */ | ||
158 | #define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */ | ||
159 | #define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */ | ||
160 | #define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */ | ||
161 | #define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */ | ||
162 | #define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */ | ||
163 | #define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */ | ||
164 | #define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */ | ||
165 | #define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */ | ||
166 | #define BI_MAC_PMU 0x801f /* Mac power management / poweroff hardware */ | ||
167 | #define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */ | ||
168 | #define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */ | ||
169 | |||
170 | /* | ||
171 | * Mac: compatibility with old booter data format (temporarily) | ||
172 | * Fields unused with the new bootinfo can be deleted now; instead of | ||
173 | * adding new fields the struct might be splitted into a hardware address | ||
174 | * part and a hardware type part | ||
175 | */ | ||
176 | |||
177 | #ifndef __ASSEMBLY__ | ||
178 | |||
179 | struct mac_booter_data | ||
180 | { | ||
181 | unsigned long videoaddr; | ||
182 | unsigned long videorow; | ||
183 | unsigned long videodepth; | ||
184 | unsigned long dimensions; | ||
185 | unsigned long args; | ||
186 | unsigned long boottime; | ||
187 | unsigned long gmtbias; | ||
188 | unsigned long bootver; | ||
189 | unsigned long videological; | ||
190 | unsigned long sccbase; | ||
191 | unsigned long id; | ||
192 | unsigned long memsize; | ||
193 | unsigned long serialmf; | ||
194 | unsigned long serialhsk; | ||
195 | unsigned long serialgpi; | ||
196 | unsigned long printmf; | ||
197 | unsigned long printhsk; | ||
198 | unsigned long printgpi; | ||
199 | unsigned long cpuid; | ||
200 | unsigned long rombase; | ||
201 | unsigned long adbdelay; | ||
202 | unsigned long timedbra; | ||
203 | }; | ||
204 | |||
205 | extern struct mac_booter_data | ||
206 | mac_bi_data; | ||
207 | |||
5 | #endif | 208 | #endif |
209 | |||
210 | /* | ||
211 | * Apollo-specific tags | ||
212 | */ | ||
213 | |||
214 | #define BI_APOLLO_MODEL 0x8000 /* model (u_long) */ | ||
215 | |||
216 | /* | ||
217 | * HP300-specific tags | ||
218 | */ | ||
219 | |||
220 | #define BI_HP300_MODEL 0x8000 /* model (u_long) */ | ||
221 | #define BI_HP300_UART_SCODE 0x8001 /* UART select code (u_long) */ | ||
222 | #define BI_HP300_UART_ADDR 0x8002 /* phys. addr of UART (u_long) */ | ||
223 | |||
224 | /* | ||
225 | * Stuff for bootinfo interface versioning | ||
226 | * | ||
227 | * At the start of kernel code, a 'struct bootversion' is located. | ||
228 | * bootstrap checks for a matching version of the interface before booting | ||
229 | * a kernel, to avoid user confusion if kernel and bootstrap don't work | ||
230 | * together :-) | ||
231 | * | ||
232 | * If incompatible changes are made to the bootinfo interface, the major | ||
233 | * number below should be stepped (and the minor reset to 0) for the | ||
234 | * appropriate machine. If a change is backward-compatible, the minor | ||
235 | * should be stepped. "Backwards-compatible" means that booting will work, | ||
236 | * but certain features may not. | ||
237 | */ | ||
238 | |||
239 | #define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */ | ||
240 | #define MK_BI_VERSION(major,minor) (((major)<<16)+(minor)) | ||
241 | #define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff) | ||
242 | #define BI_VERSION_MINOR(v) ((v) & 0xffff) | ||
243 | |||
244 | #ifndef __ASSEMBLY__ | ||
245 | |||
246 | struct bootversion { | ||
247 | unsigned short branch; | ||
248 | unsigned long magic; | ||
249 | struct { | ||
250 | unsigned long machtype; | ||
251 | unsigned long version; | ||
252 | } machversions[0]; | ||
253 | }; | ||
254 | |||
255 | #endif /* __ASSEMBLY__ */ | ||
256 | |||
257 | #define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
258 | #define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 ) | ||
259 | #define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
260 | #define MVME147_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
261 | #define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
262 | #define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
263 | #define Q40_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
264 | #define HP300_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
265 | |||
266 | #ifdef BOOTINFO_COMPAT_1_0 | ||
267 | |||
268 | /* | ||
269 | * Backwards compatibility with bootinfo interface version 1.0 | ||
270 | */ | ||
271 | |||
272 | #define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) | ||
273 | #define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) | ||
274 | #define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) | ||
275 | |||
276 | #include <linux/zorro.h> | ||
277 | |||
278 | #define COMPAT_NUM_AUTO 16 | ||
279 | |||
280 | struct compat_bi_Amiga { | ||
281 | int model; | ||
282 | int num_autocon; | ||
283 | struct ConfigDev autocon[COMPAT_NUM_AUTO]; | ||
284 | unsigned long chip_size; | ||
285 | unsigned char vblank; | ||
286 | unsigned char psfreq; | ||
287 | unsigned long eclock; | ||
288 | unsigned long chipset; | ||
289 | unsigned long hw_present; | ||
290 | }; | ||
291 | |||
292 | struct compat_bi_Atari { | ||
293 | unsigned long hw_present; | ||
294 | unsigned long mch_cookie; | ||
295 | }; | ||
296 | |||
297 | #ifndef __ASSEMBLY__ | ||
298 | |||
299 | struct compat_bi_Macintosh | ||
300 | { | ||
301 | unsigned long videoaddr; | ||
302 | unsigned long videorow; | ||
303 | unsigned long videodepth; | ||
304 | unsigned long dimensions; | ||
305 | unsigned long args; | ||
306 | unsigned long boottime; | ||
307 | unsigned long gmtbias; | ||
308 | unsigned long bootver; | ||
309 | unsigned long videological; | ||
310 | unsigned long sccbase; | ||
311 | unsigned long id; | ||
312 | unsigned long memsize; | ||
313 | unsigned long serialmf; | ||
314 | unsigned long serialhsk; | ||
315 | unsigned long serialgpi; | ||
316 | unsigned long printmf; | ||
317 | unsigned long printhsk; | ||
318 | unsigned long printgpi; | ||
319 | unsigned long cpuid; | ||
320 | unsigned long rombase; | ||
321 | unsigned long adbdelay; | ||
322 | unsigned long timedbra; | ||
323 | }; | ||
324 | |||
325 | #endif | ||
326 | |||
327 | struct compat_mem_info { | ||
328 | unsigned long addr; | ||
329 | unsigned long size; | ||
330 | }; | ||
331 | |||
332 | #define COMPAT_NUM_MEMINFO 4 | ||
333 | |||
334 | #define COMPAT_CPUB_68020 0 | ||
335 | #define COMPAT_CPUB_68030 1 | ||
336 | #define COMPAT_CPUB_68040 2 | ||
337 | #define COMPAT_CPUB_68060 3 | ||
338 | #define COMPAT_FPUB_68881 5 | ||
339 | #define COMPAT_FPUB_68882 6 | ||
340 | #define COMPAT_FPUB_68040 7 | ||
341 | #define COMPAT_FPUB_68060 8 | ||
342 | |||
343 | #define COMPAT_CPU_68020 (1<<COMPAT_CPUB_68020) | ||
344 | #define COMPAT_CPU_68030 (1<<COMPAT_CPUB_68030) | ||
345 | #define COMPAT_CPU_68040 (1<<COMPAT_CPUB_68040) | ||
346 | #define COMPAT_CPU_68060 (1<<COMPAT_CPUB_68060) | ||
347 | #define COMPAT_CPU_MASK (31) | ||
348 | #define COMPAT_FPU_68881 (1<<COMPAT_FPUB_68881) | ||
349 | #define COMPAT_FPU_68882 (1<<COMPAT_FPUB_68882) | ||
350 | #define COMPAT_FPU_68040 (1<<COMPAT_FPUB_68040) | ||
351 | #define COMPAT_FPU_68060 (1<<COMPAT_FPUB_68060) | ||
352 | #define COMPAT_FPU_MASK (0xfe0) | ||
353 | |||
354 | #define COMPAT_CL_SIZE (256) | ||
355 | |||
356 | struct compat_bootinfo { | ||
357 | unsigned long machtype; | ||
358 | unsigned long cputype; | ||
359 | struct compat_mem_info memory[COMPAT_NUM_MEMINFO]; | ||
360 | int num_memory; | ||
361 | unsigned long ramdisk_size; | ||
362 | unsigned long ramdisk_addr; | ||
363 | char command_line[COMPAT_CL_SIZE]; | ||
364 | union { | ||
365 | struct compat_bi_Amiga bi_ami; | ||
366 | struct compat_bi_Atari bi_ata; | ||
367 | struct compat_bi_Macintosh bi_mac; | ||
368 | } bi_un; | ||
369 | }; | ||
370 | |||
371 | #define bi_amiga bi_un.bi_ami | ||
372 | #define bi_atari bi_un.bi_ata | ||
373 | #define bi_mac bi_un.bi_mac | ||
374 | |||
375 | #endif /* BOOTINFO_COMPAT_1_0 */ | ||
376 | |||
377 | |||
378 | #endif /* _M68K_BOOTINFO_H */ | ||
diff --git a/arch/m68k/include/asm/bootinfo_mm.h b/arch/m68k/include/asm/bootinfo_mm.h deleted file mode 100644 index fb8a06b9ab6a..000000000000 --- a/arch/m68k/include/asm/bootinfo_mm.h +++ /dev/null | |||
@@ -1,378 +0,0 @@ | |||
1 | /* | ||
2 | ** asm/bootinfo.h -- Definition of the Linux/m68k boot information structure | ||
3 | ** | ||
4 | ** Copyright 1992 by Greg Harp | ||
5 | ** | ||
6 | ** This file is subject to the terms and conditions of the GNU General Public | ||
7 | ** License. See the file COPYING in the main directory of this archive | ||
8 | ** for more details. | ||
9 | ** | ||
10 | ** Created 09/29/92 by Greg Harp | ||
11 | ** | ||
12 | ** 5/2/94 Roman Hodek: | ||
13 | ** Added bi_atari part of the machine dependent union bi_un; for now it | ||
14 | ** contains just a model field to distinguish between TT and Falcon. | ||
15 | ** 26/7/96 Roman Zippel: | ||
16 | ** Renamed to setup.h; added some useful macros to allow gcc some | ||
17 | ** optimizations if possible. | ||
18 | ** 5/10/96 Geert Uytterhoeven: | ||
19 | ** Redesign of the boot information structure; renamed to bootinfo.h again | ||
20 | ** 27/11/96 Geert Uytterhoeven: | ||
21 | ** Backwards compatibility with bootinfo interface version 1.0 | ||
22 | */ | ||
23 | |||
24 | #ifndef _M68K_BOOTINFO_H | ||
25 | #define _M68K_BOOTINFO_H | ||
26 | |||
27 | |||
28 | /* | ||
29 | * Bootinfo definitions | ||
30 | * | ||
31 | * This is an easily parsable and extendable structure containing all | ||
32 | * information to be passed from the bootstrap to the kernel. | ||
33 | * | ||
34 | * This way I hope to keep all future changes back/forewards compatible. | ||
35 | * Thus, keep your fingers crossed... | ||
36 | * | ||
37 | * This structure is copied right after the kernel bss by the bootstrap | ||
38 | * routine. | ||
39 | */ | ||
40 | |||
41 | #ifndef __ASSEMBLY__ | ||
42 | |||
43 | struct bi_record { | ||
44 | unsigned short tag; /* tag ID */ | ||
45 | unsigned short size; /* size of record (in bytes) */ | ||
46 | unsigned long data[0]; /* data */ | ||
47 | }; | ||
48 | |||
49 | #endif /* __ASSEMBLY__ */ | ||
50 | |||
51 | |||
52 | /* | ||
53 | * Tag Definitions | ||
54 | * | ||
55 | * Machine independent tags start counting from 0x0000 | ||
56 | * Machine dependent tags start counting from 0x8000 | ||
57 | */ | ||
58 | |||
59 | #define BI_LAST 0x0000 /* last record (sentinel) */ | ||
60 | #define BI_MACHTYPE 0x0001 /* machine type (u_long) */ | ||
61 | #define BI_CPUTYPE 0x0002 /* cpu type (u_long) */ | ||
62 | #define BI_FPUTYPE 0x0003 /* fpu type (u_long) */ | ||
63 | #define BI_MMUTYPE 0x0004 /* mmu type (u_long) */ | ||
64 | #define BI_MEMCHUNK 0x0005 /* memory chunk address and size */ | ||
65 | /* (struct mem_info) */ | ||
66 | #define BI_RAMDISK 0x0006 /* ramdisk address and size */ | ||
67 | /* (struct mem_info) */ | ||
68 | #define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */ | ||
69 | /* (string) */ | ||
70 | |||
71 | /* | ||
72 | * Amiga-specific tags | ||
73 | */ | ||
74 | |||
75 | #define BI_AMIGA_MODEL 0x8000 /* model (u_long) */ | ||
76 | #define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */ | ||
77 | /* (struct ConfigDev) */ | ||
78 | #define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */ | ||
79 | #define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */ | ||
80 | #define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */ | ||
81 | #define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */ | ||
82 | #define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */ | ||
83 | #define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */ | ||
84 | |||
85 | /* | ||
86 | * Atari-specific tags | ||
87 | */ | ||
88 | |||
89 | #define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */ | ||
90 | #define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */ | ||
91 | /* (values are ATARI_MACH_* defines */ | ||
92 | |||
93 | /* mch_cookie values (upper word) */ | ||
94 | #define ATARI_MCH_ST 0 | ||
95 | #define ATARI_MCH_STE 1 | ||
96 | #define ATARI_MCH_TT 2 | ||
97 | #define ATARI_MCH_FALCON 3 | ||
98 | |||
99 | /* mch_type values */ | ||
100 | #define ATARI_MACH_NORMAL 0 /* no special machine type */ | ||
101 | #define ATARI_MACH_MEDUSA 1 /* Medusa 040 */ | ||
102 | #define ATARI_MACH_HADES 2 /* Hades 040 or 060 */ | ||
103 | #define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */ | ||
104 | |||
105 | /* | ||
106 | * VME-specific tags | ||
107 | */ | ||
108 | |||
109 | #define BI_VME_TYPE 0x8000 /* VME sub-architecture (u_long) */ | ||
110 | #define BI_VME_BRDINFO 0x8001 /* VME board information (struct) */ | ||
111 | |||
112 | /* BI_VME_TYPE codes */ | ||
113 | #define VME_TYPE_TP34V 0x0034 /* Tadpole TP34V */ | ||
114 | #define VME_TYPE_MVME147 0x0147 /* Motorola MVME147 */ | ||
115 | #define VME_TYPE_MVME162 0x0162 /* Motorola MVME162 */ | ||
116 | #define VME_TYPE_MVME166 0x0166 /* Motorola MVME166 */ | ||
117 | #define VME_TYPE_MVME167 0x0167 /* Motorola MVME167 */ | ||
118 | #define VME_TYPE_MVME172 0x0172 /* Motorola MVME172 */ | ||
119 | #define VME_TYPE_MVME177 0x0177 /* Motorola MVME177 */ | ||
120 | #define VME_TYPE_BVME4000 0x4000 /* BVM Ltd. BVME4000 */ | ||
121 | #define VME_TYPE_BVME6000 0x6000 /* BVM Ltd. BVME6000 */ | ||
122 | |||
123 | /* BI_VME_BRDINFO is a 32 byte struct as returned by the Bug code on | ||
124 | * Motorola VME boards. Contains board number, Bug version, board | ||
125 | * configuration options, etc. See include/asm/mvme16xhw.h for details. | ||
126 | */ | ||
127 | |||
128 | |||
129 | /* | ||
130 | * Macintosh-specific tags (all u_long) | ||
131 | */ | ||
132 | |||
133 | #define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */ | ||
134 | #define BI_MAC_VADDR 0x8001 /* Mac video base address */ | ||
135 | #define BI_MAC_VDEPTH 0x8002 /* Mac video depth */ | ||
136 | #define BI_MAC_VROW 0x8003 /* Mac video rowbytes */ | ||
137 | #define BI_MAC_VDIM 0x8004 /* Mac video dimensions */ | ||
138 | #define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */ | ||
139 | #define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */ | ||
140 | #define BI_MAC_BTIME 0x8007 /* Mac boot time */ | ||
141 | #define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */ | ||
142 | #define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */ | ||
143 | #define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */ | ||
144 | #define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */ | ||
145 | |||
146 | /* | ||
147 | * Macintosh hardware profile data - unused, see macintosh.h for | ||
148 | * resonable type values | ||
149 | */ | ||
150 | |||
151 | #define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */ | ||
152 | #define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */ | ||
153 | #define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */ | ||
154 | #define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */ | ||
155 | #define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */ | ||
156 | #define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */ | ||
157 | #define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */ | ||
158 | #define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */ | ||
159 | #define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */ | ||
160 | #define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */ | ||
161 | #define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */ | ||
162 | #define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */ | ||
163 | #define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */ | ||
164 | #define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */ | ||
165 | #define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */ | ||
166 | #define BI_MAC_PMU 0x801f /* Mac power management / poweroff hardware */ | ||
167 | #define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */ | ||
168 | #define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */ | ||
169 | |||
170 | /* | ||
171 | * Mac: compatibility with old booter data format (temporarily) | ||
172 | * Fields unused with the new bootinfo can be deleted now; instead of | ||
173 | * adding new fields the struct might be splitted into a hardware address | ||
174 | * part and a hardware type part | ||
175 | */ | ||
176 | |||
177 | #ifndef __ASSEMBLY__ | ||
178 | |||
179 | struct mac_booter_data | ||
180 | { | ||
181 | unsigned long videoaddr; | ||
182 | unsigned long videorow; | ||
183 | unsigned long videodepth; | ||
184 | unsigned long dimensions; | ||
185 | unsigned long args; | ||
186 | unsigned long boottime; | ||
187 | unsigned long gmtbias; | ||
188 | unsigned long bootver; | ||
189 | unsigned long videological; | ||
190 | unsigned long sccbase; | ||
191 | unsigned long id; | ||
192 | unsigned long memsize; | ||
193 | unsigned long serialmf; | ||
194 | unsigned long serialhsk; | ||
195 | unsigned long serialgpi; | ||
196 | unsigned long printmf; | ||
197 | unsigned long printhsk; | ||
198 | unsigned long printgpi; | ||
199 | unsigned long cpuid; | ||
200 | unsigned long rombase; | ||
201 | unsigned long adbdelay; | ||
202 | unsigned long timedbra; | ||
203 | }; | ||
204 | |||
205 | extern struct mac_booter_data | ||
206 | mac_bi_data; | ||
207 | |||
208 | #endif | ||
209 | |||
210 | /* | ||
211 | * Apollo-specific tags | ||
212 | */ | ||
213 | |||
214 | #define BI_APOLLO_MODEL 0x8000 /* model (u_long) */ | ||
215 | |||
216 | /* | ||
217 | * HP300-specific tags | ||
218 | */ | ||
219 | |||
220 | #define BI_HP300_MODEL 0x8000 /* model (u_long) */ | ||
221 | #define BI_HP300_UART_SCODE 0x8001 /* UART select code (u_long) */ | ||
222 | #define BI_HP300_UART_ADDR 0x8002 /* phys. addr of UART (u_long) */ | ||
223 | |||
224 | /* | ||
225 | * Stuff for bootinfo interface versioning | ||
226 | * | ||
227 | * At the start of kernel code, a 'struct bootversion' is located. | ||
228 | * bootstrap checks for a matching version of the interface before booting | ||
229 | * a kernel, to avoid user confusion if kernel and bootstrap don't work | ||
230 | * together :-) | ||
231 | * | ||
232 | * If incompatible changes are made to the bootinfo interface, the major | ||
233 | * number below should be stepped (and the minor reset to 0) for the | ||
234 | * appropriate machine. If a change is backward-compatible, the minor | ||
235 | * should be stepped. "Backwards-compatible" means that booting will work, | ||
236 | * but certain features may not. | ||
237 | */ | ||
238 | |||
239 | #define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */ | ||
240 | #define MK_BI_VERSION(major,minor) (((major)<<16)+(minor)) | ||
241 | #define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff) | ||
242 | #define BI_VERSION_MINOR(v) ((v) & 0xffff) | ||
243 | |||
244 | #ifndef __ASSEMBLY__ | ||
245 | |||
246 | struct bootversion { | ||
247 | unsigned short branch; | ||
248 | unsigned long magic; | ||
249 | struct { | ||
250 | unsigned long machtype; | ||
251 | unsigned long version; | ||
252 | } machversions[0]; | ||
253 | }; | ||
254 | |||
255 | #endif /* __ASSEMBLY__ */ | ||
256 | |||
257 | #define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
258 | #define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 ) | ||
259 | #define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
260 | #define MVME147_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
261 | #define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
262 | #define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
263 | #define Q40_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
264 | #define HP300_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) | ||
265 | |||
266 | #ifdef BOOTINFO_COMPAT_1_0 | ||
267 | |||
268 | /* | ||
269 | * Backwards compatibility with bootinfo interface version 1.0 | ||
270 | */ | ||
271 | |||
272 | #define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) | ||
273 | #define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) | ||
274 | #define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) | ||
275 | |||
276 | #include <linux/zorro.h> | ||
277 | |||
278 | #define COMPAT_NUM_AUTO 16 | ||
279 | |||
280 | struct compat_bi_Amiga { | ||
281 | int model; | ||
282 | int num_autocon; | ||
283 | struct ConfigDev autocon[COMPAT_NUM_AUTO]; | ||
284 | unsigned long chip_size; | ||
285 | unsigned char vblank; | ||
286 | unsigned char psfreq; | ||
287 | unsigned long eclock; | ||
288 | unsigned long chipset; | ||
289 | unsigned long hw_present; | ||
290 | }; | ||
291 | |||
292 | struct compat_bi_Atari { | ||
293 | unsigned long hw_present; | ||
294 | unsigned long mch_cookie; | ||
295 | }; | ||
296 | |||
297 | #ifndef __ASSEMBLY__ | ||
298 | |||
299 | struct compat_bi_Macintosh | ||
300 | { | ||
301 | unsigned long videoaddr; | ||
302 | unsigned long videorow; | ||
303 | unsigned long videodepth; | ||
304 | unsigned long dimensions; | ||
305 | unsigned long args; | ||
306 | unsigned long boottime; | ||
307 | unsigned long gmtbias; | ||
308 | unsigned long bootver; | ||
309 | unsigned long videological; | ||
310 | unsigned long sccbase; | ||
311 | unsigned long id; | ||
312 | unsigned long memsize; | ||
313 | unsigned long serialmf; | ||
314 | unsigned long serialhsk; | ||
315 | unsigned long serialgpi; | ||
316 | unsigned long printmf; | ||
317 | unsigned long printhsk; | ||
318 | unsigned long printgpi; | ||
319 | unsigned long cpuid; | ||
320 | unsigned long rombase; | ||
321 | unsigned long adbdelay; | ||
322 | unsigned long timedbra; | ||
323 | }; | ||
324 | |||
325 | #endif | ||
326 | |||
327 | struct compat_mem_info { | ||
328 | unsigned long addr; | ||
329 | unsigned long size; | ||
330 | }; | ||
331 | |||
332 | #define COMPAT_NUM_MEMINFO 4 | ||
333 | |||
334 | #define COMPAT_CPUB_68020 0 | ||
335 | #define COMPAT_CPUB_68030 1 | ||
336 | #define COMPAT_CPUB_68040 2 | ||
337 | #define COMPAT_CPUB_68060 3 | ||
338 | #define COMPAT_FPUB_68881 5 | ||
339 | #define COMPAT_FPUB_68882 6 | ||
340 | #define COMPAT_FPUB_68040 7 | ||
341 | #define COMPAT_FPUB_68060 8 | ||
342 | |||
343 | #define COMPAT_CPU_68020 (1<<COMPAT_CPUB_68020) | ||
344 | #define COMPAT_CPU_68030 (1<<COMPAT_CPUB_68030) | ||
345 | #define COMPAT_CPU_68040 (1<<COMPAT_CPUB_68040) | ||
346 | #define COMPAT_CPU_68060 (1<<COMPAT_CPUB_68060) | ||
347 | #define COMPAT_CPU_MASK (31) | ||
348 | #define COMPAT_FPU_68881 (1<<COMPAT_FPUB_68881) | ||
349 | #define COMPAT_FPU_68882 (1<<COMPAT_FPUB_68882) | ||
350 | #define COMPAT_FPU_68040 (1<<COMPAT_FPUB_68040) | ||
351 | #define COMPAT_FPU_68060 (1<<COMPAT_FPUB_68060) | ||
352 | #define COMPAT_FPU_MASK (0xfe0) | ||
353 | |||
354 | #define COMPAT_CL_SIZE (256) | ||
355 | |||
356 | struct compat_bootinfo { | ||
357 | unsigned long machtype; | ||
358 | unsigned long cputype; | ||
359 | struct compat_mem_info memory[COMPAT_NUM_MEMINFO]; | ||
360 | int num_memory; | ||
361 | unsigned long ramdisk_size; | ||
362 | unsigned long ramdisk_addr; | ||
363 | char command_line[COMPAT_CL_SIZE]; | ||
364 | union { | ||
365 | struct compat_bi_Amiga bi_ami; | ||
366 | struct compat_bi_Atari bi_ata; | ||
367 | struct compat_bi_Macintosh bi_mac; | ||
368 | } bi_un; | ||
369 | }; | ||
370 | |||
371 | #define bi_amiga bi_un.bi_ami | ||
372 | #define bi_atari bi_un.bi_ata | ||
373 | #define bi_mac bi_un.bi_mac | ||
374 | |||
375 | #endif /* BOOTINFO_COMPAT_1_0 */ | ||
376 | |||
377 | |||
378 | #endif /* _M68K_BOOTINFO_H */ | ||
diff --git a/arch/m68k/include/asm/bootinfo_no.h b/arch/m68k/include/asm/bootinfo_no.h deleted file mode 100644 index c12e526f5189..000000000000 --- a/arch/m68k/include/asm/bootinfo_no.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | |||
2 | /* Nothing for m68knommu */ | ||
diff --git a/arch/m68k/include/asm/bug.h b/arch/m68k/include/asm/bug.h index 997e0944ebc1..ef9a2e47352f 100644 --- a/arch/m68k/include/asm/bug.h +++ b/arch/m68k/include/asm/bug.h | |||
@@ -1,5 +1,30 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_BUG_H |
2 | #include "bug_no.h" | 2 | #define _M68K_BUG_H |
3 | |||
4 | #ifdef CONFIG_MMU | ||
5 | #ifdef CONFIG_BUG | ||
6 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
7 | #ifndef CONFIG_SUN3 | ||
8 | #define BUG() do { \ | ||
9 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | ||
10 | __builtin_trap(); \ | ||
11 | } while (0) | ||
3 | #else | 12 | #else |
4 | #include "bug_mm.h" | 13 | #define BUG() do { \ |
14 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | ||
15 | panic("BUG!"); \ | ||
16 | } while (0) | ||
17 | #endif | ||
18 | #else | ||
19 | #define BUG() do { \ | ||
20 | __builtin_trap(); \ | ||
21 | } while (0) | ||
22 | #endif | ||
23 | |||
24 | #define HAVE_ARCH_BUG | ||
25 | #endif | ||
26 | #endif /* CONFIG_MMU */ | ||
27 | |||
28 | #include <asm-generic/bug.h> | ||
29 | |||
5 | #endif | 30 | #endif |
diff --git a/arch/m68k/include/asm/bug_mm.h b/arch/m68k/include/asm/bug_mm.h deleted file mode 100644 index e5b528deb8a8..000000000000 --- a/arch/m68k/include/asm/bug_mm.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | #ifndef _M68K_BUG_H | ||
2 | #define _M68K_BUG_H | ||
3 | |||
4 | |||
5 | #ifdef CONFIG_BUG | ||
6 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
7 | #ifndef CONFIG_SUN3 | ||
8 | #define BUG() do { \ | ||
9 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | ||
10 | __builtin_trap(); \ | ||
11 | } while (0) | ||
12 | #else | ||
13 | #define BUG() do { \ | ||
14 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | ||
15 | panic("BUG!"); \ | ||
16 | } while (0) | ||
17 | #endif | ||
18 | #else | ||
19 | #define BUG() do { \ | ||
20 | __builtin_trap(); \ | ||
21 | } while (0) | ||
22 | #endif | ||
23 | |||
24 | #define HAVE_ARCH_BUG | ||
25 | #endif | ||
26 | |||
27 | #include <asm-generic/bug.h> | ||
28 | |||
29 | #endif | ||
diff --git a/arch/m68k/include/asm/bug_no.h b/arch/m68k/include/asm/bug_no.h deleted file mode 100644 index 70e7dc0af21a..000000000000 --- a/arch/m68k/include/asm/bug_no.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_BUG_H | ||
2 | #define _M68KNOMMU_BUG_H | ||
3 | #include <asm-generic/bug.h> | ||
4 | #endif | ||
diff --git a/arch/m68k/include/asm/bugs.h b/arch/m68k/include/asm/bugs.h index 01f047d784ec..d06207b9ba5a 100644 --- a/arch/m68k/include/asm/bugs.h +++ b/arch/m68k/include/asm/bugs.h | |||
@@ -1,5 +1,20 @@ | |||
1 | #ifdef __uClinux__ | 1 | /* |
2 | #include "bugs_no.h" | 2 | * include/asm-m68k/bugs.h |
3 | * | ||
4 | * Copyright (C) 1994 Linus Torvalds | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * This is included by init/main.c to check for architecture-dependent bugs. | ||
9 | * | ||
10 | * Needs: | ||
11 | * void check_bugs(void); | ||
12 | */ | ||
13 | |||
14 | #ifdef CONFIG_MMU | ||
15 | extern void check_bugs(void); /* in arch/m68k/kernel/setup.c */ | ||
3 | #else | 16 | #else |
4 | #include "bugs_mm.h" | 17 | static void check_bugs(void) |
18 | { | ||
19 | } | ||
5 | #endif | 20 | #endif |
diff --git a/arch/m68k/include/asm/bugs_mm.h b/arch/m68k/include/asm/bugs_mm.h deleted file mode 100644 index d01935592410..000000000000 --- a/arch/m68k/include/asm/bugs_mm.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-m68k/bugs.h | ||
3 | * | ||
4 | * Copyright (C) 1994 Linus Torvalds | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * This is included by init/main.c to check for architecture-dependent bugs. | ||
9 | * | ||
10 | * Needs: | ||
11 | * void check_bugs(void); | ||
12 | */ | ||
13 | |||
14 | extern void check_bugs(void); /* in arch/m68k/kernel/setup.c */ | ||
diff --git a/arch/m68k/include/asm/bugs_no.h b/arch/m68k/include/asm/bugs_no.h deleted file mode 100644 index 5f382dac3a60..000000000000 --- a/arch/m68k/include/asm/bugs_no.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-m68k/bugs.h | ||
3 | * | ||
4 | * Copyright (C) 1994 Linus Torvalds | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * This is included by init/main.c to check for architecture-dependent bugs. | ||
9 | * | ||
10 | * Needs: | ||
11 | * void check_bugs(void); | ||
12 | */ | ||
13 | |||
14 | static void check_bugs(void) | ||
15 | { | ||
16 | } | ||
diff --git a/arch/m68k/include/asm/cache.h b/arch/m68k/include/asm/cache.h index 599c29bc8f40..fed3fd30de7e 100644 --- a/arch/m68k/include/asm/cache.h +++ b/arch/m68k/include/asm/cache.h | |||
@@ -1,5 +1,11 @@ | |||
1 | #ifdef __uClinux__ | 1 | /* |
2 | #include "cache_no.h" | 2 | * include/asm-m68k/cache.h |
3 | #else | 3 | */ |
4 | #include "cache_mm.h" | 4 | #ifndef __ARCH_M68K_CACHE_H |
5 | #define __ARCH_M68K_CACHE_H | ||
6 | |||
7 | /* bytes per L1 cache line */ | ||
8 | #define L1_CACHE_SHIFT 4 | ||
9 | #define L1_CACHE_BYTES (1<< L1_CACHE_SHIFT) | ||
10 | |||
5 | #endif | 11 | #endif |
diff --git a/arch/m68k/include/asm/cache_mm.h b/arch/m68k/include/asm/cache_mm.h deleted file mode 100644 index fed3fd30de7e..000000000000 --- a/arch/m68k/include/asm/cache_mm.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-m68k/cache.h | ||
3 | */ | ||
4 | #ifndef __ARCH_M68K_CACHE_H | ||
5 | #define __ARCH_M68K_CACHE_H | ||
6 | |||
7 | /* bytes per L1 cache line */ | ||
8 | #define L1_CACHE_SHIFT 4 | ||
9 | #define L1_CACHE_BYTES (1<< L1_CACHE_SHIFT) | ||
10 | |||
11 | #endif | ||
diff --git a/arch/m68k/include/asm/cache_no.h b/arch/m68k/include/asm/cache_no.h deleted file mode 100644 index 24e9eace5f8c..000000000000 --- a/arch/m68k/include/asm/cache_no.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef __ARCH_M68KNOMMU_CACHE_H | ||
2 | #define __ARCH_M68KNOMMU_CACHE_H | ||
3 | |||
4 | /* bytes per L1 cache line */ | ||
5 | #define L1_CACHE_BYTES 16 /* this need to be at least 1 */ | ||
6 | |||
7 | /* m68k-elf-gcc 2.95.2 doesn't like these */ | ||
8 | |||
9 | #define __cacheline_aligned | ||
10 | #define ____cacheline_aligned | ||
11 | |||
12 | #endif | ||
diff --git a/arch/m68k/include/asm/current.h b/arch/m68k/include/asm/current.h index 51b056dfaedd..91fcc5358cfe 100644 --- a/arch/m68k/include/asm/current.h +++ b/arch/m68k/include/asm/current.h | |||
@@ -1,5 +1,28 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_CURRENT_H |
2 | #include "current_no.h" | 2 | #define _M68K_CURRENT_H |
3 | |||
4 | #ifdef CONFIG_MMU | ||
5 | |||
6 | register struct task_struct *current __asm__("%a2"); | ||
7 | |||
3 | #else | 8 | #else |
4 | #include "current_mm.h" | 9 | |
5 | #endif | 10 | /* |
11 | * Rather than dedicate a register (as the m68k source does), we | ||
12 | * just keep a global, we should probably just change it all to be | ||
13 | * current and lose _current_task. | ||
14 | */ | ||
15 | #include <linux/thread_info.h> | ||
16 | |||
17 | struct task_struct; | ||
18 | |||
19 | static inline struct task_struct *get_current(void) | ||
20 | { | ||
21 | return(current_thread_info()->task); | ||
22 | } | ||
23 | |||
24 | #define current get_current() | ||
25 | |||
26 | #endif /* CONFNIG_MMU */ | ||
27 | |||
28 | #endif /* !(_M68K_CURRENT_H) */ | ||
diff --git a/arch/m68k/include/asm/current_mm.h b/arch/m68k/include/asm/current_mm.h deleted file mode 100644 index 8de8f8ceda61..000000000000 --- a/arch/m68k/include/asm/current_mm.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _M68K_CURRENT_H | ||
2 | #define _M68K_CURRENT_H | ||
3 | |||
4 | register struct task_struct *current __asm__("%a2"); | ||
5 | |||
6 | #endif /* !(_M68K_CURRENT_H) */ | ||
diff --git a/arch/m68k/include/asm/current_no.h b/arch/m68k/include/asm/current_no.h deleted file mode 100644 index 53ee0f9f7cef..000000000000 --- a/arch/m68k/include/asm/current_no.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_CURRENT_H | ||
2 | #define _M68KNOMMU_CURRENT_H | ||
3 | /* | ||
4 | * current.h | ||
5 | * (C) Copyright 2000, Lineo, David McCullough <davidm@uclinux.org> | ||
6 | * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) | ||
7 | * | ||
8 | * rather than dedicate a register (as the m68k source does), we | ||
9 | * just keep a global, we should probably just change it all to be | ||
10 | * current and lose _current_task. | ||
11 | */ | ||
12 | |||
13 | #include <linux/thread_info.h> | ||
14 | |||
15 | struct task_struct; | ||
16 | |||
17 | static inline struct task_struct *get_current(void) | ||
18 | { | ||
19 | return(current_thread_info()->task); | ||
20 | } | ||
21 | |||
22 | #define current get_current() | ||
23 | |||
24 | #endif /* _M68KNOMMU_CURRENT_H */ | ||
diff --git a/arch/m68k/include/asm/div64.h b/arch/m68k/include/asm/div64.h index d211d9f54276..edb66148a71d 100644 --- a/arch/m68k/include/asm/div64.h +++ b/arch/m68k/include/asm/div64.h | |||
@@ -1,5 +1,34 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_DIV64_H |
2 | #include "div64_no.h" | 2 | #define _M68K_DIV64_H |
3 | |||
4 | #ifdef CONFIG_MMU | ||
5 | |||
6 | #include <linux/types.h> | ||
7 | |||
8 | /* n = n / base; return rem; */ | ||
9 | |||
10 | #define do_div(n, base) ({ \ | ||
11 | union { \ | ||
12 | unsigned long n32[2]; \ | ||
13 | unsigned long long n64; \ | ||
14 | } __n; \ | ||
15 | unsigned long __rem, __upper; \ | ||
16 | \ | ||
17 | __n.n64 = (n); \ | ||
18 | if ((__upper = __n.n32[0])) { \ | ||
19 | asm ("divul.l %2,%1:%0" \ | ||
20 | : "=d" (__n.n32[0]), "=d" (__upper) \ | ||
21 | : "d" (base), "0" (__n.n32[0])); \ | ||
22 | } \ | ||
23 | asm ("divu.l %2,%1:%0" \ | ||
24 | : "=d" (__n.n32[1]), "=d" (__rem) \ | ||
25 | : "d" (base), "1" (__upper), "0" (__n.n32[1])); \ | ||
26 | (n) = __n.n64; \ | ||
27 | __rem; \ | ||
28 | }) | ||
29 | |||
3 | #else | 30 | #else |
4 | #include "div64_mm.h" | 31 | #include <asm-generic/div64.h> |
5 | #endif | 32 | #endif /* CONFIG_MMU */ |
33 | |||
34 | #endif /* _M68K_DIV64_H */ | ||
diff --git a/arch/m68k/include/asm/div64_mm.h b/arch/m68k/include/asm/div64_mm.h deleted file mode 100644 index 8243c931b5c0..000000000000 --- a/arch/m68k/include/asm/div64_mm.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #ifndef _M68K_DIV64_H | ||
2 | #define _M68K_DIV64_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* n = n / base; return rem; */ | ||
7 | |||
8 | #define do_div(n, base) ({ \ | ||
9 | union { \ | ||
10 | unsigned long n32[2]; \ | ||
11 | unsigned long long n64; \ | ||
12 | } __n; \ | ||
13 | unsigned long __rem, __upper; \ | ||
14 | \ | ||
15 | __n.n64 = (n); \ | ||
16 | if ((__upper = __n.n32[0])) { \ | ||
17 | asm ("divul.l %2,%1:%0" \ | ||
18 | : "=d" (__n.n32[0]), "=d" (__upper) \ | ||
19 | : "d" (base), "0" (__n.n32[0])); \ | ||
20 | } \ | ||
21 | asm ("divu.l %2,%1:%0" \ | ||
22 | : "=d" (__n.n32[1]), "=d" (__rem) \ | ||
23 | : "d" (base), "1" (__upper), "0" (__n.n32[1])); \ | ||
24 | (n) = __n.n64; \ | ||
25 | __rem; \ | ||
26 | }) | ||
27 | |||
28 | #endif /* _M68K_DIV64_H */ | ||
diff --git a/arch/m68k/include/asm/div64_no.h b/arch/m68k/include/asm/div64_no.h deleted file mode 100644 index 6cd978cefb28..000000000000 --- a/arch/m68k/include/asm/div64_no.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/div64.h> | ||
diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h index f4a4c7638f89..26f505488c11 100644 --- a/arch/m68k/include/asm/dma-mapping.h +++ b/arch/m68k/include/asm/dma-mapping.h | |||
@@ -1,5 +1,112 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_DMA_MAPPING_H |
2 | #include "dma-mapping_no.h" | 2 | #define _M68K_DMA_MAPPING_H |
3 | |||
4 | #include <asm/cache.h> | ||
5 | |||
6 | struct scatterlist; | ||
7 | |||
8 | #ifndef CONFIG_MMU_SUN3 | ||
9 | static inline int dma_supported(struct device *dev, u64 mask) | ||
10 | { | ||
11 | return 1; | ||
12 | } | ||
13 | |||
14 | static inline int dma_set_mask(struct device *dev, u64 mask) | ||
15 | { | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | static inline int dma_get_cache_alignment(void) | ||
20 | { | ||
21 | return 1 << L1_CACHE_SHIFT; | ||
22 | } | ||
23 | |||
24 | static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr) | ||
25 | { | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | extern void *dma_alloc_coherent(struct device *, size_t, | ||
30 | dma_addr_t *, gfp_t); | ||
31 | extern void dma_free_coherent(struct device *, size_t, | ||
32 | void *, dma_addr_t); | ||
33 | |||
34 | static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, | ||
35 | dma_addr_t *handle, gfp_t flag) | ||
36 | { | ||
37 | return dma_alloc_coherent(dev, size, handle, flag); | ||
38 | } | ||
39 | static inline void dma_free_noncoherent(struct device *dev, size_t size, | ||
40 | void *addr, dma_addr_t handle) | ||
41 | { | ||
42 | dma_free_coherent(dev, size, addr, handle); | ||
43 | } | ||
44 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | ||
45 | enum dma_data_direction dir) | ||
46 | { | ||
47 | /* we use coherent allocation, so not much to do here. */ | ||
48 | } | ||
49 | |||
50 | extern dma_addr_t dma_map_single(struct device *, void *, size_t, | ||
51 | enum dma_data_direction); | ||
52 | static inline void dma_unmap_single(struct device *dev, dma_addr_t addr, | ||
53 | size_t size, enum dma_data_direction dir) | ||
54 | { | ||
55 | } | ||
56 | |||
57 | extern dma_addr_t dma_map_page(struct device *, struct page *, | ||
58 | unsigned long, size_t size, | ||
59 | enum dma_data_direction); | ||
60 | static inline void dma_unmap_page(struct device *dev, dma_addr_t address, | ||
61 | size_t size, enum dma_data_direction dir) | ||
62 | { | ||
63 | } | ||
64 | |||
65 | extern int dma_map_sg(struct device *, struct scatterlist *, int, | ||
66 | enum dma_data_direction); | ||
67 | static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
68 | int nhwentries, enum dma_data_direction dir) | ||
69 | { | ||
70 | } | ||
71 | |||
72 | extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t, | ||
73 | enum dma_data_direction); | ||
74 | extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int, | ||
75 | enum dma_data_direction); | ||
76 | |||
77 | static inline void dma_sync_single_range_for_device(struct device *dev, | ||
78 | dma_addr_t dma_handle, unsigned long offset, size_t size, | ||
79 | enum dma_data_direction direction) | ||
80 | { | ||
81 | /* just sync everything for now */ | ||
82 | dma_sync_single_for_device(dev, dma_handle, offset + size, direction); | ||
83 | } | ||
84 | |||
85 | static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, | ||
86 | size_t size, enum dma_data_direction dir) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | ||
91 | int nents, enum dma_data_direction dir) | ||
92 | { | ||
93 | } | ||
94 | |||
95 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | ||
96 | dma_addr_t dma_handle, unsigned long offset, size_t size, | ||
97 | enum dma_data_direction direction) | ||
98 | { | ||
99 | /* just sync everything for now */ | ||
100 | dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction); | ||
101 | } | ||
102 | |||
103 | static inline int dma_mapping_error(struct device *dev, dma_addr_t handle) | ||
104 | { | ||
105 | return 0; | ||
106 | } | ||
107 | |||
3 | #else | 108 | #else |
4 | #include "dma-mapping_mm.h" | 109 | #include <asm-generic/dma-mapping-broken.h> |
5 | #endif | 110 | #endif |
111 | |||
112 | #endif /* _M68K_DMA_MAPPING_H */ | ||
diff --git a/arch/m68k/include/asm/dma-mapping_mm.h b/arch/m68k/include/asm/dma-mapping_mm.h deleted file mode 100644 index 26f505488c11..000000000000 --- a/arch/m68k/include/asm/dma-mapping_mm.h +++ /dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | #ifndef _M68K_DMA_MAPPING_H | ||
2 | #define _M68K_DMA_MAPPING_H | ||
3 | |||
4 | #include <asm/cache.h> | ||
5 | |||
6 | struct scatterlist; | ||
7 | |||
8 | #ifndef CONFIG_MMU_SUN3 | ||
9 | static inline int dma_supported(struct device *dev, u64 mask) | ||
10 | { | ||
11 | return 1; | ||
12 | } | ||
13 | |||
14 | static inline int dma_set_mask(struct device *dev, u64 mask) | ||
15 | { | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | static inline int dma_get_cache_alignment(void) | ||
20 | { | ||
21 | return 1 << L1_CACHE_SHIFT; | ||
22 | } | ||
23 | |||
24 | static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr) | ||
25 | { | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | extern void *dma_alloc_coherent(struct device *, size_t, | ||
30 | dma_addr_t *, gfp_t); | ||
31 | extern void dma_free_coherent(struct device *, size_t, | ||
32 | void *, dma_addr_t); | ||
33 | |||
34 | static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, | ||
35 | dma_addr_t *handle, gfp_t flag) | ||
36 | { | ||
37 | return dma_alloc_coherent(dev, size, handle, flag); | ||
38 | } | ||
39 | static inline void dma_free_noncoherent(struct device *dev, size_t size, | ||
40 | void *addr, dma_addr_t handle) | ||
41 | { | ||
42 | dma_free_coherent(dev, size, addr, handle); | ||
43 | } | ||
44 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | ||
45 | enum dma_data_direction dir) | ||
46 | { | ||
47 | /* we use coherent allocation, so not much to do here. */ | ||
48 | } | ||
49 | |||
50 | extern dma_addr_t dma_map_single(struct device *, void *, size_t, | ||
51 | enum dma_data_direction); | ||
52 | static inline void dma_unmap_single(struct device *dev, dma_addr_t addr, | ||
53 | size_t size, enum dma_data_direction dir) | ||
54 | { | ||
55 | } | ||
56 | |||
57 | extern dma_addr_t dma_map_page(struct device *, struct page *, | ||
58 | unsigned long, size_t size, | ||
59 | enum dma_data_direction); | ||
60 | static inline void dma_unmap_page(struct device *dev, dma_addr_t address, | ||
61 | size_t size, enum dma_data_direction dir) | ||
62 | { | ||
63 | } | ||
64 | |||
65 | extern int dma_map_sg(struct device *, struct scatterlist *, int, | ||
66 | enum dma_data_direction); | ||
67 | static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
68 | int nhwentries, enum dma_data_direction dir) | ||
69 | { | ||
70 | } | ||
71 | |||
72 | extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t, | ||
73 | enum dma_data_direction); | ||
74 | extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int, | ||
75 | enum dma_data_direction); | ||
76 | |||
77 | static inline void dma_sync_single_range_for_device(struct device *dev, | ||
78 | dma_addr_t dma_handle, unsigned long offset, size_t size, | ||
79 | enum dma_data_direction direction) | ||
80 | { | ||
81 | /* just sync everything for now */ | ||
82 | dma_sync_single_for_device(dev, dma_handle, offset + size, direction); | ||
83 | } | ||
84 | |||
85 | static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, | ||
86 | size_t size, enum dma_data_direction dir) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | ||
91 | int nents, enum dma_data_direction dir) | ||
92 | { | ||
93 | } | ||
94 | |||
95 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | ||
96 | dma_addr_t dma_handle, unsigned long offset, size_t size, | ||
97 | enum dma_data_direction direction) | ||
98 | { | ||
99 | /* just sync everything for now */ | ||
100 | dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction); | ||
101 | } | ||
102 | |||
103 | static inline int dma_mapping_error(struct device *dev, dma_addr_t handle) | ||
104 | { | ||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | #else | ||
109 | #include <asm-generic/dma-mapping-broken.h> | ||
110 | #endif | ||
111 | |||
112 | #endif /* _M68K_DMA_MAPPING_H */ | ||
diff --git a/arch/m68k/include/asm/dma-mapping_no.h b/arch/m68k/include/asm/dma-mapping_no.h deleted file mode 100644 index 1748f2bca940..000000000000 --- a/arch/m68k/include/asm/dma-mapping_no.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_DMA_MAPPING_H | ||
2 | #define _M68KNOMMU_DMA_MAPPING_H | ||
3 | |||
4 | #include <asm-generic/dma-mapping-broken.h> | ||
5 | |||
6 | #endif /* _M68KNOMMU_DMA_MAPPING_H */ | ||
diff --git a/arch/m68k/include/asm/elf.h b/arch/m68k/include/asm/elf.h index 04ce488bc63f..0b0f49eb876b 100644 --- a/arch/m68k/include/asm/elf.h +++ b/arch/m68k/include/asm/elf.h | |||
@@ -1,5 +1,119 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef __ASMm68k_ELF_H |
2 | #include "elf_no.h" | 2 | #define __ASMm68k_ELF_H |
3 | |||
4 | /* | ||
5 | * ELF register definitions.. | ||
6 | */ | ||
7 | |||
8 | #include <asm/ptrace.h> | ||
9 | #include <asm/user.h> | ||
10 | |||
11 | /* | ||
12 | * 68k ELF relocation types | ||
13 | */ | ||
14 | #define R_68K_NONE 0 | ||
15 | #define R_68K_32 1 | ||
16 | #define R_68K_16 2 | ||
17 | #define R_68K_8 3 | ||
18 | #define R_68K_PC32 4 | ||
19 | #define R_68K_PC16 5 | ||
20 | #define R_68K_PC8 6 | ||
21 | #define R_68K_GOT32 7 | ||
22 | #define R_68K_GOT16 8 | ||
23 | #define R_68K_GOT8 9 | ||
24 | #define R_68K_GOT32O 10 | ||
25 | #define R_68K_GOT16O 11 | ||
26 | #define R_68K_GOT8O 12 | ||
27 | #define R_68K_PLT32 13 | ||
28 | #define R_68K_PLT16 14 | ||
29 | #define R_68K_PLT8 15 | ||
30 | #define R_68K_PLT32O 16 | ||
31 | #define R_68K_PLT16O 17 | ||
32 | #define R_68K_PLT8O 18 | ||
33 | #define R_68K_COPY 19 | ||
34 | #define R_68K_GLOB_DAT 20 | ||
35 | #define R_68K_JMP_SLOT 21 | ||
36 | #define R_68K_RELATIVE 22 | ||
37 | |||
38 | typedef unsigned long elf_greg_t; | ||
39 | |||
40 | #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t)) | ||
41 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
42 | |||
43 | typedef struct user_m68kfp_struct elf_fpregset_t; | ||
44 | |||
45 | /* | ||
46 | * This is used to ensure we don't load something for the wrong architecture. | ||
47 | */ | ||
48 | #define elf_check_arch(x) ((x)->e_machine == EM_68K) | ||
49 | |||
50 | /* | ||
51 | * These are used to set parameters in the core dumps. | ||
52 | */ | ||
53 | #define ELF_CLASS ELFCLASS32 | ||
54 | #define ELF_DATA ELFDATA2MSB | ||
55 | #define ELF_ARCH EM_68K | ||
56 | |||
57 | /* For SVR4/m68k the function pointer to be registered with `atexit' is | ||
58 | passed in %a1. Although my copy of the ABI has no such statement, it | ||
59 | is actually used on ASV. */ | ||
60 | #define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0 | ||
61 | |||
62 | #define USE_ELF_CORE_DUMP | ||
63 | #ifndef CONFIG_SUN3 | ||
64 | #define ELF_EXEC_PAGESIZE 4096 | ||
3 | #else | 65 | #else |
4 | #include "elf_mm.h" | 66 | #define ELF_EXEC_PAGESIZE 8192 |
67 | #endif | ||
68 | |||
69 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | ||
70 | use of this is to invoke "./ld.so someprog" to test out a new version of | ||
71 | the loader. We need to make sure that it is out of the way of the program | ||
72 | that it will "exec", and that there is sufficient room for the brk. */ | ||
73 | |||
74 | #ifndef CONFIG_SUN3 | ||
75 | #define ELF_ET_DYN_BASE 0xD0000000UL | ||
76 | #else | ||
77 | #define ELF_ET_DYN_BASE 0x0D800000UL | ||
78 | #endif | ||
79 | |||
80 | #define ELF_CORE_COPY_REGS(pr_reg, regs) \ | ||
81 | /* Bleech. */ \ | ||
82 | pr_reg[0] = regs->d1; \ | ||
83 | pr_reg[1] = regs->d2; \ | ||
84 | pr_reg[2] = regs->d3; \ | ||
85 | pr_reg[3] = regs->d4; \ | ||
86 | pr_reg[4] = regs->d5; \ | ||
87 | pr_reg[7] = regs->a0; \ | ||
88 | pr_reg[8] = regs->a1; \ | ||
89 | pr_reg[9] = regs->a2; \ | ||
90 | pr_reg[14] = regs->d0; \ | ||
91 | pr_reg[15] = rdusp(); \ | ||
92 | pr_reg[16] = regs->orig_d0; \ | ||
93 | pr_reg[17] = regs->sr; \ | ||
94 | pr_reg[18] = regs->pc; \ | ||
95 | pr_reg[19] = (regs->format << 12) | regs->vector; \ | ||
96 | { \ | ||
97 | struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \ | ||
98 | pr_reg[5] = sw->d6; \ | ||
99 | pr_reg[6] = sw->d7; \ | ||
100 | pr_reg[10] = sw->a3; \ | ||
101 | pr_reg[11] = sw->a4; \ | ||
102 | pr_reg[12] = sw->a5; \ | ||
103 | pr_reg[13] = sw->a6; \ | ||
104 | } | ||
105 | |||
106 | /* This yields a mask that user programs can use to figure out what | ||
107 | instruction set this cpu supports. */ | ||
108 | |||
109 | #define ELF_HWCAP (0) | ||
110 | |||
111 | /* This yields a string that ld.so will use to load implementation | ||
112 | specific libraries for optimization. This is more specific in | ||
113 | intent than poking at uname or /proc/cpuinfo. */ | ||
114 | |||
115 | #define ELF_PLATFORM (NULL) | ||
116 | |||
117 | #define SET_PERSONALITY(ex) set_personality(PER_LINUX) | ||
118 | |||
5 | #endif | 119 | #endif |
diff --git a/arch/m68k/include/asm/elf_mm.h b/arch/m68k/include/asm/elf_mm.h deleted file mode 100644 index 0b0f49eb876b..000000000000 --- a/arch/m68k/include/asm/elf_mm.h +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | #ifndef __ASMm68k_ELF_H | ||
2 | #define __ASMm68k_ELF_H | ||
3 | |||
4 | /* | ||
5 | * ELF register definitions.. | ||
6 | */ | ||
7 | |||
8 | #include <asm/ptrace.h> | ||
9 | #include <asm/user.h> | ||
10 | |||
11 | /* | ||
12 | * 68k ELF relocation types | ||
13 | */ | ||
14 | #define R_68K_NONE 0 | ||
15 | #define R_68K_32 1 | ||
16 | #define R_68K_16 2 | ||
17 | #define R_68K_8 3 | ||
18 | #define R_68K_PC32 4 | ||
19 | #define R_68K_PC16 5 | ||
20 | #define R_68K_PC8 6 | ||
21 | #define R_68K_GOT32 7 | ||
22 | #define R_68K_GOT16 8 | ||
23 | #define R_68K_GOT8 9 | ||
24 | #define R_68K_GOT32O 10 | ||
25 | #define R_68K_GOT16O 11 | ||
26 | #define R_68K_GOT8O 12 | ||
27 | #define R_68K_PLT32 13 | ||
28 | #define R_68K_PLT16 14 | ||
29 | #define R_68K_PLT8 15 | ||
30 | #define R_68K_PLT32O 16 | ||
31 | #define R_68K_PLT16O 17 | ||
32 | #define R_68K_PLT8O 18 | ||
33 | #define R_68K_COPY 19 | ||
34 | #define R_68K_GLOB_DAT 20 | ||
35 | #define R_68K_JMP_SLOT 21 | ||
36 | #define R_68K_RELATIVE 22 | ||
37 | |||
38 | typedef unsigned long elf_greg_t; | ||
39 | |||
40 | #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t)) | ||
41 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
42 | |||
43 | typedef struct user_m68kfp_struct elf_fpregset_t; | ||
44 | |||
45 | /* | ||
46 | * This is used to ensure we don't load something for the wrong architecture. | ||
47 | */ | ||
48 | #define elf_check_arch(x) ((x)->e_machine == EM_68K) | ||
49 | |||
50 | /* | ||
51 | * These are used to set parameters in the core dumps. | ||
52 | */ | ||
53 | #define ELF_CLASS ELFCLASS32 | ||
54 | #define ELF_DATA ELFDATA2MSB | ||
55 | #define ELF_ARCH EM_68K | ||
56 | |||
57 | /* For SVR4/m68k the function pointer to be registered with `atexit' is | ||
58 | passed in %a1. Although my copy of the ABI has no such statement, it | ||
59 | is actually used on ASV. */ | ||
60 | #define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0 | ||
61 | |||
62 | #define USE_ELF_CORE_DUMP | ||
63 | #ifndef CONFIG_SUN3 | ||
64 | #define ELF_EXEC_PAGESIZE 4096 | ||
65 | #else | ||
66 | #define ELF_EXEC_PAGESIZE 8192 | ||
67 | #endif | ||
68 | |||
69 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | ||
70 | use of this is to invoke "./ld.so someprog" to test out a new version of | ||
71 | the loader. We need to make sure that it is out of the way of the program | ||
72 | that it will "exec", and that there is sufficient room for the brk. */ | ||
73 | |||
74 | #ifndef CONFIG_SUN3 | ||
75 | #define ELF_ET_DYN_BASE 0xD0000000UL | ||
76 | #else | ||
77 | #define ELF_ET_DYN_BASE 0x0D800000UL | ||
78 | #endif | ||
79 | |||
80 | #define ELF_CORE_COPY_REGS(pr_reg, regs) \ | ||
81 | /* Bleech. */ \ | ||
82 | pr_reg[0] = regs->d1; \ | ||
83 | pr_reg[1] = regs->d2; \ | ||
84 | pr_reg[2] = regs->d3; \ | ||
85 | pr_reg[3] = regs->d4; \ | ||
86 | pr_reg[4] = regs->d5; \ | ||
87 | pr_reg[7] = regs->a0; \ | ||
88 | pr_reg[8] = regs->a1; \ | ||
89 | pr_reg[9] = regs->a2; \ | ||
90 | pr_reg[14] = regs->d0; \ | ||
91 | pr_reg[15] = rdusp(); \ | ||
92 | pr_reg[16] = regs->orig_d0; \ | ||
93 | pr_reg[17] = regs->sr; \ | ||
94 | pr_reg[18] = regs->pc; \ | ||
95 | pr_reg[19] = (regs->format << 12) | regs->vector; \ | ||
96 | { \ | ||
97 | struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \ | ||
98 | pr_reg[5] = sw->d6; \ | ||
99 | pr_reg[6] = sw->d7; \ | ||
100 | pr_reg[10] = sw->a3; \ | ||
101 | pr_reg[11] = sw->a4; \ | ||
102 | pr_reg[12] = sw->a5; \ | ||
103 | pr_reg[13] = sw->a6; \ | ||
104 | } | ||
105 | |||
106 | /* This yields a mask that user programs can use to figure out what | ||
107 | instruction set this cpu supports. */ | ||
108 | |||
109 | #define ELF_HWCAP (0) | ||
110 | |||
111 | /* This yields a string that ld.so will use to load implementation | ||
112 | specific libraries for optimization. This is more specific in | ||
113 | intent than poking at uname or /proc/cpuinfo. */ | ||
114 | |||
115 | #define ELF_PLATFORM (NULL) | ||
116 | |||
117 | #define SET_PERSONALITY(ex) set_personality(PER_LINUX) | ||
118 | |||
119 | #endif | ||
diff --git a/arch/m68k/include/asm/elf_no.h b/arch/m68k/include/asm/elf_no.h deleted file mode 100644 index b8046837f384..000000000000 --- a/arch/m68k/include/asm/elf_no.h +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | #ifndef __ASMm68k_ELF_H | ||
2 | #define __ASMm68k_ELF_H | ||
3 | |||
4 | /* | ||
5 | * ELF register definitions.. | ||
6 | */ | ||
7 | |||
8 | #include <asm/ptrace.h> | ||
9 | #include <asm/user.h> | ||
10 | |||
11 | /* | ||
12 | * 68k ELF relocation types | ||
13 | */ | ||
14 | #define R_68K_NONE 0 | ||
15 | #define R_68K_32 1 | ||
16 | #define R_68K_16 2 | ||
17 | #define R_68K_8 3 | ||
18 | #define R_68K_PC32 4 | ||
19 | #define R_68K_PC16 5 | ||
20 | #define R_68K_PC8 6 | ||
21 | #define R_68K_GOT32 7 | ||
22 | #define R_68K_GOT16 8 | ||
23 | #define R_68K_GOT8 9 | ||
24 | #define R_68K_GOT32O 10 | ||
25 | #define R_68K_GOT16O 11 | ||
26 | #define R_68K_GOT8O 12 | ||
27 | #define R_68K_PLT32 13 | ||
28 | #define R_68K_PLT16 14 | ||
29 | #define R_68K_PLT8 15 | ||
30 | #define R_68K_PLT32O 16 | ||
31 | #define R_68K_PLT16O 17 | ||
32 | #define R_68K_PLT8O 18 | ||
33 | #define R_68K_COPY 19 | ||
34 | #define R_68K_GLOB_DAT 20 | ||
35 | #define R_68K_JMP_SLOT 21 | ||
36 | #define R_68K_RELATIVE 22 | ||
37 | |||
38 | typedef unsigned long elf_greg_t; | ||
39 | |||
40 | #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t)) | ||
41 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
42 | |||
43 | typedef struct user_m68kfp_struct elf_fpregset_t; | ||
44 | |||
45 | /* | ||
46 | * This is used to ensure we don't load something for the wrong architecture. | ||
47 | */ | ||
48 | #define elf_check_arch(x) ((x)->e_machine == EM_68K) | ||
49 | |||
50 | /* | ||
51 | * These are used to set parameters in the core dumps. | ||
52 | */ | ||
53 | #define ELF_CLASS ELFCLASS32 | ||
54 | #define ELF_DATA ELFDATA2MSB | ||
55 | #define ELF_ARCH EM_68K | ||
56 | |||
57 | /* For SVR4/m68k the function pointer to be registered with `atexit' is | ||
58 | passed in %a1. Although my copy of the ABI has no such statement, it | ||
59 | is actually used on ASV. */ | ||
60 | #define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0 | ||
61 | |||
62 | #define USE_ELF_CORE_DUMP | ||
63 | #define ELF_EXEC_PAGESIZE 4096 | ||
64 | |||
65 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | ||
66 | use of this is to invoke "./ld.so someprog" to test out a new version of | ||
67 | the loader. We need to make sure that it is out of the way of the program | ||
68 | that it will "exec", and that there is sufficient room for the brk. */ | ||
69 | |||
70 | #define ELF_ET_DYN_BASE 0xD0000000UL | ||
71 | |||
72 | #define ELF_CORE_COPY_REGS(pr_reg, regs) \ | ||
73 | /* Bleech. */ \ | ||
74 | pr_reg[0] = regs->d1; \ | ||
75 | pr_reg[1] = regs->d2; \ | ||
76 | pr_reg[2] = regs->d3; \ | ||
77 | pr_reg[3] = regs->d4; \ | ||
78 | pr_reg[4] = regs->d5; \ | ||
79 | pr_reg[7] = regs->a0; \ | ||
80 | pr_reg[8] = regs->a1; \ | ||
81 | pr_reg[14] = regs->d0; \ | ||
82 | pr_reg[15] = rdusp(); \ | ||
83 | pr_reg[16] = 0 /* regs->orig_d0 */; \ | ||
84 | pr_reg[17] = regs->sr; \ | ||
85 | pr_reg[18] = regs->pc; \ | ||
86 | /* pr_reg[19] = (regs->format << 12) | regs->vector; */ \ | ||
87 | { \ | ||
88 | struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \ | ||
89 | pr_reg[5] = sw->d6; \ | ||
90 | pr_reg[6] = sw->d7; \ | ||
91 | pr_reg[10] = sw->a3; \ | ||
92 | pr_reg[11] = sw->a4; \ | ||
93 | pr_reg[12] = sw->a5; \ | ||
94 | pr_reg[13] = sw->a6; \ | ||
95 | } | ||
96 | |||
97 | /* This yields a mask that user programs can use to figure out what | ||
98 | instruction set this cpu supports. */ | ||
99 | |||
100 | #define ELF_HWCAP (0) | ||
101 | |||
102 | /* This yields a string that ld.so will use to load implementation | ||
103 | specific libraries for optimization. This is more specific in | ||
104 | intent than poking at uname or /proc/cpuinfo. */ | ||
105 | |||
106 | #define ELF_PLATFORM (NULL) | ||
107 | |||
108 | #define SET_PERSONALITY(ex) set_personality(PER_LINUX) | ||
109 | |||
110 | #endif | ||
diff --git a/arch/m68k/include/asm/fb.h b/arch/m68k/include/asm/fb.h index 97bcaefd2064..be4e4c6797e8 100644 --- a/arch/m68k/include/asm/fb.h +++ b/arch/m68k/include/asm/fb.h | |||
@@ -1,5 +1,38 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _ASM_FB_H_ |
2 | #include "fb_no.h" | 2 | #define _ASM_FB_H_ |
3 | |||
4 | #include <linux/fb.h> | ||
5 | #include <linux/fs.h> | ||
6 | #include <asm/page.h> | ||
7 | #include <asm/setup.h> | ||
8 | |||
9 | #ifdef CONFIG_MMU | ||
10 | #ifdef CONFIG_SUN3 | ||
11 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
12 | unsigned long off) | ||
13 | { | ||
14 | pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE; | ||
15 | } | ||
3 | #else | 16 | #else |
4 | #include "fb_mm.h" | 17 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, |
5 | #endif | 18 | unsigned long off) |
19 | { | ||
20 | if (CPU_IS_020_OR_030) | ||
21 | pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030; | ||
22 | if (CPU_IS_040_OR_060) { | ||
23 | pgprot_val(vma->vm_page_prot) &= _CACHEMASK040; | ||
24 | /* Use no-cache mode, serialized */ | ||
25 | pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S; | ||
26 | } | ||
27 | } | ||
28 | #endif /* CONFIG_SUN3 */ | ||
29 | #else | ||
30 | #define fb_pgprotect(...) do {} while (0) | ||
31 | #endif /* CONFIG_MMU */ | ||
32 | |||
33 | static inline int fb_is_primary_device(struct fb_info *info) | ||
34 | { | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/arch/m68k/include/asm/fb_mm.h b/arch/m68k/include/asm/fb_mm.h deleted file mode 100644 index 380b97ae8157..000000000000 --- a/arch/m68k/include/asm/fb_mm.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | #ifndef _ASM_FB_H_ | ||
2 | #define _ASM_FB_H_ | ||
3 | |||
4 | #include <linux/fb.h> | ||
5 | #include <linux/fs.h> | ||
6 | #include <asm/page.h> | ||
7 | #include <asm/setup.h> | ||
8 | |||
9 | #ifdef CONFIG_SUN3 | ||
10 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
11 | unsigned long off) | ||
12 | { | ||
13 | pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE; | ||
14 | } | ||
15 | #else | ||
16 | static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, | ||
17 | unsigned long off) | ||
18 | { | ||
19 | if (CPU_IS_020_OR_030) | ||
20 | pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030; | ||
21 | if (CPU_IS_040_OR_060) { | ||
22 | pgprot_val(vma->vm_page_prot) &= _CACHEMASK040; | ||
23 | /* Use no-cache mode, serialized */ | ||
24 | pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S; | ||
25 | } | ||
26 | } | ||
27 | #endif /* CONFIG_SUN3 */ | ||
28 | |||
29 | static inline int fb_is_primary_device(struct fb_info *info) | ||
30 | { | ||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/arch/m68k/include/asm/fb_no.h b/arch/m68k/include/asm/fb_no.h deleted file mode 100644 index c7df38030992..000000000000 --- a/arch/m68k/include/asm/fb_no.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef _ASM_FB_H_ | ||
2 | #define _ASM_FB_H_ | ||
3 | #include <linux/fb.h> | ||
4 | |||
5 | #define fb_pgprotect(...) do {} while (0) | ||
6 | |||
7 | static inline int fb_is_primary_device(struct fb_info *info) | ||
8 | { | ||
9 | return 0; | ||
10 | } | ||
11 | |||
12 | #endif /* _ASM_FB_H_ */ | ||
diff --git a/arch/m68k/include/asm/fpu.h b/arch/m68k/include/asm/fpu.h index e19bc5ed9c37..ffb6b8cfc6d5 100644 --- a/arch/m68k/include/asm/fpu.h +++ b/arch/m68k/include/asm/fpu.h | |||
@@ -1,5 +1,21 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef __M68K_FPU_H |
2 | #include "fpu_no.h" | 2 | #define __M68K_FPU_H |
3 | |||
4 | |||
5 | /* | ||
6 | * MAX floating point unit state size (FSAVE/FRESTORE) | ||
7 | */ | ||
8 | |||
9 | #if defined(CONFIG_M68020) || defined(CONFIG_M68030) | ||
10 | #define FPSTATESIZE (216) | ||
11 | #elif defined(CONFIG_M68040) | ||
12 | #define FPSTATESIZE (96) | ||
13 | #elif defined(CONFIG_M68KFPU_EMU) | ||
14 | #define FPSTATESIZE (28) | ||
15 | #elif defined(CONFIG_M68060) | ||
16 | #define FPSTATESIZE (12) | ||
3 | #else | 17 | #else |
4 | #include "fpu_mm.h" | 18 | #define FPSTATESIZE (0) |
5 | #endif | 19 | #endif |
20 | |||
21 | #endif /* __M68K_FPU_H */ | ||
diff --git a/arch/m68k/include/asm/fpu_mm.h b/arch/m68k/include/asm/fpu_mm.h deleted file mode 100644 index ffb6b8cfc6d5..000000000000 --- a/arch/m68k/include/asm/fpu_mm.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #ifndef __M68K_FPU_H | ||
2 | #define __M68K_FPU_H | ||
3 | |||
4 | |||
5 | /* | ||
6 | * MAX floating point unit state size (FSAVE/FRESTORE) | ||
7 | */ | ||
8 | |||
9 | #if defined(CONFIG_M68020) || defined(CONFIG_M68030) | ||
10 | #define FPSTATESIZE (216) | ||
11 | #elif defined(CONFIG_M68040) | ||
12 | #define FPSTATESIZE (96) | ||
13 | #elif defined(CONFIG_M68KFPU_EMU) | ||
14 | #define FPSTATESIZE (28) | ||
15 | #elif defined(CONFIG_M68060) | ||
16 | #define FPSTATESIZE (12) | ||
17 | #else | ||
18 | #define FPSTATESIZE (0) | ||
19 | #endif | ||
20 | |||
21 | #endif /* __M68K_FPU_H */ | ||
diff --git a/arch/m68k/include/asm/fpu_no.h b/arch/m68k/include/asm/fpu_no.h deleted file mode 100644 index b16b2e4fca2a..000000000000 --- a/arch/m68k/include/asm/fpu_no.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #ifndef __M68KNOMMU_FPU_H | ||
2 | #define __M68KNOMMU_FPU_H | ||
3 | |||
4 | |||
5 | /* | ||
6 | * MAX floating point unit state size (FSAVE/FRESTORE) | ||
7 | */ | ||
8 | #if defined(CONFIG_M68020) || defined(CONFIG_M68030) | ||
9 | #define FPSTATESIZE (216/sizeof(unsigned char)) | ||
10 | #elif defined(CONFIG_M68040) | ||
11 | #define FPSTATESIZE (96/sizeof(unsigned char)) | ||
12 | #elif defined(CONFIG_M68KFPU_EMU) | ||
13 | #define FPSTATESIZE (28/sizeof(unsigned char)) | ||
14 | #elif defined(CONFIG_M68060) | ||
15 | #define FPSTATESIZE (12/sizeof(unsigned char)) | ||
16 | #else | ||
17 | /* Assume no FP unit present then... */ | ||
18 | #define FPSTATESIZE (2) /* dummy size */ | ||
19 | #endif | ||
20 | |||
21 | #endif /* __M68K_FPU_H */ | ||
diff --git a/arch/m68k/include/asm/ftrace.h b/arch/m68k/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/m68k/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/m68k/include/asm/hw_irq.h b/arch/m68k/include/asm/hw_irq.h index e19526015890..eacef0951fbf 100644 --- a/arch/m68k/include/asm/hw_irq.h +++ b/arch/m68k/include/asm/hw_irq.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef __ASM_M68K_HW_IRQ_H |
2 | #include "hw_irq_no.h" | 2 | #define __ASM_M68K_HW_IRQ_H |
3 | #else | 3 | |
4 | #include "hw_irq_mm.h" | 4 | /* Dummy include. */ |
5 | |||
5 | #endif | 6 | #endif |
diff --git a/arch/m68k/include/asm/hw_irq_mm.h b/arch/m68k/include/asm/hw_irq_mm.h deleted file mode 100644 index eacef0951fbf..000000000000 --- a/arch/m68k/include/asm/hw_irq_mm.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_M68K_HW_IRQ_H | ||
2 | #define __ASM_M68K_HW_IRQ_H | ||
3 | |||
4 | /* Dummy include. */ | ||
5 | |||
6 | #endif | ||
diff --git a/arch/m68k/include/asm/hw_irq_no.h b/arch/m68k/include/asm/hw_irq_no.h deleted file mode 100644 index f3ec9e5ae049..000000000000 --- a/arch/m68k/include/asm/hw_irq_no.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #ifndef __M68KNOMMU_HW_IRQ_H__ | ||
2 | #define __M68KNOMMU_HW_IRQ_H__ | ||
3 | |||
4 | #endif /* __M68KNOMMU_HW_IRQ_H__ */ | ||
diff --git a/arch/m68k/include/asm/kmap_types.h b/arch/m68k/include/asm/kmap_types.h index 045d9fd122a2..c843c63d3801 100644 --- a/arch/m68k/include/asm/kmap_types.h +++ b/arch/m68k/include/asm/kmap_types.h | |||
@@ -1,5 +1,21 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef __ASM_M68K_KMAP_TYPES_H |
2 | #include "kmap_types_no.h" | 2 | #define __ASM_M68K_KMAP_TYPES_H |
3 | #else | 3 | |
4 | #include "kmap_types_mm.h" | 4 | enum km_type { |
5 | #endif | 5 | KM_BOUNCE_READ, |
6 | KM_SKB_SUNRPC_DATA, | ||
7 | KM_SKB_DATA_SOFTIRQ, | ||
8 | KM_USER0, | ||
9 | KM_USER1, | ||
10 | KM_BIO_SRC_IRQ, | ||
11 | KM_BIO_DST_IRQ, | ||
12 | KM_PTE0, | ||
13 | KM_PTE1, | ||
14 | KM_IRQ0, | ||
15 | KM_IRQ1, | ||
16 | KM_SOFTIRQ0, | ||
17 | KM_SOFTIRQ1, | ||
18 | KM_TYPE_NR | ||
19 | }; | ||
20 | |||
21 | #endif /* __ASM_M68K_KMAP_TYPES_H */ | ||
diff --git a/arch/m68k/include/asm/kmap_types_mm.h b/arch/m68k/include/asm/kmap_types_mm.h deleted file mode 100644 index c843c63d3801..000000000000 --- a/arch/m68k/include/asm/kmap_types_mm.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #ifndef __ASM_M68K_KMAP_TYPES_H | ||
2 | #define __ASM_M68K_KMAP_TYPES_H | ||
3 | |||
4 | enum km_type { | ||
5 | KM_BOUNCE_READ, | ||
6 | KM_SKB_SUNRPC_DATA, | ||
7 | KM_SKB_DATA_SOFTIRQ, | ||
8 | KM_USER0, | ||
9 | KM_USER1, | ||
10 | KM_BIO_SRC_IRQ, | ||
11 | KM_BIO_DST_IRQ, | ||
12 | KM_PTE0, | ||
13 | KM_PTE1, | ||
14 | KM_IRQ0, | ||
15 | KM_IRQ1, | ||
16 | KM_SOFTIRQ0, | ||
17 | KM_SOFTIRQ1, | ||
18 | KM_TYPE_NR | ||
19 | }; | ||
20 | |||
21 | #endif /* __ASM_M68K_KMAP_TYPES_H */ | ||
diff --git a/arch/m68k/include/asm/kmap_types_no.h b/arch/m68k/include/asm/kmap_types_no.h deleted file mode 100644 index bfb6707575d1..000000000000 --- a/arch/m68k/include/asm/kmap_types_no.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #ifndef __ASM_M68K_KMAP_TYPES_H | ||
2 | #define __ASM_M68K_KMAP_TYPES_H | ||
3 | |||
4 | enum km_type { | ||
5 | KM_BOUNCE_READ, | ||
6 | KM_SKB_SUNRPC_DATA, | ||
7 | KM_SKB_DATA_SOFTIRQ, | ||
8 | KM_USER0, | ||
9 | KM_USER1, | ||
10 | KM_BIO_SRC_IRQ, | ||
11 | KM_BIO_DST_IRQ, | ||
12 | KM_PTE0, | ||
13 | KM_PTE1, | ||
14 | KM_IRQ0, | ||
15 | KM_IRQ1, | ||
16 | KM_SOFTIRQ0, | ||
17 | KM_SOFTIRQ1, | ||
18 | KM_TYPE_NR | ||
19 | }; | ||
20 | |||
21 | #endif | ||
diff --git a/arch/m68k/include/asm/m532xsim.h b/arch/m68k/include/asm/m532xsim.h index 1835fd20a82c..ce603451b55e 100644 --- a/arch/m68k/include/asm/m532xsim.h +++ b/arch/m68k/include/asm/m532xsim.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define MCFINT_VECBASE 64 | 16 | #define MCFINT_VECBASE 64 |
17 | #define MCFINT_UART0 26 /* Interrupt number for UART0 */ | 17 | #define MCFINT_UART0 26 /* Interrupt number for UART0 */ |
18 | #define MCFINT_UART1 27 /* Interrupt number for UART1 */ | 18 | #define MCFINT_UART1 27 /* Interrupt number for UART1 */ |
19 | #define MCFINT_UART2 28 /* Interrupt number for UART2 */ | ||
19 | 20 | ||
20 | #define MCF_WTM_WCR MCF_REG16(0xFC098000) | 21 | #define MCF_WTM_WCR MCF_REG16(0xFC098000) |
21 | 22 | ||
diff --git a/arch/m68k/include/asm/mc146818rtc.h b/arch/m68k/include/asm/mc146818rtc.h index fb90dcf78426..9f70a01f73dc 100644 --- a/arch/m68k/include/asm/mc146818rtc.h +++ b/arch/m68k/include/asm/mc146818rtc.h | |||
@@ -1,5 +1,26 @@ | |||
1 | #ifdef __uClinux__ | 1 | /* |
2 | #include "mc146818rtc_no.h" | 2 | * Machine dependent access functions for RTC registers. |
3 | #else | 3 | */ |
4 | #include "mc146818rtc_mm.h" | 4 | #ifndef _ASM_MC146818RTC_H |
5 | #endif | 5 | #define _ASM_MC146818RTC_H |
6 | |||
7 | |||
8 | #ifdef CONFIG_ATARI | ||
9 | /* RTC in Atari machines */ | ||
10 | |||
11 | #include <asm/atarihw.h> | ||
12 | |||
13 | #define RTC_PORT(x) (TT_RTC_BAS + 2*(x)) | ||
14 | #define RTC_ALWAYS_BCD 0 | ||
15 | |||
16 | #define CMOS_READ(addr) ({ \ | ||
17 | atari_outb_p((addr),RTC_PORT(0)); \ | ||
18 | atari_inb_p(RTC_PORT(1)); \ | ||
19 | }) | ||
20 | #define CMOS_WRITE(val, addr) ({ \ | ||
21 | atari_outb_p((addr),RTC_PORT(0)); \ | ||
22 | atari_outb_p((val),RTC_PORT(1)); \ | ||
23 | }) | ||
24 | #endif /* CONFIG_ATARI */ | ||
25 | |||
26 | #endif /* _ASM_MC146818RTC_H */ | ||
diff --git a/arch/m68k/include/asm/mc146818rtc_mm.h b/arch/m68k/include/asm/mc146818rtc_mm.h deleted file mode 100644 index 9f70a01f73dc..000000000000 --- a/arch/m68k/include/asm/mc146818rtc_mm.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * Machine dependent access functions for RTC registers. | ||
3 | */ | ||
4 | #ifndef _ASM_MC146818RTC_H | ||
5 | #define _ASM_MC146818RTC_H | ||
6 | |||
7 | |||
8 | #ifdef CONFIG_ATARI | ||
9 | /* RTC in Atari machines */ | ||
10 | |||
11 | #include <asm/atarihw.h> | ||
12 | |||
13 | #define RTC_PORT(x) (TT_RTC_BAS + 2*(x)) | ||
14 | #define RTC_ALWAYS_BCD 0 | ||
15 | |||
16 | #define CMOS_READ(addr) ({ \ | ||
17 | atari_outb_p((addr),RTC_PORT(0)); \ | ||
18 | atari_inb_p(RTC_PORT(1)); \ | ||
19 | }) | ||
20 | #define CMOS_WRITE(val, addr) ({ \ | ||
21 | atari_outb_p((addr),RTC_PORT(0)); \ | ||
22 | atari_outb_p((val),RTC_PORT(1)); \ | ||
23 | }) | ||
24 | #endif /* CONFIG_ATARI */ | ||
25 | |||
26 | #endif /* _ASM_MC146818RTC_H */ | ||
diff --git a/arch/m68k/include/asm/mc146818rtc_no.h b/arch/m68k/include/asm/mc146818rtc_no.h deleted file mode 100644 index 907a0481a140..000000000000 --- a/arch/m68k/include/asm/mc146818rtc_no.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | /* | ||
2 | * Machine dependent access functions for RTC registers. | ||
3 | */ | ||
4 | #ifndef _M68KNOMMU_MC146818RTC_H | ||
5 | #define _M68KNOMMU_MC146818RTC_H | ||
6 | |||
7 | /* empty include file to satisfy the include in genrtc.c/ide-geometry.c */ | ||
8 | |||
9 | #endif /* _M68KNOMMU_MC146818RTC_H */ | ||
diff --git a/arch/m68k/include/asm/mcfpci.h b/arch/m68k/include/asm/mcfpci.h deleted file mode 100644 index f1507dd06ec6..000000000000 --- a/arch/m68k/include/asm/mcfpci.h +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | /****************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * mcfpci.h -- PCI bridge on ColdFire eval boards. | ||
5 | * | ||
6 | * (C) Copyright 2000, Greg Ungerer (gerg@snapgear.com) | ||
7 | * (C) Copyright 2000, Lineo Inc. (www.lineo.com) | ||
8 | */ | ||
9 | |||
10 | /****************************************************************************/ | ||
11 | #ifndef mcfpci_h | ||
12 | #define mcfpci_h | ||
13 | /****************************************************************************/ | ||
14 | |||
15 | |||
16 | #ifdef CONFIG_PCI | ||
17 | |||
18 | /* | ||
19 | * Address regions in the PCI address space are not mapped into the | ||
20 | * normal memory space of the ColdFire. They must be accessed via | ||
21 | * handler routines. This is easy for I/O space (inb/outb/etc) but | ||
22 | * needs some code changes to support ordinary memory. Interrupts | ||
23 | * also need to be vectored through the PCI handler first, then it | ||
24 | * will call the actual driver sub-handlers. | ||
25 | */ | ||
26 | |||
27 | /* | ||
28 | * Un-define all the standard I/O access routines. | ||
29 | */ | ||
30 | #undef inb | ||
31 | #undef inw | ||
32 | #undef inl | ||
33 | #undef inb_p | ||
34 | #undef inw_p | ||
35 | #undef insb | ||
36 | #undef insw | ||
37 | #undef insl | ||
38 | #undef outb | ||
39 | #undef outw | ||
40 | #undef outl | ||
41 | #undef outb_p | ||
42 | #undef outw_p | ||
43 | #undef outsb | ||
44 | #undef outsw | ||
45 | #undef outsl | ||
46 | |||
47 | #undef request_irq | ||
48 | #undef free_irq | ||
49 | |||
50 | #undef bus_to_virt | ||
51 | #undef virt_to_bus | ||
52 | |||
53 | |||
54 | /* | ||
55 | * Re-direct all I/O memory accesses functions to PCI specific ones. | ||
56 | */ | ||
57 | #define inb pci_inb | ||
58 | #define inw pci_inw | ||
59 | #define inl pci_inl | ||
60 | #define inb_p pci_inb | ||
61 | #define inw_p pci_inw | ||
62 | #define insb pci_insb | ||
63 | #define insw pci_insw | ||
64 | #define insl pci_insl | ||
65 | |||
66 | #define outb pci_outb | ||
67 | #define outw pci_outw | ||
68 | #define outl pci_outl | ||
69 | #define outb_p pci_outb | ||
70 | #define outw_p pci_outw | ||
71 | #define outsb pci_outsb | ||
72 | #define outsw pci_outsw | ||
73 | #define outsl pci_outsl | ||
74 | |||
75 | #define request_irq pci_request_irq | ||
76 | #define free_irq pci_free_irq | ||
77 | |||
78 | #define virt_to_bus pci_virt_to_bus | ||
79 | #define bus_to_virt pci_bus_to_virt | ||
80 | |||
81 | #define CONFIG_COMEMPCI 1 | ||
82 | |||
83 | |||
84 | /* | ||
85 | * Prototypes of the real PCI functions (defined in bios32.c). | ||
86 | */ | ||
87 | unsigned char pci_inb(unsigned int addr); | ||
88 | unsigned short pci_inw(unsigned int addr); | ||
89 | unsigned int pci_inl(unsigned int addr); | ||
90 | void pci_insb(void *addr, void *buf, int len); | ||
91 | void pci_insw(void *addr, void *buf, int len); | ||
92 | void pci_insl(void *addr, void *buf, int len); | ||
93 | |||
94 | void pci_outb(unsigned char val, unsigned int addr); | ||
95 | void pci_outw(unsigned short val, unsigned int addr); | ||
96 | void pci_outl(unsigned int val, unsigned int addr); | ||
97 | void pci_outsb(void *addr, void *buf, int len); | ||
98 | void pci_outsw(void *addr, void *buf, int len); | ||
99 | void pci_outsl(void *addr, void *buf, int len); | ||
100 | |||
101 | int pci_request_irq(unsigned int irq, | ||
102 | void (*handler)(int, void *, struct pt_regs *), | ||
103 | unsigned long flags, | ||
104 | const char *device, | ||
105 | void *dev_id); | ||
106 | void pci_free_irq(unsigned int irq, void *dev_id); | ||
107 | |||
108 | void *pci_bmalloc(int size); | ||
109 | void pci_bmfree(void *bmp, int len); | ||
110 | void pci_copytoshmem(unsigned long bmp, void *src, int size); | ||
111 | void pci_copyfromshmem(void *dst, unsigned long bmp, int size); | ||
112 | unsigned long pci_virt_to_bus(volatile void *address); | ||
113 | void *pci_bus_to_virt(unsigned long address); | ||
114 | void pci_bmcpyto(void *dst, void *src, int len); | ||
115 | void pci_bmcpyfrom(void *dst, void *src, int len); | ||
116 | |||
117 | #endif /* CONFIG_PCI */ | ||
118 | /****************************************************************************/ | ||
119 | #endif /* mcfpci_h */ | ||
diff --git a/arch/m68k/include/asm/mmu.h b/arch/m68k/include/asm/mmu.h index a81d3946675f..8a11a63ee15a 100644 --- a/arch/m68k/include/asm/mmu.h +++ b/arch/m68k/include/asm/mmu.h | |||
@@ -1,5 +1,13 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef __MMU_H |
2 | #include "mmu_no.h" | 2 | #define __MMU_H |
3 | |||
4 | #ifdef CONFIG_MMU | ||
5 | /* Default "unsigned long" context */ | ||
6 | typedef unsigned long mm_context_t; | ||
3 | #else | 7 | #else |
4 | #include "mmu_mm.h" | 8 | typedef struct { |
9 | unsigned long end_brk; | ||
10 | } mm_context_t; | ||
11 | #endif | ||
12 | |||
5 | #endif | 13 | #endif |
diff --git a/arch/m68k/include/asm/mmu_context.h b/arch/m68k/include/asm/mmu_context.h index b440928fc6c7..7d4341e55a99 100644 --- a/arch/m68k/include/asm/mmu_context.h +++ b/arch/m68k/include/asm/mmu_context.h | |||
@@ -1,5 +1,175 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef __M68K_MMU_CONTEXT_H |
2 | #include "mmu_context_no.h" | 2 | #define __M68K_MMU_CONTEXT_H |
3 | |||
4 | #include <asm-generic/mm_hooks.h> | ||
5 | |||
6 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | ||
7 | { | ||
8 | } | ||
9 | |||
10 | #ifdef CONFIG_MMU | ||
11 | #ifndef CONFIG_SUN3 | ||
12 | |||
13 | #include <asm/setup.h> | ||
14 | #include <asm/page.h> | ||
15 | #include <asm/pgalloc.h> | ||
16 | |||
17 | static inline int init_new_context(struct task_struct *tsk, | ||
18 | struct mm_struct *mm) | ||
19 | { | ||
20 | mm->context = virt_to_phys(mm->pgd); | ||
21 | return 0; | ||
22 | } | ||
23 | |||
24 | #define destroy_context(mm) do { } while(0) | ||
25 | |||
26 | static inline void switch_mm_0230(struct mm_struct *mm) | ||
27 | { | ||
28 | unsigned long crp[2] = { | ||
29 | 0x80000000 | _PAGE_TABLE, mm->context | ||
30 | }; | ||
31 | unsigned long tmp; | ||
32 | |||
33 | asm volatile (".chip 68030"); | ||
34 | |||
35 | /* flush MC68030/MC68020 caches (they are virtually addressed) */ | ||
36 | asm volatile ( | ||
37 | "movec %%cacr,%0;" | ||
38 | "orw %1,%0; " | ||
39 | "movec %0,%%cacr" | ||
40 | : "=d" (tmp) : "di" (FLUSH_I_AND_D)); | ||
41 | |||
42 | /* Switch the root pointer. For a 030-only kernel, | ||
43 | * avoid flushing the whole ATC, we only need to | ||
44 | * flush the user entries. The 68851 does this by | ||
45 | * itself. Avoid a runtime check here. | ||
46 | */ | ||
47 | asm volatile ( | ||
48 | #ifdef CPU_M68030_ONLY | ||
49 | "pmovefd %0,%%crp; " | ||
50 | "pflush #0,#4" | ||
3 | #else | 51 | #else |
4 | #include "mmu_context_mm.h" | 52 | "pmove %0,%%crp" |
5 | #endif | 53 | #endif |
54 | : : "m" (crp[0])); | ||
55 | |||
56 | asm volatile (".chip 68k"); | ||
57 | } | ||
58 | |||
59 | static inline void switch_mm_0460(struct mm_struct *mm) | ||
60 | { | ||
61 | asm volatile (".chip 68040"); | ||
62 | |||
63 | /* flush address translation cache (user entries) */ | ||
64 | asm volatile ("pflushan"); | ||
65 | |||
66 | /* switch the root pointer */ | ||
67 | asm volatile ("movec %0,%%urp" : : "r" (mm->context)); | ||
68 | |||
69 | if (CPU_IS_060) { | ||
70 | unsigned long tmp; | ||
71 | |||
72 | /* clear user entries in the branch cache */ | ||
73 | asm volatile ( | ||
74 | "movec %%cacr,%0; " | ||
75 | "orl %1,%0; " | ||
76 | "movec %0,%%cacr" | ||
77 | : "=d" (tmp): "di" (0x00200000)); | ||
78 | } | ||
79 | |||
80 | asm volatile (".chip 68k"); | ||
81 | } | ||
82 | |||
83 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) | ||
84 | { | ||
85 | if (prev != next) { | ||
86 | if (CPU_IS_020_OR_030) | ||
87 | switch_mm_0230(next); | ||
88 | else | ||
89 | switch_mm_0460(next); | ||
90 | } | ||
91 | } | ||
92 | |||
93 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
94 | |||
95 | static inline void activate_mm(struct mm_struct *prev_mm, | ||
96 | struct mm_struct *next_mm) | ||
97 | { | ||
98 | next_mm->context = virt_to_phys(next_mm->pgd); | ||
99 | |||
100 | if (CPU_IS_020_OR_030) | ||
101 | switch_mm_0230(next_mm); | ||
102 | else | ||
103 | switch_mm_0460(next_mm); | ||
104 | } | ||
105 | |||
106 | #else /* CONFIG_SUN3 */ | ||
107 | #include <asm/sun3mmu.h> | ||
108 | #include <linux/sched.h> | ||
109 | |||
110 | extern unsigned long get_free_context(struct mm_struct *mm); | ||
111 | extern void clear_context(unsigned long context); | ||
112 | |||
113 | /* set the context for a new task to unmapped */ | ||
114 | static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) | ||
115 | { | ||
116 | mm->context = SUN3_INVALID_CONTEXT; | ||
117 | return 0; | ||
118 | } | ||
119 | |||
120 | /* find the context given to this process, and if it hasn't already | ||
121 | got one, go get one for it. */ | ||
122 | static inline void get_mmu_context(struct mm_struct *mm) | ||
123 | { | ||
124 | if(mm->context == SUN3_INVALID_CONTEXT) | ||
125 | mm->context = get_free_context(mm); | ||
126 | } | ||
127 | |||
128 | /* flush context if allocated... */ | ||
129 | static inline void destroy_context(struct mm_struct *mm) | ||
130 | { | ||
131 | if(mm->context != SUN3_INVALID_CONTEXT) | ||
132 | clear_context(mm->context); | ||
133 | } | ||
134 | |||
135 | static inline void activate_context(struct mm_struct *mm) | ||
136 | { | ||
137 | get_mmu_context(mm); | ||
138 | sun3_put_context(mm->context); | ||
139 | } | ||
140 | |||
141 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) | ||
142 | { | ||
143 | activate_context(tsk->mm); | ||
144 | } | ||
145 | |||
146 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
147 | |||
148 | static inline void activate_mm(struct mm_struct *prev_mm, | ||
149 | struct mm_struct *next_mm) | ||
150 | { | ||
151 | activate_context(next_mm); | ||
152 | } | ||
153 | |||
154 | #endif | ||
155 | #else /* !CONFIG_MMU */ | ||
156 | |||
157 | static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) | ||
158 | { | ||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | |||
163 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) | ||
164 | { | ||
165 | } | ||
166 | |||
167 | #define destroy_context(mm) do { } while (0) | ||
168 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
169 | |||
170 | static inline void activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm) | ||
171 | { | ||
172 | } | ||
173 | |||
174 | #endif /* CONFIG_MMU */ | ||
175 | #endif /* __M68K_MMU_CONTEXT_H */ | ||
diff --git a/arch/m68k/include/asm/mmu_context_mm.h b/arch/m68k/include/asm/mmu_context_mm.h deleted file mode 100644 index 894dacbcee14..000000000000 --- a/arch/m68k/include/asm/mmu_context_mm.h +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | #ifndef __M68K_MMU_CONTEXT_H | ||
2 | #define __M68K_MMU_CONTEXT_H | ||
3 | |||
4 | #include <asm-generic/mm_hooks.h> | ||
5 | |||
6 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | ||
7 | { | ||
8 | } | ||
9 | |||
10 | #ifndef CONFIG_SUN3 | ||
11 | |||
12 | #include <asm/setup.h> | ||
13 | #include <asm/page.h> | ||
14 | #include <asm/pgalloc.h> | ||
15 | |||
16 | static inline int init_new_context(struct task_struct *tsk, | ||
17 | struct mm_struct *mm) | ||
18 | { | ||
19 | mm->context = virt_to_phys(mm->pgd); | ||
20 | return 0; | ||
21 | } | ||
22 | |||
23 | #define destroy_context(mm) do { } while(0) | ||
24 | |||
25 | static inline void switch_mm_0230(struct mm_struct *mm) | ||
26 | { | ||
27 | unsigned long crp[2] = { | ||
28 | 0x80000000 | _PAGE_TABLE, mm->context | ||
29 | }; | ||
30 | unsigned long tmp; | ||
31 | |||
32 | asm volatile (".chip 68030"); | ||
33 | |||
34 | /* flush MC68030/MC68020 caches (they are virtually addressed) */ | ||
35 | asm volatile ( | ||
36 | "movec %%cacr,%0;" | ||
37 | "orw %1,%0; " | ||
38 | "movec %0,%%cacr" | ||
39 | : "=d" (tmp) : "di" (FLUSH_I_AND_D)); | ||
40 | |||
41 | /* Switch the root pointer. For a 030-only kernel, | ||
42 | * avoid flushing the whole ATC, we only need to | ||
43 | * flush the user entries. The 68851 does this by | ||
44 | * itself. Avoid a runtime check here. | ||
45 | */ | ||
46 | asm volatile ( | ||
47 | #ifdef CPU_M68030_ONLY | ||
48 | "pmovefd %0,%%crp; " | ||
49 | "pflush #0,#4" | ||
50 | #else | ||
51 | "pmove %0,%%crp" | ||
52 | #endif | ||
53 | : : "m" (crp[0])); | ||
54 | |||
55 | asm volatile (".chip 68k"); | ||
56 | } | ||
57 | |||
58 | static inline void switch_mm_0460(struct mm_struct *mm) | ||
59 | { | ||
60 | asm volatile (".chip 68040"); | ||
61 | |||
62 | /* flush address translation cache (user entries) */ | ||
63 | asm volatile ("pflushan"); | ||
64 | |||
65 | /* switch the root pointer */ | ||
66 | asm volatile ("movec %0,%%urp" : : "r" (mm->context)); | ||
67 | |||
68 | if (CPU_IS_060) { | ||
69 | unsigned long tmp; | ||
70 | |||
71 | /* clear user entries in the branch cache */ | ||
72 | asm volatile ( | ||
73 | "movec %%cacr,%0; " | ||
74 | "orl %1,%0; " | ||
75 | "movec %0,%%cacr" | ||
76 | : "=d" (tmp): "di" (0x00200000)); | ||
77 | } | ||
78 | |||
79 | asm volatile (".chip 68k"); | ||
80 | } | ||
81 | |||
82 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) | ||
83 | { | ||
84 | if (prev != next) { | ||
85 | if (CPU_IS_020_OR_030) | ||
86 | switch_mm_0230(next); | ||
87 | else | ||
88 | switch_mm_0460(next); | ||
89 | } | ||
90 | } | ||
91 | |||
92 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
93 | |||
94 | static inline void activate_mm(struct mm_struct *prev_mm, | ||
95 | struct mm_struct *next_mm) | ||
96 | { | ||
97 | next_mm->context = virt_to_phys(next_mm->pgd); | ||
98 | |||
99 | if (CPU_IS_020_OR_030) | ||
100 | switch_mm_0230(next_mm); | ||
101 | else | ||
102 | switch_mm_0460(next_mm); | ||
103 | } | ||
104 | |||
105 | #else /* CONFIG_SUN3 */ | ||
106 | #include <asm/sun3mmu.h> | ||
107 | #include <linux/sched.h> | ||
108 | |||
109 | extern unsigned long get_free_context(struct mm_struct *mm); | ||
110 | extern void clear_context(unsigned long context); | ||
111 | |||
112 | /* set the context for a new task to unmapped */ | ||
113 | static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) | ||
114 | { | ||
115 | mm->context = SUN3_INVALID_CONTEXT; | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | /* find the context given to this process, and if it hasn't already | ||
120 | got one, go get one for it. */ | ||
121 | static inline void get_mmu_context(struct mm_struct *mm) | ||
122 | { | ||
123 | if(mm->context == SUN3_INVALID_CONTEXT) | ||
124 | mm->context = get_free_context(mm); | ||
125 | } | ||
126 | |||
127 | /* flush context if allocated... */ | ||
128 | static inline void destroy_context(struct mm_struct *mm) | ||
129 | { | ||
130 | if(mm->context != SUN3_INVALID_CONTEXT) | ||
131 | clear_context(mm->context); | ||
132 | } | ||
133 | |||
134 | static inline void activate_context(struct mm_struct *mm) | ||
135 | { | ||
136 | get_mmu_context(mm); | ||
137 | sun3_put_context(mm->context); | ||
138 | } | ||
139 | |||
140 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) | ||
141 | { | ||
142 | activate_context(tsk->mm); | ||
143 | } | ||
144 | |||
145 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
146 | |||
147 | static inline void activate_mm(struct mm_struct *prev_mm, | ||
148 | struct mm_struct *next_mm) | ||
149 | { | ||
150 | activate_context(next_mm); | ||
151 | } | ||
152 | |||
153 | #endif | ||
154 | #endif | ||
diff --git a/arch/m68k/include/asm/mmu_context_no.h b/arch/m68k/include/asm/mmu_context_no.h deleted file mode 100644 index 9ccee4278c97..000000000000 --- a/arch/m68k/include/asm/mmu_context_no.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifndef __M68KNOMMU_MMU_CONTEXT_H | ||
2 | #define __M68KNOMMU_MMU_CONTEXT_H | ||
3 | |||
4 | #include <asm/setup.h> | ||
5 | #include <asm/page.h> | ||
6 | #include <asm/pgalloc.h> | ||
7 | #include <asm-generic/mm_hooks.h> | ||
8 | |||
9 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | ||
10 | { | ||
11 | } | ||
12 | |||
13 | static inline int | ||
14 | init_new_context(struct task_struct *tsk, struct mm_struct *mm) | ||
15 | { | ||
16 | // mm->context = virt_to_phys(mm->pgd); | ||
17 | return(0); | ||
18 | } | ||
19 | |||
20 | #define destroy_context(mm) do { } while(0) | ||
21 | |||
22 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) | ||
23 | { | ||
24 | } | ||
25 | |||
26 | #define deactivate_mm(tsk,mm) do { } while (0) | ||
27 | |||
28 | static inline void activate_mm(struct mm_struct *prev_mm, | ||
29 | struct mm_struct *next_mm) | ||
30 | { | ||
31 | } | ||
32 | |||
33 | #endif | ||
diff --git a/arch/m68k/include/asm/mmu_mm.h b/arch/m68k/include/asm/mmu_mm.h deleted file mode 100644 index ccd36d26615a..000000000000 --- a/arch/m68k/include/asm/mmu_mm.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __MMU_H | ||
2 | #define __MMU_H | ||
3 | |||
4 | /* Default "unsigned long" context */ | ||
5 | typedef unsigned long mm_context_t; | ||
6 | |||
7 | #endif | ||
diff --git a/arch/m68k/include/asm/mmu_no.h b/arch/m68k/include/asm/mmu_no.h deleted file mode 100644 index e2da1e6f09fe..000000000000 --- a/arch/m68k/include/asm/mmu_no.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef __M68KNOMMU_MMU_H | ||
2 | #define __M68KNOMMU_MMU_H | ||
3 | |||
4 | /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ | ||
5 | |||
6 | typedef struct { | ||
7 | unsigned long end_brk; | ||
8 | } mm_context_t; | ||
9 | |||
10 | #endif /* __M68KNOMMU_MMU_H */ | ||
diff --git a/arch/m68k/include/asm/module.h b/arch/m68k/include/asm/module.h index 79b59d137dd0..5f21e11071bd 100644 --- a/arch/m68k/include/asm/module.h +++ b/arch/m68k/include/asm/module.h | |||
@@ -1,5 +1,48 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _ASM_M68K_MODULE_H |
2 | #include "module_no.h" | 2 | #define _ASM_M68K_MODULE_H |
3 | |||
4 | #ifdef CONFIG_MMU | ||
5 | |||
6 | struct mod_arch_specific { | ||
7 | struct m68k_fixup_info *fixup_start, *fixup_end; | ||
8 | }; | ||
9 | |||
10 | #define MODULE_ARCH_INIT { \ | ||
11 | .fixup_start = __start_fixup, \ | ||
12 | .fixup_end = __stop_fixup, \ | ||
13 | } | ||
14 | |||
15 | |||
16 | enum m68k_fixup_type { | ||
17 | m68k_fixup_memoffset, | ||
18 | m68k_fixup_vnode_shift, | ||
19 | }; | ||
20 | |||
21 | struct m68k_fixup_info { | ||
22 | enum m68k_fixup_type type; | ||
23 | void *addr; | ||
24 | }; | ||
25 | |||
26 | #define m68k_fixup(type, addr) \ | ||
27 | " .section \".m68k_fixup\",\"aw\"\n" \ | ||
28 | " .long " #type "," #addr "\n" \ | ||
29 | " .previous\n" | ||
30 | |||
31 | extern struct m68k_fixup_info __start_fixup[], __stop_fixup[]; | ||
32 | |||
33 | struct module; | ||
34 | extern void module_fixup(struct module *mod, struct m68k_fixup_info *start, | ||
35 | struct m68k_fixup_info *end); | ||
36 | |||
3 | #else | 37 | #else |
4 | #include "module_mm.h" | 38 | |
5 | #endif | 39 | struct mod_arch_specific { |
40 | }; | ||
41 | |||
42 | #endif /* CONFIG_MMU */ | ||
43 | |||
44 | #define Elf_Shdr Elf32_Shdr | ||
45 | #define Elf_Sym Elf32_Sym | ||
46 | #define Elf_Ehdr Elf32_Ehdr | ||
47 | |||
48 | #endif /* _ASM_M68K_MODULE_H */ | ||
diff --git a/arch/m68k/include/asm/module_mm.h b/arch/m68k/include/asm/module_mm.h deleted file mode 100644 index 382d20a6fc18..000000000000 --- a/arch/m68k/include/asm/module_mm.h +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | #ifndef _ASM_M68K_MODULE_H | ||
2 | #define _ASM_M68K_MODULE_H | ||
3 | |||
4 | struct mod_arch_specific { | ||
5 | struct m68k_fixup_info *fixup_start, *fixup_end; | ||
6 | }; | ||
7 | |||
8 | #define MODULE_ARCH_INIT { \ | ||
9 | .fixup_start = __start_fixup, \ | ||
10 | .fixup_end = __stop_fixup, \ | ||
11 | } | ||
12 | |||
13 | #define Elf_Shdr Elf32_Shdr | ||
14 | #define Elf_Sym Elf32_Sym | ||
15 | #define Elf_Ehdr Elf32_Ehdr | ||
16 | |||
17 | |||
18 | enum m68k_fixup_type { | ||
19 | m68k_fixup_memoffset, | ||
20 | m68k_fixup_vnode_shift, | ||
21 | }; | ||
22 | |||
23 | struct m68k_fixup_info { | ||
24 | enum m68k_fixup_type type; | ||
25 | void *addr; | ||
26 | }; | ||
27 | |||
28 | #define m68k_fixup(type, addr) \ | ||
29 | " .section \".m68k_fixup\",\"aw\"\n" \ | ||
30 | " .long " #type "," #addr "\n" \ | ||
31 | " .previous\n" | ||
32 | |||
33 | extern struct m68k_fixup_info __start_fixup[], __stop_fixup[]; | ||
34 | |||
35 | struct module; | ||
36 | extern void module_fixup(struct module *mod, struct m68k_fixup_info *start, | ||
37 | struct m68k_fixup_info *end); | ||
38 | |||
39 | #endif /* _ASM_M68K_MODULE_H */ | ||
diff --git a/arch/m68k/include/asm/module_no.h b/arch/m68k/include/asm/module_no.h deleted file mode 100644 index 2e45ab50b232..000000000000 --- a/arch/m68k/include/asm/module_no.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef ASM_M68KNOMMU_MODULE_H | ||
2 | #define ASM_M68KNOMMU_MODULE_H | ||
3 | |||
4 | struct mod_arch_specific { | ||
5 | }; | ||
6 | |||
7 | #define Elf_Shdr Elf32_Shdr | ||
8 | #define Elf_Sym Elf32_Sym | ||
9 | #define Elf_Ehdr Elf32_Ehdr | ||
10 | |||
11 | #endif /* ASM_M68KNOMMU_MODULE_H */ | ||
diff --git a/arch/m68k/include/asm/page_offset.h b/arch/m68k/include/asm/page_offset.h index 66455c849fbb..1780152d81da 100644 --- a/arch/m68k/include/asm/page_offset.h +++ b/arch/m68k/include/asm/page_offset.h | |||
@@ -1,5 +1,11 @@ | |||
1 | #ifdef __uClinux__ | 1 | /* This handles the memory map.. */ |
2 | #include "page_offset_no.h" | 2 | |
3 | #ifdef CONFIG_MMU | ||
4 | #ifndef CONFIG_SUN3 | ||
5 | #define PAGE_OFFSET_RAW 0x00000000 | ||
3 | #else | 6 | #else |
4 | #include "page_offset_mm.h" | 7 | #define PAGE_OFFSET_RAW 0x0E000000 |
8 | #endif | ||
9 | #else | ||
10 | #define PAGE_OFFSET_RAW CONFIG_RAMBASE | ||
5 | #endif | 11 | #endif |
diff --git a/arch/m68k/include/asm/page_offset_mm.h b/arch/m68k/include/asm/page_offset_mm.h deleted file mode 100644 index 1cbdb7f30ac2..000000000000 --- a/arch/m68k/include/asm/page_offset_mm.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | |||
2 | /* This handles the memory map.. */ | ||
3 | #ifndef CONFIG_SUN3 | ||
4 | #define PAGE_OFFSET_RAW 0x00000000 | ||
5 | #else | ||
6 | #define PAGE_OFFSET_RAW 0x0E000000 | ||
7 | #endif | ||
8 | |||
diff --git a/arch/m68k/include/asm/page_offset_no.h b/arch/m68k/include/asm/page_offset_no.h deleted file mode 100644 index d4e73e0ba646..000000000000 --- a/arch/m68k/include/asm/page_offset_no.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | |||
2 | |||
3 | /* This handles the memory map.. */ | ||
4 | #define PAGE_OFFSET_RAW CONFIG_RAMBASE | ||
5 | |||
diff --git a/arch/m68k/include/asm/pci.h b/arch/m68k/include/asm/pci.h index dbea95373080..4ad0aea48ab4 100644 --- a/arch/m68k/include/asm/pci.h +++ b/arch/m68k/include/asm/pci.h | |||
@@ -1,5 +1,12 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _ASM_M68K_PCI_H |
2 | #include "pci_no.h" | 2 | #define _ASM_M68K_PCI_H |
3 | #else | 3 | |
4 | #include "pci_mm.h" | 4 | #include <asm-generic/pci-dma-compat.h> |
5 | #endif | 5 | |
6 | /* The PCI address space does equal the physical memory | ||
7 | * address space. The networking and block device layers use | ||
8 | * this boolean for bounce buffer decisions. | ||
9 | */ | ||
10 | #define PCI_DMA_BUS_IS_PHYS (1) | ||
11 | |||
12 | #endif /* _ASM_M68K_PCI_H */ | ||
diff --git a/arch/m68k/include/asm/pci_mm.h b/arch/m68k/include/asm/pci_mm.h deleted file mode 100644 index 4ad0aea48ab4..000000000000 --- a/arch/m68k/include/asm/pci_mm.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef _ASM_M68K_PCI_H | ||
2 | #define _ASM_M68K_PCI_H | ||
3 | |||
4 | #include <asm-generic/pci-dma-compat.h> | ||
5 | |||
6 | /* The PCI address space does equal the physical memory | ||
7 | * address space. The networking and block device layers use | ||
8 | * this boolean for bounce buffer decisions. | ||
9 | */ | ||
10 | #define PCI_DMA_BUS_IS_PHYS (1) | ||
11 | |||
12 | #endif /* _ASM_M68K_PCI_H */ | ||
diff --git a/arch/m68k/include/asm/pci_no.h b/arch/m68k/include/asm/pci_no.h deleted file mode 100644 index 9abbc03c73ee..000000000000 --- a/arch/m68k/include/asm/pci_no.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | #ifndef M68KNOMMU_PCI_H | ||
2 | #define M68KNOMMU_PCI_H | ||
3 | |||
4 | #include <asm/pci_mm.h> | ||
5 | |||
6 | #ifdef CONFIG_COMEMPCI | ||
7 | /* | ||
8 | * These are pretty much arbitary with the CoMEM implementation. | ||
9 | * We have the whole address space to ourselves. | ||
10 | */ | ||
11 | #define PCIBIOS_MIN_IO 0x100 | ||
12 | #define PCIBIOS_MIN_MEM 0x00010000 | ||
13 | |||
14 | #define pcibios_scan_all_fns(a, b) 0 | ||
15 | |||
16 | /* | ||
17 | * Return whether the given PCI device DMA address mask can | ||
18 | * be supported properly. For example, if your device can | ||
19 | * only drive the low 24-bits during PCI bus mastering, then | ||
20 | * you would pass 0x00ffffff as the mask to this function. | ||
21 | */ | ||
22 | static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) | ||
23 | { | ||
24 | return 1; | ||
25 | } | ||
26 | |||
27 | #endif /* CONFIG_COMEMPCI */ | ||
28 | |||
29 | #endif /* M68KNOMMU_PCI_H */ | ||
diff --git a/arch/m68k/include/asm/pgalloc.h b/arch/m68k/include/asm/pgalloc.h index 059cb73e78fc..c294aad8a900 100644 --- a/arch/m68k/include/asm/pgalloc.h +++ b/arch/m68k/include/asm/pgalloc.h | |||
@@ -1,5 +1,19 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef M68K_PGALLOC_H |
2 | #include "pgalloc_no.h" | 2 | #define M68K_PGALLOC_H |
3 | |||
4 | #include <linux/mm.h> | ||
5 | #include <linux/highmem.h> | ||
6 | #include <asm/setup.h> | ||
7 | |||
8 | #ifdef CONFIG_MMU | ||
9 | #include <asm/virtconvert.h> | ||
10 | #ifdef CONFIG_SUN3 | ||
11 | #include <asm/sun3_pgalloc.h> | ||
3 | #else | 12 | #else |
4 | #include "pgalloc_mm.h" | 13 | #include <asm/motorola_pgalloc.h> |
5 | #endif | 14 | #endif |
15 | |||
16 | extern void m68k_setup_node(int node); | ||
17 | #endif | ||
18 | |||
19 | #endif /* M68K_PGALLOC_H */ | ||
diff --git a/arch/m68k/include/asm/pgalloc_mm.h b/arch/m68k/include/asm/pgalloc_mm.h deleted file mode 100644 index 4cb1a57ab763..000000000000 --- a/arch/m68k/include/asm/pgalloc_mm.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | |||
2 | #ifndef M68K_PGALLOC_H | ||
3 | #define M68K_PGALLOC_H | ||
4 | |||
5 | #include <linux/mm.h> | ||
6 | #include <linux/highmem.h> | ||
7 | #include <asm/setup.h> | ||
8 | #include <asm/virtconvert.h> | ||
9 | |||
10 | |||
11 | #ifdef CONFIG_SUN3 | ||
12 | #include <asm/sun3_pgalloc.h> | ||
13 | #else | ||
14 | #include <asm/motorola_pgalloc.h> | ||
15 | #endif | ||
16 | |||
17 | extern void m68k_setup_node(int node); | ||
18 | |||
19 | #endif /* M68K_PGALLOC_H */ | ||
diff --git a/arch/m68k/include/asm/pgalloc_no.h b/arch/m68k/include/asm/pgalloc_no.h deleted file mode 100644 index d6352f671ec0..000000000000 --- a/arch/m68k/include/asm/pgalloc_no.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_PGALLOC_H | ||
2 | #define _M68KNOMMU_PGALLOC_H | ||
3 | |||
4 | #include <asm/setup.h> | ||
5 | |||
6 | #define check_pgt_cache() do { } while (0) | ||
7 | |||
8 | #endif /* _M68KNOMMU_PGALLOC_H */ | ||
diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h index 46251016e821..bf86b29fe64a 100644 --- a/arch/m68k/include/asm/pgtable_no.h +++ b/arch/m68k/include/asm/pgtable_no.h | |||
@@ -67,4 +67,6 @@ extern unsigned int kobjsize(const void *objp); | |||
67 | 67 | ||
68 | #include <asm-generic/pgtable.h> | 68 | #include <asm-generic/pgtable.h> |
69 | 69 | ||
70 | #define check_pgt_cache() do { } while (0) | ||
71 | |||
70 | #endif /* _M68KNOMMU_PGTABLE_H */ | 72 | #endif /* _M68KNOMMU_PGTABLE_H */ |
diff --git a/arch/m68k/include/asm/rtc.h b/arch/m68k/include/asm/rtc.h index 5d3e03859844..a4d08ea122ee 100644 --- a/arch/m68k/include/asm/rtc.h +++ b/arch/m68k/include/asm/rtc.h | |||
@@ -36,13 +36,16 @@ static inline unsigned int get_rtc_time(struct rtc_time *time) | |||
36 | * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated | 36 | * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated |
37 | * by the RTC when initially set to a non-zero value. | 37 | * by the RTC when initially set to a non-zero value. |
38 | */ | 38 | */ |
39 | mach_hwclk(0, time); | 39 | if (mach_hwclk) |
40 | mach_hwclk(0, time); | ||
40 | return RTC_24H; | 41 | return RTC_24H; |
41 | } | 42 | } |
42 | 43 | ||
43 | static inline int set_rtc_time(struct rtc_time *time) | 44 | static inline int set_rtc_time(struct rtc_time *time) |
44 | { | 45 | { |
45 | return mach_hwclk(1, time); | 46 | if (mach_hwclk) |
47 | return mach_hwclk(1, time); | ||
48 | return -EINVAL; | ||
46 | } | 49 | } |
47 | 50 | ||
48 | static inline unsigned int get_rtc_ss(void) | 51 | static inline unsigned int get_rtc_ss(void) |
diff --git a/arch/m68k/include/asm/scatterlist.h b/arch/m68k/include/asm/scatterlist.h index b7e528636252..e27ad902b1cf 100644 --- a/arch/m68k/include/asm/scatterlist.h +++ b/arch/m68k/include/asm/scatterlist.h | |||
@@ -1,5 +1,23 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_SCATTERLIST_H |
2 | #include "scatterlist_no.h" | 2 | #define _M68K_SCATTERLIST_H |
3 | #else | 3 | |
4 | #include "scatterlist_mm.h" | 4 | #include <linux/types.h> |
5 | |||
6 | struct scatterlist { | ||
7 | #ifdef CONFIG_DEBUG_SG | ||
8 | unsigned long sg_magic; | ||
5 | #endif | 9 | #endif |
10 | unsigned long page_link; | ||
11 | unsigned int offset; | ||
12 | unsigned int length; | ||
13 | |||
14 | dma_addr_t dma_address; /* A place to hang host-specific addresses at. */ | ||
15 | }; | ||
16 | |||
17 | /* This is bogus and should go away. */ | ||
18 | #define ISA_DMA_THRESHOLD (0x00ffffff) | ||
19 | |||
20 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
21 | #define sg_dma_len(sg) ((sg)->length) | ||
22 | |||
23 | #endif /* !(_M68K_SCATTERLIST_H) */ | ||
diff --git a/arch/m68k/include/asm/scatterlist_mm.h b/arch/m68k/include/asm/scatterlist_mm.h deleted file mode 100644 index d3a7a0edfeca..000000000000 --- a/arch/m68k/include/asm/scatterlist_mm.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifndef _M68K_SCATTERLIST_H | ||
2 | #define _M68K_SCATTERLIST_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct scatterlist { | ||
7 | #ifdef CONFIG_DEBUG_SG | ||
8 | unsigned long sg_magic; | ||
9 | #endif | ||
10 | unsigned long page_link; | ||
11 | unsigned int offset; | ||
12 | unsigned int length; | ||
13 | |||
14 | __u32 dma_address; /* A place to hang host-specific addresses at. */ | ||
15 | }; | ||
16 | |||
17 | /* This is bogus and should go away. */ | ||
18 | #define ISA_DMA_THRESHOLD (0x00ffffff) | ||
19 | |||
20 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
21 | #define sg_dma_len(sg) ((sg)->length) | ||
22 | |||
23 | #endif /* !(_M68K_SCATTERLIST_H) */ | ||
diff --git a/arch/m68k/include/asm/scatterlist_no.h b/arch/m68k/include/asm/scatterlist_no.h deleted file mode 100644 index afc4788b0d2c..000000000000 --- a/arch/m68k/include/asm/scatterlist_no.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_SCATTERLIST_H | ||
2 | #define _M68KNOMMU_SCATTERLIST_H | ||
3 | |||
4 | #include <linux/mm.h> | ||
5 | #include <asm/types.h> | ||
6 | |||
7 | struct scatterlist { | ||
8 | #ifdef CONFIG_DEBUG_SG | ||
9 | unsigned long sg_magic; | ||
10 | #endif | ||
11 | unsigned long page_link; | ||
12 | unsigned int offset; | ||
13 | dma_addr_t dma_address; | ||
14 | unsigned int length; | ||
15 | }; | ||
16 | |||
17 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
18 | #define sg_dma_len(sg) ((sg)->length) | ||
19 | |||
20 | #define ISA_DMA_THRESHOLD (0xffffffff) | ||
21 | |||
22 | #endif /* !(_M68KNOMMU_SCATTERLIST_H) */ | ||
diff --git a/arch/m68k/include/asm/segment.h b/arch/m68k/include/asm/segment.h index 82583bc004bd..ee959219fdfe 100644 --- a/arch/m68k/include/asm/segment.h +++ b/arch/m68k/include/asm/segment.h | |||
@@ -1,5 +1,63 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_SEGMENT_H |
2 | #include "segment_no.h" | 2 | #define _M68K_SEGMENT_H |
3 | |||
4 | /* define constants */ | ||
5 | /* Address spaces (FC0-FC2) */ | ||
6 | #define USER_DATA (1) | ||
7 | #ifndef __USER_DS | ||
8 | #define __USER_DS (USER_DATA) | ||
9 | #endif | ||
10 | #define USER_PROGRAM (2) | ||
11 | #define SUPER_DATA (5) | ||
12 | #ifndef __KERNEL_DS | ||
13 | #define __KERNEL_DS (SUPER_DATA) | ||
14 | #endif | ||
15 | #define SUPER_PROGRAM (6) | ||
16 | #define CPU_SPACE (7) | ||
17 | |||
18 | #ifndef __ASSEMBLY__ | ||
19 | |||
20 | typedef struct { | ||
21 | unsigned long seg; | ||
22 | } mm_segment_t; | ||
23 | |||
24 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) | ||
25 | #define USER_DS MAKE_MM_SEG(__USER_DS) | ||
26 | #define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS) | ||
27 | |||
28 | /* | ||
29 | * Get/set the SFC/DFC registers for MOVES instructions | ||
30 | */ | ||
31 | |||
32 | static inline mm_segment_t get_fs(void) | ||
33 | { | ||
34 | #ifdef CONFIG_MMU | ||
35 | mm_segment_t _v; | ||
36 | __asm__ ("movec %/dfc,%0":"=r" (_v.seg):); | ||
37 | |||
38 | return _v; | ||
3 | #else | 39 | #else |
4 | #include "segment_mm.h" | 40 | return USER_DS; |
41 | #endif | ||
42 | } | ||
43 | |||
44 | static inline mm_segment_t get_ds(void) | ||
45 | { | ||
46 | /* return the supervisor data space code */ | ||
47 | return KERNEL_DS; | ||
48 | } | ||
49 | |||
50 | static inline void set_fs(mm_segment_t val) | ||
51 | { | ||
52 | #ifdef CONFIG_MMU | ||
53 | __asm__ __volatile__ ("movec %0,%/sfc\n\t" | ||
54 | "movec %0,%/dfc\n\t" | ||
55 | : /* no outputs */ : "r" (val.seg) : "memory"); | ||
5 | #endif | 56 | #endif |
57 | } | ||
58 | |||
59 | #define segment_eq(a,b) ((a).seg == (b).seg) | ||
60 | |||
61 | #endif /* __ASSEMBLY__ */ | ||
62 | |||
63 | #endif /* _M68K_SEGMENT_H */ | ||
diff --git a/arch/m68k/include/asm/segment_mm.h b/arch/m68k/include/asm/segment_mm.h deleted file mode 100644 index 7b0b2d3127f9..000000000000 --- a/arch/m68k/include/asm/segment_mm.h +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | #ifndef _M68K_SEGMENT_H | ||
2 | #define _M68K_SEGMENT_H | ||
3 | |||
4 | /* define constants */ | ||
5 | /* Address spaces (FC0-FC2) */ | ||
6 | #define USER_DATA (1) | ||
7 | #ifndef __USER_DS | ||
8 | #define __USER_DS (USER_DATA) | ||
9 | #endif | ||
10 | #define USER_PROGRAM (2) | ||
11 | #define SUPER_DATA (5) | ||
12 | #ifndef __KERNEL_DS | ||
13 | #define __KERNEL_DS (SUPER_DATA) | ||
14 | #endif | ||
15 | #define SUPER_PROGRAM (6) | ||
16 | #define CPU_SPACE (7) | ||
17 | |||
18 | #ifndef __ASSEMBLY__ | ||
19 | |||
20 | typedef struct { | ||
21 | unsigned long seg; | ||
22 | } mm_segment_t; | ||
23 | |||
24 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) | ||
25 | #define USER_DS MAKE_MM_SEG(__USER_DS) | ||
26 | #define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS) | ||
27 | |||
28 | /* | ||
29 | * Get/set the SFC/DFC registers for MOVES instructions | ||
30 | */ | ||
31 | |||
32 | static inline mm_segment_t get_fs(void) | ||
33 | { | ||
34 | mm_segment_t _v; | ||
35 | __asm__ ("movec %/dfc,%0":"=r" (_v.seg):); | ||
36 | |||
37 | return _v; | ||
38 | } | ||
39 | |||
40 | static inline mm_segment_t get_ds(void) | ||
41 | { | ||
42 | /* return the supervisor data space code */ | ||
43 | return KERNEL_DS; | ||
44 | } | ||
45 | |||
46 | static inline void set_fs(mm_segment_t val) | ||
47 | { | ||
48 | __asm__ __volatile__ ("movec %0,%/sfc\n\t" | ||
49 | "movec %0,%/dfc\n\t" | ||
50 | : /* no outputs */ : "r" (val.seg) : "memory"); | ||
51 | } | ||
52 | |||
53 | #define segment_eq(a,b) ((a).seg == (b).seg) | ||
54 | |||
55 | #endif /* __ASSEMBLY__ */ | ||
56 | |||
57 | #endif /* _M68K_SEGMENT_H */ | ||
diff --git a/arch/m68k/include/asm/segment_no.h b/arch/m68k/include/asm/segment_no.h deleted file mode 100644 index 42318ebec7ec..000000000000 --- a/arch/m68k/include/asm/segment_no.h +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | #ifndef _M68K_SEGMENT_H | ||
2 | #define _M68K_SEGMENT_H | ||
3 | |||
4 | /* define constants */ | ||
5 | /* Address spaces (FC0-FC2) */ | ||
6 | #define USER_DATA (1) | ||
7 | #ifndef __USER_DS | ||
8 | #define __USER_DS (USER_DATA) | ||
9 | #endif | ||
10 | #define USER_PROGRAM (2) | ||
11 | #define SUPER_DATA (5) | ||
12 | #ifndef __KERNEL_DS | ||
13 | #define __KERNEL_DS (SUPER_DATA) | ||
14 | #endif | ||
15 | #define SUPER_PROGRAM (6) | ||
16 | #define CPU_SPACE (7) | ||
17 | |||
18 | #ifndef __ASSEMBLY__ | ||
19 | |||
20 | typedef struct { | ||
21 | unsigned long seg; | ||
22 | } mm_segment_t; | ||
23 | |||
24 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) | ||
25 | #define USER_DS MAKE_MM_SEG(__USER_DS) | ||
26 | #define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS) | ||
27 | |||
28 | /* | ||
29 | * Get/set the SFC/DFC registers for MOVES instructions | ||
30 | */ | ||
31 | |||
32 | static inline mm_segment_t get_fs(void) | ||
33 | { | ||
34 | return USER_DS; | ||
35 | } | ||
36 | |||
37 | static inline mm_segment_t get_ds(void) | ||
38 | { | ||
39 | /* return the supervisor data space code */ | ||
40 | return KERNEL_DS; | ||
41 | } | ||
42 | |||
43 | static inline void set_fs(mm_segment_t val) | ||
44 | { | ||
45 | } | ||
46 | |||
47 | #define segment_eq(a,b) ((a).seg == (b).seg) | ||
48 | |||
49 | #endif /* __ASSEMBLY__ */ | ||
50 | |||
51 | #endif /* _M68K_SEGMENT_H */ | ||
diff --git a/arch/m68k/include/asm/timex.h b/arch/m68k/include/asm/timex.h index 719762980578..b87f2f278f67 100644 --- a/arch/m68k/include/asm/timex.h +++ b/arch/m68k/include/asm/timex.h | |||
@@ -1,5 +1,18 @@ | |||
1 | #ifdef __uClinux__ | 1 | /* |
2 | #include "timex_no.h" | 2 | * linux/include/asm-m68k/timex.h |
3 | #else | 3 | * |
4 | #include "timex_mm.h" | 4 | * m68k architecture timex specifications |
5 | */ | ||
6 | #ifndef _ASMm68k_TIMEX_H | ||
7 | #define _ASMm68k_TIMEX_H | ||
8 | |||
9 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | ||
10 | |||
11 | typedef unsigned long cycles_t; | ||
12 | |||
13 | static inline cycles_t get_cycles(void) | ||
14 | { | ||
15 | return 0; | ||
16 | } | ||
17 | |||
5 | #endif | 18 | #endif |
diff --git a/arch/m68k/include/asm/timex_mm.h b/arch/m68k/include/asm/timex_mm.h deleted file mode 100644 index b87f2f278f67..000000000000 --- a/arch/m68k/include/asm/timex_mm.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-m68k/timex.h | ||
3 | * | ||
4 | * m68k architecture timex specifications | ||
5 | */ | ||
6 | #ifndef _ASMm68k_TIMEX_H | ||
7 | #define _ASMm68k_TIMEX_H | ||
8 | |||
9 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | ||
10 | |||
11 | typedef unsigned long cycles_t; | ||
12 | |||
13 | static inline cycles_t get_cycles(void) | ||
14 | { | ||
15 | return 0; | ||
16 | } | ||
17 | |||
18 | #endif | ||
diff --git a/arch/m68k/include/asm/timex_no.h b/arch/m68k/include/asm/timex_no.h deleted file mode 100644 index 109050f3fe91..000000000000 --- a/arch/m68k/include/asm/timex_no.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-m68knommu/timex.h | ||
3 | * | ||
4 | * m68knommu architecture timex specifications | ||
5 | */ | ||
6 | #ifndef _ASM_M68KNOMMU_TIMEX_H | ||
7 | #define _ASM_M68KNOMMU_TIMEX_H | ||
8 | |||
9 | #ifdef CONFIG_COLDFIRE | ||
10 | #include <asm/coldfire.h> | ||
11 | #define CLOCK_TICK_RATE MCF_CLK | ||
12 | #else | ||
13 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | ||
14 | #endif | ||
15 | |||
16 | typedef unsigned long cycles_t; | ||
17 | |||
18 | static inline cycles_t get_cycles(void) | ||
19 | { | ||
20 | return 0; | ||
21 | } | ||
22 | |||
23 | #endif | ||
diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h index b6f93b30951e..a6b4ed4fc90f 100644 --- a/arch/m68k/include/asm/tlbflush.h +++ b/arch/m68k/include/asm/tlbflush.h | |||
@@ -1,5 +1,267 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_TLBFLUSH_H |
2 | #include "tlbflush_no.h" | 2 | #define _M68K_TLBFLUSH_H |
3 | |||
4 | #ifdef CONFIG_MMU | ||
5 | #ifndef CONFIG_SUN3 | ||
6 | |||
7 | #include <asm/current.h> | ||
8 | |||
9 | static inline void flush_tlb_kernel_page(void *addr) | ||
10 | { | ||
11 | if (CPU_IS_040_OR_060) { | ||
12 | mm_segment_t old_fs = get_fs(); | ||
13 | set_fs(KERNEL_DS); | ||
14 | __asm__ __volatile__(".chip 68040\n\t" | ||
15 | "pflush (%0)\n\t" | ||
16 | ".chip 68k" | ||
17 | : : "a" (addr)); | ||
18 | set_fs(old_fs); | ||
19 | } else if (CPU_IS_020_OR_030) | ||
20 | __asm__ __volatile__("pflush #4,#4,(%0)" : : "a" (addr)); | ||
21 | } | ||
22 | |||
23 | /* | ||
24 | * flush all user-space atc entries. | ||
25 | */ | ||
26 | static inline void __flush_tlb(void) | ||
27 | { | ||
28 | if (CPU_IS_040_OR_060) | ||
29 | __asm__ __volatile__(".chip 68040\n\t" | ||
30 | "pflushan\n\t" | ||
31 | ".chip 68k"); | ||
32 | else if (CPU_IS_020_OR_030) | ||
33 | __asm__ __volatile__("pflush #0,#4"); | ||
34 | } | ||
35 | |||
36 | static inline void __flush_tlb040_one(unsigned long addr) | ||
37 | { | ||
38 | __asm__ __volatile__(".chip 68040\n\t" | ||
39 | "pflush (%0)\n\t" | ||
40 | ".chip 68k" | ||
41 | : : "a" (addr)); | ||
42 | } | ||
43 | |||
44 | static inline void __flush_tlb_one(unsigned long addr) | ||
45 | { | ||
46 | if (CPU_IS_040_OR_060) | ||
47 | __flush_tlb040_one(addr); | ||
48 | else if (CPU_IS_020_OR_030) | ||
49 | __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr)); | ||
50 | } | ||
51 | |||
52 | #define flush_tlb() __flush_tlb() | ||
53 | |||
54 | /* | ||
55 | * flush all atc entries (both kernel and user-space entries). | ||
56 | */ | ||
57 | static inline void flush_tlb_all(void) | ||
58 | { | ||
59 | if (CPU_IS_040_OR_060) | ||
60 | __asm__ __volatile__(".chip 68040\n\t" | ||
61 | "pflusha\n\t" | ||
62 | ".chip 68k"); | ||
63 | else if (CPU_IS_020_OR_030) | ||
64 | __asm__ __volatile__("pflusha"); | ||
65 | } | ||
66 | |||
67 | static inline void flush_tlb_mm(struct mm_struct *mm) | ||
68 | { | ||
69 | if (mm == current->active_mm) | ||
70 | __flush_tlb(); | ||
71 | } | ||
72 | |||
73 | static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) | ||
74 | { | ||
75 | if (vma->vm_mm == current->active_mm) { | ||
76 | mm_segment_t old_fs = get_fs(); | ||
77 | set_fs(USER_DS); | ||
78 | __flush_tlb_one(addr); | ||
79 | set_fs(old_fs); | ||
80 | } | ||
81 | } | ||
82 | |||
83 | static inline void flush_tlb_range(struct vm_area_struct *vma, | ||
84 | unsigned long start, unsigned long end) | ||
85 | { | ||
86 | if (vma->vm_mm == current->active_mm) | ||
87 | __flush_tlb(); | ||
88 | } | ||
89 | |||
90 | static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
91 | { | ||
92 | flush_tlb_all(); | ||
93 | } | ||
94 | |||
3 | #else | 95 | #else |
4 | #include "tlbflush_mm.h" | 96 | |
97 | |||
98 | /* Reserved PMEGs. */ | ||
99 | extern char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; | ||
100 | extern unsigned long pmeg_vaddr[SUN3_PMEGS_NUM]; | ||
101 | extern unsigned char pmeg_alloc[SUN3_PMEGS_NUM]; | ||
102 | extern unsigned char pmeg_ctx[SUN3_PMEGS_NUM]; | ||
103 | |||
104 | /* Flush all userspace mappings one by one... (why no flush command, | ||
105 | sun?) */ | ||
106 | static inline void flush_tlb_all(void) | ||
107 | { | ||
108 | unsigned long addr; | ||
109 | unsigned char ctx, oldctx; | ||
110 | |||
111 | oldctx = sun3_get_context(); | ||
112 | for(addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) { | ||
113 | for(ctx = 0; ctx < 8; ctx++) { | ||
114 | sun3_put_context(ctx); | ||
115 | sun3_put_segmap(addr, SUN3_INVALID_PMEG); | ||
116 | } | ||
117 | } | ||
118 | |||
119 | sun3_put_context(oldctx); | ||
120 | /* erase all of the userspace pmeg maps, we've clobbered them | ||
121 | all anyway */ | ||
122 | for(addr = 0; addr < SUN3_INVALID_PMEG; addr++) { | ||
123 | if(pmeg_alloc[addr] == 1) { | ||
124 | pmeg_alloc[addr] = 0; | ||
125 | pmeg_ctx[addr] = 0; | ||
126 | pmeg_vaddr[addr] = 0; | ||
127 | } | ||
128 | } | ||
129 | |||
130 | } | ||
131 | |||
132 | /* Clear user TLB entries within the context named in mm */ | ||
133 | static inline void flush_tlb_mm (struct mm_struct *mm) | ||
134 | { | ||
135 | unsigned char oldctx; | ||
136 | unsigned char seg; | ||
137 | unsigned long i; | ||
138 | |||
139 | oldctx = sun3_get_context(); | ||
140 | sun3_put_context(mm->context); | ||
141 | |||
142 | for(i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) { | ||
143 | seg = sun3_get_segmap(i); | ||
144 | if(seg == SUN3_INVALID_PMEG) | ||
145 | continue; | ||
146 | |||
147 | sun3_put_segmap(i, SUN3_INVALID_PMEG); | ||
148 | pmeg_alloc[seg] = 0; | ||
149 | pmeg_ctx[seg] = 0; | ||
150 | pmeg_vaddr[seg] = 0; | ||
151 | } | ||
152 | |||
153 | sun3_put_context(oldctx); | ||
154 | |||
155 | } | ||
156 | |||
157 | /* Flush a single TLB page. In this case, we're limited to flushing a | ||
158 | single PMEG */ | ||
159 | static inline void flush_tlb_page (struct vm_area_struct *vma, | ||
160 | unsigned long addr) | ||
161 | { | ||
162 | unsigned char oldctx; | ||
163 | unsigned char i; | ||
164 | |||
165 | oldctx = sun3_get_context(); | ||
166 | sun3_put_context(vma->vm_mm->context); | ||
167 | addr &= ~SUN3_PMEG_MASK; | ||
168 | if((i = sun3_get_segmap(addr)) != SUN3_INVALID_PMEG) | ||
169 | { | ||
170 | pmeg_alloc[i] = 0; | ||
171 | pmeg_ctx[i] = 0; | ||
172 | pmeg_vaddr[i] = 0; | ||
173 | sun3_put_segmap (addr, SUN3_INVALID_PMEG); | ||
174 | } | ||
175 | sun3_put_context(oldctx); | ||
176 | |||
177 | } | ||
178 | /* Flush a range of pages from TLB. */ | ||
179 | |||
180 | static inline void flush_tlb_range (struct vm_area_struct *vma, | ||
181 | unsigned long start, unsigned long end) | ||
182 | { | ||
183 | struct mm_struct *mm = vma->vm_mm; | ||
184 | unsigned char seg, oldctx; | ||
185 | |||
186 | start &= ~SUN3_PMEG_MASK; | ||
187 | |||
188 | oldctx = sun3_get_context(); | ||
189 | sun3_put_context(mm->context); | ||
190 | |||
191 | while(start < end) | ||
192 | { | ||
193 | if((seg = sun3_get_segmap(start)) == SUN3_INVALID_PMEG) | ||
194 | goto next; | ||
195 | if(pmeg_ctx[seg] == mm->context) { | ||
196 | pmeg_alloc[seg] = 0; | ||
197 | pmeg_ctx[seg] = 0; | ||
198 | pmeg_vaddr[seg] = 0; | ||
199 | } | ||
200 | sun3_put_segmap(start, SUN3_INVALID_PMEG); | ||
201 | next: | ||
202 | start += SUN3_PMEG_SIZE; | ||
203 | } | ||
204 | } | ||
205 | |||
206 | static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
207 | { | ||
208 | flush_tlb_all(); | ||
209 | } | ||
210 | |||
211 | /* Flush kernel page from TLB. */ | ||
212 | static inline void flush_tlb_kernel_page (unsigned long addr) | ||
213 | { | ||
214 | sun3_put_segmap (addr & ~(SUN3_PMEG_SIZE - 1), SUN3_INVALID_PMEG); | ||
215 | } | ||
216 | |||
5 | #endif | 217 | #endif |
218 | |||
219 | #else /* !CONFIG_MMU */ | ||
220 | |||
221 | /* | ||
222 | * flush all user-space atc entries. | ||
223 | */ | ||
224 | static inline void __flush_tlb(void) | ||
225 | { | ||
226 | BUG(); | ||
227 | } | ||
228 | |||
229 | static inline void __flush_tlb_one(unsigned long addr) | ||
230 | { | ||
231 | BUG(); | ||
232 | } | ||
233 | |||
234 | #define flush_tlb() __flush_tlb() | ||
235 | |||
236 | /* | ||
237 | * flush all atc entries (both kernel and user-space entries). | ||
238 | */ | ||
239 | static inline void flush_tlb_all(void) | ||
240 | { | ||
241 | BUG(); | ||
242 | } | ||
243 | |||
244 | static inline void flush_tlb_mm(struct mm_struct *mm) | ||
245 | { | ||
246 | BUG(); | ||
247 | } | ||
248 | |||
249 | static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) | ||
250 | { | ||
251 | BUG(); | ||
252 | } | ||
253 | |||
254 | static inline void flush_tlb_range(struct mm_struct *mm, | ||
255 | unsigned long start, unsigned long end) | ||
256 | { | ||
257 | BUG(); | ||
258 | } | ||
259 | |||
260 | static inline void flush_tlb_kernel_page(unsigned long addr) | ||
261 | { | ||
262 | BUG(); | ||
263 | } | ||
264 | |||
265 | #endif /* CONFIG_MMU */ | ||
266 | |||
267 | #endif /* _M68K_TLBFLUSH_H */ | ||
diff --git a/arch/m68k/include/asm/tlbflush_mm.h b/arch/m68k/include/asm/tlbflush_mm.h deleted file mode 100644 index acb6bf21a321..000000000000 --- a/arch/m68k/include/asm/tlbflush_mm.h +++ /dev/null | |||
@@ -1,219 +0,0 @@ | |||
1 | #ifndef _M68K_TLBFLUSH_H | ||
2 | #define _M68K_TLBFLUSH_H | ||
3 | |||
4 | |||
5 | #ifndef CONFIG_SUN3 | ||
6 | |||
7 | #include <asm/current.h> | ||
8 | |||
9 | static inline void flush_tlb_kernel_page(void *addr) | ||
10 | { | ||
11 | if (CPU_IS_040_OR_060) { | ||
12 | mm_segment_t old_fs = get_fs(); | ||
13 | set_fs(KERNEL_DS); | ||
14 | __asm__ __volatile__(".chip 68040\n\t" | ||
15 | "pflush (%0)\n\t" | ||
16 | ".chip 68k" | ||
17 | : : "a" (addr)); | ||
18 | set_fs(old_fs); | ||
19 | } else if (CPU_IS_020_OR_030) | ||
20 | __asm__ __volatile__("pflush #4,#4,(%0)" : : "a" (addr)); | ||
21 | } | ||
22 | |||
23 | /* | ||
24 | * flush all user-space atc entries. | ||
25 | */ | ||
26 | static inline void __flush_tlb(void) | ||
27 | { | ||
28 | if (CPU_IS_040_OR_060) | ||
29 | __asm__ __volatile__(".chip 68040\n\t" | ||
30 | "pflushan\n\t" | ||
31 | ".chip 68k"); | ||
32 | else if (CPU_IS_020_OR_030) | ||
33 | __asm__ __volatile__("pflush #0,#4"); | ||
34 | } | ||
35 | |||
36 | static inline void __flush_tlb040_one(unsigned long addr) | ||
37 | { | ||
38 | __asm__ __volatile__(".chip 68040\n\t" | ||
39 | "pflush (%0)\n\t" | ||
40 | ".chip 68k" | ||
41 | : : "a" (addr)); | ||
42 | } | ||
43 | |||
44 | static inline void __flush_tlb_one(unsigned long addr) | ||
45 | { | ||
46 | if (CPU_IS_040_OR_060) | ||
47 | __flush_tlb040_one(addr); | ||
48 | else if (CPU_IS_020_OR_030) | ||
49 | __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr)); | ||
50 | } | ||
51 | |||
52 | #define flush_tlb() __flush_tlb() | ||
53 | |||
54 | /* | ||
55 | * flush all atc entries (both kernel and user-space entries). | ||
56 | */ | ||
57 | static inline void flush_tlb_all(void) | ||
58 | { | ||
59 | if (CPU_IS_040_OR_060) | ||
60 | __asm__ __volatile__(".chip 68040\n\t" | ||
61 | "pflusha\n\t" | ||
62 | ".chip 68k"); | ||
63 | else if (CPU_IS_020_OR_030) | ||
64 | __asm__ __volatile__("pflusha"); | ||
65 | } | ||
66 | |||
67 | static inline void flush_tlb_mm(struct mm_struct *mm) | ||
68 | { | ||
69 | if (mm == current->active_mm) | ||
70 | __flush_tlb(); | ||
71 | } | ||
72 | |||
73 | static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) | ||
74 | { | ||
75 | if (vma->vm_mm == current->active_mm) { | ||
76 | mm_segment_t old_fs = get_fs(); | ||
77 | set_fs(USER_DS); | ||
78 | __flush_tlb_one(addr); | ||
79 | set_fs(old_fs); | ||
80 | } | ||
81 | } | ||
82 | |||
83 | static inline void flush_tlb_range(struct vm_area_struct *vma, | ||
84 | unsigned long start, unsigned long end) | ||
85 | { | ||
86 | if (vma->vm_mm == current->active_mm) | ||
87 | __flush_tlb(); | ||
88 | } | ||
89 | |||
90 | static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
91 | { | ||
92 | flush_tlb_all(); | ||
93 | } | ||
94 | |||
95 | #else | ||
96 | |||
97 | |||
98 | /* Reserved PMEGs. */ | ||
99 | extern char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; | ||
100 | extern unsigned long pmeg_vaddr[SUN3_PMEGS_NUM]; | ||
101 | extern unsigned char pmeg_alloc[SUN3_PMEGS_NUM]; | ||
102 | extern unsigned char pmeg_ctx[SUN3_PMEGS_NUM]; | ||
103 | |||
104 | /* Flush all userspace mappings one by one... (why no flush command, | ||
105 | sun?) */ | ||
106 | static inline void flush_tlb_all(void) | ||
107 | { | ||
108 | unsigned long addr; | ||
109 | unsigned char ctx, oldctx; | ||
110 | |||
111 | oldctx = sun3_get_context(); | ||
112 | for(addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) { | ||
113 | for(ctx = 0; ctx < 8; ctx++) { | ||
114 | sun3_put_context(ctx); | ||
115 | sun3_put_segmap(addr, SUN3_INVALID_PMEG); | ||
116 | } | ||
117 | } | ||
118 | |||
119 | sun3_put_context(oldctx); | ||
120 | /* erase all of the userspace pmeg maps, we've clobbered them | ||
121 | all anyway */ | ||
122 | for(addr = 0; addr < SUN3_INVALID_PMEG; addr++) { | ||
123 | if(pmeg_alloc[addr] == 1) { | ||
124 | pmeg_alloc[addr] = 0; | ||
125 | pmeg_ctx[addr] = 0; | ||
126 | pmeg_vaddr[addr] = 0; | ||
127 | } | ||
128 | } | ||
129 | |||
130 | } | ||
131 | |||
132 | /* Clear user TLB entries within the context named in mm */ | ||
133 | static inline void flush_tlb_mm (struct mm_struct *mm) | ||
134 | { | ||
135 | unsigned char oldctx; | ||
136 | unsigned char seg; | ||
137 | unsigned long i; | ||
138 | |||
139 | oldctx = sun3_get_context(); | ||
140 | sun3_put_context(mm->context); | ||
141 | |||
142 | for(i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) { | ||
143 | seg = sun3_get_segmap(i); | ||
144 | if(seg == SUN3_INVALID_PMEG) | ||
145 | continue; | ||
146 | |||
147 | sun3_put_segmap(i, SUN3_INVALID_PMEG); | ||
148 | pmeg_alloc[seg] = 0; | ||
149 | pmeg_ctx[seg] = 0; | ||
150 | pmeg_vaddr[seg] = 0; | ||
151 | } | ||
152 | |||
153 | sun3_put_context(oldctx); | ||
154 | |||
155 | } | ||
156 | |||
157 | /* Flush a single TLB page. In this case, we're limited to flushing a | ||
158 | single PMEG */ | ||
159 | static inline void flush_tlb_page (struct vm_area_struct *vma, | ||
160 | unsigned long addr) | ||
161 | { | ||
162 | unsigned char oldctx; | ||
163 | unsigned char i; | ||
164 | |||
165 | oldctx = sun3_get_context(); | ||
166 | sun3_put_context(vma->vm_mm->context); | ||
167 | addr &= ~SUN3_PMEG_MASK; | ||
168 | if((i = sun3_get_segmap(addr)) != SUN3_INVALID_PMEG) | ||
169 | { | ||
170 | pmeg_alloc[i] = 0; | ||
171 | pmeg_ctx[i] = 0; | ||
172 | pmeg_vaddr[i] = 0; | ||
173 | sun3_put_segmap (addr, SUN3_INVALID_PMEG); | ||
174 | } | ||
175 | sun3_put_context(oldctx); | ||
176 | |||
177 | } | ||
178 | /* Flush a range of pages from TLB. */ | ||
179 | |||
180 | static inline void flush_tlb_range (struct vm_area_struct *vma, | ||
181 | unsigned long start, unsigned long end) | ||
182 | { | ||
183 | struct mm_struct *mm = vma->vm_mm; | ||
184 | unsigned char seg, oldctx; | ||
185 | |||
186 | start &= ~SUN3_PMEG_MASK; | ||
187 | |||
188 | oldctx = sun3_get_context(); | ||
189 | sun3_put_context(mm->context); | ||
190 | |||
191 | while(start < end) | ||
192 | { | ||
193 | if((seg = sun3_get_segmap(start)) == SUN3_INVALID_PMEG) | ||
194 | goto next; | ||
195 | if(pmeg_ctx[seg] == mm->context) { | ||
196 | pmeg_alloc[seg] = 0; | ||
197 | pmeg_ctx[seg] = 0; | ||
198 | pmeg_vaddr[seg] = 0; | ||
199 | } | ||
200 | sun3_put_segmap(start, SUN3_INVALID_PMEG); | ||
201 | next: | ||
202 | start += SUN3_PMEG_SIZE; | ||
203 | } | ||
204 | } | ||
205 | |||
206 | static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
207 | { | ||
208 | flush_tlb_all(); | ||
209 | } | ||
210 | |||
211 | /* Flush kernel page from TLB. */ | ||
212 | static inline void flush_tlb_kernel_page (unsigned long addr) | ||
213 | { | ||
214 | sun3_put_segmap (addr & ~(SUN3_PMEG_SIZE - 1), SUN3_INVALID_PMEG); | ||
215 | } | ||
216 | |||
217 | #endif | ||
218 | |||
219 | #endif /* _M68K_TLBFLUSH_H */ | ||
diff --git a/arch/m68k/include/asm/tlbflush_no.h b/arch/m68k/include/asm/tlbflush_no.h deleted file mode 100644 index a470cfb803eb..000000000000 --- a/arch/m68k/include/asm/tlbflush_no.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_TLBFLUSH_H | ||
2 | #define _M68KNOMMU_TLBFLUSH_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2000 Lineo, David McCullough <davidm@uclinux.org> | ||
6 | * Copyright (C) 2000-2002, Greg Ungerer <gerg@snapgear.com> | ||
7 | */ | ||
8 | |||
9 | #include <asm/setup.h> | ||
10 | |||
11 | /* | ||
12 | * flush all user-space atc entries. | ||
13 | */ | ||
14 | static inline void __flush_tlb(void) | ||
15 | { | ||
16 | BUG(); | ||
17 | } | ||
18 | |||
19 | static inline void __flush_tlb_one(unsigned long addr) | ||
20 | { | ||
21 | BUG(); | ||
22 | } | ||
23 | |||
24 | #define flush_tlb() __flush_tlb() | ||
25 | |||
26 | /* | ||
27 | * flush all atc entries (both kernel and user-space entries). | ||
28 | */ | ||
29 | static inline void flush_tlb_all(void) | ||
30 | { | ||
31 | BUG(); | ||
32 | } | ||
33 | |||
34 | static inline void flush_tlb_mm(struct mm_struct *mm) | ||
35 | { | ||
36 | BUG(); | ||
37 | } | ||
38 | |||
39 | static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) | ||
40 | { | ||
41 | BUG(); | ||
42 | } | ||
43 | |||
44 | static inline void flush_tlb_range(struct mm_struct *mm, | ||
45 | unsigned long start, unsigned long end) | ||
46 | { | ||
47 | BUG(); | ||
48 | } | ||
49 | |||
50 | static inline void flush_tlb_kernel_page(unsigned long addr) | ||
51 | { | ||
52 | BUG(); | ||
53 | } | ||
54 | |||
55 | #endif /* _M68KNOMMU_TLBFLUSH_H */ | ||
diff --git a/arch/m68k/include/asm/ucontext.h b/arch/m68k/include/asm/ucontext.h index b53cd160c0b3..e4e22669edc0 100644 --- a/arch/m68k/include/asm/ucontext.h +++ b/arch/m68k/include/asm/ucontext.h | |||
@@ -1,5 +1,30 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_UCONTEXT_H |
2 | #include "ucontext_no.h" | 2 | #define _M68K_UCONTEXT_H |
3 | #else | 3 | |
4 | #include "ucontext_mm.h" | 4 | typedef int greg_t; |
5 | #define NGREG 18 | ||
6 | typedef greg_t gregset_t[NGREG]; | ||
7 | |||
8 | typedef struct fpregset { | ||
9 | int f_fpcntl[3]; | ||
10 | int f_fpregs[8*3]; | ||
11 | } fpregset_t; | ||
12 | |||
13 | struct mcontext { | ||
14 | int version; | ||
15 | gregset_t gregs; | ||
16 | fpregset_t fpregs; | ||
17 | }; | ||
18 | |||
19 | #define MCONTEXT_VERSION 2 | ||
20 | |||
21 | struct ucontext { | ||
22 | unsigned long uc_flags; | ||
23 | struct ucontext *uc_link; | ||
24 | stack_t uc_stack; | ||
25 | struct mcontext uc_mcontext; | ||
26 | unsigned long uc_filler[80]; | ||
27 | sigset_t uc_sigmask; /* mask last for extensibility */ | ||
28 | }; | ||
29 | |||
5 | #endif | 30 | #endif |
diff --git a/arch/m68k/include/asm/ucontext_mm.h b/arch/m68k/include/asm/ucontext_mm.h deleted file mode 100644 index e4e22669edc0..000000000000 --- a/arch/m68k/include/asm/ucontext_mm.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | #ifndef _M68K_UCONTEXT_H | ||
2 | #define _M68K_UCONTEXT_H | ||
3 | |||
4 | typedef int greg_t; | ||
5 | #define NGREG 18 | ||
6 | typedef greg_t gregset_t[NGREG]; | ||
7 | |||
8 | typedef struct fpregset { | ||
9 | int f_fpcntl[3]; | ||
10 | int f_fpregs[8*3]; | ||
11 | } fpregset_t; | ||
12 | |||
13 | struct mcontext { | ||
14 | int version; | ||
15 | gregset_t gregs; | ||
16 | fpregset_t fpregs; | ||
17 | }; | ||
18 | |||
19 | #define MCONTEXT_VERSION 2 | ||
20 | |||
21 | struct ucontext { | ||
22 | unsigned long uc_flags; | ||
23 | struct ucontext *uc_link; | ||
24 | stack_t uc_stack; | ||
25 | struct mcontext uc_mcontext; | ||
26 | unsigned long uc_filler[80]; | ||
27 | sigset_t uc_sigmask; /* mask last for extensibility */ | ||
28 | }; | ||
29 | |||
30 | #endif | ||
diff --git a/arch/m68k/include/asm/ucontext_no.h b/arch/m68k/include/asm/ucontext_no.h deleted file mode 100644 index 713a27f901cd..000000000000 --- a/arch/m68k/include/asm/ucontext_no.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_UCONTEXT_H | ||
2 | #define _M68KNOMMU_UCONTEXT_H | ||
3 | |||
4 | typedef int greg_t; | ||
5 | #define NGREG 18 | ||
6 | typedef greg_t gregset_t[NGREG]; | ||
7 | |||
8 | typedef struct fpregset { | ||
9 | int f_pcr; | ||
10 | int f_psr; | ||
11 | int f_fpiaddr; | ||
12 | int f_fpregs[8][3]; | ||
13 | } fpregset_t; | ||
14 | |||
15 | struct mcontext { | ||
16 | int version; | ||
17 | gregset_t gregs; | ||
18 | fpregset_t fpregs; | ||
19 | }; | ||
20 | |||
21 | #define MCONTEXT_VERSION 2 | ||
22 | |||
23 | struct ucontext { | ||
24 | unsigned long uc_flags; | ||
25 | struct ucontext *uc_link; | ||
26 | stack_t uc_stack; | ||
27 | struct mcontext uc_mcontext; | ||
28 | unsigned long uc_filler[80]; | ||
29 | sigset_t uc_sigmask; /* mask last for extensibility */ | ||
30 | }; | ||
31 | |||
32 | #endif | ||
diff --git a/arch/m68k/include/asm/unaligned.h b/arch/m68k/include/asm/unaligned.h index c640bba3bdf4..019caa740c21 100644 --- a/arch/m68k/include/asm/unaligned.h +++ b/arch/m68k/include/asm/unaligned.h | |||
@@ -1,5 +1,25 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _ASM_M68K_UNALIGNED_H |
2 | #include "unaligned_no.h" | 2 | #define _ASM_M68K_UNALIGNED_H |
3 | |||
4 | |||
5 | #ifdef CONFIG_COLDFIRE | ||
6 | #include <linux/unaligned/be_struct.h> | ||
7 | #include <linux/unaligned/le_byteshift.h> | ||
8 | #include <linux/unaligned/generic.h> | ||
9 | |||
10 | #define get_unaligned __get_unaligned_be | ||
11 | #define put_unaligned __put_unaligned_be | ||
12 | |||
3 | #else | 13 | #else |
4 | #include "unaligned_mm.h" | 14 | /* |
15 | * The m68k can do unaligned accesses itself. | ||
16 | */ | ||
17 | #include <linux/unaligned/access_ok.h> | ||
18 | #include <linux/unaligned/generic.h> | ||
19 | |||
20 | #define get_unaligned __get_unaligned_be | ||
21 | #define put_unaligned __put_unaligned_be | ||
22 | |||
5 | #endif | 23 | #endif |
24 | |||
25 | #endif /* _ASM_M68K_UNALIGNED_H */ | ||
diff --git a/arch/m68k/include/asm/unaligned_mm.h b/arch/m68k/include/asm/unaligned_mm.h deleted file mode 100644 index 77698f2dc33c..000000000000 --- a/arch/m68k/include/asm/unaligned_mm.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef _ASM_M68K_UNALIGNED_H | ||
2 | #define _ASM_M68K_UNALIGNED_H | ||
3 | |||
4 | /* | ||
5 | * The m68k can do unaligned accesses itself. | ||
6 | */ | ||
7 | #include <linux/unaligned/access_ok.h> | ||
8 | #include <linux/unaligned/generic.h> | ||
9 | |||
10 | #define get_unaligned __get_unaligned_be | ||
11 | #define put_unaligned __put_unaligned_be | ||
12 | |||
13 | #endif /* _ASM_M68K_UNALIGNED_H */ | ||
diff --git a/arch/m68k/include/asm/unaligned_no.h b/arch/m68k/include/asm/unaligned_no.h deleted file mode 100644 index eb1ea4cb9a59..000000000000 --- a/arch/m68k/include/asm/unaligned_no.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef _ASM_M68KNOMMU_UNALIGNED_H | ||
2 | #define _ASM_M68KNOMMU_UNALIGNED_H | ||
3 | |||
4 | |||
5 | #ifdef CONFIG_COLDFIRE | ||
6 | #include <linux/unaligned/be_struct.h> | ||
7 | #include <linux/unaligned/le_byteshift.h> | ||
8 | #include <linux/unaligned/generic.h> | ||
9 | |||
10 | #define get_unaligned __get_unaligned_be | ||
11 | #define put_unaligned __put_unaligned_be | ||
12 | |||
13 | #else | ||
14 | /* | ||
15 | * The m68k can do unaligned accesses itself. | ||
16 | */ | ||
17 | #include <linux/unaligned/access_ok.h> | ||
18 | #include <linux/unaligned/generic.h> | ||
19 | |||
20 | #define get_unaligned __get_unaligned_be | ||
21 | #define put_unaligned __put_unaligned_be | ||
22 | |||
23 | #endif | ||
24 | |||
25 | #endif /* _ASM_M68KNOMMU_UNALIGNED_H */ | ||
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 632ce016014d..ec37fb56c127 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c | |||
@@ -233,7 +233,7 @@ asmlinkage int m68k_clone(struct pt_regs *regs) | |||
233 | parent_tidptr, child_tidptr); | 233 | parent_tidptr, child_tidptr); |
234 | } | 234 | } |
235 | 235 | ||
236 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 236 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
237 | unsigned long unused, | 237 | unsigned long unused, |
238 | struct task_struct * p, struct pt_regs * regs) | 238 | struct task_struct * p, struct pt_regs * regs) |
239 | { | 239 | { |
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index 7db41594d7b6..54d980795fc4 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
19 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
20 | #include <linux/rtc.h> | 20 | #include <linux/rtc.h> |
21 | #include <linux/platform_device.h> | ||
21 | 22 | ||
22 | #include <asm/machdep.h> | 23 | #include <asm/machdep.h> |
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
@@ -159,3 +160,20 @@ int do_settimeofday(struct timespec *tv) | |||
159 | } | 160 | } |
160 | 161 | ||
161 | EXPORT_SYMBOL(do_settimeofday); | 162 | EXPORT_SYMBOL(do_settimeofday); |
163 | |||
164 | |||
165 | static int __init rtc_init(void) | ||
166 | { | ||
167 | struct platform_device *pdev; | ||
168 | |||
169 | if (!mach_hwclk) | ||
170 | return -ENODEV; | ||
171 | |||
172 | pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0); | ||
173 | if (IS_ERR(pdev)) | ||
174 | return PTR_ERR(pdev); | ||
175 | |||
176 | return 0; | ||
177 | } | ||
178 | |||
179 | module_init(rtc_init); | ||
diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile index fd0fb303d885..ce404bc9ccbd 100644 --- a/arch/m68knommu/Makefile +++ b/arch/m68knommu/Makefile | |||
@@ -88,18 +88,18 @@ export PLATFORM BOARD MODEL CPUCLASS | |||
88 | # | 88 | # |
89 | # Some CFLAG additions based on specific CPU type. | 89 | # Some CFLAG additions based on specific CPU type. |
90 | # | 90 | # |
91 | cflags-$(CONFIG_M5206) := -m5200 | 91 | cflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200) |
92 | cflags-$(CONFIG_M5206e) := -m5200 | 92 | cflags-$(CONFIG_M5206e) := $(call cc-option,-m5206e,-m5200) |
93 | cflags-$(CONFIG_M520x) := -m5307 | 93 | cflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200) |
94 | cflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307) | 94 | cflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307) |
95 | cflags-$(CONFIG_M5249) := -m5200 | 95 | cflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200) |
96 | cflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307) | 96 | cflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307) |
97 | cflags-$(CONFIG_M5272) := -m5307 | 97 | cflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5271,-m5200) |
98 | cflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307) | 98 | cflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307) |
99 | cflags-$(CONFIG_M528x) := $(call cc-option,-m528x,-m5307) | 99 | cflags-$(CONFIG_M528x) := $(call cc-option,-m528x,-m5307) |
100 | cflags-$(CONFIG_M5307) := -m5307 | 100 | cflags-$(CONFIG_M5307) := $(call cc-option,-m5307,-m5200) |
101 | cflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307) | 101 | cflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307) |
102 | cflags-$(CONFIG_M5407) := -m5200 | 102 | cflags-$(CONFIG_M5407) := $(call cc-option,-m5407,-m5200) |
103 | cflags-$(CONFIG_M68328) := -m68000 | 103 | cflags-$(CONFIG_M68328) := -m68000 |
104 | cflags-$(CONFIG_M68EZ328) := -m68000 | 104 | cflags-$(CONFIG_M68EZ328) := -m68000 |
105 | cflags-$(CONFIG_M68VZ328) := -m68000 | 105 | cflags-$(CONFIG_M68VZ328) := -m68000 |
diff --git a/arch/m68knommu/kernel/dma.c b/arch/m68knommu/kernel/dma.c index e10eafc52789..936125806638 100644 --- a/arch/m68knommu/kernel/dma.c +++ b/arch/m68knommu/kernel/dma.c | |||
@@ -9,10 +9,11 @@ | |||
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/dma-mapping.h> | ||
12 | #include <asm/io.h> | 13 | #include <asm/io.h> |
13 | 14 | ||
14 | void *dma_alloc_coherent(struct device *dev, size_t size, | 15 | void *dma_alloc_coherent(struct device *dev, size_t size, |
15 | dma_addr_t *dma_handle, int gfp) | 16 | dma_addr_t *dma_handle, gfp_t gfp) |
16 | { | 17 | { |
17 | void *ret; | 18 | void *ret; |
18 | /* ignore region specifiers */ | 19 | /* ignore region specifiers */ |
@@ -34,3 +35,8 @@ void dma_free_coherent(struct device *dev, size_t size, | |||
34 | { | 35 | { |
35 | free_pages((unsigned long)vaddr, get_order(size)); | 36 | free_pages((unsigned long)vaddr, get_order(size)); |
36 | } | 37 | } |
38 | |||
39 | void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) | ||
40 | { | ||
41 | } | ||
42 | |||
diff --git a/arch/m68knommu/kernel/irq.c b/arch/m68knommu/kernel/irq.c index bba1bb48a21f..56e0f4c55a67 100644 --- a/arch/m68knommu/kernel/irq.c +++ b/arch/m68knommu/kernel/irq.c | |||
@@ -23,7 +23,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs) | |||
23 | struct pt_regs *oldregs = set_irq_regs(regs); | 23 | struct pt_regs *oldregs = set_irq_regs(regs); |
24 | 24 | ||
25 | irq_enter(); | 25 | irq_enter(); |
26 | __do_IRQ(irq); | 26 | generic_handle_irq(irq); |
27 | irq_exit(); | 27 | irq_exit(); |
28 | 28 | ||
29 | set_irq_regs(oldregs); | 29 | set_irq_regs(oldregs); |
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c index 3f2d7745f31e..1e96c6eb6312 100644 --- a/arch/m68knommu/kernel/process.c +++ b/arch/m68knommu/kernel/process.c | |||
@@ -199,7 +199,7 @@ asmlinkage int m68k_clone(struct pt_regs *regs) | |||
199 | return do_fork(clone_flags, newsp, regs, 0, NULL, NULL); | 199 | return do_fork(clone_flags, newsp, regs, 0, NULL, NULL); |
200 | } | 200 | } |
201 | 201 | ||
202 | int copy_thread(int nr, unsigned long clone_flags, | 202 | int copy_thread(unsigned long clone_flags, |
203 | unsigned long usp, unsigned long topstk, | 203 | unsigned long usp, unsigned long topstk, |
204 | struct task_struct * p, struct pt_regs * regs) | 204 | struct task_struct * p, struct pt_regs * regs) |
205 | { | 205 | { |
diff --git a/arch/m68knommu/mm/init.c b/arch/m68knommu/mm/init.c index 3bf249c53e41..7befc0c357e0 100644 --- a/arch/m68knommu/mm/init.c +++ b/arch/m68knommu/mm/init.c | |||
@@ -111,11 +111,7 @@ void __init paging_init(void) | |||
111 | { | 111 | { |
112 | unsigned long zones_size[MAX_NR_ZONES] = {0, }; | 112 | unsigned long zones_size[MAX_NR_ZONES] = {0, }; |
113 | 113 | ||
114 | zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT; | 114 | zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; |
115 | zones_size[ZONE_NORMAL] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; | ||
116 | #ifdef CONFIG_HIGHMEM | ||
117 | zones_size[ZONE_HIGHMEM] = 0; | ||
118 | #endif | ||
119 | free_area_init(zones_size); | 115 | free_area_init(zones_size); |
120 | } | 116 | } |
121 | } | 117 | } |
diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c index d299f7b8768a..9eab19d01eb1 100644 --- a/arch/m68knommu/platform/5249/config.c +++ b/arch/m68knommu/platform/5249/config.c | |||
@@ -32,7 +32,8 @@ static struct mcf_platform_uart m5249_uart_platform[] = { | |||
32 | { | 32 | { |
33 | .mapbase = MCF_MBAR + MCFUART_BASE2, | 33 | .mapbase = MCF_MBAR + MCFUART_BASE2, |
34 | .irq = 74, | 34 | .irq = 74, |
35 | } | 35 | }, |
36 | { }, | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | static struct platform_device m5249_uart = { | 39 | static struct platform_device m5249_uart = { |
@@ -50,12 +51,12 @@ static struct platform_device *m5249_devices[] __initdata = { | |||
50 | static void __init m5249_uart_init_line(int line, int irq) | 51 | static void __init m5249_uart_init_line(int line, int irq) |
51 | { | 52 | { |
52 | if (line == 0) { | 53 | if (line == 0) { |
53 | writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); | 54 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); |
54 | writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); | 55 | writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); |
55 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); | 56 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); |
56 | } else if (line == 1) { | 57 | } else if (line == 1) { |
57 | writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); | 58 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); |
58 | writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); | 59 | writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); |
59 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); | 60 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); |
60 | } | 61 | } |
61 | } | 62 | } |
diff --git a/arch/m68knommu/platform/5307/config.c b/arch/m68knommu/platform/5307/config.c index 724faf05852a..44803bf70a6e 100644 --- a/arch/m68knommu/platform/5307/config.c +++ b/arch/m68knommu/platform/5307/config.c | |||
@@ -65,12 +65,12 @@ static struct platform_device *m5307_devices[] __initdata = { | |||
65 | static void __init m5307_uart_init_line(int line, int irq) | 65 | static void __init m5307_uart_init_line(int line, int irq) |
66 | { | 66 | { |
67 | if (line == 0) { | 67 | if (line == 0) { |
68 | writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); | 68 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); |
69 | writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); | 69 | writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); |
70 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); | 70 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); |
71 | } else if (line == 1) { | 71 | } else if (line == 1) { |
72 | writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); | 72 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); |
73 | writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); | 73 | writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); |
74 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); | 74 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); |
75 | } | 75 | } |
76 | } | 76 | } |
diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c index 648b8b778211..0ee8c1a200c8 100644 --- a/arch/m68knommu/platform/5407/config.c +++ b/arch/m68knommu/platform/5407/config.c | |||
@@ -56,12 +56,12 @@ static struct platform_device *m5407_devices[] __initdata = { | |||
56 | static void __init m5407_uart_init_line(int line, int irq) | 56 | static void __init m5407_uart_init_line(int line, int irq) |
57 | { | 57 | { |
58 | if (line == 0) { | 58 | if (line == 0) { |
59 | writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); | 59 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); |
60 | writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); | 60 | writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); |
61 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); | 61 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); |
62 | } else if (line == 1) { | 62 | } else if (line == 1) { |
63 | writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); | 63 | writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); |
64 | writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); | 64 | writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); |
65 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); | 65 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); |
66 | } | 66 | } |
67 | } | 67 | } |
diff --git a/arch/m68knommu/platform/coldfire/Makefile b/arch/m68knommu/platform/coldfire/Makefile index 4f416a91a829..1bcb9372353f 100644 --- a/arch/m68knommu/platform/coldfire/Makefile +++ b/arch/m68knommu/platform/coldfire/Makefile | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 | 15 | asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 |
16 | 16 | ||
17 | obj-$(CONFIG_COLDFIRE) += dma.o entry.o vectors.o | 17 | obj-$(CONFIG_COLDFIRE) += clk.o dma.o entry.o vectors.o |
18 | obj-$(CONFIG_M5206) += timers.o | 18 | obj-$(CONFIG_M5206) += timers.o |
19 | obj-$(CONFIG_M5206e) += timers.o | 19 | obj-$(CONFIG_M5206e) += timers.o |
20 | obj-$(CONFIG_M520x) += pit.o | 20 | obj-$(CONFIG_M520x) += pit.o |
diff --git a/arch/m68knommu/platform/coldfire/clk.c b/arch/m68knommu/platform/coldfire/clk.c new file mode 100644 index 000000000000..7cdbf445b28f --- /dev/null +++ b/arch/m68knommu/platform/coldfire/clk.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /***************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * clk.c -- general ColdFire CPU kernel clk handling | ||
5 | * | ||
6 | * Copyright (C) 2009, Greg Ungerer (gerg@snapgear.com) | ||
7 | */ | ||
8 | |||
9 | /***************************************************************************/ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/clk.h> | ||
13 | #include <asm/coldfire.h> | ||
14 | |||
15 | /***************************************************************************/ | ||
16 | |||
17 | struct clk *clk_get(struct device *dev, const char *id) | ||
18 | { | ||
19 | return NULL; | ||
20 | } | ||
21 | |||
22 | int clk_enable(struct clk *clk) | ||
23 | { | ||
24 | return 0; | ||
25 | } | ||
26 | |||
27 | void clk_disable(struct clk *clk) | ||
28 | { | ||
29 | } | ||
30 | |||
31 | void clk_put(struct clk *clk) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | unsigned long clk_get_rate(struct clk *clk) | ||
36 | { | ||
37 | return MCF_CLK; | ||
38 | } | ||
39 | |||
40 | /***************************************************************************/ | ||
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index dc787190430a..998e5db8cc0f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -134,7 +134,7 @@ config MACH_JAZZ | |||
134 | help | 134 | help |
135 | This a family of machines based on the MIPS R4030 chipset which was | 135 | This a family of machines based on the MIPS R4030 chipset which was |
136 | used by several vendors to build RISC/os and Windows NT workstations. | 136 | used by several vendors to build RISC/os and Windows NT workstations. |
137 | Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and | 137 | Members include the Acer PICA, MIPS Magnum 4000, MIPS Millennium and |
138 | Olivetti M700-10 workstations. | 138 | Olivetti M700-10 workstations. |
139 | 139 | ||
140 | config LASAT | 140 | config LASAT |
diff --git a/arch/mips/include/asm/ftrace.h b/arch/mips/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/mips/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h index 10e82441b496..5b60a09a0f08 100644 --- a/arch/mips/include/asm/spinlock.h +++ b/arch/mips/include/asm/spinlock.h | |||
@@ -480,6 +480,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
480 | return ret; | 480 | return ret; |
481 | } | 481 | } |
482 | 482 | ||
483 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
484 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
483 | 485 | ||
484 | #define _raw_spin_relax(lock) cpu_relax() | 486 | #define _raw_spin_relax(lock) cpu_relax() |
485 | #define _raw_read_relax(lock) cpu_relax() | 487 | #define _raw_read_relax(lock) cpu_relax() |
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index a73e1531e151..40005010827c 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
@@ -350,16 +350,18 @@ | |||
350 | #define __NR_dup3 (__NR_Linux + 327) | 350 | #define __NR_dup3 (__NR_Linux + 327) |
351 | #define __NR_pipe2 (__NR_Linux + 328) | 351 | #define __NR_pipe2 (__NR_Linux + 328) |
352 | #define __NR_inotify_init1 (__NR_Linux + 329) | 352 | #define __NR_inotify_init1 (__NR_Linux + 329) |
353 | #define __NR_preadv (__NR_Linux + 330) | ||
354 | #define __NR_pwritev (__NR_Linux + 331) | ||
353 | 355 | ||
354 | /* | 356 | /* |
355 | * Offset of the last Linux o32 flavoured syscall | 357 | * Offset of the last Linux o32 flavoured syscall |
356 | */ | 358 | */ |
357 | #define __NR_Linux_syscalls 329 | 359 | #define __NR_Linux_syscalls 331 |
358 | 360 | ||
359 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 361 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
360 | 362 | ||
361 | #define __NR_O32_Linux 4000 | 363 | #define __NR_O32_Linux 4000 |
362 | #define __NR_O32_Linux_syscalls 329 | 364 | #define __NR_O32_Linux_syscalls 331 |
363 | 365 | ||
364 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 366 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
365 | 367 | ||
@@ -656,16 +658,18 @@ | |||
656 | #define __NR_dup3 (__NR_Linux + 286) | 658 | #define __NR_dup3 (__NR_Linux + 286) |
657 | #define __NR_pipe2 (__NR_Linux + 287) | 659 | #define __NR_pipe2 (__NR_Linux + 287) |
658 | #define __NR_inotify_init1 (__NR_Linux + 288) | 660 | #define __NR_inotify_init1 (__NR_Linux + 288) |
661 | #define __NR_preadv (__NR_Linux + 289) | ||
662 | #define __NR_pwritev (__NR_Linux + 290) | ||
659 | 663 | ||
660 | /* | 664 | /* |
661 | * Offset of the last Linux 64-bit flavoured syscall | 665 | * Offset of the last Linux 64-bit flavoured syscall |
662 | */ | 666 | */ |
663 | #define __NR_Linux_syscalls 288 | 667 | #define __NR_Linux_syscalls 290 |
664 | 668 | ||
665 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 669 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
666 | 670 | ||
667 | #define __NR_64_Linux 5000 | 671 | #define __NR_64_Linux 5000 |
668 | #define __NR_64_Linux_syscalls 288 | 672 | #define __NR_64_Linux_syscalls 290 |
669 | 673 | ||
670 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 674 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
671 | 675 | ||
@@ -966,16 +970,18 @@ | |||
966 | #define __NR_dup3 (__NR_Linux + 290) | 970 | #define __NR_dup3 (__NR_Linux + 290) |
967 | #define __NR_pipe2 (__NR_Linux + 291) | 971 | #define __NR_pipe2 (__NR_Linux + 291) |
968 | #define __NR_inotify_init1 (__NR_Linux + 292) | 972 | #define __NR_inotify_init1 (__NR_Linux + 292) |
973 | #define __NR_preadv (__NR_Linux + 293) | ||
974 | #define __NR_pwritev (__NR_Linux + 294) | ||
969 | 975 | ||
970 | /* | 976 | /* |
971 | * Offset of the last N32 flavoured syscall | 977 | * Offset of the last N32 flavoured syscall |
972 | */ | 978 | */ |
973 | #define __NR_Linux_syscalls 292 | 979 | #define __NR_Linux_syscalls 294 |
974 | 980 | ||
975 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 981 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
976 | 982 | ||
977 | #define __NR_N32_Linux 6000 | 983 | #define __NR_N32_Linux 6000 |
978 | #define __NR_N32_Linux_syscalls 292 | 984 | #define __NR_N32_Linux_syscalls 294 |
979 | 985 | ||
980 | #ifdef __KERNEL__ | 986 | #ifdef __KERNEL__ |
981 | 987 | ||
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index ca2e4026ad20..1eaaa450e20c 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -99,7 +99,7 @@ void flush_thread(void) | |||
99 | { | 99 | { |
100 | } | 100 | } |
101 | 101 | ||
102 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 102 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
103 | unsigned long unused, struct task_struct *p, struct pt_regs *regs) | 103 | unsigned long unused, struct task_struct *p, struct pt_regs *regs) |
104 | { | 104 | { |
105 | struct thread_info *ti = task_thread_info(p); | 105 | struct thread_info *ti = task_thread_info(p); |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 9ab70c3b5be6..0b31b9bda048 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -650,6 +650,8 @@ einval: li v0, -ENOSYS | |||
650 | sys sys_dup3 3 | 650 | sys sys_dup3 3 |
651 | sys sys_pipe2 2 | 651 | sys sys_pipe2 2 |
652 | sys sys_inotify_init1 1 | 652 | sys sys_inotify_init1 1 |
653 | sys sys_preadv 6 /* 4330 */ | ||
654 | sys sys_pwritev 6 | ||
653 | .endm | 655 | .endm |
654 | 656 | ||
655 | /* We pre-compute the number of _instruction_ bytes needed to | 657 | /* We pre-compute the number of _instruction_ bytes needed to |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 9b4698667154..c647fd6e722f 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -487,4 +487,6 @@ sys_call_table: | |||
487 | PTR sys_dup3 | 487 | PTR sys_dup3 |
488 | PTR sys_pipe2 | 488 | PTR sys_pipe2 |
489 | PTR sys_inotify_init1 | 489 | PTR sys_inotify_init1 |
490 | PTR sys_preadv | ||
491 | PTR sys_pwritev /* 5390 */ | ||
490 | .size sys_call_table,.-sys_call_table | 492 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index f61d6b0e5731..c2c16ef9218f 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -413,4 +413,6 @@ EXPORT(sysn32_call_table) | |||
413 | PTR sys_dup3 /* 5290 */ | 413 | PTR sys_dup3 /* 5290 */ |
414 | PTR sys_pipe2 | 414 | PTR sys_pipe2 |
415 | PTR sys_inotify_init1 | 415 | PTR sys_inotify_init1 |
416 | PTR sys_preadv | ||
417 | PTR sys_pwritev | ||
416 | .size sysn32_call_table,.-sysn32_call_table | 418 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 60997f1f69d4..002fac27021e 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -533,4 +533,6 @@ sys_call_table: | |||
533 | PTR sys_dup3 | 533 | PTR sys_dup3 |
534 | PTR sys_pipe2 | 534 | PTR sys_pipe2 |
535 | PTR sys_inotify_init1 | 535 | PTR sys_inotify_init1 |
536 | PTR compat_sys_preadv /* 4330 */ | ||
537 | PTR compat_sys_pwritev | ||
536 | .size sys_call_table,.-sys_call_table | 538 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c index 5b47d6b65275..cbcd7eb83bd1 100644 --- a/arch/mips/sgi-ip27/ip27-smp.c +++ b/arch/mips/sgi-ip27/ip27-smp.c | |||
@@ -221,7 +221,7 @@ static void __init ip27_smp_setup(void) | |||
221 | * Assumption to be fixed: we're always booted on logical / physical | 221 | * Assumption to be fixed: we're always booted on logical / physical |
222 | * processor 0. While we're always running on logical processor 0 | 222 | * processor 0. While we're always running on logical processor 0 |
223 | * this still means this is physical processor zero; it might for | 223 | * this still means this is physical processor zero; it might for |
224 | * example be disabled in the firwware. | 224 | * example be disabled in the firmware. |
225 | */ | 225 | */ |
226 | alloc_cpupda(0, 0); | 226 | alloc_cpupda(0, 0); |
227 | } | 227 | } |
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c index b28c9a60445b..234cf344cdce 100644 --- a/arch/mn10300/kernel/process.c +++ b/arch/mn10300/kernel/process.c | |||
@@ -193,7 +193,7 @@ void prepare_to_copy(struct task_struct *tsk) | |||
193 | * set up the kernel stack for a new thread and copy arch-specific thread | 193 | * set up the kernel stack for a new thread and copy arch-specific thread |
194 | * control information | 194 | * control information |
195 | */ | 195 | */ |
196 | int copy_thread(int nr, unsigned long clone_flags, | 196 | int copy_thread(unsigned long clone_flags, |
197 | unsigned long c_usp, unsigned long ustk_size, | 197 | unsigned long c_usp, unsigned long ustk_size, |
198 | struct task_struct *p, struct pt_regs *kregs) | 198 | struct task_struct *p, struct pt_regs *kregs) |
199 | { | 199 | { |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index aacf11d33723..9038f39d9d73 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -9,9 +9,13 @@ config PARISC | |||
9 | def_bool y | 9 | def_bool y |
10 | select HAVE_IDE | 10 | select HAVE_IDE |
11 | select HAVE_OPROFILE | 11 | select HAVE_OPROFILE |
12 | select HAVE_FUNCTION_TRACER if 64BIT | ||
13 | select HAVE_FUNCTION_GRAPH_TRACER if 64BIT | ||
14 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST if 64BIT | ||
12 | select RTC_CLASS | 15 | select RTC_CLASS |
13 | select RTC_DRV_PARISC | 16 | select RTC_DRV_GENERIC |
14 | select INIT_ALL_POSSIBLE | 17 | select INIT_ALL_POSSIBLE |
18 | select BUG | ||
15 | help | 19 | help |
16 | The PA-RISC microprocessor is designed by Hewlett-Packard and used | 20 | The PA-RISC microprocessor is designed by Hewlett-Packard and used |
17 | in many of their workstations & servers (HP9000 700 and 800 series, | 21 | in many of their workstations & servers (HP9000 700 and 800 series, |
@@ -75,6 +79,9 @@ config GENERIC_HARDIRQS | |||
75 | config GENERIC_IRQ_PROBE | 79 | config GENERIC_IRQ_PROBE |
76 | def_bool y | 80 | def_bool y |
77 | 81 | ||
82 | config HAVE_LATENCYTOP_SUPPORT | ||
83 | def_bool y | ||
84 | |||
78 | config IRQ_PER_CPU | 85 | config IRQ_PER_CPU |
79 | bool | 86 | bool |
80 | default y | 87 | default y |
@@ -83,6 +90,9 @@ config IRQ_PER_CPU | |||
83 | config PM | 90 | config PM |
84 | bool | 91 | bool |
85 | 92 | ||
93 | config STACKTRACE_SUPPORT | ||
94 | def_bool y | ||
95 | |||
86 | config ISA_DMA_API | 96 | config ISA_DMA_API |
87 | bool | 97 | bool |
88 | 98 | ||
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 0d428278356d..da6f66901c92 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile | |||
@@ -56,7 +56,9 @@ cflags-y += -mdisable-fpregs | |||
56 | 56 | ||
57 | # Without this, "ld -r" results in .text sections that are too big | 57 | # Without this, "ld -r" results in .text sections that are too big |
58 | # (> 0x40000) for branches to reach stubs. | 58 | # (> 0x40000) for branches to reach stubs. |
59 | cflags-y += -ffunction-sections | 59 | ifndef CONFIG_FUNCTION_TRACER |
60 | cflags-y += -ffunction-sections | ||
61 | endif | ||
60 | 62 | ||
61 | # select which processor to optimise for | 63 | # select which processor to optimise for |
62 | cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100 | 64 | cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100 |
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index edbfe25c5fc1..ada3e5364d82 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h | |||
@@ -25,7 +25,7 @@ | |||
25 | * Since "a" is usually an address, use one spinlock per cacheline. | 25 | * Since "a" is usually an address, use one spinlock per cacheline. |
26 | */ | 26 | */ |
27 | # define ATOMIC_HASH_SIZE 4 | 27 | # define ATOMIC_HASH_SIZE 4 |
28 | # define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ])) | 28 | # define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ])) |
29 | 29 | ||
30 | extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned; | 30 | extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned; |
31 | 31 | ||
@@ -222,13 +222,13 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | |||
222 | 222 | ||
223 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | 223 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) |
224 | 224 | ||
225 | #define atomic_add(i,v) ((void)(__atomic_add_return( ((int)i),(v)))) | 225 | #define atomic_add(i,v) ((void)(__atomic_add_return( ((int)(i)),(v)))) |
226 | #define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)i),(v)))) | 226 | #define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)(i)),(v)))) |
227 | #define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) | 227 | #define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) |
228 | #define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) | 228 | #define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) |
229 | 229 | ||
230 | #define atomic_add_return(i,v) (__atomic_add_return( ((int)i),(v))) | 230 | #define atomic_add_return(i,v) (__atomic_add_return( ((int)(i)),(v))) |
231 | #define atomic_sub_return(i,v) (__atomic_add_return(-((int)i),(v))) | 231 | #define atomic_sub_return(i,v) (__atomic_add_return(-((int)(i)),(v))) |
232 | #define atomic_inc_return(v) (__atomic_add_return( 1,(v))) | 232 | #define atomic_inc_return(v) (__atomic_add_return( 1,(v))) |
233 | #define atomic_dec_return(v) (__atomic_add_return( -1,(v))) | 233 | #define atomic_dec_return(v) (__atomic_add_return( -1,(v))) |
234 | 234 | ||
@@ -289,13 +289,13 @@ atomic64_read(const atomic64_t *v) | |||
289 | return v->counter; | 289 | return v->counter; |
290 | } | 290 | } |
291 | 291 | ||
292 | #define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)i),(v)))) | 292 | #define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)(i)),(v)))) |
293 | #define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)i),(v)))) | 293 | #define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)(i)),(v)))) |
294 | #define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v)))) | 294 | #define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v)))) |
295 | #define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v)))) | 295 | #define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v)))) |
296 | 296 | ||
297 | #define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)i),(v))) | 297 | #define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)(i)),(v))) |
298 | #define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)i),(v))) | 298 | #define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)(i)),(v))) |
299 | #define atomic64_inc_return(v) (__atomic64_add_return( 1,(v))) | 299 | #define atomic64_inc_return(v) (__atomic64_add_return( 1,(v))) |
300 | #define atomic64_dec_return(v) (__atomic64_add_return( -1,(v))) | 300 | #define atomic64_dec_return(v) (__atomic64_add_return( -1,(v))) |
301 | 301 | ||
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h index b7ca6dc7fddc..724395143f26 100644 --- a/arch/parisc/include/asm/cacheflush.h +++ b/arch/parisc/include/asm/cacheflush.h | |||
@@ -97,6 +97,9 @@ void mark_rodata_ro(void); | |||
97 | 97 | ||
98 | #ifdef CONFIG_PA8X00 | 98 | #ifdef CONFIG_PA8X00 |
99 | /* Only pa8800, pa8900 needs this */ | 99 | /* Only pa8800, pa8900 needs this */ |
100 | |||
101 | #include <asm/kmap_types.h> | ||
102 | |||
100 | #define ARCH_HAS_KMAP | 103 | #define ARCH_HAS_KMAP |
101 | 104 | ||
102 | void kunmap_parisc(void *addr); | 105 | void kunmap_parisc(void *addr); |
diff --git a/arch/parisc/include/asm/elf.h b/arch/parisc/include/asm/elf.h index 7fa675799e6d..9c802eb4be84 100644 --- a/arch/parisc/include/asm/elf.h +++ b/arch/parisc/include/asm/elf.h | |||
@@ -168,6 +168,16 @@ typedef struct elf64_fdesc { | |||
168 | __u64 gp; | 168 | __u64 gp; |
169 | } Elf64_Fdesc; | 169 | } Elf64_Fdesc; |
170 | 170 | ||
171 | #ifdef __KERNEL__ | ||
172 | |||
173 | #ifdef CONFIG_64BIT | ||
174 | #define Elf_Fdesc Elf64_Fdesc | ||
175 | #else | ||
176 | #define Elf_Fdesc Elf32_Fdesc | ||
177 | #endif /*CONFIG_64BIT*/ | ||
178 | |||
179 | #endif /*__KERNEL__*/ | ||
180 | |||
171 | /* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ | 181 | /* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ |
172 | 182 | ||
173 | #define PT_HP_TLS (PT_LOOS + 0x0) | 183 | #define PT_HP_TLS (PT_LOOS + 0x0) |
diff --git a/arch/parisc/include/asm/ftrace.h b/arch/parisc/include/asm/ftrace.h new file mode 100644 index 000000000000..2fa05dd6aeee --- /dev/null +++ b/arch/parisc/include/asm/ftrace.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef _ASM_PARISC_FTRACE_H | ||
2 | #define _ASM_PARISC_FTRACE_H | ||
3 | |||
4 | #ifndef __ASSEMBLY__ | ||
5 | extern void mcount(void); | ||
6 | |||
7 | /* | ||
8 | * Stack of return addresses for functions of a thread. | ||
9 | * Used in struct thread_info | ||
10 | */ | ||
11 | struct ftrace_ret_stack { | ||
12 | unsigned long ret; | ||
13 | unsigned long func; | ||
14 | unsigned long long calltime; | ||
15 | }; | ||
16 | |||
17 | /* | ||
18 | * Primary handler of a function return. | ||
19 | * It relays on ftrace_return_to_handler. | ||
20 | * Defined in entry.S | ||
21 | */ | ||
22 | extern void return_to_handler(void); | ||
23 | #endif /* __ASSEMBLY__ */ | ||
24 | |||
25 | #endif /* _ASM_PARISC_FTRACE_H */ | ||
diff --git a/arch/parisc/include/asm/page.h b/arch/parisc/include/asm/page.h index c3941f09a878..7bc5125d7d4c 100644 --- a/arch/parisc/include/asm/page.h +++ b/arch/parisc/include/asm/page.h | |||
@@ -36,16 +36,7 @@ void clear_user_page(void *page, unsigned long vaddr, struct page *pg); | |||
36 | */ | 36 | */ |
37 | #define STRICT_MM_TYPECHECKS | 37 | #define STRICT_MM_TYPECHECKS |
38 | #ifdef STRICT_MM_TYPECHECKS | 38 | #ifdef STRICT_MM_TYPECHECKS |
39 | typedef struct { unsigned long pte; | 39 | typedef struct { unsigned long pte; } pte_t; /* either 32 or 64bit */ |
40 | #if !defined(CONFIG_64BIT) | ||
41 | unsigned long future_flags; | ||
42 | /* XXX: it's possible to remove future_flags and change BITS_PER_PTE_ENTRY | ||
43 | to 2, but then strangely the identical 32bit kernel boots on a | ||
44 | c3000(pa20), but not any longer on a 715(pa11). | ||
45 | Still investigating... HelgeD. | ||
46 | */ | ||
47 | #endif | ||
48 | } pte_t; /* either 32 or 64bit */ | ||
49 | 40 | ||
50 | /* NOTE: even on 64 bits, these entries are __u32 because we allocate | 41 | /* NOTE: even on 64 bits, these entries are __u32 because we allocate |
51 | * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */ | 42 | * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */ |
@@ -111,7 +102,7 @@ extern int npmem_ranges; | |||
111 | #define BITS_PER_PMD_ENTRY 2 | 102 | #define BITS_PER_PMD_ENTRY 2 |
112 | #define BITS_PER_PGD_ENTRY 2 | 103 | #define BITS_PER_PGD_ENTRY 2 |
113 | #else | 104 | #else |
114 | #define BITS_PER_PTE_ENTRY 3 | 105 | #define BITS_PER_PTE_ENTRY 2 |
115 | #define BITS_PER_PMD_ENTRY 2 | 106 | #define BITS_PER_PMD_ENTRY 2 |
116 | #define BITS_PER_PGD_ENTRY BITS_PER_PMD_ENTRY | 107 | #define BITS_PER_PGD_ENTRY BITS_PER_PMD_ENTRY |
117 | #endif | 108 | #endif |
diff --git a/arch/parisc/include/asm/pdc.h b/arch/parisc/include/asm/pdc.h index 430f1aeea0b8..4ca510b3c6f8 100644 --- a/arch/parisc/include/asm/pdc.h +++ b/arch/parisc/include/asm/pdc.h | |||
@@ -49,6 +49,8 @@ | |||
49 | #define PDC_MODEL_CPU_ID 6 /* returns cpu-id (only newer machines!) */ | 49 | #define PDC_MODEL_CPU_ID 6 /* returns cpu-id (only newer machines!) */ |
50 | #define PDC_MODEL_CAPABILITIES 7 /* returns OS32/OS64-flags */ | 50 | #define PDC_MODEL_CAPABILITIES 7 /* returns OS32/OS64-flags */ |
51 | /* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */ | 51 | /* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */ |
52 | #define PDC_MODEL_OS64 (1 << 0) | ||
53 | #define PDC_MODEL_OS32 (1 << 1) | ||
52 | #define PDC_MODEL_IOPDIR_FDC (1 << 2) | 54 | #define PDC_MODEL_IOPDIR_FDC (1 << 2) |
53 | #define PDC_MODEL_NVA_MASK (3 << 4) | 55 | #define PDC_MODEL_NVA_MASK (3 << 4) |
54 | #define PDC_MODEL_NVA_SUPPORTED (0 << 4) | 56 | #define PDC_MODEL_NVA_SUPPORTED (0 << 4) |
@@ -341,6 +343,8 @@ | |||
341 | 343 | ||
342 | #ifdef __KERNEL__ | 344 | #ifdef __KERNEL__ |
343 | 345 | ||
346 | #include <asm/page.h> /* for __PAGE_OFFSET */ | ||
347 | |||
344 | extern int pdc_type; | 348 | extern int pdc_type; |
345 | 349 | ||
346 | /* Values for pdc_type */ | 350 | /* Values for pdc_type */ |
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index 470a4b88124d..a27d2e200fb2 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h | |||
@@ -50,11 +50,7 @@ | |||
50 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e)) | 50 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e)) |
51 | 51 | ||
52 | /* This is the size of the initially mapped kernel memory */ | 52 | /* This is the size of the initially mapped kernel memory */ |
53 | #ifdef CONFIG_64BIT | ||
54 | #define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */ | 53 | #define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */ |
55 | #else | ||
56 | #define KERNEL_INITIAL_ORDER 23 /* 0 to 1<<23 = 8MB */ | ||
57 | #endif | ||
58 | #define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) | 54 | #define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) |
59 | 55 | ||
60 | #if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB) | 56 | #if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB) |
@@ -91,16 +87,25 @@ | |||
91 | 87 | ||
92 | /* Definitions for 1st level */ | 88 | /* Definitions for 1st level */ |
93 | #define PGDIR_SHIFT (PMD_SHIFT + BITS_PER_PMD) | 89 | #define PGDIR_SHIFT (PMD_SHIFT + BITS_PER_PMD) |
90 | #if (PGDIR_SHIFT + PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY) > BITS_PER_LONG | ||
91 | #define BITS_PER_PGD (BITS_PER_LONG - PGDIR_SHIFT) | ||
92 | #else | ||
94 | #define BITS_PER_PGD (PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY) | 93 | #define BITS_PER_PGD (PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY) |
94 | #endif | ||
95 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | 95 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) |
96 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 96 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
97 | #define PTRS_PER_PGD (1UL << BITS_PER_PGD) | 97 | #define PTRS_PER_PGD (1UL << BITS_PER_PGD) |
98 | #define USER_PTRS_PER_PGD PTRS_PER_PGD | 98 | #define USER_PTRS_PER_PGD PTRS_PER_PGD |
99 | 99 | ||
100 | #ifdef CONFIG_64BIT | ||
100 | #define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD) | 101 | #define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD) |
101 | #define MAX_ADDRESS (1UL << MAX_ADDRBITS) | 102 | #define MAX_ADDRESS (1UL << MAX_ADDRBITS) |
102 | |||
103 | #define SPACEID_SHIFT (MAX_ADDRBITS - 32) | 103 | #define SPACEID_SHIFT (MAX_ADDRBITS - 32) |
104 | #else | ||
105 | #define MAX_ADDRBITS (BITS_PER_LONG) | ||
106 | #define MAX_ADDRESS (1UL << MAX_ADDRBITS) | ||
107 | #define SPACEID_SHIFT 0 | ||
108 | #endif | ||
104 | 109 | ||
105 | /* This calculates the number of initial pages we need for the initial | 110 | /* This calculates the number of initial pages we need for the initial |
106 | * page tables */ | 111 | * page tables */ |
diff --git a/arch/parisc/include/asm/smp.h b/arch/parisc/include/asm/smp.h index 6ef4b7867b1b..21eb45a52629 100644 --- a/arch/parisc/include/asm/smp.h +++ b/arch/parisc/include/asm/smp.h | |||
@@ -29,7 +29,8 @@ extern void smp_send_reschedule(int cpu); | |||
29 | extern void smp_send_all_nop(void); | 29 | extern void smp_send_all_nop(void); |
30 | 30 | ||
31 | extern void arch_send_call_function_single_ipi(int cpu); | 31 | extern void arch_send_call_function_single_ipi(int cpu); |
32 | extern void arch_send_call_function_ipi(cpumask_t mask); | 32 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
33 | #define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask | ||
33 | 34 | ||
34 | #endif /* !ASSEMBLY */ | 35 | #endif /* !ASSEMBLY */ |
35 | 36 | ||
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h index f3d2090a18dc..fae03e136fa8 100644 --- a/arch/parisc/include/asm/spinlock.h +++ b/arch/parisc/include/asm/spinlock.h | |||
@@ -187,6 +187,9 @@ static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw) | |||
187 | return !rw->counter; | 187 | return !rw->counter; |
188 | } | 188 | } |
189 | 189 | ||
190 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
191 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
192 | |||
190 | #define _raw_spin_relax(lock) cpu_relax() | 193 | #define _raw_spin_relax(lock) cpu_relax() |
191 | #define _raw_read_relax(lock) cpu_relax() | 194 | #define _raw_read_relax(lock) cpu_relax() |
192 | #define _raw_write_relax(lock) cpu_relax() | 195 | #define _raw_write_relax(lock) cpu_relax() |
diff --git a/arch/parisc/kernel/Makefile b/arch/parisc/kernel/Makefile index 016d3fc4111c..67db0722e6ca 100644 --- a/arch/parisc/kernel/Makefile +++ b/arch/parisc/kernel/Makefile | |||
@@ -11,10 +11,25 @@ obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \ | |||
11 | process.o processor.o pdc_cons.o pdc_chassis.o unwind.o \ | 11 | process.o processor.o pdc_cons.o pdc_chassis.o unwind.o \ |
12 | topology.o | 12 | topology.o |
13 | 13 | ||
14 | ifdef CONFIG_FUNCTION_TRACER | ||
15 | # Do not profile debug and lowlevel utilities | ||
16 | CFLAGS_REMOVE_ftrace.o = -pg | ||
17 | CFLAGS_REMOVE_cache.o = -pg | ||
18 | CFLAGS_REMOVE_irq.o = -pg | ||
19 | CFLAGS_REMOVE_pacache.o = -pg | ||
20 | CFLAGS_REMOVE_perf.o = -pg | ||
21 | CFLAGS_REMOVE_traps.o = -pg | ||
22 | CFLAGS_REMOVE_unaligned.o = -pg | ||
23 | CFLAGS_REMOVE_unwind.o = -pg | ||
24 | endif | ||
25 | |||
14 | obj-$(CONFIG_SMP) += smp.o | 26 | obj-$(CONFIG_SMP) += smp.o |
15 | obj-$(CONFIG_PA11) += pci-dma.o | 27 | obj-$(CONFIG_PA11) += pci-dma.o |
16 | obj-$(CONFIG_PCI) += pci.o | 28 | obj-$(CONFIG_PCI) += pci.o |
17 | obj-$(CONFIG_MODULES) += module.o | 29 | obj-$(CONFIG_MODULES) += module.o |
18 | obj-$(CONFIG_64BIT) += binfmt_elf32.o sys_parisc32.o signal32.o | 30 | obj-$(CONFIG_64BIT) += binfmt_elf32.o sys_parisc32.o signal32.o |
31 | obj-$(CONFIG_STACKTRACE)+= stacktrace.o | ||
19 | # only supported for PCX-W/U in 64-bit mode at the moment | 32 | # only supported for PCX-W/U in 64-bit mode at the moment |
20 | obj-$(CONFIG_64BIT) += perf.o perf_asm.o | 33 | obj-$(CONFIG_64BIT) += perf.o perf_asm.o |
34 | obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o | ||
35 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o | ||
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index 0db9fdcb7709..ae3e70cd1e14 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S | |||
@@ -505,6 +505,18 @@ | |||
505 | STREG \pte,0(\ptep) | 505 | STREG \pte,0(\ptep) |
506 | .endm | 506 | .endm |
507 | 507 | ||
508 | /* bitshift difference between a PFN (based on kernel's PAGE_SIZE) | ||
509 | * to a CPU TLB 4k PFN (4k => 12 bits to shift) */ | ||
510 | #define PAGE_ADD_SHIFT (PAGE_SHIFT-12) | ||
511 | |||
512 | /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ | ||
513 | .macro convert_for_tlb_insert20 pte | ||
514 | extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\ | ||
515 | 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte | ||
516 | depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\ | ||
517 | (63-58)+PAGE_ADD_SHIFT,\pte | ||
518 | .endm | ||
519 | |||
508 | /* Convert the pte and prot to tlb insertion values. How | 520 | /* Convert the pte and prot to tlb insertion values. How |
509 | * this happens is quite subtle, read below */ | 521 | * this happens is quite subtle, read below */ |
510 | .macro make_insert_tlb spc,pte,prot | 522 | .macro make_insert_tlb spc,pte,prot |
@@ -544,8 +556,7 @@ | |||
544 | depi 1,12,1,\prot | 556 | depi 1,12,1,\prot |
545 | 557 | ||
546 | /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ | 558 | /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ |
547 | extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte | 559 | convert_for_tlb_insert20 \pte |
548 | depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte | ||
549 | .endm | 560 | .endm |
550 | 561 | ||
551 | /* Identical macro to make_insert_tlb above, except it | 562 | /* Identical macro to make_insert_tlb above, except it |
@@ -563,8 +574,8 @@ | |||
563 | 574 | ||
564 | /* Get rid of prot bits and convert to page addr for iitlba */ | 575 | /* Get rid of prot bits and convert to page addr for iitlba */ |
565 | 576 | ||
566 | depi _PAGE_SIZE_ENCODING_DEFAULT,31,ASM_PFN_PTE_SHIFT,\pte | 577 | depi 0,31,ASM_PFN_PTE_SHIFT,\pte |
567 | extru \pte,24,25,\pte | 578 | SHRREG \pte,(ASM_PFN_PTE_SHIFT-(31-26)),\pte |
568 | .endm | 579 | .endm |
569 | 580 | ||
570 | /* This is for ILP32 PA2.0 only. The TLB insertion needs | 581 | /* This is for ILP32 PA2.0 only. The TLB insertion needs |
@@ -1244,10 +1255,9 @@ nadtlb_check_flush_20w: | |||
1244 | depdi,z 7,7,3,prot | 1255 | depdi,z 7,7,3,prot |
1245 | depdi 1,10,1,prot | 1256 | depdi 1,10,1,prot |
1246 | 1257 | ||
1247 | /* Get rid of prot bits and convert to page addr for idtlbt */ | 1258 | /* Drop prot bits from pte and convert to page addr for idtlbt */ |
1259 | convert_for_tlb_insert20 pte | ||
1248 | 1260 | ||
1249 | depdi 0,63,12,pte | ||
1250 | extrd,u pte,56,52,pte | ||
1251 | idtlbt pte,prot | 1261 | idtlbt pte,prot |
1252 | 1262 | ||
1253 | rfir | 1263 | rfir |
@@ -1337,8 +1347,8 @@ nadtlb_check_flush_11: | |||
1337 | 1347 | ||
1338 | /* Get rid of prot bits and convert to page addr for idtlba */ | 1348 | /* Get rid of prot bits and convert to page addr for idtlba */ |
1339 | 1349 | ||
1340 | depi 0,31,12,pte | 1350 | depi 0,31,ASM_PFN_PTE_SHIFT,pte |
1341 | extru pte,24,25,pte | 1351 | SHRREG pte,(ASM_PFN_PTE_SHIFT-(31-26)),pte |
1342 | 1352 | ||
1343 | mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */ | 1353 | mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */ |
1344 | mtsp spc,%sr1 | 1354 | mtsp spc,%sr1 |
@@ -1403,10 +1413,9 @@ nadtlb_check_flush_20: | |||
1403 | depdi,z 7,7,3,prot | 1413 | depdi,z 7,7,3,prot |
1404 | depdi 1,10,1,prot | 1414 | depdi 1,10,1,prot |
1405 | 1415 | ||
1406 | /* Get rid of prot bits and convert to page addr for idtlbt */ | 1416 | /* Drop prot bits from pte and convert to page addr for idtlbt */ |
1417 | convert_for_tlb_insert20 pte | ||
1407 | 1418 | ||
1408 | depdi 0,63,12,pte | ||
1409 | extrd,u pte,56,32,pte | ||
1410 | idtlbt pte,prot | 1419 | idtlbt pte,prot |
1411 | 1420 | ||
1412 | rfir | 1421 | rfir |
@@ -2176,6 +2185,33 @@ syscall_do_resched: | |||
2176 | ENDPROC(syscall_exit) | 2185 | ENDPROC(syscall_exit) |
2177 | 2186 | ||
2178 | 2187 | ||
2188 | #ifdef CONFIG_FUNCTION_TRACER | ||
2189 | .import ftrace_function_trampoline,code | ||
2190 | ENTRY(_mcount) | ||
2191 | copy %r3, %arg2 | ||
2192 | b ftrace_function_trampoline | ||
2193 | nop | ||
2194 | ENDPROC(_mcount) | ||
2195 | |||
2196 | ENTRY(return_to_handler) | ||
2197 | load32 return_trampoline, %rp | ||
2198 | copy %ret0, %arg0 | ||
2199 | copy %ret1, %arg1 | ||
2200 | b ftrace_return_to_handler | ||
2201 | nop | ||
2202 | return_trampoline: | ||
2203 | copy %ret0, %rp | ||
2204 | copy %r23, %ret0 | ||
2205 | copy %r24, %ret1 | ||
2206 | |||
2207 | .globl ftrace_stub | ||
2208 | ftrace_stub: | ||
2209 | bv %r0(%rp) | ||
2210 | nop | ||
2211 | ENDPROC(return_to_handler) | ||
2212 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
2213 | |||
2214 | |||
2179 | get_register: | 2215 | get_register: |
2180 | /* | 2216 | /* |
2181 | * get_register is used by the non access tlb miss handlers to | 2217 | * get_register is used by the non access tlb miss handlers to |
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index f6d241238a78..4c247e02d9b1 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c | |||
@@ -527,7 +527,11 @@ int pdc_model_capabilities(unsigned long *capabilities) | |||
527 | pdc_result[0] = 0; /* preset zero (call may not be implemented!) */ | 527 | pdc_result[0] = 0; /* preset zero (call may not be implemented!) */ |
528 | retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0); | 528 | retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0); |
529 | convert_to_wide(pdc_result); | 529 | convert_to_wide(pdc_result); |
530 | *capabilities = pdc_result[0]; | 530 | if (retval == PDC_OK) { |
531 | *capabilities = pdc_result[0]; | ||
532 | } else { | ||
533 | *capabilities = PDC_MODEL_OS32; | ||
534 | } | ||
531 | spin_unlock_irqrestore(&pdc_lock, flags); | 535 | spin_unlock_irqrestore(&pdc_lock, flags); |
532 | 536 | ||
533 | return retval; | 537 | return retval; |
diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c new file mode 100644 index 000000000000..9877372ffdba --- /dev/null +++ b/arch/parisc/kernel/ftrace.c | |||
@@ -0,0 +1,185 @@ | |||
1 | /* | ||
2 | * Code for tracing calls in Linux kernel. | ||
3 | * Copyright (C) 2009 Helge Deller <deller@gmx.de> | ||
4 | * | ||
5 | * based on code for x86 which is: | ||
6 | * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com> | ||
7 | * | ||
8 | * future possible enhancements: | ||
9 | * - add CONFIG_DYNAMIC_FTRACE | ||
10 | * - add CONFIG_STACK_TRACER | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/ftrace.h> | ||
15 | |||
16 | #include <asm/sections.h> | ||
17 | #include <asm/ftrace.h> | ||
18 | |||
19 | |||
20 | |||
21 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
22 | |||
23 | /* Add a function return address to the trace stack on thread info.*/ | ||
24 | static int push_return_trace(unsigned long ret, unsigned long long time, | ||
25 | unsigned long func, int *depth) | ||
26 | { | ||
27 | int index; | ||
28 | |||
29 | if (!current->ret_stack) | ||
30 | return -EBUSY; | ||
31 | |||
32 | /* The return trace stack is full */ | ||
33 | if (current->curr_ret_stack == FTRACE_RETFUNC_DEPTH - 1) { | ||
34 | atomic_inc(¤t->trace_overrun); | ||
35 | return -EBUSY; | ||
36 | } | ||
37 | |||
38 | index = ++current->curr_ret_stack; | ||
39 | barrier(); | ||
40 | current->ret_stack[index].ret = ret; | ||
41 | current->ret_stack[index].func = func; | ||
42 | current->ret_stack[index].calltime = time; | ||
43 | *depth = index; | ||
44 | |||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | /* Retrieve a function return address to the trace stack on thread info.*/ | ||
49 | static void pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret) | ||
50 | { | ||
51 | int index; | ||
52 | |||
53 | index = current->curr_ret_stack; | ||
54 | |||
55 | if (unlikely(index < 0)) { | ||
56 | ftrace_graph_stop(); | ||
57 | WARN_ON(1); | ||
58 | /* Might as well panic, otherwise we have no where to go */ | ||
59 | *ret = (unsigned long) | ||
60 | dereference_function_descriptor(&panic); | ||
61 | return; | ||
62 | } | ||
63 | |||
64 | *ret = current->ret_stack[index].ret; | ||
65 | trace->func = current->ret_stack[index].func; | ||
66 | trace->calltime = current->ret_stack[index].calltime; | ||
67 | trace->overrun = atomic_read(¤t->trace_overrun); | ||
68 | trace->depth = index; | ||
69 | barrier(); | ||
70 | current->curr_ret_stack--; | ||
71 | |||
72 | } | ||
73 | |||
74 | /* | ||
75 | * Send the trace to the ring-buffer. | ||
76 | * @return the original return address. | ||
77 | */ | ||
78 | unsigned long ftrace_return_to_handler(unsigned long retval0, | ||
79 | unsigned long retval1) | ||
80 | { | ||
81 | struct ftrace_graph_ret trace; | ||
82 | unsigned long ret; | ||
83 | |||
84 | pop_return_trace(&trace, &ret); | ||
85 | trace.rettime = cpu_clock(raw_smp_processor_id()); | ||
86 | ftrace_graph_return(&trace); | ||
87 | |||
88 | if (unlikely(!ret)) { | ||
89 | ftrace_graph_stop(); | ||
90 | WARN_ON(1); | ||
91 | /* Might as well panic. What else to do? */ | ||
92 | ret = (unsigned long) | ||
93 | dereference_function_descriptor(&panic); | ||
94 | } | ||
95 | |||
96 | /* HACK: we hand over the old functions' return values | ||
97 | in %r23 and %r24. Assembly in entry.S will take care | ||
98 | and move those to their final registers %ret0 and %ret1 */ | ||
99 | asm( "copy %0, %%r23 \n\t" | ||
100 | "copy %1, %%r24 \n" : : "r" (retval0), "r" (retval1) ); | ||
101 | |||
102 | return ret; | ||
103 | } | ||
104 | |||
105 | /* | ||
106 | * Hook the return address and push it in the stack of return addrs | ||
107 | * in current thread info. | ||
108 | */ | ||
109 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | ||
110 | { | ||
111 | unsigned long old; | ||
112 | unsigned long long calltime; | ||
113 | struct ftrace_graph_ent trace; | ||
114 | |||
115 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) | ||
116 | return; | ||
117 | |||
118 | old = *parent; | ||
119 | *parent = (unsigned long) | ||
120 | dereference_function_descriptor(&return_to_handler); | ||
121 | |||
122 | if (unlikely(!__kernel_text_address(old))) { | ||
123 | ftrace_graph_stop(); | ||
124 | *parent = old; | ||
125 | WARN_ON(1); | ||
126 | return; | ||
127 | } | ||
128 | |||
129 | calltime = cpu_clock(raw_smp_processor_id()); | ||
130 | |||
131 | if (push_return_trace(old, calltime, | ||
132 | self_addr, &trace.depth) == -EBUSY) { | ||
133 | *parent = old; | ||
134 | return; | ||
135 | } | ||
136 | |||
137 | trace.func = self_addr; | ||
138 | |||
139 | /* Only trace if the calling function expects to */ | ||
140 | if (!ftrace_graph_entry(&trace)) { | ||
141 | current->curr_ret_stack--; | ||
142 | *parent = old; | ||
143 | } | ||
144 | } | ||
145 | |||
146 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | ||
147 | |||
148 | |||
149 | void ftrace_function_trampoline(unsigned long parent, | ||
150 | unsigned long self_addr, | ||
151 | unsigned long org_sp_gr3) | ||
152 | { | ||
153 | extern ftrace_func_t ftrace_trace_function; | ||
154 | |||
155 | if (function_trace_stop) | ||
156 | return; | ||
157 | |||
158 | if (ftrace_trace_function != ftrace_stub) { | ||
159 | ftrace_trace_function(parent, self_addr); | ||
160 | return; | ||
161 | } | ||
162 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
163 | if (ftrace_graph_entry && ftrace_graph_return) { | ||
164 | unsigned long sp; | ||
165 | unsigned long *parent_rp; | ||
166 | |||
167 | asm volatile ("copy %%r30, %0" : "=r"(sp)); | ||
168 | /* sanity check: is stack pointer which we got from | ||
169 | assembler function in entry.S in a reasonable | ||
170 | range compared to current stack pointer? */ | ||
171 | if ((sp - org_sp_gr3) > 0x400) | ||
172 | return; | ||
173 | |||
174 | /* calculate pointer to %rp in stack */ | ||
175 | parent_rp = (unsigned long *) org_sp_gr3 - 0x10; | ||
176 | /* sanity check: parent_rp should hold parent */ | ||
177 | if (*parent_rp != parent) | ||
178 | return; | ||
179 | |||
180 | prepare_ftrace_return(parent_rp, self_addr); | ||
181 | return; | ||
182 | } | ||
183 | #endif | ||
184 | } | ||
185 | |||
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 1c740f5cbd63..4ea4229d765c 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c | |||
@@ -311,12 +311,12 @@ unsigned long txn_alloc_addr(unsigned int virt_irq) | |||
311 | next_cpu++; /* assign to "next" CPU we want this bugger on */ | 311 | next_cpu++; /* assign to "next" CPU we want this bugger on */ |
312 | 312 | ||
313 | /* validate entry */ | 313 | /* validate entry */ |
314 | while ((next_cpu < NR_CPUS) && | 314 | while ((next_cpu < nr_cpu_ids) && |
315 | (!per_cpu(cpu_data, next_cpu).txn_addr || | 315 | (!per_cpu(cpu_data, next_cpu).txn_addr || |
316 | !cpu_online(next_cpu))) | 316 | !cpu_online(next_cpu))) |
317 | next_cpu++; | 317 | next_cpu++; |
318 | 318 | ||
319 | if (next_cpu >= NR_CPUS) | 319 | if (next_cpu >= nr_cpu_ids) |
320 | next_cpu = 0; /* nothing else, assign monarch */ | 320 | next_cpu = 0; /* nothing else, assign monarch */ |
321 | 321 | ||
322 | return txn_affinity_addr(virt_irq, next_cpu); | 322 | return txn_affinity_addr(virt_irq, next_cpu); |
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index 9013243cecca..ecd1c5024447 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -61,9 +61,7 @@ | |||
61 | #include <linux/string.h> | 61 | #include <linux/string.h> |
62 | #include <linux/kernel.h> | 62 | #include <linux/kernel.h> |
63 | #include <linux/bug.h> | 63 | #include <linux/bug.h> |
64 | #include <linux/uaccess.h> | ||
65 | 64 | ||
66 | #include <asm/sections.h> | ||
67 | #include <asm/unwind.h> | 65 | #include <asm/unwind.h> |
68 | 66 | ||
69 | #if 0 | 67 | #if 0 |
@@ -115,8 +113,6 @@ struct got_entry { | |||
115 | Elf32_Addr addr; | 113 | Elf32_Addr addr; |
116 | }; | 114 | }; |
117 | 115 | ||
118 | #define Elf_Fdesc Elf32_Fdesc | ||
119 | |||
120 | struct stub_entry { | 116 | struct stub_entry { |
121 | Elf32_Word insns[2]; /* each stub entry has two insns */ | 117 | Elf32_Word insns[2]; /* each stub entry has two insns */ |
122 | }; | 118 | }; |
@@ -125,8 +121,6 @@ struct got_entry { | |||
125 | Elf64_Addr addr; | 121 | Elf64_Addr addr; |
126 | }; | 122 | }; |
127 | 123 | ||
128 | #define Elf_Fdesc Elf64_Fdesc | ||
129 | |||
130 | struct stub_entry { | 124 | struct stub_entry { |
131 | Elf64_Word insns[4]; /* each stub entry has four insns */ | 125 | Elf64_Word insns[4]; /* each stub entry has four insns */ |
132 | }; | 126 | }; |
@@ -916,15 +910,3 @@ void module_arch_cleanup(struct module *mod) | |||
916 | deregister_unwind_table(mod); | 910 | deregister_unwind_table(mod); |
917 | module_bug_cleanup(mod); | 911 | module_bug_cleanup(mod); |
918 | } | 912 | } |
919 | |||
920 | #ifdef CONFIG_64BIT | ||
921 | void *dereference_function_descriptor(void *ptr) | ||
922 | { | ||
923 | Elf64_Fdesc *desc = ptr; | ||
924 | void *p; | ||
925 | |||
926 | if (!probe_kernel_address(&desc->addr, p)) | ||
927 | ptr = p; | ||
928 | return ptr; | ||
929 | } | ||
930 | #endif | ||
diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c index 0eecfbbc59cd..df653663d3db 100644 --- a/arch/parisc/kernel/parisc_ksyms.c +++ b/arch/parisc/kernel/parisc_ksyms.c | |||
@@ -153,5 +153,10 @@ EXPORT_SYMBOL(node_data); | |||
153 | EXPORT_SYMBOL(pfnnid_map); | 153 | EXPORT_SYMBOL(pfnnid_map); |
154 | #endif | 154 | #endif |
155 | 155 | ||
156 | #ifdef CONFIG_FUNCTION_TRACER | ||
157 | extern void _mcount(void); | ||
158 | EXPORT_SYMBOL(_mcount); | ||
159 | #endif | ||
160 | |||
156 | /* from pacache.S -- needed for copy_page */ | 161 | /* from pacache.S -- needed for copy_page */ |
157 | EXPORT_SYMBOL(copy_user_page_asm); | 162 | EXPORT_SYMBOL(copy_user_page_asm); |
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index b80e02a4d81d..6f69101f90bb 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c | |||
@@ -46,14 +46,15 @@ | |||
46 | #include <linux/stddef.h> | 46 | #include <linux/stddef.h> |
47 | #include <linux/unistd.h> | 47 | #include <linux/unistd.h> |
48 | #include <linux/kallsyms.h> | 48 | #include <linux/kallsyms.h> |
49 | #include <linux/uaccess.h> | ||
49 | 50 | ||
50 | #include <asm/io.h> | 51 | #include <asm/io.h> |
51 | #include <asm/asm-offsets.h> | 52 | #include <asm/asm-offsets.h> |
52 | #include <asm/pdc.h> | 53 | #include <asm/pdc.h> |
53 | #include <asm/pdc_chassis.h> | 54 | #include <asm/pdc_chassis.h> |
54 | #include <asm/pgalloc.h> | 55 | #include <asm/pgalloc.h> |
55 | #include <asm/uaccess.h> | ||
56 | #include <asm/unwind.h> | 56 | #include <asm/unwind.h> |
57 | #include <asm/sections.h> | ||
57 | 58 | ||
58 | /* | 59 | /* |
59 | * The idle thread. There's no useful work to be | 60 | * The idle thread. There's no useful work to be |
@@ -231,8 +232,8 @@ sys_clone(unsigned long clone_flags, unsigned long usp, | |||
231 | 232 | ||
232 | However, these last 3 args are only examined | 233 | However, these last 3 args are only examined |
233 | if the proper flags are set. */ | 234 | if the proper flags are set. */ |
234 | int __user *child_tidptr; | 235 | int __user *parent_tidptr = (int __user *)regs->gr[24]; |
235 | int __user *parent_tidptr; | 236 | int __user *child_tidptr = (int __user *)regs->gr[22]; |
236 | 237 | ||
237 | /* usp must be word aligned. This also prevents users from | 238 | /* usp must be word aligned. This also prevents users from |
238 | * passing in the value 1 (which is the signal for a special | 239 | * passing in the value 1 (which is the signal for a special |
@@ -243,16 +244,6 @@ sys_clone(unsigned long clone_flags, unsigned long usp, | |||
243 | if (usp == 0) | 244 | if (usp == 0) |
244 | usp = regs->gr[30]; | 245 | usp = regs->gr[30]; |
245 | 246 | ||
246 | if (clone_flags & CLONE_PARENT_SETTID) | ||
247 | parent_tidptr = (int __user *)regs->gr[24]; | ||
248 | else | ||
249 | parent_tidptr = NULL; | ||
250 | |||
251 | if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) | ||
252 | child_tidptr = (int __user *)regs->gr[22]; | ||
253 | else | ||
254 | child_tidptr = NULL; | ||
255 | |||
256 | return do_fork(clone_flags, usp, regs, 0, parent_tidptr, child_tidptr); | 247 | return do_fork(clone_flags, usp, regs, 0, parent_tidptr, child_tidptr); |
257 | } | 248 | } |
258 | 249 | ||
@@ -263,7 +254,7 @@ sys_vfork(struct pt_regs *regs) | |||
263 | } | 254 | } |
264 | 255 | ||
265 | int | 256 | int |
266 | copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 257 | copy_thread(unsigned long clone_flags, unsigned long usp, |
267 | unsigned long unused, /* in ia64 this is "user_stack_size" */ | 258 | unsigned long unused, /* in ia64 this is "user_stack_size" */ |
268 | struct task_struct * p, struct pt_regs * pregs) | 259 | struct task_struct * p, struct pt_regs * pregs) |
269 | { | 260 | { |
@@ -400,3 +391,15 @@ get_wchan(struct task_struct *p) | |||
400 | } while (count++ < 16); | 391 | } while (count++ < 16); |
401 | return 0; | 392 | return 0; |
402 | } | 393 | } |
394 | |||
395 | #ifdef CONFIG_64BIT | ||
396 | void *dereference_function_descriptor(void *ptr) | ||
397 | { | ||
398 | Elf64_Fdesc *desc = ptr; | ||
399 | void *p; | ||
400 | |||
401 | if (!probe_kernel_address(&desc->addr, p)) | ||
402 | ptr = p; | ||
403 | return ptr; | ||
404 | } | ||
405 | #endif | ||
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index ecb609342feb..e09d0f7fb6b0 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c | |||
@@ -100,8 +100,8 @@ static int __cpuinit processor_probe(struct parisc_device *dev) | |||
100 | struct cpuinfo_parisc *p; | 100 | struct cpuinfo_parisc *p; |
101 | 101 | ||
102 | #ifdef CONFIG_SMP | 102 | #ifdef CONFIG_SMP |
103 | if (num_online_cpus() >= NR_CPUS) { | 103 | if (num_online_cpus() >= nr_cpu_ids) { |
104 | printk(KERN_INFO "num_online_cpus() >= NR_CPUS\n"); | 104 | printk(KERN_INFO "num_online_cpus() >= nr_cpu_ids\n"); |
105 | return 1; | 105 | return 1; |
106 | } | 106 | } |
107 | #else | 107 | #else |
@@ -214,7 +214,7 @@ static int __cpuinit processor_probe(struct parisc_device *dev) | |||
214 | */ | 214 | */ |
215 | #ifdef CONFIG_SMP | 215 | #ifdef CONFIG_SMP |
216 | if (cpuid) { | 216 | if (cpuid) { |
217 | cpu_set(cpuid, cpu_present_map); | 217 | set_cpu_present(cpuid, true); |
218 | cpu_up(cpuid); | 218 | cpu_up(cpuid); |
219 | } | 219 | } |
220 | #endif | 220 | #endif |
@@ -364,6 +364,13 @@ show_cpuinfo (struct seq_file *m, void *v) | |||
364 | boot_cpu_data.cpu_hz / 1000000, | 364 | boot_cpu_data.cpu_hz / 1000000, |
365 | boot_cpu_data.cpu_hz % 1000000 ); | 365 | boot_cpu_data.cpu_hz % 1000000 ); |
366 | 366 | ||
367 | seq_printf(m, "capabilities\t:"); | ||
368 | if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS32) | ||
369 | seq_printf(m, " os32"); | ||
370 | if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS64) | ||
371 | seq_printf(m, " os64"); | ||
372 | seq_printf(m, "\n"); | ||
373 | |||
367 | seq_printf(m, "model\t\t: %s\n" | 374 | seq_printf(m, "model\t\t: %s\n" |
368 | "model name\t: %s\n", | 375 | "model name\t: %s\n", |
369 | boot_cpu_data.pdc.sys_model_name, | 376 | boot_cpu_data.pdc.sys_model_name, |
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 9995d7ed5819..1fd0f0cec037 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/err.h> | 31 | #include <linux/err.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/bitops.h> | 33 | #include <linux/bitops.h> |
34 | #include <linux/ftrace.h> | ||
34 | 35 | ||
35 | #include <asm/system.h> | 36 | #include <asm/system.h> |
36 | #include <asm/atomic.h> | 37 | #include <asm/atomic.h> |
@@ -113,14 +114,14 @@ halt_processor(void) | |||
113 | { | 114 | { |
114 | /* REVISIT : redirect I/O Interrupts to another CPU? */ | 115 | /* REVISIT : redirect I/O Interrupts to another CPU? */ |
115 | /* REVISIT : does PM *know* this CPU isn't available? */ | 116 | /* REVISIT : does PM *know* this CPU isn't available? */ |
116 | cpu_clear(smp_processor_id(), cpu_online_map); | 117 | set_cpu_online(smp_processor_id(), false); |
117 | local_irq_disable(); | 118 | local_irq_disable(); |
118 | for (;;) | 119 | for (;;) |
119 | ; | 120 | ; |
120 | } | 121 | } |
121 | 122 | ||
122 | 123 | ||
123 | irqreturn_t | 124 | irqreturn_t __irq_entry |
124 | ipi_interrupt(int irq, void *dev_id) | 125 | ipi_interrupt(int irq, void *dev_id) |
125 | { | 126 | { |
126 | int this_cpu = smp_processor_id(); | 127 | int this_cpu = smp_processor_id(); |
@@ -214,11 +215,11 @@ ipi_send(int cpu, enum ipi_message_type op) | |||
214 | } | 215 | } |
215 | 216 | ||
216 | static void | 217 | static void |
217 | send_IPI_mask(cpumask_t mask, enum ipi_message_type op) | 218 | send_IPI_mask(const struct cpumask *mask, enum ipi_message_type op) |
218 | { | 219 | { |
219 | int cpu; | 220 | int cpu; |
220 | 221 | ||
221 | for_each_cpu_mask(cpu, mask) | 222 | for_each_cpu(cpu, mask) |
222 | ipi_send(cpu, op); | 223 | ipi_send(cpu, op); |
223 | } | 224 | } |
224 | 225 | ||
@@ -257,7 +258,7 @@ smp_send_all_nop(void) | |||
257 | send_IPI_allbutself(IPI_NOP); | 258 | send_IPI_allbutself(IPI_NOP); |
258 | } | 259 | } |
259 | 260 | ||
260 | void arch_send_call_function_ipi(cpumask_t mask) | 261 | void arch_send_call_function_ipi_mask(const struct cpumask *mask) |
261 | { | 262 | { |
262 | send_IPI_mask(mask, IPI_CALL_FUNC); | 263 | send_IPI_mask(mask, IPI_CALL_FUNC); |
263 | } | 264 | } |
@@ -296,13 +297,14 @@ smp_cpu_init(int cpunum) | |||
296 | mb(); | 297 | mb(); |
297 | 298 | ||
298 | /* Well, support 2.4 linux scheme as well. */ | 299 | /* Well, support 2.4 linux scheme as well. */ |
299 | if (cpu_test_and_set(cpunum, cpu_online_map)) | 300 | if (cpu_isset(cpunum, cpu_online_map)) |
300 | { | 301 | { |
301 | extern void machine_halt(void); /* arch/parisc.../process.c */ | 302 | extern void machine_halt(void); /* arch/parisc.../process.c */ |
302 | 303 | ||
303 | printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum); | 304 | printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum); |
304 | machine_halt(); | 305 | machine_halt(); |
305 | } | 306 | } |
307 | set_cpu_online(cpunum, true); | ||
306 | 308 | ||
307 | /* Initialise the idle task for this CPU */ | 309 | /* Initialise the idle task for this CPU */ |
308 | atomic_inc(&init_mm.mm_count); | 310 | atomic_inc(&init_mm.mm_count); |
@@ -424,8 +426,8 @@ void __init smp_prepare_boot_cpu(void) | |||
424 | /* Setup BSP mappings */ | 426 | /* Setup BSP mappings */ |
425 | printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor); | 427 | printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor); |
426 | 428 | ||
427 | cpu_set(bootstrap_processor, cpu_online_map); | 429 | set_cpu_online(bootstrap_processor, true); |
428 | cpu_set(bootstrap_processor, cpu_present_map); | 430 | set_cpu_present(bootstrap_processor, true); |
429 | } | 431 | } |
430 | 432 | ||
431 | 433 | ||
@@ -436,8 +438,7 @@ void __init smp_prepare_boot_cpu(void) | |||
436 | */ | 438 | */ |
437 | void __init smp_prepare_cpus(unsigned int max_cpus) | 439 | void __init smp_prepare_cpus(unsigned int max_cpus) |
438 | { | 440 | { |
439 | cpus_clear(cpu_present_map); | 441 | init_cpu_present(cpumask_of(0)); |
440 | cpu_set(0, cpu_present_map); | ||
441 | 442 | ||
442 | parisc_max_cpus = max_cpus; | 443 | parisc_max_cpus = max_cpus; |
443 | if (!max_cpus) | 444 | if (!max_cpus) |
diff --git a/arch/parisc/kernel/stacktrace.c b/arch/parisc/kernel/stacktrace.c new file mode 100644 index 000000000000..2fe914c5f533 --- /dev/null +++ b/arch/parisc/kernel/stacktrace.c | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * Stack trace management functions | ||
3 | * | ||
4 | * Copyright (C) 2009 Helge Deller <deller@gmx.de> | ||
5 | * based on arch/x86/kernel/stacktrace.c by Ingo Molnar <mingo@redhat.com> | ||
6 | * and parisc unwind functions by Randolph Chung <tausq@debian.org> | ||
7 | * | ||
8 | * TODO: Userspace stacktrace (CONFIG_USER_STACKTRACE_SUPPORT) | ||
9 | */ | ||
10 | #include <linux/module.h> | ||
11 | #include <linux/stacktrace.h> | ||
12 | |||
13 | #include <asm/unwind.h> | ||
14 | |||
15 | static void dump_trace(struct task_struct *task, struct stack_trace *trace) | ||
16 | { | ||
17 | struct unwind_frame_info info; | ||
18 | |||
19 | /* initialize unwind info */ | ||
20 | if (task == current) { | ||
21 | unsigned long sp; | ||
22 | struct pt_regs r; | ||
23 | HERE: | ||
24 | asm volatile ("copy %%r30, %0" : "=r"(sp)); | ||
25 | memset(&r, 0, sizeof(struct pt_regs)); | ||
26 | r.iaoq[0] = (unsigned long)&&HERE; | ||
27 | r.gr[2] = (unsigned long)__builtin_return_address(0); | ||
28 | r.gr[30] = sp; | ||
29 | unwind_frame_init(&info, task, &r); | ||
30 | } else { | ||
31 | unwind_frame_init_from_blocked_task(&info, task); | ||
32 | } | ||
33 | |||
34 | /* unwind stack and save entries in stack_trace struct */ | ||
35 | trace->nr_entries = 0; | ||
36 | while (trace->nr_entries < trace->max_entries) { | ||
37 | if (unwind_once(&info) < 0 || info.ip == 0) | ||
38 | break; | ||
39 | |||
40 | if (__kernel_text_address(info.ip)) | ||
41 | trace->entries[trace->nr_entries++] = info.ip; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | |||
46 | /* | ||
47 | * Save stack-backtrace addresses into a stack_trace buffer. | ||
48 | */ | ||
49 | void save_stack_trace(struct stack_trace *trace) | ||
50 | { | ||
51 | dump_trace(current, trace); | ||
52 | if (trace->nr_entries < trace->max_entries) | ||
53 | trace->entries[trace->nr_entries++] = ULONG_MAX; | ||
54 | } | ||
55 | EXPORT_SYMBOL_GPL(save_stack_trace); | ||
56 | |||
57 | void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) | ||
58 | { | ||
59 | dump_trace(tsk, trace); | ||
60 | if (trace->nr_entries < trace->max_entries) | ||
61 | trace->entries[trace->nr_entries++] = ULONG_MAX; | ||
62 | } | ||
63 | EXPORT_SYMBOL_GPL(save_stack_trace_tsk); | ||
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 69b6eebc466e..59fc1a43ec3e 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S | |||
@@ -365,17 +365,51 @@ tracesys_sigexit: | |||
365 | 365 | ||
366 | 366 | ||
367 | /********************************************************* | 367 | /********************************************************* |
368 | Light-weight-syscall code | 368 | 32/64-bit Light-Weight-Syscall ABI |
369 | 369 | ||
370 | r20 - lws number | 370 | * - Indicates a hint for userspace inline asm |
371 | r26,r25,r24,r23,r22 - Input registers | 371 | implementations. |
372 | r28 - Function return register | ||
373 | r21 - Error code. | ||
374 | 372 | ||
375 | Scracth: Any of the above that aren't being | 373 | Syscall number (caller-saves) |
376 | currently used, including r1. | 374 | - %r20 |
375 | * In asm clobber. | ||
377 | 376 | ||
378 | Return pointer: r31 (Not usable) | 377 | Argument registers (caller-saves) |
378 | - %r26, %r25, %r24, %r23, %r22 | ||
379 | * In asm input. | ||
380 | |||
381 | Return registers (caller-saves) | ||
382 | - %r28 (return), %r21 (errno) | ||
383 | * In asm output. | ||
384 | |||
385 | Caller-saves registers | ||
386 | - %r1, %r27, %r29 | ||
387 | - %r2 (return pointer) | ||
388 | - %r31 (ble link register) | ||
389 | * In asm clobber. | ||
390 | |||
391 | Callee-saves registers | ||
392 | - %r3-%r18 | ||
393 | - %r30 (stack pointer) | ||
394 | * Not in asm clobber. | ||
395 | |||
396 | If userspace is 32-bit: | ||
397 | Callee-saves registers | ||
398 | - %r19 (32-bit PIC register) | ||
399 | |||
400 | Differences from 32-bit calling convention: | ||
401 | - Syscall number in %r20 | ||
402 | - Additional argument register %r22 (arg4) | ||
403 | - Callee-saves %r19. | ||
404 | |||
405 | If userspace is 64-bit: | ||
406 | Callee-saves registers | ||
407 | - %r27 (64-bit PIC register) | ||
408 | |||
409 | Differences from 64-bit calling convention: | ||
410 | - Syscall number in %r20 | ||
411 | - Additional argument register %r22 (arg4) | ||
412 | - Callee-saves %r27. | ||
379 | 413 | ||
380 | Error codes returned by entry path: | 414 | Error codes returned by entry path: |
381 | 415 | ||
@@ -473,7 +507,8 @@ lws_compare_and_swap64: | |||
473 | b,n lws_compare_and_swap | 507 | b,n lws_compare_and_swap |
474 | #else | 508 | #else |
475 | /* If we are not a 64-bit kernel, then we don't | 509 | /* If we are not a 64-bit kernel, then we don't |
476 | * implement having 64-bit input registers | 510 | * have 64-bit input registers, and calling |
511 | * the 64-bit LWS CAS returns ENOSYS. | ||
477 | */ | 512 | */ |
478 | b,n lws_exit_nosys | 513 | b,n lws_exit_nosys |
479 | #endif | 514 | #endif |
@@ -635,12 +670,15 @@ END(sys_call_table64) | |||
635 | /* | 670 | /* |
636 | All light-weight-syscall atomic operations | 671 | All light-weight-syscall atomic operations |
637 | will use this set of locks | 672 | will use this set of locks |
673 | |||
674 | NOTE: The lws_lock_start symbol must be | ||
675 | at least 16-byte aligned for safe use | ||
676 | with ldcw. | ||
638 | */ | 677 | */ |
639 | .section .data | 678 | .section .data |
640 | .align PAGE_SIZE | 679 | .align PAGE_SIZE |
641 | ENTRY(lws_lock_start) | 680 | ENTRY(lws_lock_start) |
642 | /* lws locks */ | 681 | /* lws locks */ |
643 | .align 16 | ||
644 | .rept 16 | 682 | .rept 16 |
645 | /* Keep locks aligned at 16-bytes */ | 683 | /* Keep locks aligned at 16-bytes */ |
646 | .word 1 | 684 | .word 1 |
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index e75cae6072c5..d4dd05674c62 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/profile.h> | 24 | #include <linux/profile.h> |
25 | #include <linux/clocksource.h> | 25 | #include <linux/clocksource.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/ftrace.h> | ||
27 | 28 | ||
28 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
29 | #include <asm/io.h> | 30 | #include <asm/io.h> |
@@ -53,7 +54,7 @@ static unsigned long clocktick __read_mostly; /* timer cycles per tick */ | |||
53 | * held off for an arbitrarily long period of time by interrupts being | 54 | * held off for an arbitrarily long period of time by interrupts being |
54 | * disabled, so we may miss one or more ticks. | 55 | * disabled, so we may miss one or more ticks. |
55 | */ | 56 | */ |
56 | irqreturn_t timer_interrupt(int irq, void *dev_id) | 57 | irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id) |
57 | { | 58 | { |
58 | unsigned long now; | 59 | unsigned long now; |
59 | unsigned long next_tick; | 60 | unsigned long next_tick; |
@@ -216,14 +217,14 @@ void __init start_cpu_itimer(void) | |||
216 | per_cpu(cpu_data, cpu).it_value = next_tick; | 217 | per_cpu(cpu_data, cpu).it_value = next_tick; |
217 | } | 218 | } |
218 | 219 | ||
219 | static struct platform_device rtc_parisc_dev = { | 220 | static struct platform_device rtc_generic_dev = { |
220 | .name = "rtc-parisc", | 221 | .name = "rtc-generic", |
221 | .id = -1, | 222 | .id = -1, |
222 | }; | 223 | }; |
223 | 224 | ||
224 | static int __init rtc_init(void) | 225 | static int __init rtc_init(void) |
225 | { | 226 | { |
226 | if (platform_device_register(&rtc_parisc_dev) < 0) | 227 | if (platform_device_register(&rtc_generic_dev) < 0) |
227 | printk(KERN_ERR "unable to register rtc device...\n"); | 228 | printk(KERN_ERR "unable to register rtc device...\n"); |
228 | 229 | ||
229 | /* not necessarily an error */ | 230 | /* not necessarily an error */ |
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index ba658d2086f7..c32f5d6d778e 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
@@ -247,6 +247,8 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err) | |||
247 | 247 | ||
248 | oops_in_progress = 1; | 248 | oops_in_progress = 1; |
249 | 249 | ||
250 | oops_enter(); | ||
251 | |||
250 | /* Amuse the user in a SPARC fashion */ | 252 | /* Amuse the user in a SPARC fashion */ |
251 | if (err) printk( | 253 | if (err) printk( |
252 | KERN_CRIT " _______________________________ \n" | 254 | KERN_CRIT " _______________________________ \n" |
@@ -293,6 +295,7 @@ KERN_CRIT " || ||\n"); | |||
293 | panic("Fatal exception"); | 295 | panic("Fatal exception"); |
294 | } | 296 | } |
295 | 297 | ||
298 | oops_exit(); | ||
296 | do_exit(SIGSEGV); | 299 | do_exit(SIGSEGV); |
297 | } | 300 | } |
298 | 301 | ||
@@ -494,7 +497,7 @@ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long o | |||
494 | panic(msg); | 497 | panic(msg); |
495 | } | 498 | } |
496 | 499 | ||
497 | void handle_interruption(int code, struct pt_regs *regs) | 500 | void notrace handle_interruption(int code, struct pt_regs *regs) |
498 | { | 501 | { |
499 | unsigned long fault_address = 0; | 502 | unsigned long fault_address = 0; |
500 | unsigned long fault_space = 0; | 503 | unsigned long fault_space = 0; |
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index 1a3b6ccd3620..fd2cc4fd2b65 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S | |||
@@ -54,6 +54,8 @@ SECTIONS | |||
54 | TEXT_TEXT | 54 | TEXT_TEXT |
55 | SCHED_TEXT | 55 | SCHED_TEXT |
56 | LOCK_TEXT | 56 | LOCK_TEXT |
57 | KPROBES_TEXT | ||
58 | IRQENTRY_TEXT | ||
57 | *(.text.do_softirq) | 59 | *(.text.do_softirq) |
58 | *(.text.sys_exit) | 60 | *(.text.sys_exit) |
59 | *(.text.do_sigaltstack) | 61 | *(.text.do_sigaltstack) |
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 9d704d9831d1..4356ceb1e366 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c | |||
@@ -456,6 +456,13 @@ void __init mem_init(void) | |||
456 | { | 456 | { |
457 | int codesize, reservedpages, datasize, initsize; | 457 | int codesize, reservedpages, datasize, initsize; |
458 | 458 | ||
459 | /* Do sanity checks on page table constants */ | ||
460 | BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t)); | ||
461 | BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t)); | ||
462 | BUILD_BUG_ON(PGD_ENTRY_SIZE != sizeof(pgd_t)); | ||
463 | BUILD_BUG_ON(PAGE_SHIFT + BITS_PER_PTE + BITS_PER_PMD + BITS_PER_PGD | ||
464 | > BITS_PER_LONG); | ||
465 | |||
459 | high_memory = __va((max_pfn << PAGE_SHIFT)); | 466 | high_memory = __va((max_pfn << PAGE_SHIFT)); |
460 | 467 | ||
461 | #ifndef CONFIG_DISCONTIGMEM | 468 | #ifndef CONFIG_DISCONTIGMEM |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 45192dce65c4..9e08d8a69fdf 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -346,7 +346,7 @@ config PHYP_DUMP | |||
346 | help | 346 | help |
347 | Hypervisor-assisted dump is meant to be a kdump replacement | 347 | Hypervisor-assisted dump is meant to be a kdump replacement |
348 | offering robustness and speed not possible without system | 348 | offering robustness and speed not possible without system |
349 | hypervisor assistence. | 349 | hypervisor assistance. |
350 | 350 | ||
351 | If unsure, say "N" | 351 | If unsure, say "N" |
352 | 352 | ||
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index 6aa0b5e087cd..a1098e23221f 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug | |||
@@ -27,16 +27,6 @@ config DEBUG_STACK_USAGE | |||
27 | 27 | ||
28 | This option will slow down process creation somewhat. | 28 | This option will slow down process creation somewhat. |
29 | 29 | ||
30 | config DEBUG_PAGEALLOC | ||
31 | bool "Debug page memory allocations" | ||
32 | depends on DEBUG_KERNEL && !HIBERNATION | ||
33 | depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC | ||
34 | help | ||
35 | Unmap pages from the kernel linear mapping after free_pages(). | ||
36 | This results in a large slowdown, but helps to find certain types | ||
37 | of memory corruptions. | ||
38 | |||
39 | |||
40 | config HCALL_STATS | 30 | config HCALL_STATS |
41 | bool "Hypervisor call instrumentation" | 31 | bool "Hypervisor call instrumentation" |
42 | depends on PPC_PSERIES && DEBUG_FS | 32 | depends on PPC_PSERIES && DEBUG_FS |
diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h index 19f299b7e256..35acac90c8ca 100644 --- a/arch/powerpc/include/asm/mmzone.h +++ b/arch/powerpc/include/asm/mmzone.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #define _ASM_MMZONE_H_ | 8 | #define _ASM_MMZONE_H_ |
9 | #ifdef __KERNEL__ | 9 | #ifdef __KERNEL__ |
10 | 10 | ||
11 | #include <linux/cpumask.h> | ||
11 | 12 | ||
12 | /* | 13 | /* |
13 | * generic non-linear memory support: | 14 | * generic non-linear memory support: |
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h index 67f1812698d2..cdb6fd814de8 100644 --- a/arch/powerpc/include/asm/ps3.h +++ b/arch/powerpc/include/asm/ps3.h | |||
@@ -50,6 +50,9 @@ enum ps3_param_av_multi_out { | |||
50 | 50 | ||
51 | enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void); | 51 | enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void); |
52 | 52 | ||
53 | extern u64 ps3_os_area_get_rtc_diff(void); | ||
54 | extern void ps3_os_area_set_rtc_diff(u64 rtc_diff); | ||
55 | |||
53 | /* dma routines */ | 56 | /* dma routines */ |
54 | 57 | ||
55 | enum ps3_dma_page_size { | 58 | enum ps3_dma_page_size { |
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h index 36864364e601..c3b193121f81 100644 --- a/arch/powerpc/include/asm/spinlock.h +++ b/arch/powerpc/include/asm/spinlock.h | |||
@@ -287,6 +287,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
287 | rw->lock = 0; | 287 | rw->lock = 0; |
288 | } | 288 | } |
289 | 289 | ||
290 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
291 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
292 | |||
290 | #define _raw_spin_relax(lock) __spin_yield(lock) | 293 | #define _raw_spin_relax(lock) __spin_yield(lock) |
291 | #define _raw_read_relax(lock) __rw_yield(lock) | 294 | #define _raw_read_relax(lock) __rw_yield(lock) |
292 | #define _raw_write_relax(lock) __rw_yield(lock) | 295 | #define _raw_write_relax(lock) __rw_yield(lock) |
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 5b5d16b2cac8..5455943f16aa 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
@@ -557,7 +557,6 @@ extern void mod_return_to_handler(void); | |||
557 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | 557 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) |
558 | { | 558 | { |
559 | unsigned long old; | 559 | unsigned long old; |
560 | unsigned long long calltime; | ||
561 | int faulted; | 560 | int faulted; |
562 | struct ftrace_graph_ent trace; | 561 | struct ftrace_graph_ent trace; |
563 | unsigned long return_hooker = (unsigned long)&return_to_handler; | 562 | unsigned long return_hooker = (unsigned long)&return_to_handler; |
@@ -606,10 +605,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
606 | return; | 605 | return; |
607 | } | 606 | } |
608 | 607 | ||
609 | calltime = cpu_clock(raw_smp_processor_id()); | 608 | if (ftrace_push_return_trace(old, self_addr, &trace.depth) == -EBUSY) { |
610 | |||
611 | if (ftrace_push_return_trace(old, calltime, | ||
612 | self_addr, &trace.depth) == -EBUSY) { | ||
613 | *parent = old; | 609 | *parent = old; |
614 | return; | 610 | return; |
615 | } | 611 | } |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index eac064948780..7b44a33f03c2 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -598,7 +598,7 @@ void prepare_to_copy(struct task_struct *tsk) | |||
598 | /* | 598 | /* |
599 | * Copy a thread.. | 599 | * Copy a thread.. |
600 | */ | 600 | */ |
601 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 601 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
602 | unsigned long unused, struct task_struct *p, | 602 | unsigned long unused, struct task_struct *p, |
603 | struct pt_regs *regs) | 603 | struct pt_regs *regs) |
604 | { | 604 | { |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index c9564031a2a9..926ea864e34f 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -1127,3 +1127,19 @@ void div128_by_32(u64 dividend_high, u64 dividend_low, | |||
1127 | dr->result_low = ((u64)y << 32) + z; | 1127 | dr->result_low = ((u64)y << 32) + z; |
1128 | 1128 | ||
1129 | } | 1129 | } |
1130 | |||
1131 | static int __init rtc_init(void) | ||
1132 | { | ||
1133 | struct platform_device *pdev; | ||
1134 | |||
1135 | if (!ppc_md.get_rtc_time) | ||
1136 | return -ENODEV; | ||
1137 | |||
1138 | pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0); | ||
1139 | if (IS_ERR(pdev)) | ||
1140 | return PTR_ERR(pdev); | ||
1141 | |||
1142 | return 0; | ||
1143 | } | ||
1144 | |||
1145 | module_init(rtc_init); | ||
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index d3694498f3af..819e59f6f7c7 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -482,7 +482,7 @@ static void vio_cmo_balance(struct work_struct *work) | |||
482 | cmo->excess.size = cmo->entitled - cmo->reserve.size; | 482 | cmo->excess.size = cmo->entitled - cmo->reserve.size; |
483 | cmo->excess.free = cmo->excess.size - need; | 483 | cmo->excess.free = cmo->excess.size - need; |
484 | 484 | ||
485 | cancel_delayed_work(container_of(work, struct delayed_work, work)); | 485 | cancel_delayed_work(to_delayed_work(work)); |
486 | spin_unlock_irqrestore(&vio_cmo.lock, flags); | 486 | spin_unlock_irqrestore(&vio_cmo.lock, flags); |
487 | } | 487 | } |
488 | 488 | ||
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index ffa2a9fd53d0..e3e87078d03f 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig | |||
@@ -293,7 +293,7 @@ config CPM | |||
293 | config OF_RTC | 293 | config OF_RTC |
294 | bool | 294 | bool |
295 | help | 295 | help |
296 | Uses information from the OF or flattened device tree to instatiate | 296 | Uses information from the OF or flattened device tree to instantiate |
297 | platform devices for direct mapped RTC chips like the DS1742 or DS1743. | 297 | platform devices for direct mapped RTC chips like the DS1742 or DS1743. |
298 | 298 | ||
299 | source "arch/powerpc/sysdev/bestcomm/Kconfig" | 299 | source "arch/powerpc/sysdev/bestcomm/Kconfig" |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 64f068540d0d..706eb5c7e2ee 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -635,7 +635,7 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode, | |||
635 | if (dentry->d_inode) | 635 | if (dentry->d_inode) |
636 | goto out_dput; | 636 | goto out_dput; |
637 | 637 | ||
638 | mode &= ~current->fs->umask; | 638 | mode &= ~current_umask(); |
639 | 639 | ||
640 | if (flags & SPU_CREATE_GANG) | 640 | if (flags & SPU_CREATE_GANG) |
641 | ret = spufs_create_gang(nd->path.dentry->d_inode, | 641 | ret = spufs_create_gang(nd->path.dentry->d_inode, |
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c index e1c83c23b435..86e392b1b049 100644 --- a/arch/powerpc/platforms/ps3/os-area.c +++ b/arch/powerpc/platforms/ps3/os-area.c | |||
@@ -808,6 +808,7 @@ u64 ps3_os_area_get_rtc_diff(void) | |||
808 | { | 808 | { |
809 | return saved_params.rtc_diff; | 809 | return saved_params.rtc_diff; |
810 | } | 810 | } |
811 | EXPORT_SYMBOL(ps3_os_area_get_rtc_diff); | ||
811 | 812 | ||
812 | /** | 813 | /** |
813 | * ps3_os_area_set_rtc_diff - Set the rtc diff value. | 814 | * ps3_os_area_set_rtc_diff - Set the rtc diff value. |
@@ -823,6 +824,7 @@ void ps3_os_area_set_rtc_diff(u64 rtc_diff) | |||
823 | os_area_queue_work(); | 824 | os_area_queue_work(); |
824 | } | 825 | } |
825 | } | 826 | } |
827 | EXPORT_SYMBOL(ps3_os_area_set_rtc_diff); | ||
826 | 828 | ||
827 | /** | 829 | /** |
828 | * ps3_os_area_get_av_multi_out - Returns the default video mode. | 830 | * ps3_os_area_get_av_multi_out - Returns the default video mode. |
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h index 235c13ebacd9..136aa0637d9c 100644 --- a/arch/powerpc/platforms/ps3/platform.h +++ b/arch/powerpc/platforms/ps3/platform.h | |||
@@ -64,8 +64,6 @@ int ps3_set_rtc_time(struct rtc_time *time); | |||
64 | 64 | ||
65 | void __init ps3_os_area_save_params(void); | 65 | void __init ps3_os_area_save_params(void); |
66 | void __init ps3_os_area_init(void); | 66 | void __init ps3_os_area_init(void); |
67 | u64 ps3_os_area_get_rtc_diff(void); | ||
68 | void ps3_os_area_set_rtc_diff(u64 rtc_diff); | ||
69 | 67 | ||
70 | /* spu */ | 68 | /* spu */ |
71 | 69 | ||
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 3331ccbb8d38..66181821322a 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c | |||
@@ -270,8 +270,6 @@ define_machine(ps3) { | |||
270 | .init_IRQ = ps3_init_IRQ, | 270 | .init_IRQ = ps3_init_IRQ, |
271 | .panic = ps3_panic, | 271 | .panic = ps3_panic, |
272 | .get_boot_time = ps3_get_boot_time, | 272 | .get_boot_time = ps3_get_boot_time, |
273 | .set_rtc_time = ps3_set_rtc_time, | ||
274 | .get_rtc_time = ps3_get_rtc_time, | ||
275 | .set_dabr = ps3_set_dabr, | 273 | .set_dabr = ps3_set_dabr, |
276 | .calibrate_decr = ps3_calibrate_decr, | 274 | .calibrate_decr = ps3_calibrate_decr, |
277 | .progress = ps3_progress, | 275 | .progress = ps3_progress, |
diff --git a/arch/powerpc/platforms/ps3/time.c b/arch/powerpc/platforms/ps3/time.c index d0daf7d6d3b2..b178a1e66c91 100644 --- a/arch/powerpc/platforms/ps3/time.c +++ b/arch/powerpc/platforms/ps3/time.c | |||
@@ -19,6 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/platform_device.h> | ||
22 | 23 | ||
23 | #include <asm/rtc.h> | 24 | #include <asm/rtc.h> |
24 | #include <asm/lv1call.h> | 25 | #include <asm/lv1call.h> |
@@ -74,23 +75,20 @@ static u64 read_rtc(void) | |||
74 | return rtc_val; | 75 | return rtc_val; |
75 | } | 76 | } |
76 | 77 | ||
77 | int ps3_set_rtc_time(struct rtc_time *tm) | 78 | unsigned long __init ps3_get_boot_time(void) |
78 | { | 79 | { |
79 | u64 now = mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, | 80 | return read_rtc() + ps3_os_area_get_rtc_diff(); |
80 | tm->tm_hour, tm->tm_min, tm->tm_sec); | ||
81 | |||
82 | ps3_os_area_set_rtc_diff(now - read_rtc()); | ||
83 | return 0; | ||
84 | } | 81 | } |
85 | 82 | ||
86 | void ps3_get_rtc_time(struct rtc_time *tm) | 83 | static int __init ps3_rtc_init(void) |
87 | { | 84 | { |
88 | to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm); | 85 | struct platform_device *pdev; |
89 | tm->tm_year -= 1900; | ||
90 | tm->tm_mon -= 1; | ||
91 | } | ||
92 | 86 | ||
93 | unsigned long __init ps3_get_boot_time(void) | 87 | pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0); |
94 | { | 88 | if (IS_ERR(pdev)) |
95 | return read_rtc() + ps3_os_area_get_rtc_diff(); | 89 | return PTR_ERR(pdev); |
90 | |||
91 | return 0; | ||
96 | } | 92 | } |
93 | |||
94 | module_init(ps3_rtc_init); | ||
diff --git a/arch/powerpc/sysdev/bestcomm/Kconfig b/arch/powerpc/sysdev/bestcomm/Kconfig index 0b192a1c429d..29e427085efb 100644 --- a/arch/powerpc/sysdev/bestcomm/Kconfig +++ b/arch/powerpc/sysdev/bestcomm/Kconfig | |||
@@ -9,8 +9,8 @@ config PPC_BESTCOMM | |||
9 | select PPC_LIB_RHEAP | 9 | select PPC_LIB_RHEAP |
10 | help | 10 | help |
11 | BestComm is the name of the communication coprocessor found | 11 | BestComm is the name of the communication coprocessor found |
12 | on the Freescale MPC5200 family of processor. It's usage is | 12 | on the Freescale MPC5200 family of processor. Its usage is |
13 | optionnal for some drivers (like ATA), but required for | 13 | optional for some drivers (like ATA), but required for |
14 | others (like FEC). | 14 | others (like FEC). |
15 | 15 | ||
16 | If you want to use drivers that require DMA operations, | 16 | If you want to use drivers that require DMA operations, |
diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug index 7e297a3cde34..2283933a9a93 100644 --- a/arch/s390/Kconfig.debug +++ b/arch/s390/Kconfig.debug | |||
@@ -6,13 +6,4 @@ config TRACE_IRQFLAGS_SUPPORT | |||
6 | 6 | ||
7 | source "lib/Kconfig.debug" | 7 | source "lib/Kconfig.debug" |
8 | 8 | ||
9 | config DEBUG_PAGEALLOC | ||
10 | bool "Debug page memory allocations" | ||
11 | depends on DEBUG_KERNEL | ||
12 | depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC | ||
13 | help | ||
14 | Unmap pages from the kernel linear mapping after free_pages(). | ||
15 | This results in a slowdown, but helps to find certain types of | ||
16 | memory corruptions. | ||
17 | |||
18 | endmenu | 9 | endmenu |
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h index 2009158a4502..72137bc907ac 100644 --- a/arch/s390/include/asm/smp.h +++ b/arch/s390/include/asm/smp.h | |||
@@ -92,12 +92,6 @@ extern void arch_send_call_function_ipi(cpumask_t mask); | |||
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | #ifndef CONFIG_SMP | 94 | #ifndef CONFIG_SMP |
95 | static inline void smp_send_stop(void) | ||
96 | { | ||
97 | /* Disable all interrupts/machine checks */ | ||
98 | __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK); | ||
99 | } | ||
100 | |||
101 | #define hard_smp_processor_id() 0 | 95 | #define hard_smp_processor_id() 0 |
102 | #define smp_cpu_not_running(cpu) 1 | 96 | #define smp_cpu_not_running(cpu) 1 |
103 | #endif | 97 | #endif |
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h index df84ae96915f..f3861b09ebb0 100644 --- a/arch/s390/include/asm/spinlock.h +++ b/arch/s390/include/asm/spinlock.h | |||
@@ -172,6 +172,9 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
172 | return _raw_write_trylock_retry(rw); | 172 | return _raw_write_trylock_retry(rw); |
173 | } | 173 | } |
174 | 174 | ||
175 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
176 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
177 | |||
175 | #define _raw_read_relax(lock) cpu_relax() | 178 | #define _raw_read_relax(lock) cpu_relax() |
176 | #define _raw_write_relax(lock) cpu_relax() | 179 | #define _raw_write_relax(lock) cpu_relax() |
177 | 180 | ||
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index b48e961a38f6..a3acd8e60aff 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -160,7 +160,7 @@ void release_thread(struct task_struct *dead_task) | |||
160 | { | 160 | { |
161 | } | 161 | } |
162 | 162 | ||
163 | int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp, | 163 | int copy_thread(unsigned long clone_flags, unsigned long new_stackp, |
164 | unsigned long unused, | 164 | unsigned long unused, |
165 | struct task_struct *p, struct pt_regs *regs) | 165 | struct task_struct *p, struct pt_regs *regs) |
166 | { | 166 | { |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 6a1e79b886c1..5e4babecf934 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -644,10 +644,10 @@ config GUSA_RB | |||
644 | depends on GUSA && CPU_SH3 || (CPU_SH4 && !CPU_SH4A) | 644 | depends on GUSA && CPU_SH3 || (CPU_SH4 && !CPU_SH4A) |
645 | help | 645 | help |
646 | Enabling this option will allow the kernel to implement some | 646 | Enabling this option will allow the kernel to implement some |
647 | atomic operations using a software implemention of load-locked/ | 647 | atomic operations using a software implementation of load-locked/ |
648 | store-conditional (LLSC). On machines which do not have hardware | 648 | store-conditional (LLSC). On machines which do not have hardware |
649 | LLSC, this should be more efficient than the other alternative of | 649 | LLSC, this should be more efficient than the other alternative of |
650 | disabling insterrupts around the atomic sequence. | 650 | disabling interrupts around the atomic sequence. |
651 | 651 | ||
652 | endmenu | 652 | endmenu |
653 | 653 | ||
diff --git a/arch/sh/include/asm/spinlock.h b/arch/sh/include/asm/spinlock.h index e793181d64da..60283565f89b 100644 --- a/arch/sh/include/asm/spinlock.h +++ b/arch/sh/include/asm/spinlock.h | |||
@@ -216,6 +216,9 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
216 | return (oldval > (RW_LOCK_BIAS - 1)); | 216 | return (oldval > (RW_LOCK_BIAS - 1)); |
217 | } | 217 | } |
218 | 218 | ||
219 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
220 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
221 | |||
219 | #define _raw_spin_relax(lock) cpu_relax() | 222 | #define _raw_spin_relax(lock) cpu_relax() |
220 | #define _raw_read_relax(lock) cpu_relax() | 223 | #define _raw_read_relax(lock) cpu_relax() |
221 | #define _raw_write_relax(lock) cpu_relax() | 224 | #define _raw_write_relax(lock) cpu_relax() |
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index 0747fabd73a7..6d94725d22f2 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -170,7 +170,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
170 | 170 | ||
171 | asmlinkage void ret_from_fork(void); | 171 | asmlinkage void ret_from_fork(void); |
172 | 172 | ||
173 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 173 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
174 | unsigned long unused, | 174 | unsigned long unused, |
175 | struct task_struct *p, struct pt_regs *regs) | 175 | struct task_struct *p, struct pt_regs *regs) |
176 | { | 176 | { |
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index c90c7e5e5fee..96be839040f8 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c | |||
@@ -425,7 +425,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
425 | 425 | ||
426 | asmlinkage void ret_from_fork(void); | 426 | asmlinkage void ret_from_fork(void); |
427 | 427 | ||
428 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 428 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
429 | unsigned long unused, | 429 | unsigned long unused, |
430 | struct task_struct *p, struct pt_regs *regs) | 430 | struct task_struct *p, struct pt_regs *regs) |
431 | { | 431 | { |
diff --git a/arch/sparc/Kconfig.debug b/arch/sparc/Kconfig.debug index d001b42041a5..90d5fe223a74 100644 --- a/arch/sparc/Kconfig.debug +++ b/arch/sparc/Kconfig.debug | |||
@@ -22,15 +22,6 @@ config DEBUG_DCFLUSH | |||
22 | config STACK_DEBUG | 22 | config STACK_DEBUG |
23 | bool "Stack Overflow Detection Support" | 23 | bool "Stack Overflow Detection Support" |
24 | 24 | ||
25 | config DEBUG_PAGEALLOC | ||
26 | bool "Debug page memory allocations" | ||
27 | depends on DEBUG_KERNEL && !HIBERNATION | ||
28 | depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC | ||
29 | help | ||
30 | Unmap pages from the kernel linear mapping after free_pages(). | ||
31 | This results in a large slowdown, but helps to find certain types | ||
32 | of memory corruptions. | ||
33 | |||
34 | config MCOUNT | 25 | config MCOUNT |
35 | bool | 26 | bool |
36 | depends on SPARC64 | 27 | depends on SPARC64 |
diff --git a/arch/sparc/include/asm/mmzone.h b/arch/sparc/include/asm/mmzone.h index ebf5986c12ed..e8c648741ed4 100644 --- a/arch/sparc/include/asm/mmzone.h +++ b/arch/sparc/include/asm/mmzone.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 4 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
5 | 5 | ||
6 | #include <linux/cpumask.h> | ||
7 | |||
6 | extern struct pglist_data *node_data[]; | 8 | extern struct pglist_data *node_data[]; |
7 | 9 | ||
8 | #define NODE_DATA(nid) (node_data[nid]) | 10 | #define NODE_DATA(nid) (node_data[nid]) |
diff --git a/arch/sparc/include/asm/spinlock_32.h b/arch/sparc/include/asm/spinlock_32.h index bf2d532593e3..46f91ab66a50 100644 --- a/arch/sparc/include/asm/spinlock_32.h +++ b/arch/sparc/include/asm/spinlock_32.h | |||
@@ -177,6 +177,8 @@ static inline int __read_trylock(raw_rwlock_t *rw) | |||
177 | #define __raw_write_unlock(rw) do { (rw)->lock = 0; } while(0) | 177 | #define __raw_write_unlock(rw) do { (rw)->lock = 0; } while(0) |
178 | 178 | ||
179 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 179 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
180 | #define __raw_read_lock_flags(rw, flags) __raw_read_lock(rw) | ||
181 | #define __raw_write_lock_flags(rw, flags) __raw_write_lock(rw) | ||
180 | 182 | ||
181 | #define _raw_spin_relax(lock) cpu_relax() | 183 | #define _raw_spin_relax(lock) cpu_relax() |
182 | #define _raw_read_relax(lock) cpu_relax() | 184 | #define _raw_read_relax(lock) cpu_relax() |
diff --git a/arch/sparc/include/asm/spinlock_64.h b/arch/sparc/include/asm/spinlock_64.h index c4d274d330e9..f6b2b92ad8d2 100644 --- a/arch/sparc/include/asm/spinlock_64.h +++ b/arch/sparc/include/asm/spinlock_64.h | |||
@@ -211,9 +211,11 @@ static int inline __write_trylock(raw_rwlock_t *lock) | |||
211 | } | 211 | } |
212 | 212 | ||
213 | #define __raw_read_lock(p) __read_lock(p) | 213 | #define __raw_read_lock(p) __read_lock(p) |
214 | #define __raw_read_lock_flags(p, f) __read_lock(p) | ||
214 | #define __raw_read_trylock(p) __read_trylock(p) | 215 | #define __raw_read_trylock(p) __read_trylock(p) |
215 | #define __raw_read_unlock(p) __read_unlock(p) | 216 | #define __raw_read_unlock(p) __read_unlock(p) |
216 | #define __raw_write_lock(p) __write_lock(p) | 217 | #define __raw_write_lock(p) __write_lock(p) |
218 | #define __raw_write_lock_flags(p, f) __write_lock(p) | ||
217 | #define __raw_write_unlock(p) __write_unlock(p) | 219 | #define __raw_write_unlock(p) __write_unlock(p) |
218 | #define __raw_write_trylock(p) __write_trylock(p) | 220 | #define __raw_write_trylock(p) __write_trylock(p) |
219 | 221 | ||
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S index a46c3a21e26d..3a1b7bf03cff 100644 --- a/arch/sparc/kernel/head_64.S +++ b/arch/sparc/kernel/head_64.S | |||
@@ -686,7 +686,7 @@ tlb_fixup_done: | |||
686 | * point. | 686 | * point. |
687 | * | 687 | * |
688 | * There used to be enormous complexity wrt. transferring | 688 | * There used to be enormous complexity wrt. transferring |
689 | * over from the firwmare's trap table to the Linux kernel's. | 689 | * over from the firmware's trap table to the Linux kernel's. |
690 | * For example, there was a chicken & egg problem wrt. building | 690 | * For example, there was a chicken & egg problem wrt. building |
691 | * the OBP page tables, yet needing to be on the Linux kernel | 691 | * the OBP page tables, yet needing to be on the Linux kernel |
692 | * trap table (to translate PAGE_OFFSET addresses) in order to | 692 | * trap table (to translate PAGE_OFFSET addresses) in order to |
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index f4bee35a1b46..2830b415e214 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
@@ -455,7 +455,7 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags, | |||
455 | */ | 455 | */ |
456 | extern void ret_from_fork(void); | 456 | extern void ret_from_fork(void); |
457 | 457 | ||
458 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | 458 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
459 | unsigned long unused, | 459 | unsigned long unused, |
460 | struct task_struct *p, struct pt_regs *regs) | 460 | struct task_struct *p, struct pt_regs *regs) |
461 | { | 461 | { |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index a73954b87f0a..4041f94e7724 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -561,7 +561,7 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags, | |||
561 | * Parent --> %o0 == childs pid, %o1 == 0 | 561 | * Parent --> %o0 == childs pid, %o1 == 0 |
562 | * Child --> %o0 == parents pid, %o1 == 1 | 562 | * Child --> %o0 == parents pid, %o1 == 1 |
563 | */ | 563 | */ |
564 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | 564 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
565 | unsigned long unused, | 565 | unsigned long unused, |
566 | struct task_struct *p, struct pt_regs *regs) | 566 | struct task_struct *p, struct pt_regs *regs) |
567 | { | 567 | { |
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 434224e2229f..434ba121e3c5 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
@@ -757,7 +757,7 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event, | |||
757 | void (*proc)(unsigned char *, unsigned char *, void *); | 757 | void (*proc)(unsigned char *, unsigned char *, void *); |
758 | unsigned char addr_buf[4], netmask_buf[4]; | 758 | unsigned char addr_buf[4], netmask_buf[4]; |
759 | 759 | ||
760 | if (dev->open != uml_net_open) | 760 | if (dev->netdev_ops->ndo_open != uml_net_open) |
761 | return NOTIFY_DONE; | 761 | return NOTIFY_DONE; |
762 | 762 | ||
763 | lp = netdev_priv(dev); | 763 | lp = netdev_priv(dev); |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index d42f826a8ab9..f934225fd8ef 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "linux/kernel.h" | 22 | #include "linux/kernel.h" |
23 | #include "linux/module.h" | 23 | #include "linux/module.h" |
24 | #include "linux/blkdev.h" | 24 | #include "linux/blkdev.h" |
25 | #include "linux/ata.h" | ||
25 | #include "linux/hdreg.h" | 26 | #include "linux/hdreg.h" |
26 | #include "linux/init.h" | 27 | #include "linux/init.h" |
27 | #include "linux/cdrom.h" | 28 | #include "linux/cdrom.h" |
@@ -1308,16 +1309,15 @@ static int ubd_ioctl(struct block_device *bdev, fmode_t mode, | |||
1308 | unsigned int cmd, unsigned long arg) | 1309 | unsigned int cmd, unsigned long arg) |
1309 | { | 1310 | { |
1310 | struct ubd *ubd_dev = bdev->bd_disk->private_data; | 1311 | struct ubd *ubd_dev = bdev->bd_disk->private_data; |
1311 | struct hd_driveid ubd_id = { | 1312 | u16 ubd_id[ATA_ID_WORDS]; |
1312 | .cyls = 0, | ||
1313 | .heads = 128, | ||
1314 | .sectors = 32, | ||
1315 | }; | ||
1316 | 1313 | ||
1317 | switch (cmd) { | 1314 | switch (cmd) { |
1318 | struct cdrom_volctrl volume; | 1315 | struct cdrom_volctrl volume; |
1319 | case HDIO_GET_IDENTITY: | 1316 | case HDIO_GET_IDENTITY: |
1320 | ubd_id.cyls = ubd_dev->size / (128 * 32 * 512); | 1317 | memset(&ubd_id, 0, ATA_ID_WORDS * 2); |
1318 | ubd_id[ATA_ID_CYLS] = ubd_dev->size / (128 * 32 * 512); | ||
1319 | ubd_id[ATA_ID_HEADS] = 128; | ||
1320 | ubd_id[ATA_ID_SECTORS] = 32; | ||
1321 | if(copy_to_user((char __user *) arg, (char *) &ubd_id, | 1321 | if(copy_to_user((char __user *) arg, (char *) &ubd_id, |
1322 | sizeof(ubd_id))) | 1322 | sizeof(ubd_id))) |
1323 | return -EFAULT; | 1323 | return -EFAULT; |
diff --git a/arch/um/include/asm/ftrace.h b/arch/um/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/um/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index a1c6d07cac3e..4a28a1568d85 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -179,7 +179,7 @@ void fork_handler(void) | |||
179 | userspace(¤t->thread.regs.regs); | 179 | userspace(¤t->thread.regs.regs); |
180 | } | 180 | } |
181 | 181 | ||
182 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | 182 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
183 | unsigned long stack_top, struct task_struct * p, | 183 | unsigned long stack_top, struct task_struct * p, |
184 | struct pt_regs *regs) | 184 | struct pt_regs *regs) |
185 | { | 185 | { |
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index c4df705b8359..a4625c7b2bf9 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c | |||
@@ -127,7 +127,8 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | |||
127 | 127 | ||
128 | fs = get_fs(); | 128 | fs = get_fs(); |
129 | set_fs(KERNEL_DS); | 129 | set_fs(KERNEL_DS); |
130 | ret = um_execve(filename, argv, envp); | 130 | ret = um_execve((char *)filename, (char __user *__user *)argv, |
131 | (char __user *__user *) envp); | ||
131 | set_fs(fs); | 132 | set_fs(fs); |
132 | 133 | ||
133 | return ret; | 134 | return ret; |
diff --git a/arch/um/sys-i386/sys_call_table.S b/arch/um/sys-i386/sys_call_table.S index 00e5f5203eea..c6260dd6ebb9 100644 --- a/arch/um/sys-i386/sys_call_table.S +++ b/arch/um/sys-i386/sys_call_table.S | |||
@@ -9,6 +9,17 @@ | |||
9 | 9 | ||
10 | #define old_mmap old_mmap_i386 | 10 | #define old_mmap old_mmap_i386 |
11 | 11 | ||
12 | #define ptregs_fork sys_fork | ||
13 | #define ptregs_execve sys_execve | ||
14 | #define ptregs_iopl sys_iopl | ||
15 | #define ptregs_vm86old sys_vm86old | ||
16 | #define ptregs_sigreturn sys_sigreturn | ||
17 | #define ptregs_clone sys_clone | ||
18 | #define ptregs_vm86 sys_vm86 | ||
19 | #define ptregs_rt_sigreturn sys_rt_sigreturn | ||
20 | #define ptregs_sigaltstack sys_sigaltstack | ||
21 | #define ptregs_vfork sys_vfork | ||
22 | |||
12 | .section .rodata,"a" | 23 | .section .rodata,"a" |
13 | 24 | ||
14 | #include "../../x86/kernel/syscall_table_32.S" | 25 | #include "../../x86/kernel/syscall_table_32.S" |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 748e50a1a152..5b2196ab8168 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -34,6 +34,8 @@ config X86 | |||
34 | select HAVE_FUNCTION_TRACER | 34 | select HAVE_FUNCTION_TRACER |
35 | select HAVE_FUNCTION_GRAPH_TRACER | 35 | select HAVE_FUNCTION_GRAPH_TRACER |
36 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST | 36 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST |
37 | select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE | ||
38 | select HAVE_FTRACE_SYSCALLS | ||
37 | select HAVE_KVM | 39 | select HAVE_KVM |
38 | select HAVE_ARCH_KGDB | 40 | select HAVE_ARCH_KGDB |
39 | select HAVE_ARCH_TRACEHOOK | 41 | select HAVE_ARCH_TRACEHOOK |
@@ -1144,7 +1146,7 @@ config NODES_SHIFT | |||
1144 | depends on NEED_MULTIPLE_NODES | 1146 | depends on NEED_MULTIPLE_NODES |
1145 | ---help--- | 1147 | ---help--- |
1146 | Specify the maximum number of NUMA Nodes available on the target | 1148 | Specify the maximum number of NUMA Nodes available on the target |
1147 | system. Increases memory reserved to accomodate various tables. | 1149 | system. Increases memory reserved to accommodate various tables. |
1148 | 1150 | ||
1149 | config HAVE_ARCH_BOOTMEM | 1151 | config HAVE_ARCH_BOOTMEM |
1150 | def_bool y | 1152 | def_bool y |
@@ -1322,7 +1324,7 @@ config MTRR_SANITIZER | |||
1322 | add writeback entries. | 1324 | add writeback entries. |
1323 | 1325 | ||
1324 | Can be disabled with disable_mtrr_cleanup on the kernel command line. | 1326 | Can be disabled with disable_mtrr_cleanup on the kernel command line. |
1325 | The largest mtrr entry size for a continous block can be set with | 1327 | The largest mtrr entry size for a continuous block can be set with |
1326 | mtrr_chunk_size. | 1328 | mtrr_chunk_size. |
1327 | 1329 | ||
1328 | If unsure, say Y. | 1330 | If unsure, say Y. |
@@ -1837,8 +1839,8 @@ config PCI_MMCONFIG | |||
1837 | 1839 | ||
1838 | config DMAR | 1840 | config DMAR |
1839 | bool "Support for DMA Remapping Devices (EXPERIMENTAL)" | 1841 | bool "Support for DMA Remapping Devices (EXPERIMENTAL)" |
1840 | depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL | 1842 | depends on PCI_MSI && ACPI && EXPERIMENTAL |
1841 | ---help--- | 1843 | help |
1842 | DMA remapping (DMAR) devices support enables independent address | 1844 | DMA remapping (DMAR) devices support enables independent address |
1843 | translations for Direct Memory Access (DMA) from devices. | 1845 | translations for Direct Memory Access (DMA) from devices. |
1844 | These DMA remapping devices are reported via ACPI tables | 1846 | These DMA remapping devices are reported via ACPI tables |
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index a345cb5447a8..d8359e73317f 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug | |||
@@ -72,15 +72,6 @@ config DEBUG_STACK_USAGE | |||
72 | 72 | ||
73 | This option will slow down process creation somewhat. | 73 | This option will slow down process creation somewhat. |
74 | 74 | ||
75 | config DEBUG_PAGEALLOC | ||
76 | bool "Debug page memory allocations" | ||
77 | depends on DEBUG_KERNEL | ||
78 | depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC | ||
79 | ---help--- | ||
80 | Unmap pages from the kernel linear mapping after free_pages(). | ||
81 | This results in a large slowdown, but helps to find certain types | ||
82 | of memory corruptions. | ||
83 | |||
84 | config DEBUG_PER_CPU_MAPS | 75 | config DEBUG_PER_CPU_MAPS |
85 | bool "Debug access to per_cpu maps" | 76 | bool "Debug access to per_cpu maps" |
86 | depends on DEBUG_KERNEL | 77 | depends on DEBUG_KERNEL |
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index fb737ce5888d..6633b6e7505a 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
@@ -57,6 +57,7 @@ $(obj)/cpustr.h: $(obj)/mkcpustr FORCE | |||
57 | # How to compile the 16-bit code. Note we always compile for -march=i386, | 57 | # How to compile the 16-bit code. Note we always compile for -march=i386, |
58 | # that way we can complain to the user if the CPU is insufficient. | 58 | # that way we can complain to the user if the CPU is insufficient. |
59 | KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ | 59 | KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ |
60 | -DDISABLE_BRANCH_PROFILING \ | ||
60 | -Wall -Wstrict-prototypes \ | 61 | -Wall -Wstrict-prototypes \ |
61 | -march=i386 -mregparm=3 \ | 62 | -march=i386 -mregparm=3 \ |
62 | -include $(srctree)/$(src)/code16gcc.h \ | 63 | -include $(srctree)/$(src)/code16gcc.h \ |
@@ -66,7 +67,7 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ | |||
66 | $(call cc-option, -fno-unit-at-a-time)) \ | 67 | $(call cc-option, -fno-unit-at-a-time)) \ |
67 | $(call cc-option, -fno-stack-protector) \ | 68 | $(call cc-option, -fno-stack-protector) \ |
68 | $(call cc-option, -mpreferred-stack-boundary=2) | 69 | $(call cc-option, -mpreferred-stack-boundary=2) |
69 | KBUILD_CFLAGS += $(call cc-option,-m32) | 70 | KBUILD_CFLAGS += $(call cc-option, -m32) |
70 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ | 71 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ |
71 | 72 | ||
72 | $(obj)/bzImage: asflags-y := $(SVGA_MODE) | 73 | $(obj)/bzImage: asflags-y := $(SVGA_MODE) |
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 3ca4c194b8e5..65551c9f8571 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
@@ -8,6 +8,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma h | |||
8 | 8 | ||
9 | KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 | 9 | KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 |
10 | KBUILD_CFLAGS += -fno-strict-aliasing -fPIC | 10 | KBUILD_CFLAGS += -fno-strict-aliasing -fPIC |
11 | KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING | ||
11 | cflags-$(CONFIG_X86_64) := -mcmodel=small | 12 | cflags-$(CONFIG_X86_64) := -mcmodel=small |
12 | KBUILD_CFLAGS += $(cflags-y) | 13 | KBUILD_CFLAGS += $(cflags-y) |
13 | KBUILD_CFLAGS += $(call cc-option,-ffreestanding) | 14 | KBUILD_CFLAGS += $(call cc-option,-ffreestanding) |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index db0c803170ab..a505202086e8 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -828,4 +828,6 @@ ia32_sys_call_table: | |||
828 | .quad sys_dup3 /* 330 */ | 828 | .quad sys_dup3 /* 330 */ |
829 | .quad sys_pipe2 | 829 | .quad sys_pipe2 |
830 | .quad sys_inotify_init1 | 830 | .quad sys_inotify_init1 |
831 | .quad compat_sys_preadv | ||
832 | .quad compat_sys_pwritev | ||
831 | ia32_syscall_end: | 833 | ia32_syscall_end: |
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h index b3894bf52fcd..e55dfc1ad453 100644 --- a/arch/x86/include/asm/cacheflush.h +++ b/arch/x86/include/asm/cacheflush.h | |||
@@ -126,6 +126,11 @@ void clflush_cache_range(void *addr, unsigned int size); | |||
126 | #ifdef CONFIG_DEBUG_RODATA | 126 | #ifdef CONFIG_DEBUG_RODATA |
127 | void mark_rodata_ro(void); | 127 | void mark_rodata_ro(void); |
128 | extern const int rodata_test_data; | 128 | extern const int rodata_test_data; |
129 | void set_kernel_text_rw(void); | ||
130 | void set_kernel_text_ro(void); | ||
131 | #else | ||
132 | static inline void set_kernel_text_rw(void) { } | ||
133 | static inline void set_kernel_text_ro(void) { } | ||
129 | #endif | 134 | #endif |
130 | 135 | ||
131 | #ifdef CONFIG_DEBUG_RODATA_TEST | 136 | #ifdef CONFIG_DEBUG_RODATA_TEST |
diff --git a/arch/x86/include/asm/cpumask.h b/arch/x86/include/asm/cpumask.h index a7f3c75f8ad7..61c852fa346b 100644 --- a/arch/x86/include/asm/cpumask.h +++ b/arch/x86/include/asm/cpumask.h | |||
@@ -3,8 +3,6 @@ | |||
3 | #ifndef __ASSEMBLY__ | 3 | #ifndef __ASSEMBLY__ |
4 | #include <linux/cpumask.h> | 4 | #include <linux/cpumask.h> |
5 | 5 | ||
6 | #ifdef CONFIG_X86_64 | ||
7 | |||
8 | extern cpumask_var_t cpu_callin_mask; | 6 | extern cpumask_var_t cpu_callin_mask; |
9 | extern cpumask_var_t cpu_callout_mask; | 7 | extern cpumask_var_t cpu_callout_mask; |
10 | extern cpumask_var_t cpu_initialized_mask; | 8 | extern cpumask_var_t cpu_initialized_mask; |
@@ -12,21 +10,5 @@ extern cpumask_var_t cpu_sibling_setup_mask; | |||
12 | 10 | ||
13 | extern void setup_cpu_local_masks(void); | 11 | extern void setup_cpu_local_masks(void); |
14 | 12 | ||
15 | #else /* CONFIG_X86_32 */ | ||
16 | |||
17 | extern cpumask_t cpu_callin_map; | ||
18 | extern cpumask_t cpu_callout_map; | ||
19 | extern cpumask_t cpu_initialized; | ||
20 | extern cpumask_t cpu_sibling_setup_map; | ||
21 | |||
22 | #define cpu_callin_mask ((struct cpumask *)&cpu_callin_map) | ||
23 | #define cpu_callout_mask ((struct cpumask *)&cpu_callout_map) | ||
24 | #define cpu_initialized_mask ((struct cpumask *)&cpu_initialized) | ||
25 | #define cpu_sibling_setup_mask ((struct cpumask *)&cpu_sibling_setup_map) | ||
26 | |||
27 | static inline void setup_cpu_local_masks(void) { } | ||
28 | |||
29 | #endif /* CONFIG_X86_32 */ | ||
30 | |||
31 | #endif /* __ASSEMBLY__ */ | 13 | #endif /* __ASSEMBLY__ */ |
32 | #endif /* _ASM_X86_CPUMASK_H */ | 14 | #endif /* _ASM_X86_CPUMASK_H */ |
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index 63a79c77d220..81937a5dc77c 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h | |||
@@ -111,6 +111,8 @@ enum fixed_addresses { | |||
111 | #ifdef CONFIG_PARAVIRT | 111 | #ifdef CONFIG_PARAVIRT |
112 | FIX_PARAVIRT_BOOTMAP, | 112 | FIX_PARAVIRT_BOOTMAP, |
113 | #endif | 113 | #endif |
114 | FIX_TEXT_POKE0, /* reserve 2 pages for text_poke() */ | ||
115 | FIX_TEXT_POKE1, | ||
114 | __end_of_permanent_fixed_addresses, | 116 | __end_of_permanent_fixed_addresses, |
115 | #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT | 117 | #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT |
116 | FIX_OHCI1394_BASE, | 118 | FIX_OHCI1394_BASE, |
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h index db24c2278be0..bd2c6511c887 100644 --- a/arch/x86/include/asm/ftrace.h +++ b/arch/x86/include/asm/ftrace.h | |||
@@ -28,6 +28,13 @@ | |||
28 | 28 | ||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | /* FIXME: I don't want to stay hardcoded */ | ||
32 | #ifdef CONFIG_X86_64 | ||
33 | # define FTRACE_SYSCALL_MAX 296 | ||
34 | #else | ||
35 | # define FTRACE_SYSCALL_MAX 333 | ||
36 | #endif | ||
37 | |||
31 | #ifdef CONFIG_FUNCTION_TRACER | 38 | #ifdef CONFIG_FUNCTION_TRACER |
32 | #define MCOUNT_ADDR ((long)(mcount)) | 39 | #define MCOUNT_ADDR ((long)(mcount)) |
33 | #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ | 40 | #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ |
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index a0301bfeb954..b51a1e8b0baf 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h | |||
@@ -89,12 +89,40 @@ extern void pci_iommu_alloc(void); | |||
89 | /* MSI arch hook */ | 89 | /* MSI arch hook */ |
90 | #define arch_setup_msi_irqs arch_setup_msi_irqs | 90 | #define arch_setup_msi_irqs arch_setup_msi_irqs |
91 | 91 | ||
92 | #endif /* __KERNEL__ */ | 92 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) |
93 | |||
94 | #if defined(CONFIG_X86_64) || defined(CONFIG_DMA_API_DEBUG) | ||
95 | |||
96 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | ||
97 | dma_addr_t ADDR_NAME; | ||
98 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | ||
99 | __u32 LEN_NAME; | ||
100 | #define pci_unmap_addr(PTR, ADDR_NAME) \ | ||
101 | ((PTR)->ADDR_NAME) | ||
102 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | ||
103 | (((PTR)->ADDR_NAME) = (VAL)) | ||
104 | #define pci_unmap_len(PTR, LEN_NAME) \ | ||
105 | ((PTR)->LEN_NAME) | ||
106 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | ||
107 | (((PTR)->LEN_NAME) = (VAL)) | ||
93 | 108 | ||
94 | #ifdef CONFIG_X86_32 | ||
95 | # include "pci_32.h" | ||
96 | #else | 109 | #else |
97 | # include "pci_64.h" | 110 | |
111 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME[0]; | ||
112 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) unsigned LEN_NAME[0]; | ||
113 | #define pci_unmap_addr(PTR, ADDR_NAME) sizeof((PTR)->ADDR_NAME) | ||
114 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | ||
115 | do { break; } while (pci_unmap_addr(PTR, ADDR_NAME)) | ||
116 | #define pci_unmap_len(PTR, LEN_NAME) sizeof((PTR)->LEN_NAME) | ||
117 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | ||
118 | do { break; } while (pci_unmap_len(PTR, LEN_NAME)) | ||
119 | |||
120 | #endif | ||
121 | |||
122 | #endif /* __KERNEL__ */ | ||
123 | |||
124 | #ifdef CONFIG_X86_64 | ||
125 | #include "pci_64.h" | ||
98 | #endif | 126 | #endif |
99 | 127 | ||
100 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ | 128 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ |
@@ -112,11 +140,6 @@ static inline int __pcibus_to_node(const struct pci_bus *bus) | |||
112 | return sd->node; | 140 | return sd->node; |
113 | } | 141 | } |
114 | 142 | ||
115 | static inline cpumask_t __pcibus_to_cpumask(struct pci_bus *bus) | ||
116 | { | ||
117 | return node_to_cpumask(__pcibus_to_node(bus)); | ||
118 | } | ||
119 | |||
120 | static inline const struct cpumask * | 143 | static inline const struct cpumask * |
121 | cpumask_of_pcibus(const struct pci_bus *bus) | 144 | cpumask_of_pcibus(const struct pci_bus *bus) |
122 | { | 145 | { |
diff --git a/arch/x86/include/asm/pci_32.h b/arch/x86/include/asm/pci_32.h deleted file mode 100644 index 6f1213a6ef4f..000000000000 --- a/arch/x86/include/asm/pci_32.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | #ifndef _ASM_X86_PCI_32_H | ||
2 | #define _ASM_X86_PCI_32_H | ||
3 | |||
4 | |||
5 | #ifdef __KERNEL__ | ||
6 | |||
7 | |||
8 | /* Dynamic DMA mapping stuff. | ||
9 | * i386 has everything mapped statically. | ||
10 | */ | ||
11 | |||
12 | struct pci_dev; | ||
13 | |||
14 | /* The PCI address space does equal the physical memory | ||
15 | * address space. The networking and block device layers use | ||
16 | * this boolean for bounce buffer decisions. | ||
17 | */ | ||
18 | #define PCI_DMA_BUS_IS_PHYS (1) | ||
19 | |||
20 | /* pci_unmap_{page,single} is a nop so... */ | ||
21 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME[0]; | ||
22 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) unsigned LEN_NAME[0]; | ||
23 | #define pci_unmap_addr(PTR, ADDR_NAME) sizeof((PTR)->ADDR_NAME) | ||
24 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | ||
25 | do { break; } while (pci_unmap_addr(PTR, ADDR_NAME)) | ||
26 | #define pci_unmap_len(PTR, LEN_NAME) sizeof((PTR)->LEN_NAME) | ||
27 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | ||
28 | do { break; } while (pci_unmap_len(PTR, LEN_NAME)) | ||
29 | |||
30 | |||
31 | #endif /* __KERNEL__ */ | ||
32 | |||
33 | |||
34 | #endif /* _ASM_X86_PCI_32_H */ | ||
diff --git a/arch/x86/include/asm/pci_64.h b/arch/x86/include/asm/pci_64.h index 4da207982777..ae5e40f67daf 100644 --- a/arch/x86/include/asm/pci_64.h +++ b/arch/x86/include/asm/pci_64.h | |||
@@ -24,28 +24,6 @@ extern int (*pci_config_write)(int seg, int bus, int dev, int fn, | |||
24 | 24 | ||
25 | extern void dma32_reserve_bootmem(void); | 25 | extern void dma32_reserve_bootmem(void); |
26 | 26 | ||
27 | /* The PCI address space does equal the physical memory | ||
28 | * address space. The networking and block device layers use | ||
29 | * this boolean for bounce buffer decisions | ||
30 | * | ||
31 | * On AMD64 it mostly equals, but we set it to zero if a hardware | ||
32 | * IOMMU (gart) of sotware IOMMU (swiotlb) is available. | ||
33 | */ | ||
34 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) | ||
35 | |||
36 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | ||
37 | dma_addr_t ADDR_NAME; | ||
38 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | ||
39 | __u32 LEN_NAME; | ||
40 | #define pci_unmap_addr(PTR, ADDR_NAME) \ | ||
41 | ((PTR)->ADDR_NAME) | ||
42 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | ||
43 | (((PTR)->ADDR_NAME) = (VAL)) | ||
44 | #define pci_unmap_len(PTR, LEN_NAME) \ | ||
45 | ((PTR)->LEN_NAME) | ||
46 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | ||
47 | (((PTR)->LEN_NAME) = (VAL)) | ||
48 | |||
49 | #endif /* __KERNEL__ */ | 27 | #endif /* __KERNEL__ */ |
50 | 28 | ||
51 | #endif /* _ASM_X86_PCI_64_H */ | 29 | #endif /* _ASM_X86_PCI_64_H */ |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index ae85a8d66a30..34c52370f2fe 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -94,7 +94,7 @@ struct cpuinfo_x86 { | |||
94 | unsigned long loops_per_jiffy; | 94 | unsigned long loops_per_jiffy; |
95 | #ifdef CONFIG_SMP | 95 | #ifdef CONFIG_SMP |
96 | /* cpus sharing the last level cache: */ | 96 | /* cpus sharing the last level cache: */ |
97 | cpumask_t llc_shared_map; | 97 | cpumask_var_t llc_shared_map; |
98 | #endif | 98 | #endif |
99 | /* cpuid returned max cores value: */ | 99 | /* cpuid returned max cores value: */ |
100 | u16 x86_max_cores; | 100 | u16 x86_max_cores; |
@@ -736,6 +736,7 @@ static inline void __sti_mwait(unsigned long eax, unsigned long ecx) | |||
736 | extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); | 736 | extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); |
737 | 737 | ||
738 | extern void select_idle_routine(const struct cpuinfo_x86 *c); | 738 | extern void select_idle_routine(const struct cpuinfo_x86 *c); |
739 | extern void init_c1e_mask(void); | ||
739 | 740 | ||
740 | extern unsigned long boot_option_idle_override; | 741 | extern unsigned long boot_option_idle_override; |
741 | extern unsigned long idle_halt; | 742 | extern unsigned long idle_halt; |
diff --git a/arch/x86/include/asm/ptrace-abi.h b/arch/x86/include/asm/ptrace-abi.h index 8e0f8d199e05..86723035a515 100644 --- a/arch/x86/include/asm/ptrace-abi.h +++ b/arch/x86/include/asm/ptrace-abi.h | |||
@@ -80,8 +80,6 @@ | |||
80 | 80 | ||
81 | #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ | 81 | #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ |
82 | 82 | ||
83 | #ifdef CONFIG_X86_PTRACE_BTS | ||
84 | |||
85 | #ifndef __ASSEMBLY__ | 83 | #ifndef __ASSEMBLY__ |
86 | #include <linux/types.h> | 84 | #include <linux/types.h> |
87 | 85 | ||
@@ -140,6 +138,5 @@ struct ptrace_bts_config { | |||
140 | BTS records are read from oldest to newest. | 138 | BTS records are read from oldest to newest. |
141 | Returns number of BTS records drained. | 139 | Returns number of BTS records drained. |
142 | */ | 140 | */ |
143 | #endif /* CONFIG_X86_PTRACE_BTS */ | ||
144 | 141 | ||
145 | #endif /* _ASM_X86_PTRACE_ABI_H */ | 142 | #endif /* _ASM_X86_PTRACE_ABI_H */ |
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 47d0e21f2b9e..19e0d88b966d 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -21,19 +21,19 @@ | |||
21 | extern int smp_num_siblings; | 21 | extern int smp_num_siblings; |
22 | extern unsigned int num_processors; | 22 | extern unsigned int num_processors; |
23 | 23 | ||
24 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | 24 | DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_map); |
25 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); | 25 | DECLARE_PER_CPU(cpumask_var_t, cpu_core_map); |
26 | DECLARE_PER_CPU(u16, cpu_llc_id); | 26 | DECLARE_PER_CPU(u16, cpu_llc_id); |
27 | DECLARE_PER_CPU(int, cpu_number); | 27 | DECLARE_PER_CPU(int, cpu_number); |
28 | 28 | ||
29 | static inline struct cpumask *cpu_sibling_mask(int cpu) | 29 | static inline struct cpumask *cpu_sibling_mask(int cpu) |
30 | { | 30 | { |
31 | return &per_cpu(cpu_sibling_map, cpu); | 31 | return per_cpu(cpu_sibling_map, cpu); |
32 | } | 32 | } |
33 | 33 | ||
34 | static inline struct cpumask *cpu_core_mask(int cpu) | 34 | static inline struct cpumask *cpu_core_mask(int cpu) |
35 | { | 35 | { |
36 | return &per_cpu(cpu_core_map, cpu); | 36 | return per_cpu(cpu_core_map, cpu); |
37 | } | 37 | } |
38 | 38 | ||
39 | DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); | 39 | DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); |
@@ -121,9 +121,10 @@ static inline void arch_send_call_function_single_ipi(int cpu) | |||
121 | smp_ops.send_call_func_single_ipi(cpu); | 121 | smp_ops.send_call_func_single_ipi(cpu); |
122 | } | 122 | } |
123 | 123 | ||
124 | static inline void arch_send_call_function_ipi(cpumask_t mask) | 124 | #define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask |
125 | static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask) | ||
125 | { | 126 | { |
126 | smp_ops.send_call_func_ipi(&mask); | 127 | smp_ops.send_call_func_ipi(mask); |
127 | } | 128 | } |
128 | 129 | ||
129 | void cpu_disable_common(void); | 130 | void cpu_disable_common(void); |
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 3a5696656680..e5e6caffec87 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h | |||
@@ -295,6 +295,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
295 | : "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory"); | 295 | : "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory"); |
296 | } | 296 | } |
297 | 297 | ||
298 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
299 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
300 | |||
298 | #define _raw_spin_relax(lock) cpu_relax() | 301 | #define _raw_spin_relax(lock) cpu_relax() |
299 | #define _raw_read_relax(lock) cpu_relax() | 302 | #define _raw_read_relax(lock) cpu_relax() |
300 | #define _raw_write_relax(lock) cpu_relax() | 303 | #define _raw_write_relax(lock) cpu_relax() |
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index df9d5f78385e..8820a73ae090 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h | |||
@@ -94,6 +94,7 @@ struct thread_info { | |||
94 | #define TIF_FORCED_TF 24 /* true if TF in eflags artificially */ | 94 | #define TIF_FORCED_TF 24 /* true if TF in eflags artificially */ |
95 | #define TIF_DEBUGCTLMSR 25 /* uses thread_struct.debugctlmsr */ | 95 | #define TIF_DEBUGCTLMSR 25 /* uses thread_struct.debugctlmsr */ |
96 | #define TIF_DS_AREA_MSR 26 /* uses thread_struct.ds_area_msr */ | 96 | #define TIF_DS_AREA_MSR 26 /* uses thread_struct.ds_area_msr */ |
97 | #define TIF_SYSCALL_FTRACE 27 /* for ftrace syscall instrumentation */ | ||
97 | 98 | ||
98 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 99 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
99 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 100 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
@@ -115,15 +116,17 @@ struct thread_info { | |||
115 | #define _TIF_FORCED_TF (1 << TIF_FORCED_TF) | 116 | #define _TIF_FORCED_TF (1 << TIF_FORCED_TF) |
116 | #define _TIF_DEBUGCTLMSR (1 << TIF_DEBUGCTLMSR) | 117 | #define _TIF_DEBUGCTLMSR (1 << TIF_DEBUGCTLMSR) |
117 | #define _TIF_DS_AREA_MSR (1 << TIF_DS_AREA_MSR) | 118 | #define _TIF_DS_AREA_MSR (1 << TIF_DS_AREA_MSR) |
119 | #define _TIF_SYSCALL_FTRACE (1 << TIF_SYSCALL_FTRACE) | ||
118 | 120 | ||
119 | /* work to do in syscall_trace_enter() */ | 121 | /* work to do in syscall_trace_enter() */ |
120 | #define _TIF_WORK_SYSCALL_ENTRY \ | 122 | #define _TIF_WORK_SYSCALL_ENTRY \ |
121 | (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | \ | 123 | (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_FTRACE | \ |
122 | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | _TIF_SINGLESTEP) | 124 | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | _TIF_SINGLESTEP) |
123 | 125 | ||
124 | /* work to do in syscall_trace_leave() */ | 126 | /* work to do in syscall_trace_leave() */ |
125 | #define _TIF_WORK_SYSCALL_EXIT \ | 127 | #define _TIF_WORK_SYSCALL_EXIT \ |
126 | (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP) | 128 | (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP | \ |
129 | _TIF_SYSCALL_FTRACE) | ||
127 | 130 | ||
128 | /* work to do on interrupt/exception return */ | 131 | /* work to do on interrupt/exception return */ |
129 | #define _TIF_WORK_MASK \ | 132 | #define _TIF_WORK_MASK \ |
@@ -132,7 +135,7 @@ struct thread_info { | |||
132 | _TIF_SINGLESTEP|_TIF_SECCOMP|_TIF_SYSCALL_EMU)) | 135 | _TIF_SINGLESTEP|_TIF_SECCOMP|_TIF_SYSCALL_EMU)) |
133 | 136 | ||
134 | /* work to do on any return to user space */ | 137 | /* work to do on any return to user space */ |
135 | #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) | 138 | #define _TIF_ALLWORK_MASK ((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_FTRACE) |
136 | 139 | ||
137 | /* Only used for 64 bit */ | 140 | /* Only used for 64 bit */ |
138 | #define _TIF_DO_NOTIFY_MASK \ | 141 | #define _TIF_DO_NOTIFY_MASK \ |
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 744299c0b774..892b119dba6f 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h | |||
@@ -44,9 +44,6 @@ | |||
44 | 44 | ||
45 | #ifdef CONFIG_X86_32 | 45 | #ifdef CONFIG_X86_32 |
46 | 46 | ||
47 | /* Mappings between node number and cpus on that node. */ | ||
48 | extern cpumask_t node_to_cpumask_map[]; | ||
49 | |||
50 | /* Mappings between logical cpu number and node number */ | 47 | /* Mappings between logical cpu number and node number */ |
51 | extern int cpu_to_node_map[]; | 48 | extern int cpu_to_node_map[]; |
52 | 49 | ||
@@ -57,30 +54,8 @@ static inline int cpu_to_node(int cpu) | |||
57 | } | 54 | } |
58 | #define early_cpu_to_node(cpu) cpu_to_node(cpu) | 55 | #define early_cpu_to_node(cpu) cpu_to_node(cpu) |
59 | 56 | ||
60 | /* Returns a bitmask of CPUs on Node 'node'. | ||
61 | * | ||
62 | * Side note: this function creates the returned cpumask on the stack | ||
63 | * so with a high NR_CPUS count, excessive stack space is used. The | ||
64 | * cpumask_of_node function should be used whenever possible. | ||
65 | */ | ||
66 | static inline cpumask_t node_to_cpumask(int node) | ||
67 | { | ||
68 | return node_to_cpumask_map[node]; | ||
69 | } | ||
70 | |||
71 | /* Returns a bitmask of CPUs on Node 'node'. */ | ||
72 | static inline const struct cpumask *cpumask_of_node(int node) | ||
73 | { | ||
74 | return &node_to_cpumask_map[node]; | ||
75 | } | ||
76 | |||
77 | static inline void setup_node_to_cpumask_map(void) { } | ||
78 | |||
79 | #else /* CONFIG_X86_64 */ | 57 | #else /* CONFIG_X86_64 */ |
80 | 58 | ||
81 | /* Mappings between node number and cpus on that node. */ | ||
82 | extern cpumask_t *node_to_cpumask_map; | ||
83 | |||
84 | /* Mappings between logical cpu number and node number */ | 59 | /* Mappings between logical cpu number and node number */ |
85 | DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); | 60 | DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); |
86 | 61 | ||
@@ -91,8 +66,6 @@ DECLARE_PER_CPU(int, node_number); | |||
91 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS | 66 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS |
92 | extern int cpu_to_node(int cpu); | 67 | extern int cpu_to_node(int cpu); |
93 | extern int early_cpu_to_node(int cpu); | 68 | extern int early_cpu_to_node(int cpu); |
94 | extern const cpumask_t *cpumask_of_node(int node); | ||
95 | extern cpumask_t node_to_cpumask(int node); | ||
96 | 69 | ||
97 | #else /* !CONFIG_DEBUG_PER_CPU_MAPS */ | 70 | #else /* !CONFIG_DEBUG_PER_CPU_MAPS */ |
98 | 71 | ||
@@ -108,42 +81,32 @@ static inline int early_cpu_to_node(int cpu) | |||
108 | return early_per_cpu(x86_cpu_to_node_map, cpu); | 81 | return early_per_cpu(x86_cpu_to_node_map, cpu); |
109 | } | 82 | } |
110 | 83 | ||
111 | /* Returns a pointer to the cpumask of CPUs on Node 'node'. */ | 84 | #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ |
112 | static inline const cpumask_t *cpumask_of_node(int node) | 85 | |
113 | { | 86 | #endif /* CONFIG_X86_64 */ |
114 | return &node_to_cpumask_map[node]; | ||
115 | } | ||
116 | 87 | ||
117 | /* Returns a bitmask of CPUs on Node 'node'. */ | 88 | /* Mappings between node number and cpus on that node. */ |
118 | static inline cpumask_t node_to_cpumask(int node) | 89 | extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; |
90 | |||
91 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS | ||
92 | extern const struct cpumask *cpumask_of_node(int node); | ||
93 | #else | ||
94 | /* Returns a pointer to the cpumask of CPUs on Node 'node'. */ | ||
95 | static inline const struct cpumask *cpumask_of_node(int node) | ||
119 | { | 96 | { |
120 | return node_to_cpumask_map[node]; | 97 | return node_to_cpumask_map[node]; |
121 | } | 98 | } |
122 | 99 | #endif | |
123 | #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ | ||
124 | 100 | ||
125 | extern void setup_node_to_cpumask_map(void); | 101 | extern void setup_node_to_cpumask_map(void); |
126 | 102 | ||
127 | /* | 103 | /* |
128 | * Replace default node_to_cpumask_ptr with optimized version | ||
129 | * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)" | ||
130 | */ | ||
131 | #define node_to_cpumask_ptr(v, node) \ | ||
132 | const cpumask_t *v = cpumask_of_node(node) | ||
133 | |||
134 | #define node_to_cpumask_ptr_next(v, node) \ | ||
135 | v = cpumask_of_node(node) | ||
136 | |||
137 | #endif /* CONFIG_X86_64 */ | ||
138 | |||
139 | /* | ||
140 | * Returns the number of the node containing Node 'node'. This | 104 | * Returns the number of the node containing Node 'node'. This |
141 | * architecture is flat, so it is a pretty simple function! | 105 | * architecture is flat, so it is a pretty simple function! |
142 | */ | 106 | */ |
143 | #define parent_node(node) (node) | 107 | #define parent_node(node) (node) |
144 | 108 | ||
145 | #define pcibus_to_node(bus) __pcibus_to_node(bus) | 109 | #define pcibus_to_node(bus) __pcibus_to_node(bus) |
146 | #define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus) | ||
147 | 110 | ||
148 | #ifdef CONFIG_X86_32 | 111 | #ifdef CONFIG_X86_32 |
149 | extern unsigned long node_start_pfn[]; | 112 | extern unsigned long node_start_pfn[]; |
@@ -209,40 +172,24 @@ static inline int early_cpu_to_node(int cpu) | |||
209 | return 0; | 172 | return 0; |
210 | } | 173 | } |
211 | 174 | ||
212 | static inline const cpumask_t *cpumask_of_node(int node) | 175 | static inline const struct cpumask *cpumask_of_node(int node) |
213 | { | ||
214 | return &cpu_online_map; | ||
215 | } | ||
216 | static inline cpumask_t node_to_cpumask(int node) | ||
217 | { | 176 | { |
218 | return cpu_online_map; | 177 | return cpu_online_mask; |
219 | } | 178 | } |
220 | 179 | ||
221 | static inline void setup_node_to_cpumask_map(void) { } | 180 | static inline void setup_node_to_cpumask_map(void) { } |
222 | 181 | ||
223 | /* | ||
224 | * Replace default node_to_cpumask_ptr with optimized version | ||
225 | * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)" | ||
226 | */ | ||
227 | #define node_to_cpumask_ptr(v, node) \ | ||
228 | const cpumask_t *v = cpumask_of_node(node) | ||
229 | |||
230 | #define node_to_cpumask_ptr_next(v, node) \ | ||
231 | v = cpumask_of_node(node) | ||
232 | #endif | 182 | #endif |
233 | 183 | ||
234 | #include <asm-generic/topology.h> | 184 | #include <asm-generic/topology.h> |
235 | 185 | ||
236 | extern cpumask_t cpu_coregroup_map(int cpu); | ||
237 | extern const struct cpumask *cpu_coregroup_mask(int cpu); | 186 | extern const struct cpumask *cpu_coregroup_mask(int cpu); |
238 | 187 | ||
239 | #ifdef ENABLE_TOPO_DEFINES | 188 | #ifdef ENABLE_TOPO_DEFINES |
240 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) | 189 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) |
241 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) | 190 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) |
242 | #define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu)) | 191 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) |
243 | #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) | 192 | #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) |
244 | #define topology_core_cpumask(cpu) (&per_cpu(cpu_core_map, cpu)) | ||
245 | #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu)) | ||
246 | 193 | ||
247 | /* indicates that pointers to the topology cpumask_t maps are valid */ | 194 | /* indicates that pointers to the topology cpumask_t maps are valid */ |
248 | #define arch_provides_topology_pointers yes | 195 | #define arch_provides_topology_pointers yes |
@@ -256,7 +203,7 @@ struct pci_bus; | |||
256 | void set_pci_bus_resources_arch_default(struct pci_bus *b); | 203 | void set_pci_bus_resources_arch_default(struct pci_bus *b); |
257 | 204 | ||
258 | #ifdef CONFIG_SMP | 205 | #ifdef CONFIG_SMP |
259 | #define mc_capable() (cpus_weight(per_cpu(cpu_core_map, 0)) != nr_cpu_ids) | 206 | #define mc_capable() (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids) |
260 | #define smt_capable() (smp_num_siblings > 1) | 207 | #define smt_capable() (smp_num_siblings > 1) |
261 | #endif | 208 | #endif |
262 | 209 | ||
diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h index f2bba78430a4..6e72d74cf8dc 100644 --- a/arch/x86/include/asm/unistd_32.h +++ b/arch/x86/include/asm/unistd_32.h | |||
@@ -338,6 +338,8 @@ | |||
338 | #define __NR_dup3 330 | 338 | #define __NR_dup3 330 |
339 | #define __NR_pipe2 331 | 339 | #define __NR_pipe2 331 |
340 | #define __NR_inotify_init1 332 | 340 | #define __NR_inotify_init1 332 |
341 | #define __NR_preadv 333 | ||
342 | #define __NR_pwritev 334 | ||
341 | 343 | ||
342 | #ifdef __KERNEL__ | 344 | #ifdef __KERNEL__ |
343 | 345 | ||
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index d2e415e6666f..f81829462325 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h | |||
@@ -653,6 +653,10 @@ __SYSCALL(__NR_dup3, sys_dup3) | |||
653 | __SYSCALL(__NR_pipe2, sys_pipe2) | 653 | __SYSCALL(__NR_pipe2, sys_pipe2) |
654 | #define __NR_inotify_init1 294 | 654 | #define __NR_inotify_init1 294 |
655 | __SYSCALL(__NR_inotify_init1, sys_inotify_init1) | 655 | __SYSCALL(__NR_inotify_init1, sys_inotify_init1) |
656 | #define __NR_preadv 295 | ||
657 | __SYSCALL(__NR_preadv, sys_preadv) | ||
658 | #define __NR_pwritev 296 | ||
659 | __SYSCALL(__NR_pwritev, sys_pwritev) | ||
656 | 660 | ||
657 | 661 | ||
658 | #ifndef __NO_STUBS | 662 | #ifndef __NO_STUBS |
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 9f4dfba33b28..d3a98ea1062e 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -11,11 +11,13 @@ | |||
11 | #ifndef _ASM_X86_UV_UV_HUB_H | 11 | #ifndef _ASM_X86_UV_UV_HUB_H |
12 | #define _ASM_X86_UV_UV_HUB_H | 12 | #define _ASM_X86_UV_UV_HUB_H |
13 | 13 | ||
14 | #ifdef CONFIG_X86_64 | ||
14 | #include <linux/numa.h> | 15 | #include <linux/numa.h> |
15 | #include <linux/percpu.h> | 16 | #include <linux/percpu.h> |
16 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
17 | #include <asm/types.h> | 18 | #include <asm/types.h> |
18 | #include <asm/percpu.h> | 19 | #include <asm/percpu.h> |
20 | #include <asm/uv/uv_mmrs.h> | ||
19 | 21 | ||
20 | 22 | ||
21 | /* | 23 | /* |
@@ -397,6 +399,7 @@ static inline void uv_set_scir_bits(unsigned char value) | |||
397 | uv_write_local_mmr8(uv_hub_info->scir.offset, value); | 399 | uv_write_local_mmr8(uv_hub_info->scir.offset, value); |
398 | } | 400 | } |
399 | } | 401 | } |
402 | |||
400 | static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value) | 403 | static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value) |
401 | { | 404 | { |
402 | if (uv_cpu_hub_info(cpu)->scir.state != value) { | 405 | if (uv_cpu_hub_info(cpu)->scir.state != value) { |
@@ -405,4 +408,15 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value) | |||
405 | } | 408 | } |
406 | } | 409 | } |
407 | 410 | ||
411 | static inline void uv_hub_send_ipi(int pnode, int apicid, int vector) | ||
412 | { | ||
413 | unsigned long val; | ||
414 | |||
415 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | ||
416 | ((apicid & 0x3f) << UVH_IPI_INT_APIC_ID_SHFT) | | ||
417 | (vector << UVH_IPI_INT_VECTOR_SHFT); | ||
418 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | ||
419 | } | ||
420 | |||
421 | #endif /* CONFIG_X86_64 */ | ||
408 | #endif /* _ASM_X86_UV_UV_HUB_H */ | 422 | #endif /* _ASM_X86_UV_UV_HUB_H */ |
diff --git a/arch/x86/include/asm/uv/uv_mmrs.h b/arch/x86/include/asm/uv/uv_mmrs.h index dd627793a234..db68ac8a5ac2 100644 --- a/arch/x86/include/asm/uv/uv_mmrs.h +++ b/arch/x86/include/asm/uv/uv_mmrs.h | |||
@@ -1,3 +1,4 @@ | |||
1 | |||
1 | /* | 2 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 3 | * This file is subject to the terms and conditions of the GNU General Public |
3 | * License. See the file "COPYING" in the main directory of this archive | 4 | * License. See the file "COPYING" in the main directory of this archive |
@@ -243,6 +244,158 @@ union uvh_event_occurred0_u { | |||
243 | #define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0 | 244 | #define UVH_EVENT_OCCURRED0_ALIAS_32 0x005f0 |
244 | 245 | ||
245 | /* ========================================================================= */ | 246 | /* ========================================================================= */ |
247 | /* UVH_GR0_TLB_INT0_CONFIG */ | ||
248 | /* ========================================================================= */ | ||
249 | #define UVH_GR0_TLB_INT0_CONFIG 0x61b00UL | ||
250 | |||
251 | #define UVH_GR0_TLB_INT0_CONFIG_VECTOR_SHFT 0 | ||
252 | #define UVH_GR0_TLB_INT0_CONFIG_VECTOR_MASK 0x00000000000000ffUL | ||
253 | #define UVH_GR0_TLB_INT0_CONFIG_DM_SHFT 8 | ||
254 | #define UVH_GR0_TLB_INT0_CONFIG_DM_MASK 0x0000000000000700UL | ||
255 | #define UVH_GR0_TLB_INT0_CONFIG_DESTMODE_SHFT 11 | ||
256 | #define UVH_GR0_TLB_INT0_CONFIG_DESTMODE_MASK 0x0000000000000800UL | ||
257 | #define UVH_GR0_TLB_INT0_CONFIG_STATUS_SHFT 12 | ||
258 | #define UVH_GR0_TLB_INT0_CONFIG_STATUS_MASK 0x0000000000001000UL | ||
259 | #define UVH_GR0_TLB_INT0_CONFIG_P_SHFT 13 | ||
260 | #define UVH_GR0_TLB_INT0_CONFIG_P_MASK 0x0000000000002000UL | ||
261 | #define UVH_GR0_TLB_INT0_CONFIG_T_SHFT 15 | ||
262 | #define UVH_GR0_TLB_INT0_CONFIG_T_MASK 0x0000000000008000UL | ||
263 | #define UVH_GR0_TLB_INT0_CONFIG_M_SHFT 16 | ||
264 | #define UVH_GR0_TLB_INT0_CONFIG_M_MASK 0x0000000000010000UL | ||
265 | #define UVH_GR0_TLB_INT0_CONFIG_APIC_ID_SHFT 32 | ||
266 | #define UVH_GR0_TLB_INT0_CONFIG_APIC_ID_MASK 0xffffffff00000000UL | ||
267 | |||
268 | union uvh_gr0_tlb_int0_config_u { | ||
269 | unsigned long v; | ||
270 | struct uvh_gr0_tlb_int0_config_s { | ||
271 | unsigned long vector_ : 8; /* RW */ | ||
272 | unsigned long dm : 3; /* RW */ | ||
273 | unsigned long destmode : 1; /* RW */ | ||
274 | unsigned long status : 1; /* RO */ | ||
275 | unsigned long p : 1; /* RO */ | ||
276 | unsigned long rsvd_14 : 1; /* */ | ||
277 | unsigned long t : 1; /* RO */ | ||
278 | unsigned long m : 1; /* RW */ | ||
279 | unsigned long rsvd_17_31: 15; /* */ | ||
280 | unsigned long apic_id : 32; /* RW */ | ||
281 | } s; | ||
282 | }; | ||
283 | |||
284 | /* ========================================================================= */ | ||
285 | /* UVH_GR0_TLB_INT1_CONFIG */ | ||
286 | /* ========================================================================= */ | ||
287 | #define UVH_GR0_TLB_INT1_CONFIG 0x61b40UL | ||
288 | |||
289 | #define UVH_GR0_TLB_INT1_CONFIG_VECTOR_SHFT 0 | ||
290 | #define UVH_GR0_TLB_INT1_CONFIG_VECTOR_MASK 0x00000000000000ffUL | ||
291 | #define UVH_GR0_TLB_INT1_CONFIG_DM_SHFT 8 | ||
292 | #define UVH_GR0_TLB_INT1_CONFIG_DM_MASK 0x0000000000000700UL | ||
293 | #define UVH_GR0_TLB_INT1_CONFIG_DESTMODE_SHFT 11 | ||
294 | #define UVH_GR0_TLB_INT1_CONFIG_DESTMODE_MASK 0x0000000000000800UL | ||
295 | #define UVH_GR0_TLB_INT1_CONFIG_STATUS_SHFT 12 | ||
296 | #define UVH_GR0_TLB_INT1_CONFIG_STATUS_MASK 0x0000000000001000UL | ||
297 | #define UVH_GR0_TLB_INT1_CONFIG_P_SHFT 13 | ||
298 | #define UVH_GR0_TLB_INT1_CONFIG_P_MASK 0x0000000000002000UL | ||
299 | #define UVH_GR0_TLB_INT1_CONFIG_T_SHFT 15 | ||
300 | #define UVH_GR0_TLB_INT1_CONFIG_T_MASK 0x0000000000008000UL | ||
301 | #define UVH_GR0_TLB_INT1_CONFIG_M_SHFT 16 | ||
302 | #define UVH_GR0_TLB_INT1_CONFIG_M_MASK 0x0000000000010000UL | ||
303 | #define UVH_GR0_TLB_INT1_CONFIG_APIC_ID_SHFT 32 | ||
304 | #define UVH_GR0_TLB_INT1_CONFIG_APIC_ID_MASK 0xffffffff00000000UL | ||
305 | |||
306 | union uvh_gr0_tlb_int1_config_u { | ||
307 | unsigned long v; | ||
308 | struct uvh_gr0_tlb_int1_config_s { | ||
309 | unsigned long vector_ : 8; /* RW */ | ||
310 | unsigned long dm : 3; /* RW */ | ||
311 | unsigned long destmode : 1; /* RW */ | ||
312 | unsigned long status : 1; /* RO */ | ||
313 | unsigned long p : 1; /* RO */ | ||
314 | unsigned long rsvd_14 : 1; /* */ | ||
315 | unsigned long t : 1; /* RO */ | ||
316 | unsigned long m : 1; /* RW */ | ||
317 | unsigned long rsvd_17_31: 15; /* */ | ||
318 | unsigned long apic_id : 32; /* RW */ | ||
319 | } s; | ||
320 | }; | ||
321 | |||
322 | /* ========================================================================= */ | ||
323 | /* UVH_GR1_TLB_INT0_CONFIG */ | ||
324 | /* ========================================================================= */ | ||
325 | #define UVH_GR1_TLB_INT0_CONFIG 0x61f00UL | ||
326 | |||
327 | #define UVH_GR1_TLB_INT0_CONFIG_VECTOR_SHFT 0 | ||
328 | #define UVH_GR1_TLB_INT0_CONFIG_VECTOR_MASK 0x00000000000000ffUL | ||
329 | #define UVH_GR1_TLB_INT0_CONFIG_DM_SHFT 8 | ||
330 | #define UVH_GR1_TLB_INT0_CONFIG_DM_MASK 0x0000000000000700UL | ||
331 | #define UVH_GR1_TLB_INT0_CONFIG_DESTMODE_SHFT 11 | ||
332 | #define UVH_GR1_TLB_INT0_CONFIG_DESTMODE_MASK 0x0000000000000800UL | ||
333 | #define UVH_GR1_TLB_INT0_CONFIG_STATUS_SHFT 12 | ||
334 | #define UVH_GR1_TLB_INT0_CONFIG_STATUS_MASK 0x0000000000001000UL | ||
335 | #define UVH_GR1_TLB_INT0_CONFIG_P_SHFT 13 | ||
336 | #define UVH_GR1_TLB_INT0_CONFIG_P_MASK 0x0000000000002000UL | ||
337 | #define UVH_GR1_TLB_INT0_CONFIG_T_SHFT 15 | ||
338 | #define UVH_GR1_TLB_INT0_CONFIG_T_MASK 0x0000000000008000UL | ||
339 | #define UVH_GR1_TLB_INT0_CONFIG_M_SHFT 16 | ||
340 | #define UVH_GR1_TLB_INT0_CONFIG_M_MASK 0x0000000000010000UL | ||
341 | #define UVH_GR1_TLB_INT0_CONFIG_APIC_ID_SHFT 32 | ||
342 | #define UVH_GR1_TLB_INT0_CONFIG_APIC_ID_MASK 0xffffffff00000000UL | ||
343 | |||
344 | union uvh_gr1_tlb_int0_config_u { | ||
345 | unsigned long v; | ||
346 | struct uvh_gr1_tlb_int0_config_s { | ||
347 | unsigned long vector_ : 8; /* RW */ | ||
348 | unsigned long dm : 3; /* RW */ | ||
349 | unsigned long destmode : 1; /* RW */ | ||
350 | unsigned long status : 1; /* RO */ | ||
351 | unsigned long p : 1; /* RO */ | ||
352 | unsigned long rsvd_14 : 1; /* */ | ||
353 | unsigned long t : 1; /* RO */ | ||
354 | unsigned long m : 1; /* RW */ | ||
355 | unsigned long rsvd_17_31: 15; /* */ | ||
356 | unsigned long apic_id : 32; /* RW */ | ||
357 | } s; | ||
358 | }; | ||
359 | |||
360 | /* ========================================================================= */ | ||
361 | /* UVH_GR1_TLB_INT1_CONFIG */ | ||
362 | /* ========================================================================= */ | ||
363 | #define UVH_GR1_TLB_INT1_CONFIG 0x61f40UL | ||
364 | |||
365 | #define UVH_GR1_TLB_INT1_CONFIG_VECTOR_SHFT 0 | ||
366 | #define UVH_GR1_TLB_INT1_CONFIG_VECTOR_MASK 0x00000000000000ffUL | ||
367 | #define UVH_GR1_TLB_INT1_CONFIG_DM_SHFT 8 | ||
368 | #define UVH_GR1_TLB_INT1_CONFIG_DM_MASK 0x0000000000000700UL | ||
369 | #define UVH_GR1_TLB_INT1_CONFIG_DESTMODE_SHFT 11 | ||
370 | #define UVH_GR1_TLB_INT1_CONFIG_DESTMODE_MASK 0x0000000000000800UL | ||
371 | #define UVH_GR1_TLB_INT1_CONFIG_STATUS_SHFT 12 | ||
372 | #define UVH_GR1_TLB_INT1_CONFIG_STATUS_MASK 0x0000000000001000UL | ||
373 | #define UVH_GR1_TLB_INT1_CONFIG_P_SHFT 13 | ||
374 | #define UVH_GR1_TLB_INT1_CONFIG_P_MASK 0x0000000000002000UL | ||
375 | #define UVH_GR1_TLB_INT1_CONFIG_T_SHFT 15 | ||
376 | #define UVH_GR1_TLB_INT1_CONFIG_T_MASK 0x0000000000008000UL | ||
377 | #define UVH_GR1_TLB_INT1_CONFIG_M_SHFT 16 | ||
378 | #define UVH_GR1_TLB_INT1_CONFIG_M_MASK 0x0000000000010000UL | ||
379 | #define UVH_GR1_TLB_INT1_CONFIG_APIC_ID_SHFT 32 | ||
380 | #define UVH_GR1_TLB_INT1_CONFIG_APIC_ID_MASK 0xffffffff00000000UL | ||
381 | |||
382 | union uvh_gr1_tlb_int1_config_u { | ||
383 | unsigned long v; | ||
384 | struct uvh_gr1_tlb_int1_config_s { | ||
385 | unsigned long vector_ : 8; /* RW */ | ||
386 | unsigned long dm : 3; /* RW */ | ||
387 | unsigned long destmode : 1; /* RW */ | ||
388 | unsigned long status : 1; /* RO */ | ||
389 | unsigned long p : 1; /* RO */ | ||
390 | unsigned long rsvd_14 : 1; /* */ | ||
391 | unsigned long t : 1; /* RO */ | ||
392 | unsigned long m : 1; /* RW */ | ||
393 | unsigned long rsvd_17_31: 15; /* */ | ||
394 | unsigned long apic_id : 32; /* RW */ | ||
395 | } s; | ||
396 | }; | ||
397 | |||
398 | /* ========================================================================= */ | ||
246 | /* UVH_INT_CMPB */ | 399 | /* UVH_INT_CMPB */ |
247 | /* ========================================================================= */ | 400 | /* ========================================================================= */ |
248 | #define UVH_INT_CMPB 0x22080UL | 401 | #define UVH_INT_CMPB 0x22080UL |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index c611ad64137f..145cce75cda7 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -66,7 +66,8 @@ obj-$(CONFIG_X86_MPPARSE) += mpparse.o | |||
66 | obj-y += apic/ | 66 | obj-y += apic/ |
67 | obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o | 67 | obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o |
68 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | 68 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o |
69 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o | 69 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o |
70 | obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o | ||
70 | obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o | 71 | obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o |
71 | obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o | 72 | obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o |
72 | obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o | 73 | obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o |
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 4c80f1557433..f57658702571 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/kprobes.h> | 5 | #include <linux/kprobes.h> |
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/vmalloc.h> | 7 | #include <linux/vmalloc.h> |
8 | #include <linux/memory.h> | ||
8 | #include <asm/alternative.h> | 9 | #include <asm/alternative.h> |
9 | #include <asm/sections.h> | 10 | #include <asm/sections.h> |
10 | #include <asm/pgtable.h> | 11 | #include <asm/pgtable.h> |
@@ -12,7 +13,9 @@ | |||
12 | #include <asm/nmi.h> | 13 | #include <asm/nmi.h> |
13 | #include <asm/vsyscall.h> | 14 | #include <asm/vsyscall.h> |
14 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
16 | #include <asm/tlbflush.h> | ||
15 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | #include <asm/fixmap.h> | ||
16 | 19 | ||
17 | #define MAX_PATCH_LEN (255-1) | 20 | #define MAX_PATCH_LEN (255-1) |
18 | 21 | ||
@@ -226,6 +229,7 @@ static void alternatives_smp_lock(u8 **start, u8 **end, u8 *text, u8 *text_end) | |||
226 | { | 229 | { |
227 | u8 **ptr; | 230 | u8 **ptr; |
228 | 231 | ||
232 | mutex_lock(&text_mutex); | ||
229 | for (ptr = start; ptr < end; ptr++) { | 233 | for (ptr = start; ptr < end; ptr++) { |
230 | if (*ptr < text) | 234 | if (*ptr < text) |
231 | continue; | 235 | continue; |
@@ -234,6 +238,7 @@ static void alternatives_smp_lock(u8 **start, u8 **end, u8 *text, u8 *text_end) | |||
234 | /* turn DS segment override prefix into lock prefix */ | 238 | /* turn DS segment override prefix into lock prefix */ |
235 | text_poke(*ptr, ((unsigned char []){0xf0}), 1); | 239 | text_poke(*ptr, ((unsigned char []){0xf0}), 1); |
236 | }; | 240 | }; |
241 | mutex_unlock(&text_mutex); | ||
237 | } | 242 | } |
238 | 243 | ||
239 | static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end) | 244 | static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end) |
@@ -243,6 +248,7 @@ static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end | |||
243 | if (noreplace_smp) | 248 | if (noreplace_smp) |
244 | return; | 249 | return; |
245 | 250 | ||
251 | mutex_lock(&text_mutex); | ||
246 | for (ptr = start; ptr < end; ptr++) { | 252 | for (ptr = start; ptr < end; ptr++) { |
247 | if (*ptr < text) | 253 | if (*ptr < text) |
248 | continue; | 254 | continue; |
@@ -251,6 +257,7 @@ static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end | |||
251 | /* turn lock prefix into DS segment override prefix */ | 257 | /* turn lock prefix into DS segment override prefix */ |
252 | text_poke(*ptr, ((unsigned char []){0x3E}), 1); | 258 | text_poke(*ptr, ((unsigned char []){0x3E}), 1); |
253 | }; | 259 | }; |
260 | mutex_unlock(&text_mutex); | ||
254 | } | 261 | } |
255 | 262 | ||
256 | struct smp_alt_module { | 263 | struct smp_alt_module { |
@@ -500,15 +507,16 @@ void *text_poke_early(void *addr, const void *opcode, size_t len) | |||
500 | * It means the size must be writable atomically and the address must be aligned | 507 | * It means the size must be writable atomically and the address must be aligned |
501 | * in a way that permits an atomic write. It also makes sure we fit on a single | 508 | * in a way that permits an atomic write. It also makes sure we fit on a single |
502 | * page. | 509 | * page. |
510 | * | ||
511 | * Note: Must be called under text_mutex. | ||
503 | */ | 512 | */ |
504 | void *__kprobes text_poke(void *addr, const void *opcode, size_t len) | 513 | void *__kprobes text_poke(void *addr, const void *opcode, size_t len) |
505 | { | 514 | { |
515 | unsigned long flags; | ||
506 | char *vaddr; | 516 | char *vaddr; |
507 | int nr_pages = 2; | ||
508 | struct page *pages[2]; | 517 | struct page *pages[2]; |
509 | int i; | 518 | int i; |
510 | 519 | ||
511 | might_sleep(); | ||
512 | if (!core_kernel_text((unsigned long)addr)) { | 520 | if (!core_kernel_text((unsigned long)addr)) { |
513 | pages[0] = vmalloc_to_page(addr); | 521 | pages[0] = vmalloc_to_page(addr); |
514 | pages[1] = vmalloc_to_page(addr + PAGE_SIZE); | 522 | pages[1] = vmalloc_to_page(addr + PAGE_SIZE); |
@@ -518,18 +526,21 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len) | |||
518 | pages[1] = virt_to_page(addr + PAGE_SIZE); | 526 | pages[1] = virt_to_page(addr + PAGE_SIZE); |
519 | } | 527 | } |
520 | BUG_ON(!pages[0]); | 528 | BUG_ON(!pages[0]); |
521 | if (!pages[1]) | 529 | local_irq_save(flags); |
522 | nr_pages = 1; | 530 | set_fixmap(FIX_TEXT_POKE0, page_to_phys(pages[0])); |
523 | vaddr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL); | 531 | if (pages[1]) |
524 | BUG_ON(!vaddr); | 532 | set_fixmap(FIX_TEXT_POKE1, page_to_phys(pages[1])); |
525 | local_irq_disable(); | 533 | vaddr = (char *)fix_to_virt(FIX_TEXT_POKE0); |
526 | memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len); | 534 | memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len); |
527 | local_irq_enable(); | 535 | clear_fixmap(FIX_TEXT_POKE0); |
528 | vunmap(vaddr); | 536 | if (pages[1]) |
537 | clear_fixmap(FIX_TEXT_POKE1); | ||
538 | local_flush_tlb(); | ||
529 | sync_core(); | 539 | sync_core(); |
530 | /* Could also do a CLFLUSH here to speed up CPU recovery; but | 540 | /* Could also do a CLFLUSH here to speed up CPU recovery; but |
531 | that causes hangs on some VIA CPUs. */ | 541 | that causes hangs on some VIA CPUs. */ |
532 | for (i = 0; i < len; i++) | 542 | for (i = 0; i < len; i++) |
533 | BUG_ON(((char *)addr)[i] != ((char *)opcode)[i]); | 543 | BUG_ON(((char *)addr)[i] != ((char *)opcode)[i]); |
544 | local_irq_restore(flags); | ||
534 | return addr; | 545 | return addr; |
535 | } | 546 | } |
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index c5962fe3796f..a97db99dad52 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -1928,6 +1928,12 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom, | |||
1928 | return paddr; | 1928 | return paddr; |
1929 | } | 1929 | } |
1930 | 1930 | ||
1931 | static int amd_iommu_domain_has_cap(struct iommu_domain *domain, | ||
1932 | unsigned long cap) | ||
1933 | { | ||
1934 | return 0; | ||
1935 | } | ||
1936 | |||
1931 | static struct iommu_ops amd_iommu_ops = { | 1937 | static struct iommu_ops amd_iommu_ops = { |
1932 | .domain_init = amd_iommu_domain_init, | 1938 | .domain_init = amd_iommu_domain_init, |
1933 | .domain_destroy = amd_iommu_domain_destroy, | 1939 | .domain_destroy = amd_iommu_domain_destroy, |
@@ -1936,5 +1942,6 @@ static struct iommu_ops amd_iommu_ops = { | |||
1936 | .map = amd_iommu_map_range, | 1942 | .map = amd_iommu_map_range, |
1937 | .unmap = amd_iommu_unmap_range, | 1943 | .unmap = amd_iommu_unmap_range, |
1938 | .iova_to_phys = amd_iommu_iova_to_phys, | 1944 | .iova_to_phys = amd_iommu_iova_to_phys, |
1945 | .domain_has_cap = amd_iommu_domain_has_cap, | ||
1939 | }; | 1946 | }; |
1940 | 1947 | ||
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index d806ecaa948f..676cdac385c0 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
@@ -26,12 +26,12 @@ static int bigsmp_apic_id_registered(void) | |||
26 | return 1; | 26 | return 1; |
27 | } | 27 | } |
28 | 28 | ||
29 | static const cpumask_t *bigsmp_target_cpus(void) | 29 | static const struct cpumask *bigsmp_target_cpus(void) |
30 | { | 30 | { |
31 | #ifdef CONFIG_SMP | 31 | #ifdef CONFIG_SMP |
32 | return &cpu_online_map; | 32 | return cpu_online_mask; |
33 | #else | 33 | #else |
34 | return &cpumask_of_cpu(0); | 34 | return cpumask_of(0); |
35 | #endif | 35 | #endif |
36 | } | 36 | } |
37 | 37 | ||
@@ -118,9 +118,9 @@ static int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid) | |||
118 | } | 118 | } |
119 | 119 | ||
120 | /* As we are using single CPU as destination, pick only one CPU here */ | 120 | /* As we are using single CPU as destination, pick only one CPU here */ |
121 | static unsigned int bigsmp_cpu_mask_to_apicid(const cpumask_t *cpumask) | 121 | static unsigned int bigsmp_cpu_mask_to_apicid(const struct cpumask *cpumask) |
122 | { | 122 | { |
123 | return bigsmp_cpu_to_logical_apicid(first_cpu(*cpumask)); | 123 | return bigsmp_cpu_to_logical_apicid(cpumask_first(cpumask)); |
124 | } | 124 | } |
125 | 125 | ||
126 | static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | 126 | static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask, |
@@ -188,10 +188,10 @@ static const struct dmi_system_id bigsmp_dmi_table[] = { | |||
188 | { } /* NULL entry stops DMI scanning */ | 188 | { } /* NULL entry stops DMI scanning */ |
189 | }; | 189 | }; |
190 | 190 | ||
191 | static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask) | 191 | static void bigsmp_vector_allocation_domain(int cpu, struct cpumask *retmask) |
192 | { | 192 | { |
193 | cpus_clear(*retmask); | 193 | cpumask_clear(retmask); |
194 | cpu_set(cpu, *retmask); | 194 | cpumask_set_cpu(cpu, retmask); |
195 | } | 195 | } |
196 | 196 | ||
197 | static int probe_bigsmp(void) | 197 | static int probe_bigsmp(void) |
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index 19588f2770ee..1c11b819f245 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c | |||
@@ -410,7 +410,7 @@ static void es7000_enable_apic_mode(void) | |||
410 | WARN(1, "Command failed, status = %x\n", mip_status); | 410 | WARN(1, "Command failed, status = %x\n", mip_status); |
411 | } | 411 | } |
412 | 412 | ||
413 | static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask) | 413 | static void es7000_vector_allocation_domain(int cpu, struct cpumask *retmask) |
414 | { | 414 | { |
415 | /* Careful. Some cpus do not strictly honor the set of cpus | 415 | /* Careful. Some cpus do not strictly honor the set of cpus |
416 | * specified in the interrupt destination when using lowest | 416 | * specified in the interrupt destination when using lowest |
@@ -420,7 +420,8 @@ static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask) | |||
420 | * deliver interrupts to the wrong hyperthread when only one | 420 | * deliver interrupts to the wrong hyperthread when only one |
421 | * hyperthread was specified in the interrupt desitination. | 421 | * hyperthread was specified in the interrupt desitination. |
422 | */ | 422 | */ |
423 | *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } }; | 423 | cpumask_clear(retmask); |
424 | cpumask_bits(retmask)[0] = APIC_ALL_CPUS; | ||
424 | } | 425 | } |
425 | 426 | ||
426 | 427 | ||
@@ -455,14 +456,14 @@ static int es7000_apic_id_registered(void) | |||
455 | return 1; | 456 | return 1; |
456 | } | 457 | } |
457 | 458 | ||
458 | static const cpumask_t *target_cpus_cluster(void) | 459 | static const struct cpumask *target_cpus_cluster(void) |
459 | { | 460 | { |
460 | return &CPU_MASK_ALL; | 461 | return cpu_all_mask; |
461 | } | 462 | } |
462 | 463 | ||
463 | static const cpumask_t *es7000_target_cpus(void) | 464 | static const struct cpumask *es7000_target_cpus(void) |
464 | { | 465 | { |
465 | return &cpumask_of_cpu(smp_processor_id()); | 466 | return cpumask_of(smp_processor_id()); |
466 | } | 467 | } |
467 | 468 | ||
468 | static unsigned long | 469 | static unsigned long |
@@ -517,7 +518,7 @@ static void es7000_setup_apic_routing(void) | |||
517 | "Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n", | 518 | "Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n", |
518 | (apic_version[apic] == 0x14) ? | 519 | (apic_version[apic] == 0x14) ? |
519 | "Physical Cluster" : "Logical Cluster", | 520 | "Physical Cluster" : "Logical Cluster", |
520 | nr_ioapics, cpus_addr(*es7000_target_cpus())[0]); | 521 | nr_ioapics, cpumask_bits(es7000_target_cpus())[0]); |
521 | } | 522 | } |
522 | 523 | ||
523 | static int es7000_apicid_to_node(int logical_apicid) | 524 | static int es7000_apicid_to_node(int logical_apicid) |
@@ -572,7 +573,7 @@ static int es7000_check_phys_apicid_present(int cpu_physical_apicid) | |||
572 | return 1; | 573 | return 1; |
573 | } | 574 | } |
574 | 575 | ||
575 | static unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask) | 576 | static unsigned int es7000_cpu_mask_to_apicid(const struct cpumask *cpumask) |
576 | { | 577 | { |
577 | unsigned int round = 0; | 578 | unsigned int round = 0; |
578 | int cpu, uninitialized_var(apicid); | 579 | int cpu, uninitialized_var(apicid); |
diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c index bdfad80c3cf1..d6bd62407152 100644 --- a/arch/x86/kernel/apic/nmi.c +++ b/arch/x86/kernel/apic/nmi.c | |||
@@ -39,7 +39,7 @@ | |||
39 | int unknown_nmi_panic; | 39 | int unknown_nmi_panic; |
40 | int nmi_watchdog_enabled; | 40 | int nmi_watchdog_enabled; |
41 | 41 | ||
42 | static cpumask_t backtrace_mask = CPU_MASK_NONE; | 42 | static cpumask_var_t backtrace_mask; |
43 | 43 | ||
44 | /* nmi_active: | 44 | /* nmi_active: |
45 | * >0: the lapic NMI watchdog is active, but can be disabled | 45 | * >0: the lapic NMI watchdog is active, but can be disabled |
@@ -138,6 +138,7 @@ int __init check_nmi_watchdog(void) | |||
138 | if (!prev_nmi_count) | 138 | if (!prev_nmi_count) |
139 | goto error; | 139 | goto error; |
140 | 140 | ||
141 | alloc_cpumask_var(&backtrace_mask, GFP_KERNEL); | ||
141 | printk(KERN_INFO "Testing NMI watchdog ... "); | 142 | printk(KERN_INFO "Testing NMI watchdog ... "); |
142 | 143 | ||
143 | #ifdef CONFIG_SMP | 144 | #ifdef CONFIG_SMP |
@@ -413,14 +414,14 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason) | |||
413 | touched = 1; | 414 | touched = 1; |
414 | } | 415 | } |
415 | 416 | ||
416 | if (cpu_isset(cpu, backtrace_mask)) { | 417 | if (cpumask_test_cpu(cpu, backtrace_mask)) { |
417 | static DEFINE_SPINLOCK(lock); /* Serialise the printks */ | 418 | static DEFINE_SPINLOCK(lock); /* Serialise the printks */ |
418 | 419 | ||
419 | spin_lock(&lock); | 420 | spin_lock(&lock); |
420 | printk(KERN_WARNING "NMI backtrace for cpu %d\n", cpu); | 421 | printk(KERN_WARNING "NMI backtrace for cpu %d\n", cpu); |
421 | dump_stack(); | 422 | dump_stack(); |
422 | spin_unlock(&lock); | 423 | spin_unlock(&lock); |
423 | cpu_clear(cpu, backtrace_mask); | 424 | cpumask_clear_cpu(cpu, backtrace_mask); |
424 | } | 425 | } |
425 | 426 | ||
426 | /* Could check oops_in_progress here too, but it's safer not to */ | 427 | /* Could check oops_in_progress here too, but it's safer not to */ |
@@ -554,10 +555,10 @@ void __trigger_all_cpu_backtrace(void) | |||
554 | { | 555 | { |
555 | int i; | 556 | int i; |
556 | 557 | ||
557 | backtrace_mask = cpu_online_map; | 558 | cpumask_copy(backtrace_mask, cpu_online_mask); |
558 | /* Wait for up to 10 seconds for all CPUs to do the backtrace */ | 559 | /* Wait for up to 10 seconds for all CPUs to do the backtrace */ |
559 | for (i = 0; i < 10 * 1000; i++) { | 560 | for (i = 0; i < 10 * 1000; i++) { |
560 | if (cpus_empty(backtrace_mask)) | 561 | if (cpumask_empty(backtrace_mask)) |
561 | break; | 562 | break; |
562 | mdelay(1); | 563 | mdelay(1); |
563 | } | 564 | } |
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index ba2fc6465534..533e59c6fc82 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -334,9 +334,9 @@ static inline void numaq_smp_callin_clear_local_apic(void) | |||
334 | clear_local_APIC(); | 334 | clear_local_APIC(); |
335 | } | 335 | } |
336 | 336 | ||
337 | static inline const cpumask_t *numaq_target_cpus(void) | 337 | static inline const struct cpumask *numaq_target_cpus(void) |
338 | { | 338 | { |
339 | return &CPU_MASK_ALL; | 339 | return cpu_all_mask; |
340 | } | 340 | } |
341 | 341 | ||
342 | static inline unsigned long | 342 | static inline unsigned long |
@@ -427,7 +427,7 @@ static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid) | |||
427 | * We use physical apicids here, not logical, so just return the default | 427 | * We use physical apicids here, not logical, so just return the default |
428 | * physical broadcast to stop people from breaking us | 428 | * physical broadcast to stop people from breaking us |
429 | */ | 429 | */ |
430 | static inline unsigned int numaq_cpu_mask_to_apicid(const cpumask_t *cpumask) | 430 | static unsigned int numaq_cpu_mask_to_apicid(const struct cpumask *cpumask) |
431 | { | 431 | { |
432 | return 0x0F; | 432 | return 0x0F; |
433 | } | 433 | } |
@@ -462,7 +462,7 @@ static int probe_numaq(void) | |||
462 | return found_numaq; | 462 | return found_numaq; |
463 | } | 463 | } |
464 | 464 | ||
465 | static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask) | 465 | static void numaq_vector_allocation_domain(int cpu, struct cpumask *retmask) |
466 | { | 466 | { |
467 | /* Careful. Some cpus do not strictly honor the set of cpus | 467 | /* Careful. Some cpus do not strictly honor the set of cpus |
468 | * specified in the interrupt destination when using lowest | 468 | * specified in the interrupt destination when using lowest |
@@ -472,7 +472,8 @@ static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask) | |||
472 | * deliver interrupts to the wrong hyperthread when only one | 472 | * deliver interrupts to the wrong hyperthread when only one |
473 | * hyperthread was specified in the interrupt desitination. | 473 | * hyperthread was specified in the interrupt desitination. |
474 | */ | 474 | */ |
475 | *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } }; | 475 | cpumask_clear(retmask); |
476 | cpumask_bits(retmask)[0] = APIC_ALL_CPUS; | ||
476 | } | 477 | } |
477 | 478 | ||
478 | static void numaq_setup_portio_remap(void) | 479 | static void numaq_setup_portio_remap(void) |
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 141c99a1c264..01eda2ac65e4 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
@@ -83,7 +83,8 @@ static void default_vector_allocation_domain(int cpu, struct cpumask *retmask) | |||
83 | * deliver interrupts to the wrong hyperthread when only one | 83 | * deliver interrupts to the wrong hyperthread when only one |
84 | * hyperthread was specified in the interrupt desitination. | 84 | * hyperthread was specified in the interrupt desitination. |
85 | */ | 85 | */ |
86 | *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } }; | 86 | cpumask_clear(retmask); |
87 | cpumask_bits(retmask)[0] = APIC_ALL_CPUS; | ||
87 | } | 88 | } |
88 | 89 | ||
89 | /* should be called last. */ | 90 | /* should be called last. */ |
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c index aac52fa873ff..9cfe1f415d81 100644 --- a/arch/x86/kernel/apic/summit_32.c +++ b/arch/x86/kernel/apic/summit_32.c | |||
@@ -53,23 +53,19 @@ static unsigned summit_get_apic_id(unsigned long x) | |||
53 | return (x >> 24) & 0xFF; | 53 | return (x >> 24) & 0xFF; |
54 | } | 54 | } |
55 | 55 | ||
56 | static inline void summit_send_IPI_mask(const cpumask_t *mask, int vector) | 56 | static inline void summit_send_IPI_mask(const struct cpumask *mask, int vector) |
57 | { | 57 | { |
58 | default_send_IPI_mask_sequence_logical(mask, vector); | 58 | default_send_IPI_mask_sequence_logical(mask, vector); |
59 | } | 59 | } |
60 | 60 | ||
61 | static void summit_send_IPI_allbutself(int vector) | 61 | static void summit_send_IPI_allbutself(int vector) |
62 | { | 62 | { |
63 | cpumask_t mask = cpu_online_map; | 63 | default_send_IPI_mask_allbutself_logical(cpu_online_mask, vector); |
64 | cpu_clear(smp_processor_id(), mask); | ||
65 | |||
66 | if (!cpus_empty(mask)) | ||
67 | summit_send_IPI_mask(&mask, vector); | ||
68 | } | 64 | } |
69 | 65 | ||
70 | static void summit_send_IPI_all(int vector) | 66 | static void summit_send_IPI_all(int vector) |
71 | { | 67 | { |
72 | summit_send_IPI_mask(&cpu_online_map, vector); | 68 | summit_send_IPI_mask(cpu_online_mask, vector); |
73 | } | 69 | } |
74 | 70 | ||
75 | #include <asm/tsc.h> | 71 | #include <asm/tsc.h> |
@@ -186,13 +182,13 @@ static inline int is_WPEG(struct rio_detail *rio){ | |||
186 | 182 | ||
187 | #define SUMMIT_APIC_DFR_VALUE (APIC_DFR_CLUSTER) | 183 | #define SUMMIT_APIC_DFR_VALUE (APIC_DFR_CLUSTER) |
188 | 184 | ||
189 | static const cpumask_t *summit_target_cpus(void) | 185 | static const struct cpumask *summit_target_cpus(void) |
190 | { | 186 | { |
191 | /* CPU_MASK_ALL (0xff) has undefined behaviour with | 187 | /* CPU_MASK_ALL (0xff) has undefined behaviour with |
192 | * dest_LowestPrio mode logical clustered apic interrupt routing | 188 | * dest_LowestPrio mode logical clustered apic interrupt routing |
193 | * Just start on cpu 0. IRQ balancing will spread load | 189 | * Just start on cpu 0. IRQ balancing will spread load |
194 | */ | 190 | */ |
195 | return &cpumask_of_cpu(0); | 191 | return cpumask_of(0); |
196 | } | 192 | } |
197 | 193 | ||
198 | static unsigned long summit_check_apicid_used(physid_mask_t bitmap, int apicid) | 194 | static unsigned long summit_check_apicid_used(physid_mask_t bitmap, int apicid) |
@@ -289,7 +285,7 @@ static int summit_check_phys_apicid_present(int boot_cpu_physical_apicid) | |||
289 | return 1; | 285 | return 1; |
290 | } | 286 | } |
291 | 287 | ||
292 | static unsigned int summit_cpu_mask_to_apicid(const cpumask_t *cpumask) | 288 | static unsigned int summit_cpu_mask_to_apicid(const struct cpumask *cpumask) |
293 | { | 289 | { |
294 | unsigned int round = 0; | 290 | unsigned int round = 0; |
295 | int cpu, apicid = 0; | 291 | int cpu, apicid = 0; |
@@ -346,7 +342,7 @@ static int probe_summit(void) | |||
346 | return 0; | 342 | return 0; |
347 | } | 343 | } |
348 | 344 | ||
349 | static void summit_vector_allocation_domain(int cpu, cpumask_t *retmask) | 345 | static void summit_vector_allocation_domain(int cpu, struct cpumask *retmask) |
350 | { | 346 | { |
351 | /* Careful. Some cpus do not strictly honor the set of cpus | 347 | /* Careful. Some cpus do not strictly honor the set of cpus |
352 | * specified in the interrupt destination when using lowest | 348 | * specified in the interrupt destination when using lowest |
@@ -356,7 +352,8 @@ static void summit_vector_allocation_domain(int cpu, cpumask_t *retmask) | |||
356 | * deliver interrupts to the wrong hyperthread when only one | 352 | * deliver interrupts to the wrong hyperthread when only one |
357 | * hyperthread was specified in the interrupt desitination. | 353 | * hyperthread was specified in the interrupt desitination. |
358 | */ | 354 | */ |
359 | *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } }; | 355 | cpumask_clear(retmask); |
356 | cpumask_bits(retmask)[0] = APIC_ALL_CPUS; | ||
360 | } | 357 | } |
361 | 358 | ||
362 | #ifdef CONFIG_X86_SUMMIT_NUMA | 359 | #ifdef CONFIG_X86_SUMMIT_NUMA |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 1bd6da1f8fad..1248318436e8 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -118,17 +118,12 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) | |||
118 | 118 | ||
119 | static void uv_send_IPI_one(int cpu, int vector) | 119 | static void uv_send_IPI_one(int cpu, int vector) |
120 | { | 120 | { |
121 | unsigned long val, apicid; | 121 | unsigned long apicid; |
122 | int pnode; | 122 | int pnode; |
123 | 123 | ||
124 | apicid = per_cpu(x86_cpu_to_apicid, cpu); | 124 | apicid = per_cpu(x86_cpu_to_apicid, cpu); |
125 | pnode = uv_apicid_to_pnode(apicid); | 125 | pnode = uv_apicid_to_pnode(apicid); |
126 | 126 | uv_hub_send_ipi(pnode, apicid, vector); | |
127 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | ||
128 | (apicid << UVH_IPI_INT_APIC_ID_SHFT) | | ||
129 | (vector << UVH_IPI_INT_VECTOR_SHFT); | ||
130 | |||
131 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | ||
132 | } | 127 | } |
133 | 128 | ||
134 | static void uv_send_IPI_mask(const struct cpumask *mask, int vector) | 129 | static void uv_send_IPI_mask(const struct cpumask *mask, int vector) |
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index ac7783a67432..49e0939bac42 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c | |||
@@ -466,7 +466,7 @@ static const lookup_t error_table[] = { | |||
466 | * @err: APM BIOS return code | 466 | * @err: APM BIOS return code |
467 | * | 467 | * |
468 | * Write a meaningful log entry to the kernel log in the event of | 468 | * Write a meaningful log entry to the kernel log in the event of |
469 | * an APM error. | 469 | * an APM error. Note that this also handles (negative) kernel errors. |
470 | */ | 470 | */ |
471 | 471 | ||
472 | static void apm_error(char *str, int err) | 472 | static void apm_error(char *str, int err) |
@@ -478,43 +478,14 @@ static void apm_error(char *str, int err) | |||
478 | break; | 478 | break; |
479 | if (i < ERROR_COUNT) | 479 | if (i < ERROR_COUNT) |
480 | printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg); | 480 | printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg); |
481 | else if (err < 0) | ||
482 | printk(KERN_NOTICE "apm: %s: linux error code %i\n", str, err); | ||
481 | else | 483 | else |
482 | printk(KERN_NOTICE "apm: %s: unknown error code %#2.2x\n", | 484 | printk(KERN_NOTICE "apm: %s: unknown error code %#2.2x\n", |
483 | str, err); | 485 | str, err); |
484 | } | 486 | } |
485 | 487 | ||
486 | /* | 488 | /* |
487 | * Lock APM functionality to physical CPU 0 | ||
488 | */ | ||
489 | |||
490 | #ifdef CONFIG_SMP | ||
491 | |||
492 | static cpumask_t apm_save_cpus(void) | ||
493 | { | ||
494 | cpumask_t x = current->cpus_allowed; | ||
495 | /* Some bioses don't like being called from CPU != 0 */ | ||
496 | set_cpus_allowed(current, cpumask_of_cpu(0)); | ||
497 | BUG_ON(smp_processor_id() != 0); | ||
498 | return x; | ||
499 | } | ||
500 | |||
501 | static inline void apm_restore_cpus(cpumask_t mask) | ||
502 | { | ||
503 | set_cpus_allowed(current, mask); | ||
504 | } | ||
505 | |||
506 | #else | ||
507 | |||
508 | /* | ||
509 | * No CPU lockdown needed on a uniprocessor | ||
510 | */ | ||
511 | |||
512 | #define apm_save_cpus() (current->cpus_allowed) | ||
513 | #define apm_restore_cpus(x) (void)(x) | ||
514 | |||
515 | #endif | ||
516 | |||
517 | /* | ||
518 | * These are the actual BIOS calls. Depending on APM_ZERO_SEGS and | 489 | * These are the actual BIOS calls. Depending on APM_ZERO_SEGS and |
519 | * apm_info.allow_ints, we are being really paranoid here! Not only | 490 | * apm_info.allow_ints, we are being really paranoid here! Not only |
520 | * are interrupts disabled, but all the segment registers (except SS) | 491 | * are interrupts disabled, but all the segment registers (except SS) |
@@ -568,16 +539,23 @@ static inline void apm_irq_restore(unsigned long flags) | |||
568 | # define APM_DO_RESTORE_SEGS | 539 | # define APM_DO_RESTORE_SEGS |
569 | #endif | 540 | #endif |
570 | 541 | ||
542 | struct apm_bios_call { | ||
543 | u32 func; | ||
544 | /* In and out */ | ||
545 | u32 ebx; | ||
546 | u32 ecx; | ||
547 | /* Out only */ | ||
548 | u32 eax; | ||
549 | u32 edx; | ||
550 | u32 esi; | ||
551 | |||
552 | /* Error: -ENOMEM, or bits 8-15 of eax */ | ||
553 | int err; | ||
554 | }; | ||
555 | |||
571 | /** | 556 | /** |
572 | * apm_bios_call - Make an APM BIOS 32bit call | 557 | * __apm_bios_call - Make an APM BIOS 32bit call |
573 | * @func: APM function to execute | 558 | * @_call: pointer to struct apm_bios_call. |
574 | * @ebx_in: EBX register for call entry | ||
575 | * @ecx_in: ECX register for call entry | ||
576 | * @eax: EAX register return | ||
577 | * @ebx: EBX register return | ||
578 | * @ecx: ECX register return | ||
579 | * @edx: EDX register return | ||
580 | * @esi: ESI register return | ||
581 | * | 559 | * |
582 | * Make an APM call using the 32bit protected mode interface. The | 560 | * Make an APM call using the 32bit protected mode interface. The |
583 | * caller is responsible for knowing if APM BIOS is configured and | 561 | * caller is responsible for knowing if APM BIOS is configured and |
@@ -586,80 +564,142 @@ static inline void apm_irq_restore(unsigned long flags) | |||
586 | * flag is loaded into AL. If there is an error, then the error | 564 | * flag is loaded into AL. If there is an error, then the error |
587 | * code is returned in AH (bits 8-15 of eax) and this function | 565 | * code is returned in AH (bits 8-15 of eax) and this function |
588 | * returns non-zero. | 566 | * returns non-zero. |
567 | * | ||
568 | * Note: this makes the call on the current CPU. | ||
589 | */ | 569 | */ |
590 | 570 | static long __apm_bios_call(void *_call) | |
591 | static u8 apm_bios_call(u32 func, u32 ebx_in, u32 ecx_in, | ||
592 | u32 *eax, u32 *ebx, u32 *ecx, u32 *edx, u32 *esi) | ||
593 | { | 571 | { |
594 | APM_DECL_SEGS | 572 | APM_DECL_SEGS |
595 | unsigned long flags; | 573 | unsigned long flags; |
596 | cpumask_t cpus; | ||
597 | int cpu; | 574 | int cpu; |
598 | struct desc_struct save_desc_40; | 575 | struct desc_struct save_desc_40; |
599 | struct desc_struct *gdt; | 576 | struct desc_struct *gdt; |
600 | 577 | struct apm_bios_call *call = _call; | |
601 | cpus = apm_save_cpus(); | ||
602 | 578 | ||
603 | cpu = get_cpu(); | 579 | cpu = get_cpu(); |
580 | BUG_ON(cpu != 0); | ||
604 | gdt = get_cpu_gdt_table(cpu); | 581 | gdt = get_cpu_gdt_table(cpu); |
605 | save_desc_40 = gdt[0x40 / 8]; | 582 | save_desc_40 = gdt[0x40 / 8]; |
606 | gdt[0x40 / 8] = bad_bios_desc; | 583 | gdt[0x40 / 8] = bad_bios_desc; |
607 | 584 | ||
608 | apm_irq_save(flags); | 585 | apm_irq_save(flags); |
609 | APM_DO_SAVE_SEGS; | 586 | APM_DO_SAVE_SEGS; |
610 | apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi); | 587 | apm_bios_call_asm(call->func, call->ebx, call->ecx, |
588 | &call->eax, &call->ebx, &call->ecx, &call->edx, | ||
589 | &call->esi); | ||
611 | APM_DO_RESTORE_SEGS; | 590 | APM_DO_RESTORE_SEGS; |
612 | apm_irq_restore(flags); | 591 | apm_irq_restore(flags); |
613 | gdt[0x40 / 8] = save_desc_40; | 592 | gdt[0x40 / 8] = save_desc_40; |
614 | put_cpu(); | 593 | put_cpu(); |
615 | apm_restore_cpus(cpus); | ||
616 | 594 | ||
617 | return *eax & 0xff; | 595 | return call->eax & 0xff; |
596 | } | ||
597 | |||
598 | /* Run __apm_bios_call or __apm_bios_call_simple on CPU 0 */ | ||
599 | static int on_cpu0(long (*fn)(void *), struct apm_bios_call *call) | ||
600 | { | ||
601 | int ret; | ||
602 | |||
603 | /* Don't bother with work_on_cpu in the common case, so we don't | ||
604 | * have to worry about OOM or overhead. */ | ||
605 | if (get_cpu() == 0) { | ||
606 | ret = fn(call); | ||
607 | put_cpu(); | ||
608 | } else { | ||
609 | put_cpu(); | ||
610 | ret = work_on_cpu(0, fn, call); | ||
611 | } | ||
612 | |||
613 | /* work_on_cpu can fail with -ENOMEM */ | ||
614 | if (ret < 0) | ||
615 | call->err = ret; | ||
616 | else | ||
617 | call->err = (call->eax >> 8) & 0xff; | ||
618 | |||
619 | return ret; | ||
618 | } | 620 | } |
619 | 621 | ||
620 | /** | 622 | /** |
621 | * apm_bios_call_simple - make a simple APM BIOS 32bit call | 623 | * apm_bios_call - Make an APM BIOS 32bit call (on CPU 0) |
622 | * @func: APM function to invoke | 624 | * @call: the apm_bios_call registers. |
623 | * @ebx_in: EBX register value for BIOS call | 625 | * |
624 | * @ecx_in: ECX register value for BIOS call | 626 | * If there is an error, it is returned in @call.err. |
625 | * @eax: EAX register on return from the BIOS call | 627 | */ |
628 | static int apm_bios_call(struct apm_bios_call *call) | ||
629 | { | ||
630 | return on_cpu0(__apm_bios_call, call); | ||
631 | } | ||
632 | |||
633 | /** | ||
634 | * __apm_bios_call_simple - Make an APM BIOS 32bit call (on CPU 0) | ||
635 | * @_call: pointer to struct apm_bios_call. | ||
626 | * | 636 | * |
627 | * Make a BIOS call that returns one value only, or just status. | 637 | * Make a BIOS call that returns one value only, or just status. |
628 | * If there is an error, then the error code is returned in AH | 638 | * If there is an error, then the error code is returned in AH |
629 | * (bits 8-15 of eax) and this function returns non-zero. This is | 639 | * (bits 8-15 of eax) and this function returns non-zero (it can |
630 | * used for simpler BIOS operations. This call may hold interrupts | 640 | * also return -ENOMEM). This is used for simpler BIOS operations. |
631 | * off for a long time on some laptops. | 641 | * This call may hold interrupts off for a long time on some laptops. |
642 | * | ||
643 | * Note: this makes the call on the current CPU. | ||
632 | */ | 644 | */ |
633 | 645 | static long __apm_bios_call_simple(void *_call) | |
634 | static u8 apm_bios_call_simple(u32 func, u32 ebx_in, u32 ecx_in, u32 *eax) | ||
635 | { | 646 | { |
636 | u8 error; | 647 | u8 error; |
637 | APM_DECL_SEGS | 648 | APM_DECL_SEGS |
638 | unsigned long flags; | 649 | unsigned long flags; |
639 | cpumask_t cpus; | ||
640 | int cpu; | 650 | int cpu; |
641 | struct desc_struct save_desc_40; | 651 | struct desc_struct save_desc_40; |
642 | struct desc_struct *gdt; | 652 | struct desc_struct *gdt; |
643 | 653 | struct apm_bios_call *call = _call; | |
644 | cpus = apm_save_cpus(); | ||
645 | 654 | ||
646 | cpu = get_cpu(); | 655 | cpu = get_cpu(); |
656 | BUG_ON(cpu != 0); | ||
647 | gdt = get_cpu_gdt_table(cpu); | 657 | gdt = get_cpu_gdt_table(cpu); |
648 | save_desc_40 = gdt[0x40 / 8]; | 658 | save_desc_40 = gdt[0x40 / 8]; |
649 | gdt[0x40 / 8] = bad_bios_desc; | 659 | gdt[0x40 / 8] = bad_bios_desc; |
650 | 660 | ||
651 | apm_irq_save(flags); | 661 | apm_irq_save(flags); |
652 | APM_DO_SAVE_SEGS; | 662 | APM_DO_SAVE_SEGS; |
653 | error = apm_bios_call_simple_asm(func, ebx_in, ecx_in, eax); | 663 | error = apm_bios_call_simple_asm(call->func, call->ebx, call->ecx, |
664 | &call->eax); | ||
654 | APM_DO_RESTORE_SEGS; | 665 | APM_DO_RESTORE_SEGS; |
655 | apm_irq_restore(flags); | 666 | apm_irq_restore(flags); |
656 | gdt[0x40 / 8] = save_desc_40; | 667 | gdt[0x40 / 8] = save_desc_40; |
657 | put_cpu(); | 668 | put_cpu(); |
658 | apm_restore_cpus(cpus); | ||
659 | return error; | 669 | return error; |
660 | } | 670 | } |
661 | 671 | ||
662 | /** | 672 | /** |
673 | * apm_bios_call_simple - make a simple APM BIOS 32bit call | ||
674 | * @func: APM function to invoke | ||
675 | * @ebx_in: EBX register value for BIOS call | ||
676 | * @ecx_in: ECX register value for BIOS call | ||
677 | * @eax: EAX register on return from the BIOS call | ||
678 | * @err: bits | ||
679 | * | ||
680 | * Make a BIOS call that returns one value only, or just status. | ||
681 | * If there is an error, then the error code is returned in @err | ||
682 | * and this function returns non-zero. This is used for simpler | ||
683 | * BIOS operations. This call may hold interrupts off for a long | ||
684 | * time on some laptops. | ||
685 | */ | ||
686 | static int apm_bios_call_simple(u32 func, u32 ebx_in, u32 ecx_in, u32 *eax, | ||
687 | int *err) | ||
688 | { | ||
689 | struct apm_bios_call call; | ||
690 | int ret; | ||
691 | |||
692 | call.func = func; | ||
693 | call.ebx = ebx_in; | ||
694 | call.ecx = ecx_in; | ||
695 | |||
696 | ret = on_cpu0(__apm_bios_call_simple, &call); | ||
697 | *eax = call.eax; | ||
698 | *err = call.err; | ||
699 | return ret; | ||
700 | } | ||
701 | |||
702 | /** | ||
663 | * apm_driver_version - APM driver version | 703 | * apm_driver_version - APM driver version |
664 | * @val: loaded with the APM version on return | 704 | * @val: loaded with the APM version on return |
665 | * | 705 | * |
@@ -678,9 +718,10 @@ static u8 apm_bios_call_simple(u32 func, u32 ebx_in, u32 ecx_in, u32 *eax) | |||
678 | static int apm_driver_version(u_short *val) | 718 | static int apm_driver_version(u_short *val) |
679 | { | 719 | { |
680 | u32 eax; | 720 | u32 eax; |
721 | int err; | ||
681 | 722 | ||
682 | if (apm_bios_call_simple(APM_FUNC_VERSION, 0, *val, &eax)) | 723 | if (apm_bios_call_simple(APM_FUNC_VERSION, 0, *val, &eax, &err)) |
683 | return (eax >> 8) & 0xff; | 724 | return err; |
684 | *val = eax; | 725 | *val = eax; |
685 | return APM_SUCCESS; | 726 | return APM_SUCCESS; |
686 | } | 727 | } |
@@ -701,22 +742,21 @@ static int apm_driver_version(u_short *val) | |||
701 | * that APM 1.2 is in use. If no messges are pending the value 0x80 | 742 | * that APM 1.2 is in use. If no messges are pending the value 0x80 |
702 | * is returned (No power management events pending). | 743 | * is returned (No power management events pending). |
703 | */ | 744 | */ |
704 | |||
705 | static int apm_get_event(apm_event_t *event, apm_eventinfo_t *info) | 745 | static int apm_get_event(apm_event_t *event, apm_eventinfo_t *info) |
706 | { | 746 | { |
707 | u32 eax; | 747 | struct apm_bios_call call; |
708 | u32 ebx; | ||
709 | u32 ecx; | ||
710 | u32 dummy; | ||
711 | 748 | ||
712 | if (apm_bios_call(APM_FUNC_GET_EVENT, 0, 0, &eax, &ebx, &ecx, | 749 | call.func = APM_FUNC_GET_EVENT; |
713 | &dummy, &dummy)) | 750 | call.ebx = call.ecx = 0; |
714 | return (eax >> 8) & 0xff; | 751 | |
715 | *event = ebx; | 752 | if (apm_bios_call(&call)) |
753 | return call.err; | ||
754 | |||
755 | *event = call.ebx; | ||
716 | if (apm_info.connection_version < 0x0102) | 756 | if (apm_info.connection_version < 0x0102) |
717 | *info = ~0; /* indicate info not valid */ | 757 | *info = ~0; /* indicate info not valid */ |
718 | else | 758 | else |
719 | *info = ecx; | 759 | *info = call.ecx; |
720 | return APM_SUCCESS; | 760 | return APM_SUCCESS; |
721 | } | 761 | } |
722 | 762 | ||
@@ -737,9 +777,10 @@ static int apm_get_event(apm_event_t *event, apm_eventinfo_t *info) | |||
737 | static int set_power_state(u_short what, u_short state) | 777 | static int set_power_state(u_short what, u_short state) |
738 | { | 778 | { |
739 | u32 eax; | 779 | u32 eax; |
780 | int err; | ||
740 | 781 | ||
741 | if (apm_bios_call_simple(APM_FUNC_SET_STATE, what, state, &eax)) | 782 | if (apm_bios_call_simple(APM_FUNC_SET_STATE, what, state, &eax, &err)) |
742 | return (eax >> 8) & 0xff; | 783 | return err; |
743 | return APM_SUCCESS; | 784 | return APM_SUCCESS; |
744 | } | 785 | } |
745 | 786 | ||
@@ -770,6 +811,7 @@ static int apm_do_idle(void) | |||
770 | u8 ret = 0; | 811 | u8 ret = 0; |
771 | int idled = 0; | 812 | int idled = 0; |
772 | int polling; | 813 | int polling; |
814 | int err; | ||
773 | 815 | ||
774 | polling = !!(current_thread_info()->status & TS_POLLING); | 816 | polling = !!(current_thread_info()->status & TS_POLLING); |
775 | if (polling) { | 817 | if (polling) { |
@@ -782,7 +824,7 @@ static int apm_do_idle(void) | |||
782 | } | 824 | } |
783 | if (!need_resched()) { | 825 | if (!need_resched()) { |
784 | idled = 1; | 826 | idled = 1; |
785 | ret = apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax); | 827 | ret = apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax, &err); |
786 | } | 828 | } |
787 | if (polling) | 829 | if (polling) |
788 | current_thread_info()->status |= TS_POLLING; | 830 | current_thread_info()->status |= TS_POLLING; |
@@ -797,8 +839,7 @@ static int apm_do_idle(void) | |||
797 | * Only report the failure the first 5 times. | 839 | * Only report the failure the first 5 times. |
798 | */ | 840 | */ |
799 | if (++t < 5) { | 841 | if (++t < 5) { |
800 | printk(KERN_DEBUG "apm_do_idle failed (%d)\n", | 842 | printk(KERN_DEBUG "apm_do_idle failed (%d)\n", err); |
801 | (eax >> 8) & 0xff); | ||
802 | t = jiffies; | 843 | t = jiffies; |
803 | } | 844 | } |
804 | return -1; | 845 | return -1; |
@@ -816,9 +857,10 @@ static int apm_do_idle(void) | |||
816 | static void apm_do_busy(void) | 857 | static void apm_do_busy(void) |
817 | { | 858 | { |
818 | u32 dummy; | 859 | u32 dummy; |
860 | int err; | ||
819 | 861 | ||
820 | if (clock_slowed || ALWAYS_CALL_BUSY) { | 862 | if (clock_slowed || ALWAYS_CALL_BUSY) { |
821 | (void)apm_bios_call_simple(APM_FUNC_BUSY, 0, 0, &dummy); | 863 | (void)apm_bios_call_simple(APM_FUNC_BUSY, 0, 0, &dummy, &err); |
822 | clock_slowed = 0; | 864 | clock_slowed = 0; |
823 | } | 865 | } |
824 | } | 866 | } |
@@ -937,7 +979,7 @@ static void apm_power_off(void) | |||
937 | 979 | ||
938 | /* Some bioses don't like being called from CPU != 0 */ | 980 | /* Some bioses don't like being called from CPU != 0 */ |
939 | if (apm_info.realmode_power_off) { | 981 | if (apm_info.realmode_power_off) { |
940 | (void)apm_save_cpus(); | 982 | set_cpus_allowed_ptr(current, cpumask_of(0)); |
941 | machine_real_restart(po_bios_call, sizeof(po_bios_call)); | 983 | machine_real_restart(po_bios_call, sizeof(po_bios_call)); |
942 | } else { | 984 | } else { |
943 | (void)set_system_power_state(APM_STATE_OFF); | 985 | (void)set_system_power_state(APM_STATE_OFF); |
@@ -956,12 +998,13 @@ static void apm_power_off(void) | |||
956 | static int apm_enable_power_management(int enable) | 998 | static int apm_enable_power_management(int enable) |
957 | { | 999 | { |
958 | u32 eax; | 1000 | u32 eax; |
1001 | int err; | ||
959 | 1002 | ||
960 | if ((enable == 0) && (apm_info.bios.flags & APM_BIOS_DISENGAGED)) | 1003 | if ((enable == 0) && (apm_info.bios.flags & APM_BIOS_DISENGAGED)) |
961 | return APM_NOT_ENGAGED; | 1004 | return APM_NOT_ENGAGED; |
962 | if (apm_bios_call_simple(APM_FUNC_ENABLE_PM, APM_DEVICE_BALL, | 1005 | if (apm_bios_call_simple(APM_FUNC_ENABLE_PM, APM_DEVICE_BALL, |
963 | enable, &eax)) | 1006 | enable, &eax, &err)) |
964 | return (eax >> 8) & 0xff; | 1007 | return err; |
965 | if (enable) | 1008 | if (enable) |
966 | apm_info.bios.flags &= ~APM_BIOS_DISABLED; | 1009 | apm_info.bios.flags &= ~APM_BIOS_DISABLED; |
967 | else | 1010 | else |
@@ -986,24 +1029,23 @@ static int apm_enable_power_management(int enable) | |||
986 | 1029 | ||
987 | static int apm_get_power_status(u_short *status, u_short *bat, u_short *life) | 1030 | static int apm_get_power_status(u_short *status, u_short *bat, u_short *life) |
988 | { | 1031 | { |
989 | u32 eax; | 1032 | struct apm_bios_call call; |
990 | u32 ebx; | 1033 | |
991 | u32 ecx; | 1034 | call.func = APM_FUNC_GET_STATUS; |
992 | u32 edx; | 1035 | call.ebx = APM_DEVICE_ALL; |
993 | u32 dummy; | 1036 | call.ecx = 0; |
994 | 1037 | ||
995 | if (apm_info.get_power_status_broken) | 1038 | if (apm_info.get_power_status_broken) |
996 | return APM_32_UNSUPPORTED; | 1039 | return APM_32_UNSUPPORTED; |
997 | if (apm_bios_call(APM_FUNC_GET_STATUS, APM_DEVICE_ALL, 0, | 1040 | if (apm_bios_call(&call)) |
998 | &eax, &ebx, &ecx, &edx, &dummy)) | 1041 | return call.err; |
999 | return (eax >> 8) & 0xff; | 1042 | *status = call.ebx; |
1000 | *status = ebx; | 1043 | *bat = call.ecx; |
1001 | *bat = ecx; | ||
1002 | if (apm_info.get_power_status_swabinminutes) { | 1044 | if (apm_info.get_power_status_swabinminutes) { |
1003 | *life = swab16((u16)edx); | 1045 | *life = swab16((u16)call.edx); |
1004 | *life |= 0x8000; | 1046 | *life |= 0x8000; |
1005 | } else | 1047 | } else |
1006 | *life = edx; | 1048 | *life = call.edx; |
1007 | return APM_SUCCESS; | 1049 | return APM_SUCCESS; |
1008 | } | 1050 | } |
1009 | 1051 | ||
@@ -1048,12 +1090,14 @@ static int apm_get_battery_status(u_short which, u_short *status, | |||
1048 | static int apm_engage_power_management(u_short device, int enable) | 1090 | static int apm_engage_power_management(u_short device, int enable) |
1049 | { | 1091 | { |
1050 | u32 eax; | 1092 | u32 eax; |
1093 | int err; | ||
1051 | 1094 | ||
1052 | if ((enable == 0) && (device == APM_DEVICE_ALL) | 1095 | if ((enable == 0) && (device == APM_DEVICE_ALL) |
1053 | && (apm_info.bios.flags & APM_BIOS_DISABLED)) | 1096 | && (apm_info.bios.flags & APM_BIOS_DISABLED)) |
1054 | return APM_DISABLED; | 1097 | return APM_DISABLED; |
1055 | if (apm_bios_call_simple(APM_FUNC_ENGAGE_PM, device, enable, &eax)) | 1098 | if (apm_bios_call_simple(APM_FUNC_ENGAGE_PM, device, enable, |
1056 | return (eax >> 8) & 0xff; | 1099 | &eax, &err)) |
1100 | return err; | ||
1057 | if (device == APM_DEVICE_ALL) { | 1101 | if (device == APM_DEVICE_ALL) { |
1058 | if (enable) | 1102 | if (enable) |
1059 | apm_info.bios.flags &= ~APM_BIOS_DISENGAGED; | 1103 | apm_info.bios.flags &= ~APM_BIOS_DISENGAGED; |
@@ -1689,16 +1733,14 @@ static int apm(void *unused) | |||
1689 | char *power_stat; | 1733 | char *power_stat; |
1690 | char *bat_stat; | 1734 | char *bat_stat; |
1691 | 1735 | ||
1692 | #ifdef CONFIG_SMP | ||
1693 | /* 2002/08/01 - WT | 1736 | /* 2002/08/01 - WT |
1694 | * This is to avoid random crashes at boot time during initialization | 1737 | * This is to avoid random crashes at boot time during initialization |
1695 | * on SMP systems in case of "apm=power-off" mode. Seen on ASUS A7M266D. | 1738 | * on SMP systems in case of "apm=power-off" mode. Seen on ASUS A7M266D. |
1696 | * Some bioses don't like being called from CPU != 0. | 1739 | * Some bioses don't like being called from CPU != 0. |
1697 | * Method suggested by Ingo Molnar. | 1740 | * Method suggested by Ingo Molnar. |
1698 | */ | 1741 | */ |
1699 | set_cpus_allowed(current, cpumask_of_cpu(0)); | 1742 | set_cpus_allowed_ptr(current, cpumask_of(0)); |
1700 | BUG_ON(smp_processor_id() != 0); | 1743 | BUG_ON(smp_processor_id() != 0); |
1701 | #endif | ||
1702 | 1744 | ||
1703 | if (apm_info.connection_version == 0) { | 1745 | if (apm_info.connection_version == 0) { |
1704 | apm_info.connection_version = apm_info.bios.version; | 1746 | apm_info.connection_version = apm_info.bios.version; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index e2962cc1e27b..c4f667896c28 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -41,8 +41,6 @@ | |||
41 | 41 | ||
42 | #include "cpu.h" | 42 | #include "cpu.h" |
43 | 43 | ||
44 | #ifdef CONFIG_X86_64 | ||
45 | |||
46 | /* all of these masks are initialized in setup_cpu_local_masks() */ | 44 | /* all of these masks are initialized in setup_cpu_local_masks() */ |
47 | cpumask_var_t cpu_initialized_mask; | 45 | cpumask_var_t cpu_initialized_mask; |
48 | cpumask_var_t cpu_callout_mask; | 46 | cpumask_var_t cpu_callout_mask; |
@@ -60,16 +58,6 @@ void __init setup_cpu_local_masks(void) | |||
60 | alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask); | 58 | alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask); |
61 | } | 59 | } |
62 | 60 | ||
63 | #else /* CONFIG_X86_32 */ | ||
64 | |||
65 | cpumask_t cpu_sibling_setup_map; | ||
66 | cpumask_t cpu_callout_map; | ||
67 | cpumask_t cpu_initialized; | ||
68 | cpumask_t cpu_callin_map; | ||
69 | |||
70 | #endif /* CONFIG_X86_32 */ | ||
71 | |||
72 | |||
73 | static const struct cpu_dev *this_cpu __cpuinitdata; | 61 | static const struct cpu_dev *this_cpu __cpuinitdata; |
74 | 62 | ||
75 | DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = { | 63 | DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = { |
@@ -859,6 +847,7 @@ static void vgetcpu_set_mode(void) | |||
859 | void __init identify_boot_cpu(void) | 847 | void __init identify_boot_cpu(void) |
860 | { | 848 | { |
861 | identify_cpu(&boot_cpu_data); | 849 | identify_cpu(&boot_cpu_data); |
850 | init_c1e_mask(); | ||
862 | #ifdef CONFIG_X86_32 | 851 | #ifdef CONFIG_X86_32 |
863 | sysenter_setup(); | 852 | sysenter_setup(); |
864 | enable_sep_cpu(); | 853 | enable_sep_cpu(); |
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 23da96e57b17..05209b5cc6ca 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <linux/cpufreq.h> | 33 | #include <linux/cpufreq.h> |
34 | #include <linux/compiler.h> | 34 | #include <linux/compiler.h> |
35 | #include <linux/dmi.h> | 35 | #include <linux/dmi.h> |
36 | #include <linux/ftrace.h> | 36 | #include <trace/power.h> |
37 | 37 | ||
38 | #include <linux/acpi.h> | 38 | #include <linux/acpi.h> |
39 | #include <linux/io.h> | 39 | #include <linux/io.h> |
@@ -72,6 +72,8 @@ struct acpi_cpufreq_data { | |||
72 | 72 | ||
73 | static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data); | 73 | static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data); |
74 | 74 | ||
75 | DEFINE_TRACE(power_mark); | ||
76 | |||
75 | /* acpi_perf_data is a pointer to percpu data. */ | 77 | /* acpi_perf_data is a pointer to percpu data. */ |
76 | static struct acpi_processor_performance *acpi_perf_data; | 78 | static struct acpi_processor_performance *acpi_perf_data; |
77 | 79 | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c index 41ed94915f97..6ac55bd341ae 100644 --- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c +++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c | |||
@@ -211,7 +211,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) | |||
211 | unsigned int i; | 211 | unsigned int i; |
212 | 212 | ||
213 | #ifdef CONFIG_SMP | 213 | #ifdef CONFIG_SMP |
214 | cpumask_copy(policy->cpus, &per_cpu(cpu_sibling_map, policy->cpu)); | 214 | cpumask_copy(policy->cpus, cpu_sibling_mask(policy->cpu)); |
215 | #endif | 215 | #endif |
216 | 216 | ||
217 | /* Errata workaround */ | 217 | /* Errata workaround */ |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index a15ac94e0b9b..4709ead2db52 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -54,7 +54,10 @@ static DEFINE_PER_CPU(struct powernow_k8_data *, powernow_data); | |||
54 | static int cpu_family = CPU_OPTERON; | 54 | static int cpu_family = CPU_OPTERON; |
55 | 55 | ||
56 | #ifndef CONFIG_SMP | 56 | #ifndef CONFIG_SMP |
57 | DEFINE_PER_CPU(cpumask_t, cpu_core_map); | 57 | static inline const struct cpumask *cpu_core_mask(int cpu) |
58 | { | ||
59 | return cpumask_of(0); | ||
60 | } | ||
58 | #endif | 61 | #endif |
59 | 62 | ||
60 | /* Return a frequency in MHz, given an input fid */ | 63 | /* Return a frequency in MHz, given an input fid */ |
@@ -699,7 +702,7 @@ static int fill_powernow_table(struct powernow_k8_data *data, | |||
699 | 702 | ||
700 | dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid); | 703 | dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid); |
701 | data->powernow_table = powernow_table; | 704 | data->powernow_table = powernow_table; |
702 | if (first_cpu(per_cpu(cpu_core_map, data->cpu)) == data->cpu) | 705 | if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu) |
703 | print_basics(data); | 706 | print_basics(data); |
704 | 707 | ||
705 | for (j = 0; j < data->numps; j++) | 708 | for (j = 0; j < data->numps; j++) |
@@ -862,7 +865,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) | |||
862 | 865 | ||
863 | /* fill in data */ | 866 | /* fill in data */ |
864 | data->numps = data->acpi_data.state_count; | 867 | data->numps = data->acpi_data.state_count; |
865 | if (first_cpu(per_cpu(cpu_core_map, data->cpu)) == data->cpu) | 868 | if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu) |
866 | print_basics(data); | 869 | print_basics(data); |
867 | powernow_k8_acpi_pst_values(data, 0); | 870 | powernow_k8_acpi_pst_values(data, 0); |
868 | 871 | ||
@@ -1300,7 +1303,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1300 | if (cpu_family == CPU_HW_PSTATE) | 1303 | if (cpu_family == CPU_HW_PSTATE) |
1301 | cpumask_copy(pol->cpus, cpumask_of(pol->cpu)); | 1304 | cpumask_copy(pol->cpus, cpumask_of(pol->cpu)); |
1302 | else | 1305 | else |
1303 | cpumask_copy(pol->cpus, &per_cpu(cpu_core_map, pol->cpu)); | 1306 | cpumask_copy(pol->cpus, cpu_core_mask(pol->cpu)); |
1304 | data->available_cores = pol->cpus; | 1307 | data->available_cores = pol->cpus; |
1305 | 1308 | ||
1306 | if (cpu_family == CPU_HW_PSTATE) | 1309 | if (cpu_family == CPU_HW_PSTATE) |
@@ -1365,7 +1368,7 @@ static unsigned int powernowk8_get(unsigned int cpu) | |||
1365 | unsigned int khz = 0; | 1368 | unsigned int khz = 0; |
1366 | unsigned int first; | 1369 | unsigned int first; |
1367 | 1370 | ||
1368 | first = first_cpu(per_cpu(cpu_core_map, cpu)); | 1371 | first = cpumask_first(cpu_core_mask(cpu)); |
1369 | data = per_cpu(powernow_data, first); | 1372 | data = per_cpu(powernow_data, first); |
1370 | 1373 | ||
1371 | if (!data) | 1374 | if (!data) |
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c index 8bbb11adb315..016c1a4fa3fc 100644 --- a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c | |||
@@ -321,7 +321,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) | |||
321 | 321 | ||
322 | /* only run on CPU to be set, or on its sibling */ | 322 | /* only run on CPU to be set, or on its sibling */ |
323 | #ifdef CONFIG_SMP | 323 | #ifdef CONFIG_SMP |
324 | cpumask_copy(policy->cpus, &per_cpu(cpu_sibling_map, policy->cpu)); | 324 | cpumask_copy(policy->cpus, cpu_sibling_mask(policy->cpu)); |
325 | #endif | 325 | #endif |
326 | 326 | ||
327 | cpus_allowed = current->cpus_allowed; | 327 | cpus_allowed = current->cpus_allowed; |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index c471eb1a389c..483eda96e102 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -159,7 +159,7 @@ struct _cpuid4_info_regs { | |||
159 | unsigned long can_disable; | 159 | unsigned long can_disable; |
160 | }; | 160 | }; |
161 | 161 | ||
162 | #ifdef CONFIG_PCI | 162 | #if defined(CONFIG_PCI) && defined(CONFIG_SYSFS) |
163 | static struct pci_device_id k8_nb_id[] = { | 163 | static struct pci_device_id k8_nb_id[] = { |
164 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1103) }, | 164 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1103) }, |
165 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1203) }, | 165 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1203) }, |
@@ -324,15 +324,6 @@ __cpuinit cpuid4_cache_lookup_regs(int index, | |||
324 | return 0; | 324 | return 0; |
325 | } | 325 | } |
326 | 326 | ||
327 | static int | ||
328 | __cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf) | ||
329 | { | ||
330 | struct _cpuid4_info_regs *leaf_regs = | ||
331 | (struct _cpuid4_info_regs *)this_leaf; | ||
332 | |||
333 | return cpuid4_cache_lookup_regs(index, leaf_regs); | ||
334 | } | ||
335 | |||
336 | static int __cpuinit find_num_cache_leaves(void) | 327 | static int __cpuinit find_num_cache_leaves(void) |
337 | { | 328 | { |
338 | unsigned int eax, ebx, ecx, edx; | 329 | unsigned int eax, ebx, ecx, edx; |
@@ -508,6 +499,8 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c) | |||
508 | return l2; | 499 | return l2; |
509 | } | 500 | } |
510 | 501 | ||
502 | #ifdef CONFIG_SYSFS | ||
503 | |||
511 | /* pointer to _cpuid4_info array (for each cache leaf) */ | 504 | /* pointer to _cpuid4_info array (for each cache leaf) */ |
512 | static DEFINE_PER_CPU(struct _cpuid4_info *, cpuid4_info); | 505 | static DEFINE_PER_CPU(struct _cpuid4_info *, cpuid4_info); |
513 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(cpuid4_info, x))[y])) | 506 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(cpuid4_info, x))[y])) |
@@ -571,6 +564,15 @@ static void __cpuinit free_cache_attributes(unsigned int cpu) | |||
571 | per_cpu(cpuid4_info, cpu) = NULL; | 564 | per_cpu(cpuid4_info, cpu) = NULL; |
572 | } | 565 | } |
573 | 566 | ||
567 | static int | ||
568 | __cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf) | ||
569 | { | ||
570 | struct _cpuid4_info_regs *leaf_regs = | ||
571 | (struct _cpuid4_info_regs *)this_leaf; | ||
572 | |||
573 | return cpuid4_cache_lookup_regs(index, leaf_regs); | ||
574 | } | ||
575 | |||
574 | static void __cpuinit get_cpu_leaves(void *_retval) | 576 | static void __cpuinit get_cpu_leaves(void *_retval) |
575 | { | 577 | { |
576 | int j, *retval = _retval, cpu = smp_processor_id(); | 578 | int j, *retval = _retval, cpu = smp_processor_id(); |
@@ -612,8 +614,6 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) | |||
612 | return retval; | 614 | return retval; |
613 | } | 615 | } |
614 | 616 | ||
615 | #ifdef CONFIG_SYSFS | ||
616 | |||
617 | #include <linux/kobject.h> | 617 | #include <linux/kobject.h> |
618 | #include <linux/sysfs.h> | 618 | #include <linux/sysfs.h> |
619 | 619 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c index ca14604611ec..863f89568b1a 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_64.c | |||
@@ -990,7 +990,7 @@ static struct sysdev_attribute *mce_attributes[] = { | |||
990 | NULL | 990 | NULL |
991 | }; | 991 | }; |
992 | 992 | ||
993 | static cpumask_t mce_device_initialized = CPU_MASK_NONE; | 993 | static cpumask_var_t mce_device_initialized; |
994 | 994 | ||
995 | /* Per cpu sysdev init. All of the cpus still share the same ctl bank */ | 995 | /* Per cpu sysdev init. All of the cpus still share the same ctl bank */ |
996 | static __cpuinit int mce_create_device(unsigned int cpu) | 996 | static __cpuinit int mce_create_device(unsigned int cpu) |
@@ -1021,7 +1021,7 @@ static __cpuinit int mce_create_device(unsigned int cpu) | |||
1021 | if (err) | 1021 | if (err) |
1022 | goto error2; | 1022 | goto error2; |
1023 | } | 1023 | } |
1024 | cpu_set(cpu, mce_device_initialized); | 1024 | cpumask_set_cpu(cpu, mce_device_initialized); |
1025 | 1025 | ||
1026 | return 0; | 1026 | return 0; |
1027 | error2: | 1027 | error2: |
@@ -1043,7 +1043,7 @@ static __cpuinit void mce_remove_device(unsigned int cpu) | |||
1043 | { | 1043 | { |
1044 | int i; | 1044 | int i; |
1045 | 1045 | ||
1046 | if (!cpu_isset(cpu, mce_device_initialized)) | 1046 | if (!cpumask_test_cpu(cpu, mce_device_initialized)) |
1047 | return; | 1047 | return; |
1048 | 1048 | ||
1049 | for (i = 0; mce_attributes[i]; i++) | 1049 | for (i = 0; mce_attributes[i]; i++) |
@@ -1053,7 +1053,7 @@ static __cpuinit void mce_remove_device(unsigned int cpu) | |||
1053 | sysdev_remove_file(&per_cpu(device_mce, cpu), | 1053 | sysdev_remove_file(&per_cpu(device_mce, cpu), |
1054 | &bank_attrs[i]); | 1054 | &bank_attrs[i]); |
1055 | sysdev_unregister(&per_cpu(device_mce,cpu)); | 1055 | sysdev_unregister(&per_cpu(device_mce,cpu)); |
1056 | cpu_clear(cpu, mce_device_initialized); | 1056 | cpumask_clear_cpu(cpu, mce_device_initialized); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | /* Make sure there are no machine checks on offlined CPUs. */ | 1059 | /* Make sure there are no machine checks on offlined CPUs. */ |
@@ -1162,6 +1162,8 @@ static __init int mce_init_device(void) | |||
1162 | if (!mce_available(&boot_cpu_data)) | 1162 | if (!mce_available(&boot_cpu_data)) |
1163 | return -EIO; | 1163 | return -EIO; |
1164 | 1164 | ||
1165 | alloc_cpumask_var(&mce_device_initialized, GFP_KERNEL); | ||
1166 | |||
1165 | err = mce_init_banks(); | 1167 | err = mce_init_banks(); |
1166 | if (err) | 1168 | if (err) |
1167 | return err; | 1169 | return err; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c index 7d01be868870..56dde9c4bc96 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c | |||
@@ -485,7 +485,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) | |||
485 | 485 | ||
486 | #ifdef CONFIG_SMP | 486 | #ifdef CONFIG_SMP |
487 | if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */ | 487 | if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */ |
488 | i = cpumask_first(&per_cpu(cpu_core_map, cpu)); | 488 | i = cpumask_first(cpu_core_mask(cpu)); |
489 | 489 | ||
490 | /* first core not up yet */ | 490 | /* first core not up yet */ |
491 | if (cpu_data(i).cpu_core_id) | 491 | if (cpu_data(i).cpu_core_id) |
@@ -505,7 +505,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) | |||
505 | if (err) | 505 | if (err) |
506 | goto out; | 506 | goto out; |
507 | 507 | ||
508 | cpumask_copy(b->cpus, &per_cpu(cpu_core_map, cpu)); | 508 | cpumask_copy(b->cpus, cpu_core_mask(cpu)); |
509 | per_cpu(threshold_banks, cpu)[bank] = b; | 509 | per_cpu(threshold_banks, cpu)[bank] = b; |
510 | goto out; | 510 | goto out; |
511 | } | 511 | } |
@@ -529,7 +529,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) | |||
529 | #ifndef CONFIG_SMP | 529 | #ifndef CONFIG_SMP |
530 | cpumask_setall(b->cpus); | 530 | cpumask_setall(b->cpus); |
531 | #else | 531 | #else |
532 | cpumask_copy(b->cpus, &per_cpu(cpu_core_map, cpu)); | 532 | cpumask_copy(b->cpus, cpu_core_mask(cpu)); |
533 | #endif | 533 | #endif |
534 | 534 | ||
535 | per_cpu(threshold_banks, cpu)[bank] = b; | 535 | per_cpu(threshold_banks, cpu)[bank] = b; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c index 57df3d383470..d6b72df89d69 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c | |||
@@ -249,7 +249,7 @@ void cmci_rediscover(int dying) | |||
249 | for_each_online_cpu (cpu) { | 249 | for_each_online_cpu (cpu) { |
250 | if (cpu == dying) | 250 | if (cpu == dying) |
251 | continue; | 251 | continue; |
252 | if (set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu))) | 252 | if (set_cpus_allowed_ptr(current, cpumask_of(cpu))) |
253 | continue; | 253 | continue; |
254 | /* Recheck banks in case CPUs don't all have the same */ | 254 | /* Recheck banks in case CPUs don't all have the same */ |
255 | if (cmci_supported(&banks)) | 255 | if (cmci_supported(&banks)) |
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index 37f28fc7cf95..0b776c09aff3 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c | |||
@@ -462,9 +462,6 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base, | |||
462 | *base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT; | 462 | *base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT; |
463 | *type = base_lo & 0xff; | 463 | *type = base_lo & 0xff; |
464 | 464 | ||
465 | printk(KERN_DEBUG " get_mtrr: cpu%d reg%02d base=%010lx size=%010lx %s\n", | ||
466 | cpu, reg, *base, *size, | ||
467 | mtrr_attrib_to_str(*type & 0xff)); | ||
468 | out_put_cpu: | 465 | out_put_cpu: |
469 | put_cpu(); | 466 | put_cpu(); |
470 | } | 467 | } |
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index d67e0e48bc2d..f93047fed791 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c | |||
@@ -14,7 +14,7 @@ static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c, | |||
14 | if (c->x86_max_cores * smp_num_siblings > 1) { | 14 | if (c->x86_max_cores * smp_num_siblings > 1) { |
15 | seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); | 15 | seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); |
16 | seq_printf(m, "siblings\t: %d\n", | 16 | seq_printf(m, "siblings\t: %d\n", |
17 | cpus_weight(per_cpu(cpu_core_map, cpu))); | 17 | cpumask_weight(cpu_sibling_mask(cpu))); |
18 | seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); | 18 | seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); |
19 | seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); | 19 | seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); |
20 | seq_printf(m, "apicid\t\t: %d\n", c->apicid); | 20 | seq_printf(m, "apicid\t\t: %d\n", c->apicid); |
@@ -143,9 +143,9 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
143 | static void *c_start(struct seq_file *m, loff_t *pos) | 143 | static void *c_start(struct seq_file *m, loff_t *pos) |
144 | { | 144 | { |
145 | if (*pos == 0) /* just in case, cpu 0 is not the first */ | 145 | if (*pos == 0) /* just in case, cpu 0 is not the first */ |
146 | *pos = first_cpu(cpu_online_map); | 146 | *pos = cpumask_first(cpu_online_mask); |
147 | else | 147 | else |
148 | *pos = next_cpu_nr(*pos - 1, cpu_online_map); | 148 | *pos = cpumask_next(*pos - 1, cpu_online_mask); |
149 | if ((*pos) < nr_cpu_ids) | 149 | if ((*pos) < nr_cpu_ids) |
150 | return &cpu_data(*pos); | 150 | return &cpu_data(*pos); |
151 | return NULL; | 151 | return NULL; |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index dd2130b0fb3e..95ea5fa7d444 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/bug.h> | 15 | #include <linux/bug.h> |
16 | #include <linux/nmi.h> | 16 | #include <linux/nmi.h> |
17 | #include <linux/sysfs.h> | 17 | #include <linux/sysfs.h> |
18 | #include <linux/ftrace.h> | ||
18 | 19 | ||
19 | #include <asm/stacktrace.h> | 20 | #include <asm/stacktrace.h> |
20 | 21 | ||
@@ -196,6 +197,11 @@ unsigned __kprobes long oops_begin(void) | |||
196 | int cpu; | 197 | int cpu; |
197 | unsigned long flags; | 198 | unsigned long flags; |
198 | 199 | ||
200 | /* notify the hw-branch tracer so it may disable tracing and | ||
201 | add the last trace to the trace buffer - | ||
202 | the earlier this happens, the more useful the trace. */ | ||
203 | trace_hw_branch_oops(); | ||
204 | |||
199 | oops_enter(); | 205 | oops_enter(); |
200 | 206 | ||
201 | /* racy, but better than risking deadlock. */ | 207 | /* racy, but better than risking deadlock. */ |
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 76f7141e0f91..61df77532120 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
20 | 20 | ||
21 | #include <asm/cacheflush.h> | ||
21 | #include <asm/ftrace.h> | 22 | #include <asm/ftrace.h> |
22 | #include <linux/ftrace.h> | 23 | #include <linux/ftrace.h> |
23 | #include <asm/nops.h> | 24 | #include <asm/nops.h> |
@@ -26,6 +27,18 @@ | |||
26 | 27 | ||
27 | #ifdef CONFIG_DYNAMIC_FTRACE | 28 | #ifdef CONFIG_DYNAMIC_FTRACE |
28 | 29 | ||
30 | int ftrace_arch_code_modify_prepare(void) | ||
31 | { | ||
32 | set_kernel_text_rw(); | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | int ftrace_arch_code_modify_post_process(void) | ||
37 | { | ||
38 | set_kernel_text_ro(); | ||
39 | return 0; | ||
40 | } | ||
41 | |||
29 | union ftrace_code_union { | 42 | union ftrace_code_union { |
30 | char code[MCOUNT_INSN_SIZE]; | 43 | char code[MCOUNT_INSN_SIZE]; |
31 | struct { | 44 | struct { |
@@ -66,11 +79,11 @@ static unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |||
66 | * | 79 | * |
67 | * 1) Put the instruction pointer into the IP buffer | 80 | * 1) Put the instruction pointer into the IP buffer |
68 | * and the new code into the "code" buffer. | 81 | * and the new code into the "code" buffer. |
69 | * 2) Set a flag that says we are modifying code | 82 | * 2) Wait for any running NMIs to finish and set a flag that says |
70 | * 3) Wait for any running NMIs to finish. | 83 | * we are modifying code, it is done in an atomic operation. |
71 | * 4) Write the code | 84 | * 3) Write the code |
72 | * 5) clear the flag. | 85 | * 4) clear the flag. |
73 | * 6) Wait for any running NMIs to finish. | 86 | * 5) Wait for any running NMIs to finish. |
74 | * | 87 | * |
75 | * If an NMI is executed, the first thing it does is to call | 88 | * If an NMI is executed, the first thing it does is to call |
76 | * "ftrace_nmi_enter". This will check if the flag is set to write | 89 | * "ftrace_nmi_enter". This will check if the flag is set to write |
@@ -82,9 +95,9 @@ static unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |||
82 | * are the same as what exists. | 95 | * are the same as what exists. |
83 | */ | 96 | */ |
84 | 97 | ||
85 | static atomic_t in_nmi = ATOMIC_INIT(0); | 98 | #define MOD_CODE_WRITE_FLAG (1 << 31) /* set when NMI should do the write */ |
99 | static atomic_t nmi_running = ATOMIC_INIT(0); | ||
86 | static int mod_code_status; /* holds return value of text write */ | 100 | static int mod_code_status; /* holds return value of text write */ |
87 | static int mod_code_write; /* set when NMI should do the write */ | ||
88 | static void *mod_code_ip; /* holds the IP to write to */ | 101 | static void *mod_code_ip; /* holds the IP to write to */ |
89 | static void *mod_code_newcode; /* holds the text to write to the IP */ | 102 | static void *mod_code_newcode; /* holds the text to write to the IP */ |
90 | 103 | ||
@@ -101,6 +114,20 @@ int ftrace_arch_read_dyn_info(char *buf, int size) | |||
101 | return r; | 114 | return r; |
102 | } | 115 | } |
103 | 116 | ||
117 | static void clear_mod_flag(void) | ||
118 | { | ||
119 | int old = atomic_read(&nmi_running); | ||
120 | |||
121 | for (;;) { | ||
122 | int new = old & ~MOD_CODE_WRITE_FLAG; | ||
123 | |||
124 | if (old == new) | ||
125 | break; | ||
126 | |||
127 | old = atomic_cmpxchg(&nmi_running, old, new); | ||
128 | } | ||
129 | } | ||
130 | |||
104 | static void ftrace_mod_code(void) | 131 | static void ftrace_mod_code(void) |
105 | { | 132 | { |
106 | /* | 133 | /* |
@@ -111,37 +138,52 @@ static void ftrace_mod_code(void) | |||
111 | */ | 138 | */ |
112 | mod_code_status = probe_kernel_write(mod_code_ip, mod_code_newcode, | 139 | mod_code_status = probe_kernel_write(mod_code_ip, mod_code_newcode, |
113 | MCOUNT_INSN_SIZE); | 140 | MCOUNT_INSN_SIZE); |
141 | |||
142 | /* if we fail, then kill any new writers */ | ||
143 | if (mod_code_status) | ||
144 | clear_mod_flag(); | ||
114 | } | 145 | } |
115 | 146 | ||
116 | void ftrace_nmi_enter(void) | 147 | void ftrace_nmi_enter(void) |
117 | { | 148 | { |
118 | atomic_inc(&in_nmi); | 149 | if (atomic_inc_return(&nmi_running) & MOD_CODE_WRITE_FLAG) { |
119 | /* Must have in_nmi seen before reading write flag */ | 150 | smp_rmb(); |
120 | smp_mb(); | ||
121 | if (mod_code_write) { | ||
122 | ftrace_mod_code(); | 151 | ftrace_mod_code(); |
123 | atomic_inc(&nmi_update_count); | 152 | atomic_inc(&nmi_update_count); |
124 | } | 153 | } |
154 | /* Must have previous changes seen before executions */ | ||
155 | smp_mb(); | ||
125 | } | 156 | } |
126 | 157 | ||
127 | void ftrace_nmi_exit(void) | 158 | void ftrace_nmi_exit(void) |
128 | { | 159 | { |
129 | /* Finish all executions before clearing in_nmi */ | 160 | /* Finish all executions before clearing nmi_running */ |
130 | smp_wmb(); | 161 | smp_mb(); |
131 | atomic_dec(&in_nmi); | 162 | atomic_dec(&nmi_running); |
163 | } | ||
164 | |||
165 | static void wait_for_nmi_and_set_mod_flag(void) | ||
166 | { | ||
167 | if (!atomic_cmpxchg(&nmi_running, 0, MOD_CODE_WRITE_FLAG)) | ||
168 | return; | ||
169 | |||
170 | do { | ||
171 | cpu_relax(); | ||
172 | } while (atomic_cmpxchg(&nmi_running, 0, MOD_CODE_WRITE_FLAG)); | ||
173 | |||
174 | nmi_wait_count++; | ||
132 | } | 175 | } |
133 | 176 | ||
134 | static void wait_for_nmi(void) | 177 | static void wait_for_nmi(void) |
135 | { | 178 | { |
136 | int waited = 0; | 179 | if (!atomic_read(&nmi_running)) |
180 | return; | ||
137 | 181 | ||
138 | while (atomic_read(&in_nmi)) { | 182 | do { |
139 | waited = 1; | ||
140 | cpu_relax(); | 183 | cpu_relax(); |
141 | } | 184 | } while (atomic_read(&nmi_running)); |
142 | 185 | ||
143 | if (waited) | 186 | nmi_wait_count++; |
144 | nmi_wait_count++; | ||
145 | } | 187 | } |
146 | 188 | ||
147 | static int | 189 | static int |
@@ -151,14 +193,9 @@ do_ftrace_mod_code(unsigned long ip, void *new_code) | |||
151 | mod_code_newcode = new_code; | 193 | mod_code_newcode = new_code; |
152 | 194 | ||
153 | /* The buffers need to be visible before we let NMIs write them */ | 195 | /* The buffers need to be visible before we let NMIs write them */ |
154 | smp_wmb(); | ||
155 | |||
156 | mod_code_write = 1; | ||
157 | |||
158 | /* Make sure write bit is visible before we wait on NMIs */ | ||
159 | smp_mb(); | 196 | smp_mb(); |
160 | 197 | ||
161 | wait_for_nmi(); | 198 | wait_for_nmi_and_set_mod_flag(); |
162 | 199 | ||
163 | /* Make sure all running NMIs have finished before we write the code */ | 200 | /* Make sure all running NMIs have finished before we write the code */ |
164 | smp_mb(); | 201 | smp_mb(); |
@@ -166,13 +203,9 @@ do_ftrace_mod_code(unsigned long ip, void *new_code) | |||
166 | ftrace_mod_code(); | 203 | ftrace_mod_code(); |
167 | 204 | ||
168 | /* Make sure the write happens before clearing the bit */ | 205 | /* Make sure the write happens before clearing the bit */ |
169 | smp_wmb(); | ||
170 | |||
171 | mod_code_write = 0; | ||
172 | |||
173 | /* make sure NMIs see the cleared bit */ | ||
174 | smp_mb(); | 206 | smp_mb(); |
175 | 207 | ||
208 | clear_mod_flag(); | ||
176 | wait_for_nmi(); | 209 | wait_for_nmi(); |
177 | 210 | ||
178 | return mod_code_status; | 211 | return mod_code_status; |
@@ -368,25 +401,6 @@ int ftrace_disable_ftrace_graph_caller(void) | |||
368 | return ftrace_mod_jmp(ip, old_offset, new_offset); | 401 | return ftrace_mod_jmp(ip, old_offset, new_offset); |
369 | } | 402 | } |
370 | 403 | ||
371 | #else /* CONFIG_DYNAMIC_FTRACE */ | ||
372 | |||
373 | /* | ||
374 | * These functions are picked from those used on | ||
375 | * this page for dynamic ftrace. They have been | ||
376 | * simplified to ignore all traces in NMI context. | ||
377 | */ | ||
378 | static atomic_t in_nmi; | ||
379 | |||
380 | void ftrace_nmi_enter(void) | ||
381 | { | ||
382 | atomic_inc(&in_nmi); | ||
383 | } | ||
384 | |||
385 | void ftrace_nmi_exit(void) | ||
386 | { | ||
387 | atomic_dec(&in_nmi); | ||
388 | } | ||
389 | |||
390 | #endif /* !CONFIG_DYNAMIC_FTRACE */ | 404 | #endif /* !CONFIG_DYNAMIC_FTRACE */ |
391 | 405 | ||
392 | /* | 406 | /* |
@@ -396,14 +410,13 @@ void ftrace_nmi_exit(void) | |||
396 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | 410 | void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) |
397 | { | 411 | { |
398 | unsigned long old; | 412 | unsigned long old; |
399 | unsigned long long calltime; | ||
400 | int faulted; | 413 | int faulted; |
401 | struct ftrace_graph_ent trace; | 414 | struct ftrace_graph_ent trace; |
402 | unsigned long return_hooker = (unsigned long) | 415 | unsigned long return_hooker = (unsigned long) |
403 | &return_to_handler; | 416 | &return_to_handler; |
404 | 417 | ||
405 | /* Nmi's are currently unsupported */ | 418 | /* Nmi's are currently unsupported */ |
406 | if (unlikely(atomic_read(&in_nmi))) | 419 | if (unlikely(in_nmi())) |
407 | return; | 420 | return; |
408 | 421 | ||
409 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) | 422 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) |
@@ -439,17 +452,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
439 | return; | 452 | return; |
440 | } | 453 | } |
441 | 454 | ||
442 | if (unlikely(!__kernel_text_address(old))) { | 455 | if (ftrace_push_return_trace(old, self_addr, &trace.depth) == -EBUSY) { |
443 | ftrace_graph_stop(); | ||
444 | *parent = old; | ||
445 | WARN_ON(1); | ||
446 | return; | ||
447 | } | ||
448 | |||
449 | calltime = cpu_clock(raw_smp_processor_id()); | ||
450 | |||
451 | if (ftrace_push_return_trace(old, calltime, | ||
452 | self_addr, &trace.depth) == -EBUSY) { | ||
453 | *parent = old; | 456 | *parent = old; |
454 | return; | 457 | return; |
455 | } | 458 | } |
@@ -463,3 +466,66 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | |||
463 | } | 466 | } |
464 | } | 467 | } |
465 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 468 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
469 | |||
470 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
471 | |||
472 | extern unsigned long __start_syscalls_metadata[]; | ||
473 | extern unsigned long __stop_syscalls_metadata[]; | ||
474 | extern unsigned long *sys_call_table; | ||
475 | |||
476 | static struct syscall_metadata **syscalls_metadata; | ||
477 | |||
478 | static struct syscall_metadata *find_syscall_meta(unsigned long *syscall) | ||
479 | { | ||
480 | struct syscall_metadata *start; | ||
481 | struct syscall_metadata *stop; | ||
482 | char str[KSYM_SYMBOL_LEN]; | ||
483 | |||
484 | |||
485 | start = (struct syscall_metadata *)__start_syscalls_metadata; | ||
486 | stop = (struct syscall_metadata *)__stop_syscalls_metadata; | ||
487 | kallsyms_lookup((unsigned long) syscall, NULL, NULL, NULL, str); | ||
488 | |||
489 | for ( ; start < stop; start++) { | ||
490 | if (start->name && !strcmp(start->name, str)) | ||
491 | return start; | ||
492 | } | ||
493 | return NULL; | ||
494 | } | ||
495 | |||
496 | struct syscall_metadata *syscall_nr_to_meta(int nr) | ||
497 | { | ||
498 | if (!syscalls_metadata || nr >= FTRACE_SYSCALL_MAX || nr < 0) | ||
499 | return NULL; | ||
500 | |||
501 | return syscalls_metadata[nr]; | ||
502 | } | ||
503 | |||
504 | void arch_init_ftrace_syscalls(void) | ||
505 | { | ||
506 | int i; | ||
507 | struct syscall_metadata *meta; | ||
508 | unsigned long **psys_syscall_table = &sys_call_table; | ||
509 | static atomic_t refs; | ||
510 | |||
511 | if (atomic_inc_return(&refs) != 1) | ||
512 | goto end; | ||
513 | |||
514 | syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * | ||
515 | FTRACE_SYSCALL_MAX, GFP_KERNEL); | ||
516 | if (!syscalls_metadata) { | ||
517 | WARN_ON(1); | ||
518 | return; | ||
519 | } | ||
520 | |||
521 | for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { | ||
522 | meta = find_syscall_meta(psys_syscall_table[i]); | ||
523 | syscalls_metadata[i] = meta; | ||
524 | } | ||
525 | return; | ||
526 | |||
527 | /* Paranoid: avoid overflow */ | ||
528 | end: | ||
529 | atomic_dec(&refs); | ||
530 | } | ||
531 | #endif | ||
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index 55b94614e348..7b5169d2b000 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c | |||
@@ -638,13 +638,13 @@ static void __used __kprobes kretprobe_trampoline_holder(void) | |||
638 | #else | 638 | #else |
639 | " pushf\n" | 639 | " pushf\n" |
640 | /* | 640 | /* |
641 | * Skip cs, ip, orig_ax. | 641 | * Skip cs, ip, orig_ax and gs. |
642 | * trampoline_handler() will plug in these values | 642 | * trampoline_handler() will plug in these values |
643 | */ | 643 | */ |
644 | " subl $12, %esp\n" | 644 | " subl $16, %esp\n" |
645 | " pushl %fs\n" | 645 | " pushl %fs\n" |
646 | " pushl %ds\n" | ||
647 | " pushl %es\n" | 646 | " pushl %es\n" |
647 | " pushl %ds\n" | ||
648 | " pushl %eax\n" | 648 | " pushl %eax\n" |
649 | " pushl %ebp\n" | 649 | " pushl %ebp\n" |
650 | " pushl %edi\n" | 650 | " pushl %edi\n" |
@@ -655,10 +655,10 @@ static void __used __kprobes kretprobe_trampoline_holder(void) | |||
655 | " movl %esp, %eax\n" | 655 | " movl %esp, %eax\n" |
656 | " call trampoline_handler\n" | 656 | " call trampoline_handler\n" |
657 | /* Move flags to cs */ | 657 | /* Move flags to cs */ |
658 | " movl 52(%esp), %edx\n" | 658 | " movl 56(%esp), %edx\n" |
659 | " movl %edx, 48(%esp)\n" | 659 | " movl %edx, 52(%esp)\n" |
660 | /* Replace saved flags with true return address. */ | 660 | /* Replace saved flags with true return address. */ |
661 | " movl %eax, 52(%esp)\n" | 661 | " movl %eax, 56(%esp)\n" |
662 | " popl %ebx\n" | 662 | " popl %ebx\n" |
663 | " popl %ecx\n" | 663 | " popl %ecx\n" |
664 | " popl %edx\n" | 664 | " popl %edx\n" |
@@ -666,8 +666,8 @@ static void __used __kprobes kretprobe_trampoline_holder(void) | |||
666 | " popl %edi\n" | 666 | " popl %edi\n" |
667 | " popl %ebp\n" | 667 | " popl %ebp\n" |
668 | " popl %eax\n" | 668 | " popl %eax\n" |
669 | /* Skip ip, orig_ax, es, ds, fs */ | 669 | /* Skip ds, es, fs, gs, orig_ax and ip */ |
670 | " addl $20, %esp\n" | 670 | " addl $24, %esp\n" |
671 | " popf\n" | 671 | " popf\n" |
672 | #endif | 672 | #endif |
673 | " ret\n"); | 673 | " ret\n"); |
@@ -691,6 +691,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs) | |||
691 | regs->cs = __KERNEL_CS; | 691 | regs->cs = __KERNEL_CS; |
692 | #else | 692 | #else |
693 | regs->cs = __KERNEL_CS | get_kernel_rpl(); | 693 | regs->cs = __KERNEL_CS | get_kernel_rpl(); |
694 | regs->gs = 0; | ||
694 | #endif | 695 | #endif |
695 | regs->ip = trampoline_address; | 696 | regs->ip = trampoline_address; |
696 | regs->orig_ax = ~0UL; | 697 | regs->orig_ax = ~0UL; |
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index c25fdb382292..453b5795a5c6 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
@@ -12,31 +12,30 @@ | |||
12 | * | 12 | * |
13 | * Licensed under the terms of the GNU General Public | 13 | * Licensed under the terms of the GNU General Public |
14 | * License version 2. See file COPYING for details. | 14 | * License version 2. See file COPYING for details. |
15 | */ | 15 | */ |
16 | 16 | #include <linux/platform_device.h> | |
17 | #include <linux/capability.h> | 17 | #include <linux/capability.h> |
18 | #include <linux/kernel.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/sched.h> | ||
21 | #include <linux/cpumask.h> | ||
22 | #include <linux/module.h> | ||
23 | #include <linux/slab.h> | ||
24 | #include <linux/vmalloc.h> | ||
25 | #include <linux/miscdevice.h> | 18 | #include <linux/miscdevice.h> |
19 | #include <linux/firmware.h> | ||
26 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
27 | #include <linux/mm.h> | 21 | #include <linux/cpumask.h> |
28 | #include <linux/fs.h> | 22 | #include <linux/pci_ids.h> |
23 | #include <linux/uaccess.h> | ||
24 | #include <linux/vmalloc.h> | ||
25 | #include <linux/kernel.h> | ||
26 | #include <linux/module.h> | ||
29 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/sched.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/slab.h> | ||
30 | #include <linux/cpu.h> | 31 | #include <linux/cpu.h> |
31 | #include <linux/firmware.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/pci.h> | 32 | #include <linux/pci.h> |
34 | #include <linux/pci_ids.h> | 33 | #include <linux/fs.h> |
35 | #include <linux/uaccess.h> | 34 | #include <linux/mm.h> |
36 | 35 | ||
37 | #include <asm/msr.h> | ||
38 | #include <asm/processor.h> | ||
39 | #include <asm/microcode.h> | 36 | #include <asm/microcode.h> |
37 | #include <asm/processor.h> | ||
38 | #include <asm/msr.h> | ||
40 | 39 | ||
41 | MODULE_DESCRIPTION("AMD Microcode Update Driver"); | 40 | MODULE_DESCRIPTION("AMD Microcode Update Driver"); |
42 | MODULE_AUTHOR("Peter Oruba"); | 41 | MODULE_AUTHOR("Peter Oruba"); |
@@ -72,8 +71,8 @@ struct microcode_header_amd { | |||
72 | } __attribute__((packed)); | 71 | } __attribute__((packed)); |
73 | 72 | ||
74 | struct microcode_amd { | 73 | struct microcode_amd { |
75 | struct microcode_header_amd hdr; | 74 | struct microcode_header_amd hdr; |
76 | unsigned int mpb[0]; | 75 | unsigned int mpb[0]; |
77 | }; | 76 | }; |
78 | 77 | ||
79 | #define UCODE_MAX_SIZE 2048 | 78 | #define UCODE_MAX_SIZE 2048 |
@@ -184,8 +183,8 @@ static int get_ucode_data(void *to, const u8 *from, size_t n) | |||
184 | return 0; | 183 | return 0; |
185 | } | 184 | } |
186 | 185 | ||
187 | static void *get_next_ucode(const u8 *buf, unsigned int size, | 186 | static void * |
188 | unsigned int *mc_size) | 187 | get_next_ucode(const u8 *buf, unsigned int size, unsigned int *mc_size) |
189 | { | 188 | { |
190 | unsigned int total_size; | 189 | unsigned int total_size; |
191 | u8 section_hdr[UCODE_CONTAINER_SECTION_HDR]; | 190 | u8 section_hdr[UCODE_CONTAINER_SECTION_HDR]; |
@@ -223,7 +222,6 @@ static void *get_next_ucode(const u8 *buf, unsigned int size, | |||
223 | return mc; | 222 | return mc; |
224 | } | 223 | } |
225 | 224 | ||
226 | |||
227 | static int install_equiv_cpu_table(const u8 *buf) | 225 | static int install_equiv_cpu_table(const u8 *buf) |
228 | { | 226 | { |
229 | u8 *container_hdr[UCODE_CONTAINER_HEADER_SIZE]; | 227 | u8 *container_hdr[UCODE_CONTAINER_HEADER_SIZE]; |
@@ -372,4 +370,3 @@ struct microcode_ops * __init init_amd_microcode(void) | |||
372 | { | 370 | { |
373 | return µcode_amd_ops; | 371 | return µcode_amd_ops; |
374 | } | 372 | } |
375 | |||
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index c9b721ba968c..a0f3851ef310 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
@@ -70,67 +70,78 @@ | |||
70 | * Fix sigmatch() macro to handle old CPUs with pf == 0. | 70 | * Fix sigmatch() macro to handle old CPUs with pf == 0. |
71 | * Thanks to Stuart Swales for pointing out this bug. | 71 | * Thanks to Stuart Swales for pointing out this bug. |
72 | */ | 72 | */ |
73 | #include <linux/platform_device.h> | ||
73 | #include <linux/capability.h> | 74 | #include <linux/capability.h> |
74 | #include <linux/kernel.h> | 75 | #include <linux/miscdevice.h> |
75 | #include <linux/init.h> | 76 | #include <linux/firmware.h> |
76 | #include <linux/sched.h> | ||
77 | #include <linux/smp_lock.h> | 77 | #include <linux/smp_lock.h> |
78 | #include <linux/spinlock.h> | ||
78 | #include <linux/cpumask.h> | 79 | #include <linux/cpumask.h> |
79 | #include <linux/module.h> | 80 | #include <linux/uaccess.h> |
80 | #include <linux/slab.h> | ||
81 | #include <linux/vmalloc.h> | 81 | #include <linux/vmalloc.h> |
82 | #include <linux/miscdevice.h> | 82 | #include <linux/kernel.h> |
83 | #include <linux/spinlock.h> | 83 | #include <linux/module.h> |
84 | #include <linux/mm.h> | ||
85 | #include <linux/fs.h> | ||
86 | #include <linux/mutex.h> | 84 | #include <linux/mutex.h> |
85 | #include <linux/sched.h> | ||
86 | #include <linux/init.h> | ||
87 | #include <linux/slab.h> | ||
87 | #include <linux/cpu.h> | 88 | #include <linux/cpu.h> |
88 | #include <linux/firmware.h> | 89 | #include <linux/fs.h> |
89 | #include <linux/platform_device.h> | 90 | #include <linux/mm.h> |
90 | 91 | ||
91 | #include <asm/msr.h> | ||
92 | #include <asm/uaccess.h> | ||
93 | #include <asm/processor.h> | ||
94 | #include <asm/microcode.h> | 92 | #include <asm/microcode.h> |
93 | #include <asm/processor.h> | ||
94 | #include <asm/msr.h> | ||
95 | 95 | ||
96 | MODULE_DESCRIPTION("Microcode Update Driver"); | 96 | MODULE_DESCRIPTION("Microcode Update Driver"); |
97 | MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); | 97 | MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); |
98 | MODULE_LICENSE("GPL"); | 98 | MODULE_LICENSE("GPL"); |
99 | 99 | ||
100 | #define MICROCODE_VERSION "2.00" | 100 | #define MICROCODE_VERSION "2.00" |
101 | 101 | ||
102 | static struct microcode_ops *microcode_ops; | 102 | static struct microcode_ops *microcode_ops; |
103 | 103 | ||
104 | /* no concurrent ->write()s are allowed on /dev/cpu/microcode */ | 104 | /* no concurrent ->write()s are allowed on /dev/cpu/microcode */ |
105 | static DEFINE_MUTEX(microcode_mutex); | 105 | static DEFINE_MUTEX(microcode_mutex); |
106 | 106 | ||
107 | struct ucode_cpu_info ucode_cpu_info[NR_CPUS]; | 107 | struct ucode_cpu_info ucode_cpu_info[NR_CPUS]; |
108 | EXPORT_SYMBOL_GPL(ucode_cpu_info); | 108 | EXPORT_SYMBOL_GPL(ucode_cpu_info); |
109 | 109 | ||
110 | #ifdef CONFIG_MICROCODE_OLD_INTERFACE | 110 | #ifdef CONFIG_MICROCODE_OLD_INTERFACE |
111 | struct update_for_cpu { | ||
112 | const void __user *buf; | ||
113 | size_t size; | ||
114 | }; | ||
115 | |||
116 | static long update_for_cpu(void *_ufc) | ||
117 | { | ||
118 | struct update_for_cpu *ufc = _ufc; | ||
119 | int error; | ||
120 | |||
121 | error = microcode_ops->request_microcode_user(smp_processor_id(), | ||
122 | ufc->buf, ufc->size); | ||
123 | if (error < 0) | ||
124 | return error; | ||
125 | if (!error) | ||
126 | microcode_ops->apply_microcode(smp_processor_id()); | ||
127 | return error; | ||
128 | } | ||
129 | |||
111 | static int do_microcode_update(const void __user *buf, size_t size) | 130 | static int do_microcode_update(const void __user *buf, size_t size) |
112 | { | 131 | { |
113 | cpumask_t old; | ||
114 | int error = 0; | 132 | int error = 0; |
115 | int cpu; | 133 | int cpu; |
116 | 134 | struct update_for_cpu ufc = { .buf = buf, .size = size }; | |
117 | old = current->cpus_allowed; | ||
118 | 135 | ||
119 | for_each_online_cpu(cpu) { | 136 | for_each_online_cpu(cpu) { |
120 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 137 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
121 | 138 | ||
122 | if (!uci->valid) | 139 | if (!uci->valid) |
123 | continue; | 140 | continue; |
124 | 141 | error = work_on_cpu(cpu, update_for_cpu, &ufc); | |
125 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); | ||
126 | error = microcode_ops->request_microcode_user(cpu, buf, size); | ||
127 | if (error < 0) | 142 | if (error < 0) |
128 | goto out; | 143 | break; |
129 | if (!error) | ||
130 | microcode_ops->apply_microcode(cpu); | ||
131 | } | 144 | } |
132 | out: | ||
133 | set_cpus_allowed_ptr(current, &old); | ||
134 | return error; | 145 | return error; |
135 | } | 146 | } |
136 | 147 | ||
@@ -198,18 +209,33 @@ static void microcode_dev_exit(void) | |||
198 | 209 | ||
199 | MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); | 210 | MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); |
200 | #else | 211 | #else |
201 | #define microcode_dev_init() 0 | 212 | #define microcode_dev_init() 0 |
202 | #define microcode_dev_exit() do { } while (0) | 213 | #define microcode_dev_exit() do { } while (0) |
203 | #endif | 214 | #endif |
204 | 215 | ||
205 | /* fake device for request_firmware */ | 216 | /* fake device for request_firmware */ |
206 | static struct platform_device *microcode_pdev; | 217 | static struct platform_device *microcode_pdev; |
218 | |||
219 | static long reload_for_cpu(void *unused) | ||
220 | { | ||
221 | struct ucode_cpu_info *uci = ucode_cpu_info + smp_processor_id(); | ||
222 | int err = 0; | ||
223 | |||
224 | mutex_lock(µcode_mutex); | ||
225 | if (uci->valid) { | ||
226 | err = microcode_ops->request_microcode_fw(smp_processor_id(), | ||
227 | µcode_pdev->dev); | ||
228 | if (!err) | ||
229 | microcode_ops->apply_microcode(smp_processor_id()); | ||
230 | } | ||
231 | mutex_unlock(µcode_mutex); | ||
232 | return err; | ||
233 | } | ||
207 | 234 | ||
208 | static ssize_t reload_store(struct sys_device *dev, | 235 | static ssize_t reload_store(struct sys_device *dev, |
209 | struct sysdev_attribute *attr, | 236 | struct sysdev_attribute *attr, |
210 | const char *buf, size_t sz) | 237 | const char *buf, size_t sz) |
211 | { | 238 | { |
212 | struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; | ||
213 | char *end; | 239 | char *end; |
214 | unsigned long val = simple_strtoul(buf, &end, 0); | 240 | unsigned long val = simple_strtoul(buf, &end, 0); |
215 | int err = 0; | 241 | int err = 0; |
@@ -218,21 +244,9 @@ static ssize_t reload_store(struct sys_device *dev, | |||
218 | if (end == buf) | 244 | if (end == buf) |
219 | return -EINVAL; | 245 | return -EINVAL; |
220 | if (val == 1) { | 246 | if (val == 1) { |
221 | cpumask_t old = current->cpus_allowed; | ||
222 | |||
223 | get_online_cpus(); | 247 | get_online_cpus(); |
224 | if (cpu_online(cpu)) { | 248 | if (cpu_online(cpu)) |
225 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); | 249 | err = work_on_cpu(cpu, reload_for_cpu, NULL); |
226 | mutex_lock(µcode_mutex); | ||
227 | if (uci->valid) { | ||
228 | err = microcode_ops->request_microcode_fw(cpu, | ||
229 | µcode_pdev->dev); | ||
230 | if (!err) | ||
231 | microcode_ops->apply_microcode(cpu); | ||
232 | } | ||
233 | mutex_unlock(µcode_mutex); | ||
234 | set_cpus_allowed_ptr(current, &old); | ||
235 | } | ||
236 | put_online_cpus(); | 250 | put_online_cpus(); |
237 | } | 251 | } |
238 | if (err) | 252 | if (err) |
@@ -268,8 +282,8 @@ static struct attribute *mc_default_attrs[] = { | |||
268 | }; | 282 | }; |
269 | 283 | ||
270 | static struct attribute_group mc_attr_group = { | 284 | static struct attribute_group mc_attr_group = { |
271 | .attrs = mc_default_attrs, | 285 | .attrs = mc_default_attrs, |
272 | .name = "microcode", | 286 | .name = "microcode", |
273 | }; | 287 | }; |
274 | 288 | ||
275 | static void __microcode_fini_cpu(int cpu) | 289 | static void __microcode_fini_cpu(int cpu) |
@@ -328,9 +342,9 @@ static int microcode_resume_cpu(int cpu) | |||
328 | return 0; | 342 | return 0; |
329 | } | 343 | } |
330 | 344 | ||
331 | static void microcode_update_cpu(int cpu) | 345 | static long microcode_update_cpu(void *unused) |
332 | { | 346 | { |
333 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 347 | struct ucode_cpu_info *uci = ucode_cpu_info + smp_processor_id(); |
334 | int err = 0; | 348 | int err = 0; |
335 | 349 | ||
336 | /* | 350 | /* |
@@ -338,30 +352,27 @@ static void microcode_update_cpu(int cpu) | |||
338 | * otherwise just request a firmware: | 352 | * otherwise just request a firmware: |
339 | */ | 353 | */ |
340 | if (uci->valid) { | 354 | if (uci->valid) { |
341 | err = microcode_resume_cpu(cpu); | 355 | err = microcode_resume_cpu(smp_processor_id()); |
342 | } else { | 356 | } else { |
343 | collect_cpu_info(cpu); | 357 | collect_cpu_info(smp_processor_id()); |
344 | if (uci->valid && system_state == SYSTEM_RUNNING) | 358 | if (uci->valid && system_state == SYSTEM_RUNNING) |
345 | err = microcode_ops->request_microcode_fw(cpu, | 359 | err = microcode_ops->request_microcode_fw( |
360 | smp_processor_id(), | ||
346 | µcode_pdev->dev); | 361 | µcode_pdev->dev); |
347 | } | 362 | } |
348 | if (!err) | 363 | if (!err) |
349 | microcode_ops->apply_microcode(cpu); | 364 | microcode_ops->apply_microcode(smp_processor_id()); |
365 | return err; | ||
350 | } | 366 | } |
351 | 367 | ||
352 | static void microcode_init_cpu(int cpu) | 368 | static int microcode_init_cpu(int cpu) |
353 | { | 369 | { |
354 | cpumask_t old = current->cpus_allowed; | 370 | int err; |
355 | |||
356 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); | ||
357 | /* We should bind the task to the CPU */ | ||
358 | BUG_ON(raw_smp_processor_id() != cpu); | ||
359 | |||
360 | mutex_lock(µcode_mutex); | 371 | mutex_lock(µcode_mutex); |
361 | microcode_update_cpu(cpu); | 372 | err = work_on_cpu(cpu, microcode_update_cpu, NULL); |
362 | mutex_unlock(µcode_mutex); | 373 | mutex_unlock(µcode_mutex); |
363 | 374 | ||
364 | set_cpus_allowed_ptr(current, &old); | 375 | return err; |
365 | } | 376 | } |
366 | 377 | ||
367 | static int mc_sysdev_add(struct sys_device *sys_dev) | 378 | static int mc_sysdev_add(struct sys_device *sys_dev) |
@@ -379,8 +390,11 @@ static int mc_sysdev_add(struct sys_device *sys_dev) | |||
379 | if (err) | 390 | if (err) |
380 | return err; | 391 | return err; |
381 | 392 | ||
382 | microcode_init_cpu(cpu); | 393 | err = microcode_init_cpu(cpu); |
383 | return 0; | 394 | if (err) |
395 | sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); | ||
396 | |||
397 | return err; | ||
384 | } | 398 | } |
385 | 399 | ||
386 | static int mc_sysdev_remove(struct sys_device *sys_dev) | 400 | static int mc_sysdev_remove(struct sys_device *sys_dev) |
@@ -404,14 +418,14 @@ static int mc_sysdev_resume(struct sys_device *dev) | |||
404 | return 0; | 418 | return 0; |
405 | 419 | ||
406 | /* only CPU 0 will apply ucode here */ | 420 | /* only CPU 0 will apply ucode here */ |
407 | microcode_update_cpu(0); | 421 | microcode_update_cpu(NULL); |
408 | return 0; | 422 | return 0; |
409 | } | 423 | } |
410 | 424 | ||
411 | static struct sysdev_driver mc_sysdev_driver = { | 425 | static struct sysdev_driver mc_sysdev_driver = { |
412 | .add = mc_sysdev_add, | 426 | .add = mc_sysdev_add, |
413 | .remove = mc_sysdev_remove, | 427 | .remove = mc_sysdev_remove, |
414 | .resume = mc_sysdev_resume, | 428 | .resume = mc_sysdev_resume, |
415 | }; | 429 | }; |
416 | 430 | ||
417 | static __cpuinit int | 431 | static __cpuinit int |
@@ -424,7 +438,9 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) | |||
424 | switch (action) { | 438 | switch (action) { |
425 | case CPU_ONLINE: | 439 | case CPU_ONLINE: |
426 | case CPU_ONLINE_FROZEN: | 440 | case CPU_ONLINE_FROZEN: |
427 | microcode_init_cpu(cpu); | 441 | if (microcode_init_cpu(cpu)) |
442 | printk(KERN_ERR "microcode: failed to init CPU%d\n", | ||
443 | cpu); | ||
428 | case CPU_DOWN_FAILED: | 444 | case CPU_DOWN_FAILED: |
429 | case CPU_DOWN_FAILED_FROZEN: | 445 | case CPU_DOWN_FAILED_FROZEN: |
430 | pr_debug("microcode: CPU%d added\n", cpu); | 446 | pr_debug("microcode: CPU%d added\n", cpu); |
@@ -448,7 +464,7 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) | |||
448 | } | 464 | } |
449 | 465 | ||
450 | static struct notifier_block __refdata mc_cpu_notifier = { | 466 | static struct notifier_block __refdata mc_cpu_notifier = { |
451 | .notifier_call = mc_cpu_callback, | 467 | .notifier_call = mc_cpu_callback, |
452 | }; | 468 | }; |
453 | 469 | ||
454 | static int __init microcode_init(void) | 470 | static int __init microcode_init(void) |
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c index 5e9f4fc51385..149b9ec7c1ab 100644 --- a/arch/x86/kernel/microcode_intel.c +++ b/arch/x86/kernel/microcode_intel.c | |||
@@ -70,28 +70,28 @@ | |||
70 | * Fix sigmatch() macro to handle old CPUs with pf == 0. | 70 | * Fix sigmatch() macro to handle old CPUs with pf == 0. |
71 | * Thanks to Stuart Swales for pointing out this bug. | 71 | * Thanks to Stuart Swales for pointing out this bug. |
72 | */ | 72 | */ |
73 | #include <linux/platform_device.h> | ||
73 | #include <linux/capability.h> | 74 | #include <linux/capability.h> |
74 | #include <linux/kernel.h> | 75 | #include <linux/miscdevice.h> |
75 | #include <linux/init.h> | 76 | #include <linux/firmware.h> |
76 | #include <linux/sched.h> | ||
77 | #include <linux/smp_lock.h> | 77 | #include <linux/smp_lock.h> |
78 | #include <linux/spinlock.h> | ||
78 | #include <linux/cpumask.h> | 79 | #include <linux/cpumask.h> |
79 | #include <linux/module.h> | 80 | #include <linux/uaccess.h> |
80 | #include <linux/slab.h> | ||
81 | #include <linux/vmalloc.h> | 81 | #include <linux/vmalloc.h> |
82 | #include <linux/miscdevice.h> | 82 | #include <linux/kernel.h> |
83 | #include <linux/spinlock.h> | 83 | #include <linux/module.h> |
84 | #include <linux/mm.h> | ||
85 | #include <linux/fs.h> | ||
86 | #include <linux/mutex.h> | 84 | #include <linux/mutex.h> |
85 | #include <linux/sched.h> | ||
86 | #include <linux/init.h> | ||
87 | #include <linux/slab.h> | ||
87 | #include <linux/cpu.h> | 88 | #include <linux/cpu.h> |
88 | #include <linux/firmware.h> | 89 | #include <linux/fs.h> |
89 | #include <linux/platform_device.h> | 90 | #include <linux/mm.h> |
90 | #include <linux/uaccess.h> | ||
91 | 91 | ||
92 | #include <asm/msr.h> | ||
93 | #include <asm/processor.h> | ||
94 | #include <asm/microcode.h> | 92 | #include <asm/microcode.h> |
93 | #include <asm/processor.h> | ||
94 | #include <asm/msr.h> | ||
95 | 95 | ||
96 | MODULE_DESCRIPTION("Microcode Update Driver"); | 96 | MODULE_DESCRIPTION("Microcode Update Driver"); |
97 | MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); | 97 | MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); |
@@ -129,12 +129,13 @@ struct extended_sigtable { | |||
129 | struct extended_signature sigs[0]; | 129 | struct extended_signature sigs[0]; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | #define DEFAULT_UCODE_DATASIZE (2000) | 132 | #define DEFAULT_UCODE_DATASIZE (2000) |
133 | #define MC_HEADER_SIZE (sizeof(struct microcode_header_intel)) | 133 | #define MC_HEADER_SIZE (sizeof(struct microcode_header_intel)) |
134 | #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) | 134 | #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) |
135 | #define EXT_HEADER_SIZE (sizeof(struct extended_sigtable)) | 135 | #define EXT_HEADER_SIZE (sizeof(struct extended_sigtable)) |
136 | #define EXT_SIGNATURE_SIZE (sizeof(struct extended_signature)) | 136 | #define EXT_SIGNATURE_SIZE (sizeof(struct extended_signature)) |
137 | #define DWSIZE (sizeof(u32)) | 137 | #define DWSIZE (sizeof(u32)) |
138 | |||
138 | #define get_totalsize(mc) \ | 139 | #define get_totalsize(mc) \ |
139 | (((struct microcode_intel *)mc)->hdr.totalsize ? \ | 140 | (((struct microcode_intel *)mc)->hdr.totalsize ? \ |
140 | ((struct microcode_intel *)mc)->hdr.totalsize : \ | 141 | ((struct microcode_intel *)mc)->hdr.totalsize : \ |
@@ -197,30 +198,31 @@ static inline int update_match_cpu(struct cpu_signature *csig, int sig, int pf) | |||
197 | } | 198 | } |
198 | 199 | ||
199 | static inline int | 200 | static inline int |
200 | update_match_revision(struct microcode_header_intel *mc_header, int rev) | 201 | update_match_revision(struct microcode_header_intel *mc_header, int rev) |
201 | { | 202 | { |
202 | return (mc_header->rev <= rev) ? 0 : 1; | 203 | return (mc_header->rev <= rev) ? 0 : 1; |
203 | } | 204 | } |
204 | 205 | ||
205 | static int microcode_sanity_check(void *mc) | 206 | static int microcode_sanity_check(void *mc) |
206 | { | 207 | { |
208 | unsigned long total_size, data_size, ext_table_size; | ||
207 | struct microcode_header_intel *mc_header = mc; | 209 | struct microcode_header_intel *mc_header = mc; |
208 | struct extended_sigtable *ext_header = NULL; | 210 | struct extended_sigtable *ext_header = NULL; |
209 | struct extended_signature *ext_sig; | ||
210 | unsigned long total_size, data_size, ext_table_size; | ||
211 | int sum, orig_sum, ext_sigcount = 0, i; | 211 | int sum, orig_sum, ext_sigcount = 0, i; |
212 | struct extended_signature *ext_sig; | ||
212 | 213 | ||
213 | total_size = get_totalsize(mc_header); | 214 | total_size = get_totalsize(mc_header); |
214 | data_size = get_datasize(mc_header); | 215 | data_size = get_datasize(mc_header); |
216 | |||
215 | if (data_size + MC_HEADER_SIZE > total_size) { | 217 | if (data_size + MC_HEADER_SIZE > total_size) { |
216 | printk(KERN_ERR "microcode: error! " | 218 | printk(KERN_ERR "microcode: error! " |
217 | "Bad data size in microcode data file\n"); | 219 | "Bad data size in microcode data file\n"); |
218 | return -EINVAL; | 220 | return -EINVAL; |
219 | } | 221 | } |
220 | 222 | ||
221 | if (mc_header->ldrver != 1 || mc_header->hdrver != 1) { | 223 | if (mc_header->ldrver != 1 || mc_header->hdrver != 1) { |
222 | printk(KERN_ERR "microcode: error! " | 224 | printk(KERN_ERR "microcode: error! " |
223 | "Unknown microcode update format\n"); | 225 | "Unknown microcode update format\n"); |
224 | return -EINVAL; | 226 | return -EINVAL; |
225 | } | 227 | } |
226 | ext_table_size = total_size - (MC_HEADER_SIZE + data_size); | 228 | ext_table_size = total_size - (MC_HEADER_SIZE + data_size); |
@@ -318,11 +320,15 @@ get_matching_microcode(struct cpu_signature *cpu_sig, void *mc, int rev) | |||
318 | 320 | ||
319 | static void apply_microcode(int cpu) | 321 | static void apply_microcode(int cpu) |
320 | { | 322 | { |
323 | struct microcode_intel *mc_intel; | ||
324 | struct ucode_cpu_info *uci; | ||
321 | unsigned long flags; | 325 | unsigned long flags; |
322 | unsigned int val[2]; | 326 | unsigned int val[2]; |
323 | int cpu_num = raw_smp_processor_id(); | 327 | int cpu_num; |
324 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 328 | |
325 | struct microcode_intel *mc_intel = uci->mc; | 329 | cpu_num = raw_smp_processor_id(); |
330 | uci = ucode_cpu_info + cpu; | ||
331 | mc_intel = uci->mc; | ||
326 | 332 | ||
327 | /* We should bind the task to the CPU */ | 333 | /* We should bind the task to the CPU */ |
328 | BUG_ON(cpu_num != cpu); | 334 | BUG_ON(cpu_num != cpu); |
@@ -348,15 +354,17 @@ static void apply_microcode(int cpu) | |||
348 | spin_unlock_irqrestore(µcode_update_lock, flags); | 354 | spin_unlock_irqrestore(µcode_update_lock, flags); |
349 | if (val[1] != mc_intel->hdr.rev) { | 355 | if (val[1] != mc_intel->hdr.rev) { |
350 | printk(KERN_ERR "microcode: CPU%d update from revision " | 356 | printk(KERN_ERR "microcode: CPU%d update from revision " |
351 | "0x%x to 0x%x failed\n", cpu_num, uci->cpu_sig.rev, val[1]); | 357 | "0x%x to 0x%x failed\n", |
358 | cpu_num, uci->cpu_sig.rev, val[1]); | ||
352 | return; | 359 | return; |
353 | } | 360 | } |
354 | printk(KERN_INFO "microcode: CPU%d updated from revision " | 361 | printk(KERN_INFO "microcode: CPU%d updated from revision " |
355 | "0x%x to 0x%x, date = %04x-%02x-%02x \n", | 362 | "0x%x to 0x%x, date = %04x-%02x-%02x \n", |
356 | cpu_num, uci->cpu_sig.rev, val[1], | 363 | cpu_num, uci->cpu_sig.rev, val[1], |
357 | mc_intel->hdr.date & 0xffff, | 364 | mc_intel->hdr.date & 0xffff, |
358 | mc_intel->hdr.date >> 24, | 365 | mc_intel->hdr.date >> 24, |
359 | (mc_intel->hdr.date >> 16) & 0xff); | 366 | (mc_intel->hdr.date >> 16) & 0xff); |
367 | |||
360 | uci->cpu_sig.rev = val[1]; | 368 | uci->cpu_sig.rev = val[1]; |
361 | } | 369 | } |
362 | 370 | ||
@@ -404,18 +412,23 @@ static int generic_load_microcode(int cpu, void *data, size_t size, | |||
404 | leftover -= mc_size; | 412 | leftover -= mc_size; |
405 | } | 413 | } |
406 | 414 | ||
407 | if (new_mc) { | 415 | if (!new_mc) |
408 | if (!leftover) { | 416 | goto out; |
409 | if (uci->mc) | 417 | |
410 | vfree(uci->mc); | 418 | if (leftover) { |
411 | uci->mc = (struct microcode_intel *)new_mc; | 419 | vfree(new_mc); |
412 | pr_debug("microcode: CPU%d found a matching microcode update with" | 420 | goto out; |
413 | " version 0x%x (current=0x%x)\n", | ||
414 | cpu, new_rev, uci->cpu_sig.rev); | ||
415 | } else | ||
416 | vfree(new_mc); | ||
417 | } | 421 | } |
418 | 422 | ||
423 | if (uci->mc) | ||
424 | vfree(uci->mc); | ||
425 | uci->mc = (struct microcode_intel *)new_mc; | ||
426 | |||
427 | pr_debug("microcode: CPU%d found a matching microcode update with" | ||
428 | " version 0x%x (current=0x%x)\n", | ||
429 | cpu, new_rev, uci->cpu_sig.rev); | ||
430 | |||
431 | out: | ||
419 | return (int)leftover; | 432 | return (int)leftover; |
420 | } | 433 | } |
421 | 434 | ||
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 156f87582c6c..ca989158e847 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
9 | #include <linux/pm.h> | 9 | #include <linux/pm.h> |
10 | #include <linux/clockchips.h> | 10 | #include <linux/clockchips.h> |
11 | #include <linux/ftrace.h> | 11 | #include <trace/power.h> |
12 | #include <asm/system.h> | 12 | #include <asm/system.h> |
13 | #include <asm/apic.h> | 13 | #include <asm/apic.h> |
14 | #include <asm/idle.h> | 14 | #include <asm/idle.h> |
@@ -22,6 +22,9 @@ EXPORT_SYMBOL(idle_nomwait); | |||
22 | 22 | ||
23 | struct kmem_cache *task_xstate_cachep; | 23 | struct kmem_cache *task_xstate_cachep; |
24 | 24 | ||
25 | DEFINE_TRACE(power_start); | ||
26 | DEFINE_TRACE(power_end); | ||
27 | |||
25 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | 28 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) |
26 | { | 29 | { |
27 | *dst = *src; | 30 | *dst = *src; |
@@ -325,7 +328,7 @@ void stop_this_cpu(void *dummy) | |||
325 | /* | 328 | /* |
326 | * Remove this CPU: | 329 | * Remove this CPU: |
327 | */ | 330 | */ |
328 | cpu_clear(smp_processor_id(), cpu_online_map); | 331 | set_cpu_online(smp_processor_id(), false); |
329 | disable_local_APIC(); | 332 | disable_local_APIC(); |
330 | 333 | ||
331 | for (;;) { | 334 | for (;;) { |
@@ -475,12 +478,13 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c) | |||
475 | return 1; | 478 | return 1; |
476 | } | 479 | } |
477 | 480 | ||
478 | static cpumask_t c1e_mask = CPU_MASK_NONE; | 481 | static cpumask_var_t c1e_mask; |
479 | static int c1e_detected; | 482 | static int c1e_detected; |
480 | 483 | ||
481 | void c1e_remove_cpu(int cpu) | 484 | void c1e_remove_cpu(int cpu) |
482 | { | 485 | { |
483 | cpu_clear(cpu, c1e_mask); | 486 | if (c1e_mask != NULL) |
487 | cpumask_clear_cpu(cpu, c1e_mask); | ||
484 | } | 488 | } |
485 | 489 | ||
486 | /* | 490 | /* |
@@ -509,8 +513,8 @@ static void c1e_idle(void) | |||
509 | if (c1e_detected) { | 513 | if (c1e_detected) { |
510 | int cpu = smp_processor_id(); | 514 | int cpu = smp_processor_id(); |
511 | 515 | ||
512 | if (!cpu_isset(cpu, c1e_mask)) { | 516 | if (!cpumask_test_cpu(cpu, c1e_mask)) { |
513 | cpu_set(cpu, c1e_mask); | 517 | cpumask_set_cpu(cpu, c1e_mask); |
514 | /* | 518 | /* |
515 | * Force broadcast so ACPI can not interfere. Needs | 519 | * Force broadcast so ACPI can not interfere. Needs |
516 | * to run with interrupts enabled as it uses | 520 | * to run with interrupts enabled as it uses |
@@ -562,6 +566,15 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) | |||
562 | pm_idle = default_idle; | 566 | pm_idle = default_idle; |
563 | } | 567 | } |
564 | 568 | ||
569 | void __init init_c1e_mask(void) | ||
570 | { | ||
571 | /* If we're using c1e_idle, we need to allocate c1e_mask. */ | ||
572 | if (pm_idle == c1e_idle) { | ||
573 | alloc_cpumask_var(&c1e_mask, GFP_KERNEL); | ||
574 | cpumask_clear(c1e_mask); | ||
575 | } | ||
576 | } | ||
577 | |||
565 | static int __init idle_setup(char *str) | 578 | static int __init idle_setup(char *str) |
566 | { | 579 | { |
567 | if (!str) | 580 | if (!str) |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 14014d766cad..76f8f84043a2 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -245,7 +245,7 @@ void prepare_to_copy(struct task_struct *tsk) | |||
245 | unlazy_fpu(tsk); | 245 | unlazy_fpu(tsk); |
246 | } | 246 | } |
247 | 247 | ||
248 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | 248 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
249 | unsigned long unused, | 249 | unsigned long unused, |
250 | struct task_struct *p, struct pt_regs *regs) | 250 | struct task_struct *p, struct pt_regs *regs) |
251 | { | 251 | { |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index abb7e6a7f0c6..b751a41392b1 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -278,7 +278,7 @@ void prepare_to_copy(struct task_struct *tsk) | |||
278 | unlazy_fpu(tsk); | 278 | unlazy_fpu(tsk); |
279 | } | 279 | } |
280 | 280 | ||
281 | int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | 281 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
282 | unsigned long unused, | 282 | unsigned long unused, |
283 | struct task_struct *p, struct pt_regs *regs) | 283 | struct task_struct *p, struct pt_regs *regs) |
284 | { | 284 | { |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 19378715f415..fe9345c967de 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/audit.h> | 21 | #include <linux/audit.h> |
22 | #include <linux/seccomp.h> | 22 | #include <linux/seccomp.h> |
23 | #include <linux/signal.h> | 23 | #include <linux/signal.h> |
24 | #include <linux/ftrace.h> | ||
24 | 25 | ||
25 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
26 | #include <asm/pgtable.h> | 27 | #include <asm/pgtable.h> |
@@ -1415,6 +1416,9 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs) | |||
1415 | tracehook_report_syscall_entry(regs)) | 1416 | tracehook_report_syscall_entry(regs)) |
1416 | ret = -1L; | 1417 | ret = -1L; |
1417 | 1418 | ||
1419 | if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE))) | ||
1420 | ftrace_syscall_enter(regs); | ||
1421 | |||
1418 | if (unlikely(current->audit_context)) { | 1422 | if (unlikely(current->audit_context)) { |
1419 | if (IS_IA32) | 1423 | if (IS_IA32) |
1420 | audit_syscall_entry(AUDIT_ARCH_I386, | 1424 | audit_syscall_entry(AUDIT_ARCH_I386, |
@@ -1438,6 +1442,9 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs) | |||
1438 | if (unlikely(current->audit_context)) | 1442 | if (unlikely(current->audit_context)) |
1439 | audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax); | 1443 | audit_syscall_exit(AUDITSC_RESULT(regs->ax), regs->ax); |
1440 | 1444 | ||
1445 | if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE))) | ||
1446 | ftrace_syscall_exit(regs); | ||
1447 | |||
1441 | if (test_thread_flag(TIF_SYSCALL_TRACE)) | 1448 | if (test_thread_flag(TIF_SYSCALL_TRACE)) |
1442 | tracehook_report_syscall_exit(regs, 0); | 1449 | tracehook_report_syscall_exit(regs, 0); |
1443 | 1450 | ||
@@ -1455,6 +1462,6 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs) | |||
1455 | * system call instruction. | 1462 | * system call instruction. |
1456 | */ | 1463 | */ |
1457 | if (test_thread_flag(TIF_SINGLESTEP) && | 1464 | if (test_thread_flag(TIF_SINGLESTEP) && |
1458 | tracehook_consider_fatal_signal(current, SIGTRAP, SIG_DFL)) | 1465 | tracehook_consider_fatal_signal(current, SIGTRAP)) |
1459 | send_sigtrap(current, regs, 0, TRAP_BRKPT); | 1466 | send_sigtrap(current, regs, 0, TRAP_BRKPT); |
1460 | } | 1467 | } |
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 400331b50a53..3a97a4cf1872 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -153,7 +153,6 @@ static struct page * __init pcpur_get_page(unsigned int cpu, int pageno) | |||
153 | static ssize_t __init setup_pcpu_remap(size_t static_size) | 153 | static ssize_t __init setup_pcpu_remap(size_t static_size) |
154 | { | 154 | { |
155 | static struct vm_struct vm; | 155 | static struct vm_struct vm; |
156 | pg_data_t *last; | ||
157 | size_t ptrs_size, dyn_size; | 156 | size_t ptrs_size, dyn_size; |
158 | unsigned int cpu; | 157 | unsigned int cpu; |
159 | ssize_t ret; | 158 | ssize_t ret; |
@@ -162,22 +161,9 @@ static ssize_t __init setup_pcpu_remap(size_t static_size) | |||
162 | * If large page isn't supported, there's no benefit in doing | 161 | * If large page isn't supported, there's no benefit in doing |
163 | * this. Also, on non-NUMA, embedding is better. | 162 | * this. Also, on non-NUMA, embedding is better. |
164 | */ | 163 | */ |
165 | if (!cpu_has_pse || pcpu_need_numa()) | 164 | if (!cpu_has_pse || !pcpu_need_numa()) |
166 | return -EINVAL; | 165 | return -EINVAL; |
167 | 166 | ||
168 | last = NULL; | ||
169 | for_each_possible_cpu(cpu) { | ||
170 | int node = early_cpu_to_node(cpu); | ||
171 | |||
172 | if (node_online(node) && NODE_DATA(node) && | ||
173 | last && last != NODE_DATA(node)) | ||
174 | goto proceed; | ||
175 | |||
176 | last = NODE_DATA(node); | ||
177 | } | ||
178 | return -EINVAL; | ||
179 | |||
180 | proceed: | ||
181 | /* | 167 | /* |
182 | * Currently supports only single page. Supporting multiple | 168 | * Currently supports only single page. Supporting multiple |
183 | * pages won't be too difficult if it ever becomes necessary. | 169 | * pages won't be too difficult if it ever becomes necessary. |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index dfcc74ab0ab6..14425166b8e3 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -221,7 +221,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size, | |||
221 | if (!onsigstack) { | 221 | if (!onsigstack) { |
222 | /* This is the X/Open sanctioned signal stack switching. */ | 222 | /* This is the X/Open sanctioned signal stack switching. */ |
223 | if (ka->sa.sa_flags & SA_ONSTACK) { | 223 | if (ka->sa.sa_flags & SA_ONSTACK) { |
224 | if (sas_ss_flags(sp) == 0) | 224 | if (current->sas_ss_size) |
225 | sp = current->sas_ss_sp + current->sas_ss_size; | 225 | sp = current->sas_ss_sp + current->sas_ss_size; |
226 | } else { | 226 | } else { |
227 | #ifdef CONFIG_X86_32 | 227 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index ef7d10170c30..58d24ef917d8 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -101,11 +101,11 @@ EXPORT_SYMBOL(smp_num_siblings); | |||
101 | DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID; | 101 | DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID; |
102 | 102 | ||
103 | /* representing HT siblings of each logical CPU */ | 103 | /* representing HT siblings of each logical CPU */ |
104 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map); | 104 | DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map); |
105 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); | 105 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); |
106 | 106 | ||
107 | /* representing HT and core siblings of each logical CPU */ | 107 | /* representing HT and core siblings of each logical CPU */ |
108 | DEFINE_PER_CPU(cpumask_t, cpu_core_map); | 108 | DEFINE_PER_CPU(cpumask_var_t, cpu_core_map); |
109 | EXPORT_PER_CPU_SYMBOL(cpu_core_map); | 109 | EXPORT_PER_CPU_SYMBOL(cpu_core_map); |
110 | 110 | ||
111 | /* Per CPU bogomips and other parameters */ | 111 | /* Per CPU bogomips and other parameters */ |
@@ -115,11 +115,6 @@ EXPORT_PER_CPU_SYMBOL(cpu_info); | |||
115 | atomic_t init_deasserted; | 115 | atomic_t init_deasserted; |
116 | 116 | ||
117 | #if defined(CONFIG_NUMA) && defined(CONFIG_X86_32) | 117 | #if defined(CONFIG_NUMA) && defined(CONFIG_X86_32) |
118 | |||
119 | /* which logical CPUs are on which nodes */ | ||
120 | cpumask_t node_to_cpumask_map[MAX_NUMNODES] __read_mostly = | ||
121 | { [0 ... MAX_NUMNODES-1] = CPU_MASK_NONE }; | ||
122 | EXPORT_SYMBOL(node_to_cpumask_map); | ||
123 | /* which node each logical CPU is on */ | 118 | /* which node each logical CPU is on */ |
124 | int cpu_to_node_map[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = 0 }; | 119 | int cpu_to_node_map[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = 0 }; |
125 | EXPORT_SYMBOL(cpu_to_node_map); | 120 | EXPORT_SYMBOL(cpu_to_node_map); |
@@ -128,7 +123,7 @@ EXPORT_SYMBOL(cpu_to_node_map); | |||
128 | static void map_cpu_to_node(int cpu, int node) | 123 | static void map_cpu_to_node(int cpu, int node) |
129 | { | 124 | { |
130 | printk(KERN_INFO "Mapping cpu %d to node %d\n", cpu, node); | 125 | printk(KERN_INFO "Mapping cpu %d to node %d\n", cpu, node); |
131 | cpumask_set_cpu(cpu, &node_to_cpumask_map[node]); | 126 | cpumask_set_cpu(cpu, node_to_cpumask_map[node]); |
132 | cpu_to_node_map[cpu] = node; | 127 | cpu_to_node_map[cpu] = node; |
133 | } | 128 | } |
134 | 129 | ||
@@ -139,7 +134,7 @@ static void unmap_cpu_to_node(int cpu) | |||
139 | 134 | ||
140 | printk(KERN_INFO "Unmapping cpu %d from all nodes\n", cpu); | 135 | printk(KERN_INFO "Unmapping cpu %d from all nodes\n", cpu); |
141 | for (node = 0; node < MAX_NUMNODES; node++) | 136 | for (node = 0; node < MAX_NUMNODES; node++) |
142 | cpumask_clear_cpu(cpu, &node_to_cpumask_map[node]); | 137 | cpumask_clear_cpu(cpu, node_to_cpumask_map[node]); |
143 | cpu_to_node_map[cpu] = 0; | 138 | cpu_to_node_map[cpu] = 0; |
144 | } | 139 | } |
145 | #else /* !(CONFIG_NUMA && CONFIG_X86_32) */ | 140 | #else /* !(CONFIG_NUMA && CONFIG_X86_32) */ |
@@ -301,7 +296,7 @@ notrace static void __cpuinit start_secondary(void *unused) | |||
301 | __flush_tlb_all(); | 296 | __flush_tlb_all(); |
302 | #endif | 297 | #endif |
303 | 298 | ||
304 | /* This must be done before setting cpu_online_map */ | 299 | /* This must be done before setting cpu_online_mask */ |
305 | set_cpu_sibling_map(raw_smp_processor_id()); | 300 | set_cpu_sibling_map(raw_smp_processor_id()); |
306 | wmb(); | 301 | wmb(); |
307 | 302 | ||
@@ -334,6 +329,23 @@ notrace static void __cpuinit start_secondary(void *unused) | |||
334 | cpu_idle(); | 329 | cpu_idle(); |
335 | } | 330 | } |
336 | 331 | ||
332 | #ifdef CONFIG_CPUMASK_OFFSTACK | ||
333 | /* In this case, llc_shared_map is a pointer to a cpumask. */ | ||
334 | static inline void copy_cpuinfo_x86(struct cpuinfo_x86 *dst, | ||
335 | const struct cpuinfo_x86 *src) | ||
336 | { | ||
337 | struct cpumask *llc = dst->llc_shared_map; | ||
338 | *dst = *src; | ||
339 | dst->llc_shared_map = llc; | ||
340 | } | ||
341 | #else | ||
342 | static inline void copy_cpuinfo_x86(struct cpuinfo_x86 *dst, | ||
343 | const struct cpuinfo_x86 *src) | ||
344 | { | ||
345 | *dst = *src; | ||
346 | } | ||
347 | #endif /* CONFIG_CPUMASK_OFFSTACK */ | ||
348 | |||
337 | /* | 349 | /* |
338 | * The bootstrap kernel entry code has set these up. Save them for | 350 | * The bootstrap kernel entry code has set these up. Save them for |
339 | * a given CPU | 351 | * a given CPU |
@@ -343,7 +355,7 @@ void __cpuinit smp_store_cpu_info(int id) | |||
343 | { | 355 | { |
344 | struct cpuinfo_x86 *c = &cpu_data(id); | 356 | struct cpuinfo_x86 *c = &cpu_data(id); |
345 | 357 | ||
346 | *c = boot_cpu_data; | 358 | copy_cpuinfo_x86(c, &boot_cpu_data); |
347 | c->cpu_index = id; | 359 | c->cpu_index = id; |
348 | if (id != 0) | 360 | if (id != 0) |
349 | identify_secondary_cpu(c); | 361 | identify_secondary_cpu(c); |
@@ -367,15 +379,15 @@ void __cpuinit set_cpu_sibling_map(int cpu) | |||
367 | cpumask_set_cpu(cpu, cpu_sibling_mask(i)); | 379 | cpumask_set_cpu(cpu, cpu_sibling_mask(i)); |
368 | cpumask_set_cpu(i, cpu_core_mask(cpu)); | 380 | cpumask_set_cpu(i, cpu_core_mask(cpu)); |
369 | cpumask_set_cpu(cpu, cpu_core_mask(i)); | 381 | cpumask_set_cpu(cpu, cpu_core_mask(i)); |
370 | cpumask_set_cpu(i, &c->llc_shared_map); | 382 | cpumask_set_cpu(i, c->llc_shared_map); |
371 | cpumask_set_cpu(cpu, &o->llc_shared_map); | 383 | cpumask_set_cpu(cpu, o->llc_shared_map); |
372 | } | 384 | } |
373 | } | 385 | } |
374 | } else { | 386 | } else { |
375 | cpumask_set_cpu(cpu, cpu_sibling_mask(cpu)); | 387 | cpumask_set_cpu(cpu, cpu_sibling_mask(cpu)); |
376 | } | 388 | } |
377 | 389 | ||
378 | cpumask_set_cpu(cpu, &c->llc_shared_map); | 390 | cpumask_set_cpu(cpu, c->llc_shared_map); |
379 | 391 | ||
380 | if (current_cpu_data.x86_max_cores == 1) { | 392 | if (current_cpu_data.x86_max_cores == 1) { |
381 | cpumask_copy(cpu_core_mask(cpu), cpu_sibling_mask(cpu)); | 393 | cpumask_copy(cpu_core_mask(cpu), cpu_sibling_mask(cpu)); |
@@ -386,8 +398,8 @@ void __cpuinit set_cpu_sibling_map(int cpu) | |||
386 | for_each_cpu(i, cpu_sibling_setup_mask) { | 398 | for_each_cpu(i, cpu_sibling_setup_mask) { |
387 | if (per_cpu(cpu_llc_id, cpu) != BAD_APICID && | 399 | if (per_cpu(cpu_llc_id, cpu) != BAD_APICID && |
388 | per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) { | 400 | per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) { |
389 | cpumask_set_cpu(i, &c->llc_shared_map); | 401 | cpumask_set_cpu(i, c->llc_shared_map); |
390 | cpumask_set_cpu(cpu, &cpu_data(i).llc_shared_map); | 402 | cpumask_set_cpu(cpu, cpu_data(i).llc_shared_map); |
391 | } | 403 | } |
392 | if (c->phys_proc_id == cpu_data(i).phys_proc_id) { | 404 | if (c->phys_proc_id == cpu_data(i).phys_proc_id) { |
393 | cpumask_set_cpu(i, cpu_core_mask(cpu)); | 405 | cpumask_set_cpu(i, cpu_core_mask(cpu)); |
@@ -425,12 +437,7 @@ const struct cpumask *cpu_coregroup_mask(int cpu) | |||
425 | if (sched_mc_power_savings || sched_smt_power_savings) | 437 | if (sched_mc_power_savings || sched_smt_power_savings) |
426 | return cpu_core_mask(cpu); | 438 | return cpu_core_mask(cpu); |
427 | else | 439 | else |
428 | return &c->llc_shared_map; | 440 | return c->llc_shared_map; |
429 | } | ||
430 | |||
431 | cpumask_t cpu_coregroup_map(int cpu) | ||
432 | { | ||
433 | return *cpu_coregroup_mask(cpu); | ||
434 | } | 441 | } |
435 | 442 | ||
436 | static void impress_friends(void) | 443 | static void impress_friends(void) |
@@ -897,9 +904,8 @@ int __cpuinit native_cpu_up(unsigned int cpu) | |||
897 | */ | 904 | */ |
898 | static __init void disable_smp(void) | 905 | static __init void disable_smp(void) |
899 | { | 906 | { |
900 | /* use the read/write pointers to the present and possible maps */ | 907 | init_cpu_present(cpumask_of(0)); |
901 | cpumask_copy(&cpu_present_map, cpumask_of(0)); | 908 | init_cpu_possible(cpumask_of(0)); |
902 | cpumask_copy(&cpu_possible_map, cpumask_of(0)); | ||
903 | smpboot_clear_io_apic_irqs(); | 909 | smpboot_clear_io_apic_irqs(); |
904 | 910 | ||
905 | if (smp_found_config) | 911 | if (smp_found_config) |
@@ -1031,6 +1037,8 @@ static void __init smp_cpu_index_default(void) | |||
1031 | */ | 1037 | */ |
1032 | void __init native_smp_prepare_cpus(unsigned int max_cpus) | 1038 | void __init native_smp_prepare_cpus(unsigned int max_cpus) |
1033 | { | 1039 | { |
1040 | unsigned int i; | ||
1041 | |||
1034 | preempt_disable(); | 1042 | preempt_disable(); |
1035 | smp_cpu_index_default(); | 1043 | smp_cpu_index_default(); |
1036 | current_cpu_data = boot_cpu_data; | 1044 | current_cpu_data = boot_cpu_data; |
@@ -1044,6 +1052,14 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
1044 | boot_cpu_logical_apicid = logical_smp_processor_id(); | 1052 | boot_cpu_logical_apicid = logical_smp_processor_id(); |
1045 | #endif | 1053 | #endif |
1046 | current_thread_info()->cpu = 0; /* needed? */ | 1054 | current_thread_info()->cpu = 0; /* needed? */ |
1055 | for_each_possible_cpu(i) { | ||
1056 | alloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL); | ||
1057 | alloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL); | ||
1058 | alloc_cpumask_var(&cpu_data(i).llc_shared_map, GFP_KERNEL); | ||
1059 | cpumask_clear(per_cpu(cpu_core_map, i)); | ||
1060 | cpumask_clear(per_cpu(cpu_sibling_map, i)); | ||
1061 | cpumask_clear(cpu_data(i).llc_shared_map); | ||
1062 | } | ||
1047 | set_cpu_sibling_map(0); | 1063 | set_cpu_sibling_map(0); |
1048 | 1064 | ||
1049 | enable_IR_x2apic(); | 1065 | enable_IR_x2apic(); |
@@ -1132,11 +1148,11 @@ early_param("possible_cpus", _setup_possible_cpus); | |||
1132 | 1148 | ||
1133 | 1149 | ||
1134 | /* | 1150 | /* |
1135 | * cpu_possible_map should be static, it cannot change as cpu's | 1151 | * cpu_possible_mask should be static, it cannot change as cpu's |
1136 | * are onlined, or offlined. The reason is per-cpu data-structures | 1152 | * are onlined, or offlined. The reason is per-cpu data-structures |
1137 | * are allocated by some modules at init time, and dont expect to | 1153 | * are allocated by some modules at init time, and dont expect to |
1138 | * do this dynamically on cpu arrival/departure. | 1154 | * do this dynamically on cpu arrival/departure. |
1139 | * cpu_present_map on the other hand can change dynamically. | 1155 | * cpu_present_mask on the other hand can change dynamically. |
1140 | * In case when cpu_hotplug is not compiled, then we resort to current | 1156 | * In case when cpu_hotplug is not compiled, then we resort to current |
1141 | * behaviour, which is cpu_possible == cpu_present. | 1157 | * behaviour, which is cpu_possible == cpu_present. |
1142 | * - Ashok Raj | 1158 | * - Ashok Raj |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index 3bdb64829b82..ff5c8736b491 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -332,3 +332,5 @@ ENTRY(sys_call_table) | |||
332 | .long sys_dup3 /* 330 */ | 332 | .long sys_dup3 /* 330 */ |
333 | .long sys_pipe2 | 333 | .long sys_pipe2 |
334 | .long sys_inotify_init1 | 334 | .long sys_inotify_init1 |
335 | .long sys_preadv | ||
336 | .long sys_pwritev | ||
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c index 79c073247284..deb5ebb32c3b 100644 --- a/arch/x86/kernel/tlb_uv.c +++ b/arch/x86/kernel/tlb_uv.c | |||
@@ -275,6 +275,8 @@ const struct cpumask *uv_flush_send_and_wait(int cpu, int this_blade, | |||
275 | return NULL; | 275 | return NULL; |
276 | } | 276 | } |
277 | 277 | ||
278 | static DEFINE_PER_CPU(cpumask_var_t, uv_flush_tlb_mask); | ||
279 | |||
278 | /** | 280 | /** |
279 | * uv_flush_tlb_others - globally purge translation cache of a virtual | 281 | * uv_flush_tlb_others - globally purge translation cache of a virtual |
280 | * address or all TLB's | 282 | * address or all TLB's |
@@ -304,8 +306,7 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, | |||
304 | struct mm_struct *mm, | 306 | struct mm_struct *mm, |
305 | unsigned long va, unsigned int cpu) | 307 | unsigned long va, unsigned int cpu) |
306 | { | 308 | { |
307 | static DEFINE_PER_CPU(cpumask_t, flush_tlb_mask); | 309 | struct cpumask *flush_mask = __get_cpu_var(uv_flush_tlb_mask); |
308 | struct cpumask *flush_mask = &__get_cpu_var(flush_tlb_mask); | ||
309 | int i; | 310 | int i; |
310 | int bit; | 311 | int bit; |
311 | int blade; | 312 | int blade; |
@@ -755,6 +756,10 @@ static int __init uv_bau_init(void) | |||
755 | if (!is_uv_system()) | 756 | if (!is_uv_system()) |
756 | return 0; | 757 | return 0; |
757 | 758 | ||
759 | for_each_possible_cpu(cur_cpu) | ||
760 | alloc_cpumask_var_node(&per_cpu(uv_flush_tlb_mask, cur_cpu), | ||
761 | GFP_KERNEL, cpu_to_node(cur_cpu)); | ||
762 | |||
758 | uv_bau_retry_limit = 1; | 763 | uv_bau_retry_limit = 1; |
759 | uv_nshift = uv_hub_info->n_val; | 764 | uv_nshift = uv_hub_info->n_val; |
760 | uv_mmask = (1UL << uv_hub_info->n_val) - 1; | 765 | uv_mmask = (1UL << uv_hub_info->n_val) - 1; |
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 0a303c3ed11f..a58504ea78cc 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig | |||
@@ -59,7 +59,8 @@ config KVM_AMD | |||
59 | 59 | ||
60 | config KVM_TRACE | 60 | config KVM_TRACE |
61 | bool "KVM trace support" | 61 | bool "KVM trace support" |
62 | depends on KVM && MARKERS && SYSFS | 62 | depends on KVM && SYSFS |
63 | select MARKERS | ||
63 | select RELAY | 64 | select RELAY |
64 | select DEBUG_FS | 65 | select DEBUG_FS |
65 | default n | 66 | default n |
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile index 08537747cb58..fdd30d08ab52 100644 --- a/arch/x86/mm/Makefile +++ b/arch/x86/mm/Makefile | |||
@@ -14,7 +14,7 @@ obj-$(CONFIG_MMIOTRACE) += mmiotrace.o | |||
14 | mmiotrace-y := kmmio.o pf_in.o mmio-mod.o | 14 | mmiotrace-y := kmmio.o pf_in.o mmio-mod.o |
15 | obj-$(CONFIG_MMIOTRACE_TEST) += testmmiotrace.o | 15 | obj-$(CONFIG_MMIOTRACE_TEST) += testmmiotrace.o |
16 | 16 | ||
17 | obj-$(CONFIG_NUMA) += numa_$(BITS).o | 17 | obj-$(CONFIG_NUMA) += numa.o numa_$(BITS).o |
18 | obj-$(CONFIG_K8_NUMA) += k8topology_64.o | 18 | obj-$(CONFIG_K8_NUMA) += k8topology_64.o |
19 | obj-$(CONFIG_ACPI_NUMA) += srat_$(BITS).o | 19 | obj-$(CONFIG_ACPI_NUMA) += srat_$(BITS).o |
20 | 20 | ||
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index 5bc5d1688c1c..8126e8d1a2a4 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c | |||
@@ -40,7 +40,6 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot) | |||
40 | 40 | ||
41 | debug_kmap_atomic(type); | 41 | debug_kmap_atomic(type); |
42 | 42 | ||
43 | debug_kmap_atomic(type); | ||
44 | idx = type + KM_TYPE_NR*smp_processor_id(); | 43 | idx = type + KM_TYPE_NR*smp_processor_id(); |
45 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 44 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
46 | BUG_ON(!pte_none(*(kmap_pte-idx))); | 45 | BUG_ON(!pte_none(*(kmap_pte-idx))); |
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index db81e9a8556b..749559ed80f5 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -1054,17 +1054,47 @@ static noinline int do_test_wp_bit(void) | |||
1054 | const int rodata_test_data = 0xC3; | 1054 | const int rodata_test_data = 0xC3; |
1055 | EXPORT_SYMBOL_GPL(rodata_test_data); | 1055 | EXPORT_SYMBOL_GPL(rodata_test_data); |
1056 | 1056 | ||
1057 | static int kernel_set_to_readonly; | ||
1058 | |||
1059 | void set_kernel_text_rw(void) | ||
1060 | { | ||
1061 | unsigned long start = PFN_ALIGN(_text); | ||
1062 | unsigned long size = PFN_ALIGN(_etext) - start; | ||
1063 | |||
1064 | if (!kernel_set_to_readonly) | ||
1065 | return; | ||
1066 | |||
1067 | pr_debug("Set kernel text: %lx - %lx for read write\n", | ||
1068 | start, start+size); | ||
1069 | |||
1070 | set_pages_rw(virt_to_page(start), size >> PAGE_SHIFT); | ||
1071 | } | ||
1072 | |||
1073 | void set_kernel_text_ro(void) | ||
1074 | { | ||
1075 | unsigned long start = PFN_ALIGN(_text); | ||
1076 | unsigned long size = PFN_ALIGN(_etext) - start; | ||
1077 | |||
1078 | if (!kernel_set_to_readonly) | ||
1079 | return; | ||
1080 | |||
1081 | pr_debug("Set kernel text: %lx - %lx for read only\n", | ||
1082 | start, start+size); | ||
1083 | |||
1084 | set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT); | ||
1085 | } | ||
1086 | |||
1057 | void mark_rodata_ro(void) | 1087 | void mark_rodata_ro(void) |
1058 | { | 1088 | { |
1059 | unsigned long start = PFN_ALIGN(_text); | 1089 | unsigned long start = PFN_ALIGN(_text); |
1060 | unsigned long size = PFN_ALIGN(_etext) - start; | 1090 | unsigned long size = PFN_ALIGN(_etext) - start; |
1061 | 1091 | ||
1062 | #ifndef CONFIG_DYNAMIC_FTRACE | ||
1063 | /* Dynamic tracing modifies the kernel text section */ | ||
1064 | set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT); | 1092 | set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT); |
1065 | printk(KERN_INFO "Write protecting the kernel text: %luk\n", | 1093 | printk(KERN_INFO "Write protecting the kernel text: %luk\n", |
1066 | size >> 10); | 1094 | size >> 10); |
1067 | 1095 | ||
1096 | kernel_set_to_readonly = 1; | ||
1097 | |||
1068 | #ifdef CONFIG_CPA_DEBUG | 1098 | #ifdef CONFIG_CPA_DEBUG |
1069 | printk(KERN_INFO "Testing CPA: Reverting %lx-%lx\n", | 1099 | printk(KERN_INFO "Testing CPA: Reverting %lx-%lx\n", |
1070 | start, start+size); | 1100 | start, start+size); |
@@ -1073,7 +1103,6 @@ void mark_rodata_ro(void) | |||
1073 | printk(KERN_INFO "Testing CPA: write protecting again\n"); | 1103 | printk(KERN_INFO "Testing CPA: write protecting again\n"); |
1074 | set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT); | 1104 | set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT); |
1075 | #endif | 1105 | #endif |
1076 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
1077 | 1106 | ||
1078 | start += size; | 1107 | start += size; |
1079 | size = (unsigned long)__end_rodata - start; | 1108 | size = (unsigned long)__end_rodata - start; |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 54efa57d1c03..1753e8020df6 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -734,21 +734,48 @@ void __init mem_init(void) | |||
734 | const int rodata_test_data = 0xC3; | 734 | const int rodata_test_data = 0xC3; |
735 | EXPORT_SYMBOL_GPL(rodata_test_data); | 735 | EXPORT_SYMBOL_GPL(rodata_test_data); |
736 | 736 | ||
737 | static int kernel_set_to_readonly; | ||
738 | |||
739 | void set_kernel_text_rw(void) | ||
740 | { | ||
741 | unsigned long start = PFN_ALIGN(_stext); | ||
742 | unsigned long end = PFN_ALIGN(__start_rodata); | ||
743 | |||
744 | if (!kernel_set_to_readonly) | ||
745 | return; | ||
746 | |||
747 | pr_debug("Set kernel text: %lx - %lx for read write\n", | ||
748 | start, end); | ||
749 | |||
750 | set_memory_rw(start, (end - start) >> PAGE_SHIFT); | ||
751 | } | ||
752 | |||
753 | void set_kernel_text_ro(void) | ||
754 | { | ||
755 | unsigned long start = PFN_ALIGN(_stext); | ||
756 | unsigned long end = PFN_ALIGN(__start_rodata); | ||
757 | |||
758 | if (!kernel_set_to_readonly) | ||
759 | return; | ||
760 | |||
761 | pr_debug("Set kernel text: %lx - %lx for read only\n", | ||
762 | start, end); | ||
763 | |||
764 | set_memory_ro(start, (end - start) >> PAGE_SHIFT); | ||
765 | } | ||
766 | |||
737 | void mark_rodata_ro(void) | 767 | void mark_rodata_ro(void) |
738 | { | 768 | { |
739 | unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata); | 769 | unsigned long start = PFN_ALIGN(_stext), end = PFN_ALIGN(__end_rodata); |
740 | unsigned long rodata_start = | 770 | unsigned long rodata_start = |
741 | ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK; | 771 | ((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK; |
742 | 772 | ||
743 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
744 | /* Dynamic tracing modifies the kernel text section */ | ||
745 | start = rodata_start; | ||
746 | #endif | ||
747 | |||
748 | printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", | 773 | printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", |
749 | (end - start) >> 10); | 774 | (end - start) >> 10); |
750 | set_memory_ro(start, (end - start) >> PAGE_SHIFT); | 775 | set_memory_ro(start, (end - start) >> PAGE_SHIFT); |
751 | 776 | ||
777 | kernel_set_to_readonly = 1; | ||
778 | |||
752 | /* | 779 | /* |
753 | * The rodata section (but not the kernel text!) should also be | 780 | * The rodata section (but not the kernel text!) should also be |
754 | * not-executable. | 781 | * not-executable. |
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c index bff0c9032f8c..8056545e2d39 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | int is_io_mapping_possible(resource_size_t base, unsigned long size) | 24 | int is_io_mapping_possible(resource_size_t base, unsigned long size) |
25 | { | 25 | { |
26 | #ifndef CONFIG_X86_PAE | 26 | #if !defined(CONFIG_X86_PAE) && defined(CONFIG_PHYS_ADDR_T_64BIT) |
27 | /* There is no way to map greater than 1 << 32 address without PAE */ | 27 | /* There is no way to map greater than 1 << 32 address without PAE */ |
28 | if (base + size > 0x100000000ULL) | 28 | if (base + size > 0x100000000ULL) |
29 | return 0; | 29 | return 0; |
@@ -39,6 +39,7 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) | |||
39 | 39 | ||
40 | pagefault_disable(); | 40 | pagefault_disable(); |
41 | 41 | ||
42 | debug_kmap_atomic(type); | ||
42 | idx = type + KM_TYPE_NR * smp_processor_id(); | 43 | idx = type + KM_TYPE_NR * smp_processor_id(); |
43 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 44 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
44 | set_pte(kmap_pte - idx, pfn_pte(pfn, prot)); | 45 | set_pte(kmap_pte - idx, pfn_pte(pfn, prot)); |
@@ -72,7 +73,6 @@ iounmap_atomic(void *kvaddr, enum km_type type) | |||
72 | unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; | 73 | unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; |
73 | enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); | 74 | enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); |
74 | 75 | ||
75 | debug_kmap_atomic(type); | ||
76 | /* | 76 | /* |
77 | * Force other mappings to Oops if they'll try to access this pte | 77 | * Force other mappings to Oops if they'll try to access this pte |
78 | * without first remap it. Keeping stale mappings around is a bad idea | 78 | * without first remap it. Keeping stale mappings around is a bad idea |
diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index 2c4baa88f2cb..c9342ed8b402 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c | |||
@@ -378,27 +378,34 @@ static void clear_trace_list(void) | |||
378 | } | 378 | } |
379 | 379 | ||
380 | #ifdef CONFIG_HOTPLUG_CPU | 380 | #ifdef CONFIG_HOTPLUG_CPU |
381 | static cpumask_t downed_cpus; | 381 | static cpumask_var_t downed_cpus; |
382 | 382 | ||
383 | static void enter_uniprocessor(void) | 383 | static void enter_uniprocessor(void) |
384 | { | 384 | { |
385 | int cpu; | 385 | int cpu; |
386 | int err; | 386 | int err; |
387 | 387 | ||
388 | if (downed_cpus == NULL && | ||
389 | !alloc_cpumask_var(&downed_cpus, GFP_KERNEL)) { | ||
390 | pr_notice(NAME "Failed to allocate mask\n"); | ||
391 | goto out; | ||
392 | } | ||
393 | |||
388 | get_online_cpus(); | 394 | get_online_cpus(); |
389 | downed_cpus = cpu_online_map; | 395 | cpumask_copy(downed_cpus, cpu_online_mask); |
390 | cpu_clear(first_cpu(cpu_online_map), downed_cpus); | 396 | cpumask_clear_cpu(cpumask_first(cpu_online_mask), downed_cpus); |
391 | if (num_online_cpus() > 1) | 397 | if (num_online_cpus() > 1) |
392 | pr_notice(NAME "Disabling non-boot CPUs...\n"); | 398 | pr_notice(NAME "Disabling non-boot CPUs...\n"); |
393 | put_online_cpus(); | 399 | put_online_cpus(); |
394 | 400 | ||
395 | for_each_cpu_mask(cpu, downed_cpus) { | 401 | for_each_cpu(cpu, downed_cpus) { |
396 | err = cpu_down(cpu); | 402 | err = cpu_down(cpu); |
397 | if (!err) | 403 | if (!err) |
398 | pr_info(NAME "CPU%d is down.\n", cpu); | 404 | pr_info(NAME "CPU%d is down.\n", cpu); |
399 | else | 405 | else |
400 | pr_err(NAME "Error taking CPU%d down: %d\n", cpu, err); | 406 | pr_err(NAME "Error taking CPU%d down: %d\n", cpu, err); |
401 | } | 407 | } |
408 | out: | ||
402 | if (num_online_cpus() > 1) | 409 | if (num_online_cpus() > 1) |
403 | pr_warning(NAME "multiple CPUs still online, " | 410 | pr_warning(NAME "multiple CPUs still online, " |
404 | "may miss events.\n"); | 411 | "may miss events.\n"); |
@@ -411,10 +418,10 @@ static void __ref leave_uniprocessor(void) | |||
411 | int cpu; | 418 | int cpu; |
412 | int err; | 419 | int err; |
413 | 420 | ||
414 | if (cpus_weight(downed_cpus) == 0) | 421 | if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0) |
415 | return; | 422 | return; |
416 | pr_notice(NAME "Re-enabling CPUs...\n"); | 423 | pr_notice(NAME "Re-enabling CPUs...\n"); |
417 | for_each_cpu_mask(cpu, downed_cpus) { | 424 | for_each_cpu(cpu, downed_cpus) { |
418 | err = cpu_up(cpu); | 425 | err = cpu_up(cpu); |
419 | if (!err) | 426 | if (!err) |
420 | pr_info(NAME "enabled CPU%d.\n", cpu); | 427 | pr_info(NAME "enabled CPU%d.\n", cpu); |
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c new file mode 100644 index 000000000000..550df481accd --- /dev/null +++ b/arch/x86/mm/numa.c | |||
@@ -0,0 +1,67 @@ | |||
1 | /* Common code for 32 and 64-bit NUMA */ | ||
2 | #include <linux/topology.h> | ||
3 | #include <linux/module.h> | ||
4 | #include <linux/bootmem.h> | ||
5 | |||
6 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS | ||
7 | # define DBG(x...) printk(KERN_DEBUG x) | ||
8 | #else | ||
9 | # define DBG(x...) | ||
10 | #endif | ||
11 | |||
12 | /* | ||
13 | * Which logical CPUs are on which nodes | ||
14 | */ | ||
15 | cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; | ||
16 | EXPORT_SYMBOL(node_to_cpumask_map); | ||
17 | |||
18 | /* | ||
19 | * Allocate node_to_cpumask_map based on number of available nodes | ||
20 | * Requires node_possible_map to be valid. | ||
21 | * | ||
22 | * Note: node_to_cpumask() is not valid until after this is done. | ||
23 | * (Use CONFIG_DEBUG_PER_CPU_MAPS to check this.) | ||
24 | */ | ||
25 | void __init setup_node_to_cpumask_map(void) | ||
26 | { | ||
27 | unsigned int node, num = 0; | ||
28 | |||
29 | /* setup nr_node_ids if not done yet */ | ||
30 | if (nr_node_ids == MAX_NUMNODES) { | ||
31 | for_each_node_mask(node, node_possible_map) | ||
32 | num = node; | ||
33 | nr_node_ids = num + 1; | ||
34 | } | ||
35 | |||
36 | /* allocate the map */ | ||
37 | for (node = 0; node < nr_node_ids; node++) | ||
38 | alloc_bootmem_cpumask_var(&node_to_cpumask_map[node]); | ||
39 | |||
40 | /* cpumask_of_node() will now work */ | ||
41 | pr_debug("Node to cpumask map for %d nodes\n", nr_node_ids); | ||
42 | } | ||
43 | |||
44 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS | ||
45 | /* | ||
46 | * Returns a pointer to the bitmask of CPUs on Node 'node'. | ||
47 | */ | ||
48 | const struct cpumask *cpumask_of_node(int node) | ||
49 | { | ||
50 | if (node >= nr_node_ids) { | ||
51 | printk(KERN_WARNING | ||
52 | "cpumask_of_node(%d): node > nr_node_ids(%d)\n", | ||
53 | node, nr_node_ids); | ||
54 | dump_stack(); | ||
55 | return cpu_none_mask; | ||
56 | } | ||
57 | if (node_to_cpumask_map[node] == NULL) { | ||
58 | printk(KERN_WARNING | ||
59 | "cpumask_of_node(%d): no node_to_cpumask_map!\n", | ||
60 | node); | ||
61 | dump_stack(); | ||
62 | return cpu_online_mask; | ||
63 | } | ||
64 | return node_to_cpumask_map[node]; | ||
65 | } | ||
66 | EXPORT_SYMBOL(cpumask_of_node); | ||
67 | #endif | ||
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 64c9cf043cdd..d73aaa892371 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -20,12 +20,6 @@ | |||
20 | #include <asm/acpi.h> | 20 | #include <asm/acpi.h> |
21 | #include <asm/k8.h> | 21 | #include <asm/k8.h> |
22 | 22 | ||
23 | #ifdef CONFIG_DEBUG_PER_CPU_MAPS | ||
24 | # define DBG(x...) printk(KERN_DEBUG x) | ||
25 | #else | ||
26 | # define DBG(x...) | ||
27 | #endif | ||
28 | |||
29 | struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; | 23 | struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; |
30 | EXPORT_SYMBOL(node_data); | 24 | EXPORT_SYMBOL(node_data); |
31 | 25 | ||
@@ -49,12 +43,6 @@ DEFINE_EARLY_PER_CPU(int, x86_cpu_to_node_map, NUMA_NO_NODE); | |||
49 | EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_node_map); | 43 | EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_node_map); |
50 | 44 | ||
51 | /* | 45 | /* |
52 | * Which logical CPUs are on which nodes | ||
53 | */ | ||
54 | cpumask_t *node_to_cpumask_map; | ||
55 | EXPORT_SYMBOL(node_to_cpumask_map); | ||
56 | |||
57 | /* | ||
58 | * Given a shift value, try to populate memnodemap[] | 46 | * Given a shift value, try to populate memnodemap[] |
59 | * Returns : | 47 | * Returns : |
60 | * 1 if OK | 48 | * 1 if OK |
@@ -661,36 +649,6 @@ void __init init_cpu_to_node(void) | |||
661 | #endif | 649 | #endif |
662 | 650 | ||
663 | 651 | ||
664 | /* | ||
665 | * Allocate node_to_cpumask_map based on number of available nodes | ||
666 | * Requires node_possible_map to be valid. | ||
667 | * | ||
668 | * Note: node_to_cpumask() is not valid until after this is done. | ||
669 | * (Use CONFIG_DEBUG_PER_CPU_MAPS to check this.) | ||
670 | */ | ||
671 | void __init setup_node_to_cpumask_map(void) | ||
672 | { | ||
673 | unsigned int node, num = 0; | ||
674 | cpumask_t *map; | ||
675 | |||
676 | /* setup nr_node_ids if not done yet */ | ||
677 | if (nr_node_ids == MAX_NUMNODES) { | ||
678 | for_each_node_mask(node, node_possible_map) | ||
679 | num = node; | ||
680 | nr_node_ids = num + 1; | ||
681 | } | ||
682 | |||
683 | /* allocate the map */ | ||
684 | map = alloc_bootmem_low(nr_node_ids * sizeof(cpumask_t)); | ||
685 | DBG("node_to_cpumask_map at %p for %d nodes\n", map, nr_node_ids); | ||
686 | |||
687 | pr_debug("Node to cpumask map at %p for %d nodes\n", | ||
688 | map, nr_node_ids); | ||
689 | |||
690 | /* node_to_cpumask() will now work */ | ||
691 | node_to_cpumask_map = map; | ||
692 | } | ||
693 | |||
694 | void __cpuinit numa_set_node(int cpu, int node) | 652 | void __cpuinit numa_set_node(int cpu, int node) |
695 | { | 653 | { |
696 | int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map); | 654 | int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map); |
@@ -723,12 +681,12 @@ void __cpuinit numa_clear_node(int cpu) | |||
723 | 681 | ||
724 | void __cpuinit numa_add_cpu(int cpu) | 682 | void __cpuinit numa_add_cpu(int cpu) |
725 | { | 683 | { |
726 | cpu_set(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]); | 684 | cpumask_set_cpu(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]); |
727 | } | 685 | } |
728 | 686 | ||
729 | void __cpuinit numa_remove_cpu(int cpu) | 687 | void __cpuinit numa_remove_cpu(int cpu) |
730 | { | 688 | { |
731 | cpu_clear(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]); | 689 | cpumask_clear_cpu(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]); |
732 | } | 690 | } |
733 | 691 | ||
734 | #else /* CONFIG_DEBUG_PER_CPU_MAPS */ | 692 | #else /* CONFIG_DEBUG_PER_CPU_MAPS */ |
@@ -739,20 +697,20 @@ void __cpuinit numa_remove_cpu(int cpu) | |||
739 | static void __cpuinit numa_set_cpumask(int cpu, int enable) | 697 | static void __cpuinit numa_set_cpumask(int cpu, int enable) |
740 | { | 698 | { |
741 | int node = early_cpu_to_node(cpu); | 699 | int node = early_cpu_to_node(cpu); |
742 | cpumask_t *mask; | 700 | struct cpumask *mask; |
743 | char buf[64]; | 701 | char buf[64]; |
744 | 702 | ||
745 | if (node_to_cpumask_map == NULL) { | 703 | mask = node_to_cpumask_map[node]; |
746 | printk(KERN_ERR "node_to_cpumask_map NULL\n"); | 704 | if (mask == NULL) { |
705 | printk(KERN_ERR "node_to_cpumask_map[%i] NULL\n", node); | ||
747 | dump_stack(); | 706 | dump_stack(); |
748 | return; | 707 | return; |
749 | } | 708 | } |
750 | 709 | ||
751 | mask = &node_to_cpumask_map[node]; | ||
752 | if (enable) | 710 | if (enable) |
753 | cpu_set(cpu, *mask); | 711 | cpumask_set_cpu(cpu, mask); |
754 | else | 712 | else |
755 | cpu_clear(cpu, *mask); | 713 | cpumask_clear_cpu(cpu, mask); |
756 | 714 | ||
757 | cpulist_scnprintf(buf, sizeof(buf), mask); | 715 | cpulist_scnprintf(buf, sizeof(buf), mask); |
758 | printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n", | 716 | printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n", |
@@ -799,59 +757,6 @@ int early_cpu_to_node(int cpu) | |||
799 | return per_cpu(x86_cpu_to_node_map, cpu); | 757 | return per_cpu(x86_cpu_to_node_map, cpu); |
800 | } | 758 | } |
801 | 759 | ||
802 | |||
803 | /* empty cpumask */ | ||
804 | static const cpumask_t cpu_mask_none; | ||
805 | |||
806 | /* | ||
807 | * Returns a pointer to the bitmask of CPUs on Node 'node'. | ||
808 | */ | ||
809 | const cpumask_t *cpumask_of_node(int node) | ||
810 | { | ||
811 | if (node_to_cpumask_map == NULL) { | ||
812 | printk(KERN_WARNING | ||
813 | "cpumask_of_node(%d): no node_to_cpumask_map!\n", | ||
814 | node); | ||
815 | dump_stack(); | ||
816 | return (const cpumask_t *)&cpu_online_map; | ||
817 | } | ||
818 | if (node >= nr_node_ids) { | ||
819 | printk(KERN_WARNING | ||
820 | "cpumask_of_node(%d): node > nr_node_ids(%d)\n", | ||
821 | node, nr_node_ids); | ||
822 | dump_stack(); | ||
823 | return &cpu_mask_none; | ||
824 | } | ||
825 | return &node_to_cpumask_map[node]; | ||
826 | } | ||
827 | EXPORT_SYMBOL(cpumask_of_node); | ||
828 | |||
829 | /* | ||
830 | * Returns a bitmask of CPUs on Node 'node'. | ||
831 | * | ||
832 | * Side note: this function creates the returned cpumask on the stack | ||
833 | * so with a high NR_CPUS count, excessive stack space is used. The | ||
834 | * node_to_cpumask_ptr function should be used whenever possible. | ||
835 | */ | ||
836 | cpumask_t node_to_cpumask(int node) | ||
837 | { | ||
838 | if (node_to_cpumask_map == NULL) { | ||
839 | printk(KERN_WARNING | ||
840 | "node_to_cpumask(%d): no node_to_cpumask_map!\n", node); | ||
841 | dump_stack(); | ||
842 | return cpu_online_map; | ||
843 | } | ||
844 | if (node >= nr_node_ids) { | ||
845 | printk(KERN_WARNING | ||
846 | "node_to_cpumask(%d): node > nr_node_ids(%d)\n", | ||
847 | node, nr_node_ids); | ||
848 | dump_stack(); | ||
849 | return cpu_mask_none; | ||
850 | } | ||
851 | return node_to_cpumask_map[node]; | ||
852 | } | ||
853 | EXPORT_SYMBOL(node_to_cpumask); | ||
854 | |||
855 | /* | 760 | /* |
856 | * --------- end of debug versions of the numa functions --------- | 761 | * --------- end of debug versions of the numa functions --------- |
857 | */ | 762 | */ |
diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c index 4c4a51c90bc2..819b131fd752 100644 --- a/arch/x86/oprofile/op_model_p4.c +++ b/arch/x86/oprofile/op_model_p4.c | |||
@@ -380,7 +380,7 @@ static unsigned int get_stagger(void) | |||
380 | { | 380 | { |
381 | #ifdef CONFIG_SMP | 381 | #ifdef CONFIG_SMP |
382 | int cpu = smp_processor_id(); | 382 | int cpu = smp_processor_id(); |
383 | return (cpu != first_cpu(per_cpu(cpu_sibling_map, cpu))); | 383 | return cpu != cpumask_first(__get_cpu_var(cpu_sibling_map)); |
384 | #endif | 384 | #endif |
385 | return 0; | 385 | return 0; |
386 | } | 386 | } |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index f234a37bd428..f1817f71e009 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -258,24 +258,7 @@ void pcibios_set_master(struct pci_dev *dev) | |||
258 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); | 258 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); |
259 | } | 259 | } |
260 | 260 | ||
261 | static void pci_unmap_page_range(struct vm_area_struct *vma) | ||
262 | { | ||
263 | u64 addr = (u64)vma->vm_pgoff << PAGE_SHIFT; | ||
264 | free_memtype(addr, addr + vma->vm_end - vma->vm_start); | ||
265 | } | ||
266 | |||
267 | static void pci_track_mmap_page_range(struct vm_area_struct *vma) | ||
268 | { | ||
269 | u64 addr = (u64)vma->vm_pgoff << PAGE_SHIFT; | ||
270 | unsigned long flags = pgprot_val(vma->vm_page_prot) | ||
271 | & _PAGE_CACHE_MASK; | ||
272 | |||
273 | reserve_memtype(addr, addr + vma->vm_end - vma->vm_start, flags, NULL); | ||
274 | } | ||
275 | |||
276 | static struct vm_operations_struct pci_mmap_ops = { | 261 | static struct vm_operations_struct pci_mmap_ops = { |
277 | .open = pci_track_mmap_page_range, | ||
278 | .close = pci_unmap_page_range, | ||
279 | .access = generic_access_phys, | 262 | .access = generic_access_phys, |
280 | }; | 263 | }; |
281 | 264 | ||
@@ -283,11 +266,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
283 | enum pci_mmap_state mmap_state, int write_combine) | 266 | enum pci_mmap_state mmap_state, int write_combine) |
284 | { | 267 | { |
285 | unsigned long prot; | 268 | unsigned long prot; |
286 | u64 addr = vma->vm_pgoff << PAGE_SHIFT; | ||
287 | unsigned long len = vma->vm_end - vma->vm_start; | ||
288 | unsigned long flags; | ||
289 | unsigned long new_flags; | ||
290 | int retval; | ||
291 | 269 | ||
292 | /* I/O space cannot be accessed via normal processor loads and | 270 | /* I/O space cannot be accessed via normal processor loads and |
293 | * stores on this platform. | 271 | * stores on this platform. |
@@ -308,30 +286,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
308 | 286 | ||
309 | vma->vm_page_prot = __pgprot(prot); | 287 | vma->vm_page_prot = __pgprot(prot); |
310 | 288 | ||
311 | flags = pgprot_val(vma->vm_page_prot) & _PAGE_CACHE_MASK; | ||
312 | retval = reserve_memtype(addr, addr + len, flags, &new_flags); | ||
313 | if (retval) | ||
314 | return retval; | ||
315 | |||
316 | if (flags != new_flags) { | ||
317 | if (!is_new_memtype_allowed(flags, new_flags)) { | ||
318 | free_memtype(addr, addr+len); | ||
319 | return -EINVAL; | ||
320 | } | ||
321 | flags = new_flags; | ||
322 | vma->vm_page_prot = __pgprot( | ||
323 | (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK) | | ||
324 | flags); | ||
325 | } | ||
326 | |||
327 | if (((vma->vm_pgoff < max_low_pfn_mapped) || | ||
328 | (vma->vm_pgoff >= (1UL<<(32 - PAGE_SHIFT)) && | ||
329 | vma->vm_pgoff < max_pfn_mapped)) && | ||
330 | ioremap_change_attr((unsigned long)__va(addr), len, flags)) { | ||
331 | free_memtype(addr, addr + len); | ||
332 | return -EINVAL; | ||
333 | } | ||
334 | |||
335 | if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | 289 | if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, |
336 | vma->vm_end - vma->vm_start, | 290 | vma->vm_end - vma->vm_start, |
337 | vma->vm_page_prot)) | 291 | vma->vm_page_prot)) |
diff --git a/arch/x86/power/Makefile b/arch/x86/power/Makefile index 9ff4d5b55ad1..58b32db33125 100644 --- a/arch/x86/power/Makefile +++ b/arch/x86/power/Makefile | |||
@@ -1,2 +1,7 @@ | |||
1 | # __restore_processor_state() restores %gs after S3 resume and so should not | ||
2 | # itself be stack-protected | ||
3 | nostackp := $(call cc-option, -fno-stack-protector) | ||
4 | CFLAGS_cpu_$(BITS).o := $(nostackp) | ||
5 | |||
1 | obj-$(CONFIG_PM_SLEEP) += cpu_$(BITS).o | 6 | obj-$(CONFIG_PM_SLEEP) += cpu_$(BITS).o |
2 | obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o | 7 | obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o |
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 8d470562ffc9..585a6e330837 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -158,7 +158,7 @@ static void __init xen_fill_possible_map(void) | |||
158 | rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); | 158 | rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); |
159 | if (rc >= 0) { | 159 | if (rc >= 0) { |
160 | num_processors++; | 160 | num_processors++; |
161 | cpu_set(i, cpu_possible_map); | 161 | set_cpu_possible(i, true); |
162 | } | 162 | } |
163 | } | 163 | } |
164 | } | 164 | } |
@@ -197,7 +197,7 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) | |||
197 | while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) { | 197 | while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) { |
198 | for (cpu = nr_cpu_ids - 1; !cpu_possible(cpu); cpu--) | 198 | for (cpu = nr_cpu_ids - 1; !cpu_possible(cpu); cpu--) |
199 | continue; | 199 | continue; |
200 | cpu_clear(cpu, cpu_possible_map); | 200 | set_cpu_possible(cpu, false); |
201 | } | 201 | } |
202 | 202 | ||
203 | for_each_possible_cpu (cpu) { | 203 | for_each_possible_cpu (cpu) { |
@@ -210,7 +210,7 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) | |||
210 | if (IS_ERR(idle)) | 210 | if (IS_ERR(idle)) |
211 | panic("failed fork for CPU %d", cpu); | 211 | panic("failed fork for CPU %d", cpu); |
212 | 212 | ||
213 | cpu_set(cpu, cpu_present_map); | 213 | set_cpu_present(cpu, true); |
214 | } | 214 | } |
215 | } | 215 | } |
216 | 216 | ||
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 981200830432..fa6dc4dd3b19 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -4,16 +4,13 @@ | |||
4 | mainmenu "Linux/Xtensa Kernel Configuration" | 4 | mainmenu "Linux/Xtensa Kernel Configuration" |
5 | 5 | ||
6 | config FRAME_POINTER | 6 | config FRAME_POINTER |
7 | bool | 7 | def_bool n |
8 | default n | ||
9 | 8 | ||
10 | config ZONE_DMA | 9 | config ZONE_DMA |
11 | bool | 10 | def_bool y |
12 | default y | ||
13 | 11 | ||
14 | config XTENSA | 12 | config XTENSA |
15 | bool | 13 | def_bool y |
16 | default y | ||
17 | select HAVE_IDE | 14 | select HAVE_IDE |
18 | help | 15 | help |
19 | Xtensa processors are 32-bit RISC machines designed by Tensilica | 16 | Xtensa processors are 32-bit RISC machines designed by Tensilica |
@@ -24,28 +21,25 @@ config XTENSA | |||
24 | a home page at <http://xtensa.sourceforge.net/>. | 21 | a home page at <http://xtensa.sourceforge.net/>. |
25 | 22 | ||
26 | config RWSEM_XCHGADD_ALGORITHM | 23 | config RWSEM_XCHGADD_ALGORITHM |
27 | bool | 24 | def_bool y |
28 | default y | ||
29 | 25 | ||
30 | config GENERIC_FIND_NEXT_BIT | 26 | config GENERIC_FIND_NEXT_BIT |
31 | bool | 27 | def_bool y |
32 | default y | ||
33 | 28 | ||
34 | config GENERIC_HWEIGHT | 29 | config GENERIC_HWEIGHT |
35 | bool | 30 | def_bool y |
36 | default y | ||
37 | 31 | ||
38 | config GENERIC_HARDIRQS | 32 | config GENERIC_HARDIRQS |
39 | bool | 33 | def_bool y |
40 | default y | 34 | |
35 | config GENERIC_GPIO | ||
36 | def_bool y | ||
41 | 37 | ||
42 | config ARCH_HAS_ILOG2_U32 | 38 | config ARCH_HAS_ILOG2_U32 |
43 | bool | 39 | def_bool n |
44 | default n | ||
45 | 40 | ||
46 | config ARCH_HAS_ILOG2_U64 | 41 | config ARCH_HAS_ILOG2_U64 |
47 | bool | 42 | def_bool n |
48 | default n | ||
49 | 43 | ||
50 | config NO_IOPORT | 44 | config NO_IOPORT |
51 | def_bool y | 45 | def_bool y |
@@ -54,9 +48,18 @@ config HZ | |||
54 | int | 48 | int |
55 | default 100 | 49 | default 100 |
56 | 50 | ||
51 | config GENERIC_TIME | ||
52 | def_bool y | ||
53 | |||
57 | source "init/Kconfig" | 54 | source "init/Kconfig" |
58 | source "kernel/Kconfig.freezer" | 55 | source "kernel/Kconfig.freezer" |
59 | 56 | ||
57 | config MMU | ||
58 | def_bool n | ||
59 | |||
60 | config VARIANT_IRQ_SWITCH | ||
61 | def_bool n | ||
62 | |||
60 | menu "Processor type and features" | 63 | menu "Processor type and features" |
61 | 64 | ||
62 | choice | 65 | choice |
@@ -65,38 +68,41 @@ choice | |||
65 | 68 | ||
66 | config XTENSA_VARIANT_FSF | 69 | config XTENSA_VARIANT_FSF |
67 | bool "fsf - default (not generic) configuration" | 70 | bool "fsf - default (not generic) configuration" |
71 | select MMU | ||
68 | 72 | ||
69 | config XTENSA_VARIANT_DC232B | 73 | config XTENSA_VARIANT_DC232B |
70 | bool "dc232b - Diamond 232L Standard Core Rev.B (LE)" | 74 | bool "dc232b - Diamond 232L Standard Core Rev.B (LE)" |
75 | select MMU | ||
71 | help | 76 | help |
72 | This variant refers to Tensilica's Diamond 232L Standard core Rev.B (LE). | 77 | This variant refers to Tensilica's Diamond 232L Standard core Rev.B (LE). |
73 | endchoice | ||
74 | 78 | ||
75 | config MMU | 79 | config XTENSA_VARIANT_S6000 |
76 | bool | 80 | bool "s6000 - Stretch software configurable processor" |
77 | default y | 81 | select VARIANT_IRQ_SWITCH |
82 | select ARCH_REQUIRE_GPIOLIB | ||
83 | endchoice | ||
78 | 84 | ||
79 | config XTENSA_UNALIGNED_USER | 85 | config XTENSA_UNALIGNED_USER |
80 | bool "Unaligned memory access in use space" | 86 | bool "Unaligned memory access in use space" |
81 | ---help--- | 87 | help |
82 | The Xtensa architecture currently does not handle unaligned | 88 | The Xtensa architecture currently does not handle unaligned |
83 | memory accesses in hardware but through an exception handler. | 89 | memory accesses in hardware but through an exception handler. |
84 | Per default, unaligned memory accesses are disabled in user space. | 90 | Per default, unaligned memory accesses are disabled in user space. |
85 | 91 | ||
86 | Say Y here to enable unaligned memory access in user space. | 92 | Say Y here to enable unaligned memory access in user space. |
87 | 93 | ||
88 | config PREEMPT | 94 | config PREEMPT |
89 | bool "Preemptible Kernel" | 95 | bool "Preemptible Kernel" |
90 | ---help--- | 96 | help |
91 | This option reduces the latency of the kernel when reacting to | 97 | This option reduces the latency of the kernel when reacting to |
92 | real-time or interactive events by allowing a low priority process to | 98 | real-time or interactive events by allowing a low priority process to |
93 | be preempted even if it is in kernel mode executing a system call. | 99 | be preempted even if it is in kernel mode executing a system call. |
94 | Unfortunately the kernel code has some race conditions if both | 100 | Unfortunately the kernel code has some race conditions if both |
95 | CONFIG_SMP and CONFIG_PREEMPT are enabled, so this option is | 101 | CONFIG_SMP and CONFIG_PREEMPT are enabled, so this option is |
96 | currently disabled if you are building an SMP kernel. | 102 | currently disabled if you are building an SMP kernel. |
97 | 103 | ||
98 | Say Y here if you are building a kernel for a desktop, embedded | 104 | Say Y here if you are building a kernel for a desktop, embedded |
99 | or real-time system. Say N if you are unsure. | 105 | or real-time system. Say N if you are unsure. |
100 | 106 | ||
101 | config MATH_EMULATION | 107 | config MATH_EMULATION |
102 | bool "Math emulation" | 108 | bool "Math emulation" |
@@ -105,6 +111,32 @@ config MATH_EMULATION | |||
105 | 111 | ||
106 | endmenu | 112 | endmenu |
107 | 113 | ||
114 | config XTENSA_CALIBRATE_CCOUNT | ||
115 | def_bool n | ||
116 | help | ||
117 | On some platforms (XT2000, for example), the CPU clock rate can | ||
118 | vary. The frequency can be determined, however, by measuring | ||
119 | against a well known, fixed frequency, such as an UART oscillator. | ||
120 | |||
121 | config SERIAL_CONSOLE | ||
122 | def_bool n | ||
123 | |||
124 | config XTENSA_ISS_NETWORK | ||
125 | def_bool n | ||
126 | |||
127 | menu "Bus options" | ||
128 | |||
129 | config PCI | ||
130 | bool "PCI support" | ||
131 | default y | ||
132 | help | ||
133 | Find out whether you have a PCI motherboard. PCI is the name of a | ||
134 | bus system, i.e. the way the CPU talks to the other stuff inside | ||
135 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or | ||
136 | VESA. If you have PCI, say Y, otherwise N. | ||
137 | |||
138 | source "drivers/pci/Kconfig" | ||
139 | |||
108 | menu "Platform options" | 140 | menu "Platform options" |
109 | 141 | ||
110 | choice | 142 | choice |
@@ -113,33 +145,35 @@ choice | |||
113 | 145 | ||
114 | config XTENSA_PLATFORM_ISS | 146 | config XTENSA_PLATFORM_ISS |
115 | bool "ISS" | 147 | bool "ISS" |
148 | select XTENSA_CALIBRATE_CCOUNT | ||
149 | select SERIAL_CONSOLE | ||
150 | select XTENSA_ISS_NETWORK | ||
116 | help | 151 | help |
117 | ISS is an acronym for Tensilica's Instruction Set Simulator. | 152 | ISS is an acronym for Tensilica's Instruction Set Simulator. |
118 | 153 | ||
119 | config XTENSA_PLATFORM_XT2000 | 154 | config XTENSA_PLATFORM_XT2000 |
120 | bool "XT2000" | 155 | bool "XT2000" |
156 | select XTENSA_CALIBRATE_CCOUNT | ||
157 | select PCI | ||
121 | help | 158 | help |
122 | XT2000 is the name of Tensilica's feature-rich emulation platform. | 159 | XT2000 is the name of Tensilica's feature-rich emulation platform. |
123 | This hardware is capable of running a full Linux distribution. | 160 | This hardware is capable of running a full Linux distribution. |
124 | 161 | ||
125 | endchoice | 162 | config XTENSA_PLATFORM_S6105 |
163 | bool "S6105" | ||
164 | select SERIAL_CONSOLE | ||
126 | 165 | ||
166 | endchoice | ||
127 | 167 | ||
128 | config XTENSA_CALIBRATE_CCOUNT | ||
129 | bool "Auto calibration of the CPU clock rate" | ||
130 | ---help--- | ||
131 | On some platforms (XT2000, for example), the CPU clock rate can | ||
132 | vary. The frequency can be determined, however, by measuring | ||
133 | against a well known, fixed frequency, such as an UART oscillator. | ||
134 | 168 | ||
135 | config XTENSA_CPU_CLOCK | 169 | config XTENSA_CPU_CLOCK |
136 | int "CPU clock rate [MHz]" | 170 | int "CPU clock rate [MHz]" |
137 | depends on !XTENSA_CALIBRATE_CCOUNT | 171 | depends on !XTENSA_CALIBRATE_CCOUNT |
138 | default "16" | 172 | default 16 |
139 | 173 | ||
140 | config GENERIC_CALIBRATE_DELAY | 174 | config GENERIC_CALIBRATE_DELAY |
141 | bool "Auto calibration of the BogoMIPS value" | 175 | bool "Auto calibration of the BogoMIPS value" |
142 | ---help--- | 176 | help |
143 | The BogoMIPS value can easily be derived from the CPU frequency. | 177 | The BogoMIPS value can easily be derived from the CPU frequency. |
144 | 178 | ||
145 | config CMDLINE_BOOL | 179 | config CMDLINE_BOOL |
@@ -156,52 +190,27 @@ config CMDLINE | |||
156 | time by entering them here. As a minimum, you should specify the | 190 | time by entering them here. As a minimum, you should specify the |
157 | memory size and the root device (e.g., mem=64M root=/dev/nfs). | 191 | memory size and the root device (e.g., mem=64M root=/dev/nfs). |
158 | 192 | ||
159 | config SERIAL_CONSOLE | ||
160 | bool | ||
161 | depends on XTENSA_PLATFORM_ISS | ||
162 | default y | ||
163 | |||
164 | config XTENSA_ISS_NETWORK | ||
165 | bool | ||
166 | depends on XTENSA_PLATFORM_ISS | ||
167 | default y | ||
168 | |||
169 | source "mm/Kconfig" | 193 | source "mm/Kconfig" |
170 | 194 | ||
171 | endmenu | 195 | endmenu |
172 | 196 | ||
173 | menu "Bus options" | 197 | config HOTPLUG |
174 | 198 | bool "Support for hot-pluggable devices" | |
175 | config PCI | ||
176 | bool "PCI support" if !XTENSA_PLATFORM_ISS | ||
177 | depends on !XTENSA_PLATFORM_ISS | ||
178 | default y | ||
179 | help | 199 | help |
180 | Find out whether you have a PCI motherboard. PCI is the name of a | 200 | Say Y here if you want to plug devices into your computer while |
181 | bus system, i.e. the way the CPU talks to the other stuff inside | 201 | the system is running, and be able to use them quickly. In many |
182 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or | 202 | cases, the devices can likewise be unplugged at any time too. |
183 | VESA. If you have PCI, say Y, otherwise N. | ||
184 | 203 | ||
185 | source "drivers/pci/Kconfig" | 204 | One well known example of this is PCMCIA- or PC-cards, credit-card |
205 | size devices such as network cards, modems or hard drives which are | ||
206 | plugged into slots found on all modern laptop computers. Another | ||
207 | example, used on modern desktops as well as laptops, is USB. | ||
186 | 208 | ||
187 | config HOTPLUG | 209 | Enable HOTPLUG and build a modular kernel. Get agent software |
188 | 210 | (from <http://linux-hotplug.sourceforge.net/>) and install it. | |
189 | bool "Support for hot-pluggable devices" | 211 | Then your kernel will automatically call out to a user mode "policy |
190 | ---help--- | 212 | agent" (/sbin/hotplug) to load modules and set up software needed |
191 | Say Y here if you want to plug devices into your computer while | 213 | to use devices as you hotplug them. |
192 | the system is running, and be able to use them quickly. In many | ||
193 | cases, the devices can likewise be unplugged at any time too. | ||
194 | |||
195 | One well known example of this is PCMCIA- or PC-cards, credit-card | ||
196 | size devices such as network cards, modems or hard drives which are | ||
197 | plugged into slots found on all modern laptop computers. Another | ||
198 | example, used on modern desktops as well as laptops, is USB. | ||
199 | |||
200 | Enable HOTPLUG and build a modular kernel. Get agent software | ||
201 | (from <http://linux-hotplug.sourceforge.net/>) and install it. | ||
202 | Then your kernel will automatically call out to a user mode "policy | ||
203 | agent" (/sbin/hotplug) to load modules and set up software needed | ||
204 | to use devices as you hotplug them. | ||
205 | 214 | ||
206 | source "drivers/pcmcia/Kconfig" | 215 | source "drivers/pcmcia/Kconfig" |
207 | 216 | ||
@@ -213,9 +222,8 @@ menu "Executable file formats" | |||
213 | 222 | ||
214 | # only elf supported | 223 | # only elf supported |
215 | config KCORE_ELF | 224 | config KCORE_ELF |
216 | bool | 225 | def_bool y |
217 | depends on PROC_FS | 226 | depends on PROC_FS |
218 | default y | ||
219 | help | 227 | help |
220 | If you enabled support for /proc file system then the file | 228 | If you enabled support for /proc file system then the file |
221 | /proc/kcore will contain the kernel core image in ELF format. This | 229 | /proc/kcore will contain the kernel core image in ELF format. This |
@@ -240,7 +248,7 @@ source "fs/Kconfig" | |||
240 | menu "Xtensa initrd options" | 248 | menu "Xtensa initrd options" |
241 | depends on BLK_DEV_INITRD | 249 | depends on BLK_DEV_INITRD |
242 | 250 | ||
243 | config EMBEDDED_RAMDISK | 251 | config EMBEDDED_RAMDISK |
244 | bool "Embed root filesystem ramdisk into the kernel" | 252 | bool "Embed root filesystem ramdisk into the kernel" |
245 | 253 | ||
246 | config EMBEDDED_RAMDISK_IMAGE | 254 | config EMBEDDED_RAMDISK_IMAGE |
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index 1da55fe4beff..4caffac3ca2e 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf | 16 | variant-$(CONFIG_XTENSA_VARIANT_FSF) := fsf |
17 | variant-$(CONFIG_XTENSA_VARIANT_DC232B) := dc232b | 17 | variant-$(CONFIG_XTENSA_VARIANT_DC232B) := dc232b |
18 | variant-$(CONFIG_XTENSA_VARIANT_S6000) := s6000 | ||
18 | variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom | 19 | variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom |
19 | 20 | ||
20 | VARIANT = $(variant-y) | 21 | VARIANT = $(variant-y) |
@@ -24,6 +25,7 @@ export VARIANT | |||
24 | 25 | ||
25 | platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 | 26 | platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 |
26 | platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss | 27 | platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss |
28 | platform-$(CONFIG_XTENSA_PLATFORM_S6105) := s6105 | ||
27 | 29 | ||
28 | PLATFORM = $(platform-y) | 30 | PLATFORM = $(platform-y) |
29 | export PLATFORM | 31 | export PLATFORM |
@@ -62,20 +64,23 @@ ifneq ($(VARIANT),) | |||
62 | endif | 64 | endif |
63 | endif | 65 | endif |
64 | 66 | ||
65 | # | 67 | # Only build variant and/or platform if it includes a Makefile |
68 | |||
69 | buildvar := $(shell test -a $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/) | ||
70 | buildplf := $(shell test -a $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/) | ||
71 | |||
72 | # Find libgcc.a | ||
66 | 73 | ||
67 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 74 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
68 | 75 | ||
69 | head-y := arch/xtensa/kernel/head.o | 76 | head-y := arch/xtensa/kernel/head.o |
70 | core-y += arch/xtensa/kernel/ arch/xtensa/mm/ | 77 | core-y += arch/xtensa/kernel/ arch/xtensa/mm/ |
71 | ifneq ($(PLATFORM),) | 78 | core-y += $(buildvar) $(buildplf) |
72 | core-y += arch/xtensa/platforms/$(PLATFORM)/ | 79 | |
73 | endif | ||
74 | libs-y += arch/xtensa/lib/ $(LIBGCC) | 80 | libs-y += arch/xtensa/lib/ $(LIBGCC) |
75 | 81 | ||
76 | boot := arch/xtensa/boot | 82 | boot := arch/xtensa/boot |
77 | 83 | ||
78 | |||
79 | all: zImage | 84 | all: zImage |
80 | 85 | ||
81 | bzImage : zImage | 86 | bzImage : zImage |
diff --git a/arch/xtensa/configs/s6105_defconfig b/arch/xtensa/configs/s6105_defconfig new file mode 100644 index 000000000000..6e1deff41590 --- /dev/null +++ b/arch/xtensa/configs/s6105_defconfig | |||
@@ -0,0 +1,530 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.29-rc7-s6 | ||
4 | # Tue Mar 10 11:09:26 2009 | ||
5 | # | ||
6 | # CONFIG_FRAME_POINTER is not set | ||
7 | CONFIG_ZONE_DMA=y | ||
8 | CONFIG_XTENSA=y | ||
9 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | ||
10 | CONFIG_GENERIC_FIND_NEXT_BIT=y | ||
11 | CONFIG_GENERIC_HWEIGHT=y | ||
12 | CONFIG_GENERIC_HARDIRQS=y | ||
13 | CONFIG_GENERIC_GPIO=y | ||
14 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | ||
15 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | ||
16 | CONFIG_NO_IOPORT=y | ||
17 | CONFIG_HZ=100 | ||
18 | CONFIG_GENERIC_TIME=y | ||
19 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
20 | |||
21 | # | ||
22 | # General setup | ||
23 | # | ||
24 | CONFIG_EXPERIMENTAL=y | ||
25 | CONFIG_BROKEN_ON_SMP=y | ||
26 | CONFIG_LOCK_KERNEL=y | ||
27 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
28 | CONFIG_LOCALVERSION="" | ||
29 | CONFIG_LOCALVERSION_AUTO=y | ||
30 | CONFIG_SYSVIPC=y | ||
31 | CONFIG_SYSVIPC_SYSCTL=y | ||
32 | # CONFIG_POSIX_MQUEUE is not set | ||
33 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
34 | # CONFIG_TASKSTATS is not set | ||
35 | # CONFIG_AUDIT is not set | ||
36 | |||
37 | # | ||
38 | # RCU Subsystem | ||
39 | # | ||
40 | # CONFIG_CLASSIC_RCU is not set | ||
41 | # CONFIG_TREE_RCU is not set | ||
42 | CONFIG_PREEMPT_RCU=y | ||
43 | # CONFIG_RCU_TRACE is not set | ||
44 | # CONFIG_TREE_RCU_TRACE is not set | ||
45 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
46 | CONFIG_IKCONFIG=y | ||
47 | CONFIG_IKCONFIG_PROC=y | ||
48 | CONFIG_LOG_BUF_SHIFT=16 | ||
49 | # CONFIG_GROUP_SCHED is not set | ||
50 | # CONFIG_CGROUPS is not set | ||
51 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
52 | # CONFIG_RELAY is not set | ||
53 | # CONFIG_NAMESPACES is not set | ||
54 | CONFIG_BLK_DEV_INITRD=y | ||
55 | CONFIG_INITRAMFS_SOURCE="" | ||
56 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
57 | CONFIG_SYSCTL=y | ||
58 | CONFIG_EMBEDDED=y | ||
59 | CONFIG_SYSCTL_SYSCALL=y | ||
60 | CONFIG_KALLSYMS=y | ||
61 | # CONFIG_KALLSYMS_ALL is not set | ||
62 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
63 | # CONFIG_HOTPLUG is not set | ||
64 | CONFIG_PRINTK=y | ||
65 | CONFIG_BUG=y | ||
66 | CONFIG_ELF_CORE=y | ||
67 | # CONFIG_COMPAT_BRK is not set | ||
68 | CONFIG_BASE_FULL=y | ||
69 | CONFIG_FUTEX=y | ||
70 | CONFIG_ANON_INODES=y | ||
71 | CONFIG_EPOLL=y | ||
72 | CONFIG_SIGNALFD=y | ||
73 | CONFIG_TIMERFD=y | ||
74 | CONFIG_EVENTFD=y | ||
75 | CONFIG_AIO=y | ||
76 | CONFIG_VM_EVENT_COUNTERS=y | ||
77 | CONFIG_SLAB=y | ||
78 | # CONFIG_SLUB is not set | ||
79 | # CONFIG_SLOB is not set | ||
80 | # CONFIG_PROFILING is not set | ||
81 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | ||
83 | CONFIG_RT_MUTEXES=y | ||
84 | CONFIG_BASE_SMALL=0 | ||
85 | # CONFIG_MODULES is not set | ||
86 | CONFIG_BLOCK=y | ||
87 | # CONFIG_LBD is not set | ||
88 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
89 | # CONFIG_BLK_DEV_BSG is not set | ||
90 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
91 | |||
92 | # | ||
93 | # IO Schedulers | ||
94 | # | ||
95 | CONFIG_IOSCHED_NOOP=y | ||
96 | # CONFIG_IOSCHED_AS is not set | ||
97 | # CONFIG_IOSCHED_DEADLINE is not set | ||
98 | CONFIG_IOSCHED_CFQ=y | ||
99 | # CONFIG_DEFAULT_AS is not set | ||
100 | # CONFIG_DEFAULT_DEADLINE is not set | ||
101 | CONFIG_DEFAULT_CFQ=y | ||
102 | # CONFIG_DEFAULT_NOOP is not set | ||
103 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
104 | # CONFIG_FREEZER is not set | ||
105 | # CONFIG_MMU is not set | ||
106 | CONFIG_VARIANT_IRQ_SWITCH=y | ||
107 | |||
108 | # | ||
109 | # Processor type and features | ||
110 | # | ||
111 | # CONFIG_XTENSA_VARIANT_FSF is not set | ||
112 | # CONFIG_XTENSA_VARIANT_DC232B is not set | ||
113 | CONFIG_XTENSA_VARIANT_S6000=y | ||
114 | # CONFIG_XTENSA_UNALIGNED_USER is not set | ||
115 | CONFIG_PREEMPT=y | ||
116 | # CONFIG_MATH_EMULATION is not set | ||
117 | # CONFIG_HIGHMEM is not set | ||
118 | # CONFIG_XTENSA_CALIBRATE_CCOUNT is not set | ||
119 | CONFIG_SERIAL_CONSOLE=y | ||
120 | # CONFIG_XTENSA_ISS_NETWORK is not set | ||
121 | |||
122 | # | ||
123 | # Bus options | ||
124 | # | ||
125 | # CONFIG_PCI is not set | ||
126 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
127 | |||
128 | # | ||
129 | # Platform options | ||
130 | # | ||
131 | # CONFIG_XTENSA_PLATFORM_ISS is not set | ||
132 | # CONFIG_XTENSA_PLATFORM_XT2000 is not set | ||
133 | CONFIG_XTENSA_PLATFORM_S6105=y | ||
134 | CONFIG_XTENSA_CPU_CLOCK=300 | ||
135 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
136 | CONFIG_CMDLINE_BOOL=y | ||
137 | CONFIG_CMDLINE="console=ttyS1,38400 debug bootmem_debug loglevel=7" | ||
138 | CONFIG_SELECT_MEMORY_MODEL=y | ||
139 | CONFIG_FLATMEM_MANUAL=y | ||
140 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
141 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
142 | CONFIG_FLATMEM=y | ||
143 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
144 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
145 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
146 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
147 | CONFIG_ZONE_DMA_FLAG=1 | ||
148 | CONFIG_VIRT_TO_BUS=y | ||
149 | |||
150 | # | ||
151 | # Executable file formats | ||
152 | # | ||
153 | CONFIG_KCORE_ELF=y | ||
154 | CONFIG_BINFMT_FLAT=y | ||
155 | # CONFIG_BINFMT_ZFLAT is not set | ||
156 | # CONFIG_BINFMT_SHARED_FLAT is not set | ||
157 | # CONFIG_HAVE_AOUT is not set | ||
158 | # CONFIG_BINFMT_MISC is not set | ||
159 | CONFIG_NET=y | ||
160 | |||
161 | # | ||
162 | # Networking options | ||
163 | # | ||
164 | CONFIG_COMPAT_NET_DEV_OPS=y | ||
165 | CONFIG_PACKET=y | ||
166 | # CONFIG_PACKET_MMAP is not set | ||
167 | CONFIG_UNIX=y | ||
168 | # CONFIG_NET_KEY is not set | ||
169 | CONFIG_INET=y | ||
170 | # CONFIG_IP_MULTICAST is not set | ||
171 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
172 | CONFIG_IP_FIB_HASH=y | ||
173 | # CONFIG_IP_PNP is not set | ||
174 | # CONFIG_NET_IPIP is not set | ||
175 | # CONFIG_NET_IPGRE is not set | ||
176 | # CONFIG_ARPD is not set | ||
177 | # CONFIG_SYN_COOKIES is not set | ||
178 | # CONFIG_INET_AH is not set | ||
179 | # CONFIG_INET_ESP is not set | ||
180 | # CONFIG_INET_IPCOMP is not set | ||
181 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
182 | # CONFIG_INET_TUNNEL is not set | ||
183 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
184 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
185 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
186 | # CONFIG_INET_LRO is not set | ||
187 | # CONFIG_INET_DIAG is not set | ||
188 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
189 | CONFIG_TCP_CONG_CUBIC=y | ||
190 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
191 | # CONFIG_TCP_MD5SIG is not set | ||
192 | # CONFIG_IPV6 is not set | ||
193 | # CONFIG_NETWORK_SECMARK is not set | ||
194 | # CONFIG_NETFILTER is not set | ||
195 | # CONFIG_IP_DCCP is not set | ||
196 | # CONFIG_IP_SCTP is not set | ||
197 | # CONFIG_TIPC is not set | ||
198 | # CONFIG_ATM is not set | ||
199 | # CONFIG_BRIDGE is not set | ||
200 | # CONFIG_NET_DSA is not set | ||
201 | # CONFIG_VLAN_8021Q is not set | ||
202 | # CONFIG_DECNET is not set | ||
203 | # CONFIG_LLC2 is not set | ||
204 | # CONFIG_IPX is not set | ||
205 | # CONFIG_ATALK is not set | ||
206 | # CONFIG_X25 is not set | ||
207 | # CONFIG_LAPB is not set | ||
208 | # CONFIG_ECONET is not set | ||
209 | # CONFIG_WAN_ROUTER is not set | ||
210 | # CONFIG_NET_SCHED is not set | ||
211 | # CONFIG_DCB is not set | ||
212 | |||
213 | # | ||
214 | # Network testing | ||
215 | # | ||
216 | # CONFIG_NET_PKTGEN is not set | ||
217 | # CONFIG_HAMRADIO is not set | ||
218 | # CONFIG_CAN is not set | ||
219 | # CONFIG_IRDA is not set | ||
220 | # CONFIG_BT is not set | ||
221 | # CONFIG_AF_RXRPC is not set | ||
222 | # CONFIG_PHONET is not set | ||
223 | # CONFIG_WIRELESS is not set | ||
224 | # CONFIG_WIMAX is not set | ||
225 | # CONFIG_RFKILL is not set | ||
226 | # CONFIG_NET_9P is not set | ||
227 | |||
228 | # | ||
229 | # Device Drivers | ||
230 | # | ||
231 | |||
232 | # | ||
233 | # Generic Driver Options | ||
234 | # | ||
235 | CONFIG_STANDALONE=y | ||
236 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
237 | # CONFIG_DEBUG_DRIVER is not set | ||
238 | # CONFIG_DEBUG_DEVRES is not set | ||
239 | # CONFIG_SYS_HYPERVISOR is not set | ||
240 | # CONFIG_CONNECTOR is not set | ||
241 | # CONFIG_MTD is not set | ||
242 | # CONFIG_PARPORT is not set | ||
243 | CONFIG_BLK_DEV=y | ||
244 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
245 | # CONFIG_BLK_DEV_LOOP is not set | ||
246 | # CONFIG_BLK_DEV_NBD is not set | ||
247 | CONFIG_BLK_DEV_RAM=y | ||
248 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
249 | CONFIG_BLK_DEV_RAM_SIZE=4096 | ||
250 | # CONFIG_BLK_DEV_XIP is not set | ||
251 | # CONFIG_CDROM_PKTCDVD is not set | ||
252 | # CONFIG_ATA_OVER_ETH is not set | ||
253 | # CONFIG_BLK_DEV_HD is not set | ||
254 | # CONFIG_MISC_DEVICES is not set | ||
255 | CONFIG_HAVE_IDE=y | ||
256 | # CONFIG_IDE is not set | ||
257 | |||
258 | # | ||
259 | # SCSI device support | ||
260 | # | ||
261 | # CONFIG_RAID_ATTRS is not set | ||
262 | # CONFIG_SCSI is not set | ||
263 | # CONFIG_SCSI_DMA is not set | ||
264 | # CONFIG_SCSI_NETLINK is not set | ||
265 | # CONFIG_ATA is not set | ||
266 | # CONFIG_MD is not set | ||
267 | # CONFIG_NETDEVICES is not set | ||
268 | # CONFIG_ISDN is not set | ||
269 | # CONFIG_PHONE is not set | ||
270 | |||
271 | # | ||
272 | # Input device support | ||
273 | # | ||
274 | # CONFIG_INPUT is not set | ||
275 | |||
276 | # | ||
277 | # Hardware I/O ports | ||
278 | # | ||
279 | # CONFIG_SERIO is not set | ||
280 | # CONFIG_GAMEPORT is not set | ||
281 | |||
282 | # | ||
283 | # Character devices | ||
284 | # | ||
285 | # CONFIG_VT is not set | ||
286 | # CONFIG_DEVKMEM is not set | ||
287 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
288 | |||
289 | # | ||
290 | # Serial drivers | ||
291 | # | ||
292 | CONFIG_SERIAL_8250=y | ||
293 | CONFIG_SERIAL_8250_CONSOLE=y | ||
294 | CONFIG_SERIAL_8250_NR_UARTS=2 | ||
295 | CONFIG_SERIAL_8250_RUNTIME_UARTS=2 | ||
296 | # CONFIG_SERIAL_8250_EXTENDED is not set | ||
297 | |||
298 | # | ||
299 | # Non-8250 serial port support | ||
300 | # | ||
301 | CONFIG_SERIAL_CORE=y | ||
302 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
303 | CONFIG_UNIX98_PTYS=y | ||
304 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
305 | # CONFIG_LEGACY_PTYS is not set | ||
306 | # CONFIG_IPMI_HANDLER is not set | ||
307 | # CONFIG_HW_RANDOM is not set | ||
308 | # CONFIG_RTC is not set | ||
309 | # CONFIG_GEN_RTC is not set | ||
310 | # CONFIG_R3964 is not set | ||
311 | # CONFIG_RAW_DRIVER is not set | ||
312 | # CONFIG_TCG_TPM is not set | ||
313 | # CONFIG_I2C is not set | ||
314 | # CONFIG_SPI is not set | ||
315 | CONFIG_ARCH_REQUIRE_GPIOLIB=y | ||
316 | CONFIG_GPIOLIB=y | ||
317 | # CONFIG_DEBUG_GPIO is not set | ||
318 | # CONFIG_GPIO_SYSFS is not set | ||
319 | |||
320 | # | ||
321 | # Memory mapped GPIO expanders: | ||
322 | # | ||
323 | |||
324 | # | ||
325 | # I2C GPIO expanders: | ||
326 | # | ||
327 | |||
328 | # | ||
329 | # PCI GPIO expanders: | ||
330 | # | ||
331 | |||
332 | # | ||
333 | # SPI GPIO expanders: | ||
334 | # | ||
335 | # CONFIG_W1 is not set | ||
336 | # CONFIG_POWER_SUPPLY is not set | ||
337 | # CONFIG_HWMON is not set | ||
338 | # CONFIG_THERMAL is not set | ||
339 | # CONFIG_THERMAL_HWMON is not set | ||
340 | # CONFIG_WATCHDOG is not set | ||
341 | CONFIG_SSB_POSSIBLE=y | ||
342 | |||
343 | # | ||
344 | # Sonics Silicon Backplane | ||
345 | # | ||
346 | # CONFIG_SSB is not set | ||
347 | |||
348 | # | ||
349 | # Multifunction device drivers | ||
350 | # | ||
351 | # CONFIG_MFD_CORE is not set | ||
352 | # CONFIG_MFD_SM501 is not set | ||
353 | # CONFIG_HTC_PASIC3 is not set | ||
354 | # CONFIG_MFD_TMIO is not set | ||
355 | # CONFIG_REGULATOR is not set | ||
356 | |||
357 | # | ||
358 | # Multimedia devices | ||
359 | # | ||
360 | |||
361 | # | ||
362 | # Multimedia core support | ||
363 | # | ||
364 | # CONFIG_VIDEO_DEV is not set | ||
365 | # CONFIG_DVB_CORE is not set | ||
366 | # CONFIG_VIDEO_MEDIA is not set | ||
367 | |||
368 | # | ||
369 | # Multimedia drivers | ||
370 | # | ||
371 | # CONFIG_DAB is not set | ||
372 | |||
373 | # | ||
374 | # Graphics support | ||
375 | # | ||
376 | # CONFIG_VGASTATE is not set | ||
377 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
378 | # CONFIG_FB is not set | ||
379 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
380 | |||
381 | # | ||
382 | # Display device support | ||
383 | # | ||
384 | # CONFIG_DISPLAY_SUPPORT is not set | ||
385 | # CONFIG_SOUND is not set | ||
386 | # CONFIG_USB_SUPPORT is not set | ||
387 | # CONFIG_MMC is not set | ||
388 | # CONFIG_MEMSTICK is not set | ||
389 | # CONFIG_NEW_LEDS is not set | ||
390 | # CONFIG_ACCESSIBILITY is not set | ||
391 | # CONFIG_RTC_CLASS is not set | ||
392 | # CONFIG_DMADEVICES is not set | ||
393 | # CONFIG_UIO is not set | ||
394 | # CONFIG_STAGING is not set | ||
395 | |||
396 | # | ||
397 | # File systems | ||
398 | # | ||
399 | # CONFIG_EXT2_FS is not set | ||
400 | # CONFIG_EXT3_FS is not set | ||
401 | # CONFIG_EXT4_FS is not set | ||
402 | # CONFIG_REISERFS_FS is not set | ||
403 | # CONFIG_JFS_FS is not set | ||
404 | # CONFIG_FS_POSIX_ACL is not set | ||
405 | CONFIG_FILE_LOCKING=y | ||
406 | # CONFIG_XFS_FS is not set | ||
407 | # CONFIG_OCFS2_FS is not set | ||
408 | # CONFIG_BTRFS_FS is not set | ||
409 | # CONFIG_DNOTIFY is not set | ||
410 | # CONFIG_INOTIFY is not set | ||
411 | # CONFIG_QUOTA is not set | ||
412 | # CONFIG_AUTOFS_FS is not set | ||
413 | # CONFIG_AUTOFS4_FS is not set | ||
414 | # CONFIG_FUSE_FS is not set | ||
415 | |||
416 | # | ||
417 | # CD-ROM/DVD Filesystems | ||
418 | # | ||
419 | # CONFIG_ISO9660_FS is not set | ||
420 | # CONFIG_UDF_FS is not set | ||
421 | |||
422 | # | ||
423 | # DOS/FAT/NT Filesystems | ||
424 | # | ||
425 | # CONFIG_MSDOS_FS is not set | ||
426 | # CONFIG_VFAT_FS is not set | ||
427 | # CONFIG_NTFS_FS is not set | ||
428 | |||
429 | # | ||
430 | # Pseudo filesystems | ||
431 | # | ||
432 | CONFIG_PROC_FS=y | ||
433 | CONFIG_PROC_SYSCTL=y | ||
434 | CONFIG_SYSFS=y | ||
435 | # CONFIG_TMPFS is not set | ||
436 | # CONFIG_HUGETLB_PAGE is not set | ||
437 | # CONFIG_CONFIGFS_FS is not set | ||
438 | # CONFIG_MISC_FILESYSTEMS is not set | ||
439 | # CONFIG_NETWORK_FILESYSTEMS is not set | ||
440 | |||
441 | # | ||
442 | # Partition Types | ||
443 | # | ||
444 | # CONFIG_PARTITION_ADVANCED is not set | ||
445 | CONFIG_MSDOS_PARTITION=y | ||
446 | # CONFIG_NLS is not set | ||
447 | # CONFIG_DLM is not set | ||
448 | |||
449 | # | ||
450 | # Xtensa initrd options | ||
451 | # | ||
452 | # CONFIG_EMBEDDED_RAMDISK is not set | ||
453 | |||
454 | # | ||
455 | # Kernel hacking | ||
456 | # | ||
457 | CONFIG_PRINTK_TIME=y | ||
458 | # CONFIG_ENABLE_WARN_DEPRECATED is not set | ||
459 | # CONFIG_ENABLE_MUST_CHECK is not set | ||
460 | CONFIG_FRAME_WARN=1024 | ||
461 | # CONFIG_MAGIC_SYSRQ is not set | ||
462 | # CONFIG_UNUSED_SYMBOLS is not set | ||
463 | # CONFIG_DEBUG_FS is not set | ||
464 | # CONFIG_HEADERS_CHECK is not set | ||
465 | CONFIG_DEBUG_KERNEL=y | ||
466 | CONFIG_DEBUG_SHIRQ=y | ||
467 | CONFIG_DETECT_SOFTLOCKUP=y | ||
468 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
469 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
470 | # CONFIG_SCHED_DEBUG is not set | ||
471 | # CONFIG_SCHEDSTATS is not set | ||
472 | # CONFIG_TIMER_STATS is not set | ||
473 | # CONFIG_DEBUG_OBJECTS is not set | ||
474 | # CONFIG_DEBUG_SLAB is not set | ||
475 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
476 | # CONFIG_RT_MUTEX_TESTER is not set | ||
477 | CONFIG_DEBUG_SPINLOCK=y | ||
478 | CONFIG_DEBUG_MUTEXES=y | ||
479 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
480 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
481 | # CONFIG_DEBUG_KOBJECT is not set | ||
482 | # CONFIG_DEBUG_INFO is not set | ||
483 | # CONFIG_DEBUG_VM is not set | ||
484 | CONFIG_DEBUG_NOMMU_REGIONS=y | ||
485 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
486 | # CONFIG_DEBUG_MEMORY_INIT is not set | ||
487 | # CONFIG_DEBUG_LIST is not set | ||
488 | # CONFIG_DEBUG_SG is not set | ||
489 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
490 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
491 | # CONFIG_RCU_TORTURE_TEST is not set | ||
492 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
493 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
494 | # CONFIG_FAULT_INJECTION is not set | ||
495 | # CONFIG_SYSCTL_SYSCALL_CHECK is not set | ||
496 | |||
497 | # | ||
498 | # Tracers | ||
499 | # | ||
500 | # CONFIG_PREEMPT_TRACER is not set | ||
501 | # CONFIG_SCHED_TRACER is not set | ||
502 | # CONFIG_CONTEXT_SWITCH_TRACER is not set | ||
503 | # CONFIG_BOOT_TRACER is not set | ||
504 | # CONFIG_TRACE_BRANCH_PROFILING is not set | ||
505 | # CONFIG_DYNAMIC_PRINTK_DEBUG is not set | ||
506 | # CONFIG_SAMPLES is not set | ||
507 | |||
508 | # | ||
509 | # Security options | ||
510 | # | ||
511 | # CONFIG_KEYS is not set | ||
512 | # CONFIG_SECURITY is not set | ||
513 | # CONFIG_SECURITYFS is not set | ||
514 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
515 | # CONFIG_CRYPTO is not set | ||
516 | |||
517 | # | ||
518 | # Library routines | ||
519 | # | ||
520 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
521 | # CONFIG_CRC_CCITT is not set | ||
522 | # CONFIG_CRC16 is not set | ||
523 | # CONFIG_CRC_T10DIF is not set | ||
524 | # CONFIG_CRC_ITU_T is not set | ||
525 | # CONFIG_CRC32 is not set | ||
526 | # CONFIG_CRC7 is not set | ||
527 | # CONFIG_LIBCRC32C is not set | ||
528 | CONFIG_PLIST=y | ||
529 | CONFIG_HAS_IOMEM=y | ||
530 | CONFIG_HAS_DMA=y | ||
diff --git a/arch/xtensa/include/asm/cacheflush.h b/arch/xtensa/include/asm/cacheflush.h index 94c4c53a099e..8fc1c0c8de07 100644 --- a/arch/xtensa/include/asm/cacheflush.h +++ b/arch/xtensa/include/asm/cacheflush.h | |||
@@ -65,13 +65,17 @@ extern void __flush_invalidate_dcache_range(unsigned long, unsigned long); | |||
65 | # define __flush_invalidate_dcache_range(p,s) __invalidate_dcache_range(p,s) | 65 | # define __flush_invalidate_dcache_range(p,s) __invalidate_dcache_range(p,s) |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #if (DCACHE_WAY_SIZE > PAGE_SIZE) | 68 | #if defined(CONFIG_MMU) && (DCACHE_WAY_SIZE > PAGE_SIZE) |
69 | extern void __flush_invalidate_dcache_page_alias(unsigned long, unsigned long); | 69 | extern void __flush_invalidate_dcache_page_alias(unsigned long, unsigned long); |
70 | #else | ||
71 | static inline void __flush_invalidate_dcache_page_alias(unsigned long virt, | ||
72 | unsigned long phys) { } | ||
70 | #endif | 73 | #endif |
71 | #if (ICACHE_WAY_SIZE > PAGE_SIZE) | 74 | #if defined(CONFIG_MMU) && (ICACHE_WAY_SIZE > PAGE_SIZE) |
72 | extern void __invalidate_icache_page_alias(unsigned long, unsigned long); | 75 | extern void __invalidate_icache_page_alias(unsigned long, unsigned long); |
73 | #else | 76 | #else |
74 | # define __invalidate_icache_page_alias(v,p) do { } while(0) | 77 | static inline void __invalidate_icache_page_alias(unsigned long virt, |
78 | unsigned long phys) { } | ||
75 | #endif | 79 | #endif |
76 | 80 | ||
77 | /* | 81 | /* |
diff --git a/arch/xtensa/include/asm/dma.h b/arch/xtensa/include/asm/dma.h index e30f3abf48f0..137ca3945b07 100644 --- a/arch/xtensa/include/asm/dma.h +++ b/arch/xtensa/include/asm/dma.h | |||
@@ -44,8 +44,9 @@ | |||
44 | * the value desired). | 44 | * the value desired). |
45 | */ | 45 | */ |
46 | 46 | ||
47 | #ifndef MAX_DMA_ADDRESS | ||
47 | #define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KIO_SIZE - 1) | 48 | #define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KIO_SIZE - 1) |
48 | 49 | #endif | |
49 | 50 | ||
50 | /* Reserve and release a DMA channel */ | 51 | /* Reserve and release a DMA channel */ |
51 | extern int request_dma(unsigned int dmanr, const char * device_id); | 52 | extern int request_dma(unsigned int dmanr, const char * device_id); |
diff --git a/arch/xtensa/include/asm/flat.h b/arch/xtensa/include/asm/flat.h new file mode 100644 index 000000000000..94c44abf15e4 --- /dev/null +++ b/arch/xtensa/include/asm/flat.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef __ASM_XTENSA_FLAT_H | ||
2 | #define __ASM_XTENSA_FLAT_H | ||
3 | |||
4 | #define flat_argvp_envp_on_stack() 0 | ||
5 | #define flat_old_ram_flag(flags) (flags) | ||
6 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) | ||
7 | #define flat_get_addr_from_rp(rp, relval, flags, p) get_unaligned(rp) | ||
8 | #define flat_put_addr_at_rp(rp, val, relval ) put_unaligned(val, rp) | ||
9 | #define flat_get_relocate_addr(rel) (rel) | ||
10 | #define flat_set_persistent(relval, p) 0 | ||
11 | |||
12 | #endif /* __ASM_XTENSA_FLAT_H */ | ||
diff --git a/arch/xtensa/include/asm/ftrace.h b/arch/xtensa/include/asm/ftrace.h new file mode 100644 index 000000000000..40a8c178f10d --- /dev/null +++ b/arch/xtensa/include/asm/ftrace.h | |||
@@ -0,0 +1 @@ | |||
/* empty */ | |||
diff --git a/arch/xtensa/include/asm/gpio.h b/arch/xtensa/include/asm/gpio.h new file mode 100644 index 000000000000..0763b0763960 --- /dev/null +++ b/arch/xtensa/include/asm/gpio.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Generic GPIO API implementation for xtensa. | ||
3 | * | ||
4 | * Stolen from x86, which is derived from the generic GPIO API for powerpc: | ||
5 | * | ||
6 | * Copyright (c) 2007-2008 MontaVista Software, Inc. | ||
7 | * | ||
8 | * Author: Anton Vorontsov <avorontsov@ru.mvista.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef _ASM_XTENSA_GPIO_H | ||
17 | #define _ASM_XTENSA_GPIO_H | ||
18 | |||
19 | #include <asm-generic/gpio.h> | ||
20 | |||
21 | #ifdef CONFIG_GPIOLIB | ||
22 | |||
23 | /* | ||
24 | * Just call gpiolib. | ||
25 | */ | ||
26 | static inline int gpio_get_value(unsigned int gpio) | ||
27 | { | ||
28 | return __gpio_get_value(gpio); | ||
29 | } | ||
30 | |||
31 | static inline void gpio_set_value(unsigned int gpio, int value) | ||
32 | { | ||
33 | __gpio_set_value(gpio, value); | ||
34 | } | ||
35 | |||
36 | static inline int gpio_cansleep(unsigned int gpio) | ||
37 | { | ||
38 | return __gpio_cansleep(gpio); | ||
39 | } | ||
40 | |||
41 | /* | ||
42 | * Not implemented, yet. | ||
43 | */ | ||
44 | static inline int gpio_to_irq(unsigned int gpio) | ||
45 | { | ||
46 | return -ENOSYS; | ||
47 | } | ||
48 | |||
49 | static inline int irq_to_gpio(unsigned int irq) | ||
50 | { | ||
51 | return -EINVAL; | ||
52 | } | ||
53 | |||
54 | #endif /* CONFIG_GPIOLIB */ | ||
55 | |||
56 | #endif /* _ASM_XTENSA_GPIO_H */ | ||
diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/include/asm/io.h index 07b7299dab20..d04cd3a625fa 100644 --- a/arch/xtensa/include/asm/io.h +++ b/arch/xtensa/include/asm/io.h | |||
@@ -69,21 +69,28 @@ static inline void * phys_to_virt(unsigned long address) | |||
69 | 69 | ||
70 | static inline void *ioremap(unsigned long offset, unsigned long size) | 70 | static inline void *ioremap(unsigned long offset, unsigned long size) |
71 | { | 71 | { |
72 | #ifdef CONFIG_MMU | ||
72 | if (offset >= XCHAL_KIO_PADDR | 73 | if (offset >= XCHAL_KIO_PADDR |
73 | && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) | 74 | && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) |
74 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); | 75 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); |
75 | |||
76 | else | 76 | else |
77 | BUG(); | 77 | BUG(); |
78 | #else | ||
79 | return (void *)offset; | ||
80 | #endif | ||
78 | } | 81 | } |
79 | 82 | ||
80 | static inline void *ioremap_nocache(unsigned long offset, unsigned long size) | 83 | static inline void *ioremap_nocache(unsigned long offset, unsigned long size) |
81 | { | 84 | { |
85 | #ifdef CONFIG_MMU | ||
82 | if (offset >= XCHAL_KIO_PADDR | 86 | if (offset >= XCHAL_KIO_PADDR |
83 | && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) | 87 | && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) |
84 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); | 88 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); |
85 | else | 89 | else |
86 | BUG(); | 90 | BUG(); |
91 | #else | ||
92 | return (void *)offset; | ||
93 | #endif | ||
87 | } | 94 | } |
88 | 95 | ||
89 | static inline void iounmap(void *addr) | 96 | static inline void iounmap(void *addr) |
diff --git a/arch/xtensa/include/asm/irq.h b/arch/xtensa/include/asm/irq.h index 1620d1e0e695..dfac82dc52ad 100644 --- a/arch/xtensa/include/asm/irq.h +++ b/arch/xtensa/include/asm/irq.h | |||
@@ -14,6 +14,13 @@ | |||
14 | #include <platform/hardware.h> | 14 | #include <platform/hardware.h> |
15 | #include <variant/core.h> | 15 | #include <variant/core.h> |
16 | 16 | ||
17 | #ifdef CONFIG_VARIANT_IRQ_SWITCH | ||
18 | #include <variant/irq.h> | ||
19 | #else | ||
20 | static inline void variant_irq_enable(unsigned int irq) { } | ||
21 | static inline void variant_irq_disable(unsigned int irq) { } | ||
22 | #endif | ||
23 | |||
17 | #ifndef PLATFORM_NR_IRQS | 24 | #ifndef PLATFORM_NR_IRQS |
18 | # define PLATFORM_NR_IRQS 0 | 25 | # define PLATFORM_NR_IRQS 0 |
19 | #endif | 26 | #endif |
diff --git a/arch/xtensa/include/asm/mmu.h b/arch/xtensa/include/asm/mmu.h index 44c5bb04c55c..04890d6e2335 100644 --- a/arch/xtensa/include/asm/mmu.h +++ b/arch/xtensa/include/asm/mmu.h | |||
@@ -11,7 +11,12 @@ | |||
11 | #ifndef _XTENSA_MMU_H | 11 | #ifndef _XTENSA_MMU_H |
12 | #define _XTENSA_MMU_H | 12 | #define _XTENSA_MMU_H |
13 | 13 | ||
14 | #ifndef CONFIG_MMU | ||
15 | #include <asm/nommu.h> | ||
16 | #else | ||
17 | |||
14 | /* Default "unsigned long" context */ | 18 | /* Default "unsigned long" context */ |
15 | typedef unsigned long mm_context_t; | 19 | typedef unsigned long mm_context_t; |
16 | 20 | ||
21 | #endif /* CONFIG_MMU */ | ||
17 | #endif /* _XTENSA_MMU_H */ | 22 | #endif /* _XTENSA_MMU_H */ |
diff --git a/arch/xtensa/include/asm/mmu_context.h b/arch/xtensa/include/asm/mmu_context.h index c0fd8e5b4513..dbd8731a876a 100644 --- a/arch/xtensa/include/asm/mmu_context.h +++ b/arch/xtensa/include/asm/mmu_context.h | |||
@@ -13,16 +13,20 @@ | |||
13 | #ifndef _XTENSA_MMU_CONTEXT_H | 13 | #ifndef _XTENSA_MMU_CONTEXT_H |
14 | #define _XTENSA_MMU_CONTEXT_H | 14 | #define _XTENSA_MMU_CONTEXT_H |
15 | 15 | ||
16 | #ifndef CONFIG_MMU | ||
17 | #include <asm/nommu_context.h> | ||
18 | #else | ||
19 | |||
16 | #include <linux/stringify.h> | 20 | #include <linux/stringify.h> |
17 | #include <linux/sched.h> | 21 | #include <linux/sched.h> |
18 | 22 | ||
23 | #include <variant/core.h> | ||
24 | |||
19 | #include <asm/pgtable.h> | 25 | #include <asm/pgtable.h> |
20 | #include <asm/cacheflush.h> | 26 | #include <asm/cacheflush.h> |
21 | #include <asm/tlbflush.h> | 27 | #include <asm/tlbflush.h> |
22 | #include <asm-generic/mm_hooks.h> | 28 | #include <asm-generic/mm_hooks.h> |
23 | 29 | ||
24 | #define XCHAL_MMU_ASID_BITS 8 | ||
25 | |||
26 | #if (XCHAL_HAVE_TLBS != 1) | 30 | #if (XCHAL_HAVE_TLBS != 1) |
27 | # error "Linux must have an MMU!" | 31 | # error "Linux must have an MMU!" |
28 | #endif | 32 | #endif |
@@ -133,4 +137,5 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
133 | 137 | ||
134 | } | 138 | } |
135 | 139 | ||
140 | #endif /* CONFIG_MMU */ | ||
136 | #endif /* _XTENSA_MMU_CONTEXT_H */ | 141 | #endif /* _XTENSA_MMU_CONTEXT_H */ |
diff --git a/arch/xtensa/include/asm/nommu.h b/arch/xtensa/include/asm/nommu.h new file mode 100644 index 000000000000..dce2c438c5ba --- /dev/null +++ b/arch/xtensa/include/asm/nommu.h | |||
@@ -0,0 +1,3 @@ | |||
1 | typedef struct { | ||
2 | unsigned long end_brk; | ||
3 | } mm_context_t; | ||
diff --git a/arch/xtensa/include/asm/nommu_context.h b/arch/xtensa/include/asm/nommu_context.h new file mode 100644 index 000000000000..599e7a2e729d --- /dev/null +++ b/arch/xtensa/include/asm/nommu_context.h | |||
@@ -0,0 +1,25 @@ | |||
1 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | ||
2 | { | ||
3 | } | ||
4 | |||
5 | static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) | ||
6 | { | ||
7 | return 0; | ||
8 | } | ||
9 | |||
10 | static inline void destroy_context(struct mm_struct *mm) | ||
11 | { | ||
12 | } | ||
13 | |||
14 | static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) | ||
15 | { | ||
16 | } | ||
17 | |||
18 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | ||
19 | struct task_struct *tsk) | ||
20 | { | ||
21 | } | ||
22 | |||
23 | static inline void deactivate_mm(struct task_struct *tsk, struct mm_struct *mm) | ||
24 | { | ||
25 | } | ||
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h index 11f7dc2dbec7..17e0c5383b10 100644 --- a/arch/xtensa/include/asm/page.h +++ b/arch/xtensa/include/asm/page.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/types.h> | 15 | #include <asm/types.h> |
16 | #include <asm/cache.h> | 16 | #include <asm/cache.h> |
17 | #include <platform/hardware.h> | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * Fixed TLB translations in the processor. | 20 | * Fixed TLB translations in the processor. |
@@ -32,8 +33,14 @@ | |||
32 | #define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT) | 33 | #define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT) |
33 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 34 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
34 | 35 | ||
36 | #ifdef CONFIG_MMU | ||
35 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR | 37 | #define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR |
36 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE | 38 | #define MAX_MEM_PFN XCHAL_KSEG_SIZE |
39 | #else | ||
40 | #define PAGE_OFFSET 0 | ||
41 | #define MAX_MEM_PFN (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE) | ||
42 | #endif | ||
43 | |||
37 | #define PGTABLE_START 0x80000000 | 44 | #define PGTABLE_START 0x80000000 |
38 | 45 | ||
39 | /* | 46 | /* |
@@ -150,9 +157,11 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*); | |||
150 | * addresses. | 157 | * addresses. |
151 | */ | 158 | */ |
152 | 159 | ||
160 | #define ARCH_PFN_OFFSET (PLATFORM_DEFAULT_MEM_START >> PAGE_SHIFT) | ||
161 | |||
153 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) | 162 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) |
154 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) | 163 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) |
155 | #define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr) | 164 | #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr) |
156 | #ifdef CONFIG_DISCONTIGMEM | 165 | #ifdef CONFIG_DISCONTIGMEM |
157 | # error CONFIG_DISCONTIGMEM not supported | 166 | # error CONFIG_DISCONTIGMEM not supported |
158 | #endif | 167 | #endif |
@@ -162,8 +171,9 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*); | |||
162 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 171 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
163 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 172 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
164 | 173 | ||
174 | #ifdef CONFIG_MMU | ||
165 | #define WANT_PAGE_VIRTUAL | 175 | #define WANT_PAGE_VIRTUAL |
166 | 176 | #endif | |
167 | 177 | ||
168 | #endif /* __ASSEMBLY__ */ | 178 | #endif /* __ASSEMBLY__ */ |
169 | 179 | ||
diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index 8014d96b21f1..a138770c358e 100644 --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h | |||
@@ -183,7 +183,15 @@ extern unsigned long empty_zero_page[1024]; | |||
183 | 183 | ||
184 | #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) | 184 | #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) |
185 | 185 | ||
186 | #ifdef CONFIG_MMU | ||
186 | extern pgd_t swapper_pg_dir[PAGE_SIZE/sizeof(pgd_t)]; | 187 | extern pgd_t swapper_pg_dir[PAGE_SIZE/sizeof(pgd_t)]; |
188 | extern void paging_init(void); | ||
189 | extern void pgtable_cache_init(void); | ||
190 | #else | ||
191 | # define swapper_pg_dir NULL | ||
192 | static inline void paging_init(void) { } | ||
193 | static inline void pgtable_cache_init(void) { } | ||
194 | #endif | ||
187 | 195 | ||
188 | /* | 196 | /* |
189 | * The pmd contains the kernel virtual address of the pte page. | 197 | * The pmd contains the kernel virtual address of the pte page. |
@@ -383,8 +391,6 @@ ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | |||
383 | 391 | ||
384 | #else | 392 | #else |
385 | 393 | ||
386 | extern void paging_init(void); | ||
387 | |||
388 | #define kern_addr_valid(addr) (1) | 394 | #define kern_addr_valid(addr) (1) |
389 | 395 | ||
390 | extern void update_mmu_cache(struct vm_area_struct * vma, | 396 | extern void update_mmu_cache(struct vm_area_struct * vma, |
@@ -398,9 +404,6 @@ extern void update_mmu_cache(struct vm_area_struct * vma, | |||
398 | #define io_remap_pfn_range(vma,from,pfn,size,prot) \ | 404 | #define io_remap_pfn_range(vma,from,pfn,size,prot) \ |
399 | remap_pfn_range(vma, from, pfn, size, prot) | 405 | remap_pfn_range(vma, from, pfn, size, prot) |
400 | 406 | ||
401 | |||
402 | extern void pgtable_cache_init(void); | ||
403 | |||
404 | typedef pte_t *pte_addr_t; | 407 | typedef pte_t *pte_addr_t; |
405 | 408 | ||
406 | #endif /* !defined (__ASSEMBLY__) */ | 409 | #endif /* !defined (__ASSEMBLY__) */ |
diff --git a/arch/xtensa/include/asm/platform.h b/arch/xtensa/include/asm/platform.h index e3d5a48ad495..7d936e58e9be 100644 --- a/arch/xtensa/include/asm/platform.h +++ b/arch/xtensa/include/asm/platform.h | |||
@@ -74,16 +74,5 @@ extern int platform_pcibios_fixup (void); | |||
74 | */ | 74 | */ |
75 | extern void platform_calibrate_ccount (void); | 75 | extern void platform_calibrate_ccount (void); |
76 | 76 | ||
77 | /* | ||
78 | * platform_get_rtc_time returns RTC seconds (returns 0 for no error) | ||
79 | */ | ||
80 | extern int platform_get_rtc_time(time_t*); | ||
81 | |||
82 | /* | ||
83 | * platform_set_rtc_time set RTC seconds (returns 0 for no error) | ||
84 | */ | ||
85 | extern int platform_set_rtc_time(time_t); | ||
86 | |||
87 | |||
88 | #endif /* _XTENSA_PLATFORM_H */ | 77 | #endif /* _XTENSA_PLATFORM_H */ |
89 | 78 | ||
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 07387d3b99f4..0ea4937c0b61 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <variant/core.h> | 14 | #include <variant/core.h> |
15 | #include <asm/coprocessor.h> | 15 | #include <asm/coprocessor.h> |
16 | #include <platform/hardware.h> | ||
16 | 17 | ||
17 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
18 | #include <asm/ptrace.h> | 19 | #include <asm/ptrace.h> |
@@ -25,6 +26,8 @@ | |||
25 | # error Linux requires the Xtensa Windowed Registers Option. | 26 | # error Linux requires the Xtensa Windowed Registers Option. |
26 | #endif | 27 | #endif |
27 | 28 | ||
29 | #define ARCH_SLAB_MINALIGN XCHAL_DATA_WIDTH | ||
30 | |||
28 | /* | 31 | /* |
29 | * User space process size: 1 GB. | 32 | * User space process size: 1 GB. |
30 | * Windowed call ABI requires caller and callee to be located within the same | 33 | * Windowed call ABI requires caller and callee to be located within the same |
@@ -33,7 +36,12 @@ | |||
33 | * the 1 GB requirement applies to the stack as well. | 36 | * the 1 GB requirement applies to the stack as well. |
34 | */ | 37 | */ |
35 | 38 | ||
39 | #ifdef CONFIG_MMU | ||
36 | #define TASK_SIZE __XTENSA_UL_CONST(0x40000000) | 40 | #define TASK_SIZE __XTENSA_UL_CONST(0x40000000) |
41 | #else | ||
42 | #define TASK_SIZE (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE) | ||
43 | #endif | ||
44 | |||
37 | #define STACK_TOP TASK_SIZE | 45 | #define STACK_TOP TASK_SIZE |
38 | #define STACK_TOP_MAX STACK_TOP | 46 | #define STACK_TOP_MAX STACK_TOP |
39 | 47 | ||
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index a51d36a27389..80d24c485fd3 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
@@ -1463,6 +1463,7 @@ ENTRY(_spill_registers) | |||
1463 | callx0 a0 # should not return | 1463 | callx0 a0 # should not return |
1464 | 1: j 1b | 1464 | 1: j 1b |
1465 | 1465 | ||
1466 | #ifdef CONFIG_MMU | ||
1466 | /* | 1467 | /* |
1467 | * We should never get here. Bail out! | 1468 | * We should never get here. Bail out! |
1468 | */ | 1469 | */ |
@@ -1775,7 +1776,7 @@ ENTRY(fast_store_prohibited) | |||
1775 | bbsi.l a2, PS_UM_BIT, 1f | 1776 | bbsi.l a2, PS_UM_BIT, 1f |
1776 | j _kernel_exception | 1777 | j _kernel_exception |
1777 | 1: j _user_exception | 1778 | 1: j _user_exception |
1778 | 1779 | #endif /* CONFIG_MMU */ | |
1779 | 1780 | ||
1780 | /* | 1781 | /* |
1781 | * System Calls. | 1782 | * System Calls. |
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S index 67e69139520b..0817f9db836e 100644 --- a/arch/xtensa/kernel/head.S +++ b/arch/xtensa/kernel/head.S | |||
@@ -53,7 +53,7 @@ _start: _j 2f | |||
53 | 2: l32r a0, 1b | 53 | 2: l32r a0, 1b |
54 | jx a0 | 54 | jx a0 |
55 | 55 | ||
56 | .text | 56 | .section .init.text, "ax" |
57 | .align 4 | 57 | .align 4 |
58 | _startup: | 58 | _startup: |
59 | 59 | ||
@@ -235,8 +235,9 @@ should_never_return: | |||
235 | */ | 235 | */ |
236 | 236 | ||
237 | .section ".bss.page_aligned", "w" | 237 | .section ".bss.page_aligned", "w" |
238 | #ifdef CONFIG_MMU | ||
238 | ENTRY(swapper_pg_dir) | 239 | ENTRY(swapper_pg_dir) |
239 | .fill PAGE_SIZE, 1, 0 | 240 | .fill PAGE_SIZE, 1, 0 |
241 | #endif | ||
240 | ENTRY(empty_zero_page) | 242 | ENTRY(empty_zero_page) |
241 | .fill PAGE_SIZE, 1, 0 | 243 | .fill PAGE_SIZE, 1, 0 |
242 | |||
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index f3b66fba5b8f..a36c85edd045 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c | |||
@@ -132,6 +132,18 @@ static void xtensa_irq_unmask(unsigned int irq) | |||
132 | set_sr (cached_irq_mask, INTENABLE); | 132 | set_sr (cached_irq_mask, INTENABLE); |
133 | } | 133 | } |
134 | 134 | ||
135 | static void xtensa_irq_enable(unsigned int irq) | ||
136 | { | ||
137 | variant_irq_enable(irq); | ||
138 | xtensa_irq_unmask(irq); | ||
139 | } | ||
140 | |||
141 | static void xtensa_irq_disable(unsigned int irq) | ||
142 | { | ||
143 | xtensa_irq_mask(irq); | ||
144 | variant_irq_disable(irq); | ||
145 | } | ||
146 | |||
135 | static void xtensa_irq_ack(unsigned int irq) | 147 | static void xtensa_irq_ack(unsigned int irq) |
136 | { | 148 | { |
137 | set_sr(1 << irq, INTCLEAR); | 149 | set_sr(1 << irq, INTCLEAR); |
@@ -146,6 +158,8 @@ static int xtensa_irq_retrigger(unsigned int irq) | |||
146 | 158 | ||
147 | static struct irq_chip xtensa_irq_chip = { | 159 | static struct irq_chip xtensa_irq_chip = { |
148 | .name = "xtensa", | 160 | .name = "xtensa", |
161 | .enable = xtensa_irq_enable, | ||
162 | .disable = xtensa_irq_disable, | ||
149 | .mask = xtensa_irq_mask, | 163 | .mask = xtensa_irq_mask, |
150 | .unmask = xtensa_irq_unmask, | 164 | .unmask = xtensa_irq_unmask, |
151 | .ack = xtensa_irq_ack, | 165 | .ack = xtensa_irq_ack, |
diff --git a/arch/xtensa/kernel/platform.c b/arch/xtensa/kernel/platform.c index 69675f216062..1b91a97f1d84 100644 --- a/arch/xtensa/kernel/platform.c +++ b/arch/xtensa/kernel/platform.c | |||
@@ -36,8 +36,6 @@ _F(void, power_off, (void), { while(1); }); | |||
36 | _F(void, idle, (void), { __asm__ __volatile__ ("waiti 0" ::: "memory"); }); | 36 | _F(void, idle, (void), { __asm__ __volatile__ ("waiti 0" ::: "memory"); }); |
37 | _F(void, heartbeat, (void), { }); | 37 | _F(void, heartbeat, (void), { }); |
38 | _F(int, pcibios_fixup, (void), { return 0; }); | 38 | _F(int, pcibios_fixup, (void), { return 0; }); |
39 | _F(int, get_rtc_time, (time_t* t), { return 0; }); | ||
40 | _F(int, set_rtc_time, (time_t t), { return 0; }); | ||
41 | 39 | ||
42 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT | 40 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT |
43 | _F(void, calibrate_ccount, (void), | 41 | _F(void, calibrate_ccount, (void), |
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index 9185597eb6a0..031f36685710 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c | |||
@@ -172,7 +172,7 @@ void prepare_to_copy(struct task_struct *tsk) | |||
172 | * childregs. | 172 | * childregs. |
173 | */ | 173 | */ |
174 | 174 | ||
175 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 175 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
176 | unsigned long unused, | 176 | unsigned long unused, |
177 | struct task_struct * p, struct pt_regs * regs) | 177 | struct task_struct * p, struct pt_regs * regs) |
178 | { | 178 | { |
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 4ec1633c2941..1e5a034fe011 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c | |||
@@ -84,7 +84,13 @@ sysmem_info_t __initdata sysmem; | |||
84 | int initrd_is_mapped; | 84 | int initrd_is_mapped; |
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | #ifdef CONFIG_MMU | ||
87 | extern void init_mmu(void); | 88 | extern void init_mmu(void); |
89 | #else | ||
90 | static inline void init_mmu(void) { } | ||
91 | #endif | ||
92 | |||
93 | extern void zones_init(void); | ||
88 | 94 | ||
89 | /* | 95 | /* |
90 | * Boot parameter parsing. | 96 | * Boot parameter parsing. |
@@ -286,6 +292,7 @@ void __init setup_arch(char **cmdline_p) | |||
286 | 292 | ||
287 | 293 | ||
288 | paging_init(); | 294 | paging_init(); |
295 | zones_init(); | ||
289 | 296 | ||
290 | #ifdef CONFIG_VT | 297 | #ifdef CONFIG_VT |
291 | # if defined(CONFIG_VGA_CONSOLE) | 298 | # if defined(CONFIG_VGA_CONSOLE) |
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index 8df1e842f6d4..8848120d291b 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
16 | #include <linux/time.h> | 16 | #include <linux/time.h> |
17 | #include <linux/timex.h> | 17 | #include <linux/clocksource.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
@@ -25,27 +25,31 @@ | |||
25 | #include <asm/timex.h> | 25 | #include <asm/timex.h> |
26 | #include <asm/platform.h> | 26 | #include <asm/platform.h> |
27 | 27 | ||
28 | |||
29 | DEFINE_SPINLOCK(rtc_lock); | ||
30 | EXPORT_SYMBOL(rtc_lock); | ||
31 | |||
32 | |||
33 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT | 28 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT |
34 | unsigned long ccount_per_jiffy; /* per 1/HZ */ | 29 | unsigned long ccount_per_jiffy; /* per 1/HZ */ |
35 | unsigned long nsec_per_ccount; /* nsec per ccount increment */ | 30 | unsigned long nsec_per_ccount; /* nsec per ccount increment */ |
36 | #endif | 31 | #endif |
37 | 32 | ||
38 | static long last_rtc_update = 0; | 33 | static cycle_t ccount_read(void) |
39 | |||
40 | /* | ||
41 | * Scheduler clock - returns current tim in nanosec units. | ||
42 | */ | ||
43 | |||
44 | unsigned long long sched_clock(void) | ||
45 | { | 34 | { |
46 | return (unsigned long long)jiffies * (1000000000 / HZ); | 35 | return (cycle_t)get_ccount(); |
47 | } | 36 | } |
48 | 37 | ||
38 | static struct clocksource ccount_clocksource = { | ||
39 | .name = "ccount", | ||
40 | .rating = 200, | ||
41 | .read = ccount_read, | ||
42 | .mask = CLOCKSOURCE_MASK(32), | ||
43 | /* | ||
44 | * With a shift of 22 the lower limit of the cpu clock is | ||
45 | * 1MHz, where NSEC_PER_CCOUNT is 1000 or a bit less than | ||
46 | * 2^10: Since we have 32 bits and the multiplicator can | ||
47 | * already take up as much as 10 bits, this leaves us with | ||
48 | * remaining upper 22 bits. | ||
49 | */ | ||
50 | .shift = 22, | ||
51 | }; | ||
52 | |||
49 | static irqreturn_t timer_interrupt(int irq, void *dev_id); | 53 | static irqreturn_t timer_interrupt(int irq, void *dev_id); |
50 | static struct irqaction timer_irqaction = { | 54 | static struct irqaction timer_irqaction = { |
51 | .handler = timer_interrupt, | 55 | .handler = timer_interrupt, |
@@ -55,11 +59,11 @@ static struct irqaction timer_irqaction = { | |||
55 | 59 | ||
56 | void __init time_init(void) | 60 | void __init time_init(void) |
57 | { | 61 | { |
58 | time_t sec_o, sec_n = 0; | 62 | xtime.tv_nsec = 0; |
63 | xtime.tv_sec = read_persistent_clock(); | ||
59 | 64 | ||
60 | /* The platform must provide a function to calibrate the processor | 65 | set_normalized_timespec(&wall_to_monotonic, |
61 | * speed for the CALIBRATE. | 66 | -xtime.tv_sec, -xtime.tv_nsec); |
62 | */ | ||
63 | 67 | ||
64 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT | 68 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT |
65 | printk("Calibrating CPU frequency "); | 69 | printk("Calibrating CPU frequency "); |
@@ -67,19 +71,10 @@ void __init time_init(void) | |||
67 | printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ), | 71 | printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ), |
68 | (int)(ccount_per_jiffy/(10000/HZ))%100); | 72 | (int)(ccount_per_jiffy/(10000/HZ))%100); |
69 | #endif | 73 | #endif |
70 | 74 | ccount_clocksource.mult = | |
71 | /* Set time from RTC (if provided) */ | 75 | clocksource_hz2mult(CCOUNT_PER_JIFFY * HZ, |
72 | 76 | ccount_clocksource.shift); | |
73 | if (platform_get_rtc_time(&sec_o) == 0) | 77 | clocksource_register(&ccount_clocksource); |
74 | while (platform_get_rtc_time(&sec_n)) | ||
75 | if (sec_o != sec_n) | ||
76 | break; | ||
77 | |||
78 | xtime.tv_nsec = 0; | ||
79 | last_rtc_update = xtime.tv_sec = sec_n; | ||
80 | |||
81 | set_normalized_timespec(&wall_to_monotonic, | ||
82 | -xtime.tv_sec, -xtime.tv_nsec); | ||
83 | 78 | ||
84 | /* Initialize the linux timer interrupt. */ | 79 | /* Initialize the linux timer interrupt. */ |
85 | 80 | ||
@@ -87,69 +82,6 @@ void __init time_init(void) | |||
87 | set_linux_timer(get_ccount() + CCOUNT_PER_JIFFY); | 82 | set_linux_timer(get_ccount() + CCOUNT_PER_JIFFY); |
88 | } | 83 | } |
89 | 84 | ||
90 | |||
91 | int do_settimeofday(struct timespec *tv) | ||
92 | { | ||
93 | time_t wtm_sec, sec = tv->tv_sec; | ||
94 | long wtm_nsec, nsec = tv->tv_nsec; | ||
95 | unsigned long delta; | ||
96 | |||
97 | if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) | ||
98 | return -EINVAL; | ||
99 | |||
100 | write_seqlock_irq(&xtime_lock); | ||
101 | |||
102 | /* This is revolting. We need to set "xtime" correctly. However, the | ||
103 | * value in this location is the value at the most recent update of | ||
104 | * wall time. Discover what correction gettimeofday() would have | ||
105 | * made, and then undo it! | ||
106 | */ | ||
107 | |||
108 | delta = CCOUNT_PER_JIFFY; | ||
109 | delta += get_ccount() - get_linux_timer(); | ||
110 | nsec -= delta * NSEC_PER_CCOUNT; | ||
111 | |||
112 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); | ||
113 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); | ||
114 | |||
115 | set_normalized_timespec(&xtime, sec, nsec); | ||
116 | set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); | ||
117 | |||
118 | ntp_clear(); | ||
119 | write_sequnlock_irq(&xtime_lock); | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | EXPORT_SYMBOL(do_settimeofday); | ||
124 | |||
125 | |||
126 | void do_gettimeofday(struct timeval *tv) | ||
127 | { | ||
128 | unsigned long flags; | ||
129 | unsigned long volatile sec, usec, delta, seq; | ||
130 | |||
131 | do { | ||
132 | seq = read_seqbegin_irqsave(&xtime_lock, flags); | ||
133 | |||
134 | sec = xtime.tv_sec; | ||
135 | usec = (xtime.tv_nsec / NSEC_PER_USEC); | ||
136 | |||
137 | delta = get_linux_timer() - get_ccount(); | ||
138 | |||
139 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); | ||
140 | |||
141 | usec += (((unsigned long) CCOUNT_PER_JIFFY - delta) | ||
142 | * (unsigned long) NSEC_PER_CCOUNT) / NSEC_PER_USEC; | ||
143 | |||
144 | for (; usec >= 1000000; sec++, usec -= 1000000) | ||
145 | ; | ||
146 | |||
147 | tv->tv_sec = sec; | ||
148 | tv->tv_usec = usec; | ||
149 | } | ||
150 | |||
151 | EXPORT_SYMBOL(do_gettimeofday); | ||
152 | |||
153 | /* | 85 | /* |
154 | * The timer interrupt is called HZ times per second. | 86 | * The timer interrupt is called HZ times per second. |
155 | */ | 87 | */ |
@@ -178,16 +110,6 @@ again: | |||
178 | next += CCOUNT_PER_JIFFY; | 110 | next += CCOUNT_PER_JIFFY; |
179 | set_linux_timer(next); | 111 | set_linux_timer(next); |
180 | 112 | ||
181 | if (ntp_synced() && | ||
182 | xtime.tv_sec - last_rtc_update >= 659 && | ||
183 | abs((xtime.tv_nsec/1000)-(1000000-1000000/HZ))<5000000/HZ) { | ||
184 | |||
185 | if (platform_set_rtc_time(xtime.tv_sec+1) == 0) | ||
186 | last_rtc_update = xtime.tv_sec+1; | ||
187 | else | ||
188 | /* Do it again in 60 s */ | ||
189 | last_rtc_update += 60; | ||
190 | } | ||
191 | write_sequnlock(&xtime_lock); | 113 | write_sequnlock(&xtime_lock); |
192 | } | 114 | } |
193 | 115 | ||
@@ -213,4 +135,3 @@ void __cpuinit calibrate_delay(void) | |||
213 | (loops_per_jiffy/(10000/HZ)) % 100); | 135 | (loops_per_jiffy/(10000/HZ)) % 100); |
214 | } | 136 | } |
215 | #endif | 137 | #endif |
216 | |||
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c index c44f830b6c7a..9f0b71189e94 100644 --- a/arch/xtensa/kernel/traps.c +++ b/arch/xtensa/kernel/traps.c | |||
@@ -104,6 +104,7 @@ static dispatch_init_table_t __initdata dispatch_init_table[] = { | |||
104 | #endif | 104 | #endif |
105 | { EXCCAUSE_UNALIGNED, KRNL, fast_unaligned }, | 105 | { EXCCAUSE_UNALIGNED, KRNL, fast_unaligned }, |
106 | #endif | 106 | #endif |
107 | #ifdef CONFIG_MMU | ||
107 | { EXCCAUSE_ITLB_MISS, 0, do_page_fault }, | 108 | { EXCCAUSE_ITLB_MISS, 0, do_page_fault }, |
108 | { EXCCAUSE_ITLB_MISS, USER|KRNL, fast_second_level_miss}, | 109 | { EXCCAUSE_ITLB_MISS, USER|KRNL, fast_second_level_miss}, |
109 | { EXCCAUSE_ITLB_MULTIHIT, 0, do_multihit }, | 110 | { EXCCAUSE_ITLB_MULTIHIT, 0, do_multihit }, |
@@ -118,6 +119,7 @@ static dispatch_init_table_t __initdata dispatch_init_table[] = { | |||
118 | { EXCCAUSE_STORE_CACHE_ATTRIBUTE, USER|KRNL, fast_store_prohibited }, | 119 | { EXCCAUSE_STORE_CACHE_ATTRIBUTE, USER|KRNL, fast_store_prohibited }, |
119 | { EXCCAUSE_STORE_CACHE_ATTRIBUTE, 0, do_page_fault }, | 120 | { EXCCAUSE_STORE_CACHE_ATTRIBUTE, 0, do_page_fault }, |
120 | { EXCCAUSE_LOAD_CACHE_ATTRIBUTE, 0, do_page_fault }, | 121 | { EXCCAUSE_LOAD_CACHE_ATTRIBUTE, 0, do_page_fault }, |
122 | #endif /* CONFIG_MMU */ | ||
121 | /* XCCHAL_EXCCAUSE_FLOATING_POINT unhandled */ | 123 | /* XCCHAL_EXCCAUSE_FLOATING_POINT unhandled */ |
122 | #if XTENSA_HAVE_COPROCESSOR(0) | 124 | #if XTENSA_HAVE_COPROCESSOR(0) |
123 | COPROCESSOR(0), | 125 | COPROCESSOR(0), |
@@ -372,11 +374,10 @@ void show_trace(struct task_struct *task, unsigned long *sp) | |||
372 | unsigned long a0, a1, pc; | 374 | unsigned long a0, a1, pc; |
373 | unsigned long sp_start, sp_end; | 375 | unsigned long sp_start, sp_end; |
374 | 376 | ||
375 | a1 = (unsigned long)sp; | 377 | if (sp) |
376 | 378 | a1 = (unsigned long)sp; | |
377 | if (a1 == 0) | 379 | else |
378 | __asm__ __volatile__ ("mov %0, a1\n" : "=a"(a1)); | 380 | a1 = task->thread.sp; |
379 | |||
380 | 381 | ||
381 | sp_start = a1 & ~(THREAD_SIZE-1); | 382 | sp_start = a1 & ~(THREAD_SIZE-1); |
382 | sp_end = sp_start + THREAD_SIZE; | 383 | sp_end = sp_start + THREAD_SIZE; |
@@ -418,9 +419,8 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
418 | int i = 0; | 419 | int i = 0; |
419 | unsigned long *stack; | 420 | unsigned long *stack; |
420 | 421 | ||
421 | if (sp == 0) | 422 | if (!sp) |
422 | __asm__ __volatile__ ("mov %0, a1\n" : "=a"(sp)); | 423 | sp = (unsigned long *)task->thread.sp; |
423 | |||
424 | stack = sp; | 424 | stack = sp; |
425 | 425 | ||
426 | printk("\nStack: "); | 426 | printk("\nStack: "); |
diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S index eb2d7bb69ee0..74a7518faf16 100644 --- a/arch/xtensa/kernel/vectors.S +++ b/arch/xtensa/kernel/vectors.S | |||
@@ -309,6 +309,7 @@ ENTRY(_DoubleExceptionVector) | |||
309 | * All other exceptions are unexpected and thus unrecoverable! | 309 | * All other exceptions are unexpected and thus unrecoverable! |
310 | */ | 310 | */ |
311 | 311 | ||
312 | #ifdef CONFIG_MMU | ||
312 | .extern fast_second_level_miss_double_kernel | 313 | .extern fast_second_level_miss_double_kernel |
313 | 314 | ||
314 | .Lksp: /* a0: a0, a1: a1, a2: a2, a3: trashed, depc: depc, excsave: a3 */ | 315 | .Lksp: /* a0: a0, a1: a1, a2: a2, a3: trashed, depc: depc, excsave: a3 */ |
@@ -319,6 +320,9 @@ ENTRY(_DoubleExceptionVector) | |||
319 | bnez a3, .Lunrecoverable | 320 | bnez a3, .Lunrecoverable |
320 | 1: movi a3, fast_second_level_miss_double_kernel | 321 | 1: movi a3, fast_second_level_miss_double_kernel |
321 | jx a3 | 322 | jx a3 |
323 | #else | ||
324 | .equ .Lksp, .Lunrecoverable | ||
325 | #endif | ||
322 | 326 | ||
323 | /* Critical! We can't handle this situation. PANIC! */ | 327 | /* Critical! We can't handle this situation. PANIC! */ |
324 | 328 | ||
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index d506774f4b05..c1be9a4a740c 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm-generic/vmlinux.lds.h> | 17 | #include <asm-generic/vmlinux.lds.h> |
18 | 18 | ||
19 | #include <variant/core.h> | 19 | #include <variant/core.h> |
20 | #include <platform/hardware.h> | ||
20 | OUTPUT_ARCH(xtensa) | 21 | OUTPUT_ARCH(xtensa) |
21 | ENTRY(_start) | 22 | ENTRY(_start) |
22 | 23 | ||
@@ -26,7 +27,9 @@ jiffies = jiffies_64 + 4; | |||
26 | jiffies = jiffies_64; | 27 | jiffies = jiffies_64; |
27 | #endif | 28 | #endif |
28 | 29 | ||
30 | #ifndef KERNELOFFSET | ||
29 | #define KERNELOFFSET 0xd0001000 | 31 | #define KERNELOFFSET 0xd0001000 |
32 | #endif | ||
30 | 33 | ||
31 | /* Note: In the following macros, it would be nice to specify only the | 34 | /* Note: In the following macros, it would be nice to specify only the |
32 | vector name and section kind and construct "sym" and "section" using | 35 | vector name and section kind and construct "sym" and "section" using |
diff --git a/arch/xtensa/mm/Makefile b/arch/xtensa/mm/Makefile index 64e304a2f884..f0b646d2f843 100644 --- a/arch/xtensa/mm/Makefile +++ b/arch/xtensa/mm/Makefile | |||
@@ -2,4 +2,5 @@ | |||
2 | # Makefile for the Linux/Xtensa-specific parts of the memory manager. | 2 | # Makefile for the Linux/Xtensa-specific parts of the memory manager. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := init.o fault.o tlb.o misc.o cache.o | 5 | obj-y := init.o cache.o misc.o |
6 | obj-$(CONFIG_MMU) += fault.o mmu.o tlb.o | ||
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index 34163cfaaffc..427e14fa43c5 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c | |||
@@ -24,15 +24,8 @@ | |||
24 | #include <linux/mm.h> | 24 | #include <linux/mm.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | 26 | ||
27 | #include <asm/pgtable.h> | ||
28 | #include <asm/bootparam.h> | 27 | #include <asm/bootparam.h> |
29 | #include <asm/mmu_context.h> | ||
30 | #include <asm/tlb.h> | ||
31 | #include <asm/page.h> | 28 | #include <asm/page.h> |
32 | #include <asm/pgalloc.h> | ||
33 | |||
34 | |||
35 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | ||
36 | 29 | ||
37 | /* References to section boundaries */ | 30 | /* References to section boundaries */ |
38 | 31 | ||
@@ -130,7 +123,8 @@ void __init bootmem_init(void) | |||
130 | 123 | ||
131 | /* Find an area to use for the bootmem bitmap. */ | 124 | /* Find an area to use for the bootmem bitmap. */ |
132 | 125 | ||
133 | bootmap_size = bootmem_bootmap_pages(max_low_pfn) << PAGE_SHIFT; | 126 | bootmap_size = bootmem_bootmap_pages(max_low_pfn - min_low_pfn); |
127 | bootmap_size <<= PAGE_SHIFT; | ||
134 | bootmap_start = ~0; | 128 | bootmap_start = ~0; |
135 | 129 | ||
136 | for (i=0; i<sysmem.nr_banks; i++) | 130 | for (i=0; i<sysmem.nr_banks; i++) |
@@ -145,8 +139,9 @@ void __init bootmem_init(void) | |||
145 | /* Reserve the bootmem bitmap area */ | 139 | /* Reserve the bootmem bitmap area */ |
146 | 140 | ||
147 | mem_reserve(bootmap_start, bootmap_start + bootmap_size, 1); | 141 | mem_reserve(bootmap_start, bootmap_start + bootmap_size, 1); |
148 | bootmap_size = init_bootmem_node(NODE_DATA(0), min_low_pfn, | 142 | bootmap_size = init_bootmem_node(NODE_DATA(0), |
149 | bootmap_start >> PAGE_SHIFT, | 143 | bootmap_start >> PAGE_SHIFT, |
144 | min_low_pfn, | ||
150 | max_low_pfn); | 145 | max_low_pfn); |
151 | 146 | ||
152 | /* Add all remaining memory pieces into the bootmem map */ | 147 | /* Add all remaining memory pieces into the bootmem map */ |
@@ -158,14 +153,14 @@ void __init bootmem_init(void) | |||
158 | } | 153 | } |
159 | 154 | ||
160 | 155 | ||
161 | void __init paging_init(void) | 156 | void __init zones_init(void) |
162 | { | 157 | { |
163 | unsigned long zones_size[MAX_NR_ZONES]; | 158 | unsigned long zones_size[MAX_NR_ZONES]; |
164 | int i; | 159 | int i; |
165 | 160 | ||
166 | /* All pages are DMA-able, so we put them all in the DMA zone. */ | 161 | /* All pages are DMA-able, so we put them all in the DMA zone. */ |
167 | 162 | ||
168 | zones_size[ZONE_DMA] = max_low_pfn; | 163 | zones_size[ZONE_DMA] = max_low_pfn - ARCH_PFN_OFFSET; |
169 | for (i = 1; i < MAX_NR_ZONES; i++) | 164 | for (i = 1; i < MAX_NR_ZONES; i++) |
170 | zones_size[i] = 0; | 165 | zones_size[i] = 0; |
171 | 166 | ||
@@ -173,40 +168,7 @@ void __init paging_init(void) | |||
173 | zones_size[ZONE_HIGHMEM] = max_pfn - max_low_pfn; | 168 | zones_size[ZONE_HIGHMEM] = max_pfn - max_low_pfn; |
174 | #endif | 169 | #endif |
175 | 170 | ||
176 | /* Initialize the kernel's page tables. */ | 171 | free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL); |
177 | |||
178 | memset(swapper_pg_dir, 0, PAGE_SIZE); | ||
179 | |||
180 | free_area_init(zones_size); | ||
181 | } | ||
182 | |||
183 | /* | ||
184 | * Flush the mmu and reset associated register to default values. | ||
185 | */ | ||
186 | |||
187 | void __init init_mmu (void) | ||
188 | { | ||
189 | /* Writing zeros to the <t>TLBCFG special registers ensure | ||
190 | * that valid values exist in the register. For existing | ||
191 | * PGSZID<w> fields, zero selects the first element of the | ||
192 | * page-size array. For nonexistent PGSZID<w> fields, zero is | ||
193 | * the best value to write. Also, when changing PGSZID<w> | ||
194 | * fields, the corresponding TLB must be flushed. | ||
195 | */ | ||
196 | set_itlbcfg_register (0); | ||
197 | set_dtlbcfg_register (0); | ||
198 | flush_tlb_all (); | ||
199 | |||
200 | /* Set rasid register to a known value. */ | ||
201 | |||
202 | set_rasid_register (ASID_USER_FIRST); | ||
203 | |||
204 | /* Set PTEVADDR special register to the start of the page | ||
205 | * table, which is in kernel mappable space (ie. not | ||
206 | * statically mapped). This register's value is undefined on | ||
207 | * reset. | ||
208 | */ | ||
209 | set_ptevaddr_register (PGTABLE_START); | ||
210 | } | 172 | } |
211 | 173 | ||
212 | /* | 174 | /* |
@@ -218,8 +180,8 @@ void __init mem_init(void) | |||
218 | unsigned long codesize, reservedpages, datasize, initsize; | 180 | unsigned long codesize, reservedpages, datasize, initsize; |
219 | unsigned long highmemsize, tmp, ram; | 181 | unsigned long highmemsize, tmp, ram; |
220 | 182 | ||
221 | max_mapnr = num_physpages = max_low_pfn; | 183 | max_mapnr = num_physpages = max_low_pfn - ARCH_PFN_OFFSET; |
222 | high_memory = (void *) __va(max_mapnr << PAGE_SHIFT); | 184 | high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); |
223 | highmemsize = 0; | 185 | highmemsize = 0; |
224 | 186 | ||
225 | #ifdef CONFIG_HIGHMEM | 187 | #ifdef CONFIG_HIGHMEM |
@@ -229,7 +191,7 @@ void __init mem_init(void) | |||
229 | totalram_pages += free_all_bootmem(); | 191 | totalram_pages += free_all_bootmem(); |
230 | 192 | ||
231 | reservedpages = ram = 0; | 193 | reservedpages = ram = 0; |
232 | for (tmp = 0; tmp < max_low_pfn; tmp++) { | 194 | for (tmp = 0; tmp < max_mapnr; tmp++) { |
233 | ram++; | 195 | ram++; |
234 | if (PageReserved(mem_map+tmp)) | 196 | if (PageReserved(mem_map+tmp)) |
235 | reservedpages++; | 197 | reservedpages++; |
@@ -279,23 +241,3 @@ void free_initmem(void) | |||
279 | printk("Freeing unused kernel memory: %dk freed\n", | 241 | printk("Freeing unused kernel memory: %dk freed\n", |
280 | (&__init_end - &__init_begin) >> 10); | 242 | (&__init_end - &__init_begin) >> 10); |
281 | } | 243 | } |
282 | |||
283 | struct kmem_cache *pgtable_cache __read_mostly; | ||
284 | |||
285 | static void pgd_ctor(void* addr) | ||
286 | { | ||
287 | pte_t* ptep = (pte_t*)addr; | ||
288 | int i; | ||
289 | |||
290 | for (i = 0; i < 1024; i++, ptep++) | ||
291 | pte_clear(NULL, 0, ptep); | ||
292 | |||
293 | } | ||
294 | |||
295 | void __init pgtable_cache_init(void) | ||
296 | { | ||
297 | pgtable_cache = kmem_cache_create("pgd", | ||
298 | PAGE_SIZE, PAGE_SIZE, | ||
299 | SLAB_HWCACHE_ALIGN, | ||
300 | pgd_ctor); | ||
301 | } | ||
diff --git a/arch/xtensa/mm/misc.S b/arch/xtensa/mm/misc.S index c885664211d1..b048406d8756 100644 --- a/arch/xtensa/mm/misc.S +++ b/arch/xtensa/mm/misc.S | |||
@@ -84,6 +84,7 @@ ENTRY(copy_page) | |||
84 | 84 | ||
85 | retw | 85 | retw |
86 | 86 | ||
87 | #ifdef CONFIG_MMU | ||
87 | /* | 88 | /* |
88 | * If we have to deal with cache aliasing, we use temporary memory mappings | 89 | * If we have to deal with cache aliasing, we use temporary memory mappings |
89 | * to ensure that the source and destination pages have the same color as | 90 | * to ensure that the source and destination pages have the same color as |
@@ -311,6 +312,7 @@ ENTRY(__invalidate_icache_page_alias) | |||
311 | /* End of special treatment in tlb miss exception */ | 312 | /* End of special treatment in tlb miss exception */ |
312 | 313 | ||
313 | ENTRY(__tlbtemp_mapping_end) | 314 | ENTRY(__tlbtemp_mapping_end) |
315 | #endif /* CONFIG_MMU | ||
314 | 316 | ||
315 | /* | 317 | /* |
316 | * void __invalidate_icache_page(ulong start) | 318 | * void __invalidate_icache_page(ulong start) |
diff --git a/arch/xtensa/mm/mmu.c b/arch/xtensa/mm/mmu.c new file mode 100644 index 000000000000..4bb91a970f1f --- /dev/null +++ b/arch/xtensa/mm/mmu.c | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * xtensa mmu stuff | ||
3 | * | ||
4 | * Extracted from init.c | ||
5 | */ | ||
6 | #include <linux/percpu.h> | ||
7 | #include <linux/init.h> | ||
8 | #include <linux/string.h> | ||
9 | #include <linux/slab.h> | ||
10 | #include <linux/cache.h> | ||
11 | |||
12 | #include <asm/tlb.h> | ||
13 | #include <asm/tlbflush.h> | ||
14 | #include <asm/mmu_context.h> | ||
15 | #include <asm/page.h> | ||
16 | |||
17 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | ||
18 | |||
19 | void __init paging_init(void) | ||
20 | { | ||
21 | memset(swapper_pg_dir, 0, PAGE_SIZE); | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | * Flush the mmu and reset associated register to default values. | ||
26 | */ | ||
27 | void __init init_mmu(void) | ||
28 | { | ||
29 | /* Writing zeros to the <t>TLBCFG special registers ensure | ||
30 | * that valid values exist in the register. For existing | ||
31 | * PGSZID<w> fields, zero selects the first element of the | ||
32 | * page-size array. For nonexistent PGSZID<w> fields, zero is | ||
33 | * the best value to write. Also, when changing PGSZID<w> | ||
34 | * fields, the corresponding TLB must be flushed. | ||
35 | */ | ||
36 | set_itlbcfg_register(0); | ||
37 | set_dtlbcfg_register(0); | ||
38 | flush_tlb_all(); | ||
39 | |||
40 | /* Set rasid register to a known value. */ | ||
41 | |||
42 | set_rasid_register(ASID_USER_FIRST); | ||
43 | |||
44 | /* Set PTEVADDR special register to the start of the page | ||
45 | * table, which is in kernel mappable space (ie. not | ||
46 | * statically mapped). This register's value is undefined on | ||
47 | * reset. | ||
48 | */ | ||
49 | set_ptevaddr_register(PGTABLE_START); | ||
50 | } | ||
51 | |||
52 | struct kmem_cache *pgtable_cache __read_mostly; | ||
53 | |||
54 | static void pgd_ctor(void *addr) | ||
55 | { | ||
56 | pte_t *ptep = (pte_t *)addr; | ||
57 | int i; | ||
58 | |||
59 | for (i = 0; i < 1024; i++, ptep++) | ||
60 | pte_clear(NULL, 0, ptep); | ||
61 | |||
62 | } | ||
63 | |||
64 | void __init pgtable_cache_init(void) | ||
65 | { | ||
66 | pgtable_cache = kmem_cache_create("pgd", | ||
67 | PAGE_SIZE, PAGE_SIZE, | ||
68 | SLAB_HWCACHE_ALIGN, | ||
69 | pgd_ctor); | ||
70 | } | ||
diff --git a/arch/xtensa/platforms/s6105/Makefile b/arch/xtensa/platforms/s6105/Makefile new file mode 100644 index 000000000000..0be6194bcb72 --- /dev/null +++ b/arch/xtensa/platforms/s6105/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | # Makefile for the Stretch S6105 eval board | ||
2 | |||
3 | obj-y := setup.o device.o | ||
diff --git a/arch/xtensa/platforms/s6105/device.c b/arch/xtensa/platforms/s6105/device.c new file mode 100644 index 000000000000..78b08be5a92d --- /dev/null +++ b/arch/xtensa/platforms/s6105/device.c | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * s6105 platform devices | ||
3 | * | ||
4 | * Copyright (c) 2009 emlix GmbH | ||
5 | */ | ||
6 | |||
7 | #include <linux/kernel.h> | ||
8 | #include <linux/init.h> | ||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/serial.h> | ||
11 | #include <linux/serial_8250.h> | ||
12 | |||
13 | #include <variant/hardware.h> | ||
14 | |||
15 | #define UART_INTNUM 4 | ||
16 | |||
17 | static const signed char uart_irq_mappings[] = { | ||
18 | S6_INTC_UART(0), | ||
19 | S6_INTC_UART(1), | ||
20 | -1, | ||
21 | }; | ||
22 | |||
23 | const signed char *platform_irq_mappings[NR_IRQS] = { | ||
24 | [UART_INTNUM] = uart_irq_mappings, | ||
25 | }; | ||
26 | |||
27 | static struct plat_serial8250_port serial_platform_data[] = { | ||
28 | { | ||
29 | .membase = (void *)S6_REG_UART + 0x0000, | ||
30 | .mapbase = S6_REG_UART + 0x0000, | ||
31 | .irq = UART_INTNUM, | ||
32 | .uartclk = S6_SCLK, | ||
33 | .regshift = 2, | ||
34 | .iotype = SERIAL_IO_MEM, | ||
35 | .flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST, | ||
36 | }, | ||
37 | { | ||
38 | .membase = (void *)S6_REG_UART + 0x1000, | ||
39 | .mapbase = S6_REG_UART + 0x1000, | ||
40 | .irq = UART_INTNUM, | ||
41 | .uartclk = S6_SCLK, | ||
42 | .regshift = 2, | ||
43 | .iotype = SERIAL_IO_MEM, | ||
44 | .flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST, | ||
45 | }, | ||
46 | { }, | ||
47 | }; | ||
48 | |||
49 | static struct platform_device platform_devices[] = { | ||
50 | { | ||
51 | .name = "serial8250", | ||
52 | .id = PLAT8250_DEV_PLATFORM, | ||
53 | .dev = { | ||
54 | .platform_data = serial_platform_data, | ||
55 | }, | ||
56 | }, | ||
57 | }; | ||
58 | |||
59 | static int __init device_init(void) | ||
60 | { | ||
61 | int i; | ||
62 | |||
63 | for (i = 0; i < ARRAY_SIZE(platform_devices); i++) | ||
64 | platform_device_register(&platform_devices[i]); | ||
65 | return 0; | ||
66 | } | ||
67 | arch_initcall_sync(device_init); | ||
diff --git a/arch/xtensa/platforms/s6105/include/platform/gpio.h b/arch/xtensa/platforms/s6105/include/platform/gpio.h new file mode 100644 index 000000000000..fa11aa4b61e9 --- /dev/null +++ b/arch/xtensa/platforms/s6105/include/platform/gpio.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef __ASM_XTENSA_S6105_GPIO_H | ||
2 | #define __ASM_XTENSA_S6105_GPIO_H | ||
3 | |||
4 | #define GPIO_BP_TEMP_ALARM 0 | ||
5 | #define GPIO_PB_RESET_IN 1 | ||
6 | #define GPIO_EXP_IRQ 2 | ||
7 | #define GPIO_TRIGGER_IRQ 3 | ||
8 | #define GPIO_RTC_IRQ 4 | ||
9 | #define GPIO_PHY_IRQ 5 | ||
10 | #define GPIO_IMAGER_RESET 6 | ||
11 | #define GPIO_SD_IRQ 7 | ||
12 | #define GPIO_MINI_BOOT_INH 8 | ||
13 | #define GPIO_BOARD_RESET 9 | ||
14 | #define GPIO_EXP_PRESENT 10 | ||
15 | #define GPIO_LED1_NGREEN 12 | ||
16 | #define GPIO_LED1_RED 13 | ||
17 | #define GPIO_LED0_NGREEN 14 | ||
18 | #define GPIO_LED0_NRED 15 | ||
19 | #define GPIO_SPI_CS0 16 | ||
20 | #define GPIO_SPI_CS1 17 | ||
21 | #define GPIO_SPI_CS3 19 | ||
22 | #define GPIO_SPI_CS4 20 | ||
23 | #define GPIO_SD_WP 21 | ||
24 | #define GPIO_BP_RESET 22 | ||
25 | #define GPIO_ALARM_OUT 23 | ||
26 | |||
27 | #endif /* __ASM_XTENSA_S6105_GPIO_H */ | ||
diff --git a/arch/xtensa/platforms/s6105/include/platform/hardware.h b/arch/xtensa/platforms/s6105/include/platform/hardware.h new file mode 100644 index 000000000000..d628efac7089 --- /dev/null +++ b/arch/xtensa/platforms/s6105/include/platform/hardware.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef __XTENSA_S6105_HARDWARE_H | ||
2 | #define __XTENSA_S6105_HARDWARE_H | ||
3 | |||
4 | #define PLATFORM_DEFAULT_MEM_START 0x40000000 | ||
5 | #define PLATFORM_DEFAULT_MEM_SIZE 0x08000000 | ||
6 | |||
7 | #define MAX_DMA_ADDRESS 0 | ||
8 | |||
9 | #define KERNELOFFSET (PLATFORM_DEFAULT_MEM_START + 0x1000) | ||
10 | |||
11 | #endif /* __XTENSA_S6105_HARDWARE_H */ | ||
diff --git a/arch/xtensa/platforms/s6105/include/platform/serial.h b/arch/xtensa/platforms/s6105/include/platform/serial.h new file mode 100644 index 000000000000..c8a771e5981b --- /dev/null +++ b/arch/xtensa/platforms/s6105/include/platform/serial.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __ASM_XTENSA_S6105_SERIAL_H | ||
2 | #define __ASM_XTENSA_S6105_SERIAL_H | ||
3 | |||
4 | #include <variant/hardware.h> | ||
5 | |||
6 | #define BASE_BAUD (S6_SCLK / 16) | ||
7 | |||
8 | #endif /* __ASM_XTENSA_S6105_SERIAL_H */ | ||
diff --git a/arch/xtensa/platforms/s6105/setup.c b/arch/xtensa/platforms/s6105/setup.c new file mode 100644 index 000000000000..ae041d5027a2 --- /dev/null +++ b/arch/xtensa/platforms/s6105/setup.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * s6105 control routines | ||
3 | * | ||
4 | * Copyright (c) 2009 emlix GmbH | ||
5 | */ | ||
6 | #include <linux/irq.h> | ||
7 | #include <linux/io.h> | ||
8 | #include <linux/gpio.h> | ||
9 | |||
10 | #include <asm/bootparam.h> | ||
11 | |||
12 | #include <variant/hardware.h> | ||
13 | #include <platform/gpio.h> | ||
14 | |||
15 | void platform_halt(void) | ||
16 | { | ||
17 | local_irq_disable(); | ||
18 | while (1) | ||
19 | ; | ||
20 | } | ||
21 | |||
22 | void platform_power_off(void) | ||
23 | { | ||
24 | platform_halt(); | ||
25 | } | ||
26 | |||
27 | void platform_restart(void) | ||
28 | { | ||
29 | platform_halt(); | ||
30 | } | ||
31 | |||
32 | void __init platform_setup(char **cmdline) | ||
33 | { | ||
34 | unsigned long reg; | ||
35 | |||
36 | reg = readl(S6_REG_GREG1 + S6_GREG1_CLKGATE); | ||
37 | reg &= ~(1 << S6_GREG1_BLOCK_SB); | ||
38 | writel(reg, S6_REG_GREG1 + S6_GREG1_CLKGATE); | ||
39 | |||
40 | reg = readl(S6_REG_GREG1 + S6_GREG1_BLOCKENA); | ||
41 | reg |= 1 << S6_GREG1_BLOCK_SB; | ||
42 | writel(reg, S6_REG_GREG1 + S6_GREG1_BLOCKENA); | ||
43 | |||
44 | printk(KERN_NOTICE "S6105 on Stretch S6000 - " | ||
45 | "Copyright (C) 2009 emlix GmbH <info@emlix.com>\n"); | ||
46 | } | ||
47 | |||
48 | void __init platform_init(bp_tag_t *first) | ||
49 | { | ||
50 | gpio_request(GPIO_LED1_NGREEN, "led1_green"); | ||
51 | gpio_request(GPIO_LED1_RED, "led1_red"); | ||
52 | gpio_direction_output(GPIO_LED1_NGREEN, 1); | ||
53 | } | ||
54 | |||
55 | void platform_heartbeat(void) | ||
56 | { | ||
57 | static unsigned int c; | ||
58 | |||
59 | if (!(++c & 0x4F)) | ||
60 | gpio_direction_output(GPIO_LED1_RED, !(c & 0x10)); | ||
61 | } | ||
diff --git a/arch/xtensa/platforms/xt2000/include/platform/hardware.h b/arch/xtensa/platforms/xt2000/include/platform/hardware.h index 41459ad07766..886ef156ded3 100644 --- a/arch/xtensa/platforms/xt2000/include/platform/hardware.h +++ b/arch/xtensa/platforms/xt2000/include/platform/hardware.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #define _XTENSA_XT2000_HARDWARE_H | 16 | #define _XTENSA_XT2000_HARDWARE_H |
17 | 17 | ||
18 | #include <variant/core.h> | 18 | #include <variant/core.h> |
19 | #include <asm/io.h> | ||
20 | 19 | ||
21 | /* | 20 | /* |
22 | * Memory configuration. | 21 | * Memory configuration. |
diff --git a/arch/xtensa/variants/s6000/Makefile b/arch/xtensa/variants/s6000/Makefile new file mode 100644 index 000000000000..03b3975468bd --- /dev/null +++ b/arch/xtensa/variants/s6000/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | # s6000 Makefile | ||
2 | |||
3 | obj-y += irq.o gpio.o | ||
diff --git a/arch/xtensa/variants/s6000/gpio.c b/arch/xtensa/variants/s6000/gpio.c new file mode 100644 index 000000000000..33a8d952934c --- /dev/null +++ b/arch/xtensa/variants/s6000/gpio.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * s6000 gpio driver | ||
3 | * | ||
4 | * Copyright (c) 2009 emlix GmbH | ||
5 | * Authors: Oskar Schirmer <os@emlix.com> | ||
6 | * Johannes Weiner <jw@emlix.com> | ||
7 | */ | ||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/module.h> | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/io.h> | ||
12 | #include <linux/gpio.h> | ||
13 | |||
14 | #include <variant/hardware.h> | ||
15 | |||
16 | #define S6_GPIO_DATA 0x000 | ||
17 | #define S6_GPIO_IS 0x404 | ||
18 | #define S6_GPIO_IBE 0x408 | ||
19 | #define S6_GPIO_IEV 0x40C | ||
20 | #define S6_GPIO_IE 0x410 | ||
21 | #define S6_GPIO_RIS 0x414 | ||
22 | #define S6_GPIO_MIS 0x418 | ||
23 | #define S6_GPIO_IC 0x41C | ||
24 | #define S6_GPIO_AFSEL 0x420 | ||
25 | #define S6_GPIO_DIR 0x800 | ||
26 | #define S6_GPIO_BANK(nr) ((nr) * 0x1000) | ||
27 | #define S6_GPIO_MASK(nr) (4 << (nr)) | ||
28 | #define S6_GPIO_OFFSET(nr) \ | ||
29 | (S6_GPIO_BANK((nr) >> 3) + S6_GPIO_MASK((nr) & 7)) | ||
30 | |||
31 | static int direction_input(struct gpio_chip *chip, unsigned int off) | ||
32 | { | ||
33 | writeb(0, S6_REG_GPIO + S6_GPIO_DIR + S6_GPIO_OFFSET(off)); | ||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | static int get(struct gpio_chip *chip, unsigned int off) | ||
38 | { | ||
39 | return readb(S6_REG_GPIO + S6_GPIO_DATA + S6_GPIO_OFFSET(off)); | ||
40 | } | ||
41 | |||
42 | static int direction_output(struct gpio_chip *chip, unsigned int off, int val) | ||
43 | { | ||
44 | unsigned rel = S6_GPIO_OFFSET(off); | ||
45 | writeb(~0, S6_REG_GPIO + S6_GPIO_DIR + rel); | ||
46 | writeb(val ? ~0 : 0, S6_REG_GPIO + S6_GPIO_DATA + rel); | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | static void set(struct gpio_chip *chip, unsigned int off, int val) | ||
51 | { | ||
52 | writeb(val ? ~0 : 0, S6_REG_GPIO + S6_GPIO_DATA + S6_GPIO_OFFSET(off)); | ||
53 | } | ||
54 | |||
55 | static struct gpio_chip gpiochip = { | ||
56 | .owner = THIS_MODULE, | ||
57 | .direction_input = direction_input, | ||
58 | .get = get, | ||
59 | .direction_output = direction_output, | ||
60 | .set = set, | ||
61 | .base = 0, | ||
62 | .ngpio = 24, | ||
63 | .can_sleep = 0, /* no blocking io needed */ | ||
64 | .exported = 0, /* no exporting to userspace */ | ||
65 | }; | ||
66 | |||
67 | static int gpio_init(void) | ||
68 | { | ||
69 | return gpiochip_add(&gpiochip); | ||
70 | } | ||
71 | device_initcall(gpio_init); | ||
diff --git a/arch/xtensa/variants/s6000/include/variant/core.h b/arch/xtensa/variants/s6000/include/variant/core.h new file mode 100644 index 000000000000..af007953027e --- /dev/null +++ b/arch/xtensa/variants/s6000/include/variant/core.h | |||
@@ -0,0 +1,431 @@ | |||
1 | /* | ||
2 | * Xtensa processor core configuration information. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (c) 1999-2008 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_CORE_CONFIGURATION_H | ||
12 | #define _XTENSA_CORE_CONFIGURATION_H | ||
13 | |||
14 | |||
15 | /**************************************************************************** | ||
16 | Parameters Useful for Any Code, USER or PRIVILEGED | ||
17 | ****************************************************************************/ | ||
18 | |||
19 | /* | ||
20 | * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is | ||
21 | * configured, and a value of 0 otherwise. These macros are always defined. | ||
22 | */ | ||
23 | |||
24 | |||
25 | /*---------------------------------------------------------------------- | ||
26 | ISA | ||
27 | ----------------------------------------------------------------------*/ | ||
28 | |||
29 | #define XCHAL_HAVE_BE 0 /* big-endian byte ordering */ | ||
30 | #define XCHAL_HAVE_WINDOWED 1 /* windowed registers option */ | ||
31 | #define XCHAL_NUM_AREGS 64 /* num of physical addr regs */ | ||
32 | #define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */ | ||
33 | #define XCHAL_MAX_INSTRUCTION_SIZE 8 /* max instr bytes (3..8) */ | ||
34 | #define XCHAL_HAVE_DEBUG 1 /* debug option */ | ||
35 | #define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */ | ||
36 | #define XCHAL_HAVE_LOOPS 1 /* zero-overhead loops */ | ||
37 | #define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */ | ||
38 | #define XCHAL_HAVE_MINMAX 1 /* MIN/MAX instructions */ | ||
39 | #define XCHAL_HAVE_SEXT 1 /* SEXT instruction */ | ||
40 | #define XCHAL_HAVE_CLAMPS 1 /* CLAMPS instruction */ | ||
41 | #define XCHAL_HAVE_MUL16 1 /* MUL16S/MUL16U instructions */ | ||
42 | #define XCHAL_HAVE_MUL32 1 /* MULL instruction */ | ||
43 | #define XCHAL_HAVE_MUL32_HIGH 1 /* MULUH/MULSH instructions */ | ||
44 | #define XCHAL_HAVE_DIV32 0 /* QUOS/QUOU/REMS/REMU instructions */ | ||
45 | #define XCHAL_HAVE_L32R 1 /* L32R instruction */ | ||
46 | #define XCHAL_HAVE_ABSOLUTE_LITERALS 1 /* non-PC-rel (extended) L32R */ | ||
47 | #define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */ | ||
48 | #define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */ | ||
49 | #define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */ | ||
50 | #define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */ | ||
51 | #define XCHAL_HAVE_CALL4AND12 1 /* (obsolete option) */ | ||
52 | #define XCHAL_HAVE_ABS 1 /* ABS instruction */ | ||
53 | /*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */ | ||
54 | /*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */ | ||
55 | #define XCHAL_HAVE_RELEASE_SYNC 0 /* L32AI/S32RI instructions */ | ||
56 | #define XCHAL_HAVE_S32C1I 0 /* S32C1I instruction */ | ||
57 | #define XCHAL_HAVE_SPECULATION 0 /* speculation */ | ||
58 | #define XCHAL_HAVE_FULL_RESET 0 /* all regs/state reset */ | ||
59 | #define XCHAL_NUM_CONTEXTS 1 /* */ | ||
60 | #define XCHAL_NUM_MISC_REGS 4 /* num of scratch regs (0..4) */ | ||
61 | #define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */ | ||
62 | #define XCHAL_HAVE_PRID 0 /* processor ID register */ | ||
63 | #define XCHAL_HAVE_THREADPTR 0 /* THREADPTR register */ | ||
64 | #define XCHAL_HAVE_BOOLEANS 1 /* boolean registers */ | ||
65 | #define XCHAL_HAVE_CP 1 /* CPENABLE reg (coprocessor) */ | ||
66 | #define XCHAL_CP_MAXCFG 8 /* max allowed cp id plus one */ | ||
67 | #define XCHAL_HAVE_MAC16 0 /* MAC16 package */ | ||
68 | #define XCHAL_HAVE_VECTORFPU2005 0 /* vector floating-point pkg */ | ||
69 | #define XCHAL_HAVE_FP 1 /* floating point pkg */ | ||
70 | #define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */ | ||
71 | #define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */ | ||
72 | #define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */ | ||
73 | |||
74 | |||
75 | /*---------------------------------------------------------------------- | ||
76 | MISC | ||
77 | ----------------------------------------------------------------------*/ | ||
78 | |||
79 | #define XCHAL_NUM_WRITEBUFFER_ENTRIES 8 /* size of write buffer */ | ||
80 | #define XCHAL_INST_FETCH_WIDTH 8 /* instr-fetch width in bytes */ | ||
81 | #define XCHAL_DATA_WIDTH 16 /* data width in bytes */ | ||
82 | /* In T1050, applies to selected core load and store instructions (see ISA): */ | ||
83 | #define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* unaligned loads cause exc. */ | ||
84 | #define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* unaligned stores cause exc.*/ | ||
85 | |||
86 | #define XCHAL_SW_VERSION 701001 /* sw version of this header */ | ||
87 | |||
88 | #define XCHAL_CORE_ID "stretch_bali" /* alphanum core name | ||
89 | (CoreID) set in the Xtensa | ||
90 | Processor Generator */ | ||
91 | |||
92 | #define XCHAL_BUILD_UNIQUE_ID 0x000104B9 /* 22-bit sw build ID */ | ||
93 | |||
94 | /* | ||
95 | * These definitions describe the hardware targeted by this software. | ||
96 | */ | ||
97 | #define XCHAL_HW_CONFIGID0 0xC2F3F9FE /* ConfigID hi 32 bits*/ | ||
98 | #define XCHAL_HW_CONFIGID1 0x054104B9 /* ConfigID lo 32 bits*/ | ||
99 | #define XCHAL_HW_VERSION_NAME "LX1.0.2" /* full version name */ | ||
100 | #define XCHAL_HW_VERSION_MAJOR 2100 /* major ver# of targeted hw */ | ||
101 | #define XCHAL_HW_VERSION_MINOR 2 /* minor ver# of targeted hw */ | ||
102 | #define XCHAL_HW_VERSION 210002 /* major*100+minor */ | ||
103 | #define XCHAL_HW_REL_LX1 1 | ||
104 | #define XCHAL_HW_REL_LX1_0 1 | ||
105 | #define XCHAL_HW_REL_LX1_0_2 1 | ||
106 | #define XCHAL_HW_CONFIGID_RELIABLE 1 | ||
107 | /* If software targets a *range* of hardware versions, these are the bounds: */ | ||
108 | #define XCHAL_HW_MIN_VERSION_MAJOR 2100 /* major v of earliest tgt hw */ | ||
109 | #define XCHAL_HW_MIN_VERSION_MINOR 2 /* minor v of earliest tgt hw */ | ||
110 | #define XCHAL_HW_MIN_VERSION 210002 /* earliest targeted hw */ | ||
111 | #define XCHAL_HW_MAX_VERSION_MAJOR 2100 /* major v of latest tgt hw */ | ||
112 | #define XCHAL_HW_MAX_VERSION_MINOR 2 /* minor v of latest tgt hw */ | ||
113 | #define XCHAL_HW_MAX_VERSION 210002 /* latest targeted hw */ | ||
114 | |||
115 | |||
116 | /*---------------------------------------------------------------------- | ||
117 | CACHE | ||
118 | ----------------------------------------------------------------------*/ | ||
119 | |||
120 | #define XCHAL_ICACHE_LINESIZE 16 /* I-cache line size in bytes */ | ||
121 | #define XCHAL_DCACHE_LINESIZE 16 /* D-cache line size in bytes */ | ||
122 | #define XCHAL_ICACHE_LINEWIDTH 4 /* log2(I line size in bytes) */ | ||
123 | #define XCHAL_DCACHE_LINEWIDTH 4 /* log2(D line size in bytes) */ | ||
124 | |||
125 | #define XCHAL_ICACHE_SIZE 32768 /* I-cache size in bytes or 0 */ | ||
126 | #define XCHAL_DCACHE_SIZE 32768 /* D-cache size in bytes or 0 */ | ||
127 | |||
128 | #define XCHAL_DCACHE_IS_WRITEBACK 1 /* writeback feature */ | ||
129 | |||
130 | |||
131 | |||
132 | |||
133 | /**************************************************************************** | ||
134 | Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code | ||
135 | ****************************************************************************/ | ||
136 | |||
137 | |||
138 | #ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY | ||
139 | |||
140 | /*---------------------------------------------------------------------- | ||
141 | CACHE | ||
142 | ----------------------------------------------------------------------*/ | ||
143 | |||
144 | #define XCHAL_HAVE_PIF 1 /* any outbound PIF present */ | ||
145 | |||
146 | /* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */ | ||
147 | |||
148 | /* Number of cache sets in log2(lines per way): */ | ||
149 | #define XCHAL_ICACHE_SETWIDTH 9 | ||
150 | #define XCHAL_DCACHE_SETWIDTH 10 | ||
151 | |||
152 | /* Cache set associativity (number of ways): */ | ||
153 | #define XCHAL_ICACHE_WAYS 4 | ||
154 | #define XCHAL_DCACHE_WAYS 2 | ||
155 | |||
156 | /* Cache features: */ | ||
157 | #define XCHAL_ICACHE_LINE_LOCKABLE 1 | ||
158 | #define XCHAL_DCACHE_LINE_LOCKABLE 0 | ||
159 | #define XCHAL_ICACHE_ECC_PARITY 0 | ||
160 | #define XCHAL_DCACHE_ECC_PARITY 0 | ||
161 | |||
162 | /* Number of encoded cache attr bits (see <xtensa/hal.h> for decoded bits): */ | ||
163 | #define XCHAL_CA_BITS 4 | ||
164 | |||
165 | |||
166 | /*---------------------------------------------------------------------- | ||
167 | INTERNAL I/D RAM/ROMs and XLMI | ||
168 | ----------------------------------------------------------------------*/ | ||
169 | |||
170 | #define XCHAL_NUM_INSTROM 0 /* number of core instr. ROMs */ | ||
171 | #define XCHAL_NUM_INSTRAM 0 /* number of core instr. RAMs */ | ||
172 | #define XCHAL_NUM_DATAROM 0 /* number of core data ROMs */ | ||
173 | #define XCHAL_NUM_DATARAM 1 /* number of core data RAMs */ | ||
174 | #define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/ | ||
175 | #define XCHAL_NUM_XLMI 1 /* number of core XLMI ports */ | ||
176 | |||
177 | /* Data RAM 0: */ | ||
178 | #define XCHAL_DATARAM0_VADDR 0x3FFF0000 | ||
179 | #define XCHAL_DATARAM0_PADDR 0x3FFF0000 | ||
180 | #define XCHAL_DATARAM0_SIZE 65536 | ||
181 | #define XCHAL_DATARAM0_ECC_PARITY 0 | ||
182 | |||
183 | /* XLMI Port 0: */ | ||
184 | #define XCHAL_XLMI0_VADDR 0x37F80000 | ||
185 | #define XCHAL_XLMI0_PADDR 0x37F80000 | ||
186 | #define XCHAL_XLMI0_SIZE 262144 | ||
187 | #define XCHAL_XLMI0_ECC_PARITY 0 | ||
188 | |||
189 | |||
190 | /*---------------------------------------------------------------------- | ||
191 | INTERRUPTS and TIMERS | ||
192 | ----------------------------------------------------------------------*/ | ||
193 | |||
194 | #define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */ | ||
195 | #define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */ | ||
196 | #define XCHAL_HAVE_NMI 1 /* non-maskable interrupt */ | ||
197 | #define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */ | ||
198 | #define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */ | ||
199 | #define XCHAL_NUM_INTERRUPTS 27 /* number of interrupts */ | ||
200 | #define XCHAL_NUM_INTERRUPTS_LOG2 5 /* ceil(log2(NUM_INTERRUPTS)) */ | ||
201 | #define XCHAL_NUM_EXTINTERRUPTS 20 /* num of external interrupts */ | ||
202 | #define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels | ||
203 | (not including level zero) */ | ||
204 | #define XCHAL_EXCM_LEVEL 1 /* level masked by PS.EXCM */ | ||
205 | /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */ | ||
206 | |||
207 | /* Masks of interrupts at each interrupt level: */ | ||
208 | #define XCHAL_INTLEVEL1_MASK 0x01F07FFF | ||
209 | #define XCHAL_INTLEVEL2_MASK 0x02018000 | ||
210 | #define XCHAL_INTLEVEL3_MASK 0x04060000 | ||
211 | #define XCHAL_INTLEVEL4_MASK 0x00000000 | ||
212 | #define XCHAL_INTLEVEL5_MASK 0x00080000 | ||
213 | #define XCHAL_INTLEVEL6_MASK 0x00000000 | ||
214 | #define XCHAL_INTLEVEL7_MASK 0x00000000 | ||
215 | |||
216 | /* Masks of interrupts at each range 1..n of interrupt levels: */ | ||
217 | #define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x01F07FFF | ||
218 | #define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x03F1FFFF | ||
219 | #define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x07F7FFFF | ||
220 | #define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x07F7FFFF | ||
221 | #define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x07FFFFFF | ||
222 | #define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x07FFFFFF | ||
223 | #define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x07FFFFFF | ||
224 | |||
225 | /* Level of each interrupt: */ | ||
226 | #define XCHAL_INT0_LEVEL 1 | ||
227 | #define XCHAL_INT1_LEVEL 1 | ||
228 | #define XCHAL_INT2_LEVEL 1 | ||
229 | #define XCHAL_INT3_LEVEL 1 | ||
230 | #define XCHAL_INT4_LEVEL 1 | ||
231 | #define XCHAL_INT5_LEVEL 1 | ||
232 | #define XCHAL_INT6_LEVEL 1 | ||
233 | #define XCHAL_INT7_LEVEL 1 | ||
234 | #define XCHAL_INT8_LEVEL 1 | ||
235 | #define XCHAL_INT9_LEVEL 1 | ||
236 | #define XCHAL_INT10_LEVEL 1 | ||
237 | #define XCHAL_INT11_LEVEL 1 | ||
238 | #define XCHAL_INT12_LEVEL 1 | ||
239 | #define XCHAL_INT13_LEVEL 1 | ||
240 | #define XCHAL_INT14_LEVEL 1 | ||
241 | #define XCHAL_INT15_LEVEL 2 | ||
242 | #define XCHAL_INT16_LEVEL 2 | ||
243 | #define XCHAL_INT17_LEVEL 3 | ||
244 | #define XCHAL_INT18_LEVEL 3 | ||
245 | #define XCHAL_INT19_LEVEL 5 | ||
246 | #define XCHAL_INT20_LEVEL 1 | ||
247 | #define XCHAL_INT21_LEVEL 1 | ||
248 | #define XCHAL_INT22_LEVEL 1 | ||
249 | #define XCHAL_INT23_LEVEL 1 | ||
250 | #define XCHAL_INT24_LEVEL 1 | ||
251 | #define XCHAL_INT25_LEVEL 2 | ||
252 | #define XCHAL_INT26_LEVEL 3 | ||
253 | #define XCHAL_DEBUGLEVEL 4 /* debug interrupt level */ | ||
254 | #define XCHAL_HAVE_DEBUG_EXTERN_INT 1 /* OCD external db interrupt */ | ||
255 | #define XCHAL_NMILEVEL 5 /* NMI "level" (for use with | ||
256 | EXCSAVE/EPS/EPC_n, RFI n) */ | ||
257 | |||
258 | /* Type of each interrupt: */ | ||
259 | #define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
260 | #define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
261 | #define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
262 | #define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
263 | #define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
264 | #define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
265 | #define XCHAL_INT6_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
266 | #define XCHAL_INT7_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
267 | #define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
268 | #define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
269 | #define XCHAL_INT10_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
270 | #define XCHAL_INT11_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
271 | #define XCHAL_INT12_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
272 | #define XCHAL_INT13_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
273 | #define XCHAL_INT14_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
274 | #define XCHAL_INT15_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
275 | #define XCHAL_INT16_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
276 | #define XCHAL_INT17_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
277 | #define XCHAL_INT18_TYPE XTHAL_INTTYPE_EXTERN_LEVEL | ||
278 | #define XCHAL_INT19_TYPE XTHAL_INTTYPE_NMI | ||
279 | #define XCHAL_INT20_TYPE XTHAL_INTTYPE_SOFTWARE | ||
280 | #define XCHAL_INT21_TYPE XTHAL_INTTYPE_SOFTWARE | ||
281 | #define XCHAL_INT22_TYPE XTHAL_INTTYPE_SOFTWARE | ||
282 | #define XCHAL_INT23_TYPE XTHAL_INTTYPE_SOFTWARE | ||
283 | #define XCHAL_INT24_TYPE XTHAL_INTTYPE_TIMER | ||
284 | #define XCHAL_INT25_TYPE XTHAL_INTTYPE_TIMER | ||
285 | #define XCHAL_INT26_TYPE XTHAL_INTTYPE_TIMER | ||
286 | |||
287 | /* Masks of interrupts for each type of interrupt: */ | ||
288 | #define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xF8000000 | ||
289 | #define XCHAL_INTTYPE_MASK_SOFTWARE 0x00F00000 | ||
290 | #define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00000000 | ||
291 | #define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0007FFFF | ||
292 | #define XCHAL_INTTYPE_MASK_TIMER 0x07000000 | ||
293 | #define XCHAL_INTTYPE_MASK_NMI 0x00080000 | ||
294 | #define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000 | ||
295 | |||
296 | /* Interrupt numbers assigned to specific interrupt sources: */ | ||
297 | #define XCHAL_TIMER0_INTERRUPT 24 /* CCOMPARE0 */ | ||
298 | #define XCHAL_TIMER1_INTERRUPT 25 /* CCOMPARE1 */ | ||
299 | #define XCHAL_TIMER2_INTERRUPT 26 /* CCOMPARE2 */ | ||
300 | #define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED | ||
301 | #define XCHAL_NMI_INTERRUPT 19 /* non-maskable interrupt */ | ||
302 | |||
303 | /* Interrupt numbers for levels at which only one interrupt is configured: */ | ||
304 | #define XCHAL_INTLEVEL5_NUM 19 | ||
305 | /* (There are many interrupts each at level(s) 1, 2, 3.) */ | ||
306 | |||
307 | |||
308 | /* | ||
309 | * External interrupt vectors/levels. | ||
310 | * These macros describe how Xtensa processor interrupt numbers | ||
311 | * (as numbered internally, eg. in INTERRUPT and INTENABLE registers) | ||
312 | * map to external BInterrupt<n> pins, for those interrupts | ||
313 | * configured as external (level-triggered, edge-triggered, or NMI). | ||
314 | * See the Xtensa processor databook for more details. | ||
315 | */ | ||
316 | |||
317 | /* Core interrupt numbers mapped to each EXTERNAL interrupt number: */ | ||
318 | #define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */ | ||
319 | #define XCHAL_EXTINT1_NUM 1 /* (intlevel 1) */ | ||
320 | #define XCHAL_EXTINT2_NUM 2 /* (intlevel 1) */ | ||
321 | #define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */ | ||
322 | #define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */ | ||
323 | #define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */ | ||
324 | #define XCHAL_EXTINT6_NUM 6 /* (intlevel 1) */ | ||
325 | #define XCHAL_EXTINT7_NUM 7 /* (intlevel 1) */ | ||
326 | #define XCHAL_EXTINT8_NUM 8 /* (intlevel 1) */ | ||
327 | #define XCHAL_EXTINT9_NUM 9 /* (intlevel 1) */ | ||
328 | #define XCHAL_EXTINT10_NUM 10 /* (intlevel 1) */ | ||
329 | #define XCHAL_EXTINT11_NUM 11 /* (intlevel 1) */ | ||
330 | #define XCHAL_EXTINT12_NUM 12 /* (intlevel 1) */ | ||
331 | #define XCHAL_EXTINT13_NUM 13 /* (intlevel 1) */ | ||
332 | #define XCHAL_EXTINT14_NUM 14 /* (intlevel 1) */ | ||
333 | #define XCHAL_EXTINT15_NUM 15 /* (intlevel 2) */ | ||
334 | #define XCHAL_EXTINT16_NUM 16 /* (intlevel 2) */ | ||
335 | #define XCHAL_EXTINT17_NUM 17 /* (intlevel 3) */ | ||
336 | #define XCHAL_EXTINT18_NUM 18 /* (intlevel 3) */ | ||
337 | #define XCHAL_EXTINT19_NUM 19 /* (intlevel 5) */ | ||
338 | |||
339 | |||
340 | /*---------------------------------------------------------------------- | ||
341 | EXCEPTIONS and VECTORS | ||
342 | ----------------------------------------------------------------------*/ | ||
343 | |||
344 | #define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture | ||
345 | number: 1 == XEA1 (old) | ||
346 | 2 == XEA2 (new) | ||
347 | 0 == XEAX (extern) */ | ||
348 | #define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */ | ||
349 | #define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */ | ||
350 | #define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */ | ||
351 | #define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */ | ||
352 | #define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */ | ||
353 | #define XCHAL_HAVE_VECTOR_SELECT 0 /* relocatable vectors */ | ||
354 | #define XCHAL_HAVE_VECBASE 0 /* relocatable vectors */ | ||
355 | |||
356 | #define XCHAL_RESET_VECOFS 0x00000000 | ||
357 | #define XCHAL_RESET_VECTOR_VADDR 0x3FFE03D0 | ||
358 | #define XCHAL_RESET_VECTOR_PADDR 0x3FFE03D0 | ||
359 | #define XCHAL_USER_VECOFS 0x00000000 | ||
360 | #define XCHAL_USER_VECTOR_VADDR 0x40000220 | ||
361 | #define XCHAL_USER_VECTOR_PADDR 0x40000220 | ||
362 | #define XCHAL_KERNEL_VECOFS 0x00000000 | ||
363 | #define XCHAL_KERNEL_VECTOR_VADDR 0x40000200 | ||
364 | #define XCHAL_KERNEL_VECTOR_PADDR 0x40000200 | ||
365 | #define XCHAL_DOUBLEEXC_VECOFS 0x00000000 | ||
366 | #define XCHAL_DOUBLEEXC_VECTOR_VADDR 0x400002A0 | ||
367 | #define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x400002A0 | ||
368 | #define XCHAL_WINDOW_OF4_VECOFS 0x00000000 | ||
369 | #define XCHAL_WINDOW_UF4_VECOFS 0x00000040 | ||
370 | #define XCHAL_WINDOW_OF8_VECOFS 0x00000080 | ||
371 | #define XCHAL_WINDOW_UF8_VECOFS 0x000000C0 | ||
372 | #define XCHAL_WINDOW_OF12_VECOFS 0x00000100 | ||
373 | #define XCHAL_WINDOW_UF12_VECOFS 0x00000140 | ||
374 | #define XCHAL_WINDOW_VECTORS_VADDR 0x40000000 | ||
375 | #define XCHAL_WINDOW_VECTORS_PADDR 0x40000000 | ||
376 | #define XCHAL_INTLEVEL2_VECOFS 0x00000000 | ||
377 | #define XCHAL_INTLEVEL2_VECTOR_VADDR 0x40000240 | ||
378 | #define XCHAL_INTLEVEL2_VECTOR_PADDR 0x40000240 | ||
379 | #define XCHAL_INTLEVEL3_VECOFS 0x00000000 | ||
380 | #define XCHAL_INTLEVEL3_VECTOR_VADDR 0x40000260 | ||
381 | #define XCHAL_INTLEVEL3_VECTOR_PADDR 0x40000260 | ||
382 | #define XCHAL_INTLEVEL4_VECOFS 0x00000000 | ||
383 | #define XCHAL_INTLEVEL4_VECTOR_VADDR 0x40000390 | ||
384 | #define XCHAL_INTLEVEL4_VECTOR_PADDR 0x40000390 | ||
385 | #define XCHAL_DEBUG_VECOFS XCHAL_INTLEVEL4_VECOFS | ||
386 | #define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL4_VECTOR_VADDR | ||
387 | #define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL4_VECTOR_PADDR | ||
388 | #define XCHAL_NMI_VECOFS 0x00000000 | ||
389 | #define XCHAL_NMI_VECTOR_VADDR 0x400003B0 | ||
390 | #define XCHAL_NMI_VECTOR_PADDR 0x400003B0 | ||
391 | #define XCHAL_INTLEVEL5_VECOFS XCHAL_NMI_VECOFS | ||
392 | #define XCHAL_INTLEVEL5_VECTOR_VADDR XCHAL_NMI_VECTOR_VADDR | ||
393 | #define XCHAL_INTLEVEL5_VECTOR_PADDR XCHAL_NMI_VECTOR_PADDR | ||
394 | |||
395 | |||
396 | /*---------------------------------------------------------------------- | ||
397 | DEBUG | ||
398 | ----------------------------------------------------------------------*/ | ||
399 | |||
400 | #define XCHAL_HAVE_OCD 1 /* OnChipDebug option */ | ||
401 | #define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */ | ||
402 | #define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */ | ||
403 | #define XCHAL_HAVE_OCD_DIR_ARRAY 1 /* faster OCD option */ | ||
404 | |||
405 | |||
406 | /*---------------------------------------------------------------------- | ||
407 | MMU | ||
408 | ----------------------------------------------------------------------*/ | ||
409 | |||
410 | /* See core-matmap.h header file for more details. */ | ||
411 | |||
412 | #define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */ | ||
413 | #define XCHAL_HAVE_SPANNING_WAY 1 /* one way maps I+D 4GB vaddr */ | ||
414 | #define XCHAL_HAVE_IDENTITY_MAP 1 /* vaddr == paddr always */ | ||
415 | #define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */ | ||
416 | #define XCHAL_HAVE_MIMIC_CACHEATTR 1 /* region protection */ | ||
417 | #define XCHAL_HAVE_XLT_CACHEATTR 0 /* region prot. w/translation */ | ||
418 | #define XCHAL_HAVE_PTP_MMU 0 /* full MMU (with page table | ||
419 | [autorefill] and protection) | ||
420 | usable for an MMU-based OS */ | ||
421 | /* If none of the above last 4 are set, it's a custom TLB configuration. */ | ||
422 | |||
423 | #define XCHAL_MMU_ASID_BITS 0 /* number of bits in ASIDs */ | ||
424 | #define XCHAL_MMU_RINGS 1 /* number of rings (1..4) */ | ||
425 | #define XCHAL_MMU_RING_BITS 0 /* num of bits in RING field */ | ||
426 | |||
427 | #endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */ | ||
428 | |||
429 | |||
430 | #endif /* _XTENSA_CORE_CONFIGURATION_H */ | ||
431 | |||
diff --git a/arch/xtensa/variants/s6000/include/variant/hardware.h b/arch/xtensa/variants/s6000/include/variant/hardware.h new file mode 100644 index 000000000000..5d9ba098d84a --- /dev/null +++ b/arch/xtensa/variants/s6000/include/variant/hardware.h | |||
@@ -0,0 +1,259 @@ | |||
1 | #ifndef __XTENSA_S6000_HARDWARE_H | ||
2 | #define __XTENSA_S6000_HARDWARE_H | ||
3 | |||
4 | #define S6_SCLK 1843200 | ||
5 | |||
6 | #define S6_MEM_REG 0x20000000 | ||
7 | #define S6_MEM_EFI 0x33F00000 | ||
8 | #define S6_MEM_PCIE_DATARAM1 0x34000000 | ||
9 | #define S6_MEM_XLMI 0x37F80000 | ||
10 | #define S6_MEM_PIF_DATARAM1 0x37FFC000 | ||
11 | #define S6_MEM_GMAC 0x38000000 | ||
12 | #define S6_MEM_I2S 0x3A000000 | ||
13 | #define S6_MEM_EGIB 0x3C000000 | ||
14 | #define S6_MEM_PCIE_CFG 0x3E000000 | ||
15 | #define S6_MEM_PIF_DATARAM 0x3FFE0000 | ||
16 | #define S6_MEM_XLMI_DATARAM 0x3FFF0000 | ||
17 | #define S6_MEM_DDR 0x40000000 | ||
18 | #define S6_MEM_PCIE_APER 0xC0000000 | ||
19 | #define S6_MEM_AUX 0xF0000000 | ||
20 | |||
21 | /* Device addresses */ | ||
22 | |||
23 | #define S6_REG_SCB S6_MEM_REG | ||
24 | #define S6_REG_NB (S6_REG_SCB + 0x10000) | ||
25 | #define S6_REG_LMSDMA (S6_REG_SCB + 0x20000) | ||
26 | #define S6_REG_NI (S6_REG_SCB + 0x30000) | ||
27 | #define S6_REG_NIDMA (S6_REG_SCB + 0x40000) | ||
28 | #define S6_REG_NS (S6_REG_SCB + 0x50000) | ||
29 | #define S6_REG_DDR (S6_REG_SCB + 0x60000) | ||
30 | #define S6_REG_GREG1 (S6_REG_SCB + 0x70000) | ||
31 | #define S6_REG_DP (S6_REG_SCB + 0x80000) | ||
32 | #define S6_REG_DPDMA (S6_REG_SCB + 0x90000) | ||
33 | #define S6_REG_EGIB (S6_REG_SCB + 0xA0000) | ||
34 | #define S6_REG_PCIE (S6_REG_SCB + 0xB0000) | ||
35 | #define S6_REG_I2S (S6_REG_SCB + 0xC0000) | ||
36 | #define S6_REG_GMAC (S6_REG_SCB + 0xD0000) | ||
37 | #define S6_REG_HIFDMA (S6_REG_SCB + 0xE0000) | ||
38 | #define S6_REG_GREG2 (S6_REG_SCB + 0xF0000) | ||
39 | |||
40 | #define S6_REG_APB S6_REG_SCB | ||
41 | #define S6_REG_UART (S6_REG_APB + 0x0000) | ||
42 | #define S6_REG_INTC (S6_REG_APB + 0x2000) | ||
43 | #define S6_REG_SPI (S6_REG_APB + 0x3000) | ||
44 | #define S6_REG_I2C (S6_REG_APB + 0x4000) | ||
45 | #define S6_REG_GPIO (S6_REG_APB + 0x8000) | ||
46 | |||
47 | /* Global register block */ | ||
48 | |||
49 | #define S6_GREG1_PLL_LOCKCLEAR 0x000 | ||
50 | #define S6_GREG1_PLL_LOCK_SYS 0 | ||
51 | #define S6_GREG1_PLL_LOCK_IO 1 | ||
52 | #define S6_GREG1_PLL_LOCK_AIM 2 | ||
53 | #define S6_GREG1_PLL_LOCK_DP0 3 | ||
54 | #define S6_GREG1_PLL_LOCK_DP2 4 | ||
55 | #define S6_GREG1_PLL_LOCK_DDR 5 | ||
56 | #define S6_GREG1_PLL_LOCKSTAT 0x004 | ||
57 | #define S6_GREG1_PLL_LOCKSTAT_CURLOCK 0 | ||
58 | #define S6_GREG1_PLL_LOCKSTAT_EVERUNLCK 8 | ||
59 | #define S6_GREG1_PLLSEL 0x010 | ||
60 | #define S6_GREG1_PLLSEL_AIM 0 | ||
61 | #define S6_GREG1_PLLSEL_AIM_DDR2 0 | ||
62 | #define S6_GREG1_PLLSEL_AIM_300MHZ 1 | ||
63 | #define S6_GREG1_PLLSEL_AIM_240MHZ 2 | ||
64 | #define S6_GREG1_PLLSEL_AIM_200MHZ 3 | ||
65 | #define S6_GREG1_PLLSEL_AIM_150MHZ 4 | ||
66 | #define S6_GREG1_PLLSEL_AIM_120MHZ 5 | ||
67 | #define S6_GREG1_PLLSEL_AIM_40MHZ 6 | ||
68 | #define S6_GREG1_PLLSEL_AIM_PLLAIMREF 7 | ||
69 | #define S6_GREG1_PLLSEL_AIM_MASK 7 | ||
70 | #define S6_GREG1_PLLSEL_DDR 8 | ||
71 | #define S6_GREG1_PLLSEL_DDR_HS 0 | ||
72 | #define S6_GREG1_PLLSEL_DDR_333MHZ 1 | ||
73 | #define S6_GREG1_PLLSEL_DDR_250MHZ 2 | ||
74 | #define S6_GREG1_PLLSEL_DDR_200MHZ 3 | ||
75 | #define S6_GREG1_PLLSEL_DDR_167MHZ 4 | ||
76 | #define S6_GREG1_PLLSEL_DDR_100MHZ 5 | ||
77 | #define S6_GREG1_PLLSEL_DDR_33MHZ 6 | ||
78 | #define S6_GREG1_PLLSEL_DDR_PLLIOREF 7 | ||
79 | #define S6_GREG1_PLLSEL_DDR_MASK 7 | ||
80 | #define S6_GREG1_PLLSEL_GMAC 16 | ||
81 | #define S6_GREG1_PLLSEL_GMAC_125MHZ 0 | ||
82 | #define S6_GREG1_PLLSEL_GMAC_25MHZ 1 | ||
83 | #define S6_GREG1_PLLSEL_GMAC_2500KHZ 2 | ||
84 | #define S6_GREG1_PLLSEL_GMAC_EXTERN 3 | ||
85 | #define S6_GREG1_PLLSEL_GMAC_MASK 3 | ||
86 | #define S6_GREG1_PLLSEL_GMII 18 | ||
87 | #define S6_GREG1_PLLSEL_GMII_111MHZ 0 | ||
88 | #define S6_GREG1_PLLSEL_GMII_IOREF 1 | ||
89 | #define S6_GREG1_PLLSEL_GMII_NONE 2 | ||
90 | #define S6_GREG1_PLLSEL_GMII_125MHZ 3 | ||
91 | #define S6_GREG1_PLLSEL_GMII_MASK 3 | ||
92 | #define S6_GREG1_SYSUNLOCKCNT 0x020 | ||
93 | #define S6_GREG1_IOUNLOCKCNT 0x024 | ||
94 | #define S6_GREG1_AIMUNLOCKCNT 0x028 | ||
95 | #define S6_GREG1_DP0UNLOCKCNT 0x02C | ||
96 | #define S6_GREG1_DP2UNLOCKCNT 0x030 | ||
97 | #define S6_GREG1_DDRUNLOCKCNT 0x034 | ||
98 | #define S6_GREG1_CLKBAL0 0x040 | ||
99 | #define S6_GREG1_CLKBAL0_LSGB 0 | ||
100 | #define S6_GREG1_CLKBAL0_LSPX 8 | ||
101 | #define S6_GREG1_CLKBAL0_MEMDO 16 | ||
102 | #define S6_GREG1_CLKBAL0_HSXT1 24 | ||
103 | #define S6_GREG1_CLKBAL1 0x044 | ||
104 | #define S6_GREG1_CLKBAL1_HSISEF 0 | ||
105 | #define S6_GREG1_CLKBAL1_HSNI 8 | ||
106 | #define S6_GREG1_CLKBAL1_HSNS 16 | ||
107 | #define S6_GREG1_CLKBAL1_HSISEFCFG 24 | ||
108 | #define S6_GREG1_CLKBAL2 0x048 | ||
109 | #define S6_GREG1_CLKBAL2_LSNB 0 | ||
110 | #define S6_GREG1_CLKBAL2_LSSB 8 | ||
111 | #define S6_GREG1_CLKBAL2_LSREST 24 | ||
112 | #define S6_GREG1_CLKBAL3 0x04C | ||
113 | #define S6_GREG1_CLKBAL3_ISEFXAD 0 | ||
114 | #define S6_GREG1_CLKBAL3_ISEFLMS 8 | ||
115 | #define S6_GREG1_CLKBAL3_ISEFISEF 16 | ||
116 | #define S6_GREG1_CLKBAL3_DDRDD 24 | ||
117 | #define S6_GREG1_CLKBAL4 0x050 | ||
118 | #define S6_GREG1_CLKBAL4_DDRDP 0 | ||
119 | #define S6_GREG1_CLKBAL4_DDRDO 8 | ||
120 | #define S6_GREG1_CLKBAL4_DDRNB 16 | ||
121 | #define S6_GREG1_CLKBAL4_DDRLMS 24 | ||
122 | #define S6_GREG1_BLOCKENA 0x100 | ||
123 | #define S6_GREG1_BLOCK_DDR 0 | ||
124 | #define S6_GREG1_BLOCK_DP 1 | ||
125 | #define S6_GREG1_BLOCK_NSNI 2 | ||
126 | #define S6_GREG1_BLOCK_PCIE 3 | ||
127 | #define S6_GREG1_BLOCK_GMAC 4 | ||
128 | #define S6_GREG1_BLOCK_I2S 5 | ||
129 | #define S6_GREG1_BLOCK_EGIB 6 | ||
130 | #define S6_GREG1_BLOCK_SB 7 | ||
131 | #define S6_GREG1_BLOCK_XT1 8 | ||
132 | #define S6_GREG1_CLKGATE 0x104 | ||
133 | #define S6_GREG1_BGATE_AIMNORTH 9 | ||
134 | #define S6_GREG1_BGATE_AIMEAST 10 | ||
135 | #define S6_GREG1_BGATE_AIMWEST 11 | ||
136 | #define S6_GREG1_BGATE_AIMSOUTH 12 | ||
137 | #define S6_GREG1_CHIPRES 0x108 | ||
138 | #define S6_GREG1_CHIPRES_SOFTRES 0 | ||
139 | #define S6_GREG1_CHIPRES_LOSTLOCK 1 | ||
140 | #define S6_GREG1_RESETCAUSE 0x10C | ||
141 | #define S6_GREG1_RESETCAUSE_RESETN 0 | ||
142 | #define S6_GREG1_RESETCAUSE_GLOBAL 1 | ||
143 | #define S6_GREG1_RESETCAUSE_WDOGTIMER 2 | ||
144 | #define S6_GREG1_RESETCAUSE_SWCHIP 3 | ||
145 | #define S6_GREG1_RESETCAUSE_PLLSYSLOSS 4 | ||
146 | #define S6_GREG1_RESETCAUSE_PCIE 5 | ||
147 | #define S6_GREG1_RESETCAUSE_CREATEDGLOB 6 | ||
148 | #define S6_GREG1_REFCLOCKCNT 0x110 | ||
149 | #define S6_GREG1_RESETTIMER 0x114 | ||
150 | #define S6_GREG1_NMITIMER 0x118 | ||
151 | #define S6_GREG1_GLOBAL_TIMER 0x11C | ||
152 | #define S6_GREG1_TIMER0 0x180 | ||
153 | #define S6_GREG1_TIMER1 0x184 | ||
154 | #define S6_GREG1_UARTCLOCKSEL 0x204 | ||
155 | #define S6_GREG1_CHIPVERSPACKG 0x208 | ||
156 | #define S6_GREG1_CHIPVERSPACKG_CHIPVID 0 | ||
157 | #define S6_GREG1_CHIPVERSPACKG_PACKSEL 8 | ||
158 | #define S6_GREG1_ONDIETERMCTRL 0x20C | ||
159 | #define S6_GREG1_ONDIETERMCTRL_WEST 0 | ||
160 | #define S6_GREG1_ONDIETERMCTRL_NORTH 2 | ||
161 | #define S6_GREG1_ONDIETERMCTRL_EAST 4 | ||
162 | #define S6_GREG1_ONDIETERMCTRL_SOUTH 6 | ||
163 | #define S6_GREG1_ONDIETERMCTRL_NONE 0 | ||
164 | #define S6_GREG1_ONDIETERMCTRL_75OHM 2 | ||
165 | #define S6_GREG1_ONDIETERMCTRL_MASK 3 | ||
166 | #define S6_GREG1_BOOT_CFG0 0x210 | ||
167 | #define S6_GREG1_BOOT_CFG0_AIMSTRONG 1 | ||
168 | #define S6_GREG1_BOOT_CFG0_MINIBOOTDL 2 | ||
169 | #define S6_GREG1_BOOT_CFG0_OCDGPIO8SET 5 | ||
170 | #define S6_GREG1_BOOT_CFG0_OCDGPIOENA 6 | ||
171 | #define S6_GREG1_BOOT_CFG0_DOWNSTREAM 7 | ||
172 | #define S6_GREG1_BOOT_CFG0_PLLSYSDIV 8 | ||
173 | #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_300MHZ 1 | ||
174 | #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_240MHZ 2 | ||
175 | #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_200MHZ 3 | ||
176 | #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_150MHZ 4 | ||
177 | #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_120MHZ 5 | ||
178 | #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_40MHZ 6 | ||
179 | #define S6_GREG1_BOOT_CFG0_PLLSYSDIV_MASK 7 | ||
180 | #define S6_GREG1_BOOT_CFG0_BALHSLMS 12 | ||
181 | #define S6_GREG1_BOOT_CFG0_BALHSNB 18 | ||
182 | #define S6_GREG1_BOOT_CFG0_BALHSXAD 24 | ||
183 | #define S6_GREG1_BOOT_CFG1 0x214 | ||
184 | #define S6_GREG1_BOOT_CFG1_PCIE1LANE 1 | ||
185 | #define S6_GREG1_BOOT_CFG1_MPLLPRESCALE 2 | ||
186 | #define S6_GREG1_BOOT_CFG1_MPLLNCY 4 | ||
187 | #define S6_GREG1_BOOT_CFG1_MPLLNCY5 9 | ||
188 | #define S6_GREG1_BOOT_CFG1_BALHSREST 14 | ||
189 | #define S6_GREG1_BOOT_CFG1_BALHSPSMEMS 20 | ||
190 | #define S6_GREG1_BOOT_CFG1_BALLSGI 26 | ||
191 | #define S6_GREG1_BOOT_CFG2 0x218 | ||
192 | #define S6_GREG1_BOOT_CFG2_PEID 0 | ||
193 | #define S6_GREG1_BOOT_CFG3 0x21C | ||
194 | #define S6_GREG1_DRAMBUSYHOLDOF 0x220 | ||
195 | #define S6_GREG1_DRAMBUSYHOLDOF_XT0 0 | ||
196 | #define S6_GREG1_DRAMBUSYHOLDOF_XT1 4 | ||
197 | #define S6_GREG1_DRAMBUSYHOLDOF_XT_MASK 7 | ||
198 | #define S6_GREG1_PCIEBAR1SIZE 0x224 | ||
199 | #define S6_GREG1_PCIEBAR2SIZE 0x228 | ||
200 | #define S6_GREG1_PCIEVENDOR 0x22C | ||
201 | #define S6_GREG1_PCIEDEVICE 0x230 | ||
202 | #define S6_GREG1_PCIEREV 0x234 | ||
203 | #define S6_GREG1_PCIECLASS 0x238 | ||
204 | #define S6_GREG1_XT1DCACHEMISS 0x240 | ||
205 | #define S6_GREG1_XT1ICACHEMISS 0x244 | ||
206 | #define S6_GREG1_HWSEMAPHORE(n) (0x400 + 4 * (n)) | ||
207 | #define S6_GREG1_HWSEMAPHORE_NB 16 | ||
208 | |||
209 | /* peripheral interrupt numbers */ | ||
210 | |||
211 | #define S6_INTC_GPIO(n) (n) /* 0..3 */ | ||
212 | #define S6_INTC_I2C 4 | ||
213 | #define S6_INTC_SPI 5 | ||
214 | #define S6_INTC_NB_ERR 6 | ||
215 | #define S6_INTC_DMA_LMSERR 7 | ||
216 | #define S6_INTC_DMA_LMSLOWWMRK(n) (8 + (n)) /* 0..11 */ | ||
217 | #define S6_INTC_DMA_LMSPENDCNT(n) (20 + (n)) /* 0..11 */ | ||
218 | #define S6_INTC_DMA HOSTLOWWMRK(n) (32 + (n)) /* 0..6 */ | ||
219 | #define S6_INTC_DMA_HOSTPENDCNT(n) (39 + (n)) /* 0..6 */ | ||
220 | #define S6_INTC_DMA_HOSTERR 46 | ||
221 | #define S6_INTC_UART(n) (47 + (n)) /* 0..1 */ | ||
222 | #define S6_INTC_XAD 49 | ||
223 | #define S6_INTC_NI_ERR 50 | ||
224 | #define S6_INTC_NI_INFIFOFULL 51 | ||
225 | #define S6_INTC_DMA_NIERR 52 | ||
226 | #define S6_INTC_DMA_NILOWWMRK(n) (53 + (n)) /* 0..3 */ | ||
227 | #define S6_INTC_DMA_NIPENDCNT(n) (57 + (n)) /* 0..3 */ | ||
228 | #define S6_INTC_DDR 61 | ||
229 | #define S6_INTC_NS_ERR 62 | ||
230 | #define S6_INTC_EFI_CFGERR 63 | ||
231 | #define S6_INTC_EFI_ISEFTEST 64 | ||
232 | #define S6_INTC_EFI_WRITEERR 65 | ||
233 | #define S6_INTC_NMI_TIMER 66 | ||
234 | #define S6_INTC_PLLLOCK_SYS 67 | ||
235 | #define S6_INTC_PLLLOCK_IO 68 | ||
236 | #define S6_INTC_PLLLOCK_AIM 69 | ||
237 | #define S6_INTC_PLLLOCK_DP0 70 | ||
238 | #define S6_INTC_PLLLOCK_DP2 71 | ||
239 | #define S6_INTC_I2S_ERR 72 | ||
240 | #define S6_INTC_GMAC_STAT 73 | ||
241 | #define S6_INTC_GMAC_ERR 74 | ||
242 | #define S6_INTC_GIB_ERR 75 | ||
243 | #define S6_INTC_PCIE_ERR 76 | ||
244 | #define S6_INTC_PCIE_MSI(n) (77 + (n)) /* 0..3 */ | ||
245 | #define S6_INTC_PCIE_INTA 81 | ||
246 | #define S6_INTC_PCIE_INTB 82 | ||
247 | #define S6_INTC_PCIE_INTC 83 | ||
248 | #define S6_INTC_PCIE_INTD 84 | ||
249 | #define S6_INTC_SW(n) (85 + (n)) /* 0..9 */ | ||
250 | #define S6_INTC_SW_ENABLE(n) (85 + 256 + (n)) | ||
251 | #define S6_INTC_DMA_DP_ERR 95 | ||
252 | #define S6_INTC_DMA_DPLOWWMRK(n) (96 + (n)) /* 0..3 */ | ||
253 | #define S6_INTC_DMA_DPPENDCNT(n) (100 + (n)) /* 0..3 */ | ||
254 | #define S6_INTC_DMA_DPTERMCNT(n) (104 + (n)) /* 0..3 */ | ||
255 | #define S6_INTC_TIMER0 108 | ||
256 | #define S6_INTC_TIMER1 109 | ||
257 | #define S6_INTC_DMA_HOSTTERMCNT(n) (110 + (n)) /* 0..6 */ | ||
258 | |||
259 | #endif /* __XTENSA_S6000_HARDWARE_H */ | ||
diff --git a/arch/xtensa/variants/s6000/include/variant/irq.h b/arch/xtensa/variants/s6000/include/variant/irq.h new file mode 100644 index 000000000000..fa031cb0acc4 --- /dev/null +++ b/arch/xtensa/variants/s6000/include/variant/irq.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef __XTENSA_S6000_IRQ_H | ||
2 | #define __XTENSA_S6000_IRQ_H | ||
3 | |||
4 | #define NO_IRQ (-1) | ||
5 | |||
6 | extern void variant_irq_enable(unsigned int irq); | ||
7 | extern void variant_irq_disable(unsigned int irq); | ||
8 | |||
9 | #endif /* __XTENSA_S6000_IRQ_H */ | ||
diff --git a/arch/xtensa/variants/s6000/include/variant/tie-asm.h b/arch/xtensa/variants/s6000/include/variant/tie-asm.h new file mode 100644 index 000000000000..f02d0a3a2e20 --- /dev/null +++ b/arch/xtensa/variants/s6000/include/variant/tie-asm.h | |||
@@ -0,0 +1,304 @@ | |||
1 | /* | ||
2 | * This header file contains assembly-language definitions (assembly | ||
3 | * macros, etc.) for this specific Xtensa processor's TIE extensions | ||
4 | * and options. It is customized to this Xtensa processor configuration. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 1999-2008 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_CORE_TIE_ASM_H | ||
14 | #define _XTENSA_CORE_TIE_ASM_H | ||
15 | |||
16 | /* Selection parameter values for save-area save/restore macros: */ | ||
17 | /* Option vs. TIE: */ | ||
18 | #define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */ | ||
19 | #define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */ | ||
20 | /* Whether used automatically by compiler: */ | ||
21 | #define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */ | ||
22 | #define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */ | ||
23 | /* ABI handling across function calls: */ | ||
24 | #define XTHAL_SAS_CALR 0x0010 /* caller-saved */ | ||
25 | #define XTHAL_SAS_CALE 0x0020 /* callee-saved */ | ||
26 | #define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */ | ||
27 | /* Misc */ | ||
28 | #define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */ | ||
29 | |||
30 | |||
31 | |||
32 | /* Macro to save all non-coprocessor (extra) custom TIE and optional state | ||
33 | * (not including zero-overhead loop registers). | ||
34 | * Save area ptr (clobbered): ptr (16 byte aligned) | ||
35 | * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed) | ||
36 | */ | ||
37 | .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL | ||
38 | xchal_sa_start \continue, \ofs | ||
39 | .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select | ||
40 | xchal_sa_align \ptr, 0, 1024-4, 4, 4 | ||
41 | rsr \at1, BR // boolean option | ||
42 | s32i \at1, \ptr, .Lxchal_ofs_ + 0 | ||
43 | .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 | ||
44 | .endif | ||
45 | .endm // xchal_ncp_store | ||
46 | |||
47 | /* Macro to save all non-coprocessor (extra) custom TIE and optional state | ||
48 | * (not including zero-overhead loop registers). | ||
49 | * Save area ptr (clobbered): ptr (16 byte aligned) | ||
50 | * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed) | ||
51 | */ | ||
52 | .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL | ||
53 | xchal_sa_start \continue, \ofs | ||
54 | .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select | ||
55 | xchal_sa_align \ptr, 0, 1024-4, 4, 4 | ||
56 | l32i \at1, \ptr, .Lxchal_ofs_ + 0 | ||
57 | wsr \at1, BR // boolean option | ||
58 | .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 | ||
59 | .endif | ||
60 | .endm // xchal_ncp_load | ||
61 | |||
62 | |||
63 | |||
64 | #define XCHAL_NCP_NUM_ATMPS 1 | ||
65 | |||
66 | |||
67 | |||
68 | /* Macro to save the state of TIE coprocessor FPU. | ||
69 | * Save area ptr (clobbered): ptr (16 byte aligned) | ||
70 | * Scratch regs (clobbered): at1..at4 (only first XCHAL_CP0_NUM_ATMPS needed) | ||
71 | */ | ||
72 | #define xchal_cp_FPU_store xchal_cp0_store | ||
73 | /* #define xchal_cp_FPU_store_a2 xchal_cp0_store a2 a3 a4 a5 a6 */ | ||
74 | .macro xchal_cp0_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL | ||
75 | xchal_sa_start \continue, \ofs | ||
76 | .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select | ||
77 | xchal_sa_align \ptr, 0, 0, 1, 16 | ||
78 | rur232 \at1 // FCR | ||
79 | s32i \at1, \ptr, 0 | ||
80 | rur233 \at1 // FSR | ||
81 | s32i \at1, \ptr, 4 | ||
82 | SSI f0, \ptr, 8 | ||
83 | SSI f1, \ptr, 12 | ||
84 | SSI f2, \ptr, 16 | ||
85 | SSI f3, \ptr, 20 | ||
86 | SSI f4, \ptr, 24 | ||
87 | SSI f5, \ptr, 28 | ||
88 | SSI f6, \ptr, 32 | ||
89 | SSI f7, \ptr, 36 | ||
90 | SSI f8, \ptr, 40 | ||
91 | SSI f9, \ptr, 44 | ||
92 | SSI f10, \ptr, 48 | ||
93 | SSI f11, \ptr, 52 | ||
94 | SSI f12, \ptr, 56 | ||
95 | SSI f13, \ptr, 60 | ||
96 | SSI f14, \ptr, 64 | ||
97 | SSI f15, \ptr, 68 | ||
98 | .set .Lxchal_ofs_, .Lxchal_ofs_ + 72 | ||
99 | .endif | ||
100 | .endm // xchal_cp0_store | ||
101 | |||
102 | /* Macro to restore the state of TIE coprocessor FPU. | ||
103 | * Save area ptr (clobbered): ptr (16 byte aligned) | ||
104 | * Scratch regs (clobbered): at1..at4 (only first XCHAL_CP0_NUM_ATMPS needed) | ||
105 | */ | ||
106 | #define xchal_cp_FPU_load xchal_cp0_load | ||
107 | /* #define xchal_cp_FPU_load_a2 xchal_cp0_load a2 a3 a4 a5 a6 */ | ||
108 | .macro xchal_cp0_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL | ||
109 | xchal_sa_start \continue, \ofs | ||
110 | .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select | ||
111 | xchal_sa_align \ptr, 0, 0, 1, 16 | ||
112 | l32i \at1, \ptr, 0 | ||
113 | wur232 \at1 // FCR | ||
114 | l32i \at1, \ptr, 4 | ||
115 | wur233 \at1 // FSR | ||
116 | LSI f0, \ptr, 8 | ||
117 | LSI f1, \ptr, 12 | ||
118 | LSI f2, \ptr, 16 | ||
119 | LSI f3, \ptr, 20 | ||
120 | LSI f4, \ptr, 24 | ||
121 | LSI f5, \ptr, 28 | ||
122 | LSI f6, \ptr, 32 | ||
123 | LSI f7, \ptr, 36 | ||
124 | LSI f8, \ptr, 40 | ||
125 | LSI f9, \ptr, 44 | ||
126 | LSI f10, \ptr, 48 | ||
127 | LSI f11, \ptr, 52 | ||
128 | LSI f12, \ptr, 56 | ||
129 | LSI f13, \ptr, 60 | ||
130 | LSI f14, \ptr, 64 | ||
131 | LSI f15, \ptr, 68 | ||
132 | .set .Lxchal_ofs_, .Lxchal_ofs_ + 72 | ||
133 | .endif | ||
134 | .endm // xchal_cp0_load | ||
135 | |||
136 | #define XCHAL_CP0_NUM_ATMPS 1 | ||
137 | |||
138 | /* Macro to save the state of TIE coprocessor XAD. | ||
139 | * Save area ptr (clobbered): ptr (16 byte aligned) | ||
140 | * Scratch regs (clobbered): at1..at4 (only first XCHAL_CP6_NUM_ATMPS needed) | ||
141 | */ | ||
142 | #define xchal_cp_XAD_store xchal_cp6_store | ||
143 | /* #define xchal_cp_XAD_store_a2 xchal_cp6_store a2 a3 a4 a5 a6 */ | ||
144 | .macro xchal_cp6_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL | ||
145 | xchal_sa_start \continue, \ofs | ||
146 | .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select | ||
147 | xchal_sa_align \ptr, 0, 0, 1, 16 | ||
148 | rur0 \at1 // LDCBHI | ||
149 | s32i \at1, \ptr, 0 | ||
150 | rur1 \at1 // LDCBLO | ||
151 | s32i \at1, \ptr, 4 | ||
152 | rur2 \at1 // STCBHI | ||
153 | s32i \at1, \ptr, 8 | ||
154 | rur3 \at1 // STCBLO | ||
155 | s32i \at1, \ptr, 12 | ||
156 | rur8 \at1 // LDBRBASE | ||
157 | s32i \at1, \ptr, 16 | ||
158 | rur9 \at1 // LDBROFF | ||
159 | s32i \at1, \ptr, 20 | ||
160 | rur10 \at1 // LDBRINC | ||
161 | s32i \at1, \ptr, 24 | ||
162 | rur11 \at1 // STBRBASE | ||
163 | s32i \at1, \ptr, 28 | ||
164 | rur12 \at1 // STBROFF | ||
165 | s32i \at1, \ptr, 32 | ||
166 | rur13 \at1 // STBRINC | ||
167 | s32i \at1, \ptr, 36 | ||
168 | rur24 \at1 // SCRATCH0 | ||
169 | s32i \at1, \ptr, 40 | ||
170 | rur25 \at1 // SCRATCH1 | ||
171 | s32i \at1, \ptr, 44 | ||
172 | rur26 \at1 // SCRATCH2 | ||
173 | s32i \at1, \ptr, 48 | ||
174 | rur27 \at1 // SCRATCH3 | ||
175 | s32i \at1, \ptr, 52 | ||
176 | WRAS128I wra0, \ptr, 64 | ||
177 | WRAS128I wra1, \ptr, 80 | ||
178 | WRAS128I wra2, \ptr, 96 | ||
179 | WRAS128I wra3, \ptr, 112 | ||
180 | WRAS128I wra4, \ptr, 128 | ||
181 | WRAS128I wra5, \ptr, 144 | ||
182 | WRAS128I wra6, \ptr, 160 | ||
183 | WRAS128I wra7, \ptr, 176 | ||
184 | WRAS128I wra8, \ptr, 192 | ||
185 | WRAS128I wra9, \ptr, 208 | ||
186 | WRAS128I wra10, \ptr, 224 | ||
187 | WRAS128I wra11, \ptr, 240 | ||
188 | WRAS128I wra12, \ptr, 256 | ||
189 | WRAS128I wra13, \ptr, 272 | ||
190 | WRAS128I wra14, \ptr, 288 | ||
191 | WRAS128I wra15, \ptr, 304 | ||
192 | WRBS128I wrb0, \ptr, 320 | ||
193 | WRBS128I wrb1, \ptr, 336 | ||
194 | WRBS128I wrb2, \ptr, 352 | ||
195 | WRBS128I wrb3, \ptr, 368 | ||
196 | WRBS128I wrb4, \ptr, 384 | ||
197 | WRBS128I wrb5, \ptr, 400 | ||
198 | WRBS128I wrb6, \ptr, 416 | ||
199 | WRBS128I wrb7, \ptr, 432 | ||
200 | WRBS128I wrb8, \ptr, 448 | ||
201 | WRBS128I wrb9, \ptr, 464 | ||
202 | WRBS128I wrb10, \ptr, 480 | ||
203 | WRBS128I wrb11, \ptr, 496 | ||
204 | WRBS128I wrb12, \ptr, 512 | ||
205 | WRBS128I wrb13, \ptr, 528 | ||
206 | WRBS128I wrb14, \ptr, 544 | ||
207 | WRBS128I wrb15, \ptr, 560 | ||
208 | .set .Lxchal_ofs_, .Lxchal_ofs_ + 576 | ||
209 | .endif | ||
210 | .endm // xchal_cp6_store | ||
211 | |||
212 | /* Macro to restore the state of TIE coprocessor XAD. | ||
213 | * Save area ptr (clobbered): ptr (16 byte aligned) | ||
214 | * Scratch regs (clobbered): at1..at4 (only first XCHAL_CP6_NUM_ATMPS needed) | ||
215 | */ | ||
216 | #define xchal_cp_XAD_load xchal_cp6_load | ||
217 | /* #define xchal_cp_XAD_load_a2 xchal_cp6_load a2 a3 a4 a5 a6 */ | ||
218 | .macro xchal_cp6_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL | ||
219 | xchal_sa_start \continue, \ofs | ||
220 | .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select | ||
221 | xchal_sa_align \ptr, 0, 0, 1, 16 | ||
222 | l32i \at1, \ptr, 0 | ||
223 | wur0 \at1 // LDCBHI | ||
224 | l32i \at1, \ptr, 4 | ||
225 | wur1 \at1 // LDCBLO | ||
226 | l32i \at1, \ptr, 8 | ||
227 | wur2 \at1 // STCBHI | ||
228 | l32i \at1, \ptr, 12 | ||
229 | wur3 \at1 // STCBLO | ||
230 | l32i \at1, \ptr, 16 | ||
231 | wur8 \at1 // LDBRBASE | ||
232 | l32i \at1, \ptr, 20 | ||
233 | wur9 \at1 // LDBROFF | ||
234 | l32i \at1, \ptr, 24 | ||
235 | wur10 \at1 // LDBRINC | ||
236 | l32i \at1, \ptr, 28 | ||
237 | wur11 \at1 // STBRBASE | ||
238 | l32i \at1, \ptr, 32 | ||
239 | wur12 \at1 // STBROFF | ||
240 | l32i \at1, \ptr, 36 | ||
241 | wur13 \at1 // STBRINC | ||
242 | l32i \at1, \ptr, 40 | ||
243 | wur24 \at1 // SCRATCH0 | ||
244 | l32i \at1, \ptr, 44 | ||
245 | wur25 \at1 // SCRATCH1 | ||
246 | l32i \at1, \ptr, 48 | ||
247 | wur26 \at1 // SCRATCH2 | ||
248 | l32i \at1, \ptr, 52 | ||
249 | wur27 \at1 // SCRATCH3 | ||
250 | WRBL128I wrb0, \ptr, 320 | ||
251 | WRBL128I wrb1, \ptr, 336 | ||
252 | WRBL128I wrb2, \ptr, 352 | ||
253 | WRBL128I wrb3, \ptr, 368 | ||
254 | WRBL128I wrb4, \ptr, 384 | ||
255 | WRBL128I wrb5, \ptr, 400 | ||
256 | WRBL128I wrb6, \ptr, 416 | ||
257 | WRBL128I wrb7, \ptr, 432 | ||
258 | WRBL128I wrb8, \ptr, 448 | ||
259 | WRBL128I wrb9, \ptr, 464 | ||
260 | WRBL128I wrb10, \ptr, 480 | ||
261 | WRBL128I wrb11, \ptr, 496 | ||
262 | WRBL128I wrb12, \ptr, 512 | ||
263 | WRBL128I wrb13, \ptr, 528 | ||
264 | WRBL128I wrb14, \ptr, 544 | ||
265 | WRBL128I wrb15, \ptr, 560 | ||
266 | WRAL128I wra0, \ptr, 64 | ||
267 | WRAL128I wra1, \ptr, 80 | ||
268 | WRAL128I wra2, \ptr, 96 | ||
269 | WRAL128I wra3, \ptr, 112 | ||
270 | WRAL128I wra4, \ptr, 128 | ||
271 | WRAL128I wra5, \ptr, 144 | ||
272 | WRAL128I wra6, \ptr, 160 | ||
273 | WRAL128I wra7, \ptr, 176 | ||
274 | WRAL128I wra8, \ptr, 192 | ||
275 | WRAL128I wra9, \ptr, 208 | ||
276 | WRAL128I wra10, \ptr, 224 | ||
277 | WRAL128I wra11, \ptr, 240 | ||
278 | WRAL128I wra12, \ptr, 256 | ||
279 | WRAL128I wra13, \ptr, 272 | ||
280 | WRAL128I wra14, \ptr, 288 | ||
281 | WRAL128I wra15, \ptr, 304 | ||
282 | .set .Lxchal_ofs_, .Lxchal_ofs_ + 576 | ||
283 | .endif | ||
284 | .endm // xchal_cp6_load | ||
285 | |||
286 | #define XCHAL_CP6_NUM_ATMPS 1 | ||
287 | #define XCHAL_SA_NUM_ATMPS 1 | ||
288 | |||
289 | /* Empty macros for unconfigured coprocessors: */ | ||
290 | .macro xchal_cp1_store p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
291 | .macro xchal_cp1_load p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
292 | .macro xchal_cp2_store p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
293 | .macro xchal_cp2_load p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
294 | .macro xchal_cp3_store p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
295 | .macro xchal_cp3_load p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
296 | .macro xchal_cp4_store p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
297 | .macro xchal_cp4_load p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
298 | .macro xchal_cp5_store p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
299 | .macro xchal_cp5_load p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
300 | .macro xchal_cp7_store p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
301 | .macro xchal_cp7_load p a b c d continue=0 ofs=-1 select=-1 ; .endm | ||
302 | |||
303 | #endif /*_XTENSA_CORE_TIE_ASM_H*/ | ||
304 | |||
diff --git a/arch/xtensa/variants/s6000/include/variant/tie.h b/arch/xtensa/variants/s6000/include/variant/tie.h new file mode 100644 index 000000000000..be7ea843d5df --- /dev/null +++ b/arch/xtensa/variants/s6000/include/variant/tie.h | |||
@@ -0,0 +1,191 @@ | |||
1 | /* | ||
2 | * This header file describes this specific Xtensa processor's TIE extensions | ||
3 | * that extend basic Xtensa core functionality. It is customized to this | ||
4 | * Xtensa processor configuration. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | * | ||
10 | * Copyright (C) 1999-2008 Tensilica Inc. | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_CORE_TIE_H | ||
14 | #define _XTENSA_CORE_TIE_H | ||
15 | |||
16 | #define XCHAL_CP_NUM 2 /* number of coprocessors */ | ||
17 | #define XCHAL_CP_MAX 7 /* max CP ID + 1 (0 if none) */ | ||
18 | #define XCHAL_CP_MASK 0x41 /* bitmask of all CPs by ID */ | ||
19 | #define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */ | ||
20 | |||
21 | /* Basic parameters of each coprocessor: */ | ||
22 | #define XCHAL_CP0_NAME "FPU" | ||
23 | #define XCHAL_CP0_IDENT FPU | ||
24 | #define XCHAL_CP0_SA_SIZE 72 /* size of state save area */ | ||
25 | #define XCHAL_CP0_SA_ALIGN 4 /* min alignment of save area */ | ||
26 | #define XCHAL_CP_ID_FPU 0 /* coprocessor ID (0..7) */ | ||
27 | #define XCHAL_CP6_NAME "XAD" | ||
28 | #define XCHAL_CP6_IDENT XAD | ||
29 | #define XCHAL_CP6_SA_SIZE 576 /* size of state save area */ | ||
30 | #define XCHAL_CP6_SA_ALIGN 16 /* min alignment of save area */ | ||
31 | #define XCHAL_CP_ID_XAD 6 /* coprocessor ID (0..7) */ | ||
32 | |||
33 | /* Filler info for unassigned coprocessors, to simplify arrays etc: */ | ||
34 | #define XCHAL_CP1_SA_SIZE 0 | ||
35 | #define XCHAL_CP1_SA_ALIGN 1 | ||
36 | #define XCHAL_CP2_SA_SIZE 0 | ||
37 | #define XCHAL_CP2_SA_ALIGN 1 | ||
38 | #define XCHAL_CP3_SA_SIZE 0 | ||
39 | #define XCHAL_CP3_SA_ALIGN 1 | ||
40 | #define XCHAL_CP4_SA_SIZE 0 | ||
41 | #define XCHAL_CP4_SA_ALIGN 1 | ||
42 | #define XCHAL_CP5_SA_SIZE 0 | ||
43 | #define XCHAL_CP5_SA_ALIGN 1 | ||
44 | #define XCHAL_CP7_SA_SIZE 0 | ||
45 | #define XCHAL_CP7_SA_ALIGN 1 | ||
46 | |||
47 | /* Save area for non-coprocessor optional and custom (TIE) state: */ | ||
48 | #define XCHAL_NCP_SA_SIZE 4 | ||
49 | #define XCHAL_NCP_SA_ALIGN 4 | ||
50 | |||
51 | /* Total save area for optional and custom state (NCP + CPn): */ | ||
52 | #define XCHAL_TOTAL_SA_SIZE 672 /* with 16-byte align padding */ | ||
53 | #define XCHAL_TOTAL_SA_ALIGN 16 /* actual minimum alignment */ | ||
54 | |||
55 | /* | ||
56 | * Detailed contents of save areas. | ||
57 | * NOTE: caller must define the XCHAL_SA_REG macro (not defined here) | ||
58 | * before expanding the XCHAL_xxx_SA_LIST() macros. | ||
59 | * | ||
60 | * XCHAL_SA_REG(s,ccused,abikind,kind,opt,name,galign,align,asize, | ||
61 | * dbnum,base,regnum,bitsz,gapsz,reset,x...) | ||
62 | * | ||
63 | * s = passed from XCHAL_*_LIST(s), eg. to select how to expand | ||
64 | * ccused = set if used by compiler without special options or code | ||
65 | * abikind = 0 (caller-saved), 1 (callee-saved), or 2 (thread-global) | ||
66 | * kind = 0 (special reg), 1 (TIE user reg), or 2 (TIE regfile reg) | ||
67 | * opt = 0 (custom TIE extension or coprocessor), or 1 (optional reg) | ||
68 | * name = lowercase reg name (no quotes) | ||
69 | * galign = group byte alignment (power of 2) (galign >= align) | ||
70 | * align = register byte alignment (power of 2) | ||
71 | * asize = allocated size in bytes (asize*8 == bitsz + gapsz + padsz) | ||
72 | * (not including any pad bytes required to galign this or next reg) | ||
73 | * dbnum = unique target number f/debug (see <xtensa-libdb-macros.h>) | ||
74 | * base = reg shortname w/o index (or sr=special, ur=TIE user reg) | ||
75 | * regnum = reg index in regfile, or special/TIE-user reg number | ||
76 | * bitsz = number of significant bits (regfile width, or ur/sr mask bits) | ||
77 | * gapsz = intervening bits, if bitsz bits not stored contiguously | ||
78 | * (padsz = pad bits at end [TIE regfile] or at msbits [ur,sr] of asize) | ||
79 | * reset = register reset value (or 0 if undefined at reset) | ||
80 | * x = reserved for future use (0 until then) | ||
81 | * | ||
82 | * To filter out certain registers, e.g. to expand only the non-global | ||
83 | * registers used by the compiler, you can do something like this: | ||
84 | * | ||
85 | * #define XCHAL_SA_REG(s,ccused,p...) SELCC##ccused(p) | ||
86 | * #define SELCC0(p...) | ||
87 | * #define SELCC1(abikind,p...) SELAK##abikind(p) | ||
88 | * #define SELAK0(p...) REG(p) | ||
89 | * #define SELAK1(p...) REG(p) | ||
90 | * #define SELAK2(p...) | ||
91 | * #define REG(kind,tie,name,galn,aln,asz,csz,dbnum,base,rnum,bsz,rst,x...) \ | ||
92 | * ...what you want to expand... | ||
93 | */ | ||
94 | |||
95 | #define XCHAL_NCP_SA_NUM 1 | ||
96 | #define XCHAL_NCP_SA_LIST(s) \ | ||
97 | XCHAL_SA_REG(s,0,0,0,1, br, 4, 4, 4,0x0204, sr,4 , 16,0,0,0) | ||
98 | |||
99 | #define XCHAL_CP0_SA_NUM 18 | ||
100 | #define XCHAL_CP0_SA_LIST(s) \ | ||
101 | XCHAL_SA_REG(s,0,0,1,0, fcr, 4, 4, 4,0x03E8, ur,232, 32,0,0,0) \ | ||
102 | XCHAL_SA_REG(s,0,0,1,0, fsr, 4, 4, 4,0x03E9, ur,233, 32,0,0,0) \ | ||
103 | XCHAL_SA_REG(s,0,0,2,0, f0, 4, 4, 4,0x0030, f,0 , 32,0,0,0) \ | ||
104 | XCHAL_SA_REG(s,0,0,2,0, f1, 4, 4, 4,0x0031, f,1 , 32,0,0,0) \ | ||
105 | XCHAL_SA_REG(s,0,0,2,0, f2, 4, 4, 4,0x0032, f,2 , 32,0,0,0) \ | ||
106 | XCHAL_SA_REG(s,0,0,2,0, f3, 4, 4, 4,0x0033, f,3 , 32,0,0,0) \ | ||
107 | XCHAL_SA_REG(s,0,0,2,0, f4, 4, 4, 4,0x0034, f,4 , 32,0,0,0) \ | ||
108 | XCHAL_SA_REG(s,0,0,2,0, f5, 4, 4, 4,0x0035, f,5 , 32,0,0,0) \ | ||
109 | XCHAL_SA_REG(s,0,0,2,0, f6, 4, 4, 4,0x0036, f,6 , 32,0,0,0) \ | ||
110 | XCHAL_SA_REG(s,0,0,2,0, f7, 4, 4, 4,0x0037, f,7 , 32,0,0,0) \ | ||
111 | XCHAL_SA_REG(s,0,0,2,0, f8, 4, 4, 4,0x0038, f,8 , 32,0,0,0) \ | ||
112 | XCHAL_SA_REG(s,0,0,2,0, f9, 4, 4, 4,0x0039, f,9 , 32,0,0,0) \ | ||
113 | XCHAL_SA_REG(s,0,0,2,0, f10, 4, 4, 4,0x003A, f,10 , 32,0,0,0) \ | ||
114 | XCHAL_SA_REG(s,0,0,2,0, f11, 4, 4, 4,0x003B, f,11 , 32,0,0,0) \ | ||
115 | XCHAL_SA_REG(s,0,0,2,0, f12, 4, 4, 4,0x003C, f,12 , 32,0,0,0) \ | ||
116 | XCHAL_SA_REG(s,0,0,2,0, f13, 4, 4, 4,0x003D, f,13 , 32,0,0,0) \ | ||
117 | XCHAL_SA_REG(s,0,0,2,0, f14, 4, 4, 4,0x003E, f,14 , 32,0,0,0) \ | ||
118 | XCHAL_SA_REG(s,0,0,2,0, f15, 4, 4, 4,0x003F, f,15 , 32,0,0,0) | ||
119 | |||
120 | #define XCHAL_CP1_SA_NUM 0 | ||
121 | #define XCHAL_CP1_SA_LIST(s) /* empty */ | ||
122 | |||
123 | #define XCHAL_CP2_SA_NUM 0 | ||
124 | #define XCHAL_CP2_SA_LIST(s) /* empty */ | ||
125 | |||
126 | #define XCHAL_CP3_SA_NUM 0 | ||
127 | #define XCHAL_CP3_SA_LIST(s) /* empty */ | ||
128 | |||
129 | #define XCHAL_CP4_SA_NUM 0 | ||
130 | #define XCHAL_CP4_SA_LIST(s) /* empty */ | ||
131 | |||
132 | #define XCHAL_CP5_SA_NUM 0 | ||
133 | #define XCHAL_CP5_SA_LIST(s) /* empty */ | ||
134 | |||
135 | #define XCHAL_CP6_SA_NUM 46 | ||
136 | #define XCHAL_CP6_SA_LIST(s) \ | ||
137 | XCHAL_SA_REG(s,0,0,1,0, ldcbhi,16, 4, 4,0x0300, ur,0 , 32,0,0,0) \ | ||
138 | XCHAL_SA_REG(s,0,0,1,0, ldcblo, 4, 4, 4,0x0301, ur,1 , 32,0,0,0) \ | ||
139 | XCHAL_SA_REG(s,0,0,1,0, stcbhi, 4, 4, 4,0x0302, ur,2 , 32,0,0,0) \ | ||
140 | XCHAL_SA_REG(s,0,0,1,0, stcblo, 4, 4, 4,0x0303, ur,3 , 32,0,0,0) \ | ||
141 | XCHAL_SA_REG(s,0,0,1,0, ldbrbase, 4, 4, 4,0x0308, ur,8 , 32,0,0,0) \ | ||
142 | XCHAL_SA_REG(s,0,0,1,0, ldbroff, 4, 4, 4,0x0309, ur,9 , 32,0,0,0) \ | ||
143 | XCHAL_SA_REG(s,0,0,1,0, ldbrinc, 4, 4, 4,0x030A, ur,10 , 32,0,0,0) \ | ||
144 | XCHAL_SA_REG(s,0,0,1,0, stbrbase, 4, 4, 4,0x030B, ur,11 , 32,0,0,0) \ | ||
145 | XCHAL_SA_REG(s,0,0,1,0, stbroff, 4, 4, 4,0x030C, ur,12 , 32,0,0,0) \ | ||
146 | XCHAL_SA_REG(s,0,0,1,0, stbrinc, 4, 4, 4,0x030D, ur,13 , 32,0,0,0) \ | ||
147 | XCHAL_SA_REG(s,0,0,1,0, scratch0, 4, 4, 4,0x0318, ur,24 , 32,0,0,0) \ | ||
148 | XCHAL_SA_REG(s,0,0,1,0, scratch1, 4, 4, 4,0x0319, ur,25 , 32,0,0,0) \ | ||
149 | XCHAL_SA_REG(s,0,0,1,0, scratch2, 4, 4, 4,0x031A, ur,26 , 32,0,0,0) \ | ||
150 | XCHAL_SA_REG(s,0,0,1,0, scratch3, 4, 4, 4,0x031B, ur,27 , 32,0,0,0) \ | ||
151 | XCHAL_SA_REG(s,0,0,2,0, wra0,16,16,16,0x1010, wra,0 ,128,0,0,0) \ | ||
152 | XCHAL_SA_REG(s,0,0,2,0, wra1,16,16,16,0x1011, wra,1 ,128,0,0,0) \ | ||
153 | XCHAL_SA_REG(s,0,0,2,0, wra2,16,16,16,0x1012, wra,2 ,128,0,0,0) \ | ||
154 | XCHAL_SA_REG(s,0,0,2,0, wra3,16,16,16,0x1013, wra,3 ,128,0,0,0) \ | ||
155 | XCHAL_SA_REG(s,0,0,2,0, wra4,16,16,16,0x1014, wra,4 ,128,0,0,0) \ | ||
156 | XCHAL_SA_REG(s,0,0,2,0, wra5,16,16,16,0x1015, wra,5 ,128,0,0,0) \ | ||
157 | XCHAL_SA_REG(s,0,0,2,0, wra6,16,16,16,0x1016, wra,6 ,128,0,0,0) \ | ||
158 | XCHAL_SA_REG(s,0,0,2,0, wra7,16,16,16,0x1017, wra,7 ,128,0,0,0) \ | ||
159 | XCHAL_SA_REG(s,0,0,2,0, wra8,16,16,16,0x1018, wra,8 ,128,0,0,0) \ | ||
160 | XCHAL_SA_REG(s,0,0,2,0, wra9,16,16,16,0x1019, wra,9 ,128,0,0,0) \ | ||
161 | XCHAL_SA_REG(s,0,0,2,0, wra10,16,16,16,0x101A, wra,10 ,128,0,0,0) \ | ||
162 | XCHAL_SA_REG(s,0,0,2,0, wra11,16,16,16,0x101B, wra,11 ,128,0,0,0) \ | ||
163 | XCHAL_SA_REG(s,0,0,2,0, wra12,16,16,16,0x101C, wra,12 ,128,0,0,0) \ | ||
164 | XCHAL_SA_REG(s,0,0,2,0, wra13,16,16,16,0x101D, wra,13 ,128,0,0,0) \ | ||
165 | XCHAL_SA_REG(s,0,0,2,0, wra14,16,16,16,0x101E, wra,14 ,128,0,0,0) \ | ||
166 | XCHAL_SA_REG(s,0,0,2,0, wra15,16,16,16,0x101F, wra,15 ,128,0,0,0) \ | ||
167 | XCHAL_SA_REG(s,0,0,2,0, wrb0,16,16,16,0x1020, wrb,0 ,128,0,0,0) \ | ||
168 | XCHAL_SA_REG(s,0,0,2,0, wrb1,16,16,16,0x1021, wrb,1 ,128,0,0,0) \ | ||
169 | XCHAL_SA_REG(s,0,0,2,0, wrb2,16,16,16,0x1022, wrb,2 ,128,0,0,0) \ | ||
170 | XCHAL_SA_REG(s,0,0,2,0, wrb3,16,16,16,0x1023, wrb,3 ,128,0,0,0) \ | ||
171 | XCHAL_SA_REG(s,0,0,2,0, wrb4,16,16,16,0x1024, wrb,4 ,128,0,0,0) \ | ||
172 | XCHAL_SA_REG(s,0,0,2,0, wrb5,16,16,16,0x1025, wrb,5 ,128,0,0,0) \ | ||
173 | XCHAL_SA_REG(s,0,0,2,0, wrb6,16,16,16,0x1026, wrb,6 ,128,0,0,0) \ | ||
174 | XCHAL_SA_REG(s,0,0,2,0, wrb7,16,16,16,0x1027, wrb,7 ,128,0,0,0) \ | ||
175 | XCHAL_SA_REG(s,0,0,2,0, wrb8,16,16,16,0x1028, wrb,8 ,128,0,0,0) \ | ||
176 | XCHAL_SA_REG(s,0,0,2,0, wrb9,16,16,16,0x1029, wrb,9 ,128,0,0,0) \ | ||
177 | XCHAL_SA_REG(s,0,0,2,0, wrb10,16,16,16,0x102A, wrb,10 ,128,0,0,0) \ | ||
178 | XCHAL_SA_REG(s,0,0,2,0, wrb11,16,16,16,0x102B, wrb,11 ,128,0,0,0) \ | ||
179 | XCHAL_SA_REG(s,0,0,2,0, wrb12,16,16,16,0x102C, wrb,12 ,128,0,0,0) \ | ||
180 | XCHAL_SA_REG(s,0,0,2,0, wrb13,16,16,16,0x102D, wrb,13 ,128,0,0,0) \ | ||
181 | XCHAL_SA_REG(s,0,0,2,0, wrb14,16,16,16,0x102E, wrb,14 ,128,0,0,0) \ | ||
182 | XCHAL_SA_REG(s,0,0,2,0, wrb15,16,16,16,0x102F, wrb,15 ,128,0,0,0) | ||
183 | |||
184 | #define XCHAL_CP7_SA_NUM 0 | ||
185 | #define XCHAL_CP7_SA_LIST(s) /* empty */ | ||
186 | |||
187 | /* Byte length of instruction from its first nibble (op0 field), per FLIX. */ | ||
188 | #define XCHAL_OP0_FORMAT_LENGTHS 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,8 | ||
189 | |||
190 | #endif /*_XTENSA_CORE_TIE_H*/ | ||
191 | |||
diff --git a/arch/xtensa/variants/s6000/irq.c b/arch/xtensa/variants/s6000/irq.c new file mode 100644 index 000000000000..6651e3285fcf --- /dev/null +++ b/arch/xtensa/variants/s6000/irq.c | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * s6000 irq crossbar | ||
3 | * | ||
4 | * Copyright (c) 2009 emlix GmbH | ||
5 | * Authors: Johannes Weiner <jw@emlix.com> | ||
6 | * Oskar Schirmer <os@emlix.com> | ||
7 | */ | ||
8 | #include <linux/io.h> | ||
9 | #include <asm/irq.h> | ||
10 | #include <variant/hardware.h> | ||
11 | |||
12 | /* S6_REG_INTC */ | ||
13 | #define INTC_STATUS 0x000 | ||
14 | #define INTC_RAW 0x010 | ||
15 | #define INTC_STATUS_AG 0x100 | ||
16 | #define INTC_CFG(n) (0x200 + 4 * (n)) | ||
17 | |||
18 | /* | ||
19 | * The s6000 has a crossbar that multiplexes interrupt output lines | ||
20 | * from the peripherals to input lines on the xtensa core. | ||
21 | * | ||
22 | * We leave the mapping decisions to the platform as it depends on the | ||
23 | * actually connected peripherals which distribution makes sense. | ||
24 | */ | ||
25 | extern const signed char *platform_irq_mappings[NR_IRQS]; | ||
26 | |||
27 | static unsigned long scp_to_intc_enable[] = { | ||
28 | #define TO_INTC_ENABLE(n) (((n) << 1) + 1) | ||
29 | TO_INTC_ENABLE(0), | ||
30 | TO_INTC_ENABLE(1), | ||
31 | TO_INTC_ENABLE(2), | ||
32 | TO_INTC_ENABLE(3), | ||
33 | TO_INTC_ENABLE(4), | ||
34 | TO_INTC_ENABLE(5), | ||
35 | TO_INTC_ENABLE(6), | ||
36 | TO_INTC_ENABLE(7), | ||
37 | TO_INTC_ENABLE(8), | ||
38 | TO_INTC_ENABLE(9), | ||
39 | TO_INTC_ENABLE(10), | ||
40 | TO_INTC_ENABLE(11), | ||
41 | TO_INTC_ENABLE(12), | ||
42 | -1, | ||
43 | -1, | ||
44 | TO_INTC_ENABLE(13), | ||
45 | -1, | ||
46 | TO_INTC_ENABLE(14), | ||
47 | -1, | ||
48 | TO_INTC_ENABLE(15), | ||
49 | #undef TO_INTC_ENABLE | ||
50 | }; | ||
51 | |||
52 | static void irq_set(unsigned int irq, int enable) | ||
53 | { | ||
54 | unsigned long en; | ||
55 | const signed char *m = platform_irq_mappings[irq]; | ||
56 | |||
57 | if (!m) | ||
58 | return; | ||
59 | en = enable ? scp_to_intc_enable[irq] : 0; | ||
60 | while (*m >= 0) { | ||
61 | writel(en, S6_REG_INTC + INTC_CFG(*m)); | ||
62 | m++; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | void variant_irq_enable(unsigned int irq) | ||
67 | { | ||
68 | irq_set(irq, 1); | ||
69 | } | ||
70 | |||
71 | void variant_irq_disable(unsigned int irq) | ||
72 | { | ||
73 | irq_set(irq, 0); | ||
74 | } | ||