aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/Kconfig30
-rw-r--r--arch/sh/Kconfig.debug13
-rw-r--r--arch/sh/Makefile1
-rw-r--r--arch/sh/boards/renesas/migor/setup.c197
-rw-r--r--arch/sh/boards/renesas/r7780rp/irq-r7780mp.c39
-rw-r--r--arch/sh/boards/renesas/r7780rp/setup.c42
-rw-r--r--arch/sh/boards/se/7721/Makefile1
-rw-r--r--arch/sh/boards/se/7721/irq.c45
-rw-r--r--arch/sh/boards/se/7721/setup.c99
-rw-r--r--arch/sh/boards/se/7722/setup.c41
-rw-r--r--arch/sh/configs/se7721_defconfig1085
-rw-r--r--arch/sh/kernel/cf-enabler.c15
-rw-r--r--arch/sh/kernel/cpu/sh2a/Makefile7
-rw-r--r--arch/sh/kernel/cpu/sh2a/probe.c3
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-mxg.c168
-rw-r--r--arch/sh/kernel/cpu/sh4/probe.c33
-rw-r--r--arch/sh/kernel/cpu/sh4a/Makefile2
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c28
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7723.c300
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7763.c10
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7770.c37
-rw-r--r--arch/sh/kernel/setup.c15
-rw-r--r--arch/sh/lib/clear_page.S6
-rw-r--r--arch/sh/lib/copy_page.S6
-rw-r--r--arch/sh/mm/cache-debugfs.c4
-rw-r--r--arch/sh/mm/pmb.c2
-rw-r--r--arch/sh/tools/mach-types5
-rw-r--r--arch/x86/Kconfig9
-rw-r--r--arch/x86/boot/a20.c2
-rw-r--r--arch/x86/boot/apm.c2
-rw-r--r--arch/x86/boot/bitops.h2
-rw-r--r--arch/x86/boot/boot.h2
-rw-r--r--arch/x86/boot/cmdline.c2
-rw-r--r--arch/x86/boot/compressed/head_32.S15
-rw-r--r--arch/x86/boot/compressed/head_64.S30
-rw-r--r--arch/x86/boot/compressed/misc.c8
-rw-r--r--arch/x86/boot/compressed/vmlinux_64.lds4
-rw-r--r--arch/x86/boot/copy.S2
-rw-r--r--arch/x86/boot/cpucheck.c2
-rw-r--r--arch/x86/boot/edd.c2
-rw-r--r--arch/x86/boot/install.sh2
-rw-r--r--arch/x86/boot/main.c2
-rw-r--r--arch/x86/boot/mca.c2
-rw-r--r--arch/x86/boot/memory.c2
-rw-r--r--arch/x86/boot/pm.c2
-rw-r--r--arch/x86/boot/pmjump.S2
-rw-r--r--arch/x86/boot/printf.c2
-rw-r--r--arch/x86/boot/string.c2
-rw-r--r--arch/x86/boot/tty.c2
-rw-r--r--arch/x86/boot/version.c2
-rw-r--r--arch/x86/boot/video-bios.c2
-rw-r--r--arch/x86/boot/video-vesa.c2
-rw-r--r--arch/x86/boot/video-vga.c2
-rw-r--r--arch/x86/boot/video.c2
-rw-r--r--arch/x86/boot/video.h2
-rw-r--r--arch/x86/boot/voyager.c2
-rw-r--r--arch/x86/kernel/Makefile9
-rw-r--r--arch/x86/kernel/acpi/cstate.c2
-rw-r--r--arch/x86/kernel/acpi/processor.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/p4-clockmod.c4
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c1
-rw-r--r--arch/x86/kernel/e820_32.c4
-rw-r--r--arch/x86/kernel/e820_64.c4
-rw-r--r--arch/x86/kernel/efi.c18
-rw-r--r--arch/x86/kernel/efi_64.c12
-rw-r--r--arch/x86/kernel/entry_32.S1
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c17
-rw-r--r--arch/x86/kernel/head64.c2
-rw-r--r--arch/x86/kernel/head_32.S1
-rw-r--r--arch/x86/kernel/i387.c114
-rw-r--r--arch/x86/kernel/kgdb.c6
-rw-r--r--arch/x86/kernel/nmi_32.c3
-rw-r--r--arch/x86/kernel/nmi_64.c6
-rw-r--r--arch/x86/kernel/pci-calgary_64.c3
-rw-r--r--arch/x86/kernel/pci-dma.c (renamed from arch/x86/kernel/pci-dma_64.c)546
-rw-r--r--arch/x86/kernel/pci-dma_32.c177
-rw-r--r--arch/x86/kernel/pci-gart_64.c15
-rw-r--r--arch/x86/kernel/pci-nommu.c (renamed from arch/x86/kernel/pci-nommu_64.c)34
-rw-r--r--arch/x86/kernel/pci-swiotlb_64.c9
-rw-r--r--arch/x86/kernel/process.c44
-rw-r--r--arch/x86/kernel/process_32.c50
-rw-r--r--arch/x86/kernel/process_64.c74
-rw-r--r--arch/x86/kernel/setup64.c4
-rw-r--r--arch/x86/kernel/setup_32.c4
-rw-r--r--arch/x86/kernel/setup_64.c9
-rw-r--r--arch/x86/kernel/smpboot.c29
-rw-r--r--arch/x86/kernel/traps_32.c35
-rw-r--r--arch/x86/kernel/traps_64.c36
-rw-r--r--arch/x86/kernel/tsc_32.c23
-rw-r--r--arch/x86/kernel/tsc_64.c23
-rw-r--r--arch/x86/mach-visws/visws_apic.c2
-rw-r--r--arch/x86/mach-voyager/voyager_basic.c2
-rw-r--r--arch/x86/mach-voyager/voyager_cat.c2
-rw-r--r--arch/x86/mach-voyager/voyager_smp.c2
-rw-r--r--arch/x86/mach-voyager/voyager_thread.c2
-rw-r--r--arch/x86/math-emu/fpu_entry.c4
-rw-r--r--arch/x86/math-emu/fpu_system.h26
-rw-r--r--arch/x86/math-emu/reg_ld_str.c4
-rw-r--r--arch/x86/mm/discontig_32.c6
-rw-r--r--arch/x86/mm/init_32.c1
-rw-r--r--arch/x86/mm/init_64.c3
-rw-r--r--arch/x86/mm/ioremap.c5
-rw-r--r--arch/x86/mm/k8topology_64.c2
-rw-r--r--arch/x86/mm/numa_64.c16
-rw-r--r--arch/x86/mm/pgtable_32.c4
-rw-r--r--arch/x86/mm/srat_64.c32
-rw-r--r--arch/x86/vdso/Makefile3
-rw-r--r--arch/x86/video/fbdev.c1
108 files changed, 3057 insertions, 729 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 8d2cd1de5726..6a679c3e15e8 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -167,6 +167,12 @@ config CPU_SUBTYPE_SH7263
167 select CPU_SH2A 167 select CPU_SH2A
168 select CPU_HAS_FPU 168 select CPU_HAS_FPU
169 169
170config CPU_SUBTYPE_MXG
171 bool "Support MX-G processor"
172 select CPU_SH2A
173 help
174 Select MX-G if running on an R8A03022BG part.
175
170# SH-3 Processor Support 176# SH-3 Processor Support
171 177
172config CPU_SUBTYPE_SH7705 178config CPU_SUBTYPE_SH7705
@@ -270,6 +276,15 @@ config CPU_SUBTYPE_SH4_202
270 276
271# SH-4A Processor Support 277# SH-4A Processor Support
272 278
279config CPU_SUBTYPE_SH7723
280 bool "Support SH7723 processor"
281 select CPU_SH4A
282 select CPU_SHX2
283 select ARCH_SPARSEMEM_ENABLE
284 select SYS_SUPPORTS_NUMA
285 help
286 Select SH7723 if you have an SH-MobileR2 CPU.
287
273config CPU_SUBTYPE_SH7763 288config CPU_SUBTYPE_SH7763
274 bool "Support SH7763 processor" 289 bool "Support SH7763 processor"
275 select CPU_SH4A 290 select CPU_SH4A
@@ -366,6 +381,14 @@ config SH_7619_SOLUTION_ENGINE
366 Select 7619 SolutionEngine if configuring for a Hitachi SH7619 381 Select 7619 SolutionEngine if configuring for a Hitachi SH7619
367 evaluation board. 382 evaluation board.
368 383
384config SH_7721_SOLUTION_ENGINE
385 bool "SolutionEngine7721"
386 select SOLUTION_ENGINE
387 depends on CPU_SUBTYPE_SH7721
388 help
389 Select 7721 SolutionEngine if configuring for a Hitachi SH7721
390 evaluation board.
391
369config SH_7722_SOLUTION_ENGINE 392config SH_7722_SOLUTION_ENGINE
370 bool "SolutionEngine7722" 393 bool "SolutionEngine7722"
371 select SOLUTION_ENGINE 394 select SOLUTION_ENGINE
@@ -560,7 +583,7 @@ config SH_TMU
560config SH_CMT 583config SH_CMT
561 def_bool y 584 def_bool y
562 prompt "CMT timer support" 585 prompt "CMT timer support"
563 depends on CPU_SH2 586 depends on CPU_SH2 && !CPU_SUBTYPE_MXG
564 help 587 help
565 This enables the use of the CMT as the system timer. 588 This enables the use of the CMT as the system timer.
566 589
@@ -578,6 +601,7 @@ config SH_TIMER_IRQ
578 default "86" if CPU_SUBTYPE_SH7619 601 default "86" if CPU_SUBTYPE_SH7619
579 default "140" if CPU_SUBTYPE_SH7206 602 default "140" if CPU_SUBTYPE_SH7206
580 default "142" if CPU_SUBTYPE_SH7203 603 default "142" if CPU_SUBTYPE_SH7203
604 default "238" if CPU_SUBTYPE_MXG
581 default "16" 605 default "16"
582 606
583config SH_PCLK_FREQ 607config SH_PCLK_FREQ
@@ -585,10 +609,10 @@ config SH_PCLK_FREQ
585 default "27000000" if CPU_SUBTYPE_SH7343 609 default "27000000" if CPU_SUBTYPE_SH7343
586 default "31250000" if CPU_SUBTYPE_SH7619 610 default "31250000" if CPU_SUBTYPE_SH7619
587 default "32000000" if CPU_SUBTYPE_SH7722 611 default "32000000" if CPU_SUBTYPE_SH7722
588 default "33333333" if CPU_SUBTYPE_SH7770 || \ 612 default "33333333" if CPU_SUBTYPE_SH7770 || CPU_SUBTYPE_SH7723 || \
589 CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \ 613 CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \
590 CPU_SUBTYPE_SH7203 || CPU_SUBTYPE_SH7206 || \ 614 CPU_SUBTYPE_SH7203 || CPU_SUBTYPE_SH7206 || \
591 CPU_SUBTYPE_SH7263 615 CPU_SUBTYPE_SH7263 || CPU_SUBTYPE_MXG
592 default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R 616 default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R
593 default "66000000" if CPU_SUBTYPE_SH4_202 617 default "66000000" if CPU_SUBTYPE_SH4_202
594 default "50000000" 618 default "50000000"
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
index 5dcb74b947a9..d9d28f9dd0db 100644
--- a/arch/sh/Kconfig.debug
+++ b/arch/sh/Kconfig.debug
@@ -29,16 +29,17 @@ config EARLY_SCIF_CONSOLE
29config EARLY_SCIF_CONSOLE_PORT 29config EARLY_SCIF_CONSOLE_PORT
30 hex 30 hex
31 depends on EARLY_SCIF_CONSOLE 31 depends on EARLY_SCIF_CONSOLE
32 default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763
33 default "0xffe00000" if CPU_SUBTYPE_SH7722 || CPU_SUBTYPE_SH7366
34 default "0xffea0000" if CPU_SUBTYPE_SH7785
35 default "0xfffe8000" if CPU_SUBTYPE_SH7203
36 default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263
37 default "0xf8420000" if CPU_SUBTYPE_SH7619
38 default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705 32 default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705
39 default "0xa4430000" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721 33 default "0xa4430000" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721
34 default "0xf8420000" if CPU_SUBTYPE_SH7619
35 default "0xff804000" if CPU_SUBTYPE_MXG
40 default "0xffc30000" if CPU_SUBTYPE_SHX3 36 default "0xffc30000" if CPU_SUBTYPE_SHX3
37 default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763 || \
38 CPU_SUBTYPE_SH7722 || CPU_SUBTYPE_SH7366
41 default "0xffe80000" if CPU_SH4 39 default "0xffe80000" if CPU_SH4
40 default "0xffea0000" if CPU_SUBTYPE_SH7785
41 default "0xfffe8000" if CPU_SUBTYPE_SH7203
42 default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263
42 default "0x00000000" 43 default "0x00000000"
43 44
44config EARLY_PRINTK 45config EARLY_PRINTK
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index cffc92b1bf2e..bb06f83e6239 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -107,6 +107,7 @@ machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE) += se/7722
107machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) += se/7751 107machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) += se/7751
108machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE) += se/7780 108machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE) += se/7780
109machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) += se/7343 109machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE) += se/7343
110machdir-$(CONFIG_SH_7721_SOLUTION_ENGINE) += se/7721
110machdir-$(CONFIG_SH_HP6XX) += hp6xx 111machdir-$(CONFIG_SH_HP6XX) += hp6xx
111machdir-$(CONFIG_SH_DREAMCAST) += dreamcast 112machdir-$(CONFIG_SH_DREAMCAST) += dreamcast
112machdir-$(CONFIG_SH_MPC1211) += mpc1211 113machdir-$(CONFIG_SH_MPC1211) += mpc1211
diff --git a/arch/sh/boards/renesas/migor/setup.c b/arch/sh/boards/renesas/migor/setup.c
index 21ab8c8fb590..00d52a20d8a5 100644
--- a/arch/sh/boards/renesas/migor/setup.c
+++ b/arch/sh/boards/renesas/migor/setup.c
@@ -10,8 +10,14 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/input.h>
14#include <linux/mtd/physmap.h>
15#include <linux/mtd/nand.h>
16#include <linux/i2c.h>
13#include <asm/machvec.h> 17#include <asm/machvec.h>
14#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/sh_keysc.h>
20#include <asm/migor.h>
15 21
16/* Address IRQ Size Bus Description 22/* Address IRQ Size Bus Description
17 * 0x00000000 64MB 16 NOR Flash (SP29PL256N) 23 * 0x00000000 64MB 16 NOR Flash (SP29PL256N)
@@ -23,9 +29,9 @@
23 29
24static struct resource smc91x_eth_resources[] = { 30static struct resource smc91x_eth_resources[] = {
25 [0] = { 31 [0] = {
26 .name = "smc91x-regs" , 32 .name = "SMC91C111" ,
27 .start = P2SEGADDR(0x10000300), 33 .start = 0x10000300,
28 .end = P2SEGADDR(0x1000030f), 34 .end = 0x1000030f,
29 .flags = IORESOURCE_MEM, 35 .flags = IORESOURCE_MEM,
30 }, 36 },
31 [1] = { 37 [1] = {
@@ -40,19 +46,202 @@ static struct platform_device smc91x_eth_device = {
40 .resource = smc91x_eth_resources, 46 .resource = smc91x_eth_resources,
41}; 47};
42 48
49static struct sh_keysc_info sh_keysc_info = {
50 .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
51 .scan_timing = 3,
52 .delay = 5,
53 .keycodes = {
54 0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
55 0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
56 0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
57 0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
58 0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
59 },
60};
61
62static struct resource sh_keysc_resources[] = {
63 [0] = {
64 .start = 0x044b0000,
65 .end = 0x044b000f,
66 .flags = IORESOURCE_MEM,
67 },
68 [1] = {
69 .start = 79,
70 .flags = IORESOURCE_IRQ,
71 },
72};
73
74static struct platform_device sh_keysc_device = {
75 .name = "sh_keysc",
76 .num_resources = ARRAY_SIZE(sh_keysc_resources),
77 .resource = sh_keysc_resources,
78 .dev = {
79 .platform_data = &sh_keysc_info,
80 },
81};
82
83static struct mtd_partition migor_nor_flash_partitions[] =
84{
85 {
86 .name = "uboot",
87 .offset = 0,
88 .size = (1 * 1024 * 1024),
89 .mask_flags = MTD_WRITEABLE, /* Read-only */
90 },
91 {
92 .name = "rootfs",
93 .offset = MTDPART_OFS_APPEND,
94 .size = (15 * 1024 * 1024),
95 },
96 {
97 .name = "other",
98 .offset = MTDPART_OFS_APPEND,
99 .size = MTDPART_SIZ_FULL,
100 },
101};
102
103static struct physmap_flash_data migor_nor_flash_data = {
104 .width = 2,
105 .parts = migor_nor_flash_partitions,
106 .nr_parts = ARRAY_SIZE(migor_nor_flash_partitions),
107};
108
109static struct resource migor_nor_flash_resources[] = {
110 [0] = {
111 .name = "NOR Flash",
112 .start = 0x00000000,
113 .end = 0x03ffffff,
114 .flags = IORESOURCE_MEM,
115 }
116};
117
118static struct platform_device migor_nor_flash_device = {
119 .name = "physmap-flash",
120 .resource = migor_nor_flash_resources,
121 .num_resources = ARRAY_SIZE(migor_nor_flash_resources),
122 .dev = {
123 .platform_data = &migor_nor_flash_data,
124 },
125};
126
127static struct mtd_partition migor_nand_flash_partitions[] = {
128 {
129 .name = "nanddata1",
130 .offset = 0x0,
131 .size = 512 * 1024 * 1024,
132 },
133 {
134 .name = "nanddata2",
135 .offset = MTDPART_OFS_APPEND,
136 .size = 512 * 1024 * 1024,
137 },
138};
139
140static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd,
141 unsigned int ctrl)
142{
143 struct nand_chip *chip = mtd->priv;
144
145 if (cmd == NAND_CMD_NONE)
146 return;
147
148 if (ctrl & NAND_CLE)
149 writeb(cmd, chip->IO_ADDR_W + 0x00400000);
150 else if (ctrl & NAND_ALE)
151 writeb(cmd, chip->IO_ADDR_W + 0x00800000);
152 else
153 writeb(cmd, chip->IO_ADDR_W);
154}
155
156static int migor_nand_flash_ready(struct mtd_info *mtd)
157{
158 return ctrl_inb(PORT_PADR) & 0x02; /* PTA1 */
159}
160
161struct platform_nand_data migor_nand_flash_data = {
162 .chip = {
163 .nr_chips = 1,
164 .partitions = migor_nand_flash_partitions,
165 .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
166 .chip_delay = 20,
167 .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
168 },
169 .ctrl = {
170 .dev_ready = migor_nand_flash_ready,
171 .cmd_ctrl = migor_nand_flash_cmd_ctl,
172 },
173};
174
175static struct resource migor_nand_flash_resources[] = {
176 [0] = {
177 .name = "NAND Flash",
178 .start = 0x18000000,
179 .end = 0x18ffffff,
180 .flags = IORESOURCE_MEM,
181 },
182};
183
184static struct platform_device migor_nand_flash_device = {
185 .name = "gen_nand",
186 .resource = migor_nand_flash_resources,
187 .num_resources = ARRAY_SIZE(migor_nand_flash_resources),
188 .dev = {
189 .platform_data = &migor_nand_flash_data,
190 }
191};
192
43static struct platform_device *migor_devices[] __initdata = { 193static struct platform_device *migor_devices[] __initdata = {
44 &smc91x_eth_device, 194 &smc91x_eth_device,
195 &sh_keysc_device,
196 &migor_nor_flash_device,
197 &migor_nand_flash_device,
198};
199
200static struct i2c_board_info __initdata migor_i2c_devices[] = {
201 {
202 I2C_BOARD_INFO("rtc-rs5c372", 0x32),
203 .type = "rs5c372b",
204 },
205 {
206 I2C_BOARD_INFO("migor_ts", 0x51),
207 .irq = 38, /* IRQ6 */
208 },
45}; 209};
46 210
47static int __init migor_devices_setup(void) 211static int __init migor_devices_setup(void)
48{ 212{
213 i2c_register_board_info(0, migor_i2c_devices,
214 ARRAY_SIZE(migor_i2c_devices));
215
49 return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); 216 return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
50} 217}
51__initcall(migor_devices_setup); 218__initcall(migor_devices_setup);
52 219
53static void __init migor_setup(char **cmdline_p) 220static void __init migor_setup(char **cmdline_p)
54{ 221{
55 ctrl_outw(0x1000, 0xa4050110); /* Enable IRQ0 in PJCR */ 222 /* SMC91C111 - Enable IRQ0 */
223 ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR);
224
225 /* KEYSC */
226 ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR);
227 ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR);
228 ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA);
229 ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
230 ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
231 ctrl_outl(ctrl_inl(MSTPCR2) & ~0x00004000, MSTPCR2);
232
233 /* NAND Flash */
234 ctrl_outw(ctrl_inw(PORT_PXCR) & 0x0fff, PORT_PXCR);
235 ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x00000600) | 0x00000200,
236 BSC_CS6ABCR);
237
238 /* I2C */
239 ctrl_outl(ctrl_inl(MSTPCR1) & ~0x00000200, MSTPCR1);
240
241 /* Touch Panel - Enable IRQ6 */
242 ctrl_outw(ctrl_inw(PORT_PZCR) & ~0xc, PORT_PZCR);
243 ctrl_outw((ctrl_inw(PORT_PSELA) | 0x8000), PORT_PSELA);
244 ctrl_outw((ctrl_inw(PORT_HIZCRC) & ~0x4000), PORT_HIZCRC);
56} 245}
57 246
58static struct sh_machine_vector mv_migor __initmv = { 247static struct sh_machine_vector mv_migor __initmv = {
diff --git a/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c b/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c
index 1f8f073f27be..68f0ad1b637d 100644
--- a/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c
+++ b/arch/sh/boards/renesas/r7780rp/irq-r7780mp.c
@@ -18,31 +18,44 @@ enum {
18 UNUSED = 0, 18 UNUSED = 0,
19 19
20 /* board specific interrupt sources */ 20 /* board specific interrupt sources */
21 AX88796, /* Ethernet controller */ 21 CF, /* Compact Flash */
22 CF, /* Compact Flash */ 22 TP, /* Touch panel */
23 PSW, /* Push Switch */ 23 SCIF1, /* FPGA SCIF1 */
24 EXT1, /* EXT1n IRQ */ 24 SCIF0, /* FPGA SCIF0 */
25 EXT4, /* EXT4n IRQ */ 25 SMBUS, /* SMBUS */
26 RTC, /* RTC Alarm */
27 AX88796, /* Ethernet controller */
28 PSW, /* Push Switch */
29
30 /* external bus connector */
31 EXT1, EXT2, EXT4, EXT5, EXT6,
26}; 32};
27 33
28static struct intc_vect vectors[] __initdata = { 34static struct intc_vect vectors[] __initdata = {
29 INTC_IRQ(CF, IRQ_CF), 35 INTC_IRQ(CF, IRQ_CF),
30 INTC_IRQ(PSW, IRQ_PSW), 36 INTC_IRQ(TP, IRQ_TP),
37 INTC_IRQ(SCIF1, IRQ_SCIF1),
38 INTC_IRQ(SCIF0, IRQ_SCIF0),
39 INTC_IRQ(SMBUS, IRQ_SMBUS),
40 INTC_IRQ(RTC, IRQ_RTC),
31 INTC_IRQ(AX88796, IRQ_AX88796), 41 INTC_IRQ(AX88796, IRQ_AX88796),
32 INTC_IRQ(EXT1, IRQ_EXT1), 42 INTC_IRQ(PSW, IRQ_PSW),
33 INTC_IRQ(EXT4, IRQ_EXT4), 43
44 INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2),
45 INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
46 INTC_IRQ(EXT6, IRQ_EXT6),
34}; 47};
35 48
36static struct intc_mask_reg mask_registers[] __initdata = { 49static struct intc_mask_reg mask_registers[] __initdata = {
37 { 0xa4000000, 0, 16, /* IRLMSK */ 50 { 0xa4000000, 0, 16, /* IRLMSK */
38 { 0, 0, 0, 0, CF, 0, 0, 0, 51 { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS,
39 0, 0, 0, EXT4, 0, EXT1, PSW, AX88796 } }, 52 0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } },
40}; 53};
41 54
42static unsigned char irl2irq[HL_NR_IRL] __initdata = { 55static unsigned char irl2irq[HL_NR_IRL] __initdata = {
43 0, IRQ_CF, 0, 0, 56 0, IRQ_CF, IRQ_TP, IRQ_SCIF1,
44 0, 0, 0, 0, 57 IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6,
45 0, IRQ_EXT4, 0, IRQ_EXT1, 58 IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1,
46 0, IRQ_AX88796, IRQ_PSW, 59 0, IRQ_AX88796, IRQ_PSW,
47}; 60};
48 61
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
index 2f68bea7890c..a5c5e9236501 100644
--- a/arch/sh/boards/renesas/r7780rp/setup.c
+++ b/arch/sh/boards/renesas/r7780rp/setup.c
@@ -4,7 +4,7 @@
4 * Renesas Solutions Highlander Support. 4 * Renesas Solutions Highlander Support.
5 * 5 *
6 * Copyright (C) 2002 Atom Create Engineering Co., Ltd. 6 * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
7 * Copyright (C) 2005 - 2007 Paul Mundt 7 * Copyright (C) 2005 - 2008 Paul Mundt
8 * 8 *
9 * This contains support for the R7780RP-1, R7780MP, and R7785RP 9 * This contains support for the R7780RP-1, R7780MP, and R7785RP
10 * Highlander modules. 10 * Highlander modules.
@@ -17,6 +17,7 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/ata_platform.h> 18#include <linux/ata_platform.h>
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/i2c.h>
20#include <net/ax88796.h> 21#include <net/ax88796.h>
21#include <asm/machvec.h> 22#include <asm/machvec.h>
22#include <asm/r7780rp.h> 23#include <asm/r7780rp.h>
@@ -176,11 +177,38 @@ static struct platform_device ax88796_device = {
176 .resource = ax88796_resources, 177 .resource = ax88796_resources,
177}; 178};
178 179
180static struct resource smbus_resources[] = {
181 [0] = {
182 .start = PA_SMCR,
183 .end = PA_SMCR + 0x100 - 1,
184 .flags = IORESOURCE_MEM,
185 },
186 [1] = {
187 .start = IRQ_SMBUS,
188 .end = IRQ_SMBUS,
189 .flags = IORESOURCE_IRQ,
190 },
191};
192
193static struct platform_device smbus_device = {
194 .name = "i2c-highlander",
195 .id = 0,
196 .num_resources = ARRAY_SIZE(smbus_resources),
197 .resource = smbus_resources,
198};
199
200static struct i2c_board_info __initdata highlander_i2c_devices[] = {
201 {
202 I2C_BOARD_INFO("rtc-rs5c372", 0x32),
203 .type = "r2025sd",
204 },
205};
179 206
180static struct platform_device *r7780rp_devices[] __initdata = { 207static struct platform_device *r7780rp_devices[] __initdata = {
181 &r8a66597_usb_host_device, 208 &r8a66597_usb_host_device,
182 &m66592_usb_peripheral_device, 209 &m66592_usb_peripheral_device,
183 &heartbeat_device, 210 &heartbeat_device,
211 &smbus_device,
184#ifndef CONFIG_SH_R7780RP 212#ifndef CONFIG_SH_R7780RP
185 &ax88796_device, 213 &ax88796_device,
186#endif 214#endif
@@ -199,12 +227,20 @@ static struct trapped_io cf_trapped_io = {
199 227
200static int __init r7780rp_devices_setup(void) 228static int __init r7780rp_devices_setup(void)
201{ 229{
230 int ret = 0;
231
202#ifndef CONFIG_SH_R7780RP 232#ifndef CONFIG_SH_R7780RP
203 if (register_trapped_io(&cf_trapped_io) == 0) 233 if (register_trapped_io(&cf_trapped_io) == 0)
204 platform_device_register(&cf_ide_device); 234 ret |= platform_device_register(&cf_ide_device);
205#endif 235#endif
206 return platform_add_devices(r7780rp_devices, 236
237 ret |= platform_add_devices(r7780rp_devices,
207 ARRAY_SIZE(r7780rp_devices)); 238 ARRAY_SIZE(r7780rp_devices));
239
240 ret |= i2c_register_board_info(0, highlander_i2c_devices,
241 ARRAY_SIZE(highlander_i2c_devices));
242
243 return ret;
208} 244}
209device_initcall(r7780rp_devices_setup); 245device_initcall(r7780rp_devices_setup);
210 246
diff --git a/arch/sh/boards/se/7721/Makefile b/arch/sh/boards/se/7721/Makefile
new file mode 100644
index 000000000000..7f09030980b3
--- /dev/null
+++ b/arch/sh/boards/se/7721/Makefile
@@ -0,0 +1 @@
obj-y := setup.o irq.o
diff --git a/arch/sh/boards/se/7721/irq.c b/arch/sh/boards/se/7721/irq.c
new file mode 100644
index 000000000000..c4fdd622bf8b
--- /dev/null
+++ b/arch/sh/boards/se/7721/irq.c
@@ -0,0 +1,45 @@
1/*
2 * linux/arch/sh/boards/se/7721/irq.c
3 *
4 * Copyright (C) 2008 Renesas Solutions Corp.
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#include <linux/init.h>
11#include <linux/irq.h>
12#include <linux/interrupt.h>
13#include <linux/io.h>
14#include <asm/se7721.h>
15
16enum {
17 UNUSED = 0,
18
19 /* board specific interrupt sources */
20 MRSHPC,
21};
22
23static struct intc_vect vectors[] __initdata = {
24 INTC_IRQ(MRSHPC, MRSHPC_IRQ0),
25};
26
27static struct intc_prio_reg prio_registers[] __initdata = {
28 { FPGA_ILSR6, 0, 8, 4, /* IRLMSK */
29 { 0, MRSHPC } },
30};
31
32static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
33 NULL, NULL, prio_registers, NULL);
34
35/*
36 * Initialize IRQ setting
37 */
38void __init init_se7721_IRQ(void)
39{
40 /* PPCR */
41 ctrl_outw(ctrl_inw(0xa4050118) & ~0x00ff, 0xa4050118);
42
43 register_intc_controller(&intc_desc);
44 intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
45}
diff --git a/arch/sh/boards/se/7721/setup.c b/arch/sh/boards/se/7721/setup.c
new file mode 100644
index 000000000000..1be3e92752f7
--- /dev/null
+++ b/arch/sh/boards/se/7721/setup.c
@@ -0,0 +1,99 @@
1/*
2 * linux/arch/sh/boards/se/7721/setup.c
3 *
4 * Copyright (C) 2008 Renesas Solutions Corp.
5 *
6 * Hitachi UL SolutionEngine 7721 Support.
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 *
12 */
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <asm/machvec.h>
16#include <asm/se7721.h>
17#include <asm/io.h>
18#include <asm/heartbeat.h>
19
20static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
21
22static struct heartbeat_data heartbeat_data = {
23 .bit_pos = heartbeat_bit_pos,
24 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
25 .regsize = 16,
26};
27
28static struct resource heartbeat_resources[] = {
29 [0] = {
30 .start = PA_LED,
31 .end = PA_LED,
32 .flags = IORESOURCE_MEM,
33 },
34};
35
36static struct platform_device heartbeat_device = {
37 .name = "heartbeat",
38 .id = -1,
39 .dev = {
40 .platform_data = &heartbeat_data,
41 },
42 .num_resources = ARRAY_SIZE(heartbeat_resources),
43 .resource = heartbeat_resources,
44};
45
46static struct resource cf_ide_resources[] = {
47 [0] = {
48 .start = PA_MRSHPC_IO + 0x1f0,
49 .end = PA_MRSHPC_IO + 0x1f0 + 8 ,
50 .flags = IORESOURCE_IO,
51 },
52 [1] = {
53 .start = PA_MRSHPC_IO + 0x1f0 + 0x206,
54 .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
55 .flags = IORESOURCE_IO,
56 },
57 [2] = {
58 .start = MRSHPC_IRQ0,
59 .flags = IORESOURCE_IRQ,
60 },
61};
62
63static struct platform_device cf_ide_device = {
64 .name = "pata_platform",
65 .id = -1,
66 .num_resources = ARRAY_SIZE(cf_ide_resources),
67 .resource = cf_ide_resources,
68};
69
70static struct platform_device *se7721_devices[] __initdata = {
71 &cf_ide_device,
72 &heartbeat_device
73};
74
75static int __init se7721_devices_setup(void)
76{
77 return platform_add_devices(se7721_devices,
78 ARRAY_SIZE(se7721_devices));
79}
80device_initcall(se7721_devices_setup);
81
82static void __init se7721_setup(char **cmdline_p)
83{
84 /* for USB */
85 ctrl_outw(0x0000, 0xA405010C); /* PGCR */
86 ctrl_outw(0x0000, 0xA405010E); /* PHCR */
87 ctrl_outw(0x00AA, 0xA4050118); /* PPCR */
88 ctrl_outw(0x0000, 0xA4050124); /* PSELA */
89}
90
91/*
92 * The Machine Vector
93 */
94struct sh_machine_vector mv_se7721 __initmv = {
95 .mv_name = "Solution Engine 7721",
96 .mv_setup = se7721_setup,
97 .mv_nr_irqs = 109,
98 .mv_init_irq = init_se7721_IRQ,
99};
diff --git a/arch/sh/boards/se/7722/setup.c b/arch/sh/boards/se/7722/setup.c
index b1a3d9d0172f..33f6ee71f848 100644
--- a/arch/sh/boards/se/7722/setup.c
+++ b/arch/sh/boards/se/7722/setup.c
@@ -13,10 +13,12 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
16#include <linux/input.h>
16#include <asm/machvec.h> 17#include <asm/machvec.h>
17#include <asm/se7722.h> 18#include <asm/se7722.h>
18#include <asm/io.h> 19#include <asm/io.h>
19#include <asm/heartbeat.h> 20#include <asm/heartbeat.h>
21#include <asm/sh_keysc.h>
20 22
21/* Heartbeat */ 23/* Heartbeat */
22static struct heartbeat_data heartbeat_data = { 24static struct heartbeat_data heartbeat_data = {
@@ -92,10 +94,47 @@ static struct platform_device cf_ide_device = {
92 .resource = cf_ide_resources, 94 .resource = cf_ide_resources,
93}; 95};
94 96
97static struct sh_keysc_info sh_keysc_info = {
98 .mode = SH_KEYSC_MODE_1, /* KEYOUT0->5, KEYIN0->4 */
99 .scan_timing = 3,
100 .delay = 5,
101 .keycodes = { /* SW1 -> SW30 */
102 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
103 KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
104 KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
105 KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
106 KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y,
107 KEY_Z,
108 KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE, /* life */
109 },
110};
111
112static struct resource sh_keysc_resources[] = {
113 [0] = {
114 .start = 0x044b0000,
115 .end = 0x044b000f,
116 .flags = IORESOURCE_MEM,
117 },
118 [1] = {
119 .start = 79,
120 .flags = IORESOURCE_IRQ,
121 },
122};
123
124static struct platform_device sh_keysc_device = {
125 .name = "sh_keysc",
126 .num_resources = ARRAY_SIZE(sh_keysc_resources),
127 .resource = sh_keysc_resources,
128 .dev = {
129 .platform_data = &sh_keysc_info,
130 },
131};
132
95static struct platform_device *se7722_devices[] __initdata = { 133static struct platform_device *se7722_devices[] __initdata = {
96 &heartbeat_device, 134 &heartbeat_device,
97 &smc91x_eth_device, 135 &smc91x_eth_device,
98 &cf_ide_device, 136 &cf_ide_device,
137 &sh_keysc_device,
99}; 138};
100 139
101static int __init se7722_devices_setup(void) 140static int __init se7722_devices_setup(void)
@@ -136,6 +175,8 @@ static void __init se7722_setup(char **cmdline_p)
136 ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */ 175 ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */
137 ctrl_outw(0x0000, PORT_PYCR); 176 ctrl_outw(0x0000, PORT_PYCR);
138 ctrl_outw(0x0000, PORT_PZCR); 177 ctrl_outw(0x0000, PORT_PZCR);
178 ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
179 ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
139} 180}
140 181
141/* 182/*
diff --git a/arch/sh/configs/se7721_defconfig b/arch/sh/configs/se7721_defconfig
new file mode 100644
index 000000000000..f3d4ca0caa46
--- /dev/null
+++ b/arch/sh/configs/se7721_defconfig
@@ -0,0 +1,1085 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.25-rc5
4# Fri Mar 21 12:05:31 2008
5#
6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y
8CONFIG_RWSEM_GENERIC_SPINLOCK=y
9CONFIG_GENERIC_FIND_NEXT_BIT=y
10CONFIG_GENERIC_HWEIGHT=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_GENERIC_IRQ_PROBE=y
13CONFIG_GENERIC_CALIBRATE_DELAY=y
14CONFIG_GENERIC_TIME=y
15CONFIG_GENERIC_CLOCKEVENTS=y
16CONFIG_STACKTRACE_SUPPORT=y
17CONFIG_LOCKDEP_SUPPORT=y
18# CONFIG_ARCH_HAS_ILOG2_U32 is not set
19# CONFIG_ARCH_HAS_ILOG2_U64 is not set
20CONFIG_ARCH_NO_VIRT_TO_BUS=y
21CONFIG_ARCH_SUPPORTS_AOUT=y
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23
24#
25# General setup
26#
27CONFIG_EXPERIMENTAL=y
28CONFIG_BROKEN_ON_SMP=y
29CONFIG_INIT_ENV_ARG_LIMIT=32
30CONFIG_LOCALVERSION=""
31# CONFIG_LOCALVERSION_AUTO is not set
32# CONFIG_SWAP is not set
33CONFIG_SYSVIPC=y
34CONFIG_SYSVIPC_SYSCTL=y
35CONFIG_POSIX_MQUEUE=y
36CONFIG_BSD_PROCESS_ACCT=y
37# CONFIG_BSD_PROCESS_ACCT_V3 is not set
38# CONFIG_TASKSTATS is not set
39# CONFIG_AUDIT is not set
40# CONFIG_IKCONFIG is not set
41CONFIG_LOG_BUF_SHIFT=14
42# CONFIG_CGROUPS is not set
43CONFIG_GROUP_SCHED=y
44CONFIG_FAIR_GROUP_SCHED=y
45# CONFIG_RT_GROUP_SCHED is not set
46CONFIG_USER_SCHED=y
47# CONFIG_CGROUP_SCHED is not set
48CONFIG_SYSFS_DEPRECATED=y
49CONFIG_SYSFS_DEPRECATED_V2=y
50# CONFIG_RELAY is not set
51# CONFIG_NAMESPACES is not set
52# CONFIG_BLK_DEV_INITRD is not set
53# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
54CONFIG_SYSCTL=y
55CONFIG_EMBEDDED=y
56CONFIG_UID16=y
57CONFIG_SYSCTL_SYSCALL=y
58CONFIG_KALLSYMS=y
59CONFIG_KALLSYMS_ALL=y
60# CONFIG_KALLSYMS_EXTRA_PASS is not set
61CONFIG_HOTPLUG=y
62CONFIG_PRINTK=y
63# CONFIG_BUG is not set
64CONFIG_ELF_CORE=y
65CONFIG_COMPAT_BRK=y
66# CONFIG_BASE_FULL is not set
67CONFIG_FUTEX=y
68CONFIG_ANON_INODES=y
69CONFIG_EPOLL=y
70CONFIG_SIGNALFD=y
71CONFIG_TIMERFD=y
72CONFIG_EVENTFD=y
73# CONFIG_SHMEM is not set
74CONFIG_VM_EVENT_COUNTERS=y
75CONFIG_SLAB=y
76# CONFIG_SLUB is not set
77# CONFIG_SLOB is not set
78# CONFIG_PROFILING is not set
79# CONFIG_MARKERS is not set
80CONFIG_HAVE_OPROFILE=y
81# CONFIG_HAVE_KPROBES is not set
82# CONFIG_HAVE_KRETPROBES is not set
83CONFIG_PROC_PAGE_MONITOR=y
84CONFIG_SLABINFO=y
85CONFIG_RT_MUTEXES=y
86CONFIG_TINY_SHMEM=y
87CONFIG_BASE_SMALL=1
88CONFIG_MODULES=y
89# CONFIG_MODULE_UNLOAD is not set
90# CONFIG_MODVERSIONS is not set
91# CONFIG_MODULE_SRCVERSION_ALL is not set
92# CONFIG_KMOD is not set
93CONFIG_BLOCK=y
94# CONFIG_LBD is not set
95# CONFIG_BLK_DEV_IO_TRACE is not set
96# CONFIG_LSF is not set
97# CONFIG_BLK_DEV_BSG is not set
98
99#
100# IO Schedulers
101#
102CONFIG_IOSCHED_NOOP=y
103# CONFIG_IOSCHED_AS is not set
104# CONFIG_IOSCHED_DEADLINE is not set
105# CONFIG_IOSCHED_CFQ is not set
106# CONFIG_DEFAULT_AS is not set
107# CONFIG_DEFAULT_DEADLINE is not set
108# CONFIG_DEFAULT_CFQ is not set
109CONFIG_DEFAULT_NOOP=y
110CONFIG_DEFAULT_IOSCHED="noop"
111CONFIG_CLASSIC_RCU=y
112
113#
114# System type
115#
116CONFIG_CPU_SH3=y
117# CONFIG_CPU_SUBTYPE_SH7619 is not set
118# CONFIG_CPU_SUBTYPE_SH7203 is not set
119# CONFIG_CPU_SUBTYPE_SH7206 is not set
120# CONFIG_CPU_SUBTYPE_SH7263 is not set
121# CONFIG_CPU_SUBTYPE_MXG is not set
122# CONFIG_CPU_SUBTYPE_SH7705 is not set
123# CONFIG_CPU_SUBTYPE_SH7706 is not set
124# CONFIG_CPU_SUBTYPE_SH7707 is not set
125# CONFIG_CPU_SUBTYPE_SH7708 is not set
126# CONFIG_CPU_SUBTYPE_SH7709 is not set
127# CONFIG_CPU_SUBTYPE_SH7710 is not set
128# CONFIG_CPU_SUBTYPE_SH7712 is not set
129# CONFIG_CPU_SUBTYPE_SH7720 is not set
130CONFIG_CPU_SUBTYPE_SH7721=y
131# CONFIG_CPU_SUBTYPE_SH7750 is not set
132# CONFIG_CPU_SUBTYPE_SH7091 is not set
133# CONFIG_CPU_SUBTYPE_SH7750R is not set
134# CONFIG_CPU_SUBTYPE_SH7750S is not set
135# CONFIG_CPU_SUBTYPE_SH7751 is not set
136# CONFIG_CPU_SUBTYPE_SH7751R is not set
137# CONFIG_CPU_SUBTYPE_SH7760 is not set
138# CONFIG_CPU_SUBTYPE_SH4_202 is not set
139# CONFIG_CPU_SUBTYPE_SH7763 is not set
140# CONFIG_CPU_SUBTYPE_SH7770 is not set
141# CONFIG_CPU_SUBTYPE_SH7780 is not set
142# CONFIG_CPU_SUBTYPE_SH7785 is not set
143# CONFIG_CPU_SUBTYPE_SHX3 is not set
144# CONFIG_CPU_SUBTYPE_SH7343 is not set
145# CONFIG_CPU_SUBTYPE_SH7722 is not set
146# CONFIG_CPU_SUBTYPE_SH7366 is not set
147# CONFIG_CPU_SUBTYPE_SH5_101 is not set
148# CONFIG_CPU_SUBTYPE_SH5_103 is not set
149
150#
151# Memory management options
152#
153CONFIG_QUICKLIST=y
154CONFIG_MMU=y
155CONFIG_PAGE_OFFSET=0x80000000
156CONFIG_MEMORY_START=0x0c000000
157CONFIG_MEMORY_SIZE=0x02000000
158CONFIG_29BIT=y
159CONFIG_VSYSCALL=y
160CONFIG_ARCH_FLATMEM_ENABLE=y
161CONFIG_ARCH_SPARSEMEM_ENABLE=y
162CONFIG_ARCH_SPARSEMEM_DEFAULT=y
163CONFIG_MAX_ACTIVE_REGIONS=1
164CONFIG_ARCH_POPULATES_NODE_MAP=y
165CONFIG_ARCH_SELECT_MEMORY_MODEL=y
166CONFIG_PAGE_SIZE_4KB=y
167# CONFIG_PAGE_SIZE_8KB is not set
168# CONFIG_PAGE_SIZE_64KB is not set
169CONFIG_SELECT_MEMORY_MODEL=y
170CONFIG_FLATMEM_MANUAL=y
171# CONFIG_DISCONTIGMEM_MANUAL is not set
172# CONFIG_SPARSEMEM_MANUAL is not set
173CONFIG_FLATMEM=y
174CONFIG_FLAT_NODE_MEM_MAP=y
175CONFIG_SPARSEMEM_STATIC=y
176# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
177CONFIG_SPLIT_PTLOCK_CPUS=4
178# CONFIG_RESOURCES_64BIT is not set
179CONFIG_ZONE_DMA_FLAG=0
180CONFIG_NR_QUICK=2
181
182#
183# Cache configuration
184#
185# CONFIG_SH_DIRECT_MAPPED is not set
186CONFIG_CACHE_WRITEBACK=y
187# CONFIG_CACHE_WRITETHROUGH is not set
188# CONFIG_CACHE_OFF is not set
189
190#
191# Processor features
192#
193CONFIG_CPU_LITTLE_ENDIAN=y
194# CONFIG_CPU_BIG_ENDIAN is not set
195# CONFIG_SH_FPU_EMU is not set
196# CONFIG_SH_DSP is not set
197# CONFIG_SH_ADC is not set
198CONFIG_CPU_HAS_INTEVT=y
199CONFIG_CPU_HAS_SR_RB=y
200CONFIG_CPU_HAS_DSP=y
201
202#
203# Board support
204#
205CONFIG_SOLUTION_ENGINE=y
206CONFIG_SH_7721_SOLUTION_ENGINE=y
207
208#
209# Timer and clock configuration
210#
211CONFIG_SH_TMU=y
212CONFIG_SH_TIMER_IRQ=16
213CONFIG_SH_PCLK_FREQ=33333333
214# CONFIG_TICK_ONESHOT is not set
215# CONFIG_NO_HZ is not set
216# CONFIG_HIGH_RES_TIMERS is not set
217CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
218
219#
220# CPU Frequency scaling
221#
222# CONFIG_CPU_FREQ is not set
223
224#
225# DMA support
226#
227# CONFIG_SH_DMA is not set
228
229#
230# Companion Chips
231#
232
233#
234# Additional SuperH Device Drivers
235#
236CONFIG_HEARTBEAT=y
237# CONFIG_PUSH_SWITCH is not set
238
239#
240# Kernel features
241#
242# CONFIG_HZ_100 is not set
243CONFIG_HZ_250=y
244# CONFIG_HZ_300 is not set
245# CONFIG_HZ_1000 is not set
246CONFIG_HZ=250
247# CONFIG_SCHED_HRTICK is not set
248# CONFIG_KEXEC is not set
249# CONFIG_CRASH_DUMP is not set
250# CONFIG_PREEMPT_NONE is not set
251CONFIG_PREEMPT_VOLUNTARY=y
252# CONFIG_PREEMPT is not set
253CONFIG_GUSA=y
254# CONFIG_GUSA_RB is not set
255
256#
257# Boot options
258#
259CONFIG_ZERO_PAGE_OFFSET=0x00001000
260CONFIG_BOOT_LINK_OFFSET=0x00800000
261CONFIG_CMDLINE_BOOL=y
262CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda2"
263
264#
265# Bus options
266#
267CONFIG_CF_ENABLER=y
268# CONFIG_CF_AREA5 is not set
269CONFIG_CF_AREA6=y
270CONFIG_CF_BASE_ADDR=0xb8000000
271# CONFIG_ARCH_SUPPORTS_MSI is not set
272# CONFIG_PCCARD is not set
273
274#
275# Executable file formats
276#
277CONFIG_BINFMT_ELF=y
278# CONFIG_BINFMT_MISC is not set
279
280#
281# Networking
282#
283CONFIG_NET=y
284
285#
286# Networking options
287#
288CONFIG_PACKET=y
289CONFIG_PACKET_MMAP=y
290CONFIG_UNIX=y
291CONFIG_XFRM=y
292# CONFIG_XFRM_USER is not set
293# CONFIG_XFRM_SUB_POLICY is not set
294# CONFIG_XFRM_MIGRATE is not set
295# CONFIG_XFRM_STATISTICS is not set
296CONFIG_NET_KEY=y
297# CONFIG_NET_KEY_MIGRATE is not set
298CONFIG_INET=y
299CONFIG_IP_MULTICAST=y
300CONFIG_IP_ADVANCED_ROUTER=y
301CONFIG_ASK_IP_FIB_HASH=y
302# CONFIG_IP_FIB_TRIE is not set
303CONFIG_IP_FIB_HASH=y
304CONFIG_IP_MULTIPLE_TABLES=y
305CONFIG_IP_ROUTE_MULTIPATH=y
306CONFIG_IP_ROUTE_VERBOSE=y
307CONFIG_IP_PNP=y
308CONFIG_IP_PNP_DHCP=y
309# CONFIG_IP_PNP_BOOTP is not set
310# CONFIG_IP_PNP_RARP is not set
311# CONFIG_NET_IPIP is not set
312# CONFIG_NET_IPGRE is not set
313CONFIG_IP_MROUTE=y
314CONFIG_IP_PIMSM_V1=y
315CONFIG_IP_PIMSM_V2=y
316# CONFIG_ARPD is not set
317CONFIG_SYN_COOKIES=y
318CONFIG_INET_AH=y
319CONFIG_INET_ESP=y
320CONFIG_INET_IPCOMP=y
321CONFIG_INET_XFRM_TUNNEL=y
322CONFIG_INET_TUNNEL=y
323CONFIG_INET_XFRM_MODE_TRANSPORT=y
324CONFIG_INET_XFRM_MODE_TUNNEL=y
325CONFIG_INET_XFRM_MODE_BEET=y
326# CONFIG_INET_LRO is not set
327# CONFIG_INET_DIAG is not set
328# CONFIG_TCP_CONG_ADVANCED is not set
329CONFIG_TCP_CONG_CUBIC=y
330CONFIG_DEFAULT_TCP_CONG="cubic"
331# CONFIG_TCP_MD5SIG is not set
332# CONFIG_IPV6 is not set
333# CONFIG_INET6_XFRM_TUNNEL is not set
334# CONFIG_INET6_TUNNEL is not set
335# CONFIG_NETWORK_SECMARK is not set
336# CONFIG_NETFILTER is not set
337# CONFIG_IP_DCCP is not set
338# CONFIG_IP_SCTP is not set
339# CONFIG_TIPC is not set
340# CONFIG_ATM is not set
341# CONFIG_BRIDGE is not set
342# CONFIG_VLAN_8021Q is not set
343# CONFIG_DECNET is not set
344# CONFIG_LLC2 is not set
345# CONFIG_IPX is not set
346# CONFIG_ATALK is not set
347# CONFIG_X25 is not set
348# CONFIG_LAPB is not set
349# CONFIG_ECONET is not set
350# CONFIG_WAN_ROUTER is not set
351CONFIG_NET_SCHED=y
352
353#
354# Queueing/Scheduling
355#
356CONFIG_NET_SCH_CBQ=y
357CONFIG_NET_SCH_HTB=y
358CONFIG_NET_SCH_HFSC=y
359CONFIG_NET_SCH_PRIO=y
360# CONFIG_NET_SCH_RR is not set
361CONFIG_NET_SCH_RED=y
362CONFIG_NET_SCH_SFQ=y
363CONFIG_NET_SCH_TEQL=y
364CONFIG_NET_SCH_TBF=y
365CONFIG_NET_SCH_GRED=y
366CONFIG_NET_SCH_DSMARK=y
367CONFIG_NET_SCH_NETEM=y
368
369#
370# Classification
371#
372CONFIG_NET_CLS=y
373# CONFIG_NET_CLS_BASIC is not set
374CONFIG_NET_CLS_TCINDEX=y
375CONFIG_NET_CLS_ROUTE4=y
376CONFIG_NET_CLS_ROUTE=y
377CONFIG_NET_CLS_FW=y
378# CONFIG_NET_CLS_U32 is not set
379# CONFIG_NET_CLS_RSVP is not set
380# CONFIG_NET_CLS_RSVP6 is not set
381# CONFIG_NET_CLS_FLOW is not set
382# CONFIG_NET_EMATCH is not set
383# CONFIG_NET_CLS_ACT is not set
384CONFIG_NET_CLS_IND=y
385CONFIG_NET_SCH_FIFO=y
386
387#
388# Network testing
389#
390# CONFIG_NET_PKTGEN is not set
391# CONFIG_HAMRADIO is not set
392# CONFIG_CAN is not set
393# CONFIG_IRDA is not set
394# CONFIG_BT is not set
395# CONFIG_AF_RXRPC is not set
396CONFIG_FIB_RULES=y
397
398#
399# Wireless
400#
401# CONFIG_CFG80211 is not set
402# CONFIG_WIRELESS_EXT is not set
403# CONFIG_MAC80211 is not set
404# CONFIG_IEEE80211 is not set
405# CONFIG_RFKILL is not set
406# CONFIG_NET_9P is not set
407
408#
409# Device Drivers
410#
411
412#
413# Generic Driver Options
414#
415CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
416CONFIG_STANDALONE=y
417CONFIG_PREVENT_FIRMWARE_BUILD=y
418CONFIG_FW_LOADER=y
419# CONFIG_DEBUG_DRIVER is not set
420# CONFIG_DEBUG_DEVRES is not set
421# CONFIG_SYS_HYPERVISOR is not set
422# CONFIG_CONNECTOR is not set
423CONFIG_MTD=y
424# CONFIG_MTD_DEBUG is not set
425CONFIG_MTD_CONCAT=y
426CONFIG_MTD_PARTITIONS=y
427# CONFIG_MTD_REDBOOT_PARTS is not set
428# CONFIG_MTD_CMDLINE_PARTS is not set
429
430#
431# User Modules And Translation Layers
432#
433CONFIG_MTD_CHAR=y
434CONFIG_MTD_BLKDEVS=y
435CONFIG_MTD_BLOCK=y
436# CONFIG_FTL is not set
437# CONFIG_NFTL is not set
438# CONFIG_INFTL is not set
439# CONFIG_RFD_FTL is not set
440# CONFIG_SSFDC is not set
441# CONFIG_MTD_OOPS is not set
442
443#
444# RAM/ROM/Flash chip drivers
445#
446CONFIG_MTD_CFI=y
447# CONFIG_MTD_JEDECPROBE is not set
448CONFIG_MTD_GEN_PROBE=y
449# CONFIG_MTD_CFI_ADV_OPTIONS is not set
450CONFIG_MTD_MAP_BANK_WIDTH_1=y
451CONFIG_MTD_MAP_BANK_WIDTH_2=y
452CONFIG_MTD_MAP_BANK_WIDTH_4=y
453# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
454# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
455# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
456CONFIG_MTD_CFI_I1=y
457CONFIG_MTD_CFI_I2=y
458# CONFIG_MTD_CFI_I4 is not set
459# CONFIG_MTD_CFI_I8 is not set
460# CONFIG_MTD_CFI_INTELEXT is not set
461CONFIG_MTD_CFI_AMDSTD=y
462# CONFIG_MTD_CFI_STAA is not set
463CONFIG_MTD_CFI_UTIL=y
464# CONFIG_MTD_RAM is not set
465# CONFIG_MTD_ROM is not set
466# CONFIG_MTD_ABSENT is not set
467
468#
469# Mapping drivers for chip access
470#
471# CONFIG_MTD_COMPLEX_MAPPINGS is not set
472# CONFIG_MTD_PHYSMAP is not set
473# CONFIG_MTD_PLATRAM is not set
474
475#
476# Self-contained MTD device drivers
477#
478# CONFIG_MTD_SLRAM is not set
479# CONFIG_MTD_PHRAM is not set
480# CONFIG_MTD_MTDRAM is not set
481# CONFIG_MTD_BLOCK2MTD is not set
482
483#
484# Disk-On-Chip Device Drivers
485#
486# CONFIG_MTD_DOC2000 is not set
487# CONFIG_MTD_DOC2001 is not set
488# CONFIG_MTD_DOC2001PLUS is not set
489# CONFIG_MTD_NAND is not set
490# CONFIG_MTD_ONENAND is not set
491
492#
493# UBI - Unsorted block images
494#
495# CONFIG_MTD_UBI is not set
496# CONFIG_PARPORT is not set
497CONFIG_BLK_DEV=y
498# CONFIG_BLK_DEV_COW_COMMON is not set
499# CONFIG_BLK_DEV_LOOP is not set
500# CONFIG_BLK_DEV_NBD is not set
501# CONFIG_BLK_DEV_UB is not set
502# CONFIG_BLK_DEV_RAM is not set
503# CONFIG_CDROM_PKTCDVD is not set
504# CONFIG_ATA_OVER_ETH is not set
505CONFIG_MISC_DEVICES=y
506# CONFIG_EEPROM_93CX6 is not set
507# CONFIG_ENCLOSURE_SERVICES is not set
508CONFIG_HAVE_IDE=y
509# CONFIG_IDE is not set
510
511#
512# SCSI device support
513#
514# CONFIG_RAID_ATTRS is not set
515CONFIG_SCSI=y
516CONFIG_SCSI_DMA=y
517# CONFIG_SCSI_TGT is not set
518# CONFIG_SCSI_NETLINK is not set
519CONFIG_SCSI_PROC_FS=y
520
521#
522# SCSI support type (disk, tape, CD-ROM)
523#
524CONFIG_BLK_DEV_SD=y
525# CONFIG_CHR_DEV_ST is not set
526# CONFIG_CHR_DEV_OSST is not set
527# CONFIG_BLK_DEV_SR is not set
528# CONFIG_CHR_DEV_SG is not set
529# CONFIG_CHR_DEV_SCH is not set
530
531#
532# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
533#
534CONFIG_SCSI_MULTI_LUN=y
535# CONFIG_SCSI_CONSTANTS is not set
536# CONFIG_SCSI_LOGGING is not set
537# CONFIG_SCSI_SCAN_ASYNC is not set
538CONFIG_SCSI_WAIT_SCAN=m
539
540#
541# SCSI Transports
542#
543# CONFIG_SCSI_SPI_ATTRS is not set
544# CONFIG_SCSI_FC_ATTRS is not set
545# CONFIG_SCSI_ISCSI_ATTRS is not set
546# CONFIG_SCSI_SAS_LIBSAS is not set
547# CONFIG_SCSI_SRP_ATTRS is not set
548# CONFIG_SCSI_LOWLEVEL is not set
549CONFIG_ATA=y
550# CONFIG_ATA_NONSTANDARD is not set
551# CONFIG_SATA_MV is not set
552CONFIG_PATA_PLATFORM=y
553# CONFIG_MD is not set
554CONFIG_NETDEVICES=y
555# CONFIG_NETDEVICES_MULTIQUEUE is not set
556# CONFIG_DUMMY is not set
557# CONFIG_BONDING is not set
558# CONFIG_MACVLAN is not set
559# CONFIG_EQUALIZER is not set
560# CONFIG_TUN is not set
561# CONFIG_VETH is not set
562# CONFIG_NET_ETHERNET is not set
563CONFIG_NETDEV_1000=y
564# CONFIG_E1000E_ENABLED is not set
565CONFIG_NETDEV_10000=y
566
567#
568# Wireless LAN
569#
570# CONFIG_WLAN_PRE80211 is not set
571# CONFIG_WLAN_80211 is not set
572
573#
574# USB Network Adapters
575#
576# CONFIG_USB_CATC is not set
577# CONFIG_USB_KAWETH is not set
578# CONFIG_USB_PEGASUS is not set
579# CONFIG_USB_RTL8150 is not set
580# CONFIG_USB_USBNET is not set
581# CONFIG_WAN is not set
582# CONFIG_PPP is not set
583# CONFIG_SLIP is not set
584# CONFIG_NETCONSOLE is not set
585# CONFIG_NETPOLL is not set
586# CONFIG_NET_POLL_CONTROLLER is not set
587# CONFIG_ISDN is not set
588# CONFIG_PHONE is not set
589
590#
591# Input device support
592#
593CONFIG_INPUT=y
594# CONFIG_INPUT_FF_MEMLESS is not set
595# CONFIG_INPUT_POLLDEV is not set
596
597#
598# Userland interfaces
599#
600CONFIG_INPUT_MOUSEDEV=y
601CONFIG_INPUT_MOUSEDEV_PSAUX=y
602CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
603CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
604# CONFIG_INPUT_JOYDEV is not set
605CONFIG_INPUT_EVDEV=y
606# CONFIG_INPUT_EVBUG is not set
607
608#
609# Input Device Drivers
610#
611CONFIG_INPUT_KEYBOARD=y
612# CONFIG_KEYBOARD_ATKBD is not set
613# CONFIG_KEYBOARD_SUNKBD is not set
614# CONFIG_KEYBOARD_LKKBD is not set
615# CONFIG_KEYBOARD_XTKBD is not set
616# CONFIG_KEYBOARD_NEWTON is not set
617# CONFIG_KEYBOARD_STOWAWAY is not set
618# CONFIG_KEYBOARD_SH_KEYSC is not set
619CONFIG_INPUT_MOUSE=y
620# CONFIG_MOUSE_PS2 is not set
621# CONFIG_MOUSE_SERIAL is not set
622# CONFIG_MOUSE_APPLETOUCH is not set
623# CONFIG_MOUSE_VSXXXAA is not set
624# CONFIG_INPUT_JOYSTICK is not set
625# CONFIG_INPUT_TABLET is not set
626# CONFIG_INPUT_TOUCHSCREEN is not set
627# CONFIG_INPUT_MISC is not set
628
629#
630# Hardware I/O ports
631#
632# CONFIG_SERIO is not set
633# CONFIG_GAMEPORT is not set
634
635#
636# Character devices
637#
638# CONFIG_VT is not set
639# CONFIG_SERIAL_NONSTANDARD is not set
640
641#
642# Serial drivers
643#
644# CONFIG_SERIAL_8250 is not set
645
646#
647# Non-8250 serial port support
648#
649CONFIG_SERIAL_SH_SCI=y
650CONFIG_SERIAL_SH_SCI_NR_UARTS=2
651CONFIG_SERIAL_SH_SCI_CONSOLE=y
652CONFIG_SERIAL_CORE=y
653CONFIG_SERIAL_CORE_CONSOLE=y
654CONFIG_UNIX98_PTYS=y
655# CONFIG_LEGACY_PTYS is not set
656# CONFIG_IPMI_HANDLER is not set
657# CONFIG_HW_RANDOM is not set
658# CONFIG_R3964 is not set
659# CONFIG_RAW_DRIVER is not set
660# CONFIG_TCG_TPM is not set
661# CONFIG_I2C is not set
662
663#
664# SPI support
665#
666# CONFIG_SPI is not set
667# CONFIG_SPI_MASTER is not set
668# CONFIG_W1 is not set
669# CONFIG_POWER_SUPPLY is not set
670# CONFIG_HWMON is not set
671CONFIG_THERMAL=y
672# CONFIG_WATCHDOG is not set
673
674#
675# Sonics Silicon Backplane
676#
677CONFIG_SSB_POSSIBLE=y
678# CONFIG_SSB is not set
679
680#
681# Multifunction device drivers
682#
683# CONFIG_MFD_SM501 is not set
684
685#
686# Multimedia devices
687#
688# CONFIG_VIDEO_DEV is not set
689# CONFIG_DVB_CORE is not set
690# CONFIG_DAB is not set
691
692#
693# Graphics support
694#
695# CONFIG_VGASTATE is not set
696# CONFIG_VIDEO_OUTPUT_CONTROL is not set
697# CONFIG_FB is not set
698# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
699
700#
701# Display device support
702#
703# CONFIG_DISPLAY_SUPPORT is not set
704
705#
706# Sound
707#
708# CONFIG_SOUND is not set
709CONFIG_HID_SUPPORT=y
710CONFIG_HID=y
711# CONFIG_HID_DEBUG is not set
712# CONFIG_HIDRAW is not set
713
714#
715# USB Input Devices
716#
717CONFIG_USB_HID=y
718# CONFIG_USB_HIDINPUT_POWERBOOK is not set
719# CONFIG_HID_FF is not set
720# CONFIG_USB_HIDDEV is not set
721CONFIG_USB_SUPPORT=y
722CONFIG_USB_ARCH_HAS_HCD=y
723CONFIG_USB_ARCH_HAS_OHCI=y
724# CONFIG_USB_ARCH_HAS_EHCI is not set
725CONFIG_USB=y
726# CONFIG_USB_DEBUG is not set
727# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
728
729#
730# Miscellaneous USB options
731#
732# CONFIG_USB_DEVICEFS is not set
733CONFIG_USB_DEVICE_CLASS=y
734# CONFIG_USB_DYNAMIC_MINORS is not set
735# CONFIG_USB_OTG is not set
736
737#
738# USB Host Controller Drivers
739#
740# CONFIG_USB_ISP116X_HCD is not set
741CONFIG_USB_OHCI_HCD=y
742# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
743# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
744CONFIG_USB_OHCI_LITTLE_ENDIAN=y
745# CONFIG_USB_SL811_HCD is not set
746# CONFIG_USB_R8A66597_HCD is not set
747
748#
749# USB Device Class drivers
750#
751# CONFIG_USB_ACM is not set
752# CONFIG_USB_PRINTER is not set
753
754#
755# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
756#
757
758#
759# may also be needed; see USB_STORAGE Help for more information
760#
761CONFIG_USB_STORAGE=y
762# CONFIG_USB_STORAGE_DEBUG is not set
763# CONFIG_USB_STORAGE_DATAFAB is not set
764# CONFIG_USB_STORAGE_FREECOM is not set
765# CONFIG_USB_STORAGE_ISD200 is not set
766# CONFIG_USB_STORAGE_DPCM is not set
767# CONFIG_USB_STORAGE_USBAT is not set
768# CONFIG_USB_STORAGE_SDDR09 is not set
769# CONFIG_USB_STORAGE_SDDR55 is not set
770# CONFIG_USB_STORAGE_JUMPSHOT is not set
771# CONFIG_USB_STORAGE_ALAUDA is not set
772# CONFIG_USB_STORAGE_ONETOUCH is not set
773# CONFIG_USB_STORAGE_KARMA is not set
774# CONFIG_USB_LIBUSUAL is not set
775
776#
777# USB Imaging devices
778#
779# CONFIG_USB_MDC800 is not set
780# CONFIG_USB_MICROTEK is not set
781CONFIG_USB_MON=y
782
783#
784# USB port drivers
785#
786# CONFIG_USB_SERIAL is not set
787
788#
789# USB Miscellaneous drivers
790#
791# CONFIG_USB_EMI62 is not set
792# CONFIG_USB_EMI26 is not set
793# CONFIG_USB_ADUTUX is not set
794# CONFIG_USB_AUERSWALD is not set
795# CONFIG_USB_RIO500 is not set
796# CONFIG_USB_LEGOTOWER is not set
797# CONFIG_USB_LCD is not set
798# CONFIG_USB_BERRY_CHARGE is not set
799# CONFIG_USB_LED is not set
800# CONFIG_USB_CYPRESS_CY7C63 is not set
801# CONFIG_USB_CYTHERM is not set
802# CONFIG_USB_PHIDGET is not set
803# CONFIG_USB_IDMOUSE is not set
804# CONFIG_USB_FTDI_ELAN is not set
805# CONFIG_USB_APPLEDISPLAY is not set
806# CONFIG_USB_LD is not set
807# CONFIG_USB_TRANCEVIBRATOR is not set
808# CONFIG_USB_IOWARRIOR is not set
809# CONFIG_USB_GADGET is not set
810# CONFIG_MMC is not set
811# CONFIG_MEMSTICK is not set
812CONFIG_NEW_LEDS=y
813CONFIG_LEDS_CLASS=y
814
815#
816# LED drivers
817#
818
819#
820# LED Triggers
821#
822CONFIG_LEDS_TRIGGERS=y
823# CONFIG_LEDS_TRIGGER_TIMER is not set
824# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
825# CONFIG_RTC_CLASS is not set
826
827#
828# Userspace I/O
829#
830# CONFIG_UIO is not set
831
832#
833# File systems
834#
835CONFIG_EXT2_FS=y
836CONFIG_EXT2_FS_XATTR=y
837CONFIG_EXT2_FS_POSIX_ACL=y
838CONFIG_EXT2_FS_SECURITY=y
839# CONFIG_EXT2_FS_XIP is not set
840CONFIG_EXT3_FS=y
841CONFIG_EXT3_FS_XATTR=y
842# CONFIG_EXT3_FS_POSIX_ACL is not set
843# CONFIG_EXT3_FS_SECURITY is not set
844# CONFIG_EXT4DEV_FS is not set
845CONFIG_JBD=y
846CONFIG_FS_MBCACHE=y
847# CONFIG_REISERFS_FS is not set
848# CONFIG_JFS_FS is not set
849CONFIG_FS_POSIX_ACL=y
850# CONFIG_XFS_FS is not set
851# CONFIG_GFS2_FS is not set
852# CONFIG_OCFS2_FS is not set
853# CONFIG_DNOTIFY is not set
854# CONFIG_INOTIFY is not set
855# CONFIG_QUOTA is not set
856# CONFIG_AUTOFS_FS is not set
857# CONFIG_AUTOFS4_FS is not set
858# CONFIG_FUSE_FS is not set
859
860#
861# CD-ROM/DVD Filesystems
862#
863# CONFIG_ISO9660_FS is not set
864# CONFIG_UDF_FS is not set
865
866#
867# DOS/FAT/NT Filesystems
868#
869CONFIG_FAT_FS=y
870CONFIG_MSDOS_FS=y
871CONFIG_VFAT_FS=y
872CONFIG_FAT_DEFAULT_CODEPAGE=437
873CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
874# CONFIG_NTFS_FS is not set
875
876#
877# Pseudo filesystems
878#
879CONFIG_PROC_FS=y
880# CONFIG_PROC_KCORE is not set
881CONFIG_PROC_SYSCTL=y
882CONFIG_SYSFS=y
883CONFIG_TMPFS=y
884# CONFIG_TMPFS_POSIX_ACL is not set
885# CONFIG_HUGETLBFS is not set
886# CONFIG_HUGETLB_PAGE is not set
887# CONFIG_CONFIGFS_FS is not set
888
889#
890# Miscellaneous filesystems
891#
892# CONFIG_ADFS_FS is not set
893# CONFIG_AFFS_FS is not set
894# CONFIG_HFS_FS is not set
895# CONFIG_HFSPLUS_FS is not set
896# CONFIG_BEFS_FS is not set
897# CONFIG_BFS_FS is not set
898# CONFIG_EFS_FS is not set
899CONFIG_JFFS2_FS=y
900CONFIG_JFFS2_FS_DEBUG=0
901CONFIG_JFFS2_FS_WRITEBUFFER=y
902# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
903# CONFIG_JFFS2_SUMMARY is not set
904# CONFIG_JFFS2_FS_XATTR is not set
905# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
906CONFIG_JFFS2_ZLIB=y
907# CONFIG_JFFS2_LZO is not set
908CONFIG_JFFS2_RTIME=y
909# CONFIG_JFFS2_RUBIN is not set
910CONFIG_CRAMFS=y
911# CONFIG_VXFS_FS is not set
912# CONFIG_MINIX_FS is not set
913# CONFIG_HPFS_FS is not set
914# CONFIG_QNX4FS_FS is not set
915# CONFIG_ROMFS_FS is not set
916# CONFIG_SYSV_FS is not set
917# CONFIG_UFS_FS is not set
918# CONFIG_NETWORK_FILESYSTEMS is not set
919
920#
921# Partition Types
922#
923# CONFIG_PARTITION_ADVANCED is not set
924CONFIG_MSDOS_PARTITION=y
925CONFIG_NLS=y
926CONFIG_NLS_DEFAULT="iso8859-1"
927CONFIG_NLS_CODEPAGE_437=y
928# CONFIG_NLS_CODEPAGE_737 is not set
929# CONFIG_NLS_CODEPAGE_775 is not set
930# CONFIG_NLS_CODEPAGE_850 is not set
931# CONFIG_NLS_CODEPAGE_852 is not set
932# CONFIG_NLS_CODEPAGE_855 is not set
933# CONFIG_NLS_CODEPAGE_857 is not set
934# CONFIG_NLS_CODEPAGE_860 is not set
935# CONFIG_NLS_CODEPAGE_861 is not set
936# CONFIG_NLS_CODEPAGE_862 is not set
937# CONFIG_NLS_CODEPAGE_863 is not set
938# CONFIG_NLS_CODEPAGE_864 is not set
939# CONFIG_NLS_CODEPAGE_865 is not set
940# CONFIG_NLS_CODEPAGE_866 is not set
941# CONFIG_NLS_CODEPAGE_869 is not set
942# CONFIG_NLS_CODEPAGE_936 is not set
943# CONFIG_NLS_CODEPAGE_950 is not set
944CONFIG_NLS_CODEPAGE_932=y
945# CONFIG_NLS_CODEPAGE_949 is not set
946# CONFIG_NLS_CODEPAGE_874 is not set
947# CONFIG_NLS_ISO8859_8 is not set
948# CONFIG_NLS_CODEPAGE_1250 is not set
949# CONFIG_NLS_CODEPAGE_1251 is not set
950# CONFIG_NLS_ASCII is not set
951CONFIG_NLS_ISO8859_1=y
952# CONFIG_NLS_ISO8859_2 is not set
953# CONFIG_NLS_ISO8859_3 is not set
954# CONFIG_NLS_ISO8859_4 is not set
955# CONFIG_NLS_ISO8859_5 is not set
956# CONFIG_NLS_ISO8859_6 is not set
957# CONFIG_NLS_ISO8859_7 is not set
958# CONFIG_NLS_ISO8859_9 is not set
959# CONFIG_NLS_ISO8859_13 is not set
960# CONFIG_NLS_ISO8859_14 is not set
961# CONFIG_NLS_ISO8859_15 is not set
962# CONFIG_NLS_KOI8_R is not set
963# CONFIG_NLS_KOI8_U is not set
964# CONFIG_NLS_UTF8 is not set
965# CONFIG_DLM is not set
966
967#
968# Kernel hacking
969#
970CONFIG_TRACE_IRQFLAGS_SUPPORT=y
971# CONFIG_PRINTK_TIME is not set
972CONFIG_ENABLE_WARN_DEPRECATED=y
973CONFIG_ENABLE_MUST_CHECK=y
974# CONFIG_MAGIC_SYSRQ is not set
975# CONFIG_UNUSED_SYMBOLS is not set
976# CONFIG_DEBUG_FS is not set
977# CONFIG_HEADERS_CHECK is not set
978CONFIG_DEBUG_KERNEL=y
979# CONFIG_DEBUG_SHIRQ is not set
980# CONFIG_DETECT_SOFTLOCKUP is not set
981CONFIG_SCHED_DEBUG=y
982# CONFIG_SCHEDSTATS is not set
983# CONFIG_TIMER_STATS is not set
984# CONFIG_DEBUG_SLAB is not set
985# CONFIG_DEBUG_RT_MUTEXES is not set
986# CONFIG_RT_MUTEX_TESTER is not set
987# CONFIG_DEBUG_SPINLOCK is not set
988# CONFIG_DEBUG_MUTEXES is not set
989# CONFIG_DEBUG_LOCK_ALLOC is not set
990# CONFIG_PROVE_LOCKING is not set
991# CONFIG_LOCK_STAT is not set
992# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
993# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
994# CONFIG_DEBUG_KOBJECT is not set
995CONFIG_DEBUG_INFO=y
996# CONFIG_DEBUG_VM is not set
997# CONFIG_DEBUG_LIST is not set
998# CONFIG_DEBUG_SG is not set
999CONFIG_FRAME_POINTER=y
1000# CONFIG_BOOT_PRINTK_DELAY is not set
1001# CONFIG_RCU_TORTURE_TEST is not set
1002# CONFIG_BACKTRACE_SELF_TEST is not set
1003# CONFIG_FAULT_INJECTION is not set
1004# CONFIG_SAMPLES is not set
1005# CONFIG_SH_STANDARD_BIOS is not set
1006# CONFIG_EARLY_SCIF_CONSOLE is not set
1007# CONFIG_DEBUG_BOOTMEM is not set
1008# CONFIG_DEBUG_STACKOVERFLOW is not set
1009# CONFIG_DEBUG_STACK_USAGE is not set
1010# CONFIG_4KSTACKS is not set
1011# CONFIG_IRQSTACKS is not set
1012# CONFIG_SH_KGDB is not set
1013
1014#
1015# Security options
1016#
1017# CONFIG_KEYS is not set
1018# CONFIG_SECURITY is not set
1019# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1020CONFIG_CRYPTO=y
1021CONFIG_CRYPTO_ALGAPI=y
1022CONFIG_CRYPTO_AEAD=y
1023CONFIG_CRYPTO_BLKCIPHER=y
1024# CONFIG_CRYPTO_SEQIV is not set
1025CONFIG_CRYPTO_HASH=y
1026CONFIG_CRYPTO_MANAGER=y
1027CONFIG_CRYPTO_HMAC=y
1028# CONFIG_CRYPTO_XCBC is not set
1029# CONFIG_CRYPTO_NULL is not set
1030# CONFIG_CRYPTO_MD4 is not set
1031CONFIG_CRYPTO_MD5=y
1032CONFIG_CRYPTO_SHA1=y
1033# CONFIG_CRYPTO_SHA256 is not set
1034# CONFIG_CRYPTO_SHA512 is not set
1035# CONFIG_CRYPTO_WP512 is not set
1036# CONFIG_CRYPTO_TGR192 is not set
1037# CONFIG_CRYPTO_GF128MUL is not set
1038# CONFIG_CRYPTO_ECB is not set
1039CONFIG_CRYPTO_CBC=y
1040# CONFIG_CRYPTO_PCBC is not set
1041# CONFIG_CRYPTO_LRW is not set
1042# CONFIG_CRYPTO_XTS is not set
1043# CONFIG_CRYPTO_CTR is not set
1044# CONFIG_CRYPTO_GCM is not set
1045# CONFIG_CRYPTO_CCM is not set
1046# CONFIG_CRYPTO_CRYPTD is not set
1047CONFIG_CRYPTO_DES=y
1048# CONFIG_CRYPTO_FCRYPT is not set
1049# CONFIG_CRYPTO_BLOWFISH is not set
1050# CONFIG_CRYPTO_TWOFISH is not set
1051# CONFIG_CRYPTO_SERPENT is not set
1052# CONFIG_CRYPTO_AES is not set
1053# CONFIG_CRYPTO_CAST5 is not set
1054# CONFIG_CRYPTO_CAST6 is not set
1055# CONFIG_CRYPTO_TEA is not set
1056# CONFIG_CRYPTO_ARC4 is not set
1057# CONFIG_CRYPTO_KHAZAD is not set
1058# CONFIG_CRYPTO_ANUBIS is not set
1059# CONFIG_CRYPTO_SEED is not set
1060# CONFIG_CRYPTO_SALSA20 is not set
1061CONFIG_CRYPTO_DEFLATE=y
1062# CONFIG_CRYPTO_MICHAEL_MIC is not set
1063# CONFIG_CRYPTO_CRC32C is not set
1064# CONFIG_CRYPTO_CAMELLIA is not set
1065# CONFIG_CRYPTO_TEST is not set
1066CONFIG_CRYPTO_AUTHENC=y
1067# CONFIG_CRYPTO_LZO is not set
1068CONFIG_CRYPTO_HW=y
1069
1070#
1071# Library routines
1072#
1073CONFIG_BITREVERSE=y
1074CONFIG_CRC_CCITT=y
1075# CONFIG_CRC16 is not set
1076# CONFIG_CRC_ITU_T is not set
1077CONFIG_CRC32=y
1078# CONFIG_CRC7 is not set
1079# CONFIG_LIBCRC32C is not set
1080CONFIG_ZLIB_INFLATE=y
1081CONFIG_ZLIB_DEFLATE=y
1082CONFIG_PLIST=y
1083CONFIG_HAS_IOMEM=y
1084CONFIG_HAS_IOPORT=y
1085CONFIG_HAS_DMA=y
diff --git a/arch/sh/kernel/cf-enabler.c b/arch/sh/kernel/cf-enabler.c
index 1c3b99642e1c..01ff4d05aab0 100644
--- a/arch/sh/kernel/cf-enabler.c
+++ b/arch/sh/kernel/cf-enabler.c
@@ -83,6 +83,8 @@ static int __init cf_init_default(void)
83#include <asm/se.h> 83#include <asm/se.h>
84#elif defined(CONFIG_SH_7722_SOLUTION_ENGINE) 84#elif defined(CONFIG_SH_7722_SOLUTION_ENGINE)
85#include <asm/se7722.h> 85#include <asm/se7722.h>
86#elif defined(CONFIG_SH_7721_SOLUTION_ENGINE)
87#include <asm/se7721.h>
86#endif 88#endif
87 89
88/* 90/*
@@ -99,7 +101,9 @@ static int __init cf_init_default(void)
99 * 0xB0600000 : I/O 101 * 0xB0600000 : I/O
100 */ 102 */
101 103
102#if defined(CONFIG_SH_SOLUTION_ENGINE) || defined(CONFIG_SH_7722_SOLUTION_ENGINE) 104#if defined(CONFIG_SH_SOLUTION_ENGINE) || \
105 defined(CONFIG_SH_7722_SOLUTION_ENGINE) || \
106 defined(CONFIG_SH_7721_SOLUTION_ENGINE)
103static int __init cf_init_se(void) 107static int __init cf_init_se(void)
104{ 108{
105 if ((ctrl_inw(MRSHPC_CSR) & 0x000c) != 0) 109 if ((ctrl_inw(MRSHPC_CSR) & 0x000c) != 0)
@@ -112,7 +116,7 @@ static int __init cf_init_se(void)
112 } 116 }
113 117
114 /* 118 /*
115 * PC-Card window open 119 * PC-Card window open
116 * flag == COMMON/ATTRIBUTE/IO 120 * flag == COMMON/ATTRIBUTE/IO
117 */ 121 */
118 /* common window open */ 122 /* common window open */
@@ -122,7 +126,7 @@ static int __init cf_init_se(void)
122 ctrl_outw(0x0b00, MRSHPC_MW0CR2); 126 ctrl_outw(0x0b00, MRSHPC_MW0CR2);
123 else 127 else
124 /* common mode & bus width 16bit SWAP = 0*/ 128 /* common mode & bus width 16bit SWAP = 0*/
125 ctrl_outw(0x0300, MRSHPC_MW0CR2); 129 ctrl_outw(0x0300, MRSHPC_MW0CR2);
126 130
127 /* attribute window open */ 131 /* attribute window open */
128 ctrl_outw(0x8a85, MRSHPC_MW1CR1); 132 ctrl_outw(0x8a85, MRSHPC_MW1CR1);
@@ -155,10 +159,9 @@ static int __init cf_init_se(void)
155 159
156int __init cf_init(void) 160int __init cf_init(void)
157{ 161{
158 if( mach_is_se() || mach_is_7722se() ){ 162 if (mach_is_se() || mach_is_7722se() || mach_is_7721se())
159 return cf_init_se(); 163 return cf_init_se();
160 } 164
161
162 return cf_init_default(); 165 return cf_init_default();
163} 166}
164 167
diff --git a/arch/sh/kernel/cpu/sh2a/Makefile b/arch/sh/kernel/cpu/sh2a/Makefile
index b279cdc3a233..7e2b90cfa7bf 100644
--- a/arch/sh/kernel/cpu/sh2a/Makefile
+++ b/arch/sh/kernel/cpu/sh2a/Makefile
@@ -8,6 +8,7 @@ common-y += $(addprefix ../sh2/, ex.o entry.o)
8 8
9obj-$(CONFIG_SH_FPU) += fpu.o 9obj-$(CONFIG_SH_FPU) += fpu.o
10 10
11obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o 11obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o
12obj-$(CONFIG_CPU_SUBTYPE_SH7203) += setup-sh7203.o clock-sh7203.o 12obj-$(CONFIG_CPU_SUBTYPE_SH7203) += setup-sh7203.o clock-sh7203.o
13obj-$(CONFIG_CPU_SUBTYPE_SH7263) += setup-sh7203.o clock-sh7203.o 13obj-$(CONFIG_CPU_SUBTYPE_SH7263) += setup-sh7203.o clock-sh7203.o
14obj-$(CONFIG_CPU_SUBTYPE_MXG) += setup-mxg.o clock-sh7206.o
diff --git a/arch/sh/kernel/cpu/sh2a/probe.c b/arch/sh/kernel/cpu/sh2a/probe.c
index 6910e2664468..6e79132f6f30 100644
--- a/arch/sh/kernel/cpu/sh2a/probe.c
+++ b/arch/sh/kernel/cpu/sh2a/probe.c
@@ -29,6 +29,9 @@ int __init detect_cpu_and_cache_system(void)
29 boot_cpu_data.type = CPU_SH7206; 29 boot_cpu_data.type = CPU_SH7206;
30 /* While SH7206 has a DSP.. */ 30 /* While SH7206 has a DSP.. */
31 boot_cpu_data.flags |= CPU_HAS_DSP; 31 boot_cpu_data.flags |= CPU_HAS_DSP;
32#elif defined(CONFIG_CPU_SUBTYPE_MXG)
33 boot_cpu_data.type = CPU_MXG;
34 boot_cpu_data.flags |= CPU_HAS_DSP;
32#endif 35#endif
33 36
34 boot_cpu_data.dcache.ways = 4; 37 boot_cpu_data.dcache.ways = 4;
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
new file mode 100644
index 000000000000..e611d79fac4c
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
@@ -0,0 +1,168 @@
1/*
2 * Renesas MX-G (R8A03022BG) Setup
3 *
4 * Copyright (C) 2008 Paul Mundt
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#include <linux/platform_device.h>
11#include <linux/init.h>
12#include <linux/serial.h>
13#include <linux/serial_sci.h>
14
15enum {
16 UNUSED = 0,
17
18 /* interrupt sources */
19 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
20 IRQ8, IRQ9, IRQ10, IRQ11, IRQ12, IRQ13, IRQ14, IRQ15,
21
22 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
23
24 SINT8, SINT7, SINT6, SINT5, SINT4, SINT3, SINT2, SINT1,
25
26 SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI,
27 SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
28
29 MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D,
30 MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F,
31 MTU2_TGI1A, MTU2_TGI1B, MTU2_TCI1V, MTU2_TCI1U,
32 MTU2_TGI2A, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U,
33 MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D, MTU2_TCI3V,
34 MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D, MTU2_TCI4V,
35 MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W,
36
37 /* interrupt groups */
38 PINT, SCIF0, SCIF1,
39 MTU2_GROUP1, MTU2_GROUP2, MTU2_GROUP3, MTU2_GROUP4, MTU2_GROUP5
40};
41
42static struct intc_vect vectors[] __initdata = {
43 INTC_IRQ(IRQ0, 64), INTC_IRQ(IRQ1, 65),
44 INTC_IRQ(IRQ2, 66), INTC_IRQ(IRQ3, 67),
45 INTC_IRQ(IRQ4, 68), INTC_IRQ(IRQ5, 69),
46 INTC_IRQ(IRQ6, 70), INTC_IRQ(IRQ7, 71),
47 INTC_IRQ(IRQ8, 72), INTC_IRQ(IRQ9, 73),
48 INTC_IRQ(IRQ10, 74), INTC_IRQ(IRQ11, 75),
49 INTC_IRQ(IRQ12, 76), INTC_IRQ(IRQ13, 77),
50 INTC_IRQ(IRQ14, 78), INTC_IRQ(IRQ15, 79),
51
52 INTC_IRQ(PINT0, 80), INTC_IRQ(PINT1, 81),
53 INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83),
54 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85),
55 INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87),
56
57 INTC_IRQ(SINT8, 94), INTC_IRQ(SINT7, 95),
58 INTC_IRQ(SINT6, 96), INTC_IRQ(SINT5, 97),
59 INTC_IRQ(SINT4, 98), INTC_IRQ(SINT3, 99),
60 INTC_IRQ(SINT2, 100), INTC_IRQ(SINT1, 101),
61
62 INTC_IRQ(SCIF0_RXI, 220), INTC_IRQ(SCIF0_TXI, 221),
63 INTC_IRQ(SCIF0_BRI, 222), INTC_IRQ(SCIF0_ERI, 223),
64 INTC_IRQ(SCIF1_RXI, 224), INTC_IRQ(SCIF1_TXI, 225),
65 INTC_IRQ(SCIF1_BRI, 226), INTC_IRQ(SCIF1_ERI, 227),
66
67 INTC_IRQ(MTU2_TGI0A, 228), INTC_IRQ(MTU2_TGI0B, 229),
68 INTC_IRQ(MTU2_TGI0C, 230), INTC_IRQ(MTU2_TGI0D, 231),
69 INTC_IRQ(MTU2_TCI0V, 232), INTC_IRQ(MTU2_TGI0E, 233),
70
71 INTC_IRQ(MTU2_TGI0F, 234), INTC_IRQ(MTU2_TGI1A, 235),
72 INTC_IRQ(MTU2_TGI1B, 236), INTC_IRQ(MTU2_TCI1V, 237),
73 INTC_IRQ(MTU2_TCI1U, 238), INTC_IRQ(MTU2_TGI2A, 239),
74
75 INTC_IRQ(MTU2_TGI2B, 240), INTC_IRQ(MTU2_TCI2V, 241),
76 INTC_IRQ(MTU2_TCI2U, 242), INTC_IRQ(MTU2_TGI3A, 243),
77
78 INTC_IRQ(MTU2_TGI3B, 244),
79 INTC_IRQ(MTU2_TGI3C, 245),
80
81 INTC_IRQ(MTU2_TGI3D, 246), INTC_IRQ(MTU2_TCI3V, 247),
82 INTC_IRQ(MTU2_TGI4A, 248), INTC_IRQ(MTU2_TGI4B, 249),
83 INTC_IRQ(MTU2_TGI4C, 250), INTC_IRQ(MTU2_TGI4D, 251),
84
85 INTC_IRQ(MTU2_TCI4V, 252), INTC_IRQ(MTU2_TGI5U, 253),
86 INTC_IRQ(MTU2_TGI5V, 254), INTC_IRQ(MTU2_TGI5W, 255),
87};
88
89static struct intc_group groups[] __initdata = {
90 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
91 PINT4, PINT5, PINT6, PINT7),
92 INTC_GROUP(MTU2_GROUP1, MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D,
93 MTU2_TCI0V, MTU2_TGI0E),
94 INTC_GROUP(MTU2_GROUP2, MTU2_TGI0F, MTU2_TGI1A, MTU2_TGI1B,
95 MTU2_TCI1V, MTU2_TCI1U, MTU2_TGI2A),
96 INTC_GROUP(MTU2_GROUP3, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U,
97 MTU2_TGI3A),
98 INTC_GROUP(MTU2_GROUP4, MTU2_TGI3D, MTU2_TCI3V, MTU2_TGI4A,
99 MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D),
100 INTC_GROUP(MTU2_GROUP5, MTU2_TCI4V, MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W),
101 INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
102 INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
103};
104
105static struct intc_prio_reg prio_registers[] __initdata = {
106 { 0xfffd9418, 0, 16, 4, /* IPR01 */ { IRQ0, IRQ1, IRQ2, IRQ3 } },
107 { 0xfffd941a, 0, 16, 4, /* IPR02 */ { IRQ4, IRQ5, IRQ6, IRQ7 } },
108 { 0xfffd941c, 0, 16, 4, /* IPR03 */ { IRQ8, IRQ9, IRQ10, IRQ11 } },
109 { 0xfffd941e, 0, 16, 4, /* IPR04 */ { IRQ12, IRQ13, IRQ14, IRQ15 } },
110 { 0xfffd9420, 0, 16, 4, /* IPR05 */ { PINT, 0, 0, 0 } },
111 { 0xfffd9800, 0, 16, 4, /* IPR06 */ { } },
112 { 0xfffd9802, 0, 16, 4, /* IPR07 */ { } },
113 { 0xfffd9804, 0, 16, 4, /* IPR08 */ { } },
114 { 0xfffd9806, 0, 16, 4, /* IPR09 */ { } },
115 { 0xfffd9808, 0, 16, 4, /* IPR10 */ { } },
116 { 0xfffd980a, 0, 16, 4, /* IPR11 */ { } },
117 { 0xfffd980c, 0, 16, 4, /* IPR12 */ { } },
118 { 0xfffd980e, 0, 16, 4, /* IPR13 */ { } },
119 { 0xfffd9810, 0, 16, 4, /* IPR14 */ { 0, 0, 0, SCIF0 } },
120 { 0xfffd9812, 0, 16, 4, /* IPR15 */
121 { SCIF1, MTU2_GROUP1, MTU2_GROUP2, MTU2_GROUP3 } },
122 { 0xfffd9814, 0, 16, 4, /* IPR16 */
123 { MTU2_TGI3B, MTU2_TGI3C, MTU2_GROUP4, MTU2_GROUP5 } },
124};
125
126static struct intc_mask_reg mask_registers[] __initdata = {
127 { 0xfffd9408, 0, 16, /* PINTER */
128 { 0, 0, 0, 0, 0, 0, 0, 0,
129 PINT7, PINT6, PINT5, PINT4, PINT3, PINT2, PINT1, PINT0 } },
130};
131
132static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups,
133 mask_registers, prio_registers, NULL);
134
135static struct plat_sci_port sci_platform_data[] = {
136 {
137 .mapbase = 0xff804000,
138 .flags = UPF_BOOT_AUTOCONF,
139 .type = PORT_SCIF,
140 .irqs = { 223, 220, 221, 222 },
141 }, {
142 .flags = 0,
143 }
144};
145
146static struct platform_device sci_device = {
147 .name = "sh-sci",
148 .id = -1,
149 .dev = {
150 .platform_data = sci_platform_data,
151 },
152};
153
154static struct platform_device *mxg_devices[] __initdata = {
155 &sci_device,
156};
157
158static int __init mxg_devices_setup(void)
159{
160 return platform_add_devices(mxg_devices,
161 ARRAY_SIZE(mxg_devices));
162}
163__initcall(mxg_devices_setup);
164
165void __init plat_irq_setup(void)
166{
167 register_intc_controller(&intc_desc);
168}
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c
index 9e89984c4f1d..ebceb0dadff5 100644
--- a/arch/sh/kernel/cpu/sh4/probe.c
+++ b/arch/sh/kernel/cpu/sh4/probe.c
@@ -53,7 +53,7 @@ int __init detect_cpu_and_cache_system(void)
53 /* 53 /*
54 * Setup some generic flags we can probe on SH-4A parts 54 * Setup some generic flags we can probe on SH-4A parts
55 */ 55 */
56 if (((pvr >> 16) & 0xff) == 0x10) { 56 if (((pvr >> 24) & 0xff) == 0x10) {
57 if ((cvr & 0x10000000) == 0) 57 if ((cvr & 0x10000000) == 0)
58 boot_cpu_data.flags |= CPU_HAS_DSP; 58 boot_cpu_data.flags |= CPU_HAS_DSP;
59 59
@@ -126,17 +126,22 @@ int __init detect_cpu_and_cache_system(void)
126 CPU_HAS_LLSC; 126 CPU_HAS_LLSC;
127 break; 127 break;
128 case 0x3008: 128 case 0x3008:
129 if (prr == 0xa0 || prr == 0xa1) { 129 boot_cpu_data.icache.ways = 4;
130 boot_cpu_data.type = CPU_SH7722; 130 boot_cpu_data.dcache.ways = 4;
131 boot_cpu_data.icache.ways = 4; 131 boot_cpu_data.flags |= CPU_HAS_LLSC;
132 boot_cpu_data.dcache.ways = 4; 132
133 boot_cpu_data.flags |= CPU_HAS_LLSC; 133 switch (prr) {
134 } 134 case 0x50:
135 else if (prr == 0x70) { 135 boot_cpu_data.type = CPU_SH7723;
136 boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_L2_CACHE;
137 break;
138 case 0x70:
136 boot_cpu_data.type = CPU_SH7366; 139 boot_cpu_data.type = CPU_SH7366;
137 boot_cpu_data.icache.ways = 4; 140 break;
138 boot_cpu_data.dcache.ways = 4; 141 case 0xa0:
139 boot_cpu_data.flags |= CPU_HAS_LLSC; 142 case 0xa1:
143 boot_cpu_data.type = CPU_SH7722;
144 break;
140 } 145 }
141 break; 146 break;
142 case 0x4000: /* 1st cut */ 147 case 0x4000: /* 1st cut */
@@ -215,6 +220,12 @@ int __init detect_cpu_and_cache_system(void)
215 * SH-4A's have an optional PIPT L2. 220 * SH-4A's have an optional PIPT L2.
216 */ 221 */
217 if (boot_cpu_data.flags & CPU_HAS_L2_CACHE) { 222 if (boot_cpu_data.flags & CPU_HAS_L2_CACHE) {
223 /* Bug if we can't decode the L2 info */
224 BUG_ON(!(cvr & 0xf));
225
226 /* Silicon and specifications have clearly never met.. */
227 cvr ^= 0xf;
228
218 /* 229 /*
219 * Size calculation is much more sensible 230 * Size calculation is much more sensible
220 * than it is for the L1. 231 * than it is for the L1.
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile
index 5d890ac8e793..a880e7968750 100644
--- a/arch/sh/kernel/cpu/sh4a/Makefile
+++ b/arch/sh/kernel/cpu/sh4a/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o
9obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o 9obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o
10obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o 10obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o
11obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o 11obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o
12obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o
12obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o 13obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o
13obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o 14obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o
14 15
@@ -22,6 +23,7 @@ clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o
22clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o 23clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o
23clock-$(CONFIG_CPU_SUBTYPE_SH7343) := clock-sh7343.o 24clock-$(CONFIG_CPU_SUBTYPE_SH7343) := clock-sh7343.o
24clock-$(CONFIG_CPU_SUBTYPE_SH7722) := clock-sh7722.o 25clock-$(CONFIG_CPU_SUBTYPE_SH7722) := clock-sh7722.o
26clock-$(CONFIG_CPU_SUBTYPE_SH7723) := clock-sh7722.o
25clock-$(CONFIG_CPU_SUBTYPE_SH7366) := clock-sh7722.o 27clock-$(CONFIG_CPU_SUBTYPE_SH7366) := clock-sh7722.o
26clock-$(CONFIG_CPU_SUBTYPE_SHX3) := clock-shx3.o 28clock-$(CONFIG_CPU_SUBTYPE_SHX3) := clock-shx3.o
27 29
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index b98b4bc93ec9..069314037049 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -16,13 +16,12 @@
16 16
17static struct resource usbf_resources[] = { 17static struct resource usbf_resources[] = {
18 [0] = { 18 [0] = {
19 .name = "m66592_udc", 19 .name = "USBF",
20 .start = 0xA4480000, 20 .start = 0x04480000,
21 .end = 0xA44800FF, 21 .end = 0x044800FF,
22 .flags = IORESOURCE_MEM, 22 .flags = IORESOURCE_MEM,
23 }, 23 },
24 [1] = { 24 [1] = {
25 .name = "m66592_udc",
26 .start = 65, 25 .start = 65,
27 .end = 65, 26 .end = 65,
28 .flags = IORESOURCE_IRQ, 27 .flags = IORESOURCE_IRQ,
@@ -40,6 +39,26 @@ static struct platform_device usbf_device = {
40 .resource = usbf_resources, 39 .resource = usbf_resources,
41}; 40};
42 41
42static struct resource iic_resources[] = {
43 [0] = {
44 .name = "IIC",
45 .start = 0x04470000,
46 .end = 0x04470017,
47 .flags = IORESOURCE_MEM,
48 },
49 [1] = {
50 .start = 96,
51 .end = 99,
52 .flags = IORESOURCE_IRQ,
53 },
54};
55
56static struct platform_device iic_device = {
57 .name = "i2c-sh_mobile",
58 .num_resources = ARRAY_SIZE(iic_resources),
59 .resource = iic_resources,
60};
61
43static struct plat_sci_port sci_platform_data[] = { 62static struct plat_sci_port sci_platform_data[] = {
44 { 63 {
45 .mapbase = 0xffe00000, 64 .mapbase = 0xffe00000,
@@ -74,6 +93,7 @@ static struct platform_device sci_device = {
74 93
75static struct platform_device *sh7722_devices[] __initdata = { 94static struct platform_device *sh7722_devices[] __initdata = {
76 &usbf_device, 95 &usbf_device,
96 &iic_device,
77 &sci_device, 97 &sci_device,
78}; 98};
79 99
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
new file mode 100644
index 000000000000..16925cf28db8
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -0,0 +1,300 @@
1/*
2 * SH7723 Setup
3 *
4 * Copyright (C) 2008 Paul Mundt
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#include <linux/platform_device.h>
11#include <linux/init.h>
12#include <linux/serial.h>
13#include <linux/mm.h>
14#include <linux/serial_sci.h>
15#include <asm/mmzone.h>
16
17static struct plat_sci_port sci_platform_data[] = {
18 {
19 .mapbase = 0xa4e30000,
20 .flags = UPF_BOOT_AUTOCONF,
21 .type = PORT_SCI,
22 .irqs = { 56, 56, 56, 56 },
23 },{
24 .mapbase = 0xa4e40000,
25 .flags = UPF_BOOT_AUTOCONF,
26 .type = PORT_SCI,
27 .irqs = { 88, 88, 88, 88 },
28 },{
29 .mapbase = 0xa4e50000,
30 .flags = UPF_BOOT_AUTOCONF,
31 .type = PORT_SCI,
32 .irqs = { 109, 109, 109, 109 },
33 }, {
34 .flags = 0,
35 }
36};
37
38static struct platform_device sci_device = {
39 .name = "sh-sci",
40 .id = -1,
41 .dev = {
42 .platform_data = sci_platform_data,
43 },
44};
45
46static struct resource rtc_resources[] = {
47 [0] = {
48 .start = 0xa465fec0,
49 .end = 0xa465fec0 + 0x58 - 1,
50 .flags = IORESOURCE_IO,
51 },
52 [1] = {
53 /* Period IRQ */
54 .start = 69,
55 .flags = IORESOURCE_IRQ,
56 },
57 [2] = {
58 /* Carry IRQ */
59 .start = 70,
60 .flags = IORESOURCE_IRQ,
61 },
62 [3] = {
63 /* Alarm IRQ */
64 .start = 68,
65 .flags = IORESOURCE_IRQ,
66 },
67};
68
69static struct platform_device rtc_device = {
70 .name = "sh-rtc",
71 .id = -1,
72 .num_resources = ARRAY_SIZE(rtc_resources),
73 .resource = rtc_resources,
74};
75
76static struct platform_device *sh7723_devices[] __initdata = {
77 &sci_device,
78 &rtc_device,
79};
80
81static int __init sh7723_devices_setup(void)
82{
83 return platform_add_devices(sh7723_devices,
84 ARRAY_SIZE(sh7723_devices));
85}
86__initcall(sh7723_devices_setup);
87
88enum {
89 UNUSED=0,
90
91 /* interrupt sources */
92 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
93 HUDI,
94 DMAC1A_DEI0,DMAC1A_DEI1,DMAC1A_DEI2,DMAC1A_DEI3,
95 _2DG_TRI,_2DG_INI,_2DG_CEI,
96 DMAC0A_DEI0,DMAC0A_DEI1,DMAC0A_DEI2,DMAC0A_DEI3,
97 VIO_CEUI,VIO_BEUI,VIO_VEU2HI,VIO_VOUI,
98 SCIFA_SCIFA0,
99 VPU_VPUI,
100 TPU_TPUI,
101 ADC_ADI,
102 USB_USI0,
103 RTC_ATI,RTC_PRI,RTC_CUI,
104 DMAC1B_DEI4,DMAC1B_DEI5,DMAC1B_DADERR,
105 DMAC0B_DEI4,DMAC0B_DEI5,DMAC0B_DADERR,
106 KEYSC_KEYI,
107 SCIF_SCIF0,SCIF_SCIF1,SCIF_SCIF2,
108 MSIOF_MSIOFI0,MSIOF_MSIOFI1,
109 SCIFA_SCIFA1,
110 FLCTL_FLSTEI,FLCTL_FLTENDI,FLCTL_FLTREQ0I,FLCTL_FLTREQ1I,
111 I2C_ALI,I2C_TACKI,I2C_WAITI,I2C_DTEI,
112 SDHI0_SDHII0,SDHI0_SDHII1,SDHI0_SDHII2,
113 CMT_CMTI,
114 TSIF_TSIFI,
115 SIU_SIUI,
116 SCIFA_SCIFA2,
117 TMU0_TUNI0, TMU0_TUNI1, TMU0_TUNI2,
118 IRDA_IRDAI,
119 ATAPI_ATAPII,
120 SDHI1_SDHII0,SDHI1_SDHII1,SDHI1_SDHII2,
121 VEU2H1_VEU2HI,
122 LCDC_LCDCI,
123 TMU1_TUNI0,TMU1_TUNI1,TMU1_TUNI2,
124
125 /* interrupt groups */
126 DMAC1A, DMAC0A, VIO, DMAC0B, FLCTL, I2C, _2DG,
127 SDHI1, RTC, DMAC1B, SDHI0,
128};
129
130static struct intc_vect vectors[] __initdata = {
131 INTC_VECT(IRQ0, 0x600), INTC_VECT(IRQ1, 0x620),
132 INTC_VECT(IRQ2, 0x640), INTC_VECT(IRQ3, 0x660),
133 INTC_VECT(IRQ4, 0x680), INTC_VECT(IRQ5, 0x6a0),
134 INTC_VECT(IRQ6, 0x6c0), INTC_VECT(IRQ7, 0x6e0),
135
136 INTC_VECT(DMAC1A_DEI0,0x700),
137 INTC_VECT(DMAC1A_DEI1,0x720),
138 INTC_VECT(DMAC1A_DEI2,0x740),
139 INTC_VECT(DMAC1A_DEI3,0x760),
140
141 INTC_VECT(_2DG_TRI, 0x780),
142 INTC_VECT(_2DG_INI, 0x7A0),
143 INTC_VECT(_2DG_CEI, 0x7C0),
144
145 INTC_VECT(DMAC0A_DEI0,0x800),
146 INTC_VECT(DMAC0A_DEI1,0x820),
147 INTC_VECT(DMAC0A_DEI2,0x840),
148 INTC_VECT(DMAC0A_DEI3,0x860),
149
150 INTC_VECT(VIO_CEUI,0x880),
151 INTC_VECT(VIO_BEUI,0x8A0),
152 INTC_VECT(VIO_VEU2HI,0x8C0),
153 INTC_VECT(VIO_VOUI,0x8E0),
154
155 INTC_VECT(SCIFA_SCIFA0,0x900),
156 INTC_VECT(VPU_VPUI,0x920),
157 INTC_VECT(TPU_TPUI,0x9A0),
158 INTC_VECT(ADC_ADI,0x9E0),
159 INTC_VECT(USB_USI0,0xA20),
160
161 INTC_VECT(RTC_ATI,0xA80),
162 INTC_VECT(RTC_PRI,0xAA0),
163 INTC_VECT(RTC_CUI,0xAC0),
164
165 INTC_VECT(DMAC1B_DEI4,0xB00),
166 INTC_VECT(DMAC1B_DEI5,0xB20),
167 INTC_VECT(DMAC1B_DADERR,0xB40),
168
169 INTC_VECT(DMAC0B_DEI4,0xB80),
170 INTC_VECT(DMAC0B_DEI5,0xBA0),
171 INTC_VECT(DMAC0B_DADERR,0xBC0),
172
173 INTC_VECT(KEYSC_KEYI,0xBE0),
174 INTC_VECT(SCIF_SCIF0,0xC00),
175 INTC_VECT(SCIF_SCIF1,0xC20),
176 INTC_VECT(SCIF_SCIF2,0xC40),
177 INTC_VECT(MSIOF_MSIOFI0,0xC80),
178 INTC_VECT(MSIOF_MSIOFI1,0xCA0),
179 INTC_VECT(SCIFA_SCIFA1,0xD00),
180
181 INTC_VECT(FLCTL_FLSTEI,0xD80),
182 INTC_VECT(FLCTL_FLTENDI,0xDA0),
183 INTC_VECT(FLCTL_FLTREQ0I,0xDC0),
184 INTC_VECT(FLCTL_FLTREQ1I,0xDE0),
185
186 INTC_VECT(I2C_ALI,0xE00),
187 INTC_VECT(I2C_TACKI,0xE20),
188 INTC_VECT(I2C_WAITI,0xE40),
189 INTC_VECT(I2C_DTEI,0xE60),
190
191 INTC_VECT(SDHI0_SDHII0,0xE80),
192 INTC_VECT(SDHI0_SDHII1,0xEA0),
193 INTC_VECT(SDHI0_SDHII2,0xEC0),
194
195 INTC_VECT(CMT_CMTI,0xF00),
196 INTC_VECT(TSIF_TSIFI,0xF20),
197 INTC_VECT(SIU_SIUI,0xF80),
198 INTC_VECT(SCIFA_SCIFA2,0xFA0),
199
200 INTC_VECT(TMU0_TUNI0,0x400),
201 INTC_VECT(TMU0_TUNI1,0x420),
202 INTC_VECT(TMU0_TUNI2,0x440),
203
204 INTC_VECT(IRDA_IRDAI,0x480),
205 INTC_VECT(ATAPI_ATAPII,0x4A0),
206
207 INTC_VECT(SDHI1_SDHII0,0x4E0),
208 INTC_VECT(SDHI1_SDHII1,0x500),
209 INTC_VECT(SDHI1_SDHII2,0x520),
210
211 INTC_VECT(VEU2H1_VEU2HI,0x560),
212 INTC_VECT(LCDC_LCDCI,0x580),
213
214 INTC_VECT(TMU1_TUNI0,0x920),
215 INTC_VECT(TMU1_TUNI1,0x940),
216 INTC_VECT(TMU1_TUNI2,0x960),
217
218};
219
220static struct intc_group groups[] __initdata = {
221 INTC_GROUP(DMAC1A,DMAC1A_DEI0,DMAC1A_DEI1,DMAC1A_DEI2,DMAC1A_DEI3),
222 INTC_GROUP(DMAC0A,DMAC0A_DEI0,DMAC0A_DEI1,DMAC0A_DEI2,DMAC0A_DEI3),
223 INTC_GROUP(VIO, VIO_CEUI,VIO_BEUI,VIO_VEU2HI,VIO_VOUI),
224 INTC_GROUP(DMAC0B, DMAC0B_DEI4,DMAC0B_DEI5,DMAC0B_DADERR),
225 INTC_GROUP(FLCTL,FLCTL_FLSTEI,FLCTL_FLTENDI,FLCTL_FLTREQ0I,FLCTL_FLTREQ1I),
226 INTC_GROUP(I2C,I2C_ALI,I2C_TACKI,I2C_WAITI,I2C_DTEI),
227 INTC_GROUP(_2DG, _2DG_TRI,_2DG_INI,_2DG_CEI),
228 INTC_GROUP(SDHI1, SDHI1_SDHII0,SDHI1_SDHII1,SDHI1_SDHII2),
229 INTC_GROUP(RTC, RTC_ATI,RTC_PRI,RTC_CUI),
230 INTC_GROUP(DMAC1B, DMAC1B_DEI4,DMAC1B_DEI5,DMAC1B_DADERR),
231 INTC_GROUP(SDHI0,SDHI0_SDHII0,SDHI0_SDHII1,SDHI0_SDHII2),
232};
233
234static struct intc_mask_reg mask_registers[] __initdata = {
235 { 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
236 { 0, TMU1_TUNI2,TMU1_TUNI1,TMU1_TUNI0,0,SDHI1_SDHII2,SDHI1_SDHII1,SDHI1_SDHII0} },
237 { 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
238 { VIO_VOUI, VIO_VEU2HI,VIO_BEUI,VIO_CEUI,DMAC0A_DEI3,DMAC0A_DEI2,DMAC0A_DEI1,DMAC0A_DEI0 } },
239 { 0xa4080088, 0xa40800c8, 8, /* IMR2 / IMCR2 */
240 { 0, 0, 0, VPU_VPUI,0,0,0,SCIFA_SCIFA0 } },
241 { 0xa408008c, 0xa40800cc, 8, /* IMR3 / IMCR3 */
242 { DMAC1A_DEI3,DMAC1A_DEI2,DMAC1A_DEI1,DMAC1A_DEI0,0,0,0,IRDA_IRDAI } },
243 { 0xa4080090, 0xa40800d0, 8, /* IMR4 / IMCR4 */
244 { 0,TMU0_TUNI2,TMU0_TUNI1,TMU0_TUNI0,VEU2H1_VEU2HI,0,0,LCDC_LCDCI } },
245 { 0xa4080094, 0xa40800d4, 8, /* IMR5 / IMCR5 */
246 { KEYSC_KEYI,DMAC0B_DADERR,DMAC0B_DEI5,DMAC0B_DEI4,0,SCIF_SCIF2,SCIF_SCIF1,SCIF_SCIF0 } },
247 { 0xa4080098, 0xa40800d8, 8, /* IMR6 / IMCR6 */
248 { 0,0,0,SCIFA_SCIFA1,ADC_ADI,0,MSIOF_MSIOFI1,MSIOF_MSIOFI0 } },
249 { 0xa408009c, 0xa40800dc, 8, /* IMR7 / IMCR7 */
250 { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
251 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
252 { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
253 { 0,SDHI0_SDHII2,SDHI0_SDHII1,SDHI0_SDHII0,0,0,SCIFA_SCIFA2,SIU_SIUI } },
254 { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
255 { 0, 0, 0, CMT_CMTI, 0, 0, USB_USI0,0 } },
256 { 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
257 { 0, DMAC1B_DADERR,DMAC1B_DEI5,DMAC1B_DEI4,0,RTC_ATI,RTC_PRI,RTC_CUI } },
258 { 0xa40800ac, 0xa40800ec, 8, /* IMR11 / IMCR11 */
259 { 0,_2DG_CEI,_2DG_INI,_2DG_TRI,0,TPU_TPUI,0,TSIF_TSIFI } },
260 { 0xa40800b0, 0xa40800f0, 8, /* IMR12 / IMCR12 */
261 { 0,0,0,0,0,0,0,ATAPI_ATAPII } },
262 { 0xa4140044, 0xa4140064, 8, /* INTMSK00 / INTMSKCLR00 */
263 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
264};
265
266static struct intc_prio_reg prio_registers[] __initdata = {
267 { 0xa4080000, 0, 16, 4, /* IPRA */ { TMU0_TUNI0, TMU0_TUNI1, TMU0_TUNI2, IRDA_IRDAI } },
268 { 0xa4080004, 0, 16, 4, /* IPRB */ { VEU2H1_VEU2HI, LCDC_LCDCI, DMAC1A, 0} },
269 { 0xa4080008, 0, 16, 4, /* IPRC */ { TMU1_TUNI0, TMU1_TUNI1, TMU1_TUNI2, 0} },
270 { 0xa408000c, 0, 16, 4, /* IPRD */ { } },
271 { 0xa4080010, 0, 16, 4, /* IPRE */ { DMAC0A, VIO, SCIFA_SCIFA0, VPU_VPUI } },
272 { 0xa4080014, 0, 16, 4, /* IPRF */ { KEYSC_KEYI, DMAC0B, USB_USI0, CMT_CMTI } },
273 { 0xa4080018, 0, 16, 4, /* IPRG */ { SCIF_SCIF0, SCIF_SCIF1, SCIF_SCIF2,0 } },
274 { 0xa408001c, 0, 16, 4, /* IPRH */ { MSIOF_MSIOFI0,MSIOF_MSIOFI1, FLCTL, I2C } },
275 { 0xa4080020, 0, 16, 4, /* IPRI */ { SCIFA_SCIFA1,0,TSIF_TSIFI,_2DG } },
276 { 0xa4080024, 0, 16, 4, /* IPRJ */ { ADC_ADI,0,SIU_SIUI,SDHI1 } },
277 { 0xa4080028, 0, 16, 4, /* IPRK */ { RTC,DMAC1B,0,SDHI0 } },
278 { 0xa408002c, 0, 16, 4, /* IPRL */ { SCIFA_SCIFA2,0,TPU_TPUI,ATAPI_ATAPII } },
279 { 0xa4140010, 0, 32, 4, /* INTPRI00 */
280 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
281};
282
283static struct intc_sense_reg sense_registers[] __initdata = {
284 { 0xa414001c, 16, 2, /* ICR1 */
285 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
286};
287
288static DECLARE_INTC_DESC(intc_desc, "sh7723", vectors, groups,
289 mask_registers, prio_registers, sense_registers);
290
291void __init plat_irq_setup(void)
292{
293 register_intc_controller(&intc_desc);
294}
295
296void __init plat_mem_setup(void)
297{
298 /* Register the URAM space as Node 1 */
299 setup_bootmem_node(1, 0x055f0000, 0x05610000);
300}
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 07c988dc9de6..ae2b22219f02 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -231,12 +231,6 @@ static struct intc_group groups[] __initdata = {
231 INTC_GROUP(GPIO, GPIO_CH0, GPIO_CH1, GPIO_CH2, GPIO_CH3), 231 INTC_GROUP(GPIO, GPIO_CH0, GPIO_CH1, GPIO_CH2, GPIO_CH3),
232}; 232};
233 233
234static struct intc_prio priorities[] __initdata = {
235 INTC_PRIO(SCIF0, 3),
236 INTC_PRIO(SCIF1, 3),
237 INTC_PRIO(SCIF2, 3),
238};
239
240static struct intc_mask_reg mask_registers[] __initdata = { 234static struct intc_mask_reg mask_registers[] __initdata = {
241 { 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */ 235 { 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */
242 { 0, 0, 0, 0, 0, 0, GPIO, 0, 236 { 0, 0, 0, 0, 0, 0, GPIO, 0,
@@ -270,11 +264,10 @@ static struct intc_prio_reg prio_registers[] __initdata = {
270 { 0xffd400b4, 0, 32, 8, /* INT2PRI13 */ { 0, 0, STIF1, STIF0 } }, 264 { 0xffd400b4, 0, 32, 8, /* INT2PRI13 */ { 0, 0, STIF1, STIF0 } },
271}; 265};
272 266
273static DECLARE_INTC_DESC(intc_desc, "sh7763", vectors, groups, priorities, 267static DECLARE_INTC_DESC(intc_desc, "sh7763", vectors, groups,
274 mask_registers, prio_registers, NULL); 268 mask_registers, prio_registers, NULL);
275 269
276/* Support for external interrupt pins in IRQ mode */ 270/* Support for external interrupt pins in IRQ mode */
277
278static struct intc_vect irq_vectors[] __initdata = { 271static struct intc_vect irq_vectors[] __initdata = {
279 INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280), 272 INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),
280 INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300), 273 INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300),
@@ -302,7 +295,6 @@ static DECLARE_INTC_DESC(intc_irq_desc, "sh7763-irq", irq_vectors,
302 irq_sense_registers); 295 irq_sense_registers);
303 296
304/* External interrupt pins in IRL mode */ 297/* External interrupt pins in IRL mode */
305
306static struct intc_vect irl_vectors[] __initdata = { 298static struct intc_vect irl_vectors[] __initdata = {
307 INTC_VECT(IRL_LLLL, 0x200), INTC_VECT(IRL_LLLH, 0x220), 299 INTC_VECT(IRL_LLLL, 0x200), INTC_VECT(IRL_LLLH, 0x220),
308 INTC_VECT(IRL_LLHL, 0x240), INTC_VECT(IRL_LLHH, 0x260), 300 INTC_VECT(IRL_LLHL, 0x240), INTC_VECT(IRL_LLHH, 0x260),
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index b9cec48b1808..b73578ee295d 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SH7770 Setup 2 * SH7770 Setup
3 * 3 *
4 * Copyright (C) 2006 Paul Mundt 4 * Copyright (C) 2006 - 2008 Paul Mundt
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 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 7 * License. See the file "COPYING" in the main directory of this archive
@@ -29,6 +29,41 @@ static struct plat_sci_port sci_platform_data[] = {
29 .type = PORT_SCIF, 29 .type = PORT_SCIF,
30 .irqs = { 63, 63, 63, 63 }, 30 .irqs = { 63, 63, 63, 63 },
31 }, { 31 }, {
32 .mapbase = 0xff926000,
33 .flags = UPF_BOOT_AUTOCONF,
34 .type = PORT_SCIF,
35 .irqs = { 64, 64, 64, 64 },
36 }, {
37 .mapbase = 0xff927000,
38 .flags = UPF_BOOT_AUTOCONF,
39 .type = PORT_SCIF,
40 .irqs = { 65, 65, 65, 65 },
41 }, {
42 .mapbase = 0xff928000,
43 .flags = UPF_BOOT_AUTOCONF,
44 .type = PORT_SCIF,
45 .irqs = { 66, 66, 66, 66 },
46 }, {
47 .mapbase = 0xff929000,
48 .flags = UPF_BOOT_AUTOCONF,
49 .type = PORT_SCIF,
50 .irqs = { 67, 67, 67, 67 },
51 }, {
52 .mapbase = 0xff92a000,
53 .flags = UPF_BOOT_AUTOCONF,
54 .type = PORT_SCIF,
55 .irqs = { 68, 68, 68, 68 },
56 }, {
57 .mapbase = 0xff92b000,
58 .flags = UPF_BOOT_AUTOCONF,
59 .type = PORT_SCIF,
60 .irqs = { 69, 69, 69, 69 },
61 }, {
62 .mapbase = 0xff92c000,
63 .flags = UPF_BOOT_AUTOCONF,
64 .type = PORT_SCIF,
65 .irqs = { 70, 70, 70, 70 },
66 }, {
32 .flags = 0, 67 .flags = 0,
33 } 68 }
34}; 69};
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index ff4f54a47c07..284f66f1ebbe 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -23,6 +23,8 @@
23#include <linux/kexec.h> 23#include <linux/kexec.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/smp.h> 25#include <linux/smp.h>
26#include <linux/err.h>
27#include <linux/debugfs.h>
26#include <asm/uaccess.h> 28#include <asm/uaccess.h>
27#include <asm/io.h> 29#include <asm/io.h>
28#include <asm/page.h> 30#include <asm/page.h>
@@ -333,6 +335,7 @@ static const char *cpu_name[] = {
333 [CPU_SH7343] = "SH7343", [CPU_SH7785] = "SH7785", 335 [CPU_SH7343] = "SH7343", [CPU_SH7785] = "SH7785",
334 [CPU_SH7722] = "SH7722", [CPU_SHX3] = "SH-X3", 336 [CPU_SH7722] = "SH7722", [CPU_SHX3] = "SH-X3",
335 [CPU_SH5_101] = "SH5-101", [CPU_SH5_103] = "SH5-103", 337 [CPU_SH5_101] = "SH5-101", [CPU_SH5_103] = "SH5-103",
338 [CPU_MXG] = "MX-G", [CPU_SH7723] = "SH7723",
336 [CPU_SH7366] = "SH7366", [CPU_SH_NONE] = "Unknown" 339 [CPU_SH7366] = "SH7366", [CPU_SH_NONE] = "Unknown"
337}; 340};
338 341
@@ -443,3 +446,15 @@ const struct seq_operations cpuinfo_op = {
443 .show = show_cpuinfo, 446 .show = show_cpuinfo,
444}; 447};
445#endif /* CONFIG_PROC_FS */ 448#endif /* CONFIG_PROC_FS */
449
450struct dentry *sh_debugfs_root;
451
452static int __init sh_debugfs_init(void)
453{
454 sh_debugfs_root = debugfs_create_dir("sh", NULL);
455 if (IS_ERR(sh_debugfs_root))
456 return PTR_ERR(sh_debugfs_root);
457
458 return 0;
459}
460arch_initcall(sh_debugfs_init);
diff --git a/arch/sh/lib/clear_page.S b/arch/sh/lib/clear_page.S
index 3539123fe517..8342bfbde64c 100644
--- a/arch/sh/lib/clear_page.S
+++ b/arch/sh/lib/clear_page.S
@@ -27,11 +27,11 @@ ENTRY(clear_page)
27 mov #0,r0 27 mov #0,r0
28 ! 28 !
291: 291:
30#if defined(CONFIG_CPU_SH3) 30#if defined(CONFIG_CPU_SH4)
31 mov.l r0,@r4
32#elif defined(CONFIG_CPU_SH4)
33 movca.l r0,@r4 31 movca.l r0,@r4
34 mov r4,r1 32 mov r4,r1
33#else
34 mov.l r0,@r4
35#endif 35#endif
36 add #32,r4 36 add #32,r4
37 mov.l r0,@-r4 37 mov.l r0,@-r4
diff --git a/arch/sh/lib/copy_page.S b/arch/sh/lib/copy_page.S
index e002b91c8752..5d12e657be34 100644
--- a/arch/sh/lib/copy_page.S
+++ b/arch/sh/lib/copy_page.S
@@ -41,11 +41,11 @@ ENTRY(copy_page)
41 mov.l @r11+,r5 41 mov.l @r11+,r5
42 mov.l @r11+,r6 42 mov.l @r11+,r6
43 mov.l @r11+,r7 43 mov.l @r11+,r7
44#if defined(CONFIG_CPU_SH3) 44#if defined(CONFIG_CPU_SH4)
45 mov.l r0,@r10
46#elif defined(CONFIG_CPU_SH4)
47 movca.l r0,@r10 45 movca.l r0,@r10
48 mov r10,r0 46 mov r10,r0
47#else
48 mov.l r0,@r10
49#endif 49#endif
50 add #32,r10 50 add #32,r10
51 mov.l r7,@-r10 51 mov.l r7,@-r10
diff --git a/arch/sh/mm/cache-debugfs.c b/arch/sh/mm/cache-debugfs.c
index db6d950b6f5e..c5b56d52b7d2 100644
--- a/arch/sh/mm/cache-debugfs.c
+++ b/arch/sh/mm/cache-debugfs.c
@@ -127,13 +127,13 @@ static int __init cache_debugfs_init(void)
127{ 127{
128 struct dentry *dcache_dentry, *icache_dentry; 128 struct dentry *dcache_dentry, *icache_dentry;
129 129
130 dcache_dentry = debugfs_create_file("dcache", S_IRUSR, NULL, 130 dcache_dentry = debugfs_create_file("dcache", S_IRUSR, sh_debugfs_root,
131 (unsigned int *)CACHE_TYPE_DCACHE, 131 (unsigned int *)CACHE_TYPE_DCACHE,
132 &cache_debugfs_fops); 132 &cache_debugfs_fops);
133 if (IS_ERR(dcache_dentry)) 133 if (IS_ERR(dcache_dentry))
134 return PTR_ERR(dcache_dentry); 134 return PTR_ERR(dcache_dentry);
135 135
136 icache_dentry = debugfs_create_file("icache", S_IRUSR, NULL, 136 icache_dentry = debugfs_create_file("icache", S_IRUSR, sh_debugfs_root,
137 (unsigned int *)CACHE_TYPE_ICACHE, 137 (unsigned int *)CACHE_TYPE_ICACHE,
138 &cache_debugfs_fops); 138 &cache_debugfs_fops);
139 if (IS_ERR(icache_dentry)) { 139 if (IS_ERR(icache_dentry)) {
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index ab81c602295f..0b0ec6e04753 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -393,7 +393,7 @@ static int __init pmb_debugfs_init(void)
393 struct dentry *dentry; 393 struct dentry *dentry;
394 394
395 dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO, 395 dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO,
396 NULL, NULL, &pmb_debugfs_fops); 396 sh_debugfs_root, NULL, &pmb_debugfs_fops);
397 if (IS_ERR(dentry)) 397 if (IS_ERR(dentry))
398 return PTR_ERR(dentry); 398 return PTR_ERR(dentry);
399 399
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types
index d63b93da952d..987c6682bf99 100644
--- a/arch/sh/tools/mach-types
+++ b/arch/sh/tools/mach-types
@@ -21,8 +21,9 @@ HD64465 HD64465
217206SE SH_7206_SOLUTION_ENGINE 217206SE SH_7206_SOLUTION_ENGINE
227343SE SH_7343_SOLUTION_ENGINE 227343SE SH_7343_SOLUTION_ENGINE
237619SE SH_7619_SOLUTION_ENGINE 237619SE SH_7619_SOLUTION_ENGINE
247722SE SH_7722_SOLUTION_ENGINE 247721SE SH_7721_SOLUTION_ENGINE
257751SE SH_7751_SOLUTION_ENGINE 257722SE SH_7722_SOLUTION_ENGINE
267751SE SH_7751_SOLUTION_ENGINE
267780SE SH_7780_SOLUTION_ENGINE 277780SE SH_7780_SOLUTION_ENGINE
277751SYSTEMH SH_7751_SYSTEMH 287751SYSTEMH SH_7751_SYSTEMH
28HP6XX SH_HP6XX 29HP6XX SH_HP6XX
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7f30b754bfc3..87a693cf2bb7 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -906,6 +906,15 @@ config X86_64_ACPI_NUMA
906 help 906 help
907 Enable ACPI SRAT based node topology detection. 907 Enable ACPI SRAT based node topology detection.
908 908
909# Some NUMA nodes have memory ranges that span
910# other nodes. Even though a pfn is valid and
911# between a node's start and end pfns, it may not
912# reside on that node. See memmap_init_zone()
913# for details.
914config NODES_SPAN_OTHER_NODES
915 def_bool y
916 depends on X86_64_ACPI_NUMA
917
909config NUMA_EMU 918config NUMA_EMU
910 bool "NUMA emulation" 919 bool "NUMA emulation"
911 depends on X86_64 && NUMA 920 depends on X86_64 && NUMA
diff --git a/arch/x86/boot/a20.c b/arch/x86/boot/a20.c
index 31348d054fca..90943f83e84d 100644
--- a/arch/x86/boot/a20.c
+++ b/arch/x86/boot/a20.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/a20.c
13 *
14 * Enable A20 gate (return -1 on failure) 12 * Enable A20 gate (return -1 on failure)
15 */ 13 */
16 14
diff --git a/arch/x86/boot/apm.c b/arch/x86/boot/apm.c
index c117c7fb859c..7aa6033001f9 100644
--- a/arch/x86/boot/apm.c
+++ b/arch/x86/boot/apm.c
@@ -12,8 +12,6 @@
12 * ----------------------------------------------------------------------- */ 12 * ----------------------------------------------------------------------- */
13 13
14/* 14/*
15 * arch/i386/boot/apm.c
16 *
17 * Get APM BIOS information 15 * Get APM BIOS information
18 */ 16 */
19 17
diff --git a/arch/x86/boot/bitops.h b/arch/x86/boot/bitops.h
index 8dcc8dc7db88..878e4b9940d9 100644
--- a/arch/x86/boot/bitops.h
+++ b/arch/x86/boot/bitops.h
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/bitops.h
13 *
14 * Very simple bitops for the boot code. 12 * Very simple bitops for the boot code.
15 */ 13 */
16 14
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 09578070bfba..a34b9982c7cb 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/boot.h
13 *
14 * Header file for the real-mode kernel code 12 * Header file for the real-mode kernel code
15 */ 13 */
16 14
diff --git a/arch/x86/boot/cmdline.c b/arch/x86/boot/cmdline.c
index 680408a0f463..a1d35634bce0 100644
--- a/arch/x86/boot/cmdline.c
+++ b/arch/x86/boot/cmdline.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/cmdline.c
13 *
14 * Simple command-line parser for early boot. 12 * Simple command-line parser for early boot.
15 */ 13 */
16 14
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 036e635f18a3..ba7736cf2ec7 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -130,7 +130,7 @@ relocated:
130/* 130/*
131 * Setup the stack for the decompressor 131 * Setup the stack for the decompressor
132 */ 132 */
133 leal stack_end(%ebx), %esp 133 leal boot_stack_end(%ebx), %esp
134 134
135/* 135/*
136 * Do the decompression, and jump to the new kernel.. 136 * Do the decompression, and jump to the new kernel..
@@ -142,8 +142,8 @@ relocated:
142 pushl %eax # input_len 142 pushl %eax # input_len
143 leal input_data(%ebx), %eax 143 leal input_data(%ebx), %eax
144 pushl %eax # input_data 144 pushl %eax # input_data
145 leal _end(%ebx), %eax 145 leal boot_heap(%ebx), %eax
146 pushl %eax # end of the image as third argument 146 pushl %eax # heap area as third argument
147 pushl %esi # real mode pointer as second arg 147 pushl %esi # real mode pointer as second arg
148 call decompress_kernel 148 call decompress_kernel
149 addl $20, %esp 149 addl $20, %esp
@@ -181,7 +181,10 @@ relocated:
181 jmp *%ebp 181 jmp *%ebp
182 182
183.bss 183.bss
184/* Stack and heap for uncompression */
184.balign 4 185.balign 4
185stack: 186boot_heap:
186 .fill 4096, 1, 0 187 .fill BOOT_HEAP_SIZE, 1, 0
187stack_end: 188boot_stack:
189 .fill BOOT_STACK_SIZE, 1, 0
190boot_stack_end:
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index e8657b98c902..d8819efac81d 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -28,6 +28,7 @@
28#include <asm/segment.h> 28#include <asm/segment.h>
29#include <asm/pgtable.h> 29#include <asm/pgtable.h>
30#include <asm/page.h> 30#include <asm/page.h>
31#include <asm/boot.h>
31#include <asm/msr.h> 32#include <asm/msr.h>
32#include <asm/asm-offsets.h> 33#include <asm/asm-offsets.h>
33 34
@@ -62,7 +63,7 @@ startup_32:
62 subl $1b, %ebp 63 subl $1b, %ebp
63 64
64/* setup a stack and make sure cpu supports long mode. */ 65/* setup a stack and make sure cpu supports long mode. */
65 movl $user_stack_end, %eax 66 movl $boot_stack_end, %eax
66 addl %ebp, %eax 67 addl %ebp, %eax
67 movl %eax, %esp 68 movl %eax, %esp
68 69
@@ -243,9 +244,9 @@ ENTRY(startup_64)
243/* Copy the compressed kernel to the end of our buffer 244/* Copy the compressed kernel to the end of our buffer
244 * where decompression in place becomes safe. 245 * where decompression in place becomes safe.
245 */ 246 */
246 leaq _end(%rip), %r8 247 leaq _end_before_pgt(%rip), %r8
247 leaq _end(%rbx), %r9 248 leaq _end_before_pgt(%rbx), %r9
248 movq $_end /* - $startup_32 */, %rcx 249 movq $_end_before_pgt /* - $startup_32 */, %rcx
2491: subq $8, %r8 2501: subq $8, %r8
250 subq $8, %r9 251 subq $8, %r9
251 movq 0(%r8), %rax 252 movq 0(%r8), %rax
@@ -267,14 +268,14 @@ relocated:
267 */ 268 */
268 xorq %rax, %rax 269 xorq %rax, %rax
269 leaq _edata(%rbx), %rdi 270 leaq _edata(%rbx), %rdi
270 leaq _end(%rbx), %rcx 271 leaq _end_before_pgt(%rbx), %rcx
271 subq %rdi, %rcx 272 subq %rdi, %rcx
272 cld 273 cld
273 rep 274 rep
274 stosb 275 stosb
275 276
276 /* Setup the stack */ 277 /* Setup the stack */
277 leaq user_stack_end(%rip), %rsp 278 leaq boot_stack_end(%rip), %rsp
278 279
279 /* zero EFLAGS after setting rsp */ 280 /* zero EFLAGS after setting rsp */
280 pushq $0 281 pushq $0
@@ -285,7 +286,7 @@ relocated:
285 */ 286 */
286 pushq %rsi # Save the real mode argument 287 pushq %rsi # Save the real mode argument
287 movq %rsi, %rdi # real mode address 288 movq %rsi, %rdi # real mode address
288 leaq _heap(%rip), %rsi # _heap 289 leaq boot_heap(%rip), %rsi # malloc area for uncompression
289 leaq input_data(%rip), %rdx # input_data 290 leaq input_data(%rip), %rdx # input_data
290 movl input_len(%rip), %eax 291 movl input_len(%rip), %eax
291 movq %rax, %rcx # input_len 292 movq %rax, %rcx # input_len
@@ -310,9 +311,12 @@ gdt:
310 .quad 0x0080890000000000 /* TS descriptor */ 311 .quad 0x0080890000000000 /* TS descriptor */
311 .quad 0x0000000000000000 /* TS continued */ 312 .quad 0x0000000000000000 /* TS continued */
312gdt_end: 313gdt_end:
313 .bss 314
314/* Stack for uncompression */ 315.bss
315 .balign 4 316/* Stack and heap for uncompression */
316user_stack: 317.balign 4
317 .fill 4096,4,0 318boot_heap:
318user_stack_end: 319 .fill BOOT_HEAP_SIZE, 1, 0
320boot_stack:
321 .fill BOOT_STACK_SIZE, 1, 0
322boot_stack_end:
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index dad4e699f5a3..90456cee47c3 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -217,12 +217,6 @@ static void putstr(const char *);
217static memptr free_mem_ptr; 217static memptr free_mem_ptr;
218static memptr free_mem_end_ptr; 218static memptr free_mem_end_ptr;
219 219
220#ifdef CONFIG_X86_64
221#define HEAP_SIZE 0x7000
222#else
223#define HEAP_SIZE 0x4000
224#endif
225
226static char *vidmem; 220static char *vidmem;
227static int vidport; 221static int vidport;
228static int lines, cols; 222static int lines, cols;
@@ -449,7 +443,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
449 443
450 window = output; /* Output buffer (Normally at 1M) */ 444 window = output; /* Output buffer (Normally at 1M) */
451 free_mem_ptr = heap; /* Heap */ 445 free_mem_ptr = heap; /* Heap */
452 free_mem_end_ptr = heap + HEAP_SIZE; 446 free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
453 inbuf = input_data; /* Input buffer */ 447 inbuf = input_data; /* Input buffer */
454 insize = input_len; 448 insize = input_len;
455 inptr = 0; 449 inptr = 0;
diff --git a/arch/x86/boot/compressed/vmlinux_64.lds b/arch/x86/boot/compressed/vmlinux_64.lds
index 7e5c7209f6cc..bef1ac891bce 100644
--- a/arch/x86/boot/compressed/vmlinux_64.lds
+++ b/arch/x86/boot/compressed/vmlinux_64.lds
@@ -39,10 +39,10 @@ SECTIONS
39 *(.bss.*) 39 *(.bss.*)
40 *(COMMON) 40 *(COMMON)
41 . = ALIGN(8); 41 . = ALIGN(8);
42 _end = . ; 42 _end_before_pgt = . ;
43 . = ALIGN(4096); 43 . = ALIGN(4096);
44 pgtable = . ; 44 pgtable = . ;
45 . = . + 4096 * 6; 45 . = . + 4096 * 6;
46 _heap = .; 46 _ebss = .;
47 } 47 }
48} 48}
diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S
index ef127e56a3cf..ef50c84e8b4b 100644
--- a/arch/x86/boot/copy.S
+++ b/arch/x86/boot/copy.S
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/copy.S
13 *
14 * Memory copy routines 12 * Memory copy routines
15 */ 13 */
16 14
diff --git a/arch/x86/boot/cpucheck.c b/arch/x86/boot/cpucheck.c
index 2462c88689ed..7804389ee005 100644
--- a/arch/x86/boot/cpucheck.c
+++ b/arch/x86/boot/cpucheck.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/cpucheck.c
13 *
14 * Check for obligatory CPU features and abort if the features are not 12 * Check for obligatory CPU features and abort if the features are not
15 * present. This code should be compilable as 16-, 32- or 64-bit 13 * present. This code should be compilable as 16-, 32- or 64-bit
16 * code, so be very careful with types and inline assembly. 14 * code, so be very careful with types and inline assembly.
diff --git a/arch/x86/boot/edd.c b/arch/x86/boot/edd.c
index 8721dc46a0b6..d84a48ece785 100644
--- a/arch/x86/boot/edd.c
+++ b/arch/x86/boot/edd.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/edd.c
13 *
14 * Get EDD BIOS disk information 12 * Get EDD BIOS disk information
15 */ 13 */
16 14
diff --git a/arch/x86/boot/install.sh b/arch/x86/boot/install.sh
index 88d77761d01b..8d60ee15dfd9 100644
--- a/arch/x86/boot/install.sh
+++ b/arch/x86/boot/install.sh
@@ -1,7 +1,5 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# arch/i386/boot/install.sh
4#
5# 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
6# 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
7# for more details. 5# for more details.
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c
index 7828da5cfd07..77569a4a3be1 100644
--- a/arch/x86/boot/main.c
+++ b/arch/x86/boot/main.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/main.c
13 *
14 * Main module for the real-mode kernel code 12 * Main module for the real-mode kernel code
15 */ 13 */
16 14
diff --git a/arch/x86/boot/mca.c b/arch/x86/boot/mca.c
index 68222f2d4b67..911eaae5d696 100644
--- a/arch/x86/boot/mca.c
+++ b/arch/x86/boot/mca.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/mca.c
13 *
14 * Get the MCA system description table 12 * Get the MCA system description table
15 */ 13 */
16 14
diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
index e77d89f9e8aa..acad32eb4290 100644
--- a/arch/x86/boot/memory.c
+++ b/arch/x86/boot/memory.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/memory.c
13 *
14 * Memory detection code 12 * Memory detection code
15 */ 13 */
16 14
diff --git a/arch/x86/boot/pm.c b/arch/x86/boot/pm.c
index a93cb8bded4d..328956fdb59e 100644
--- a/arch/x86/boot/pm.c
+++ b/arch/x86/boot/pm.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/pm.c
13 *
14 * Prepare the machine for transition to protected mode. 12 * Prepare the machine for transition to protected mode.
15 */ 13 */
16 14
diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S
index f5402d51f7c3..ab049d40a884 100644
--- a/arch/x86/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/pmjump.S
13 *
14 * The actual transition into protected mode 12 * The actual transition into protected mode
15 */ 13 */
16 14
diff --git a/arch/x86/boot/printf.c b/arch/x86/boot/printf.c
index 7e7e890699be..c1d00c0274c4 100644
--- a/arch/x86/boot/printf.c
+++ b/arch/x86/boot/printf.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/printf.c
13 *
14 * Oh, it's a waste of space, but oh-so-yummy for debugging. This 12 * Oh, it's a waste of space, but oh-so-yummy for debugging. This
15 * version of printf() does not include 64-bit support. "Live with 13 * version of printf() does not include 64-bit support. "Live with
16 * it." 14 * it."
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 481a22097781..f94b7a0c2abf 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/string.c
13 *
14 * Very basic string functions 12 * Very basic string functions
15 */ 13 */
16 14
diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c
index f3f14bd26371..0be77b39328a 100644
--- a/arch/x86/boot/tty.c
+++ b/arch/x86/boot/tty.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/tty.c
13 *
14 * Very simple screen I/O 12 * Very simple screen I/O
15 * XXX: Probably should add very simple serial I/O? 13 * XXX: Probably should add very simple serial I/O?
16 */ 14 */
diff --git a/arch/x86/boot/version.c b/arch/x86/boot/version.c
index c61462f7d9a7..2723d9b5ce43 100644
--- a/arch/x86/boot/version.c
+++ b/arch/x86/boot/version.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/version.c
13 *
14 * Kernel version string 12 * Kernel version string
15 */ 13 */
16 14
diff --git a/arch/x86/boot/video-bios.c b/arch/x86/boot/video-bios.c
index 39e247e96172..49f26aaaebc8 100644
--- a/arch/x86/boot/video-bios.c
+++ b/arch/x86/boot/video-bios.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/video-bios.c
13 *
14 * Standard video BIOS modes 12 * Standard video BIOS modes
15 * 13 *
16 * We have two options for this; silent and scanned. 14 * We have two options for this; silent and scanned.
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index 5d5a3f6e8b5c..401ad998ad08 100644
--- a/arch/x86/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/video-vesa.c
13 *
14 * VESA text modes 12 * VESA text modes
15 */ 13 */
16 14
diff --git a/arch/x86/boot/video-vga.c b/arch/x86/boot/video-vga.c
index 330d6589a2ad..40ecb8d7688c 100644
--- a/arch/x86/boot/video-vga.c
+++ b/arch/x86/boot/video-vga.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/video-vga.c
13 *
14 * Common all-VGA modes 12 * Common all-VGA modes
15 */ 13 */
16 14
diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c
index c1c47ba069ef..83598b23093a 100644
--- a/arch/x86/boot/video.c
+++ b/arch/x86/boot/video.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/video.c
13 *
14 * Select video mode 12 * Select video mode
15 */ 13 */
16 14
diff --git a/arch/x86/boot/video.h b/arch/x86/boot/video.h
index d69347f79e8e..ee63f5d14461 100644
--- a/arch/x86/boot/video.h
+++ b/arch/x86/boot/video.h
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/video.h
13 *
14 * Header file for the real-mode video probing code 12 * Header file for the real-mode video probing code
15 */ 13 */
16 14
diff --git a/arch/x86/boot/voyager.c b/arch/x86/boot/voyager.c
index 6499e3239b41..433909d61e5c 100644
--- a/arch/x86/boot/voyager.c
+++ b/arch/x86/boot/voyager.c
@@ -9,8 +9,6 @@
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11/* 11/*
12 * arch/i386/boot/voyager.c
13 *
14 * Get the Voyager config information 12 * Get the Voyager config information
15 */ 13 */
16 14
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index c3920ea8ac56..90e092d0af0c 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -22,13 +22,14 @@ obj-y += setup_$(BITS).o i8259_$(BITS).o setup.o
22obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o 22obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o
23obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o 23obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o
24obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o setup64.o 24obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o setup64.o
25obj-y += pci-dma_$(BITS).o bootflag.o e820_$(BITS).o 25obj-y += bootflag.o e820_$(BITS).o
26obj-y += quirks.o i8237.o topology.o kdebugfs.o 26obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
27obj-y += alternative.o i8253.o 27obj-y += alternative.o i8253.o pci-nommu.o
28obj-$(CONFIG_X86_64) += pci-nommu_64.o bugs_64.o 28obj-$(CONFIG_X86_64) += bugs_64.o
29obj-y += tsc_$(BITS).o io_delay.o rtc.o 29obj-y += tsc_$(BITS).o io_delay.o rtc.o
30 30
31obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o 31obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
32obj-y += process.o
32obj-y += i387.o 33obj-y += i387.o
33obj-y += ptrace.o 34obj-y += ptrace.o
34obj-y += ds.o 35obj-y += ds.o
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index c6dc05af8827..c2502eb9aa83 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/i386/kernel/acpi/cstate.c
3 *
4 * Copyright (C) 2005 Intel Corporation 2 * Copyright (C) 2005 Intel Corporation
5 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> 3 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
6 * - Added _PDC for SMP C-states on Intel CPUs 4 * - Added _PDC for SMP C-states on Intel CPUs
diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
index 324eb0cab19c..de2d2e4ebad9 100644
--- a/arch/x86/kernel/acpi/processor.c
+++ b/arch/x86/kernel/acpi/processor.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/i386/kernel/acpi/processor.c
3 *
4 * Copyright (C) 2005 Intel Corporation 2 * Copyright (C) 2005 Intel Corporation
5 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> 3 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
6 * - Added _PDC for platforms with Intel CPUs 4 * - Added _PDC for platforms with Intel CPUs
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index 14791ec55cfd..199e4e05e5dc 100644
--- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
@@ -289,8 +289,8 @@ static int __init cpufreq_p4_init(void)
289 if (c->x86_vendor != X86_VENDOR_INTEL) 289 if (c->x86_vendor != X86_VENDOR_INTEL)
290 return -ENODEV; 290 return -ENODEV;
291 291
292 if (!test_bit(X86_FEATURE_ACPI, c->x86_capability) || 292 if (!test_cpu_cap(c, X86_FEATURE_ACPI) ||
293 !test_bit(X86_FEATURE_ACC, c->x86_capability)) 293 !test_cpu_cap(c, X86_FEATURE_ACC))
294 return -ENODEV; 294 return -ENODEV;
295 295
296 ret = cpufreq_register_driver(&p4clockmod_driver); 296 ret = cpufreq_register_driver(&p4clockmod_driver);
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 9b7e01daa1ca..1f4cc48c14c6 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * linux/arch/i386/kernel/cpu/mcheck/therm_throt.c
3 * 2 *
4 * Thermal throttle event support code (such as syslog messaging and rate 3 * Thermal throttle event support code (such as syslog messaging and rate
5 * limiting) that was factored out from x86_64 (mce_intel.c) and i386 (p4.c). 4 * limiting) that was factored out from x86_64 (mce_intel.c) and i386 (p4.c).
diff --git a/arch/x86/kernel/e820_32.c b/arch/x86/kernel/e820_32.c
index 0240cd778365..ed733e7cf4e6 100644
--- a/arch/x86/kernel/e820_32.c
+++ b/arch/x86/kernel/e820_32.c
@@ -475,7 +475,7 @@ int __init copy_e820_map(struct e820entry *biosmap, int nr_map)
475/* 475/*
476 * Find the highest page frame number we have available 476 * Find the highest page frame number we have available
477 */ 477 */
478void __init find_max_pfn(void) 478void __init propagate_e820_map(void)
479{ 479{
480 int i; 480 int i;
481 481
@@ -704,7 +704,7 @@ static int __init parse_memmap(char *arg)
704 * size before original memory map is 704 * size before original memory map is
705 * reset. 705 * reset.
706 */ 706 */
707 find_max_pfn(); 707 propagate_e820_map();
708 saved_max_pfn = max_pfn; 708 saved_max_pfn = max_pfn;
709#endif 709#endif
710 e820.nr_map = 0; 710 e820.nr_map = 0;
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
index 7f6c0c85c8f6..cbd42e51cb08 100644
--- a/arch/x86/kernel/e820_64.c
+++ b/arch/x86/kernel/e820_64.c
@@ -96,7 +96,7 @@ void __init early_res_to_bootmem(void)
96} 96}
97 97
98/* Check for already reserved areas */ 98/* Check for already reserved areas */
99static inline int 99static inline int __init
100bad_addr(unsigned long *addrp, unsigned long size, unsigned long align) 100bad_addr(unsigned long *addrp, unsigned long size, unsigned long align)
101{ 101{
102 int i; 102 int i;
@@ -116,7 +116,7 @@ again:
116} 116}
117 117
118/* Check for already reserved areas */ 118/* Check for already reserved areas */
119static inline int 119static inline int __init
120bad_addr_size(unsigned long *addrp, unsigned long *sizep, unsigned long align) 120bad_addr_size(unsigned long *addrp, unsigned long *sizep, unsigned long align)
121{ 121{
122 int i; 122 int i;
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index 759e02bec070..77d424cf68b3 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -383,6 +383,7 @@ static void __init runtime_code_page_mkexec(void)
383{ 383{
384 efi_memory_desc_t *md; 384 efi_memory_desc_t *md;
385 void *p; 385 void *p;
386 u64 addr, npages;
386 387
387 /* Make EFI runtime service code area executable */ 388 /* Make EFI runtime service code area executable */
388 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { 389 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
@@ -391,7 +392,10 @@ static void __init runtime_code_page_mkexec(void)
391 if (md->type != EFI_RUNTIME_SERVICES_CODE) 392 if (md->type != EFI_RUNTIME_SERVICES_CODE)
392 continue; 393 continue;
393 394
394 set_memory_x(md->virt_addr, md->num_pages); 395 addr = md->virt_addr;
396 npages = md->num_pages;
397 memrange_efi_to_native(&addr, &npages);
398 set_memory_x(addr, npages);
395 } 399 }
396} 400}
397 401
@@ -408,7 +412,7 @@ void __init efi_enter_virtual_mode(void)
408 efi_memory_desc_t *md; 412 efi_memory_desc_t *md;
409 efi_status_t status; 413 efi_status_t status;
410 unsigned long size; 414 unsigned long size;
411 u64 end, systab; 415 u64 end, systab, addr, npages;
412 void *p, *va; 416 void *p, *va;
413 417
414 efi.systab = NULL; 418 efi.systab = NULL;
@@ -420,7 +424,7 @@ void __init efi_enter_virtual_mode(void)
420 size = md->num_pages << EFI_PAGE_SHIFT; 424 size = md->num_pages << EFI_PAGE_SHIFT;
421 end = md->phys_addr + size; 425 end = md->phys_addr + size;
422 426
423 if ((end >> PAGE_SHIFT) <= max_pfn_mapped) 427 if (PFN_UP(end) <= max_pfn_mapped)
424 va = __va(md->phys_addr); 428 va = __va(md->phys_addr);
425 else 429 else
426 va = efi_ioremap(md->phys_addr, size); 430 va = efi_ioremap(md->phys_addr, size);
@@ -433,8 +437,12 @@ void __init efi_enter_virtual_mode(void)
433 continue; 437 continue;
434 } 438 }
435 439
436 if (!(md->attribute & EFI_MEMORY_WB)) 440 if (!(md->attribute & EFI_MEMORY_WB)) {
437 set_memory_uc(md->virt_addr, md->num_pages); 441 addr = md->virt_addr;
442 npages = md->num_pages;
443 memrange_efi_to_native(&addr, &npages);
444 set_memory_uc(addr, npages);
445 }
438 446
439 systab = (u64) (unsigned long) efi_phys.systab; 447 systab = (u64) (unsigned long) efi_phys.systab;
440 if (md->phys_addr <= systab && systab < end) { 448 if (md->phys_addr <= systab && systab < end) {
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c
index d143a1e76b30..d0060fdcccac 100644
--- a/arch/x86/kernel/efi_64.c
+++ b/arch/x86/kernel/efi_64.c
@@ -105,14 +105,14 @@ void __init efi_reserve_bootmem(void)
105 105
106void __iomem * __init efi_ioremap(unsigned long phys_addr, unsigned long size) 106void __iomem * __init efi_ioremap(unsigned long phys_addr, unsigned long size)
107{ 107{
108 static unsigned pages_mapped; 108 static unsigned pages_mapped __initdata;
109 unsigned i, pages; 109 unsigned i, pages;
110 unsigned long offset;
110 111
111 /* phys_addr and size must be page aligned */ 112 pages = PFN_UP(phys_addr + size) - PFN_DOWN(phys_addr);
112 if ((phys_addr & ~PAGE_MASK) || (size & ~PAGE_MASK)) 113 offset = phys_addr & ~PAGE_MASK;
113 return NULL; 114 phys_addr &= PAGE_MASK;
114 115
115 pages = size >> PAGE_SHIFT;
116 if (pages_mapped + pages > MAX_EFI_IO_PAGES) 116 if (pages_mapped + pages > MAX_EFI_IO_PAGES)
117 return NULL; 117 return NULL;
118 118
@@ -124,5 +124,5 @@ void __iomem * __init efi_ioremap(unsigned long phys_addr, unsigned long size)
124 } 124 }
125 125
126 return (void __iomem *)__fix_to_virt(FIX_EFI_IO_MAP_FIRST_PAGE - \ 126 return (void __iomem *)__fix_to_virt(FIX_EFI_IO_MAP_FIRST_PAGE - \
127 (pages_mapped - pages)); 127 (pages_mapped - pages)) + offset;
128} 128}
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 9ba49a26dff8..f0f8934fc303 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -1,5 +1,4 @@
1/* 1/*
2 * linux/arch/i386/entry.S
3 * 2 *
4 * Copyright (C) 1991, 1992 Linus Torvalds 3 * Copyright (C) 1991, 1992 Linus Torvalds
5 */ 4 */
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 5d77c9cd8e15..ebf13908a743 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -61,26 +61,31 @@ int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip)
61 val = (1UL << UVH_IPI_INT_SEND_SHFT) | 61 val = (1UL << UVH_IPI_INT_SEND_SHFT) |
62 (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | 62 (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) |
63 (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | 63 (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) |
64 (6 << UVH_IPI_INT_DELIVERY_MODE_SHFT); 64 APIC_DM_INIT;
65 uv_write_global_mmr64(nasid, UVH_IPI_INT, val);
66 mdelay(10);
67
68 val = (1UL << UVH_IPI_INT_SEND_SHFT) |
69 (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) |
70 (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) |
71 APIC_DM_STARTUP;
65 uv_write_global_mmr64(nasid, UVH_IPI_INT, val); 72 uv_write_global_mmr64(nasid, UVH_IPI_INT, val);
66 return 0; 73 return 0;
67} 74}
68 75
69static void uv_send_IPI_one(int cpu, int vector) 76static void uv_send_IPI_one(int cpu, int vector)
70{ 77{
71 unsigned long val, apicid; 78 unsigned long val, apicid, lapicid;
72 int nasid; 79 int nasid;
73 80
74 apicid = per_cpu(x86_cpu_to_apicid, cpu); /* ZZZ - cache node-local ? */ 81 apicid = per_cpu(x86_cpu_to_apicid, cpu); /* ZZZ - cache node-local ? */
82 lapicid = apicid & 0x3f; /* ZZZ macro needed */
75 nasid = uv_apicid_to_nasid(apicid); 83 nasid = uv_apicid_to_nasid(apicid);
76 val = 84 val =
77 (1UL << UVH_IPI_INT_SEND_SHFT) | (apicid << 85 (1UL << UVH_IPI_INT_SEND_SHFT) | (lapicid <<
78 UVH_IPI_INT_APIC_ID_SHFT) | 86 UVH_IPI_INT_APIC_ID_SHFT) |
79 (vector << UVH_IPI_INT_VECTOR_SHFT); 87 (vector << UVH_IPI_INT_VECTOR_SHFT);
80 uv_write_global_mmr64(nasid, UVH_IPI_INT, val); 88 uv_write_global_mmr64(nasid, UVH_IPI_INT, val);
81 printk(KERN_DEBUG
82 "UV: IPI to cpu %d, apicid 0x%lx, vec %d, nasid%d, val 0x%lx\n",
83 cpu, apicid, vector, nasid, val);
84} 89}
85 90
86static void uv_send_IPI_mask(cpumask_t mask, int vector) 91static void uv_send_IPI_mask(cpumask_t mask, int vector)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index d6d54faa84df..993c76773256 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -146,6 +146,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
146 146
147 reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS"); 147 reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");
148 148
149#ifdef CONFIG_BLK_DEV_INITRD
149 /* Reserve INITRD */ 150 /* Reserve INITRD */
150 if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) { 151 if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
151 unsigned long ramdisk_image = boot_params.hdr.ramdisk_image; 152 unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
@@ -153,6 +154,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
153 unsigned long ramdisk_end = ramdisk_image + ramdisk_size; 154 unsigned long ramdisk_end = ramdisk_image + ramdisk_size;
154 reserve_early(ramdisk_image, ramdisk_end, "RAMDISK"); 155 reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
155 } 156 }
157#endif
156 158
157 reserve_ebda_region(); 159 reserve_ebda_region();
158 160
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 826988a6e964..90f038af3adc 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -1,5 +1,4 @@
1/* 1/*
2 * linux/arch/i386/kernel/head.S -- the 32-bit startup code.
3 * 2 *
4 * Copyright (C) 1991, 1992 Linus Torvalds 3 * Copyright (C) 1991, 1992 Linus Torvalds
5 * 4 *
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 8f8102d967b3..db6839b53195 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -35,17 +35,18 @@
35#endif 35#endif
36 36
37static unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu; 37static unsigned int mxcsr_feature_mask __read_mostly = 0xffffffffu;
38unsigned int xstate_size;
39static struct i387_fxsave_struct fx_scratch __cpuinitdata;
38 40
39void mxcsr_feature_mask_init(void) 41void __cpuinit mxcsr_feature_mask_init(void)
40{ 42{
41 unsigned long mask = 0; 43 unsigned long mask = 0;
42 44
43 clts(); 45 clts();
44 if (cpu_has_fxsr) { 46 if (cpu_has_fxsr) {
45 memset(&current->thread.i387.fxsave, 0, 47 memset(&fx_scratch, 0, sizeof(struct i387_fxsave_struct));
46 sizeof(struct i387_fxsave_struct)); 48 asm volatile("fxsave %0" : : "m" (fx_scratch));
47 asm volatile("fxsave %0" : : "m" (current->thread.i387.fxsave)); 49 mask = fx_scratch.mxcsr_mask;
48 mask = current->thread.i387.fxsave.mxcsr_mask;
49 if (mask == 0) 50 if (mask == 0)
50 mask = 0x0000ffbf; 51 mask = 0x0000ffbf;
51 } 52 }
@@ -53,6 +54,16 @@ void mxcsr_feature_mask_init(void)
53 stts(); 54 stts();
54} 55}
55 56
57void __init init_thread_xstate(void)
58{
59 if (cpu_has_fxsr)
60 xstate_size = sizeof(struct i387_fxsave_struct);
61#ifdef CONFIG_X86_32
62 else
63 xstate_size = sizeof(struct i387_fsave_struct);
64#endif
65}
66
56#ifdef CONFIG_X86_64 67#ifdef CONFIG_X86_64
57/* 68/*
58 * Called at bootup to set up the initial FPU state that is later cloned 69 * Called at bootup to set up the initial FPU state that is later cloned
@@ -61,10 +72,6 @@ void mxcsr_feature_mask_init(void)
61void __cpuinit fpu_init(void) 72void __cpuinit fpu_init(void)
62{ 73{
63 unsigned long oldcr0 = read_cr0(); 74 unsigned long oldcr0 = read_cr0();
64 extern void __bad_fxsave_alignment(void);
65
66 if (offsetof(struct task_struct, thread.i387.fxsave) & 15)
67 __bad_fxsave_alignment();
68 75
69 set_in_cr4(X86_CR4_OSFXSR); 76 set_in_cr4(X86_CR4_OSFXSR);
70 set_in_cr4(X86_CR4_OSXMMEXCPT); 77 set_in_cr4(X86_CR4_OSXMMEXCPT);
@@ -84,32 +91,44 @@ void __cpuinit fpu_init(void)
84 * value at reset if we support XMM instructions and then 91 * value at reset if we support XMM instructions and then
85 * remeber the current task has used the FPU. 92 * remeber the current task has used the FPU.
86 */ 93 */
87void init_fpu(struct task_struct *tsk) 94int init_fpu(struct task_struct *tsk)
88{ 95{
89 if (tsk_used_math(tsk)) { 96 if (tsk_used_math(tsk)) {
90 if (tsk == current) 97 if (tsk == current)
91 unlazy_fpu(tsk); 98 unlazy_fpu(tsk);
92 return; 99 return 0;
100 }
101
102 /*
103 * Memory allocation at the first usage of the FPU and other state.
104 */
105 if (!tsk->thread.xstate) {
106 tsk->thread.xstate = kmem_cache_alloc(task_xstate_cachep,
107 GFP_KERNEL);
108 if (!tsk->thread.xstate)
109 return -ENOMEM;
93 } 110 }
94 111
95 if (cpu_has_fxsr) { 112 if (cpu_has_fxsr) {
96 memset(&tsk->thread.i387.fxsave, 0, 113 struct i387_fxsave_struct *fx = &tsk->thread.xstate->fxsave;
97 sizeof(struct i387_fxsave_struct)); 114
98 tsk->thread.i387.fxsave.cwd = 0x37f; 115 memset(fx, 0, xstate_size);
116 fx->cwd = 0x37f;
99 if (cpu_has_xmm) 117 if (cpu_has_xmm)
100 tsk->thread.i387.fxsave.mxcsr = MXCSR_DEFAULT; 118 fx->mxcsr = MXCSR_DEFAULT;
101 } else { 119 } else {
102 memset(&tsk->thread.i387.fsave, 0, 120 struct i387_fsave_struct *fp = &tsk->thread.xstate->fsave;
103 sizeof(struct i387_fsave_struct)); 121 memset(fp, 0, xstate_size);
104 tsk->thread.i387.fsave.cwd = 0xffff037fu; 122 fp->cwd = 0xffff037fu;
105 tsk->thread.i387.fsave.swd = 0xffff0000u; 123 fp->swd = 0xffff0000u;
106 tsk->thread.i387.fsave.twd = 0xffffffffu; 124 fp->twd = 0xffffffffu;
107 tsk->thread.i387.fsave.fos = 0xffff0000u; 125 fp->fos = 0xffff0000u;
108 } 126 }
109 /* 127 /*
110 * Only the device not available exception or ptrace can call init_fpu. 128 * Only the device not available exception or ptrace can call init_fpu.
111 */ 129 */
112 set_stopped_child_used_math(tsk); 130 set_stopped_child_used_math(tsk);
131 return 0;
113} 132}
114 133
115int fpregs_active(struct task_struct *target, const struct user_regset *regset) 134int fpregs_active(struct task_struct *target, const struct user_regset *regset)
@@ -126,13 +145,17 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
126 unsigned int pos, unsigned int count, 145 unsigned int pos, unsigned int count,
127 void *kbuf, void __user *ubuf) 146 void *kbuf, void __user *ubuf)
128{ 147{
148 int ret;
149
129 if (!cpu_has_fxsr) 150 if (!cpu_has_fxsr)
130 return -ENODEV; 151 return -ENODEV;
131 152
132 init_fpu(target); 153 ret = init_fpu(target);
154 if (ret)
155 return ret;
133 156
134 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 157 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
135 &target->thread.i387.fxsave, 0, -1); 158 &target->thread.xstate->fxsave, 0, -1);
136} 159}
137 160
138int xfpregs_set(struct task_struct *target, const struct user_regset *regset, 161int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
@@ -144,16 +167,19 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
144 if (!cpu_has_fxsr) 167 if (!cpu_has_fxsr)
145 return -ENODEV; 168 return -ENODEV;
146 169
147 init_fpu(target); 170 ret = init_fpu(target);
171 if (ret)
172 return ret;
173
148 set_stopped_child_used_math(target); 174 set_stopped_child_used_math(target);
149 175
150 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, 176 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
151 &target->thread.i387.fxsave, 0, -1); 177 &target->thread.xstate->fxsave, 0, -1);
152 178
153 /* 179 /*
154 * mxcsr reserved bits must be masked to zero for security reasons. 180 * mxcsr reserved bits must be masked to zero for security reasons.
155 */ 181 */
156 target->thread.i387.fxsave.mxcsr &= mxcsr_feature_mask; 182 target->thread.xstate->fxsave.mxcsr &= mxcsr_feature_mask;
157 183
158 return ret; 184 return ret;
159} 185}
@@ -233,7 +259,7 @@ static inline u32 twd_fxsr_to_i387(struct i387_fxsave_struct *fxsave)
233static void 259static void
234convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk) 260convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
235{ 261{
236 struct i387_fxsave_struct *fxsave = &tsk->thread.i387.fxsave; 262 struct i387_fxsave_struct *fxsave = &tsk->thread.xstate->fxsave;
237 struct _fpreg *to = (struct _fpreg *) &env->st_space[0]; 263 struct _fpreg *to = (struct _fpreg *) &env->st_space[0];
238 struct _fpxreg *from = (struct _fpxreg *) &fxsave->st_space[0]; 264 struct _fpxreg *from = (struct _fpxreg *) &fxsave->st_space[0];
239 int i; 265 int i;
@@ -273,7 +299,7 @@ static void convert_to_fxsr(struct task_struct *tsk,
273 const struct user_i387_ia32_struct *env) 299 const struct user_i387_ia32_struct *env)
274 300
275{ 301{
276 struct i387_fxsave_struct *fxsave = &tsk->thread.i387.fxsave; 302 struct i387_fxsave_struct *fxsave = &tsk->thread.xstate->fxsave;
277 struct _fpreg *from = (struct _fpreg *) &env->st_space[0]; 303 struct _fpreg *from = (struct _fpreg *) &env->st_space[0];
278 struct _fpxreg *to = (struct _fpxreg *) &fxsave->st_space[0]; 304 struct _fpxreg *to = (struct _fpxreg *) &fxsave->st_space[0];
279 int i; 305 int i;
@@ -302,15 +328,19 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
302 void *kbuf, void __user *ubuf) 328 void *kbuf, void __user *ubuf)
303{ 329{
304 struct user_i387_ia32_struct env; 330 struct user_i387_ia32_struct env;
331 int ret;
305 332
306 if (!HAVE_HWFP) 333 if (!HAVE_HWFP)
307 return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf); 334 return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
308 335
309 init_fpu(target); 336 ret = init_fpu(target);
337 if (ret)
338 return ret;
310 339
311 if (!cpu_has_fxsr) { 340 if (!cpu_has_fxsr) {
312 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 341 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
313 &target->thread.i387.fsave, 0, -1); 342 &target->thread.xstate->fsave, 0,
343 -1);
314 } 344 }
315 345
316 if (kbuf && pos == 0 && count == sizeof(env)) { 346 if (kbuf && pos == 0 && count == sizeof(env)) {
@@ -333,12 +363,15 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
333 if (!HAVE_HWFP) 363 if (!HAVE_HWFP)
334 return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf); 364 return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
335 365
336 init_fpu(target); 366 ret = init_fpu(target);
367 if (ret)
368 return ret;
369
337 set_stopped_child_used_math(target); 370 set_stopped_child_used_math(target);
338 371
339 if (!cpu_has_fxsr) { 372 if (!cpu_has_fxsr) {
340 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 373 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
341 &target->thread.i387.fsave, 0, -1); 374 &target->thread.xstate->fsave, 0, -1);
342 } 375 }
343 376
344 if (pos > 0 || count < sizeof(env)) 377 if (pos > 0 || count < sizeof(env))
@@ -358,11 +391,11 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
358static inline int save_i387_fsave(struct _fpstate_ia32 __user *buf) 391static inline int save_i387_fsave(struct _fpstate_ia32 __user *buf)
359{ 392{
360 struct task_struct *tsk = current; 393 struct task_struct *tsk = current;
394 struct i387_fsave_struct *fp = &tsk->thread.xstate->fsave;
361 395
362 unlazy_fpu(tsk); 396 unlazy_fpu(tsk);
363 tsk->thread.i387.fsave.status = tsk->thread.i387.fsave.swd; 397 fp->status = fp->swd;
364 if (__copy_to_user(buf, &tsk->thread.i387.fsave, 398 if (__copy_to_user(buf, fp, sizeof(struct i387_fsave_struct)))
365 sizeof(struct i387_fsave_struct)))
366 return -1; 399 return -1;
367 return 1; 400 return 1;
368} 401}
@@ -370,6 +403,7 @@ static inline int save_i387_fsave(struct _fpstate_ia32 __user *buf)
370static int save_i387_fxsave(struct _fpstate_ia32 __user *buf) 403static int save_i387_fxsave(struct _fpstate_ia32 __user *buf)
371{ 404{
372 struct task_struct *tsk = current; 405 struct task_struct *tsk = current;
406 struct i387_fxsave_struct *fx = &tsk->thread.xstate->fxsave;
373 struct user_i387_ia32_struct env; 407 struct user_i387_ia32_struct env;
374 int err = 0; 408 int err = 0;
375 409
@@ -379,12 +413,12 @@ static int save_i387_fxsave(struct _fpstate_ia32 __user *buf)
379 if (__copy_to_user(buf, &env, sizeof(env))) 413 if (__copy_to_user(buf, &env, sizeof(env)))
380 return -1; 414 return -1;
381 415
382 err |= __put_user(tsk->thread.i387.fxsave.swd, &buf->status); 416 err |= __put_user(fx->swd, &buf->status);
383 err |= __put_user(X86_FXSR_MAGIC, &buf->magic); 417 err |= __put_user(X86_FXSR_MAGIC, &buf->magic);
384 if (err) 418 if (err)
385 return -1; 419 return -1;
386 420
387 if (__copy_to_user(&buf->_fxsr_env[0], &tsk->thread.i387.fxsave, 421 if (__copy_to_user(&buf->_fxsr_env[0], fx,
388 sizeof(struct i387_fxsave_struct))) 422 sizeof(struct i387_fxsave_struct)))
389 return -1; 423 return -1;
390 return 1; 424 return 1;
@@ -417,7 +451,7 @@ static inline int restore_i387_fsave(struct _fpstate_ia32 __user *buf)
417 struct task_struct *tsk = current; 451 struct task_struct *tsk = current;
418 452
419 clear_fpu(tsk); 453 clear_fpu(tsk);
420 return __copy_from_user(&tsk->thread.i387.fsave, buf, 454 return __copy_from_user(&tsk->thread.xstate->fsave, buf,
421 sizeof(struct i387_fsave_struct)); 455 sizeof(struct i387_fsave_struct));
422} 456}
423 457
@@ -428,10 +462,10 @@ static int restore_i387_fxsave(struct _fpstate_ia32 __user *buf)
428 int err; 462 int err;
429 463
430 clear_fpu(tsk); 464 clear_fpu(tsk);
431 err = __copy_from_user(&tsk->thread.i387.fxsave, &buf->_fxsr_env[0], 465 err = __copy_from_user(&tsk->thread.xstate->fxsave, &buf->_fxsr_env[0],
432 sizeof(struct i387_fxsave_struct)); 466 sizeof(struct i387_fxsave_struct));
433 /* mxcsr reserved bits must be masked to zero for security reasons */ 467 /* mxcsr reserved bits must be masked to zero for security reasons */
434 tsk->thread.i387.fxsave.mxcsr &= mxcsr_feature_mask; 468 tsk->thread.xstate->fxsave.mxcsr &= mxcsr_feature_mask;
435 if (err || __copy_from_user(&env, buf, sizeof(env))) 469 if (err || __copy_from_user(&env, buf, sizeof(env)))
436 return 1; 470 return 1;
437 convert_to_fxsr(tsk, &env); 471 convert_to_fxsr(tsk, &env);
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 24362ecf5f9a..f47f0eb886b8 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -46,11 +46,7 @@
46#include <asm/apicdef.h> 46#include <asm/apicdef.h>
47#include <asm/system.h> 47#include <asm/system.h>
48 48
49#ifdef CONFIG_X86_32 49#include <mach_ipi.h>
50# include <mach_ipi.h>
51#else
52# include <asm/mach_apic.h>
53#endif
54 50
55/* 51/*
56 * Put the error code here just in case the user cares: 52 * Put the error code here just in case the user cares:
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index 8421d0ac6f22..11b14bbaa61e 100644
--- a/arch/x86/kernel/nmi_32.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -321,7 +321,8 @@ EXPORT_SYMBOL(touch_nmi_watchdog);
321 321
322extern void die_nmi(struct pt_regs *, const char *msg); 322extern void die_nmi(struct pt_regs *, const char *msg);
323 323
324__kprobes int nmi_watchdog_tick(struct pt_regs * regs, unsigned reason) 324notrace __kprobes int
325nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
325{ 326{
326 327
327 /* 328 /*
diff --git a/arch/x86/kernel/nmi_64.c b/arch/x86/kernel/nmi_64.c
index 11f9130ac513..5a29ded994fa 100644
--- a/arch/x86/kernel/nmi_64.c
+++ b/arch/x86/kernel/nmi_64.c
@@ -313,7 +313,8 @@ void touch_nmi_watchdog(void)
313} 313}
314EXPORT_SYMBOL(touch_nmi_watchdog); 314EXPORT_SYMBOL(touch_nmi_watchdog);
315 315
316int __kprobes nmi_watchdog_tick(struct pt_regs * regs, unsigned reason) 316notrace __kprobes int
317nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
317{ 318{
318 int sum; 319 int sum;
319 int touched = 0; 320 int touched = 0;
@@ -384,7 +385,8 @@ int __kprobes nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
384 385
385static unsigned ignore_nmis; 386static unsigned ignore_nmis;
386 387
387asmlinkage __kprobes void do_nmi(struct pt_regs * regs, long error_code) 388asmlinkage notrace __kprobes void
389do_nmi(struct pt_regs *regs, long error_code)
388{ 390{
389 nmi_enter(); 391 nmi_enter();
390 add_pda(__nmi_count,1); 392 add_pda(__nmi_count,1);
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 1b5464c2434f..adb91e4b62da 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -470,10 +470,11 @@ error:
470 return 0; 470 return 0;
471} 471}
472 472
473static dma_addr_t calgary_map_single(struct device *dev, void *vaddr, 473static dma_addr_t calgary_map_single(struct device *dev, phys_addr_t paddr,
474 size_t size, int direction) 474 size_t size, int direction)
475{ 475{
476 dma_addr_t dma_handle = bad_dma_address; 476 dma_addr_t dma_handle = bad_dma_address;
477 void *vaddr = phys_to_virt(paddr);
477 unsigned long uaddr; 478 unsigned long uaddr;
478 unsigned int npages; 479 unsigned int npages;
479 struct iommu_table *tbl = find_iommu_table(dev); 480 struct iommu_table *tbl = find_iommu_table(dev);
diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma.c
index ada5a0604992..388b113a7d88 100644
--- a/arch/x86/kernel/pci-dma_64.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -1,61 +1,370 @@
1/* 1#include <linux/dma-mapping.h>
2 * Dynamic DMA mapping support.
3 */
4
5#include <linux/types.h>
6#include <linux/mm.h>
7#include <linux/string.h>
8#include <linux/pci.h>
9#include <linux/module.h>
10#include <linux/dmar.h> 2#include <linux/dmar.h>
11#include <asm/io.h> 3#include <linux/bootmem.h>
4#include <linux/pci.h>
5
6#include <asm/proto.h>
7#include <asm/dma.h>
12#include <asm/gart.h> 8#include <asm/gart.h>
13#include <asm/calgary.h> 9#include <asm/calgary.h>
14 10
15int iommu_merge __read_mostly = 0; 11int forbid_dac __read_mostly;
16 12EXPORT_SYMBOL(forbid_dac);
17dma_addr_t bad_dma_address __read_mostly;
18EXPORT_SYMBOL(bad_dma_address);
19 13
20/* This tells the BIO block layer to assume merging. Default to off 14const struct dma_mapping_ops *dma_ops;
21 because we cannot guarantee merging later. */ 15EXPORT_SYMBOL(dma_ops);
22int iommu_bio_merge __read_mostly = 0;
23EXPORT_SYMBOL(iommu_bio_merge);
24 16
25static int iommu_sac_force __read_mostly = 0; 17int iommu_sac_force __read_mostly = 0;
26 18
27int no_iommu __read_mostly;
28#ifdef CONFIG_IOMMU_DEBUG 19#ifdef CONFIG_IOMMU_DEBUG
29int panic_on_overflow __read_mostly = 1; 20int panic_on_overflow __read_mostly = 1;
30int force_iommu __read_mostly = 1; 21int force_iommu __read_mostly = 1;
31#else 22#else
32int panic_on_overflow __read_mostly = 0; 23int panic_on_overflow __read_mostly = 0;
33int force_iommu __read_mostly= 0; 24int force_iommu __read_mostly = 0;
34#endif 25#endif
35 26
27int iommu_merge __read_mostly = 0;
28
29int no_iommu __read_mostly;
36/* Set this to 1 if there is a HW IOMMU in the system */ 30/* Set this to 1 if there is a HW IOMMU in the system */
37int iommu_detected __read_mostly = 0; 31int iommu_detected __read_mostly = 0;
38 32
33/* This tells the BIO block layer to assume merging. Default to off
34 because we cannot guarantee merging later. */
35int iommu_bio_merge __read_mostly = 0;
36EXPORT_SYMBOL(iommu_bio_merge);
37
38dma_addr_t bad_dma_address __read_mostly = 0;
39EXPORT_SYMBOL(bad_dma_address);
40
39/* Dummy device used for NULL arguments (normally ISA). Better would 41/* Dummy device used for NULL arguments (normally ISA). Better would
40 be probably a smaller DMA mask, but this is bug-to-bug compatible 42 be probably a smaller DMA mask, but this is bug-to-bug compatible
41 to i386. */ 43 to older i386. */
42struct device fallback_dev = { 44struct device fallback_dev = {
43 .bus_id = "fallback device", 45 .bus_id = "fallback device",
44 .coherent_dma_mask = DMA_32BIT_MASK, 46 .coherent_dma_mask = DMA_32BIT_MASK,
45 .dma_mask = &fallback_dev.coherent_dma_mask, 47 .dma_mask = &fallback_dev.coherent_dma_mask,
46}; 48};
47 49
50int dma_set_mask(struct device *dev, u64 mask)
51{
52 if (!dev->dma_mask || !dma_supported(dev, mask))
53 return -EIO;
54
55 *dev->dma_mask = mask;
56
57 return 0;
58}
59EXPORT_SYMBOL(dma_set_mask);
60
61#ifdef CONFIG_X86_64
62static __initdata void *dma32_bootmem_ptr;
63static unsigned long dma32_bootmem_size __initdata = (128ULL<<20);
64
65static int __init parse_dma32_size_opt(char *p)
66{
67 if (!p)
68 return -EINVAL;
69 dma32_bootmem_size = memparse(p, &p);
70 return 0;
71}
72early_param("dma32_size", parse_dma32_size_opt);
73
74void __init dma32_reserve_bootmem(void)
75{
76 unsigned long size, align;
77 if (end_pfn <= MAX_DMA32_PFN)
78 return;
79
80 align = 64ULL<<20;
81 size = round_up(dma32_bootmem_size, align);
82 dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
83 __pa(MAX_DMA_ADDRESS));
84 if (dma32_bootmem_ptr)
85 dma32_bootmem_size = size;
86 else
87 dma32_bootmem_size = 0;
88}
89static void __init dma32_free_bootmem(void)
90{
91 int node;
92
93 if (end_pfn <= MAX_DMA32_PFN)
94 return;
95
96 if (!dma32_bootmem_ptr)
97 return;
98
99 for_each_online_node(node)
100 free_bootmem_node(NODE_DATA(node), __pa(dma32_bootmem_ptr),
101 dma32_bootmem_size);
102
103 dma32_bootmem_ptr = NULL;
104 dma32_bootmem_size = 0;
105}
106
107void __init pci_iommu_alloc(void)
108{
109 /* free the range so iommu could get some range less than 4G */
110 dma32_free_bootmem();
111 /*
112 * The order of these functions is important for
113 * fall-back/fail-over reasons
114 */
115#ifdef CONFIG_GART_IOMMU
116 gart_iommu_hole_init();
117#endif
118
119#ifdef CONFIG_CALGARY_IOMMU
120 detect_calgary();
121#endif
122
123 detect_intel_iommu();
124
125#ifdef CONFIG_SWIOTLB
126 pci_swiotlb_init();
127#endif
128}
129#endif
130
131/*
132 * See <Documentation/x86_64/boot-options.txt> for the iommu kernel parameter
133 * documentation.
134 */
135static __init int iommu_setup(char *p)
136{
137 iommu_merge = 1;
138
139 if (!p)
140 return -EINVAL;
141
142 while (*p) {
143 if (!strncmp(p, "off", 3))
144 no_iommu = 1;
145 /* gart_parse_options has more force support */
146 if (!strncmp(p, "force", 5))
147 force_iommu = 1;
148 if (!strncmp(p, "noforce", 7)) {
149 iommu_merge = 0;
150 force_iommu = 0;
151 }
152
153 if (!strncmp(p, "biomerge", 8)) {
154 iommu_bio_merge = 4096;
155 iommu_merge = 1;
156 force_iommu = 1;
157 }
158 if (!strncmp(p, "panic", 5))
159 panic_on_overflow = 1;
160 if (!strncmp(p, "nopanic", 7))
161 panic_on_overflow = 0;
162 if (!strncmp(p, "merge", 5)) {
163 iommu_merge = 1;
164 force_iommu = 1;
165 }
166 if (!strncmp(p, "nomerge", 7))
167 iommu_merge = 0;
168 if (!strncmp(p, "forcesac", 8))
169 iommu_sac_force = 1;
170 if (!strncmp(p, "allowdac", 8))
171 forbid_dac = 0;
172 if (!strncmp(p, "nodac", 5))
173 forbid_dac = -1;
174 if (!strncmp(p, "usedac", 6)) {
175 forbid_dac = -1;
176 return 1;
177 }
178#ifdef CONFIG_SWIOTLB
179 if (!strncmp(p, "soft", 4))
180 swiotlb = 1;
181#endif
182
183#ifdef CONFIG_GART_IOMMU
184 gart_parse_options(p);
185#endif
186
187#ifdef CONFIG_CALGARY_IOMMU
188 if (!strncmp(p, "calgary", 7))
189 use_calgary = 1;
190#endif /* CONFIG_CALGARY_IOMMU */
191
192 p += strcspn(p, ",");
193 if (*p == ',')
194 ++p;
195 }
196 return 0;
197}
198early_param("iommu", iommu_setup);
199
200#ifdef CONFIG_X86_32
201int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
202 dma_addr_t device_addr, size_t size, int flags)
203{
204 void __iomem *mem_base = NULL;
205 int pages = size >> PAGE_SHIFT;
206 int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long);
207
208 if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
209 goto out;
210 if (!size)
211 goto out;
212 if (dev->dma_mem)
213 goto out;
214
215 /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */
216
217 mem_base = ioremap(bus_addr, size);
218 if (!mem_base)
219 goto out;
220
221 dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
222 if (!dev->dma_mem)
223 goto out;
224 dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
225 if (!dev->dma_mem->bitmap)
226 goto free1_out;
227
228 dev->dma_mem->virt_base = mem_base;
229 dev->dma_mem->device_base = device_addr;
230 dev->dma_mem->size = pages;
231 dev->dma_mem->flags = flags;
232
233 if (flags & DMA_MEMORY_MAP)
234 return DMA_MEMORY_MAP;
235
236 return DMA_MEMORY_IO;
237
238 free1_out:
239 kfree(dev->dma_mem);
240 out:
241 if (mem_base)
242 iounmap(mem_base);
243 return 0;
244}
245EXPORT_SYMBOL(dma_declare_coherent_memory);
246
247void dma_release_declared_memory(struct device *dev)
248{
249 struct dma_coherent_mem *mem = dev->dma_mem;
250
251 if (!mem)
252 return;
253 dev->dma_mem = NULL;
254 iounmap(mem->virt_base);
255 kfree(mem->bitmap);
256 kfree(mem);
257}
258EXPORT_SYMBOL(dma_release_declared_memory);
259
260void *dma_mark_declared_memory_occupied(struct device *dev,
261 dma_addr_t device_addr, size_t size)
262{
263 struct dma_coherent_mem *mem = dev->dma_mem;
264 int pos, err;
265 int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1);
266
267 pages >>= PAGE_SHIFT;
268
269 if (!mem)
270 return ERR_PTR(-EINVAL);
271
272 pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
273 err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
274 if (err != 0)
275 return ERR_PTR(err);
276 return mem->virt_base + (pos << PAGE_SHIFT);
277}
278EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
279
280static int dma_alloc_from_coherent_mem(struct device *dev, ssize_t size,
281 dma_addr_t *dma_handle, void **ret)
282{
283 struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
284 int order = get_order(size);
285
286 if (mem) {
287 int page = bitmap_find_free_region(mem->bitmap, mem->size,
288 order);
289 if (page >= 0) {
290 *dma_handle = mem->device_base + (page << PAGE_SHIFT);
291 *ret = mem->virt_base + (page << PAGE_SHIFT);
292 memset(*ret, 0, size);
293 }
294 if (mem->flags & DMA_MEMORY_EXCLUSIVE)
295 *ret = NULL;
296 }
297 return (mem != NULL);
298}
299
300static int dma_release_coherent(struct device *dev, int order, void *vaddr)
301{
302 struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
303
304 if (mem && vaddr >= mem->virt_base && vaddr <
305 (mem->virt_base + (mem->size << PAGE_SHIFT))) {
306 int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
307
308 bitmap_release_region(mem->bitmap, page, order);
309 return 1;
310 }
311 return 0;
312}
313#else
314#define dma_alloc_from_coherent_mem(dev, size, handle, ret) (0)
315#define dma_release_coherent(dev, order, vaddr) (0)
316#endif /* CONFIG_X86_32 */
317
318int dma_supported(struct device *dev, u64 mask)
319{
320#ifdef CONFIG_PCI
321 if (mask > 0xffffffff && forbid_dac > 0) {
322 printk(KERN_INFO "PCI: Disallowing DAC for device %s\n",
323 dev->bus_id);
324 return 0;
325 }
326#endif
327
328 if (dma_ops->dma_supported)
329 return dma_ops->dma_supported(dev, mask);
330
331 /* Copied from i386. Doesn't make much sense, because it will
332 only work for pci_alloc_coherent.
333 The caller just has to use GFP_DMA in this case. */
334 if (mask < DMA_24BIT_MASK)
335 return 0;
336
337 /* Tell the device to use SAC when IOMMU force is on. This
338 allows the driver to use cheaper accesses in some cases.
339
340 Problem with this is that if we overflow the IOMMU area and
341 return DAC as fallback address the device may not handle it
342 correctly.
343
344 As a special case some controllers have a 39bit address
345 mode that is as efficient as 32bit (aic79xx). Don't force
346 SAC for these. Assume all masks <= 40 bits are of this
347 type. Normally this doesn't make any difference, but gives
348 more gentle handling of IOMMU overflow. */
349 if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) {
350 printk(KERN_INFO "%s: Force SAC with mask %Lx\n",
351 dev->bus_id, mask);
352 return 0;
353 }
354
355 return 1;
356}
357EXPORT_SYMBOL(dma_supported);
358
48/* Allocate DMA memory on node near device */ 359/* Allocate DMA memory on node near device */
49noinline static void * 360noinline struct page *
50dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order) 361dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
51{ 362{
52 struct page *page;
53 int node; 363 int node;
54 364
55 node = dev_to_node(dev); 365 node = dev_to_node(dev);
56 366
57 page = alloc_pages_node(node, gfp, order); 367 return alloc_pages_node(node, gfp, order);
58 return page ? page_address(page) : NULL;
59} 368}
60 369
61/* 370/*
@@ -65,9 +374,16 @@ void *
65dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 374dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
66 gfp_t gfp) 375 gfp_t gfp)
67{ 376{
68 void *memory; 377 void *memory = NULL;
378 struct page *page;
69 unsigned long dma_mask = 0; 379 unsigned long dma_mask = 0;
70 u64 bus; 380 dma_addr_t bus;
381
382 /* ignore region specifiers */
383 gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
384
385 if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory))
386 return memory;
71 387
72 if (!dev) 388 if (!dev)
73 dev = &fallback_dev; 389 dev = &fallback_dev;
@@ -82,26 +398,25 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
82 /* Don't invoke OOM killer */ 398 /* Don't invoke OOM killer */
83 gfp |= __GFP_NORETRY; 399 gfp |= __GFP_NORETRY;
84 400
85 /* Kludge to make it bug-to-bug compatible with i386. i386 401#ifdef CONFIG_X86_64
86 uses the normal dma_mask for alloc_coherent. */
87 dma_mask &= *dev->dma_mask;
88
89 /* Why <=? Even when the mask is smaller than 4GB it is often 402 /* Why <=? Even when the mask is smaller than 4GB it is often
90 larger than 16MB and in this case we have a chance of 403 larger than 16MB and in this case we have a chance of
91 finding fitting memory in the next higher zone first. If 404 finding fitting memory in the next higher zone first. If
92 not retry with true GFP_DMA. -AK */ 405 not retry with true GFP_DMA. -AK */
93 if (dma_mask <= DMA_32BIT_MASK) 406 if (dma_mask <= DMA_32BIT_MASK)
94 gfp |= GFP_DMA32; 407 gfp |= GFP_DMA32;
408#endif
95 409
96 again: 410 again:
97 memory = dma_alloc_pages(dev, gfp, get_order(size)); 411 page = dma_alloc_pages(dev, gfp, get_order(size));
98 if (memory == NULL) 412 if (page == NULL)
99 return NULL; 413 return NULL;
100 414
101 { 415 {
102 int high, mmu; 416 int high, mmu;
103 bus = virt_to_bus(memory); 417 bus = page_to_phys(page);
104 high = (bus + size) >= dma_mask; 418 memory = page_address(page);
419 high = (bus + size) >= dma_mask;
105 mmu = high; 420 mmu = high;
106 if (force_iommu && !(gfp & GFP_DMA)) 421 if (force_iommu && !(gfp & GFP_DMA))
107 mmu = 1; 422 mmu = 1;
@@ -127,7 +442,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
127 442
128 memset(memory, 0, size); 443 memset(memory, 0, size);
129 if (!mmu) { 444 if (!mmu) {
130 *dma_handle = virt_to_bus(memory); 445 *dma_handle = bus;
131 return memory; 446 return memory;
132 } 447 }
133 } 448 }
@@ -139,7 +454,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
139 } 454 }
140 455
141 if (dma_ops->map_simple) { 456 if (dma_ops->map_simple) {
142 *dma_handle = dma_ops->map_simple(dev, memory, 457 *dma_handle = dma_ops->map_simple(dev, virt_to_phys(memory),
143 size, 458 size,
144 PCI_DMA_BIDIRECTIONAL); 459 PCI_DMA_BIDIRECTIONAL);
145 if (*dma_handle != bad_dma_address) 460 if (*dma_handle != bad_dma_address)
@@ -147,7 +462,8 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
147 } 462 }
148 463
149 if (panic_on_overflow) 464 if (panic_on_overflow)
150 panic("dma_alloc_coherent: IOMMU overflow by %lu bytes\n",size); 465 panic("dma_alloc_coherent: IOMMU overflow by %lu bytes\n",
466 (unsigned long)size);
151 free_pages((unsigned long)memory, get_order(size)); 467 free_pages((unsigned long)memory, get_order(size));
152 return NULL; 468 return NULL;
153} 469}
@@ -160,153 +476,16 @@ EXPORT_SYMBOL(dma_alloc_coherent);
160void dma_free_coherent(struct device *dev, size_t size, 476void dma_free_coherent(struct device *dev, size_t size,
161 void *vaddr, dma_addr_t bus) 477 void *vaddr, dma_addr_t bus)
162{ 478{
479 int order = get_order(size);
163 WARN_ON(irqs_disabled()); /* for portability */ 480 WARN_ON(irqs_disabled()); /* for portability */
481 if (dma_release_coherent(dev, order, vaddr))
482 return;
164 if (dma_ops->unmap_single) 483 if (dma_ops->unmap_single)
165 dma_ops->unmap_single(dev, bus, size, 0); 484 dma_ops->unmap_single(dev, bus, size, 0);
166 free_pages((unsigned long)vaddr, get_order(size)); 485 free_pages((unsigned long)vaddr, order);
167} 486}
168EXPORT_SYMBOL(dma_free_coherent); 487EXPORT_SYMBOL(dma_free_coherent);
169 488
170static int forbid_dac __read_mostly;
171
172int dma_supported(struct device *dev, u64 mask)
173{
174#ifdef CONFIG_PCI
175 if (mask > 0xffffffff && forbid_dac > 0) {
176
177
178
179 printk(KERN_INFO "PCI: Disallowing DAC for device %s\n", dev->bus_id);
180 return 0;
181 }
182#endif
183
184 if (dma_ops->dma_supported)
185 return dma_ops->dma_supported(dev, mask);
186
187 /* Copied from i386. Doesn't make much sense, because it will
188 only work for pci_alloc_coherent.
189 The caller just has to use GFP_DMA in this case. */
190 if (mask < DMA_24BIT_MASK)
191 return 0;
192
193 /* Tell the device to use SAC when IOMMU force is on. This
194 allows the driver to use cheaper accesses in some cases.
195
196 Problem with this is that if we overflow the IOMMU area and
197 return DAC as fallback address the device may not handle it
198 correctly.
199
200 As a special case some controllers have a 39bit address
201 mode that is as efficient as 32bit (aic79xx). Don't force
202 SAC for these. Assume all masks <= 40 bits are of this
203 type. Normally this doesn't make any difference, but gives
204 more gentle handling of IOMMU overflow. */
205 if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) {
206 printk(KERN_INFO "%s: Force SAC with mask %Lx\n", dev->bus_id,mask);
207 return 0;
208 }
209
210 return 1;
211}
212EXPORT_SYMBOL(dma_supported);
213
214int dma_set_mask(struct device *dev, u64 mask)
215{
216 if (!dev->dma_mask || !dma_supported(dev, mask))
217 return -EIO;
218 *dev->dma_mask = mask;
219 return 0;
220}
221EXPORT_SYMBOL(dma_set_mask);
222
223/*
224 * See <Documentation/x86_64/boot-options.txt> for the iommu kernel parameter
225 * documentation.
226 */
227static __init int iommu_setup(char *p)
228{
229 iommu_merge = 1;
230
231 if (!p)
232 return -EINVAL;
233
234 while (*p) {
235 if (!strncmp(p, "off", 3))
236 no_iommu = 1;
237 /* gart_parse_options has more force support */
238 if (!strncmp(p, "force", 5))
239 force_iommu = 1;
240 if (!strncmp(p, "noforce", 7)) {
241 iommu_merge = 0;
242 force_iommu = 0;
243 }
244
245 if (!strncmp(p, "biomerge", 8)) {
246 iommu_bio_merge = 4096;
247 iommu_merge = 1;
248 force_iommu = 1;
249 }
250 if (!strncmp(p, "panic", 5))
251 panic_on_overflow = 1;
252 if (!strncmp(p, "nopanic", 7))
253 panic_on_overflow = 0;
254 if (!strncmp(p, "merge", 5)) {
255 iommu_merge = 1;
256 force_iommu = 1;
257 }
258 if (!strncmp(p, "nomerge", 7))
259 iommu_merge = 0;
260 if (!strncmp(p, "forcesac", 8))
261 iommu_sac_force = 1;
262 if (!strncmp(p, "allowdac", 8))
263 forbid_dac = 0;
264 if (!strncmp(p, "nodac", 5))
265 forbid_dac = -1;
266
267#ifdef CONFIG_SWIOTLB
268 if (!strncmp(p, "soft", 4))
269 swiotlb = 1;
270#endif
271
272#ifdef CONFIG_GART_IOMMU
273 gart_parse_options(p);
274#endif
275
276#ifdef CONFIG_CALGARY_IOMMU
277 if (!strncmp(p, "calgary", 7))
278 use_calgary = 1;
279#endif /* CONFIG_CALGARY_IOMMU */
280
281 p += strcspn(p, ",");
282 if (*p == ',')
283 ++p;
284 }
285 return 0;
286}
287early_param("iommu", iommu_setup);
288
289void __init pci_iommu_alloc(void)
290{
291 /*
292 * The order of these functions is important for
293 * fall-back/fail-over reasons
294 */
295#ifdef CONFIG_GART_IOMMU
296 gart_iommu_hole_init();
297#endif
298
299#ifdef CONFIG_CALGARY_IOMMU
300 detect_calgary();
301#endif
302
303 detect_intel_iommu();
304
305#ifdef CONFIG_SWIOTLB
306 pci_swiotlb_init();
307#endif
308}
309
310static int __init pci_iommu_init(void) 489static int __init pci_iommu_init(void)
311{ 490{
312#ifdef CONFIG_CALGARY_IOMMU 491#ifdef CONFIG_CALGARY_IOMMU
@@ -327,6 +506,8 @@ void pci_iommu_shutdown(void)
327{ 506{
328 gart_iommu_shutdown(); 507 gart_iommu_shutdown();
329} 508}
509/* Must execute after PCI subsystem */
510fs_initcall(pci_iommu_init);
330 511
331#ifdef CONFIG_PCI 512#ifdef CONFIG_PCI
332/* Many VIA bridges seem to corrupt data for DAC. Disable it here */ 513/* Many VIA bridges seem to corrupt data for DAC. Disable it here */
@@ -334,11 +515,10 @@ void pci_iommu_shutdown(void)
334static __devinit void via_no_dac(struct pci_dev *dev) 515static __devinit void via_no_dac(struct pci_dev *dev)
335{ 516{
336 if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) { 517 if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) {
337 printk(KERN_INFO "PCI: VIA PCI bridge detected. Disabling DAC.\n"); 518 printk(KERN_INFO "PCI: VIA PCI bridge detected."
519 "Disabling DAC.\n");
338 forbid_dac = 1; 520 forbid_dac = 1;
339 } 521 }
340} 522}
341DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); 523DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac);
342#endif 524#endif
343/* Must execute after PCI subsystem */
344fs_initcall(pci_iommu_init);
diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c
deleted file mode 100644
index 51330321a5d3..000000000000
--- a/arch/x86/kernel/pci-dma_32.c
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2 * Dynamic DMA mapping support.
3 *
4 * On i386 there is no hardware dynamic DMA address translation,
5 * so consistent alloc/free are merely page allocation/freeing.
6 * The rest of the dynamic DMA mapping interface is implemented
7 * in asm/pci.h.
8 */
9
10#include <linux/types.h>
11#include <linux/mm.h>
12#include <linux/string.h>
13#include <linux/pci.h>
14#include <linux/module.h>
15#include <asm/io.h>
16
17struct dma_coherent_mem {
18 void *virt_base;
19 u32 device_base;
20 int size;
21 int flags;
22 unsigned long *bitmap;
23};
24
25void *dma_alloc_coherent(struct device *dev, size_t size,
26 dma_addr_t *dma_handle, gfp_t gfp)
27{
28 void *ret;
29 struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
30 int order = get_order(size);
31 /* ignore region specifiers */
32 gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
33
34 if (mem) {
35 int page = bitmap_find_free_region(mem->bitmap, mem->size,
36 order);
37 if (page >= 0) {
38 *dma_handle = mem->device_base + (page << PAGE_SHIFT);
39 ret = mem->virt_base + (page << PAGE_SHIFT);
40 memset(ret, 0, size);
41 return ret;
42 }
43 if (mem->flags & DMA_MEMORY_EXCLUSIVE)
44 return NULL;
45 }
46
47 if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
48 gfp |= GFP_DMA;
49
50 ret = (void *)__get_free_pages(gfp, order);
51
52 if (ret != NULL) {
53 memset(ret, 0, size);
54 *dma_handle = virt_to_phys(ret);
55 }
56 return ret;
57}
58EXPORT_SYMBOL(dma_alloc_coherent);
59
60void dma_free_coherent(struct device *dev, size_t size,
61 void *vaddr, dma_addr_t dma_handle)
62{
63 struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
64 int order = get_order(size);
65
66 WARN_ON(irqs_disabled()); /* for portability */
67 if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) {
68 int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
69
70 bitmap_release_region(mem->bitmap, page, order);
71 } else
72 free_pages((unsigned long)vaddr, order);
73}
74EXPORT_SYMBOL(dma_free_coherent);
75
76int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
77 dma_addr_t device_addr, size_t size, int flags)
78{
79 void __iomem *mem_base = NULL;
80 int pages = size >> PAGE_SHIFT;
81 int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long);
82
83 if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
84 goto out;
85 if (!size)
86 goto out;
87 if (dev->dma_mem)
88 goto out;
89
90 /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */
91
92 mem_base = ioremap(bus_addr, size);
93 if (!mem_base)
94 goto out;
95
96 dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
97 if (!dev->dma_mem)
98 goto out;
99 dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
100 if (!dev->dma_mem->bitmap)
101 goto free1_out;
102
103 dev->dma_mem->virt_base = mem_base;
104 dev->dma_mem->device_base = device_addr;
105 dev->dma_mem->size = pages;
106 dev->dma_mem->flags = flags;
107
108 if (flags & DMA_MEMORY_MAP)
109 return DMA_MEMORY_MAP;
110
111 return DMA_MEMORY_IO;
112
113 free1_out:
114 kfree(dev->dma_mem);
115 out:
116 if (mem_base)
117 iounmap(mem_base);
118 return 0;
119}
120EXPORT_SYMBOL(dma_declare_coherent_memory);
121
122void dma_release_declared_memory(struct device *dev)
123{
124 struct dma_coherent_mem *mem = dev->dma_mem;
125
126 if(!mem)
127 return;
128 dev->dma_mem = NULL;
129 iounmap(mem->virt_base);
130 kfree(mem->bitmap);
131 kfree(mem);
132}
133EXPORT_SYMBOL(dma_release_declared_memory);
134
135void *dma_mark_declared_memory_occupied(struct device *dev,
136 dma_addr_t device_addr, size_t size)
137{
138 struct dma_coherent_mem *mem = dev->dma_mem;
139 int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT;
140 int pos, err;
141
142 if (!mem)
143 return ERR_PTR(-EINVAL);
144
145 pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
146 err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
147 if (err != 0)
148 return ERR_PTR(err);
149 return mem->virt_base + (pos << PAGE_SHIFT);
150}
151EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
152
153#ifdef CONFIG_PCI
154/* Many VIA bridges seem to corrupt data for DAC. Disable it here */
155
156int forbid_dac;
157EXPORT_SYMBOL(forbid_dac);
158
159static __devinit void via_no_dac(struct pci_dev *dev)
160{
161 if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) {
162 printk(KERN_INFO "PCI: VIA PCI bridge detected. Disabling DAC.\n");
163 forbid_dac = 1;
164 }
165}
166DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac);
167
168static int check_iommu(char *s)
169{
170 if (!strcmp(s, "usedac")) {
171 forbid_dac = -1;
172 return 1;
173 }
174 return 0;
175}
176__setup("iommu=", check_iommu);
177#endif
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index 700e4647dd30..c07455d1695f 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -264,9 +264,9 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
264} 264}
265 265
266static dma_addr_t 266static dma_addr_t
267gart_map_simple(struct device *dev, char *buf, size_t size, int dir) 267gart_map_simple(struct device *dev, phys_addr_t paddr, size_t size, int dir)
268{ 268{
269 dma_addr_t map = dma_map_area(dev, virt_to_bus(buf), size, dir); 269 dma_addr_t map = dma_map_area(dev, paddr, size, dir);
270 270
271 flush_gart(); 271 flush_gart();
272 272
@@ -275,18 +275,17 @@ gart_map_simple(struct device *dev, char *buf, size_t size, int dir)
275 275
276/* Map a single area into the IOMMU */ 276/* Map a single area into the IOMMU */
277static dma_addr_t 277static dma_addr_t
278gart_map_single(struct device *dev, void *addr, size_t size, int dir) 278gart_map_single(struct device *dev, phys_addr_t paddr, size_t size, int dir)
279{ 279{
280 unsigned long phys_mem, bus; 280 unsigned long bus;
281 281
282 if (!dev) 282 if (!dev)
283 dev = &fallback_dev; 283 dev = &fallback_dev;
284 284
285 phys_mem = virt_to_phys(addr); 285 if (!need_iommu(dev, paddr, size))
286 if (!need_iommu(dev, phys_mem, size)) 286 return paddr;
287 return phys_mem;
288 287
289 bus = gart_map_simple(dev, addr, size, dir); 288 bus = gart_map_simple(dev, paddr, size, dir);
290 289
291 return bus; 290 return bus;
292} 291}
diff --git a/arch/x86/kernel/pci-nommu_64.c b/arch/x86/kernel/pci-nommu.c
index ab08e1832228..aec43d56f49c 100644
--- a/arch/x86/kernel/pci-nommu_64.c
+++ b/arch/x86/kernel/pci-nommu.c
@@ -14,7 +14,7 @@
14static int 14static int
15check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size) 15check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
16{ 16{
17 if (hwdev && bus + size > *hwdev->dma_mask) { 17 if (hwdev && bus + size > *hwdev->dma_mask) {
18 if (*hwdev->dma_mask >= DMA_32BIT_MASK) 18 if (*hwdev->dma_mask >= DMA_32BIT_MASK)
19 printk(KERN_ERR 19 printk(KERN_ERR
20 "nommu_%s: overflow %Lx+%zu of device mask %Lx\n", 20 "nommu_%s: overflow %Lx+%zu of device mask %Lx\n",
@@ -26,19 +26,17 @@ check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
26} 26}
27 27
28static dma_addr_t 28static dma_addr_t
29nommu_map_single(struct device *hwdev, void *ptr, size_t size, 29nommu_map_single(struct device *hwdev, phys_addr_t paddr, size_t size,
30 int direction) 30 int direction)
31{ 31{
32 dma_addr_t bus = virt_to_bus(ptr); 32 dma_addr_t bus = paddr;
33 WARN_ON(size == 0);
33 if (!check_addr("map_single", hwdev, bus, size)) 34 if (!check_addr("map_single", hwdev, bus, size))
34 return bad_dma_address; 35 return bad_dma_address;
36 flush_write_buffers();
35 return bus; 37 return bus;
36} 38}
37 39
38static void nommu_unmap_single(struct device *dev, dma_addr_t addr,size_t size,
39 int direction)
40{
41}
42 40
43/* Map a set of buffers described by scatterlist in streaming 41/* Map a set of buffers described by scatterlist in streaming
44 * mode for DMA. This is the scatter-gather version of the 42 * mode for DMA. This is the scatter-gather version of the
@@ -61,30 +59,34 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
61 struct scatterlist *s; 59 struct scatterlist *s;
62 int i; 60 int i;
63 61
62 WARN_ON(nents == 0 || sg[0].length == 0);
63
64 for_each_sg(sg, s, nents, i) { 64 for_each_sg(sg, s, nents, i) {
65 BUG_ON(!sg_page(s)); 65 BUG_ON(!sg_page(s));
66 s->dma_address = virt_to_bus(sg_virt(s)); 66 s->dma_address = sg_phys(s);
67 if (!check_addr("map_sg", hwdev, s->dma_address, s->length)) 67 if (!check_addr("map_sg", hwdev, s->dma_address, s->length))
68 return 0; 68 return 0;
69 s->dma_length = s->length; 69 s->dma_length = s->length;
70 } 70 }
71 flush_write_buffers();
71 return nents; 72 return nents;
72} 73}
73 74
74/* Unmap a set of streaming mode DMA translations. 75/* Make sure we keep the same behaviour */
75 * Again, cpu read rules concerning calls here are the same as for 76static int nommu_mapping_error(dma_addr_t dma_addr)
76 * pci_unmap_single() above.
77 */
78static void nommu_unmap_sg(struct device *dev, struct scatterlist *sg,
79 int nents, int dir)
80{ 77{
78#ifdef CONFIG_X86_32
79 return 0;
80#else
81 return (dma_addr == bad_dma_address);
82#endif
81} 83}
82 84
85
83const struct dma_mapping_ops nommu_dma_ops = { 86const struct dma_mapping_ops nommu_dma_ops = {
84 .map_single = nommu_map_single, 87 .map_single = nommu_map_single,
85 .unmap_single = nommu_unmap_single,
86 .map_sg = nommu_map_sg, 88 .map_sg = nommu_map_sg,
87 .unmap_sg = nommu_unmap_sg, 89 .mapping_error = nommu_mapping_error,
88 .is_phys = 1, 90 .is_phys = 1,
89}; 91};
90 92
diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c
index 82a0a674a003..490da7f4b8d0 100644
--- a/arch/x86/kernel/pci-swiotlb_64.c
+++ b/arch/x86/kernel/pci-swiotlb_64.c
@@ -11,11 +11,18 @@
11 11
12int swiotlb __read_mostly; 12int swiotlb __read_mostly;
13 13
14static dma_addr_t
15swiotlb_map_single_phys(struct device *hwdev, phys_addr_t paddr, size_t size,
16 int direction)
17{
18 return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction);
19}
20
14const struct dma_mapping_ops swiotlb_dma_ops = { 21const struct dma_mapping_ops swiotlb_dma_ops = {
15 .mapping_error = swiotlb_dma_mapping_error, 22 .mapping_error = swiotlb_dma_mapping_error,
16 .alloc_coherent = swiotlb_alloc_coherent, 23 .alloc_coherent = swiotlb_alloc_coherent,
17 .free_coherent = swiotlb_free_coherent, 24 .free_coherent = swiotlb_free_coherent,
18 .map_single = swiotlb_map_single, 25 .map_single = swiotlb_map_single_phys,
19 .unmap_single = swiotlb_unmap_single, 26 .unmap_single = swiotlb_unmap_single,
20 .sync_single_for_cpu = swiotlb_sync_single_for_cpu, 27 .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
21 .sync_single_for_device = swiotlb_sync_single_for_device, 28 .sync_single_for_device = swiotlb_sync_single_for_device,
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
new file mode 100644
index 000000000000..3004d716539d
--- /dev/null
+++ b/arch/x86/kernel/process.c
@@ -0,0 +1,44 @@
1#include <linux/errno.h>
2#include <linux/kernel.h>
3#include <linux/mm.h>
4#include <linux/smp.h>
5#include <linux/slab.h>
6#include <linux/sched.h>
7
8struct kmem_cache *task_xstate_cachep;
9
10int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
11{
12 *dst = *src;
13 if (src->thread.xstate) {
14 dst->thread.xstate = kmem_cache_alloc(task_xstate_cachep,
15 GFP_KERNEL);
16 if (!dst->thread.xstate)
17 return -ENOMEM;
18 WARN_ON((unsigned long)dst->thread.xstate & 15);
19 memcpy(dst->thread.xstate, src->thread.xstate, xstate_size);
20 }
21 return 0;
22}
23
24void free_thread_xstate(struct task_struct *tsk)
25{
26 if (tsk->thread.xstate) {
27 kmem_cache_free(task_xstate_cachep, tsk->thread.xstate);
28 tsk->thread.xstate = NULL;
29 }
30}
31
32void free_thread_info(struct thread_info *ti)
33{
34 free_thread_xstate(ti->task);
35 free_pages((unsigned long)ti, get_order(THREAD_SIZE));
36}
37
38void arch_task_cache_init(void)
39{
40 task_xstate_cachep =
41 kmem_cache_create("task_xstate", xstate_size,
42 __alignof__(union thread_xstate),
43 SLAB_PANIC, NULL);
44}
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 3903a8f2eb97..7adad088e373 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -36,6 +36,7 @@
36#include <linux/personality.h> 36#include <linux/personality.h>
37#include <linux/tick.h> 37#include <linux/tick.h>
38#include <linux/percpu.h> 38#include <linux/percpu.h>
39#include <linux/prctl.h>
39 40
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/pgtable.h> 42#include <asm/pgtable.h>
@@ -45,7 +46,6 @@
45#include <asm/processor.h> 46#include <asm/processor.h>
46#include <asm/i387.h> 47#include <asm/i387.h>
47#include <asm/desc.h> 48#include <asm/desc.h>
48#include <asm/vm86.h>
49#ifdef CONFIG_MATH_EMULATION 49#ifdef CONFIG_MATH_EMULATION
50#include <asm/math_emu.h> 50#include <asm/math_emu.h>
51#endif 51#endif
@@ -521,14 +521,18 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
521 regs->cs = __USER_CS; 521 regs->cs = __USER_CS;
522 regs->ip = new_ip; 522 regs->ip = new_ip;
523 regs->sp = new_sp; 523 regs->sp = new_sp;
524 /*
525 * Free the old FP and other extended state
526 */
527 free_thread_xstate(current);
524} 528}
525EXPORT_SYMBOL_GPL(start_thread); 529EXPORT_SYMBOL_GPL(start_thread);
526 530
527#ifdef CONFIG_SECCOMP
528static void hard_disable_TSC(void) 531static void hard_disable_TSC(void)
529{ 532{
530 write_cr4(read_cr4() | X86_CR4_TSD); 533 write_cr4(read_cr4() | X86_CR4_TSD);
531} 534}
535
532void disable_TSC(void) 536void disable_TSC(void)
533{ 537{
534 preempt_disable(); 538 preempt_disable();
@@ -540,11 +544,47 @@ void disable_TSC(void)
540 hard_disable_TSC(); 544 hard_disable_TSC();
541 preempt_enable(); 545 preempt_enable();
542} 546}
547
543static void hard_enable_TSC(void) 548static void hard_enable_TSC(void)
544{ 549{
545 write_cr4(read_cr4() & ~X86_CR4_TSD); 550 write_cr4(read_cr4() & ~X86_CR4_TSD);
546} 551}
547#endif /* CONFIG_SECCOMP */ 552
553void enable_TSC(void)
554{
555 preempt_disable();
556 if (test_and_clear_thread_flag(TIF_NOTSC))
557 /*
558 * Must flip the CPU state synchronously with
559 * TIF_NOTSC in the current running context.
560 */
561 hard_enable_TSC();
562 preempt_enable();
563}
564
565int get_tsc_mode(unsigned long adr)
566{
567 unsigned int val;
568
569 if (test_thread_flag(TIF_NOTSC))
570 val = PR_TSC_SIGSEGV;
571 else
572 val = PR_TSC_ENABLE;
573
574 return put_user(val, (unsigned int __user *)adr);
575}
576
577int set_tsc_mode(unsigned int val)
578{
579 if (val == PR_TSC_SIGSEGV)
580 disable_TSC();
581 else if (val == PR_TSC_ENABLE)
582 enable_TSC();
583 else
584 return -EINVAL;
585
586 return 0;
587}
548 588
549static noinline void 589static noinline void
550__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, 590__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
@@ -578,7 +618,6 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
578 set_debugreg(next->debugreg7, 7); 618 set_debugreg(next->debugreg7, 7);
579 } 619 }
580 620
581#ifdef CONFIG_SECCOMP
582 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^ 621 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
583 test_tsk_thread_flag(next_p, TIF_NOTSC)) { 622 test_tsk_thread_flag(next_p, TIF_NOTSC)) {
584 /* prev and next are different */ 623 /* prev and next are different */
@@ -587,7 +626,6 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
587 else 626 else
588 hard_enable_TSC(); 627 hard_enable_TSC();
589 } 628 }
590#endif
591 629
592#ifdef X86_BTS 630#ifdef X86_BTS
593 if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS)) 631 if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS))
@@ -669,7 +707,7 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
669 707
670 /* we're going to use this soon, after a few expensive things */ 708 /* we're going to use this soon, after a few expensive things */
671 if (next_p->fpu_counter > 5) 709 if (next_p->fpu_counter > 5)
672 prefetch(&next->i387.fxsave); 710 prefetch(next->xstate);
673 711
674 /* 712 /*
675 * Reload esp0. 713 * Reload esp0.
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index e75ccc8a2b87..891af1a1b48a 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -36,6 +36,7 @@
36#include <linux/kprobes.h> 36#include <linux/kprobes.h>
37#include <linux/kdebug.h> 37#include <linux/kdebug.h>
38#include <linux/tick.h> 38#include <linux/tick.h>
39#include <linux/prctl.h>
39 40
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/pgtable.h> 42#include <asm/pgtable.h>
@@ -532,9 +533,71 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
532 regs->ss = __USER_DS; 533 regs->ss = __USER_DS;
533 regs->flags = 0x200; 534 regs->flags = 0x200;
534 set_fs(USER_DS); 535 set_fs(USER_DS);
536 /*
537 * Free the old FP and other extended state
538 */
539 free_thread_xstate(current);
535} 540}
536EXPORT_SYMBOL_GPL(start_thread); 541EXPORT_SYMBOL_GPL(start_thread);
537 542
543static void hard_disable_TSC(void)
544{
545 write_cr4(read_cr4() | X86_CR4_TSD);
546}
547
548void disable_TSC(void)
549{
550 preempt_disable();
551 if (!test_and_set_thread_flag(TIF_NOTSC))
552 /*
553 * Must flip the CPU state synchronously with
554 * TIF_NOTSC in the current running context.
555 */
556 hard_disable_TSC();
557 preempt_enable();
558}
559
560static void hard_enable_TSC(void)
561{
562 write_cr4(read_cr4() & ~X86_CR4_TSD);
563}
564
565void enable_TSC(void)
566{
567 preempt_disable();
568 if (test_and_clear_thread_flag(TIF_NOTSC))
569 /*
570 * Must flip the CPU state synchronously with
571 * TIF_NOTSC in the current running context.
572 */
573 hard_enable_TSC();
574 preempt_enable();
575}
576
577int get_tsc_mode(unsigned long adr)
578{
579 unsigned int val;
580
581 if (test_thread_flag(TIF_NOTSC))
582 val = PR_TSC_SIGSEGV;
583 else
584 val = PR_TSC_ENABLE;
585
586 return put_user(val, (unsigned int __user *)adr);
587}
588
589int set_tsc_mode(unsigned int val)
590{
591 if (val == PR_TSC_SIGSEGV)
592 disable_TSC();
593 else if (val == PR_TSC_ENABLE)
594 enable_TSC();
595 else
596 return -EINVAL;
597
598 return 0;
599}
600
538/* 601/*
539 * This special macro can be used to load a debugging register 602 * This special macro can be used to load a debugging register
540 */ 603 */
@@ -572,6 +635,15 @@ static inline void __switch_to_xtra(struct task_struct *prev_p,
572 loaddebug(next, 7); 635 loaddebug(next, 7);
573 } 636 }
574 637
638 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
639 test_tsk_thread_flag(next_p, TIF_NOTSC)) {
640 /* prev and next are different */
641 if (test_tsk_thread_flag(next_p, TIF_NOTSC))
642 hard_disable_TSC();
643 else
644 hard_enable_TSC();
645 }
646
575 if (test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) { 647 if (test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) {
576 /* 648 /*
577 * Copy the relevant range of the IO bitmap. 649 * Copy the relevant range of the IO bitmap.
@@ -614,7 +686,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
614 686
615 /* we're going to use this soon, after a few expensive things */ 687 /* we're going to use this soon, after a few expensive things */
616 if (next_p->fpu_counter>5) 688 if (next_p->fpu_counter>5)
617 prefetch(&next->i387.fxsave); 689 prefetch(next->xstate);
618 690
619 /* 691 /*
620 * Reload esp0, LDT and the page table pointer: 692 * Reload esp0, LDT and the page table pointer:
diff --git a/arch/x86/kernel/setup64.c b/arch/x86/kernel/setup64.c
index 9042fb0e36f5..aee0e8200777 100644
--- a/arch/x86/kernel/setup64.c
+++ b/arch/x86/kernel/setup64.c
@@ -74,8 +74,8 @@ int force_personality32 = 0;
74Control non executable heap for 32bit processes. 74Control non executable heap for 32bit processes.
75To control the stack too use noexec=off 75To control the stack too use noexec=off
76 76
77on PROT_READ does not imply PROT_EXEC for 32bit processes 77on PROT_READ does not imply PROT_EXEC for 32bit processes (default)
78off PROT_READ implies PROT_EXEC (default) 78off PROT_READ implies PROT_EXEC
79*/ 79*/
80static int __init nonx32_setup(char *str) 80static int __init nonx32_setup(char *str)
81{ 81{
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index 5b0bffb7fcc9..1c4799e68718 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -812,10 +812,10 @@ void __init setup_arch(char **cmdline_p)
812 efi_init(); 812 efi_init();
813 813
814 /* update e820 for memory not covered by WB MTRRs */ 814 /* update e820 for memory not covered by WB MTRRs */
815 find_max_pfn(); 815 propagate_e820_map();
816 mtrr_bp_init(); 816 mtrr_bp_init();
817 if (mtrr_trim_uncached_memory(max_pfn)) 817 if (mtrr_trim_uncached_memory(max_pfn))
818 find_max_pfn(); 818 propagate_e820_map();
819 819
820 max_low_pfn = setup_memory(); 820 max_low_pfn = setup_memory();
821 821
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 674ef3510cdf..6b8e11f0c15d 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -398,6 +398,8 @@ void __init setup_arch(char **cmdline_p)
398 398
399 early_res_to_bootmem(); 399 early_res_to_bootmem();
400 400
401 dma32_reserve_bootmem();
402
401#ifdef CONFIG_ACPI_SLEEP 403#ifdef CONFIG_ACPI_SLEEP
402 /* 404 /*
403 * Reserve low memory region for sleep support. 405 * Reserve low memory region for sleep support.
@@ -420,11 +422,14 @@ void __init setup_arch(char **cmdline_p)
420 unsigned long end_of_mem = end_pfn << PAGE_SHIFT; 422 unsigned long end_of_mem = end_pfn << PAGE_SHIFT;
421 423
422 if (ramdisk_end <= end_of_mem) { 424 if (ramdisk_end <= end_of_mem) {
423 reserve_bootmem_generic(ramdisk_image, ramdisk_size); 425 /*
426 * don't need to reserve again, already reserved early
427 * in x86_64_start_kernel, and early_res_to_bootmem
428 * convert that to reserved in bootmem
429 */
424 initrd_start = ramdisk_image + PAGE_OFFSET; 430 initrd_start = ramdisk_image + PAGE_OFFSET;
425 initrd_end = initrd_start+ramdisk_size; 431 initrd_end = initrd_start+ramdisk_size;
426 } else { 432 } else {
427 /* Assumes everything on node 0 */
428 free_bootmem(ramdisk_image, ramdisk_size); 433 free_bootmem(ramdisk_image, ramdisk_size);
429 printk(KERN_ERR "initrd extends beyond end of memory " 434 printk(KERN_ERR "initrd extends beyond end of memory "
430 "(0x%08lx > 0x%08lx)\ndisabling initrd\n", 435 "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index e6abe8a49b1f..6a925394bc7e 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -61,6 +61,7 @@
61#include <asm/mtrr.h> 61#include <asm/mtrr.h>
62#include <asm/nmi.h> 62#include <asm/nmi.h>
63#include <asm/vmi.h> 63#include <asm/vmi.h>
64#include <asm/genapic.h>
64#include <linux/mc146818rtc.h> 65#include <linux/mc146818rtc.h>
65 66
66#include <mach_apic.h> 67#include <mach_apic.h>
@@ -677,6 +678,12 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
677 unsigned long send_status, accept_status = 0; 678 unsigned long send_status, accept_status = 0;
678 int maxlvt, num_starts, j; 679 int maxlvt, num_starts, j;
679 680
681 if (get_uv_system_type() == UV_NON_UNIQUE_APIC) {
682 send_status = uv_wakeup_secondary(phys_apicid, start_eip);
683 atomic_set(&init_deasserted, 1);
684 return send_status;
685 }
686
680 /* 687 /*
681 * Be paranoid about clearing APIC errors. 688 * Be paranoid about clearing APIC errors.
682 */ 689 */
@@ -918,16 +925,19 @@ do_rest:
918 925
919 atomic_set(&init_deasserted, 0); 926 atomic_set(&init_deasserted, 0);
920 927
921 Dprintk("Setting warm reset code and vector.\n"); 928 if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
922 929
923 store_NMI_vector(&nmi_high, &nmi_low); 930 Dprintk("Setting warm reset code and vector.\n");
924 931
925 smpboot_setup_warm_reset_vector(start_ip); 932 store_NMI_vector(&nmi_high, &nmi_low);
926 /* 933
927 * Be paranoid about clearing APIC errors. 934 smpboot_setup_warm_reset_vector(start_ip);
928 */ 935 /*
929 apic_write(APIC_ESR, 0); 936 * Be paranoid about clearing APIC errors.
930 apic_read(APIC_ESR); 937 */
938 apic_write(APIC_ESR, 0);
939 apic_read(APIC_ESR);
940 }
931 941
932 /* 942 /*
933 * Starting actual IPI sequence... 943 * Starting actual IPI sequence...
@@ -966,7 +976,8 @@ do_rest:
966 else 976 else
967 /* trampoline code not run */ 977 /* trampoline code not run */
968 printk(KERN_ERR "Not responding.\n"); 978 printk(KERN_ERR "Not responding.\n");
969 inquire_remote_apic(apicid); 979 if (get_uv_system_type() != UV_NON_UNIQUE_APIC)
980 inquire_remote_apic(apicid);
970 } 981 }
971 } 982 }
972 983
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 65791ca2824a..471e694d6713 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -681,7 +681,7 @@ gp_in_kernel:
681 } 681 }
682} 682}
683 683
684static __kprobes void 684static notrace __kprobes void
685mem_parity_error(unsigned char reason, struct pt_regs *regs) 685mem_parity_error(unsigned char reason, struct pt_regs *regs)
686{ 686{
687 printk(KERN_EMERG 687 printk(KERN_EMERG
@@ -707,7 +707,7 @@ mem_parity_error(unsigned char reason, struct pt_regs *regs)
707 clear_mem_error(reason); 707 clear_mem_error(reason);
708} 708}
709 709
710static __kprobes void 710static notrace __kprobes void
711io_check_error(unsigned char reason, struct pt_regs *regs) 711io_check_error(unsigned char reason, struct pt_regs *regs)
712{ 712{
713 unsigned long i; 713 unsigned long i;
@@ -727,7 +727,7 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
727 outb(reason, 0x61); 727 outb(reason, 0x61);
728} 728}
729 729
730static __kprobes void 730static notrace __kprobes void
731unknown_nmi_error(unsigned char reason, struct pt_regs *regs) 731unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
732{ 732{
733 if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP) 733 if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
@@ -755,7 +755,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
755 755
756static DEFINE_SPINLOCK(nmi_print_lock); 756static DEFINE_SPINLOCK(nmi_print_lock);
757 757
758void __kprobes die_nmi(struct pt_regs *regs, const char *msg) 758void notrace __kprobes die_nmi(struct pt_regs *regs, const char *msg)
759{ 759{
760 if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) == NOTIFY_STOP) 760 if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) == NOTIFY_STOP)
761 return; 761 return;
@@ -786,7 +786,7 @@ void __kprobes die_nmi(struct pt_regs *regs, const char *msg)
786 do_exit(SIGSEGV); 786 do_exit(SIGSEGV);
787} 787}
788 788
789static __kprobes void default_do_nmi(struct pt_regs *regs) 789static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
790{ 790{
791 unsigned char reason = 0; 791 unsigned char reason = 0;
792 792
@@ -828,7 +828,7 @@ static __kprobes void default_do_nmi(struct pt_regs *regs)
828 828
829static int ignore_nmis; 829static int ignore_nmis;
830 830
831__kprobes void do_nmi(struct pt_regs *regs, long error_code) 831notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code)
832{ 832{
833 int cpu; 833 int cpu;
834 834
@@ -1148,9 +1148,22 @@ asmlinkage void math_state_restore(void)
1148 struct thread_info *thread = current_thread_info(); 1148 struct thread_info *thread = current_thread_info();
1149 struct task_struct *tsk = thread->task; 1149 struct task_struct *tsk = thread->task;
1150 1150
1151 if (!tsk_used_math(tsk)) {
1152 local_irq_enable();
1153 /*
1154 * does a slab alloc which can sleep
1155 */
1156 if (init_fpu(tsk)) {
1157 /*
1158 * ran out of memory!
1159 */
1160 do_group_exit(SIGKILL);
1161 return;
1162 }
1163 local_irq_disable();
1164 }
1165
1151 clts(); /* Allow maths ops (or we recurse) */ 1166 clts(); /* Allow maths ops (or we recurse) */
1152 if (!tsk_used_math(tsk))
1153 init_fpu(tsk);
1154 restore_fpu(tsk); 1167 restore_fpu(tsk);
1155 thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */ 1168 thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
1156 tsk->fpu_counter++; 1169 tsk->fpu_counter++;
@@ -1208,11 +1221,6 @@ void __init trap_init(void)
1208#endif 1221#endif
1209 set_trap_gate(19, &simd_coprocessor_error); 1222 set_trap_gate(19, &simd_coprocessor_error);
1210 1223
1211 /*
1212 * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
1213 * Generate a build-time error if the alignment is wrong.
1214 */
1215 BUILD_BUG_ON(offsetof(struct task_struct, thread.i387.fxsave) & 15);
1216 if (cpu_has_fxsr) { 1224 if (cpu_has_fxsr) {
1217 printk(KERN_INFO "Enabling fast FPU save and restore... "); 1225 printk(KERN_INFO "Enabling fast FPU save and restore... ");
1218 set_in_cr4(X86_CR4_OSFXSR); 1226 set_in_cr4(X86_CR4_OSFXSR);
@@ -1233,6 +1241,7 @@ void __init trap_init(void)
1233 1241
1234 set_bit(SYSCALL_VECTOR, used_vectors); 1242 set_bit(SYSCALL_VECTOR, used_vectors);
1235 1243
1244 init_thread_xstate();
1236 /* 1245 /*
1237 * Should be a barrier for any external CPU state: 1246 * Should be a barrier for any external CPU state:
1238 */ 1247 */
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index 79aa6fc0815c..adff76ea97c4 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -600,7 +600,8 @@ void die(const char * str, struct pt_regs * regs, long err)
600 oops_end(flags, regs, SIGSEGV); 600 oops_end(flags, regs, SIGSEGV);
601} 601}
602 602
603void __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic) 603notrace __kprobes void
604die_nmi(char *str, struct pt_regs *regs, int do_panic)
604{ 605{
605 unsigned long flags; 606 unsigned long flags;
606 607
@@ -772,7 +773,7 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
772 die("general protection fault", regs, error_code); 773 die("general protection fault", regs, error_code);
773} 774}
774 775
775static __kprobes void 776static notrace __kprobes void
776mem_parity_error(unsigned char reason, struct pt_regs * regs) 777mem_parity_error(unsigned char reason, struct pt_regs * regs)
777{ 778{
778 printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n", 779 printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n",
@@ -796,7 +797,7 @@ mem_parity_error(unsigned char reason, struct pt_regs * regs)
796 outb(reason, 0x61); 797 outb(reason, 0x61);
797} 798}
798 799
799static __kprobes void 800static notrace __kprobes void
800io_check_error(unsigned char reason, struct pt_regs * regs) 801io_check_error(unsigned char reason, struct pt_regs * regs)
801{ 802{
802 printk("NMI: IOCK error (debug interrupt?)\n"); 803 printk("NMI: IOCK error (debug interrupt?)\n");
@@ -810,7 +811,7 @@ io_check_error(unsigned char reason, struct pt_regs * regs)
810 outb(reason, 0x61); 811 outb(reason, 0x61);
811} 812}
812 813
813static __kprobes void 814static notrace __kprobes void
814unknown_nmi_error(unsigned char reason, struct pt_regs * regs) 815unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
815{ 816{
816 if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP) 817 if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
@@ -827,7 +828,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
827 828
828/* Runs on IST stack. This code must keep interrupts off all the time. 829/* Runs on IST stack. This code must keep interrupts off all the time.
829 Nested NMIs are prevented by the CPU. */ 830 Nested NMIs are prevented by the CPU. */
830asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs) 831asmlinkage notrace __kprobes void default_do_nmi(struct pt_regs *regs)
831{ 832{
832 unsigned char reason = 0; 833 unsigned char reason = 0;
833 int cpu; 834 int cpu;
@@ -1123,11 +1124,24 @@ asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void)
1123asmlinkage void math_state_restore(void) 1124asmlinkage void math_state_restore(void)
1124{ 1125{
1125 struct task_struct *me = current; 1126 struct task_struct *me = current;
1126 clts(); /* Allow maths ops (or we recurse) */
1127 1127
1128 if (!used_math()) 1128 if (!used_math()) {
1129 init_fpu(me); 1129 local_irq_enable();
1130 restore_fpu_checking(&me->thread.i387.fxsave); 1130 /*
1131 * does a slab alloc which can sleep
1132 */
1133 if (init_fpu(me)) {
1134 /*
1135 * ran out of memory!
1136 */
1137 do_group_exit(SIGKILL);
1138 return;
1139 }
1140 local_irq_disable();
1141 }
1142
1143 clts(); /* Allow maths ops (or we recurse) */
1144 restore_fpu_checking(&me->thread.xstate->fxsave);
1131 task_thread_info(me)->status |= TS_USEDFPU; 1145 task_thread_info(me)->status |= TS_USEDFPU;
1132 me->fpu_counter++; 1146 me->fpu_counter++;
1133} 1147}
@@ -1163,6 +1177,10 @@ void __init trap_init(void)
1163#endif 1177#endif
1164 1178
1165 /* 1179 /*
1180 * initialize the per thread extended state:
1181 */
1182 init_thread_xstate();
1183 /*
1166 * Should be a barrier for any external CPU state. 1184 * Should be a barrier for any external CPU state.
1167 */ 1185 */
1168 cpu_init(); 1186 cpu_init();
diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c
index 3d7e6e9fa6c2..e4790728b224 100644
--- a/arch/x86/kernel/tsc_32.c
+++ b/arch/x86/kernel/tsc_32.c
@@ -221,9 +221,9 @@ EXPORT_SYMBOL(recalibrate_cpu_khz);
221 * if the CPU frequency is scaled, TSC-based delays will need a different 221 * if the CPU frequency is scaled, TSC-based delays will need a different
222 * loops_per_jiffy value to function properly. 222 * loops_per_jiffy value to function properly.
223 */ 223 */
224static unsigned int ref_freq = 0; 224static unsigned int ref_freq;
225static unsigned long loops_per_jiffy_ref = 0; 225static unsigned long loops_per_jiffy_ref;
226static unsigned long cpu_khz_ref = 0; 226static unsigned long cpu_khz_ref;
227 227
228static int 228static int
229time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data) 229time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data)
@@ -283,15 +283,28 @@ core_initcall(cpufreq_tsc);
283 283
284/* clock source code */ 284/* clock source code */
285 285
286static unsigned long current_tsc_khz = 0; 286static unsigned long current_tsc_khz;
287static struct clocksource clocksource_tsc;
287 288
289/*
290 * We compare the TSC to the cycle_last value in the clocksource
291 * structure to avoid a nasty time-warp issue. This can be observed in
292 * a very small window right after one CPU updated cycle_last under
293 * xtime lock and the other CPU reads a TSC value which is smaller
294 * than the cycle_last reference value due to a TSC which is slighty
295 * behind. This delta is nowhere else observable, but in that case it
296 * results in a forward time jump in the range of hours due to the
297 * unsigned delta calculation of the time keeping core code, which is
298 * necessary to support wrapping clocksources like pm timer.
299 */
288static cycle_t read_tsc(void) 300static cycle_t read_tsc(void)
289{ 301{
290 cycle_t ret; 302 cycle_t ret;
291 303
292 rdtscll(ret); 304 rdtscll(ret);
293 305
294 return ret; 306 return ret >= clocksource_tsc.cycle_last ?
307 ret : clocksource_tsc.cycle_last;
295} 308}
296 309
297static struct clocksource clocksource_tsc = { 310static struct clocksource clocksource_tsc = {
diff --git a/arch/x86/kernel/tsc_64.c b/arch/x86/kernel/tsc_64.c
index ceeba01e7f47..fcc16e58609e 100644
--- a/arch/x86/kernel/tsc_64.c
+++ b/arch/x86/kernel/tsc_64.c
@@ -11,6 +11,7 @@
11#include <asm/hpet.h> 11#include <asm/hpet.h>
12#include <asm/timex.h> 12#include <asm/timex.h>
13#include <asm/timer.h> 13#include <asm/timer.h>
14#include <asm/vgtod.h>
14 15
15static int notsc __initdata = 0; 16static int notsc __initdata = 0;
16 17
@@ -287,18 +288,34 @@ int __init notsc_setup(char *s)
287 288
288__setup("notsc", notsc_setup); 289__setup("notsc", notsc_setup);
289 290
291static struct clocksource clocksource_tsc;
290 292
291/* clock source code: */ 293/*
294 * We compare the TSC to the cycle_last value in the clocksource
295 * structure to avoid a nasty time-warp. This can be observed in a
296 * very small window right after one CPU updated cycle_last under
297 * xtime/vsyscall_gtod lock and the other CPU reads a TSC value which
298 * is smaller than the cycle_last reference value due to a TSC which
299 * is slighty behind. This delta is nowhere else observable, but in
300 * that case it results in a forward time jump in the range of hours
301 * due to the unsigned delta calculation of the time keeping core
302 * code, which is necessary to support wrapping clocksources like pm
303 * timer.
304 */
292static cycle_t read_tsc(void) 305static cycle_t read_tsc(void)
293{ 306{
294 cycle_t ret = (cycle_t)get_cycles(); 307 cycle_t ret = (cycle_t)get_cycles();
295 return ret; 308
309 return ret >= clocksource_tsc.cycle_last ?
310 ret : clocksource_tsc.cycle_last;
296} 311}
297 312
298static cycle_t __vsyscall_fn vread_tsc(void) 313static cycle_t __vsyscall_fn vread_tsc(void)
299{ 314{
300 cycle_t ret = (cycle_t)vget_cycles(); 315 cycle_t ret = (cycle_t)vget_cycles();
301 return ret; 316
317 return ret >= __vsyscall_gtod_data.clock.cycle_last ?
318 ret : __vsyscall_gtod_data.clock.cycle_last;
302} 319}
303 320
304static struct clocksource clocksource_tsc = { 321static struct clocksource clocksource_tsc = {
diff --git a/arch/x86/mach-visws/visws_apic.c b/arch/x86/mach-visws/visws_apic.c
index 710faf71a650..cef9cb1d15ac 100644
--- a/arch/x86/mach-visws/visws_apic.c
+++ b/arch/x86/mach-visws/visws_apic.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/i386/mach-visws/visws_apic.c
3 *
4 * Copyright (C) 1999 Bent Hagemark, Ingo Molnar 2 * Copyright (C) 1999 Bent Hagemark, Ingo Molnar
5 * 3 *
6 * SGI Visual Workstation interrupt controller 4 * SGI Visual Workstation interrupt controller
diff --git a/arch/x86/mach-voyager/voyager_basic.c b/arch/x86/mach-voyager/voyager_basic.c
index 6a949e4edde8..46d6f8067690 100644
--- a/arch/x86/mach-voyager/voyager_basic.c
+++ b/arch/x86/mach-voyager/voyager_basic.c
@@ -2,8 +2,6 @@
2 * 2 *
3 * Author: J.E.J.Bottomley@HansenPartnership.com 3 * Author: J.E.J.Bottomley@HansenPartnership.com
4 * 4 *
5 * linux/arch/i386/kernel/voyager.c
6 *
7 * This file contains all the voyager specific routines for getting 5 * This file contains all the voyager specific routines for getting
8 * initialisation of the architecture to function. For additional 6 * initialisation of the architecture to function. For additional
9 * features see: 7 * features see:
diff --git a/arch/x86/mach-voyager/voyager_cat.c b/arch/x86/mach-voyager/voyager_cat.c
index 17a7904f75b1..ecab9fff0fd1 100644
--- a/arch/x86/mach-voyager/voyager_cat.c
+++ b/arch/x86/mach-voyager/voyager_cat.c
@@ -4,8 +4,6 @@
4 * 4 *
5 * Author: J.E.J.Bottomley@HansenPartnership.com 5 * Author: J.E.J.Bottomley@HansenPartnership.com
6 * 6 *
7 * linux/arch/i386/kernel/voyager_cat.c
8 *
9 * This file contains all the logic for manipulating the CAT bus 7 * This file contains all the logic for manipulating the CAT bus
10 * in a level 5 machine. 8 * in a level 5 machine.
11 * 9 *
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
index be7235bf105d..96f60c7cd124 100644
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
@@ -4,8 +4,6 @@
4 * 4 *
5 * Author: J.E.J.Bottomley@HansenPartnership.com 5 * Author: J.E.J.Bottomley@HansenPartnership.com
6 * 6 *
7 * linux/arch/i386/kernel/voyager_smp.c
8 *
9 * This file provides all the same external entries as smp.c but uses 7 * This file provides all the same external entries as smp.c but uses
10 * the voyager hal to provide the functionality 8 * the voyager hal to provide the functionality
11 */ 9 */
diff --git a/arch/x86/mach-voyager/voyager_thread.c b/arch/x86/mach-voyager/voyager_thread.c
index c69c931818ed..15464a20fb38 100644
--- a/arch/x86/mach-voyager/voyager_thread.c
+++ b/arch/x86/mach-voyager/voyager_thread.c
@@ -4,8 +4,6 @@
4 * 4 *
5 * Author: J.E.J.Bottomley@HansenPartnership.com 5 * Author: J.E.J.Bottomley@HansenPartnership.com
6 * 6 *
7 * linux/arch/i386/kernel/voyager_thread.c
8 *
9 * This module provides the machine status monitor thread for the 7 * This module provides the machine status monitor thread for the
10 * voyager architecture. This allows us to monitor the machine 8 * voyager architecture. This allows us to monitor the machine
11 * environment (temp, voltage, fan function) and the front panel and 9 * environment (temp, voltage, fan function) and the front panel and
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c
index 4bab3b145392..6e38d877ea77 100644
--- a/arch/x86/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
@@ -678,7 +678,7 @@ int fpregs_soft_set(struct task_struct *target,
678 unsigned int pos, unsigned int count, 678 unsigned int pos, unsigned int count,
679 const void *kbuf, const void __user *ubuf) 679 const void *kbuf, const void __user *ubuf)
680{ 680{
681 struct i387_soft_struct *s387 = &target->thread.i387.soft; 681 struct i387_soft_struct *s387 = &target->thread.xstate->soft;
682 void *space = s387->st_space; 682 void *space = s387->st_space;
683 int ret; 683 int ret;
684 int offset, other, i, tags, regnr, tag, newtop; 684 int offset, other, i, tags, regnr, tag, newtop;
@@ -730,7 +730,7 @@ int fpregs_soft_get(struct task_struct *target,
730 unsigned int pos, unsigned int count, 730 unsigned int pos, unsigned int count,
731 void *kbuf, void __user *ubuf) 731 void *kbuf, void __user *ubuf)
732{ 732{
733 struct i387_soft_struct *s387 = &target->thread.i387.soft; 733 struct i387_soft_struct *s387 = &target->thread.xstate->soft;
734 const void *space = s387->st_space; 734 const void *space = s387->st_space;
735 int ret; 735 int ret;
736 int offset = (S387->ftop & 7) * 10, other = 80 - offset; 736 int offset = (S387->ftop & 7) * 10, other = 80 - offset;
diff --git a/arch/x86/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h
index a3ae28c49ddd..13488fa153e0 100644
--- a/arch/x86/math-emu/fpu_system.h
+++ b/arch/x86/math-emu/fpu_system.h
@@ -35,8 +35,8 @@
35#define SEG_EXPAND_DOWN(s) (((s).b & ((1 << 11) | (1 << 10))) \ 35#define SEG_EXPAND_DOWN(s) (((s).b & ((1 << 11) | (1 << 10))) \
36 == (1 << 10)) 36 == (1 << 10))
37 37
38#define I387 (current->thread.i387) 38#define I387 (current->thread.xstate)
39#define FPU_info (I387.soft.info) 39#define FPU_info (I387->soft.info)
40 40
41#define FPU_CS (*(unsigned short *) &(FPU_info->___cs)) 41#define FPU_CS (*(unsigned short *) &(FPU_info->___cs))
42#define FPU_SS (*(unsigned short *) &(FPU_info->___ss)) 42#define FPU_SS (*(unsigned short *) &(FPU_info->___ss))
@@ -46,25 +46,25 @@
46#define FPU_EIP (FPU_info->___eip) 46#define FPU_EIP (FPU_info->___eip)
47#define FPU_ORIG_EIP (FPU_info->___orig_eip) 47#define FPU_ORIG_EIP (FPU_info->___orig_eip)
48 48
49#define FPU_lookahead (I387.soft.lookahead) 49#define FPU_lookahead (I387->soft.lookahead)
50 50
51/* nz if ip_offset and cs_selector are not to be set for the current 51/* nz if ip_offset and cs_selector are not to be set for the current
52 instruction. */ 52 instruction. */
53#define no_ip_update (*(u_char *)&(I387.soft.no_update)) 53#define no_ip_update (*(u_char *)&(I387->soft.no_update))
54#define FPU_rm (*(u_char *)&(I387.soft.rm)) 54#define FPU_rm (*(u_char *)&(I387->soft.rm))
55 55
56/* Number of bytes of data which can be legally accessed by the current 56/* Number of bytes of data which can be legally accessed by the current
57 instruction. This only needs to hold a number <= 108, so a byte will do. */ 57 instruction. This only needs to hold a number <= 108, so a byte will do. */
58#define access_limit (*(u_char *)&(I387.soft.alimit)) 58#define access_limit (*(u_char *)&(I387->soft.alimit))
59 59
60#define partial_status (I387.soft.swd) 60#define partial_status (I387->soft.swd)
61#define control_word (I387.soft.cwd) 61#define control_word (I387->soft.cwd)
62#define fpu_tag_word (I387.soft.twd) 62#define fpu_tag_word (I387->soft.twd)
63#define registers (I387.soft.st_space) 63#define registers (I387->soft.st_space)
64#define top (I387.soft.ftop) 64#define top (I387->soft.ftop)
65 65
66#define instruction_address (*(struct address *)&I387.soft.fip) 66#define instruction_address (*(struct address *)&I387->soft.fip)
67#define operand_address (*(struct address *)&I387.soft.foo) 67#define operand_address (*(struct address *)&I387->soft.foo)
68 68
69#define FPU_access_ok(x,y,z) if ( !access_ok(x,y,z) ) \ 69#define FPU_access_ok(x,y,z) if ( !access_ok(x,y,z) ) \
70 math_abort(FPU_info,SIGSEGV) 70 math_abort(FPU_info,SIGSEGV)
diff --git a/arch/x86/math-emu/reg_ld_str.c b/arch/x86/math-emu/reg_ld_str.c
index 02af772a24db..d597fe7423c9 100644
--- a/arch/x86/math-emu/reg_ld_str.c
+++ b/arch/x86/math-emu/reg_ld_str.c
@@ -1180,8 +1180,8 @@ u_char __user *fstenv(fpu_addr_modes addr_modes, u_char __user *d)
1180 control_word |= 0xffff0040; 1180 control_word |= 0xffff0040;
1181 partial_status = status_word() | 0xffff0000; 1181 partial_status = status_word() | 0xffff0000;
1182 fpu_tag_word |= 0xffff0000; 1182 fpu_tag_word |= 0xffff0000;
1183 I387.soft.fcs &= ~0xf8000000; 1183 I387->soft.fcs &= ~0xf8000000;
1184 I387.soft.fos |= 0xffff0000; 1184 I387->soft.fos |= 0xffff0000;
1185#endif /* PECULIAR_486 */ 1185#endif /* PECULIAR_486 */
1186 if (__copy_to_user(d, &control_word, 7 * 4)) 1186 if (__copy_to_user(d, &control_word, 7 * 4))
1187 FPU_abort; 1187 FPU_abort;
diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c
index eba0bbede7a6..18378850e25a 100644
--- a/arch/x86/mm/discontig_32.c
+++ b/arch/x86/mm/discontig_32.c
@@ -120,7 +120,7 @@ int __init get_memcfg_numa_flat(void)
120 printk("NUMA - single node, flat memory mode\n"); 120 printk("NUMA - single node, flat memory mode\n");
121 121
122 /* Run the memory configuration and find the top of memory. */ 122 /* Run the memory configuration and find the top of memory. */
123 find_max_pfn(); 123 propagate_e820_map();
124 node_start_pfn[0] = 0; 124 node_start_pfn[0] = 0;
125 node_end_pfn[0] = max_pfn; 125 node_end_pfn[0] = max_pfn;
126 memory_present(0, 0, max_pfn); 126 memory_present(0, 0, max_pfn);
@@ -134,7 +134,7 @@ int __init get_memcfg_numa_flat(void)
134/* 134/*
135 * Find the highest page frame number we have available for the node 135 * Find the highest page frame number we have available for the node
136 */ 136 */
137static void __init find_max_pfn_node(int nid) 137static void __init propagate_e820_map_node(int nid)
138{ 138{
139 if (node_end_pfn[nid] > max_pfn) 139 if (node_end_pfn[nid] > max_pfn)
140 node_end_pfn[nid] = max_pfn; 140 node_end_pfn[nid] = max_pfn;
@@ -379,7 +379,7 @@ unsigned long __init setup_memory(void)
379 printk("High memory starts at vaddr %08lx\n", 379 printk("High memory starts at vaddr %08lx\n",
380 (ulong) pfn_to_kaddr(highstart_pfn)); 380 (ulong) pfn_to_kaddr(highstart_pfn));
381 for_each_online_node(nid) 381 for_each_online_node(nid)
382 find_max_pfn_node(nid); 382 propagate_e820_map_node(nid);
383 383
384 memset(NODE_DATA(0), 0, sizeof(struct pglist_data)); 384 memset(NODE_DATA(0), 0, sizeof(struct pglist_data));
385 NODE_DATA(0)->bdata = &node0_bdata; 385 NODE_DATA(0)->bdata = &node0_bdata;
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 1500dc8d63e4..9ec62da85fd7 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * linux/arch/i386/mm/init.c
3 * 2 *
4 * Copyright (C) 1995 Linus Torvalds 3 * Copyright (C) 1995 Linus Torvalds
5 * 4 *
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 1076097dcab2..1ff7906a9a4d 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -47,9 +47,6 @@
47#include <asm/numa.h> 47#include <asm/numa.h>
48#include <asm/cacheflush.h> 48#include <asm/cacheflush.h>
49 49
50const struct dma_mapping_ops *dma_ops;
51EXPORT_SYMBOL(dma_ops);
52
53static unsigned long dma_reserve __initdata; 50static unsigned long dma_reserve __initdata;
54 51
55DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 52DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index c590fd200e29..3a4baf95e24d 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -134,7 +134,7 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
134 134
135 if (!phys_addr_valid(phys_addr)) { 135 if (!phys_addr_valid(phys_addr)) {
136 printk(KERN_WARNING "ioremap: invalid physical address %llx\n", 136 printk(KERN_WARNING "ioremap: invalid physical address %llx\n",
137 phys_addr); 137 (unsigned long long)phys_addr);
138 WARN_ON_ONCE(1); 138 WARN_ON_ONCE(1);
139 return NULL; 139 return NULL;
140 } 140 }
@@ -187,7 +187,8 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
187 new_prot_val == _PAGE_CACHE_WB)) { 187 new_prot_val == _PAGE_CACHE_WB)) {
188 pr_debug( 188 pr_debug(
189 "ioremap error for 0x%llx-0x%llx, requested 0x%lx, got 0x%lx\n", 189 "ioremap error for 0x%llx-0x%llx, requested 0x%lx, got 0x%lx\n",
190 phys_addr, phys_addr + size, 190 (unsigned long long)phys_addr,
191 (unsigned long long)(phys_addr + size),
191 prot_val, new_prot_val); 192 prot_val, new_prot_val);
192 free_memtype(phys_addr, phys_addr + size); 193 free_memtype(phys_addr, phys_addr + size);
193 return NULL; 194 return NULL;
diff --git a/arch/x86/mm/k8topology_64.c b/arch/x86/mm/k8topology_64.c
index 7a2ebce87df5..86808e666f9c 100644
--- a/arch/x86/mm/k8topology_64.c
+++ b/arch/x86/mm/k8topology_64.c
@@ -164,7 +164,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
164 if (!found) 164 if (!found)
165 return -1; 165 return -1;
166 166
167 memnode_shift = compute_hash_shift(nodes, 8); 167 memnode_shift = compute_hash_shift(nodes, 8, NULL);
168 if (memnode_shift < 0) { 168 if (memnode_shift < 0) {
169 printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n"); 169 printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n");
170 return -1; 170 return -1;
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 3f6c53c0e003..9a6892200b27 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -60,7 +60,7 @@ unsigned long __initdata nodemap_size;
60 * -1 if node overlap or lost ram (shift too big) 60 * -1 if node overlap or lost ram (shift too big)
61 */ 61 */
62static int __init populate_memnodemap(const struct bootnode *nodes, 62static int __init populate_memnodemap(const struct bootnode *nodes,
63 int numnodes, int shift) 63 int numnodes, int shift, int *nodeids)
64{ 64{
65 unsigned long addr, end; 65 unsigned long addr, end;
66 int i, res = -1; 66 int i, res = -1;
@@ -76,7 +76,12 @@ static int __init populate_memnodemap(const struct bootnode *nodes,
76 do { 76 do {
77 if (memnodemap[addr >> shift] != NUMA_NO_NODE) 77 if (memnodemap[addr >> shift] != NUMA_NO_NODE)
78 return -1; 78 return -1;
79 memnodemap[addr >> shift] = i; 79
80 if (!nodeids)
81 memnodemap[addr >> shift] = i;
82 else
83 memnodemap[addr >> shift] = nodeids[i];
84
80 addr += (1UL << shift); 85 addr += (1UL << shift);
81 } while (addr < end); 86 } while (addr < end);
82 res = 1; 87 res = 1;
@@ -139,7 +144,8 @@ static int __init extract_lsb_from_nodes(const struct bootnode *nodes,
139 return i; 144 return i;
140} 145}
141 146
142int __init compute_hash_shift(struct bootnode *nodes, int numnodes) 147int __init compute_hash_shift(struct bootnode *nodes, int numnodes,
148 int *nodeids)
143{ 149{
144 int shift; 150 int shift;
145 151
@@ -149,7 +155,7 @@ int __init compute_hash_shift(struct bootnode *nodes, int numnodes)
149 printk(KERN_DEBUG "NUMA: Using %d for the hash shift.\n", 155 printk(KERN_DEBUG "NUMA: Using %d for the hash shift.\n",
150 shift); 156 shift);
151 157
152 if (populate_memnodemap(nodes, numnodes, shift) != 1) { 158 if (populate_memnodemap(nodes, numnodes, shift, nodeids) != 1) {
153 printk(KERN_INFO "Your memory is not aligned you need to " 159 printk(KERN_INFO "Your memory is not aligned you need to "
154 "rebuild your kernel with a bigger NODEMAPSIZE " 160 "rebuild your kernel with a bigger NODEMAPSIZE "
155 "shift=%d\n", shift); 161 "shift=%d\n", shift);
@@ -463,7 +469,7 @@ done:
463 } 469 }
464 } 470 }
465out: 471out:
466 memnode_shift = compute_hash_shift(nodes, num_nodes); 472 memnode_shift = compute_hash_shift(nodes, num_nodes, NULL);
467 if (memnode_shift < 0) { 473 if (memnode_shift < 0) {
468 memnode_shift = 0; 474 memnode_shift = 0;
469 printk(KERN_ERR "No NUMA hash function found. NUMA emulation " 475 printk(KERN_ERR "No NUMA hash function found. NUMA emulation "
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index 3165ec0672bd..6fb9e7c6893f 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -1,7 +1,3 @@
1/*
2 * linux/arch/i386/mm/pgtable.c
3 */
4
5#include <linux/sched.h> 1#include <linux/sched.h>
6#include <linux/kernel.h> 2#include <linux/kernel.h>
7#include <linux/errno.h> 3#include <linux/errno.h>
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 1bae9c855ceb..fb43d89f46f3 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -32,6 +32,10 @@ static struct bootnode nodes_add[MAX_NUMNODES];
32static int found_add_area __initdata; 32static int found_add_area __initdata;
33int hotadd_percent __initdata = 0; 33int hotadd_percent __initdata = 0;
34 34
35static int num_node_memblks __initdata;
36static struct bootnode node_memblk_range[NR_NODE_MEMBLKS] __initdata;
37static int memblk_nodeid[NR_NODE_MEMBLKS] __initdata;
38
35/* Too small nodes confuse the VM badly. Usually they result 39/* Too small nodes confuse the VM badly. Usually they result
36 from BIOS bugs. */ 40 from BIOS bugs. */
37#define NODE_MIN_SIZE (4*1024*1024) 41#define NODE_MIN_SIZE (4*1024*1024)
@@ -41,17 +45,17 @@ static __init int setup_node(int pxm)
41 return acpi_map_pxm_to_node(pxm); 45 return acpi_map_pxm_to_node(pxm);
42} 46}
43 47
44static __init int conflicting_nodes(unsigned long start, unsigned long end) 48static __init int conflicting_memblks(unsigned long start, unsigned long end)
45{ 49{
46 int i; 50 int i;
47 for_each_node_mask(i, nodes_parsed) { 51 for (i = 0; i < num_node_memblks; i++) {
48 struct bootnode *nd = &nodes[i]; 52 struct bootnode *nd = &node_memblk_range[i];
49 if (nd->start == nd->end) 53 if (nd->start == nd->end)
50 continue; 54 continue;
51 if (nd->end > start && nd->start < end) 55 if (nd->end > start && nd->start < end)
52 return i; 56 return memblk_nodeid[i];
53 if (nd->end == end && nd->start == start) 57 if (nd->end == end && nd->start == start)
54 return i; 58 return memblk_nodeid[i];
55 } 59 }
56 return -1; 60 return -1;
57} 61}
@@ -258,7 +262,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
258 bad_srat(); 262 bad_srat();
259 return; 263 return;
260 } 264 }
261 i = conflicting_nodes(start, end); 265 i = conflicting_memblks(start, end);
262 if (i == node) { 266 if (i == node) {
263 printk(KERN_WARNING 267 printk(KERN_WARNING
264 "SRAT: Warning: PXM %d (%lx-%lx) overlaps with itself (%Lx-%Lx)\n", 268 "SRAT: Warning: PXM %d (%lx-%lx) overlaps with itself (%Lx-%Lx)\n",
@@ -283,10 +287,10 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
283 nd->end = end; 287 nd->end = end;
284 } 288 }
285 289
286 printk(KERN_INFO "SRAT: Node %u PXM %u %Lx-%Lx\n", node, pxm, 290 printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm,
287 nd->start, nd->end); 291 start, end);
288 e820_register_active_regions(node, nd->start >> PAGE_SHIFT, 292 e820_register_active_regions(node, start >> PAGE_SHIFT,
289 nd->end >> PAGE_SHIFT); 293 end >> PAGE_SHIFT);
290 push_node_boundaries(node, nd->start >> PAGE_SHIFT, 294 push_node_boundaries(node, nd->start >> PAGE_SHIFT,
291 nd->end >> PAGE_SHIFT); 295 nd->end >> PAGE_SHIFT);
292 296
@@ -298,6 +302,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
298 if ((nd->start | nd->end) == 0) 302 if ((nd->start | nd->end) == 0)
299 node_clear(node, nodes_parsed); 303 node_clear(node, nodes_parsed);
300 } 304 }
305
306 node_memblk_range[num_node_memblks].start = start;
307 node_memblk_range[num_node_memblks].end = end;
308 memblk_nodeid[num_node_memblks] = node;
309 num_node_memblks++;
301} 310}
302 311
303/* Sanity check to catch more bad SRATs (they are amazingly common). 312/* Sanity check to catch more bad SRATs (they are amazingly common).
@@ -368,7 +377,8 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
368 return -1; 377 return -1;
369 } 378 }
370 379
371 memnode_shift = compute_hash_shift(nodes, MAX_NUMNODES); 380 memnode_shift = compute_hash_shift(node_memblk_range, num_node_memblks,
381 memblk_nodeid);
372 if (memnode_shift < 0) { 382 if (memnode_shift < 0) {
373 printk(KERN_ERR 383 printk(KERN_ERR
374 "SRAT: No NUMA node hash function found. Contact maintainer\n"); 384 "SRAT: No NUMA node hash function found. Contact maintainer\n");
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 17a6b057856b..b7ad9f89d21f 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -37,7 +37,8 @@ $(obj)/%.so: OBJCOPYFLAGS := -S
37$(obj)/%.so: $(obj)/%.so.dbg FORCE 37$(obj)/%.so: $(obj)/%.so.dbg FORCE
38 $(call if_changed,objcopy) 38 $(call if_changed,objcopy)
39 39
40CFL := $(PROFILING) -mcmodel=small -fPIC -g0 -O2 -fasynchronous-unwind-tables -m64 40CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
41 $(filter -g%,$(KBUILD_CFLAGS))
41 42
42$(vobjs): KBUILD_CFLAGS += $(CFL) 43$(vobjs): KBUILD_CFLAGS += $(CFL)
43 44
diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/fbdev.c
index 48fb38d7d2c0..4db42bff8c60 100644
--- a/arch/x86/video/fbdev.c
+++ b/arch/x86/video/fbdev.c
@@ -1,5 +1,4 @@
1/* 1/*
2 * arch/i386/video/fbdev.c - i386 Framebuffer
3 * 2 *
4 * Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com> 3 * Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com>
5 * 4 *