diff options
Diffstat (limited to 'arch')
125 files changed, 1026 insertions, 841 deletions
diff --git a/arch/arm/boot/dts/highbank.dts b/arch/arm/boot/dts/highbank.dts index aeb1a7578fad..305635bd45c0 100644 --- a/arch/arm/boot/dts/highbank.dts +++ b/arch/arm/boot/dts/highbank.dts | |||
@@ -194,5 +194,17 @@ | |||
194 | reg = <0xfff3d000 0x1000>; | 194 | reg = <0xfff3d000 0x1000>; |
195 | interrupts = <0 92 4>; | 195 | interrupts = <0 92 4>; |
196 | }; | 196 | }; |
197 | |||
198 | ethernet@fff50000 { | ||
199 | compatible = "calxeda,hb-xgmac"; | ||
200 | reg = <0xfff50000 0x1000>; | ||
201 | interrupts = <0 77 4 0 78 4 0 79 4>; | ||
202 | }; | ||
203 | |||
204 | ethernet@fff51000 { | ||
205 | compatible = "calxeda,hb-xgmac"; | ||
206 | reg = <0xfff51000 0x1000>; | ||
207 | interrupts = <0 80 4 0 81 4 0 82 4>; | ||
208 | }; | ||
197 | }; | 209 | }; |
198 | }; | 210 | }; |
diff --git a/arch/arm/configs/omap1_defconfig b/arch/arm/configs/omap1_defconfig index a7e777581378..dde2a1af7b39 100644 --- a/arch/arm/configs/omap1_defconfig +++ b/arch/arm/configs/omap1_defconfig | |||
@@ -48,12 +48,6 @@ CONFIG_MACH_SX1=y | |||
48 | CONFIG_MACH_NOKIA770=y | 48 | CONFIG_MACH_NOKIA770=y |
49 | CONFIG_MACH_AMS_DELTA=y | 49 | CONFIG_MACH_AMS_DELTA=y |
50 | CONFIG_MACH_OMAP_GENERIC=y | 50 | CONFIG_MACH_OMAP_GENERIC=y |
51 | CONFIG_OMAP_ARM_216MHZ=y | ||
52 | CONFIG_OMAP_ARM_195MHZ=y | ||
53 | CONFIG_OMAP_ARM_192MHZ=y | ||
54 | CONFIG_OMAP_ARM_182MHZ=y | ||
55 | CONFIG_OMAP_ARM_168MHZ=y | ||
56 | # CONFIG_OMAP_ARM_60MHZ is not set | ||
57 | # CONFIG_ARM_THUMB is not set | 51 | # CONFIG_ARM_THUMB is not set |
58 | CONFIG_PCCARD=y | 52 | CONFIG_PCCARD=y |
59 | CONFIG_OMAP_CF=y | 53 | CONFIG_OMAP_CF=y |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 172101ac97de..a4f192cc51b2 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -346,15 +346,15 @@ validate_group(struct perf_event *event) | |||
346 | fake_pmu.used_mask = fake_used_mask; | 346 | fake_pmu.used_mask = fake_used_mask; |
347 | 347 | ||
348 | if (!validate_event(&fake_pmu, leader)) | 348 | if (!validate_event(&fake_pmu, leader)) |
349 | return -ENOSPC; | 349 | return -EINVAL; |
350 | 350 | ||
351 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { | 351 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { |
352 | if (!validate_event(&fake_pmu, sibling)) | 352 | if (!validate_event(&fake_pmu, sibling)) |
353 | return -ENOSPC; | 353 | return -EINVAL; |
354 | } | 354 | } |
355 | 355 | ||
356 | if (!validate_event(&fake_pmu, event)) | 356 | if (!validate_event(&fake_pmu, event)) |
357 | return -ENOSPC; | 357 | return -EINVAL; |
358 | 358 | ||
359 | return 0; | 359 | return 0; |
360 | } | 360 | } |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 66591fa53e05..ad930688358c 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -83,7 +83,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | |||
83 | * USB Device (Gadget) | 83 | * USB Device (Gadget) |
84 | * -------------------------------------------------------------------- */ | 84 | * -------------------------------------------------------------------- */ |
85 | 85 | ||
86 | #ifdef CONFIG_USB_GADGET_AT91 | 86 | #ifdef CONFIG_USB_AT91 |
87 | static struct at91_udc_data udc_data; | 87 | static struct at91_udc_data udc_data; |
88 | 88 | ||
89 | static struct resource udc_resources[] = { | 89 | static struct resource udc_resources[] = { |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index b84a9f642f59..0d20677fbef0 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -195,9 +195,9 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), | 195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), |
196 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), | 196 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), |
197 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), | 197 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), |
198 | CLKDEV_CON_DEV_ID("t3_clk", "atmel_tcb.1", &tc3_clk), | 198 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk), |
199 | CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk), | 199 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), |
200 | CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk), | 200 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), |
201 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), | 201 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), |
202 | /* more usart lookup table for DT entries */ | 202 | /* more usart lookup table for DT entries */ |
203 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), | 203 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 25e3464fb07f..629fa9774972 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -84,7 +84,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | |||
84 | * USB Device (Gadget) | 84 | * USB Device (Gadget) |
85 | * -------------------------------------------------------------------- */ | 85 | * -------------------------------------------------------------------- */ |
86 | 86 | ||
87 | #ifdef CONFIG_USB_GADGET_AT91 | 87 | #ifdef CONFIG_USB_AT91 |
88 | static struct at91_udc_data udc_data; | 88 | static struct at91_udc_data udc_data; |
89 | 89 | ||
90 | static struct resource udc_resources[] = { | 90 | static struct resource udc_resources[] = { |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index ae78f4d03b73..a178b58b0b9c 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -87,7 +87,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | |||
87 | * USB Device (Gadget) | 87 | * USB Device (Gadget) |
88 | * -------------------------------------------------------------------- */ | 88 | * -------------------------------------------------------------------- */ |
89 | 89 | ||
90 | #ifdef CONFIG_USB_GADGET_AT91 | 90 | #ifdef CONFIG_USB_AT91 |
91 | static struct at91_udc_data udc_data; | 91 | static struct at91_udc_data udc_data; |
92 | 92 | ||
93 | static struct resource udc_resources[] = { | 93 | static struct resource udc_resources[] = { |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index ad017eb1f8df..d5fbac9ff4fa 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -92,7 +92,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | |||
92 | * USB Device (Gadget) | 92 | * USB Device (Gadget) |
93 | * -------------------------------------------------------------------- */ | 93 | * -------------------------------------------------------------------- */ |
94 | 94 | ||
95 | #ifdef CONFIG_USB_GADGET_AT91 | 95 | #ifdef CONFIG_USB_AT91 |
96 | static struct at91_udc_data udc_data; | 96 | static struct at91_udc_data udc_data; |
97 | 97 | ||
98 | static struct resource udc_resources[] = { | 98 | static struct resource udc_resources[] = { |
diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h index 8f4866045b41..ec164a4124c9 100644 --- a/arch/arm/mach-at91/include/mach/system_rev.h +++ b/arch/arm/mach-at91/include/mach/system_rev.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #define BOARD_HAVE_NAND_16BIT (1 << 31) | 19 | #define BOARD_HAVE_NAND_16BIT (1 << 31) |
20 | static inline int board_have_nand_16bit(void) | 20 | static inline int board_have_nand_16bit(void) |
21 | { | 21 | { |
22 | return system_rev & BOARD_HAVE_NAND_16BIT; | 22 | return (system_rev & BOARD_HAVE_NAND_16BIT) ? 1 : 0; |
23 | } | 23 | } |
24 | 24 | ||
25 | #endif /* __ARCH_SYSTEM_REV_H__ */ | 25 | #endif /* __ARCH_SYSTEM_REV_H__ */ |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 1d7d24995226..6659a90dbcad 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -753,7 +753,7 @@ static struct snd_platform_data da850_evm_snd_data = { | |||
753 | .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), | 753 | .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction), |
754 | .tdm_slots = 2, | 754 | .tdm_slots = 2, |
755 | .serial_dir = da850_iis_serializer_direction, | 755 | .serial_dir = da850_iis_serializer_direction, |
756 | .asp_chan_q = EVENTQ_1, | 756 | .asp_chan_q = EVENTQ_0, |
757 | .version = MCASP_VERSION_2, | 757 | .version = MCASP_VERSION_2, |
758 | .txnumevt = 1, | 758 | .txnumevt = 1, |
759 | .rxnumevt = 1, | 759 | .rxnumevt = 1, |
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 1918ae711428..46e1f4173b97 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -107,7 +107,7 @@ static struct mtd_partition davinci_nand_partitions[] = { | |||
107 | /* UBL (a few copies) plus U-Boot */ | 107 | /* UBL (a few copies) plus U-Boot */ |
108 | .name = "bootloader", | 108 | .name = "bootloader", |
109 | .offset = 0, | 109 | .offset = 0, |
110 | .size = 28 * NAND_BLOCK_SIZE, | 110 | .size = 30 * NAND_BLOCK_SIZE, |
111 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | 111 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
112 | }, { | 112 | }, { |
113 | /* U-Boot environment */ | 113 | /* U-Boot environment */ |
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index e574d7f837a8..635bf7740157 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
@@ -564,7 +564,7 @@ static int setup_vpif_input_channel_mode(int mux_mode) | |||
564 | int val; | 564 | int val; |
565 | u32 value; | 565 | u32 value; |
566 | 566 | ||
567 | if (!vpif_vsclkdis_reg || !cpld_client) | 567 | if (!vpif_vidclkctl_reg || !cpld_client) |
568 | return -ENXIO; | 568 | return -ENXIO; |
569 | 569 | ||
570 | val = i2c_smbus_read_byte(cpld_client); | 570 | val = i2c_smbus_read_byte(cpld_client); |
@@ -572,7 +572,7 @@ static int setup_vpif_input_channel_mode(int mux_mode) | |||
572 | return val; | 572 | return val; |
573 | 573 | ||
574 | spin_lock_irqsave(&vpif_reg_lock, flags); | 574 | spin_lock_irqsave(&vpif_reg_lock, flags); |
575 | value = __raw_readl(vpif_vsclkdis_reg); | 575 | value = __raw_readl(vpif_vidclkctl_reg); |
576 | if (mux_mode) { | 576 | if (mux_mode) { |
577 | val &= VPIF_INPUT_TWO_CHANNEL; | 577 | val &= VPIF_INPUT_TWO_CHANNEL; |
578 | value |= VIDCH1CLK; | 578 | value |= VIDCH1CLK; |
@@ -580,7 +580,7 @@ static int setup_vpif_input_channel_mode(int mux_mode) | |||
580 | val |= VPIF_INPUT_ONE_CHANNEL; | 580 | val |= VPIF_INPUT_ONE_CHANNEL; |
581 | value &= ~VIDCH1CLK; | 581 | value &= ~VIDCH1CLK; |
582 | } | 582 | } |
583 | __raw_writel(value, vpif_vsclkdis_reg); | 583 | __raw_writel(value, vpif_vidclkctl_reg); |
584 | spin_unlock_irqrestore(&vpif_reg_lock, flags); | 584 | spin_unlock_irqrestore(&vpif_reg_lock, flags); |
585 | 585 | ||
586 | err = i2c_smbus_write_byte(cpld_client, val); | 586 | err = i2c_smbus_write_byte(cpld_client, val); |
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index 00861139101d..008772e3b843 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c | |||
@@ -31,19 +31,12 @@ static LIST_HEAD(clocks); | |||
31 | static DEFINE_MUTEX(clocks_mutex); | 31 | static DEFINE_MUTEX(clocks_mutex); |
32 | static DEFINE_SPINLOCK(clockfw_lock); | 32 | static DEFINE_SPINLOCK(clockfw_lock); |
33 | 33 | ||
34 | static unsigned psc_domain(struct clk *clk) | ||
35 | { | ||
36 | return (clk->flags & PSC_DSP) | ||
37 | ? DAVINCI_GPSC_DSPDOMAIN | ||
38 | : DAVINCI_GPSC_ARMDOMAIN; | ||
39 | } | ||
40 | |||
41 | static void __clk_enable(struct clk *clk) | 34 | static void __clk_enable(struct clk *clk) |
42 | { | 35 | { |
43 | if (clk->parent) | 36 | if (clk->parent) |
44 | __clk_enable(clk->parent); | 37 | __clk_enable(clk->parent); |
45 | if (clk->usecount++ == 0 && (clk->flags & CLK_PSC)) | 38 | if (clk->usecount++ == 0 && (clk->flags & CLK_PSC)) |
46 | davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, | 39 | davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, |
47 | true, clk->flags); | 40 | true, clk->flags); |
48 | } | 41 | } |
49 | 42 | ||
@@ -53,7 +46,7 @@ static void __clk_disable(struct clk *clk) | |||
53 | return; | 46 | return; |
54 | if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) && | 47 | if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) && |
55 | (clk->flags & CLK_PSC)) | 48 | (clk->flags & CLK_PSC)) |
56 | davinci_psc_config(psc_domain(clk), clk->gpsc, clk->lpsc, | 49 | davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, |
57 | false, clk->flags); | 50 | false, clk->flags); |
58 | if (clk->parent) | 51 | if (clk->parent) |
59 | __clk_disable(clk->parent); | 52 | __clk_disable(clk->parent); |
@@ -237,7 +230,7 @@ static int __init clk_disable_unused(void) | |||
237 | 230 | ||
238 | pr_debug("Clocks: disable unused %s\n", ck->name); | 231 | pr_debug("Clocks: disable unused %s\n", ck->name); |
239 | 232 | ||
240 | davinci_psc_config(psc_domain(ck), ck->gpsc, ck->lpsc, | 233 | davinci_psc_config(ck->domain, ck->gpsc, ck->lpsc, |
241 | false, ck->flags); | 234 | false, ck->flags); |
242 | } | 235 | } |
243 | spin_unlock_irq(&clockfw_lock); | 236 | spin_unlock_irq(&clockfw_lock); |
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h index a705f367a84d..46f0f1bf1a4c 100644 --- a/arch/arm/mach-davinci/clock.h +++ b/arch/arm/mach-davinci/clock.h | |||
@@ -93,6 +93,7 @@ struct clk { | |||
93 | u8 usecount; | 93 | u8 usecount; |
94 | u8 lpsc; | 94 | u8 lpsc; |
95 | u8 gpsc; | 95 | u8 gpsc; |
96 | u8 domain; | ||
96 | u32 flags; | 97 | u32 flags; |
97 | struct clk *parent; | 98 | struct clk *parent; |
98 | struct list_head children; /* list of children */ | 99 | struct list_head children; /* list of children */ |
@@ -107,11 +108,10 @@ struct clk { | |||
107 | /* Clock flags: SoC-specific flags start at BIT(16) */ | 108 | /* Clock flags: SoC-specific flags start at BIT(16) */ |
108 | #define ALWAYS_ENABLED BIT(1) | 109 | #define ALWAYS_ENABLED BIT(1) |
109 | #define CLK_PSC BIT(2) | 110 | #define CLK_PSC BIT(2) |
110 | #define PSC_DSP BIT(3) /* PSC uses DSP domain, not ARM */ | 111 | #define CLK_PLL BIT(3) /* PLL-derived clock */ |
111 | #define CLK_PLL BIT(4) /* PLL-derived clock */ | 112 | #define PRE_PLL BIT(4) /* source is before PLL mult/div */ |
112 | #define PRE_PLL BIT(5) /* source is before PLL mult/div */ | 113 | #define PSC_SWRSTDISABLE BIT(5) /* Disable state is SwRstDisable */ |
113 | #define PSC_SWRSTDISABLE BIT(6) /* Disable state is SwRstDisable */ | 114 | #define PSC_FORCE BIT(6) /* Force module state transtition */ |
114 | #define PSC_FORCE BIT(7) /* Force module state transtition */ | ||
115 | 115 | ||
116 | #define CLK(dev, con, ck) \ | 116 | #define CLK(dev, con, ck) \ |
117 | { \ | 117 | { \ |
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 3470983aa343..b95097dbdfed 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -130,7 +130,7 @@ static struct clk dsp_clk = { | |||
130 | .name = "dsp", | 130 | .name = "dsp", |
131 | .parent = &pll1_sysclk1, | 131 | .parent = &pll1_sysclk1, |
132 | .lpsc = DAVINCI_LPSC_GEM, | 132 | .lpsc = DAVINCI_LPSC_GEM, |
133 | .flags = PSC_DSP, | 133 | .domain = DAVINCI_GPSC_DSPDOMAIN, |
134 | .usecount = 1, /* REVISIT how to disable? */ | 134 | .usecount = 1, /* REVISIT how to disable? */ |
135 | }; | 135 | }; |
136 | 136 | ||
@@ -145,7 +145,7 @@ static struct clk vicp_clk = { | |||
145 | .name = "vicp", | 145 | .name = "vicp", |
146 | .parent = &pll1_sysclk2, | 146 | .parent = &pll1_sysclk2, |
147 | .lpsc = DAVINCI_LPSC_IMCOP, | 147 | .lpsc = DAVINCI_LPSC_IMCOP, |
148 | .flags = PSC_DSP, | 148 | .domain = DAVINCI_GPSC_DSPDOMAIN, |
149 | .usecount = 1, /* REVISIT how to disable? */ | 149 | .usecount = 1, /* REVISIT how to disable? */ |
150 | }; | 150 | }; |
151 | 151 | ||
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 0b68ed534f8e..af27c130595f 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c | |||
@@ -161,7 +161,6 @@ static struct clk dsp_clk = { | |||
161 | .name = "dsp", | 161 | .name = "dsp", |
162 | .parent = &pll1_sysclk1, | 162 | .parent = &pll1_sysclk1, |
163 | .lpsc = DM646X_LPSC_C64X_CPU, | 163 | .lpsc = DM646X_LPSC_C64X_CPU, |
164 | .flags = PSC_DSP, | ||
165 | .usecount = 1, /* REVISIT how to disable? */ | 164 | .usecount = 1, /* REVISIT how to disable? */ |
166 | }; | 165 | }; |
167 | 166 | ||
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h index fa59c097223d..8bc3fc256171 100644 --- a/arch/arm/mach-davinci/include/mach/psc.h +++ b/arch/arm/mach-davinci/include/mach/psc.h | |||
@@ -233,7 +233,7 @@ | |||
233 | #define PTCMD 0x120 | 233 | #define PTCMD 0x120 |
234 | #define PTSTAT 0x128 | 234 | #define PTSTAT 0x128 |
235 | #define PDSTAT 0x200 | 235 | #define PDSTAT 0x200 |
236 | #define PDCTL1 0x304 | 236 | #define PDCTL 0x300 |
237 | #define MDSTAT 0x800 | 237 | #define MDSTAT 0x800 |
238 | #define MDCTL 0xA00 | 238 | #define MDCTL 0xA00 |
239 | 239 | ||
@@ -244,7 +244,10 @@ | |||
244 | #define PSC_STATE_ENABLE 3 | 244 | #define PSC_STATE_ENABLE 3 |
245 | 245 | ||
246 | #define MDSTAT_STATE_MASK 0x3f | 246 | #define MDSTAT_STATE_MASK 0x3f |
247 | #define PDSTAT_STATE_MASK 0x1f | ||
247 | #define MDCTL_FORCE BIT(31) | 248 | #define MDCTL_FORCE BIT(31) |
249 | #define PDCTL_NEXT BIT(1) | ||
250 | #define PDCTL_EPCGOOD BIT(8) | ||
248 | 251 | ||
249 | #ifndef __ASSEMBLER__ | 252 | #ifndef __ASSEMBLER__ |
250 | 253 | ||
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index 1fb6bdff38c1..d7e210f4b55c 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c | |||
@@ -52,7 +52,7 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id) | |||
52 | void davinci_psc_config(unsigned int domain, unsigned int ctlr, | 52 | void davinci_psc_config(unsigned int domain, unsigned int ctlr, |
53 | unsigned int id, bool enable, u32 flags) | 53 | unsigned int id, bool enable, u32 flags) |
54 | { | 54 | { |
55 | u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl; | 55 | u32 epcpr, ptcmd, ptstat, pdstat, pdctl, mdstat, mdctl; |
56 | void __iomem *psc_base; | 56 | void __iomem *psc_base; |
57 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 57 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
58 | u32 next_state = PSC_STATE_ENABLE; | 58 | u32 next_state = PSC_STATE_ENABLE; |
@@ -79,11 +79,11 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, | |||
79 | mdctl |= MDCTL_FORCE; | 79 | mdctl |= MDCTL_FORCE; |
80 | __raw_writel(mdctl, psc_base + MDCTL + 4 * id); | 80 | __raw_writel(mdctl, psc_base + MDCTL + 4 * id); |
81 | 81 | ||
82 | pdstat = __raw_readl(psc_base + PDSTAT); | 82 | pdstat = __raw_readl(psc_base + PDSTAT + 4 * domain); |
83 | if ((pdstat & 0x00000001) == 0) { | 83 | if ((pdstat & PDSTAT_STATE_MASK) == 0) { |
84 | pdctl1 = __raw_readl(psc_base + PDCTL1); | 84 | pdctl = __raw_readl(psc_base + PDCTL + 4 * domain); |
85 | pdctl1 |= 0x1; | 85 | pdctl |= PDCTL_NEXT; |
86 | __raw_writel(pdctl1, psc_base + PDCTL1); | 86 | __raw_writel(pdctl, psc_base + PDCTL + 4 * domain); |
87 | 87 | ||
88 | ptcmd = 1 << domain; | 88 | ptcmd = 1 << domain; |
89 | __raw_writel(ptcmd, psc_base + PTCMD); | 89 | __raw_writel(ptcmd, psc_base + PTCMD); |
@@ -92,9 +92,9 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, | |||
92 | epcpr = __raw_readl(psc_base + EPCPR); | 92 | epcpr = __raw_readl(psc_base + EPCPR); |
93 | } while ((((epcpr >> domain) & 1) == 0)); | 93 | } while ((((epcpr >> domain) & 1) == 0)); |
94 | 94 | ||
95 | pdctl1 = __raw_readl(psc_base + PDCTL1); | 95 | pdctl = __raw_readl(psc_base + PDCTL + 4 * domain); |
96 | pdctl1 |= 0x100; | 96 | pdctl |= PDCTL_EPCGOOD; |
97 | __raw_writel(pdctl1, psc_base + PDCTL1); | 97 | __raw_writel(pdctl, psc_base + PDCTL + 4 * domain); |
98 | } else { | 98 | } else { |
99 | ptcmd = 1 << domain; | 99 | ptcmd = 1 << domain; |
100 | __raw_writel(ptcmd, psc_base + PTCMD); | 100 | __raw_writel(ptcmd, psc_base + PTCMD); |
diff --git a/arch/arm/mach-dove/addr-map.c b/arch/arm/mach-dove/addr-map.c index 00be4fc26dd7..98b8c83b09ab 100644 --- a/arch/arm/mach-dove/addr-map.c +++ b/arch/arm/mach-dove/addr-map.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <asm/mach/arch.h> | 15 | #include <asm/mach/arch.h> |
16 | #include <asm/setup.h> | 16 | #include <asm/setup.h> |
17 | #include <plat/addr-map.h> | ||
17 | #include "common.h" | 18 | #include "common.h" |
18 | 19 | ||
19 | /* | 20 | /* |
@@ -34,98 +35,72 @@ | |||
34 | #define ATTR_PCIE_MEM 0xe8 | 35 | #define ATTR_PCIE_MEM 0xe8 |
35 | #define ATTR_SCRATCHPAD 0x0 | 36 | #define ATTR_SCRATCHPAD 0x0 |
36 | 37 | ||
37 | /* | ||
38 | * CPU Address Decode Windows registers | ||
39 | */ | ||
40 | #define WIN_CTRL(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x0) | ||
41 | #define WIN_BASE(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x4) | ||
42 | #define WIN_REMAP_LO(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x8) | ||
43 | #define WIN_REMAP_HI(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0xc) | ||
44 | |||
45 | struct mbus_dram_target_info dove_mbus_dram_info; | ||
46 | |||
47 | static inline void __iomem *ddr_map_sc(int i) | 38 | static inline void __iomem *ddr_map_sc(int i) |
48 | { | 39 | { |
49 | return (void __iomem *)(DOVE_MC_VIRT_BASE + 0x100 + ((i) << 4)); | 40 | return (void __iomem *)(DOVE_MC_VIRT_BASE + 0x100 + ((i) << 4)); |
50 | } | 41 | } |
51 | 42 | ||
52 | static int cpu_win_can_remap(int win) | 43 | /* |
53 | { | 44 | * Description of the windows needed by the platform code |
54 | if (win < 4) | 45 | */ |
55 | return 1; | 46 | static struct __initdata orion_addr_map_cfg addr_map_cfg = { |
56 | 47 | .num_wins = 8, | |
57 | return 0; | 48 | .remappable_wins = 4, |
58 | } | 49 | .bridge_virt_base = BRIDGE_VIRT_BASE, |
59 | 50 | }; | |
60 | static void __init setup_cpu_win(int win, u32 base, u32 size, | ||
61 | u8 target, u8 attr, int remap) | ||
62 | { | ||
63 | u32 ctrl; | ||
64 | |||
65 | base &= 0xffff0000; | ||
66 | ctrl = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1; | ||
67 | |||
68 | writel(base, WIN_BASE(win)); | ||
69 | writel(ctrl, WIN_CTRL(win)); | ||
70 | if (cpu_win_can_remap(win)) { | ||
71 | if (remap < 0) | ||
72 | remap = base; | ||
73 | writel(remap & 0xffff0000, WIN_REMAP_LO(win)); | ||
74 | writel(0, WIN_REMAP_HI(win)); | ||
75 | } | ||
76 | } | ||
77 | |||
78 | void __init dove_setup_cpu_mbus(void) | ||
79 | { | ||
80 | int i; | ||
81 | int cs; | ||
82 | 51 | ||
52 | static const struct __initdata orion_addr_map_info addr_map_info[] = { | ||
83 | /* | 53 | /* |
84 | * First, disable and clear windows. | 54 | * Windows for PCIe IO+MEM space. |
85 | */ | 55 | */ |
86 | for (i = 0; i < 8; i++) { | 56 | { 0, DOVE_PCIE0_IO_PHYS_BASE, DOVE_PCIE0_IO_SIZE, |
87 | writel(0, WIN_BASE(i)); | 57 | TARGET_PCIE0, ATTR_PCIE_IO, DOVE_PCIE0_IO_BUS_BASE |
88 | writel(0, WIN_CTRL(i)); | 58 | }, |
89 | if (cpu_win_can_remap(i)) { | 59 | { 1, DOVE_PCIE1_IO_PHYS_BASE, DOVE_PCIE1_IO_SIZE, |
90 | writel(0, WIN_REMAP_LO(i)); | 60 | TARGET_PCIE1, ATTR_PCIE_IO, DOVE_PCIE1_IO_BUS_BASE |
91 | writel(0, WIN_REMAP_HI(i)); | 61 | }, |
92 | } | 62 | { 2, DOVE_PCIE0_MEM_PHYS_BASE, DOVE_PCIE0_MEM_SIZE, |
93 | } | 63 | TARGET_PCIE0, ATTR_PCIE_MEM, -1 |
94 | 64 | }, | |
65 | { 3, DOVE_PCIE1_MEM_PHYS_BASE, DOVE_PCIE1_MEM_SIZE, | ||
66 | TARGET_PCIE1, ATTR_PCIE_MEM, -1 | ||
67 | }, | ||
95 | /* | 68 | /* |
96 | * Setup windows for PCIe IO+MEM space. | 69 | * Window for CESA engine. |
97 | */ | 70 | */ |
98 | setup_cpu_win(0, DOVE_PCIE0_IO_PHYS_BASE, DOVE_PCIE0_IO_SIZE, | 71 | { 4, DOVE_CESA_PHYS_BASE, DOVE_CESA_SIZE, |
99 | TARGET_PCIE0, ATTR_PCIE_IO, DOVE_PCIE0_IO_BUS_BASE); | 72 | TARGET_CESA, ATTR_CESA, -1 |
100 | setup_cpu_win(1, DOVE_PCIE1_IO_PHYS_BASE, DOVE_PCIE1_IO_SIZE, | 73 | }, |
101 | TARGET_PCIE1, ATTR_PCIE_IO, DOVE_PCIE1_IO_BUS_BASE); | ||
102 | setup_cpu_win(2, DOVE_PCIE0_MEM_PHYS_BASE, DOVE_PCIE0_MEM_SIZE, | ||
103 | TARGET_PCIE0, ATTR_PCIE_MEM, -1); | ||
104 | setup_cpu_win(3, DOVE_PCIE1_MEM_PHYS_BASE, DOVE_PCIE1_MEM_SIZE, | ||
105 | TARGET_PCIE1, ATTR_PCIE_MEM, -1); | ||
106 | |||
107 | /* | 74 | /* |
108 | * Setup window for CESA engine. | 75 | * Window to the BootROM for Standby and Sleep Resume |
109 | */ | 76 | */ |
110 | setup_cpu_win(4, DOVE_CESA_PHYS_BASE, DOVE_CESA_SIZE, | 77 | { 5, DOVE_BOOTROM_PHYS_BASE, DOVE_BOOTROM_SIZE, |
111 | TARGET_CESA, ATTR_CESA, -1); | 78 | TARGET_BOOTROM, ATTR_BOOTROM, -1 |
112 | 79 | }, | |
113 | /* | 80 | /* |
114 | * Setup the Window to the BootROM for Standby and Sleep Resume | 81 | * Window to the PMU Scratch Pad space |
115 | */ | 82 | */ |
116 | setup_cpu_win(5, DOVE_BOOTROM_PHYS_BASE, DOVE_BOOTROM_SIZE, | 83 | { 6, DOVE_SCRATCHPAD_PHYS_BASE, DOVE_SCRATCHPAD_SIZE, |
117 | TARGET_BOOTROM, ATTR_BOOTROM, -1); | 84 | TARGET_SCRATCHPAD, ATTR_SCRATCHPAD, -1 |
85 | }, | ||
86 | /* End marker */ | ||
87 | { -1, 0, 0, 0, 0, 0 } | ||
88 | }; | ||
89 | |||
90 | void __init dove_setup_cpu_mbus(void) | ||
91 | { | ||
92 | int i; | ||
93 | int cs; | ||
118 | 94 | ||
119 | /* | 95 | /* |
120 | * Setup the Window to the PMU Scratch Pad space | 96 | * Disable, clear and configure windows. |
121 | */ | 97 | */ |
122 | setup_cpu_win(6, DOVE_SCRATCHPAD_PHYS_BASE, DOVE_SCRATCHPAD_SIZE, | 98 | orion_config_wins(&addr_map_cfg, addr_map_info); |
123 | TARGET_SCRATCHPAD, ATTR_SCRATCHPAD, -1); | ||
124 | 99 | ||
125 | /* | 100 | /* |
126 | * Setup MBUS dram target info. | 101 | * Setup MBUS dram target info. |
127 | */ | 102 | */ |
128 | dove_mbus_dram_info.mbus_dram_target_id = TARGET_DDR; | 103 | orion_mbus_dram_info.mbus_dram_target_id = TARGET_DDR; |
129 | 104 | ||
130 | for (i = 0, cs = 0; i < 2; i++) { | 105 | for (i = 0, cs = 0; i < 2; i++) { |
131 | u32 map = readl(ddr_map_sc(i)); | 106 | u32 map = readl(ddr_map_sc(i)); |
@@ -136,7 +111,7 @@ void __init dove_setup_cpu_mbus(void) | |||
136 | if (map & 1) { | 111 | if (map & 1) { |
137 | struct mbus_dram_window *w; | 112 | struct mbus_dram_window *w; |
138 | 113 | ||
139 | w = &dove_mbus_dram_info.cs[cs++]; | 114 | w = &orion_mbus_dram_info.cs[cs++]; |
140 | w->cs_index = i; | 115 | w->cs_index = i; |
141 | w->mbus_attr = 0; /* CS address decoding done inside */ | 116 | w->mbus_attr = 0; /* CS address decoding done inside */ |
142 | /* the DDR controller, no need to */ | 117 | /* the DDR controller, no need to */ |
@@ -145,5 +120,5 @@ void __init dove_setup_cpu_mbus(void) | |||
145 | w->size = 0x100000 << (((map & 0x000f0000) >> 16) - 4); | 120 | w->size = 0x100000 << (((map & 0x000f0000) >> 16) - 4); |
146 | } | 121 | } |
147 | } | 122 | } |
148 | dove_mbus_dram_info.num_cs = cs; | 123 | orion_mbus_dram_info.num_cs = cs; |
149 | } | 124 | } |
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index a9e0dae86a26..29ff0d076f0a 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |
16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
17 | #include <linux/mbus.h> | ||
18 | #include <linux/ata_platform.h> | 17 | #include <linux/ata_platform.h> |
19 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
20 | #include <asm/page.h> | 19 | #include <asm/page.h> |
@@ -30,6 +29,7 @@ | |||
30 | #include <linux/irq.h> | 29 | #include <linux/irq.h> |
31 | #include <plat/time.h> | 30 | #include <plat/time.h> |
32 | #include <plat/common.h> | 31 | #include <plat/common.h> |
32 | #include <plat/addr-map.h> | ||
33 | #include "common.h" | 33 | #include "common.h" |
34 | 34 | ||
35 | static int get_tclk(void); | 35 | static int get_tclk(void); |
@@ -71,8 +71,7 @@ void __init dove_map_io(void) | |||
71 | ****************************************************************************/ | 71 | ****************************************************************************/ |
72 | void __init dove_ehci0_init(void) | 72 | void __init dove_ehci0_init(void) |
73 | { | 73 | { |
74 | orion_ehci_init(&dove_mbus_dram_info, | 74 | orion_ehci_init(DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0); |
75 | DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0); | ||
76 | } | 75 | } |
77 | 76 | ||
78 | /***************************************************************************** | 77 | /***************************************************************************** |
@@ -80,8 +79,7 @@ void __init dove_ehci0_init(void) | |||
80 | ****************************************************************************/ | 79 | ****************************************************************************/ |
81 | void __init dove_ehci1_init(void) | 80 | void __init dove_ehci1_init(void) |
82 | { | 81 | { |
83 | orion_ehci_1_init(&dove_mbus_dram_info, | 82 | orion_ehci_1_init(DOVE_USB1_PHYS_BASE, IRQ_DOVE_USB1); |
84 | DOVE_USB1_PHYS_BASE, IRQ_DOVE_USB1); | ||
85 | } | 83 | } |
86 | 84 | ||
87 | /***************************************************************************** | 85 | /***************************************************************************** |
@@ -89,7 +87,7 @@ void __init dove_ehci1_init(void) | |||
89 | ****************************************************************************/ | 87 | ****************************************************************************/ |
90 | void __init dove_ge00_init(struct mv643xx_eth_platform_data *eth_data) | 88 | void __init dove_ge00_init(struct mv643xx_eth_platform_data *eth_data) |
91 | { | 89 | { |
92 | orion_ge00_init(eth_data, &dove_mbus_dram_info, | 90 | orion_ge00_init(eth_data, |
93 | DOVE_GE00_PHYS_BASE, IRQ_DOVE_GE00_SUM, | 91 | DOVE_GE00_PHYS_BASE, IRQ_DOVE_GE00_SUM, |
94 | 0, get_tclk()); | 92 | 0, get_tclk()); |
95 | } | 93 | } |
@@ -107,8 +105,7 @@ void __init dove_rtc_init(void) | |||
107 | ****************************************************************************/ | 105 | ****************************************************************************/ |
108 | void __init dove_sata_init(struct mv_sata_platform_data *sata_data) | 106 | void __init dove_sata_init(struct mv_sata_platform_data *sata_data) |
109 | { | 107 | { |
110 | orion_sata_init(sata_data, &dove_mbus_dram_info, | 108 | orion_sata_init(sata_data, DOVE_SATA_PHYS_BASE, IRQ_DOVE_SATA); |
111 | DOVE_SATA_PHYS_BASE, IRQ_DOVE_SATA); | ||
112 | 109 | ||
113 | } | 110 | } |
114 | 111 | ||
@@ -198,8 +195,7 @@ struct sys_timer dove_timer = { | |||
198 | ****************************************************************************/ | 195 | ****************************************************************************/ |
199 | void __init dove_xor0_init(void) | 196 | void __init dove_xor0_init(void) |
200 | { | 197 | { |
201 | orion_xor0_init(&dove_mbus_dram_info, | 198 | orion_xor0_init(DOVE_XOR0_PHYS_BASE, DOVE_XOR0_HIGH_PHYS_BASE, |
202 | DOVE_XOR0_PHYS_BASE, DOVE_XOR0_HIGH_PHYS_BASE, | ||
203 | IRQ_DOVE_XOR_00, IRQ_DOVE_XOR_01); | 199 | IRQ_DOVE_XOR_00, IRQ_DOVE_XOR_01); |
204 | } | 200 | } |
205 | 201 | ||
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h index 6a2046e44706..7322371d3908 100644 --- a/arch/arm/mach-dove/common.h +++ b/arch/arm/mach-dove/common.h | |||
@@ -15,7 +15,6 @@ struct mv643xx_eth_platform_data; | |||
15 | struct mv_sata_platform_data; | 15 | struct mv_sata_platform_data; |
16 | 16 | ||
17 | extern struct sys_timer dove_timer; | 17 | extern struct sys_timer dove_timer; |
18 | extern struct mbus_dram_target_info dove_mbus_dram_info; | ||
19 | 18 | ||
20 | /* | 19 | /* |
21 | * Basic Dove init functions used early by machine-setup. | 20 | * Basic Dove init functions used early by machine-setup. |
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c index aa2b3a09a51d..6c11a4df7178 100644 --- a/arch/arm/mach-dove/pcie.c +++ b/arch/arm/mach-dove/pcie.c | |||
@@ -10,7 +10,6 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/mbus.h> | ||
14 | #include <video/vga.h> | 13 | #include <video/vga.h> |
15 | #include <asm/mach/pci.h> | 14 | #include <asm/mach/pci.h> |
16 | #include <asm/mach/arch.h> | 15 | #include <asm/mach/arch.h> |
@@ -19,6 +18,7 @@ | |||
19 | #include <plat/pcie.h> | 18 | #include <plat/pcie.h> |
20 | #include <mach/irqs.h> | 19 | #include <mach/irqs.h> |
21 | #include <mach/bridge-regs.h> | 20 | #include <mach/bridge-regs.h> |
21 | #include <plat/addr-map.h> | ||
22 | #include "common.h" | 22 | #include "common.h" |
23 | 23 | ||
24 | struct pcie_port { | 24 | struct pcie_port { |
@@ -50,7 +50,7 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) | |||
50 | */ | 50 | */ |
51 | orion_pcie_set_local_bus_nr(pp->base, sys->busnr); | 51 | orion_pcie_set_local_bus_nr(pp->base, sys->busnr); |
52 | 52 | ||
53 | orion_pcie_setup(pp->base, &dove_mbus_dram_info); | 53 | orion_pcie_setup(pp->base); |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * IORESOURCE_IO | 56 | * IORESOURCE_IO |
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 9cd860a27af5..8deb012189b5 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -37,14 +37,15 @@ static void __init imx6q_map_io(void) | |||
37 | imx6q_clock_map_io(); | 37 | imx6q_clock_map_io(); |
38 | } | 38 | } |
39 | 39 | ||
40 | static void __init imx6q_gpio_add_irq_domain(struct device_node *np, | 40 | static int __init imx6q_gpio_add_irq_domain(struct device_node *np, |
41 | struct device_node *interrupt_parent) | 41 | struct device_node *interrupt_parent) |
42 | { | 42 | { |
43 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - | 43 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; |
44 | 32 * 7; /* imx6q gets 7 gpio ports */ | ||
45 | 44 | ||
45 | gpio_irq_base -= 32; | ||
46 | irq_domain_add_simple(np, gpio_irq_base); | 46 | irq_domain_add_simple(np, gpio_irq_base); |
47 | gpio_irq_base += 32; | 47 | |
48 | return 0; | ||
48 | } | 49 | } |
49 | 50 | ||
50 | static const struct of_device_id imx6q_irq_match[] __initconst = { | 51 | static const struct of_device_id imx6q_irq_match[] __initconst = { |
diff --git a/arch/arm/mach-kirkwood/addr-map.c b/arch/arm/mach-kirkwood/addr-map.c index 8d03bcef5182..e9a7180863d9 100644 --- a/arch/arm/mach-kirkwood/addr-map.c +++ b/arch/arm/mach-kirkwood/addr-map.c | |||
@@ -13,12 +13,12 @@ | |||
13 | #include <linux/mbus.h> | 13 | #include <linux/mbus.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <mach/hardware.h> | 15 | #include <mach/hardware.h> |
16 | #include <plat/addr-map.h> | ||
16 | #include "common.h" | 17 | #include "common.h" |
17 | 18 | ||
18 | /* | 19 | /* |
19 | * Generic Address Decode Windows bit settings | 20 | * Generic Address Decode Windows bit settings |
20 | */ | 21 | */ |
21 | #define TARGET_DDR 0 | ||
22 | #define TARGET_DEV_BUS 1 | 22 | #define TARGET_DEV_BUS 1 |
23 | #define TARGET_SRAM 3 | 23 | #define TARGET_SRAM 3 |
24 | #define TARGET_PCIE 4 | 24 | #define TARGET_PCIE 4 |
@@ -36,118 +36,55 @@ | |||
36 | #define ATTR_SRAM 0x01 | 36 | #define ATTR_SRAM 0x01 |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * Helpers to get DDR bank info | 39 | * Description of the windows needed by the platform code |
40 | */ | 40 | */ |
41 | #define DDR_BASE_CS_OFF(n) (0x0000 + ((n) << 3)) | 41 | static struct __initdata orion_addr_map_cfg addr_map_cfg = { |
42 | #define DDR_SIZE_CS_OFF(n) (0x0004 + ((n) << 3)) | 42 | .num_wins = 8, |
43 | 43 | .remappable_wins = 4, | |
44 | /* | 44 | .bridge_virt_base = BRIDGE_VIRT_BASE, |
45 | * CPU Address Decode Windows registers | 45 | }; |
46 | */ | ||
47 | #define WIN_OFF(n) (BRIDGE_VIRT_BASE + 0x0000 + ((n) << 4)) | ||
48 | #define WIN_CTRL_OFF 0x0000 | ||
49 | #define WIN_BASE_OFF 0x0004 | ||
50 | #define WIN_REMAP_LO_OFF 0x0008 | ||
51 | #define WIN_REMAP_HI_OFF 0x000c | ||
52 | |||
53 | |||
54 | struct mbus_dram_target_info kirkwood_mbus_dram_info; | ||
55 | |||
56 | static int __init cpu_win_can_remap(int win) | ||
57 | { | ||
58 | if (win < 4) | ||
59 | return 1; | ||
60 | |||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static void __init setup_cpu_win(int win, u32 base, u32 size, | ||
65 | u8 target, u8 attr, int remap) | ||
66 | { | ||
67 | void __iomem *addr = (void __iomem *)WIN_OFF(win); | ||
68 | u32 ctrl; | ||
69 | |||
70 | base &= 0xffff0000; | ||
71 | ctrl = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1; | ||
72 | |||
73 | writel(base, addr + WIN_BASE_OFF); | ||
74 | writel(ctrl, addr + WIN_CTRL_OFF); | ||
75 | if (cpu_win_can_remap(win)) { | ||
76 | if (remap < 0) | ||
77 | remap = base; | ||
78 | |||
79 | writel(remap & 0xffff0000, addr + WIN_REMAP_LO_OFF); | ||
80 | writel(0, addr + WIN_REMAP_HI_OFF); | ||
81 | } | ||
82 | } | ||
83 | |||
84 | void __init kirkwood_setup_cpu_mbus(void) | ||
85 | { | ||
86 | void __iomem *addr; | ||
87 | int i; | ||
88 | int cs; | ||
89 | 46 | ||
47 | static const struct __initdata orion_addr_map_info addr_map_info[] = { | ||
90 | /* | 48 | /* |
91 | * First, disable and clear windows. | 49 | * Windows for PCIe IO+MEM space. |
92 | */ | 50 | */ |
93 | for (i = 0; i < 8; i++) { | 51 | { 0, KIRKWOOD_PCIE_IO_PHYS_BASE, KIRKWOOD_PCIE_IO_SIZE, |
94 | addr = (void __iomem *)WIN_OFF(i); | 52 | TARGET_PCIE, ATTR_PCIE_IO, KIRKWOOD_PCIE_IO_BUS_BASE |
95 | 53 | }, | |
96 | writel(0, addr + WIN_BASE_OFF); | 54 | { 1, KIRKWOOD_PCIE_MEM_PHYS_BASE, KIRKWOOD_PCIE_MEM_SIZE, |
97 | writel(0, addr + WIN_CTRL_OFF); | 55 | TARGET_PCIE, ATTR_PCIE_MEM, KIRKWOOD_PCIE_MEM_BUS_BASE |
98 | if (cpu_win_can_remap(i)) { | 56 | }, |
99 | writel(0, addr + WIN_REMAP_LO_OFF); | 57 | { 2, KIRKWOOD_PCIE1_IO_PHYS_BASE, KIRKWOOD_PCIE1_IO_SIZE, |
100 | writel(0, addr + WIN_REMAP_HI_OFF); | 58 | TARGET_PCIE, ATTR_PCIE1_IO, KIRKWOOD_PCIE1_IO_BUS_BASE |
101 | } | 59 | }, |
102 | } | 60 | { 3, KIRKWOOD_PCIE1_MEM_PHYS_BASE, KIRKWOOD_PCIE1_MEM_SIZE, |
103 | 61 | TARGET_PCIE, ATTR_PCIE1_MEM, KIRKWOOD_PCIE1_MEM_BUS_BASE | |
62 | }, | ||
104 | /* | 63 | /* |
105 | * Setup windows for PCIe IO+MEM space. | 64 | * Window for NAND controller. |
106 | */ | 65 | */ |
107 | setup_cpu_win(0, KIRKWOOD_PCIE_IO_PHYS_BASE, KIRKWOOD_PCIE_IO_SIZE, | 66 | { 4, KIRKWOOD_NAND_MEM_PHYS_BASE, KIRKWOOD_NAND_MEM_SIZE, |
108 | TARGET_PCIE, ATTR_PCIE_IO, KIRKWOOD_PCIE_IO_BUS_BASE); | 67 | TARGET_DEV_BUS, ATTR_DEV_NAND, -1 |
109 | setup_cpu_win(1, KIRKWOOD_PCIE_MEM_PHYS_BASE, KIRKWOOD_PCIE_MEM_SIZE, | 68 | }, |
110 | TARGET_PCIE, ATTR_PCIE_MEM, KIRKWOOD_PCIE_MEM_BUS_BASE); | ||
111 | setup_cpu_win(2, KIRKWOOD_PCIE1_IO_PHYS_BASE, KIRKWOOD_PCIE1_IO_SIZE, | ||
112 | TARGET_PCIE, ATTR_PCIE1_IO, KIRKWOOD_PCIE1_IO_BUS_BASE); | ||
113 | setup_cpu_win(3, KIRKWOOD_PCIE1_MEM_PHYS_BASE, KIRKWOOD_PCIE1_MEM_SIZE, | ||
114 | TARGET_PCIE, ATTR_PCIE1_MEM, KIRKWOOD_PCIE1_MEM_BUS_BASE); | ||
115 | |||
116 | /* | 69 | /* |
117 | * Setup window for NAND controller. | 70 | * Window for SRAM. |
118 | */ | 71 | */ |
119 | setup_cpu_win(4, KIRKWOOD_NAND_MEM_PHYS_BASE, KIRKWOOD_NAND_MEM_SIZE, | 72 | { 5, KIRKWOOD_SRAM_PHYS_BASE, KIRKWOOD_SRAM_SIZE, |
120 | TARGET_DEV_BUS, ATTR_DEV_NAND, -1); | 73 | TARGET_SRAM, ATTR_SRAM, -1 |
74 | }, | ||
75 | /* End marker */ | ||
76 | { -1, 0, 0, 0, 0, 0 } | ||
77 | }; | ||
121 | 78 | ||
79 | void __init kirkwood_setup_cpu_mbus(void) | ||
80 | { | ||
122 | /* | 81 | /* |
123 | * Setup window for SRAM. | 82 | * Disable, clear and configure windows. |
124 | */ | 83 | */ |
125 | setup_cpu_win(5, KIRKWOOD_SRAM_PHYS_BASE, KIRKWOOD_SRAM_SIZE, | 84 | orion_config_wins(&addr_map_cfg, addr_map_info); |
126 | TARGET_SRAM, ATTR_SRAM, -1); | ||
127 | 85 | ||
128 | /* | 86 | /* |
129 | * Setup MBUS dram target info. | 87 | * Setup MBUS dram target info. |
130 | */ | 88 | */ |
131 | kirkwood_mbus_dram_info.mbus_dram_target_id = TARGET_DDR; | 89 | orion_setup_cpu_mbus_target(&addr_map_cfg, DDR_WINDOW_CPU_BASE); |
132 | |||
133 | addr = (void __iomem *)DDR_WINDOW_CPU_BASE; | ||
134 | |||
135 | for (i = 0, cs = 0; i < 4; i++) { | ||
136 | u32 base = readl(addr + DDR_BASE_CS_OFF(i)); | ||
137 | u32 size = readl(addr + DDR_SIZE_CS_OFF(i)); | ||
138 | |||
139 | /* | ||
140 | * Chip select enabled? | ||
141 | */ | ||
142 | if (size & 1) { | ||
143 | struct mbus_dram_window *w; | ||
144 | |||
145 | w = &kirkwood_mbus_dram_info.cs[cs++]; | ||
146 | w->cs_index = i; | ||
147 | w->mbus_attr = 0xf & ~(1 << i); | ||
148 | w->base = base & 0xffff0000; | ||
149 | w->size = (size | 0x0000ffff) + 1; | ||
150 | } | ||
151 | } | ||
152 | kirkwood_mbus_dram_info.num_cs = cs; | ||
153 | } | 90 | } |
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index f3248cfbe51d..10566d4052d2 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/serial_8250.h> | 14 | #include <linux/serial_8250.h> |
15 | #include <linux/mbus.h> | ||
16 | #include <linux/ata_platform.h> | 15 | #include <linux/ata_platform.h> |
17 | #include <linux/mtd/nand.h> | 16 | #include <linux/mtd/nand.h> |
18 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
@@ -30,6 +29,7 @@ | |||
30 | #include <plat/orion_nand.h> | 29 | #include <plat/orion_nand.h> |
31 | #include <plat/common.h> | 30 | #include <plat/common.h> |
32 | #include <plat/time.h> | 31 | #include <plat/time.h> |
32 | #include <plat/addr-map.h> | ||
33 | #include "common.h" | 33 | #include "common.h" |
34 | 34 | ||
35 | /***************************************************************************** | 35 | /***************************************************************************** |
@@ -73,8 +73,7 @@ unsigned int kirkwood_clk_ctrl = CGC_DUNIT | CGC_RESERVED; | |||
73 | void __init kirkwood_ehci_init(void) | 73 | void __init kirkwood_ehci_init(void) |
74 | { | 74 | { |
75 | kirkwood_clk_ctrl |= CGC_USB0; | 75 | kirkwood_clk_ctrl |= CGC_USB0; |
76 | orion_ehci_init(&kirkwood_mbus_dram_info, | 76 | orion_ehci_init(USB_PHYS_BASE, IRQ_KIRKWOOD_USB); |
77 | USB_PHYS_BASE, IRQ_KIRKWOOD_USB); | ||
78 | } | 77 | } |
79 | 78 | ||
80 | 79 | ||
@@ -85,7 +84,7 @@ void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data) | |||
85 | { | 84 | { |
86 | kirkwood_clk_ctrl |= CGC_GE0; | 85 | kirkwood_clk_ctrl |= CGC_GE0; |
87 | 86 | ||
88 | orion_ge00_init(eth_data, &kirkwood_mbus_dram_info, | 87 | orion_ge00_init(eth_data, |
89 | GE00_PHYS_BASE, IRQ_KIRKWOOD_GE00_SUM, | 88 | GE00_PHYS_BASE, IRQ_KIRKWOOD_GE00_SUM, |
90 | IRQ_KIRKWOOD_GE00_ERR, kirkwood_tclk); | 89 | IRQ_KIRKWOOD_GE00_ERR, kirkwood_tclk); |
91 | } | 90 | } |
@@ -99,7 +98,7 @@ void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data) | |||
99 | 98 | ||
100 | kirkwood_clk_ctrl |= CGC_GE1; | 99 | kirkwood_clk_ctrl |= CGC_GE1; |
101 | 100 | ||
102 | orion_ge01_init(eth_data, &kirkwood_mbus_dram_info, | 101 | orion_ge01_init(eth_data, |
103 | GE01_PHYS_BASE, IRQ_KIRKWOOD_GE01_SUM, | 102 | GE01_PHYS_BASE, IRQ_KIRKWOOD_GE01_SUM, |
104 | IRQ_KIRKWOOD_GE01_ERR, kirkwood_tclk); | 103 | IRQ_KIRKWOOD_GE01_ERR, kirkwood_tclk); |
105 | } | 104 | } |
@@ -178,8 +177,7 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) | |||
178 | if (sata_data->n_ports > 1) | 177 | if (sata_data->n_ports > 1) |
179 | kirkwood_clk_ctrl |= CGC_SATA1; | 178 | kirkwood_clk_ctrl |= CGC_SATA1; |
180 | 179 | ||
181 | orion_sata_init(sata_data, &kirkwood_mbus_dram_info, | 180 | orion_sata_init(sata_data, SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA); |
182 | SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA); | ||
183 | } | 181 | } |
184 | 182 | ||
185 | 183 | ||
@@ -221,7 +219,6 @@ void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data) | |||
221 | mvsdio_data->clock = 100000000; | 219 | mvsdio_data->clock = 100000000; |
222 | else | 220 | else |
223 | mvsdio_data->clock = 200000000; | 221 | mvsdio_data->clock = 200000000; |
224 | mvsdio_data->dram = &kirkwood_mbus_dram_info; | ||
225 | kirkwood_clk_ctrl |= CGC_SDIO; | 222 | kirkwood_clk_ctrl |= CGC_SDIO; |
226 | kirkwood_sdio.dev.platform_data = mvsdio_data; | 223 | kirkwood_sdio.dev.platform_data = mvsdio_data; |
227 | platform_device_register(&kirkwood_sdio); | 224 | platform_device_register(&kirkwood_sdio); |
@@ -285,8 +282,7 @@ static void __init kirkwood_xor0_init(void) | |||
285 | { | 282 | { |
286 | kirkwood_clk_ctrl |= CGC_XOR0; | 283 | kirkwood_clk_ctrl |= CGC_XOR0; |
287 | 284 | ||
288 | orion_xor0_init(&kirkwood_mbus_dram_info, | 285 | orion_xor0_init(XOR0_PHYS_BASE, XOR0_HIGH_PHYS_BASE, |
289 | XOR0_PHYS_BASE, XOR0_HIGH_PHYS_BASE, | ||
290 | IRQ_KIRKWOOD_XOR_00, IRQ_KIRKWOOD_XOR_01); | 286 | IRQ_KIRKWOOD_XOR_00, IRQ_KIRKWOOD_XOR_01); |
291 | } | 287 | } |
292 | 288 | ||
@@ -364,7 +360,6 @@ static struct resource kirkwood_i2s_resources[] = { | |||
364 | }; | 360 | }; |
365 | 361 | ||
366 | static struct kirkwood_asoc_platform_data kirkwood_i2s_data = { | 362 | static struct kirkwood_asoc_platform_data kirkwood_i2s_data = { |
367 | .dram = &kirkwood_mbus_dram_info, | ||
368 | .burst = 128, | 363 | .burst = 128, |
369 | }; | 364 | }; |
370 | 365 | ||
@@ -430,6 +425,8 @@ static char * __init kirkwood_id(void) | |||
430 | } else if (dev == MV88F6282_DEV_ID) { | 425 | } else if (dev == MV88F6282_DEV_ID) { |
431 | if (rev == MV88F6282_REV_A0) | 426 | if (rev == MV88F6282_REV_A0) |
432 | return "MV88F6282-Rev-A0"; | 427 | return "MV88F6282-Rev-A0"; |
428 | else if (rev == MV88F6282_REV_A1) | ||
429 | return "MV88F6282-Rev-A1"; | ||
433 | else | 430 | else |
434 | return "MV88F6282-Rev-Unsupported"; | 431 | return "MV88F6282-Rev-Unsupported"; |
435 | } else { | 432 | } else { |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index b9b0f0968a36..4756b945106b 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -30,7 +30,6 @@ void kirkwood_init(void); | |||
30 | void kirkwood_init_early(void); | 30 | void kirkwood_init_early(void); |
31 | void kirkwood_init_irq(void); | 31 | void kirkwood_init_irq(void); |
32 | 32 | ||
33 | extern struct mbus_dram_target_info kirkwood_mbus_dram_info; | ||
34 | void kirkwood_setup_cpu_mbus(void); | 33 | void kirkwood_setup_cpu_mbus(void); |
35 | 34 | ||
36 | void kirkwood_enable_pcie(void); | 35 | void kirkwood_enable_pcie(void); |
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index 010bdeb4ac5f..fede3d503efa 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -135,4 +135,5 @@ | |||
135 | 135 | ||
136 | #define MV88F6282_DEV_ID 0x6282 | 136 | #define MV88F6282_DEV_ID 0x6282 |
137 | #define MV88F6282_REV_A0 0 | 137 | #define MV88F6282_REV_A0 0 |
138 | #define MV88F6282_REV_A1 1 | ||
138 | #endif | 139 | #endif |
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c index cc431fa22ccb..0c6ad63f10c7 100644 --- a/arch/arm/mach-kirkwood/mpp.c +++ b/arch/arm/mach-kirkwood/mpp.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <linux/gpio.h> | 10 | #include <linux/gpio.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/mbus.h> | ||
14 | #include <linux/io.h> | 13 | #include <linux/io.h> |
15 | #include <mach/hardware.h> | 14 | #include <mach/hardware.h> |
16 | #include <plat/mpp.h> | 15 | #include <plat/mpp.h> |
diff --git a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h index ac787957e2d9..e8fda45c0736 100644 --- a/arch/arm/mach-kirkwood/mpp.h +++ b/arch/arm/mach-kirkwood/mpp.h | |||
@@ -102,6 +102,7 @@ | |||
102 | #define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 1, 0, 1, 1, 1, 1 ) | 102 | #define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 1, 0, 1, 1, 1, 1 ) |
103 | 103 | ||
104 | #define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1, 1 ) | 104 | #define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1, 1 ) |
105 | #define MPP12_GPIO MPP( 12, 0x0, 1, 1, 0, 0, 0, 1, 0 ) | ||
105 | #define MPP12_SD_CLK MPP( 12, 0x1, 0, 1, 1, 1, 1, 1, 1 ) | 106 | #define MPP12_SD_CLK MPP( 12, 0x1, 0, 1, 1, 1, 1, 1, 1 ) |
106 | #define MPP12_AU_SPDIF0 MPP( 12, 0xa, 0, 1, 0, 0, 0, 0, 1 ) | 107 | #define MPP12_AU_SPDIF0 MPP( 12, 0xa, 0, 1, 0, 0, 0, 0, 1 ) |
107 | #define MPP12_SPI_MOSI MPP( 12, 0xb, 0, 1, 0, 0, 0, 0, 1 ) | 108 | #define MPP12_SPI_MOSI MPP( 12, 0xb, 0, 1, 0, 0, 0, 0, 1 ) |
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index 74b992d810ea..fb451bfe478b 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -11,12 +11,12 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/mbus.h> | ||
15 | #include <video/vga.h> | 14 | #include <video/vga.h> |
16 | #include <asm/irq.h> | 15 | #include <asm/irq.h> |
17 | #include <asm/mach/pci.h> | 16 | #include <asm/mach/pci.h> |
18 | #include <plat/pcie.h> | 17 | #include <plat/pcie.h> |
19 | #include <mach/bridge-regs.h> | 18 | #include <mach/bridge-regs.h> |
19 | #include <plat/addr-map.h> | ||
20 | #include "common.h" | 20 | #include "common.h" |
21 | 21 | ||
22 | void kirkwood_enable_pcie(void) | 22 | void kirkwood_enable_pcie(void) |
@@ -208,7 +208,7 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) | |||
208 | */ | 208 | */ |
209 | orion_pcie_set_local_bus_nr(pp->base, sys->busnr); | 209 | orion_pcie_set_local_bus_nr(pp->base, sys->busnr); |
210 | 210 | ||
211 | orion_pcie_setup(pp->base, &kirkwood_mbus_dram_info); | 211 | orion_pcie_setup(pp->base); |
212 | 212 | ||
213 | return 1; | 213 | return 1; |
214 | } | 214 | } |
diff --git a/arch/arm/mach-msm/devices-iommu.c b/arch/arm/mach-msm/devices-iommu.c index 24030d0da6e3..0fb7a17df398 100644 --- a/arch/arm/mach-msm/devices-iommu.c +++ b/arch/arm/mach-msm/devices-iommu.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/bootmem.h> | 20 | #include <linux/bootmem.h> |
21 | #include <linux/module.h> | ||
21 | #include <mach/irqs.h> | 22 | #include <mach/irqs.h> |
22 | #include <mach/iommu.h> | 23 | #include <mach/iommu.h> |
23 | 24 | ||
diff --git a/arch/arm/mach-mv78xx0/addr-map.c b/arch/arm/mach-mv78xx0/addr-map.c index 311d5b0e9bc7..62b53d710efd 100644 --- a/arch/arm/mach-mv78xx0/addr-map.c +++ b/arch/arm/mach-mv78xx0/addr-map.c | |||
@@ -12,12 +12,12 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/mbus.h> | 13 | #include <linux/mbus.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <plat/addr-map.h> | ||
15 | #include "common.h" | 16 | #include "common.h" |
16 | 17 | ||
17 | /* | 18 | /* |
18 | * Generic Address Decode Windows bit settings | 19 | * Generic Address Decode Windows bit settings |
19 | */ | 20 | */ |
20 | #define TARGET_DDR 0 | ||
21 | #define TARGET_DEV_BUS 1 | 21 | #define TARGET_DEV_BUS 1 |
22 | #define TARGET_PCIE0 4 | 22 | #define TARGET_PCIE0 4 |
23 | #define TARGET_PCIE1 8 | 23 | #define TARGET_PCIE1 8 |
@@ -32,23 +32,10 @@ | |||
32 | #define ATTR_PCIE_MEM(l) (0xf8 & ~(0x10 << (l))) | 32 | #define ATTR_PCIE_MEM(l) (0xf8 & ~(0x10 << (l))) |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * Helpers to get DDR bank info | ||
36 | */ | ||
37 | #define DDR_BASE_CS_OFF(n) (0x0000 + ((n) << 3)) | ||
38 | #define DDR_SIZE_CS_OFF(n) (0x0004 + ((n) << 3)) | ||
39 | |||
40 | /* | ||
41 | * CPU Address Decode Windows registers | 35 | * CPU Address Decode Windows registers |
42 | */ | 36 | */ |
43 | #define WIN0_OFF(n) (BRIDGE_VIRT_BASE + 0x0000 + ((n) << 4)) | 37 | #define WIN0_OFF(n) (BRIDGE_VIRT_BASE + 0x0000 + ((n) << 4)) |
44 | #define WIN8_OFF(n) (BRIDGE_VIRT_BASE + 0x0900 + (((n) - 8) << 4)) | 38 | #define WIN8_OFF(n) (BRIDGE_VIRT_BASE + 0x0900 + (((n) - 8) << 4)) |
45 | #define WIN_CTRL_OFF 0x0000 | ||
46 | #define WIN_BASE_OFF 0x0004 | ||
47 | #define WIN_REMAP_LO_OFF 0x0008 | ||
48 | #define WIN_REMAP_HI_OFF 0x000c | ||
49 | |||
50 | |||
51 | struct mbus_dram_target_info mv78xx0_mbus_dram_info; | ||
52 | 39 | ||
53 | static void __init __iomem *win_cfg_base(int win) | 40 | static void __init __iomem *win_cfg_base(int win) |
54 | { | 41 | { |
@@ -63,94 +50,43 @@ static void __init __iomem *win_cfg_base(int win) | |||
63 | return (void __iomem *)((win < 8) ? WIN0_OFF(win) : WIN8_OFF(win)); | 50 | return (void __iomem *)((win < 8) ? WIN0_OFF(win) : WIN8_OFF(win)); |
64 | } | 51 | } |
65 | 52 | ||
66 | static int __init cpu_win_can_remap(int win) | 53 | /* |
67 | { | 54 | * Description of the windows needed by the platform code |
68 | if (win < 8) | 55 | */ |
69 | return 1; | 56 | static struct __initdata orion_addr_map_cfg addr_map_cfg = { |
70 | 57 | .num_wins = 14, | |
71 | return 0; | 58 | .remappable_wins = 8, |
72 | } | 59 | .win_cfg_base = win_cfg_base, |
73 | 60 | }; | |
74 | static void __init setup_cpu_win(int win, u32 base, u32 size, | ||
75 | u8 target, u8 attr, int remap) | ||
76 | { | ||
77 | void __iomem *addr = win_cfg_base(win); | ||
78 | u32 ctrl; | ||
79 | |||
80 | base &= 0xffff0000; | ||
81 | ctrl = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1; | ||
82 | |||
83 | writel(base, addr + WIN_BASE_OFF); | ||
84 | writel(ctrl, addr + WIN_CTRL_OFF); | ||
85 | if (cpu_win_can_remap(win)) { | ||
86 | if (remap < 0) | ||
87 | remap = base; | ||
88 | |||
89 | writel(remap & 0xffff0000, addr + WIN_REMAP_LO_OFF); | ||
90 | writel(0, addr + WIN_REMAP_HI_OFF); | ||
91 | } | ||
92 | } | ||
93 | 61 | ||
94 | void __init mv78xx0_setup_cpu_mbus(void) | 62 | void __init mv78xx0_setup_cpu_mbus(void) |
95 | { | 63 | { |
96 | void __iomem *addr; | ||
97 | int i; | ||
98 | int cs; | ||
99 | |||
100 | /* | 64 | /* |
101 | * First, disable and clear windows. | 65 | * Disable, clear and configure windows. |
102 | */ | 66 | */ |
103 | for (i = 0; i < 14; i++) { | 67 | orion_config_wins(&addr_map_cfg, NULL); |
104 | addr = win_cfg_base(i); | ||
105 | |||
106 | writel(0, addr + WIN_BASE_OFF); | ||
107 | writel(0, addr + WIN_CTRL_OFF); | ||
108 | if (cpu_win_can_remap(i)) { | ||
109 | writel(0, addr + WIN_REMAP_LO_OFF); | ||
110 | writel(0, addr + WIN_REMAP_HI_OFF); | ||
111 | } | ||
112 | } | ||
113 | 68 | ||
114 | /* | 69 | /* |
115 | * Setup MBUS dram target info. | 70 | * Setup MBUS dram target info. |
116 | */ | 71 | */ |
117 | mv78xx0_mbus_dram_info.mbus_dram_target_id = TARGET_DDR; | ||
118 | |||
119 | if (mv78xx0_core_index() == 0) | 72 | if (mv78xx0_core_index() == 0) |
120 | addr = (void __iomem *)DDR_WINDOW_CPU0_BASE; | 73 | orion_setup_cpu_mbus_target(&addr_map_cfg, |
74 | DDR_WINDOW_CPU0_BASE); | ||
121 | else | 75 | else |
122 | addr = (void __iomem *)DDR_WINDOW_CPU1_BASE; | 76 | orion_setup_cpu_mbus_target(&addr_map_cfg, |
123 | 77 | DDR_WINDOW_CPU1_BASE); | |
124 | for (i = 0, cs = 0; i < 4; i++) { | ||
125 | u32 base = readl(addr + DDR_BASE_CS_OFF(i)); | ||
126 | u32 size = readl(addr + DDR_SIZE_CS_OFF(i)); | ||
127 | |||
128 | /* | ||
129 | * Chip select enabled? | ||
130 | */ | ||
131 | if (size & 1) { | ||
132 | struct mbus_dram_window *w; | ||
133 | |||
134 | w = &mv78xx0_mbus_dram_info.cs[cs++]; | ||
135 | w->cs_index = i; | ||
136 | w->mbus_attr = 0xf & ~(1 << i); | ||
137 | w->base = base & 0xffff0000; | ||
138 | w->size = (size | 0x0000ffff) + 1; | ||
139 | } | ||
140 | } | ||
141 | mv78xx0_mbus_dram_info.num_cs = cs; | ||
142 | } | 78 | } |
143 | 79 | ||
144 | void __init mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, | 80 | void __init mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, |
145 | int maj, int min) | 81 | int maj, int min) |
146 | { | 82 | { |
147 | setup_cpu_win(window, base, size, TARGET_PCIE(maj), | 83 | orion_setup_cpu_win(&addr_map_cfg, window, base, size, |
148 | ATTR_PCIE_IO(min), -1); | 84 | TARGET_PCIE(maj), ATTR_PCIE_IO(min), -1); |
149 | } | 85 | } |
150 | 86 | ||
151 | void __init mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, | 87 | void __init mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, |
152 | int maj, int min) | 88 | int maj, int min) |
153 | { | 89 | { |
154 | setup_cpu_win(window, base, size, TARGET_PCIE(maj), | 90 | orion_setup_cpu_win(&addr_map_cfg, window, base, size, |
155 | ATTR_PCIE_MEM(min), -1); | 91 | TARGET_PCIE(maj), ATTR_PCIE_MEM(min), -1); |
156 | } | 92 | } |
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index 23d3980ef59d..534ce204e8b9 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/serial_8250.h> | 14 | #include <linux/serial_8250.h> |
15 | #include <linux/mbus.h> | ||
16 | #include <linux/ata_platform.h> | 15 | #include <linux/ata_platform.h> |
17 | #include <linux/ethtool.h> | 16 | #include <linux/ethtool.h> |
18 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
@@ -23,6 +22,7 @@ | |||
23 | #include <plat/orion_nand.h> | 22 | #include <plat/orion_nand.h> |
24 | #include <plat/time.h> | 23 | #include <plat/time.h> |
25 | #include <plat/common.h> | 24 | #include <plat/common.h> |
25 | #include <plat/addr-map.h> | ||
26 | #include "common.h" | 26 | #include "common.h" |
27 | 27 | ||
28 | static int get_tclk(void); | 28 | static int get_tclk(void); |
@@ -169,8 +169,7 @@ void __init mv78xx0_map_io(void) | |||
169 | ****************************************************************************/ | 169 | ****************************************************************************/ |
170 | void __init mv78xx0_ehci0_init(void) | 170 | void __init mv78xx0_ehci0_init(void) |
171 | { | 171 | { |
172 | orion_ehci_init(&mv78xx0_mbus_dram_info, | 172 | orion_ehci_init(USB0_PHYS_BASE, IRQ_MV78XX0_USB_0); |
173 | USB0_PHYS_BASE, IRQ_MV78XX0_USB_0); | ||
174 | } | 173 | } |
175 | 174 | ||
176 | 175 | ||
@@ -179,8 +178,7 @@ void __init mv78xx0_ehci0_init(void) | |||
179 | ****************************************************************************/ | 178 | ****************************************************************************/ |
180 | void __init mv78xx0_ehci1_init(void) | 179 | void __init mv78xx0_ehci1_init(void) |
181 | { | 180 | { |
182 | orion_ehci_1_init(&mv78xx0_mbus_dram_info, | 181 | orion_ehci_1_init(USB1_PHYS_BASE, IRQ_MV78XX0_USB_1); |
183 | USB1_PHYS_BASE, IRQ_MV78XX0_USB_1); | ||
184 | } | 182 | } |
185 | 183 | ||
186 | 184 | ||
@@ -189,8 +187,7 @@ void __init mv78xx0_ehci1_init(void) | |||
189 | ****************************************************************************/ | 187 | ****************************************************************************/ |
190 | void __init mv78xx0_ehci2_init(void) | 188 | void __init mv78xx0_ehci2_init(void) |
191 | { | 189 | { |
192 | orion_ehci_2_init(&mv78xx0_mbus_dram_info, | 190 | orion_ehci_2_init(USB2_PHYS_BASE, IRQ_MV78XX0_USB_2); |
193 | USB2_PHYS_BASE, IRQ_MV78XX0_USB_2); | ||
194 | } | 191 | } |
195 | 192 | ||
196 | 193 | ||
@@ -199,7 +196,7 @@ void __init mv78xx0_ehci2_init(void) | |||
199 | ****************************************************************************/ | 196 | ****************************************************************************/ |
200 | void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data) | 197 | void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data) |
201 | { | 198 | { |
202 | orion_ge00_init(eth_data, &mv78xx0_mbus_dram_info, | 199 | orion_ge00_init(eth_data, |
203 | GE00_PHYS_BASE, IRQ_MV78XX0_GE00_SUM, | 200 | GE00_PHYS_BASE, IRQ_MV78XX0_GE00_SUM, |
204 | IRQ_MV78XX0_GE_ERR, get_tclk()); | 201 | IRQ_MV78XX0_GE_ERR, get_tclk()); |
205 | } | 202 | } |
@@ -210,7 +207,7 @@ void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data) | |||
210 | ****************************************************************************/ | 207 | ****************************************************************************/ |
211 | void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data) | 208 | void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data) |
212 | { | 209 | { |
213 | orion_ge01_init(eth_data, &mv78xx0_mbus_dram_info, | 210 | orion_ge01_init(eth_data, |
214 | GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM, | 211 | GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM, |
215 | NO_IRQ, get_tclk()); | 212 | NO_IRQ, get_tclk()); |
216 | } | 213 | } |
@@ -234,7 +231,7 @@ void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data) | |||
234 | eth_data->duplex = DUPLEX_FULL; | 231 | eth_data->duplex = DUPLEX_FULL; |
235 | } | 232 | } |
236 | 233 | ||
237 | orion_ge10_init(eth_data, &mv78xx0_mbus_dram_info, | 234 | orion_ge10_init(eth_data, |
238 | GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM, | 235 | GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM, |
239 | NO_IRQ, get_tclk()); | 236 | NO_IRQ, get_tclk()); |
240 | } | 237 | } |
@@ -258,7 +255,7 @@ void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data) | |||
258 | eth_data->duplex = DUPLEX_FULL; | 255 | eth_data->duplex = DUPLEX_FULL; |
259 | } | 256 | } |
260 | 257 | ||
261 | orion_ge11_init(eth_data, &mv78xx0_mbus_dram_info, | 258 | orion_ge11_init(eth_data, |
262 | GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM, | 259 | GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM, |
263 | NO_IRQ, get_tclk()); | 260 | NO_IRQ, get_tclk()); |
264 | } | 261 | } |
@@ -277,8 +274,7 @@ void __init mv78xx0_i2c_init(void) | |||
277 | ****************************************************************************/ | 274 | ****************************************************************************/ |
278 | void __init mv78xx0_sata_init(struct mv_sata_platform_data *sata_data) | 275 | void __init mv78xx0_sata_init(struct mv_sata_platform_data *sata_data) |
279 | { | 276 | { |
280 | orion_sata_init(sata_data, &mv78xx0_mbus_dram_info, | 277 | orion_sata_init(sata_data, SATA_PHYS_BASE, IRQ_MV78XX0_SATA); |
281 | SATA_PHYS_BASE, IRQ_MV78XX0_SATA); | ||
282 | } | 278 | } |
283 | 279 | ||
284 | 280 | ||
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h index 632e63d65e7a..f2ca59c75c6f 100644 --- a/arch/arm/mach-mv78xx0/common.h +++ b/arch/arm/mach-mv78xx0/common.h | |||
@@ -23,7 +23,6 @@ void mv78xx0_init(void); | |||
23 | void mv78xx0_init_early(void); | 23 | void mv78xx0_init_early(void); |
24 | void mv78xx0_init_irq(void); | 24 | void mv78xx0_init_irq(void); |
25 | 25 | ||
26 | extern struct mbus_dram_target_info mv78xx0_mbus_dram_info; | ||
27 | void mv78xx0_setup_cpu_mbus(void); | 26 | void mv78xx0_setup_cpu_mbus(void); |
28 | void mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, | 27 | void mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size, |
29 | int maj, int min); | 28 | int maj, int min); |
diff --git a/arch/arm/mach-mv78xx0/mpp.c b/arch/arm/mach-mv78xx0/mpp.c index cf4e494d44bf..df50342179e2 100644 --- a/arch/arm/mach-mv78xx0/mpp.c +++ b/arch/arm/mach-mv78xx0/mpp.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <linux/gpio.h> | 10 | #include <linux/gpio.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/mbus.h> | ||
14 | #include <linux/io.h> | 13 | #include <linux/io.h> |
15 | #include <plat/mpp.h> | 14 | #include <plat/mpp.h> |
16 | #include <mach/hardware.h> | 15 | #include <mach/hardware.h> |
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c index c51af1cac300..12fcb108b0e1 100644 --- a/arch/arm/mach-mv78xx0/pcie.c +++ b/arch/arm/mach-mv78xx0/pcie.c | |||
@@ -10,11 +10,11 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/mbus.h> | ||
14 | #include <video/vga.h> | 13 | #include <video/vga.h> |
15 | #include <asm/irq.h> | 14 | #include <asm/irq.h> |
16 | #include <asm/mach/pci.h> | 15 | #include <asm/mach/pci.h> |
17 | #include <plat/pcie.h> | 16 | #include <plat/pcie.h> |
17 | #include <plat/addr-map.h> | ||
18 | #include "common.h" | 18 | #include "common.h" |
19 | 19 | ||
20 | struct pcie_port { | 20 | struct pcie_port { |
@@ -153,7 +153,7 @@ static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys) | |||
153 | * Generic PCIe unit setup. | 153 | * Generic PCIe unit setup. |
154 | */ | 154 | */ |
155 | orion_pcie_set_local_bus_nr(pp->base, sys->busnr); | 155 | orion_pcie_set_local_bus_nr(pp->base, sys->busnr); |
156 | orion_pcie_setup(pp->base, &mv78xx0_mbus_dram_info); | 156 | orion_pcie_setup(pp->base); |
157 | 157 | ||
158 | sys->resource[0] = &pp->res[0]; | 158 | sys->resource[0] = &pp->res[0]; |
159 | sys->resource[1] = &pp->res[1]; | 159 | sys->resource[1] = &pp->res[1]; |
diff --git a/arch/arm/mach-mx5/imx51-dt.c b/arch/arm/mach-mx5/imx51-dt.c index ccc61585659b..596edd967dbf 100644 --- a/arch/arm/mach-mx5/imx51-dt.c +++ b/arch/arm/mach-mx5/imx51-dt.c | |||
@@ -44,20 +44,22 @@ static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = { | |||
44 | { /* sentinel */ } | 44 | { /* sentinel */ } |
45 | }; | 45 | }; |
46 | 46 | ||
47 | static void __init imx51_tzic_add_irq_domain(struct device_node *np, | 47 | static int __init imx51_tzic_add_irq_domain(struct device_node *np, |
48 | struct device_node *interrupt_parent) | 48 | struct device_node *interrupt_parent) |
49 | { | 49 | { |
50 | irq_domain_add_simple(np, 0); | 50 | irq_domain_add_simple(np, 0); |
51 | return 0; | ||
51 | } | 52 | } |
52 | 53 | ||
53 | static void __init imx51_gpio_add_irq_domain(struct device_node *np, | 54 | static int __init imx51_gpio_add_irq_domain(struct device_node *np, |
54 | struct device_node *interrupt_parent) | 55 | struct device_node *interrupt_parent) |
55 | { | 56 | { |
56 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - | 57 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; |
57 | 32 * 4; /* imx51 gets 4 gpio ports */ | ||
58 | 58 | ||
59 | gpio_irq_base -= 32; | ||
59 | irq_domain_add_simple(np, gpio_irq_base); | 60 | irq_domain_add_simple(np, gpio_irq_base); |
60 | gpio_irq_base += 32; | 61 | |
62 | return 0; | ||
61 | } | 63 | } |
62 | 64 | ||
63 | static const struct of_device_id imx51_irq_match[] __initconst = { | 65 | static const struct of_device_id imx51_irq_match[] __initconst = { |
diff --git a/arch/arm/mach-mx5/imx53-dt.c b/arch/arm/mach-mx5/imx53-dt.c index ccaa0b81b768..85bfd5ff21b0 100644 --- a/arch/arm/mach-mx5/imx53-dt.c +++ b/arch/arm/mach-mx5/imx53-dt.c | |||
@@ -48,20 +48,22 @@ static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = { | |||
48 | { /* sentinel */ } | 48 | { /* sentinel */ } |
49 | }; | 49 | }; |
50 | 50 | ||
51 | static void __init imx53_tzic_add_irq_domain(struct device_node *np, | 51 | static int __init imx53_tzic_add_irq_domain(struct device_node *np, |
52 | struct device_node *interrupt_parent) | 52 | struct device_node *interrupt_parent) |
53 | { | 53 | { |
54 | irq_domain_add_simple(np, 0); | 54 | irq_domain_add_simple(np, 0); |
55 | return 0; | ||
55 | } | 56 | } |
56 | 57 | ||
57 | static void __init imx53_gpio_add_irq_domain(struct device_node *np, | 58 | static int __init imx53_gpio_add_irq_domain(struct device_node *np, |
58 | struct device_node *interrupt_parent) | 59 | struct device_node *interrupt_parent) |
59 | { | 60 | { |
60 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - | 61 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; |
61 | 32 * 7; /* imx53 gets 7 gpio ports */ | ||
62 | 62 | ||
63 | gpio_irq_base -= 32; | ||
63 | irq_domain_add_simple(np, gpio_irq_base); | 64 | irq_domain_add_simple(np, gpio_irq_base); |
64 | gpio_irq_base += 32; | 65 | |
66 | return 0; | ||
65 | } | 67 | } |
66 | 68 | ||
67 | static const struct of_device_id imx53_irq_match[] __initconst = { | 69 | static const struct of_device_id imx53_irq_match[] __initconst = { |
diff --git a/arch/arm/mach-mxs/include/mach/mx28.h b/arch/arm/mach-mxs/include/mach/mx28.h index 75d86118b76a..30c7990f3c01 100644 --- a/arch/arm/mach-mxs/include/mach/mx28.h +++ b/arch/arm/mach-mxs/include/mach/mx28.h | |||
@@ -104,8 +104,8 @@ | |||
104 | #define MX28_INT_CAN1 9 | 104 | #define MX28_INT_CAN1 9 |
105 | #define MX28_INT_LRADC_TOUCH 10 | 105 | #define MX28_INT_LRADC_TOUCH 10 |
106 | #define MX28_INT_HSADC 13 | 106 | #define MX28_INT_HSADC 13 |
107 | #define MX28_INT_IRADC_THRESH0 14 | 107 | #define MX28_INT_LRADC_THRESH0 14 |
108 | #define MX28_INT_IRADC_THRESH1 15 | 108 | #define MX28_INT_LRADC_THRESH1 15 |
109 | #define MX28_INT_LRADC_CH0 16 | 109 | #define MX28_INT_LRADC_CH0 16 |
110 | #define MX28_INT_LRADC_CH1 17 | 110 | #define MX28_INT_LRADC_CH1 17 |
111 | #define MX28_INT_LRADC_CH2 18 | 111 | #define MX28_INT_LRADC_CH2 18 |
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h index 0d2d2b470998..bde5f6634747 100644 --- a/arch/arm/mach-mxs/include/mach/mxs.h +++ b/arch/arm/mach-mxs/include/mach/mxs.h | |||
@@ -30,6 +30,7 @@ | |||
30 | */ | 30 | */ |
31 | #define cpu_is_mx23() ( \ | 31 | #define cpu_is_mx23() ( \ |
32 | machine_is_mx23evk() || \ | 32 | machine_is_mx23evk() || \ |
33 | machine_is_stmp378x() || \ | ||
33 | 0) | 34 | 0) |
34 | #define cpu_is_mx28() ( \ | 35 | #define cpu_is_mx28() ( \ |
35 | machine_is_mx28evk() || \ | 36 | machine_is_mx28evk() || \ |
diff --git a/arch/arm/mach-mxs/mach-m28evk.c b/arch/arm/mach-mxs/mach-m28evk.c index 3b1681e4f49a..6b00577b7025 100644 --- a/arch/arm/mach-mxs/mach-m28evk.c +++ b/arch/arm/mach-mxs/mach-m28evk.c | |||
@@ -361,6 +361,6 @@ static struct sys_timer m28evk_timer = { | |||
361 | MACHINE_START(M28EVK, "DENX M28 EVK") | 361 | MACHINE_START(M28EVK, "DENX M28 EVK") |
362 | .map_io = mx28_map_io, | 362 | .map_io = mx28_map_io, |
363 | .init_irq = mx28_init_irq, | 363 | .init_irq = mx28_init_irq, |
364 | .init_machine = m28evk_init, | ||
365 | .timer = &m28evk_timer, | 364 | .timer = &m28evk_timer, |
365 | .init_machine = m28evk_init, | ||
366 | MACHINE_END | 366 | MACHINE_END |
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c index 177e53123a02..6834dea38c04 100644 --- a/arch/arm/mach-mxs/mach-stmp378x_devb.c +++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c | |||
@@ -115,6 +115,6 @@ static struct sys_timer stmp378x_dvb_timer = { | |||
115 | MACHINE_START(STMP378X, "STMP378X") | 115 | MACHINE_START(STMP378X, "STMP378X") |
116 | .map_io = mx23_map_io, | 116 | .map_io = mx23_map_io, |
117 | .init_irq = mx23_init_irq, | 117 | .init_irq = mx23_init_irq, |
118 | .init_machine = stmp378x_dvb_init, | ||
119 | .timer = &stmp378x_dvb_timer, | 118 | .timer = &stmp378x_dvb_timer, |
119 | .init_machine = stmp378x_dvb_init, | ||
120 | MACHINE_END | 120 | MACHINE_END |
diff --git a/arch/arm/mach-mxs/module-tx28.c b/arch/arm/mach-mxs/module-tx28.c index 0fcff47009cf..9a7b08b2a925 100644 --- a/arch/arm/mach-mxs/module-tx28.c +++ b/arch/arm/mach-mxs/module-tx28.c | |||
@@ -66,11 +66,11 @@ static const iomux_cfg_t tx28_fec1_pads[] __initconst = { | |||
66 | MX28_PAD_ENET0_CRS__ENET1_RX_EN, | 66 | MX28_PAD_ENET0_CRS__ENET1_RX_EN, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | static struct fec_platform_data tx28_fec0_data = { | 69 | static const struct fec_platform_data tx28_fec0_data __initconst = { |
70 | .phy = PHY_INTERFACE_MODE_RMII, | 70 | .phy = PHY_INTERFACE_MODE_RMII, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static struct fec_platform_data tx28_fec1_data = { | 73 | static const struct fec_platform_data tx28_fec1_data __initconst = { |
74 | .phy = PHY_INTERFACE_MODE_RMII, | 74 | .phy = PHY_INTERFACE_MODE_RMII, |
75 | }; | 75 | }; |
76 | 76 | ||
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 73f287d6429b..4f8d66f044e7 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig | |||
@@ -168,70 +168,6 @@ config MACH_OMAP_GENERIC | |||
168 | custom OMAP boards. Say Y here if you have a custom | 168 | custom OMAP boards. Say Y here if you have a custom |
169 | board. | 169 | board. |
170 | 170 | ||
171 | comment "OMAP CPU Speed" | ||
172 | depends on ARCH_OMAP1 | ||
173 | |||
174 | config OMAP_ARM_216MHZ | ||
175 | bool "OMAP ARM 216 MHz CPU (1710 only)" | ||
176 | depends on ARCH_OMAP1 && ARCH_OMAP16XX | ||
177 | help | ||
178 | Enable 216 MHz clock for OMAP1710 CPU. If unsure, say N. | ||
179 | |||
180 | config OMAP_ARM_195MHZ | ||
181 | bool "OMAP ARM 195 MHz CPU" | ||
182 | depends on ARCH_OMAP1 && (ARCH_OMAP730 || ARCH_OMAP850) | ||
183 | help | ||
184 | Enable 195MHz clock for OMAP CPU. If unsure, say N. | ||
185 | |||
186 | config OMAP_ARM_192MHZ | ||
187 | bool "OMAP ARM 192 MHz CPU" | ||
188 | depends on ARCH_OMAP1 && ARCH_OMAP16XX | ||
189 | help | ||
190 | Enable 192MHz clock for OMAP CPU. If unsure, say N. | ||
191 | |||
192 | config OMAP_ARM_182MHZ | ||
193 | bool "OMAP ARM 182 MHz CPU" | ||
194 | depends on ARCH_OMAP1 && (ARCH_OMAP730 || ARCH_OMAP850) | ||
195 | help | ||
196 | Enable 182MHz clock for OMAP CPU. If unsure, say N. | ||
197 | |||
198 | config OMAP_ARM_168MHZ | ||
199 | bool "OMAP ARM 168 MHz CPU" | ||
200 | depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850) | ||
201 | help | ||
202 | Enable 168MHz clock for OMAP CPU. If unsure, say N. | ||
203 | |||
204 | config OMAP_ARM_150MHZ | ||
205 | bool "OMAP ARM 150 MHz CPU" | ||
206 | depends on ARCH_OMAP1 && ARCH_OMAP15XX | ||
207 | help | ||
208 | Enable 150MHz clock for OMAP CPU. If unsure, say N. | ||
209 | |||
210 | config OMAP_ARM_120MHZ | ||
211 | bool "OMAP ARM 120 MHz CPU" | ||
212 | depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850) | ||
213 | help | ||
214 | Enable 120MHz clock for OMAP CPU. If unsure, say N. | ||
215 | |||
216 | config OMAP_ARM_96MHZ | ||
217 | bool "OMAP ARM 96 MHz CPU" | ||
218 | depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850) | ||
219 | help | ||
220 | Enable 96MHz clock for OMAP CPU. If unsure, say N. | ||
221 | |||
222 | config OMAP_ARM_60MHZ | ||
223 | bool "OMAP ARM 60 MHz CPU" | ||
224 | depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850) | ||
225 | default y | ||
226 | help | ||
227 | Enable 60MHz clock for OMAP CPU. If unsure, say Y. | ||
228 | |||
229 | config OMAP_ARM_30MHZ | ||
230 | bool "OMAP ARM 30 MHz CPU" | ||
231 | depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850) | ||
232 | help | ||
233 | Enable 30MHz clock for OMAP CPU. If unsure, say N. | ||
234 | |||
235 | endmenu | 171 | endmenu |
236 | 172 | ||
237 | endif | 173 | endif |
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 84ef70476b51..0c50df05d135 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c | |||
@@ -197,11 +197,10 @@ int omap1_select_table_rate(struct clk *clk, unsigned long rate) | |||
197 | ref_rate = ck_ref_p->rate; | 197 | ref_rate = ck_ref_p->rate; |
198 | 198 | ||
199 | for (ptr = omap1_rate_table; ptr->rate; ptr++) { | 199 | for (ptr = omap1_rate_table; ptr->rate; ptr++) { |
200 | if (ptr->xtal != ref_rate) | 200 | if (!(ptr->flags & cpu_mask)) |
201 | continue; | 201 | continue; |
202 | 202 | ||
203 | /* DPLL1 cannot be reprogrammed without risking system crash */ | 203 | if (ptr->xtal != ref_rate) |
204 | if (likely(dpll1_rate != 0) && ptr->pll_rate != dpll1_rate) | ||
205 | continue; | 204 | continue; |
206 | 205 | ||
207 | /* Can check only after xtal frequency check */ | 206 | /* Can check only after xtal frequency check */ |
@@ -215,12 +214,8 @@ int omap1_select_table_rate(struct clk *clk, unsigned long rate) | |||
215 | /* | 214 | /* |
216 | * In most cases we should not need to reprogram DPLL. | 215 | * In most cases we should not need to reprogram DPLL. |
217 | * Reprogramming the DPLL is tricky, it must be done from SRAM. | 216 | * Reprogramming the DPLL is tricky, it must be done from SRAM. |
218 | * (on 730, bit 13 must always be 1) | ||
219 | */ | 217 | */ |
220 | if (cpu_is_omap7xx()) | 218 | omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); |
221 | omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000); | ||
222 | else | ||
223 | omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); | ||
224 | 219 | ||
225 | /* XXX Do we need to recalculate the tree below DPLL1 at this point? */ | 220 | /* XXX Do we need to recalculate the tree below DPLL1 at this point? */ |
226 | ck_dpll1_p->rate = ptr->pll_rate; | 221 | ck_dpll1_p->rate = ptr->pll_rate; |
@@ -290,6 +285,9 @@ long omap1_round_to_table_rate(struct clk *clk, unsigned long rate) | |||
290 | highest_rate = -EINVAL; | 285 | highest_rate = -EINVAL; |
291 | 286 | ||
292 | for (ptr = omap1_rate_table; ptr->rate; ptr++) { | 287 | for (ptr = omap1_rate_table; ptr->rate; ptr++) { |
288 | if (!(ptr->flags & cpu_mask)) | ||
289 | continue; | ||
290 | |||
293 | if (ptr->xtal != ref_rate) | 291 | if (ptr->xtal != ref_rate) |
294 | continue; | 292 | continue; |
295 | 293 | ||
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h index 16b1423b454a..3d04f4f67676 100644 --- a/arch/arm/mach-omap1/clock.h +++ b/arch/arm/mach-omap1/clock.h | |||
@@ -111,4 +111,7 @@ extern const struct clkops clkops_dummy; | |||
111 | extern const struct clkops clkops_uart_16xx; | 111 | extern const struct clkops clkops_uart_16xx; |
112 | extern const struct clkops clkops_generic; | 112 | extern const struct clkops clkops_generic; |
113 | 113 | ||
114 | /* used for passing SoC type to omap1_{select,round_to}_table_rate() */ | ||
115 | extern u32 cpu_mask; | ||
116 | |||
114 | #endif | 117 | #endif |
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index 1297bb58869c..94699a82a734 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c | |||
@@ -16,6 +16,8 @@ | |||
16 | 16 | ||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/cpufreq.h> | ||
20 | #include <linux/delay.h> | ||
19 | #include <linux/io.h> | 21 | #include <linux/io.h> |
20 | 22 | ||
21 | #include <asm/mach-types.h> /* for machine_is_* */ | 23 | #include <asm/mach-types.h> /* for machine_is_* */ |
@@ -23,6 +25,7 @@ | |||
23 | #include <plat/clock.h> | 25 | #include <plat/clock.h> |
24 | #include <plat/cpu.h> | 26 | #include <plat/cpu.h> |
25 | #include <plat/clkdev_omap.h> | 27 | #include <plat/clkdev_omap.h> |
28 | #include <plat/sram.h> /* for omap_sram_reprogram_clock() */ | ||
26 | #include <plat/usb.h> /* for OTG_BASE */ | 29 | #include <plat/usb.h> /* for OTG_BASE */ |
27 | 30 | ||
28 | #include "clock.h" | 31 | #include "clock.h" |
@@ -776,12 +779,14 @@ static void __init omap1_show_rates(void) | |||
776 | arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); | 779 | arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); |
777 | } | 780 | } |
778 | 781 | ||
782 | u32 cpu_mask; | ||
783 | |||
779 | int __init omap1_clk_init(void) | 784 | int __init omap1_clk_init(void) |
780 | { | 785 | { |
781 | struct omap_clk *c; | 786 | struct omap_clk *c; |
782 | const struct omap_clock_config *info; | 787 | const struct omap_clock_config *info; |
783 | int crystal_type = 0; /* Default 12 MHz */ | 788 | int crystal_type = 0; /* Default 12 MHz */ |
784 | u32 reg, cpu_mask; | 789 | u32 reg; |
785 | 790 | ||
786 | #ifdef CONFIG_DEBUG_LL | 791 | #ifdef CONFIG_DEBUG_LL |
787 | /* | 792 | /* |
@@ -806,6 +811,8 @@ int __init omap1_clk_init(void) | |||
806 | clk_preinit(c->lk.clk); | 811 | clk_preinit(c->lk.clk); |
807 | 812 | ||
808 | cpu_mask = 0; | 813 | cpu_mask = 0; |
814 | if (cpu_is_omap1710()) | ||
815 | cpu_mask |= CK_1710; | ||
809 | if (cpu_is_omap16xx()) | 816 | if (cpu_is_omap16xx()) |
810 | cpu_mask |= CK_16XX; | 817 | cpu_mask |= CK_16XX; |
811 | if (cpu_is_omap1510()) | 818 | if (cpu_is_omap1510()) |
@@ -927,16 +934,18 @@ int __init omap1_clk_init(void) | |||
927 | 934 | ||
928 | void __init omap1_clk_late_init(void) | 935 | void __init omap1_clk_late_init(void) |
929 | { | 936 | { |
930 | if (ck_dpll1.rate >= OMAP1_DPLL1_SANE_VALUE) | 937 | unsigned long rate = ck_dpll1.rate; |
931 | return; | ||
932 | 938 | ||
933 | /* Find the highest supported frequency and enable it */ | 939 | /* Find the highest supported frequency and enable it */ |
934 | if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { | 940 | if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { |
935 | pr_err("System frequencies not set, using default. Check your config.\n"); | 941 | pr_err("System frequencies not set, using default. Check your config.\n"); |
936 | omap_writew(0x2290, DPLL_CTL); | 942 | /* |
937 | omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL); | 943 | * Reprogramming the DPLL is tricky, it must be done from SRAM. |
944 | */ | ||
945 | omap_sram_reprogram_clock(0x2290, 0x0005); | ||
938 | ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE; | 946 | ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE; |
939 | } | 947 | } |
940 | propagate_rate(&ck_dpll1); | 948 | propagate_rate(&ck_dpll1); |
941 | omap1_show_rates(); | 949 | omap1_show_rates(); |
950 | loops_per_jiffy = cpufreq_scale(loops_per_jiffy, rate, ck_dpll1.rate); | ||
942 | } | 951 | } |
diff --git a/arch/arm/mach-omap1/opp.h b/arch/arm/mach-omap1/opp.h index 07074d79adce..79a683864a5c 100644 --- a/arch/arm/mach-omap1/opp.h +++ b/arch/arm/mach-omap1/opp.h | |||
@@ -21,6 +21,7 @@ struct mpu_rate { | |||
21 | unsigned long pll_rate; | 21 | unsigned long pll_rate; |
22 | __u16 ckctl_val; | 22 | __u16 ckctl_val; |
23 | __u16 dpllctl_val; | 23 | __u16 dpllctl_val; |
24 | u32 flags; | ||
24 | }; | 25 | }; |
25 | 26 | ||
26 | extern struct mpu_rate omap1_rate_table[]; | 27 | extern struct mpu_rate omap1_rate_table[]; |
diff --git a/arch/arm/mach-omap1/opp_data.c b/arch/arm/mach-omap1/opp_data.c index 75a546514994..9cd4ddb51397 100644 --- a/arch/arm/mach-omap1/opp_data.c +++ b/arch/arm/mach-omap1/opp_data.c | |||
@@ -10,6 +10,7 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <plat/clkdev_omap.h> | ||
13 | #include "opp.h" | 14 | #include "opp.h" |
14 | 15 | ||
15 | /*------------------------------------------------------------------------- | 16 | /*------------------------------------------------------------------------- |
@@ -20,40 +21,34 @@ struct mpu_rate omap1_rate_table[] = { | |||
20 | * NOTE: Comment order here is different from bits in CKCTL value: | 21 | * NOTE: Comment order here is different from bits in CKCTL value: |
21 | * armdiv, dspdiv, dspmmu, tcdiv, perdiv, lcddiv | 22 | * armdiv, dspdiv, dspmmu, tcdiv, perdiv, lcddiv |
22 | */ | 23 | */ |
23 | #if defined(CONFIG_OMAP_ARM_216MHZ) | 24 | { 216000000, 12000000, 216000000, 0x050d, 0x2910, /* 1/1/2/2/2/8 */ |
24 | { 216000000, 12000000, 216000000, 0x050d, 0x2910 }, /* 1/1/2/2/2/8 */ | 25 | CK_1710 }, |
25 | #endif | 26 | { 195000000, 13000000, 195000000, 0x050e, 0x2790, /* 1/1/2/2/4/8 */ |
26 | #if defined(CONFIG_OMAP_ARM_195MHZ) | 27 | CK_7XX }, |
27 | { 195000000, 13000000, 195000000, 0x050e, 0x2790 }, /* 1/1/2/2/4/8 */ | 28 | { 192000000, 19200000, 192000000, 0x050f, 0x2510, /* 1/1/2/2/8/8 */ |
28 | #endif | 29 | CK_16XX }, |
29 | #if defined(CONFIG_OMAP_ARM_192MHZ) | 30 | { 192000000, 12000000, 192000000, 0x050f, 0x2810, /* 1/1/2/2/8/8 */ |
30 | { 192000000, 19200000, 192000000, 0x050f, 0x2510 }, /* 1/1/2/2/8/8 */ | 31 | CK_16XX }, |
31 | { 192000000, 12000000, 192000000, 0x050f, 0x2810 }, /* 1/1/2/2/8/8 */ | 32 | { 96000000, 12000000, 192000000, 0x055f, 0x2810, /* 2/2/2/2/8/8 */ |
32 | { 96000000, 12000000, 192000000, 0x055f, 0x2810 }, /* 2/2/2/2/8/8 */ | 33 | CK_16XX }, |
33 | { 48000000, 12000000, 192000000, 0x0baf, 0x2810 }, /* 4/4/4/8/8/8 */ | 34 | { 48000000, 12000000, 192000000, 0x0baf, 0x2810, /* 4/4/4/8/8/8 */ |
34 | { 24000000, 12000000, 192000000, 0x0fff, 0x2810 }, /* 8/8/8/8/8/8 */ | 35 | CK_16XX }, |
35 | #endif | 36 | { 24000000, 12000000, 192000000, 0x0fff, 0x2810, /* 8/8/8/8/8/8 */ |
36 | #if defined(CONFIG_OMAP_ARM_182MHZ) | 37 | CK_16XX }, |
37 | { 182000000, 13000000, 182000000, 0x050e, 0x2710 }, /* 1/1/2/2/4/8 */ | 38 | { 182000000, 13000000, 182000000, 0x050e, 0x2710, /* 1/1/2/2/4/8 */ |
38 | #endif | 39 | CK_7XX }, |
39 | #if defined(CONFIG_OMAP_ARM_168MHZ) | 40 | { 168000000, 12000000, 168000000, 0x010f, 0x2710, /* 1/1/1/2/8/8 */ |
40 | { 168000000, 12000000, 168000000, 0x010f, 0x2710 }, /* 1/1/1/2/8/8 */ | 41 | CK_16XX|CK_7XX }, |
41 | #endif | 42 | { 150000000, 12000000, 150000000, 0x010a, 0x2cb0, /* 1/1/1/2/4/4 */ |
42 | #if defined(CONFIG_OMAP_ARM_150MHZ) | 43 | CK_1510 }, |
43 | { 150000000, 12000000, 150000000, 0x010a, 0x2cb0 }, /* 1/1/1/2/4/4 */ | 44 | { 120000000, 12000000, 120000000, 0x010a, 0x2510, /* 1/1/1/2/4/4 */ |
44 | #endif | 45 | CK_16XX|CK_1510|CK_310|CK_7XX }, |
45 | #if defined(CONFIG_OMAP_ARM_120MHZ) | 46 | { 96000000, 12000000, 96000000, 0x0005, 0x2410, /* 1/1/1/1/2/2 */ |
46 | { 120000000, 12000000, 120000000, 0x010a, 0x2510 }, /* 1/1/1/2/4/4 */ | 47 | CK_16XX|CK_1510|CK_310|CK_7XX }, |
47 | #endif | 48 | { 60000000, 12000000, 60000000, 0x0005, 0x2290, /* 1/1/1/1/2/2 */ |
48 | #if defined(CONFIG_OMAP_ARM_96MHZ) | 49 | CK_16XX|CK_1510|CK_310|CK_7XX }, |
49 | { 96000000, 12000000, 96000000, 0x0005, 0x2410 }, /* 1/1/1/1/2/2 */ | 50 | { 30000000, 12000000, 60000000, 0x0555, 0x2290, /* 2/2/2/2/2/2 */ |
50 | #endif | 51 | CK_16XX|CK_1510|CK_310|CK_7XX }, |
51 | #if defined(CONFIG_OMAP_ARM_60MHZ) | ||
52 | { 60000000, 12000000, 60000000, 0x0005, 0x2290 }, /* 1/1/1/1/2/2 */ | ||
53 | #endif | ||
54 | #if defined(CONFIG_OMAP_ARM_30MHZ) | ||
55 | { 30000000, 12000000, 60000000, 0x0555, 0x2290 }, /* 2/2/2/2/2/2 */ | ||
56 | #endif | ||
57 | { 0, 0, 0, 0, 0 }, | 52 | { 0, 0, 0, 0, 0 }, |
58 | }; | 53 | }; |
59 | 54 | ||
diff --git a/arch/arm/mach-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c index 5ceafdccc456..3638e5c12b7e 100644 --- a/arch/arm/mach-orion5x/addr-map.c +++ b/arch/arm/mach-orion5x/addr-map.c | |||
@@ -14,8 +14,8 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/mbus.h> | 15 | #include <linux/mbus.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/errno.h> | ||
18 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
18 | #include <plat/addr-map.h> | ||
19 | #include "common.h" | 19 | #include "common.h" |
20 | 20 | ||
21 | /* | 21 | /* |
@@ -41,7 +41,6 @@ | |||
41 | /* | 41 | /* |
42 | * Generic Address Decode Windows bit settings | 42 | * Generic Address Decode Windows bit settings |
43 | */ | 43 | */ |
44 | #define TARGET_DDR 0 | ||
45 | #define TARGET_DEV_BUS 1 | 44 | #define TARGET_DEV_BUS 1 |
46 | #define TARGET_PCI 3 | 45 | #define TARGET_PCI 3 |
47 | #define TARGET_PCIE 4 | 46 | #define TARGET_PCIE 4 |
@@ -57,27 +56,10 @@ | |||
57 | #define ATTR_DEV_BOOT 0xf | 56 | #define ATTR_DEV_BOOT 0xf |
58 | #define ATTR_SRAM 0x0 | 57 | #define ATTR_SRAM 0x0 |
59 | 58 | ||
60 | /* | ||
61 | * Helpers to get DDR bank info | ||
62 | */ | ||
63 | #define ORION5X_DDR_REG(x) (ORION5X_DDR_VIRT_BASE | (x)) | ||
64 | #define DDR_BASE_CS(n) ORION5X_DDR_REG(0x1500 + ((n) << 3)) | ||
65 | #define DDR_SIZE_CS(n) ORION5X_DDR_REG(0x1504 + ((n) << 3)) | ||
66 | |||
67 | /* | ||
68 | * CPU Address Decode Windows registers | ||
69 | */ | ||
70 | #define ORION5X_BRIDGE_REG(x) (ORION5X_BRIDGE_VIRT_BASE | (x)) | ||
71 | #define CPU_WIN_CTRL(n) ORION5X_BRIDGE_REG(0x000 | ((n) << 4)) | ||
72 | #define CPU_WIN_BASE(n) ORION5X_BRIDGE_REG(0x004 | ((n) << 4)) | ||
73 | #define CPU_WIN_REMAP_LO(n) ORION5X_BRIDGE_REG(0x008 | ((n) << 4)) | ||
74 | #define CPU_WIN_REMAP_HI(n) ORION5X_BRIDGE_REG(0x00c | ((n) << 4)) | ||
75 | |||
76 | |||
77 | struct mbus_dram_target_info orion5x_mbus_dram_info; | ||
78 | static int __initdata win_alloc_count; | 59 | static int __initdata win_alloc_count; |
79 | 60 | ||
80 | static int __init orion5x_cpu_win_can_remap(int win) | 61 | static int __init cpu_win_can_remap(const struct orion_addr_map_cfg *cfg, |
62 | const int win) | ||
81 | { | 63 | { |
82 | u32 dev, rev; | 64 | u32 dev, rev; |
83 | 65 | ||
@@ -91,116 +73,82 @@ static int __init orion5x_cpu_win_can_remap(int win) | |||
91 | return 0; | 73 | return 0; |
92 | } | 74 | } |
93 | 75 | ||
94 | static int __init setup_cpu_win(int win, u32 base, u32 size, | 76 | /* |
95 | u8 target, u8 attr, int remap) | 77 | * Description of the windows needed by the platform code |
96 | { | 78 | */ |
97 | if (win >= 8) { | 79 | static struct __initdata orion_addr_map_cfg addr_map_cfg = { |
98 | printk(KERN_ERR "setup_cpu_win: trying to allocate " | 80 | .num_wins = 8, |
99 | "window %d\n", win); | 81 | .cpu_win_can_remap = cpu_win_can_remap, |
100 | return -ENOSPC; | 82 | .bridge_virt_base = ORION5X_BRIDGE_VIRT_BASE, |
101 | } | 83 | }; |
102 | |||
103 | writel(base & 0xffff0000, CPU_WIN_BASE(win)); | ||
104 | writel(((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1, | ||
105 | CPU_WIN_CTRL(win)); | ||
106 | |||
107 | if (orion5x_cpu_win_can_remap(win)) { | ||
108 | if (remap < 0) | ||
109 | remap = base; | ||
110 | |||
111 | writel(remap & 0xffff0000, CPU_WIN_REMAP_LO(win)); | ||
112 | writel(0, CPU_WIN_REMAP_HI(win)); | ||
113 | } | ||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | void __init orion5x_setup_cpu_mbus_bridge(void) | ||
118 | { | ||
119 | int i; | ||
120 | int cs; | ||
121 | 84 | ||
85 | static const struct __initdata orion_addr_map_info addr_map_info[] = { | ||
122 | /* | 86 | /* |
123 | * First, disable and clear windows. | 87 | * Setup windows for PCI+PCIe IO+MEM space. |
124 | */ | 88 | */ |
125 | for (i = 0; i < 8; i++) { | 89 | { 0, ORION5X_PCIE_IO_PHYS_BASE, ORION5X_PCIE_IO_SIZE, |
126 | writel(0, CPU_WIN_BASE(i)); | 90 | TARGET_PCIE, ATTR_PCIE_IO, ORION5X_PCIE_IO_BUS_BASE |
127 | writel(0, CPU_WIN_CTRL(i)); | 91 | }, |
128 | if (orion5x_cpu_win_can_remap(i)) { | 92 | { 1, ORION5X_PCI_IO_PHYS_BASE, ORION5X_PCI_IO_SIZE, |
129 | writel(0, CPU_WIN_REMAP_LO(i)); | 93 | TARGET_PCI, ATTR_PCI_IO, ORION5X_PCI_IO_BUS_BASE |
130 | writel(0, CPU_WIN_REMAP_HI(i)); | 94 | }, |
131 | } | 95 | { 2, ORION5X_PCIE_MEM_PHYS_BASE, ORION5X_PCIE_MEM_SIZE, |
132 | } | 96 | TARGET_PCIE, ATTR_PCIE_MEM, -1 |
97 | }, | ||
98 | { 3, ORION5X_PCI_MEM_PHYS_BASE, ORION5X_PCI_MEM_SIZE, | ||
99 | TARGET_PCI, ATTR_PCI_MEM, -1 | ||
100 | }, | ||
101 | /* End marker */ | ||
102 | { -1, 0, 0, 0, 0, 0 } | ||
103 | }; | ||
133 | 104 | ||
105 | void __init orion5x_setup_cpu_mbus_bridge(void) | ||
106 | { | ||
134 | /* | 107 | /* |
135 | * Setup windows for PCI+PCIe IO+MEM space. | 108 | * Disable, clear and configure windows. |
136 | */ | 109 | */ |
137 | setup_cpu_win(0, ORION5X_PCIE_IO_PHYS_BASE, ORION5X_PCIE_IO_SIZE, | 110 | orion_config_wins(&addr_map_cfg, addr_map_info); |
138 | TARGET_PCIE, ATTR_PCIE_IO, ORION5X_PCIE_IO_BUS_BASE); | ||
139 | setup_cpu_win(1, ORION5X_PCI_IO_PHYS_BASE, ORION5X_PCI_IO_SIZE, | ||
140 | TARGET_PCI, ATTR_PCI_IO, ORION5X_PCI_IO_BUS_BASE); | ||
141 | setup_cpu_win(2, ORION5X_PCIE_MEM_PHYS_BASE, ORION5X_PCIE_MEM_SIZE, | ||
142 | TARGET_PCIE, ATTR_PCIE_MEM, -1); | ||
143 | setup_cpu_win(3, ORION5X_PCI_MEM_PHYS_BASE, ORION5X_PCI_MEM_SIZE, | ||
144 | TARGET_PCI, ATTR_PCI_MEM, -1); | ||
145 | win_alloc_count = 4; | 111 | win_alloc_count = 4; |
146 | 112 | ||
147 | /* | 113 | /* |
148 | * Setup MBUS dram target info. | 114 | * Setup MBUS dram target info. |
149 | */ | 115 | */ |
150 | orion5x_mbus_dram_info.mbus_dram_target_id = TARGET_DDR; | 116 | orion_setup_cpu_mbus_target(&addr_map_cfg, ORION5X_DDR_WINDOW_CPU_BASE); |
151 | |||
152 | for (i = 0, cs = 0; i < 4; i++) { | ||
153 | u32 base = readl(DDR_BASE_CS(i)); | ||
154 | u32 size = readl(DDR_SIZE_CS(i)); | ||
155 | |||
156 | /* | ||
157 | * Chip select enabled? | ||
158 | */ | ||
159 | if (size & 1) { | ||
160 | struct mbus_dram_window *w; | ||
161 | |||
162 | w = &orion5x_mbus_dram_info.cs[cs++]; | ||
163 | w->cs_index = i; | ||
164 | w->mbus_attr = 0xf & ~(1 << i); | ||
165 | w->base = base & 0xffff0000; | ||
166 | w->size = (size | 0x0000ffff) + 1; | ||
167 | } | ||
168 | } | ||
169 | orion5x_mbus_dram_info.num_cs = cs; | ||
170 | } | 117 | } |
171 | 118 | ||
172 | void __init orion5x_setup_dev_boot_win(u32 base, u32 size) | 119 | void __init orion5x_setup_dev_boot_win(u32 base, u32 size) |
173 | { | 120 | { |
174 | setup_cpu_win(win_alloc_count++, base, size, | 121 | orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size, |
175 | TARGET_DEV_BUS, ATTR_DEV_BOOT, -1); | 122 | TARGET_DEV_BUS, ATTR_DEV_BOOT, -1); |
176 | } | 123 | } |
177 | 124 | ||
178 | void __init orion5x_setup_dev0_win(u32 base, u32 size) | 125 | void __init orion5x_setup_dev0_win(u32 base, u32 size) |
179 | { | 126 | { |
180 | setup_cpu_win(win_alloc_count++, base, size, | 127 | orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size, |
181 | TARGET_DEV_BUS, ATTR_DEV_CS0, -1); | 128 | TARGET_DEV_BUS, ATTR_DEV_CS0, -1); |
182 | } | 129 | } |
183 | 130 | ||
184 | void __init orion5x_setup_dev1_win(u32 base, u32 size) | 131 | void __init orion5x_setup_dev1_win(u32 base, u32 size) |
185 | { | 132 | { |
186 | setup_cpu_win(win_alloc_count++, base, size, | 133 | orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size, |
187 | TARGET_DEV_BUS, ATTR_DEV_CS1, -1); | 134 | TARGET_DEV_BUS, ATTR_DEV_CS1, -1); |
188 | } | 135 | } |
189 | 136 | ||
190 | void __init orion5x_setup_dev2_win(u32 base, u32 size) | 137 | void __init orion5x_setup_dev2_win(u32 base, u32 size) |
191 | { | 138 | { |
192 | setup_cpu_win(win_alloc_count++, base, size, | 139 | orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size, |
193 | TARGET_DEV_BUS, ATTR_DEV_CS2, -1); | 140 | TARGET_DEV_BUS, ATTR_DEV_CS2, -1); |
194 | } | 141 | } |
195 | 142 | ||
196 | void __init orion5x_setup_pcie_wa_win(u32 base, u32 size) | 143 | void __init orion5x_setup_pcie_wa_win(u32 base, u32 size) |
197 | { | 144 | { |
198 | setup_cpu_win(win_alloc_count++, base, size, | 145 | orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size, |
199 | TARGET_PCIE, ATTR_PCIE_WA, -1); | 146 | TARGET_PCIE, ATTR_PCIE_WA, -1); |
200 | } | 147 | } |
201 | 148 | ||
202 | int __init orion5x_setup_sram_win(void) | 149 | void __init orion5x_setup_sram_win(void) |
203 | { | 150 | { |
204 | return setup_cpu_win(win_alloc_count++, ORION5X_SRAM_PHYS_BASE, | 151 | orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, |
205 | ORION5X_SRAM_SIZE, TARGET_SRAM, ATTR_SRAM, -1); | 152 | ORION5X_SRAM_PHYS_BASE, ORION5X_SRAM_SIZE, |
153 | TARGET_SRAM, ATTR_SRAM, -1); | ||
206 | } | 154 | } |
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 22ace0bf2f92..79ef693d2c03 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/dma-mapping.h> | 16 | #include <linux/dma-mapping.h> |
17 | #include <linux/serial_8250.h> | 17 | #include <linux/serial_8250.h> |
18 | #include <linux/mbus.h> | ||
19 | #include <linux/mv643xx_i2c.h> | 18 | #include <linux/mv643xx_i2c.h> |
20 | #include <linux/ata_platform.h> | 19 | #include <linux/ata_platform.h> |
21 | #include <net/dsa.h> | 20 | #include <net/dsa.h> |
@@ -31,6 +30,7 @@ | |||
31 | #include <plat/orion_nand.h> | 30 | #include <plat/orion_nand.h> |
32 | #include <plat/time.h> | 31 | #include <plat/time.h> |
33 | #include <plat/common.h> | 32 | #include <plat/common.h> |
33 | #include <plat/addr-map.h> | ||
34 | #include "common.h" | 34 | #include "common.h" |
35 | 35 | ||
36 | /***************************************************************************** | 36 | /***************************************************************************** |
@@ -71,8 +71,7 @@ void __init orion5x_map_io(void) | |||
71 | ****************************************************************************/ | 71 | ****************************************************************************/ |
72 | void __init orion5x_ehci0_init(void) | 72 | void __init orion5x_ehci0_init(void) |
73 | { | 73 | { |
74 | orion_ehci_init(&orion5x_mbus_dram_info, | 74 | orion_ehci_init(ORION5X_USB0_PHYS_BASE, IRQ_ORION5X_USB0_CTRL); |
75 | ORION5X_USB0_PHYS_BASE, IRQ_ORION5X_USB0_CTRL); | ||
76 | } | 75 | } |
77 | 76 | ||
78 | 77 | ||
@@ -81,8 +80,7 @@ void __init orion5x_ehci0_init(void) | |||
81 | ****************************************************************************/ | 80 | ****************************************************************************/ |
82 | void __init orion5x_ehci1_init(void) | 81 | void __init orion5x_ehci1_init(void) |
83 | { | 82 | { |
84 | orion_ehci_1_init(&orion5x_mbus_dram_info, | 83 | orion_ehci_1_init(ORION5X_USB1_PHYS_BASE, IRQ_ORION5X_USB1_CTRL); |
85 | ORION5X_USB1_PHYS_BASE, IRQ_ORION5X_USB1_CTRL); | ||
86 | } | 84 | } |
87 | 85 | ||
88 | 86 | ||
@@ -91,7 +89,7 @@ void __init orion5x_ehci1_init(void) | |||
91 | ****************************************************************************/ | 89 | ****************************************************************************/ |
92 | void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) | 90 | void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) |
93 | { | 91 | { |
94 | orion_ge00_init(eth_data, &orion5x_mbus_dram_info, | 92 | orion_ge00_init(eth_data, |
95 | ORION5X_ETH_PHYS_BASE, IRQ_ORION5X_ETH_SUM, | 93 | ORION5X_ETH_PHYS_BASE, IRQ_ORION5X_ETH_SUM, |
96 | IRQ_ORION5X_ETH_ERR, orion5x_tclk); | 94 | IRQ_ORION5X_ETH_ERR, orion5x_tclk); |
97 | } | 95 | } |
@@ -121,8 +119,7 @@ void __init orion5x_i2c_init(void) | |||
121 | ****************************************************************************/ | 119 | ****************************************************************************/ |
122 | void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data) | 120 | void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data) |
123 | { | 121 | { |
124 | orion_sata_init(sata_data, &orion5x_mbus_dram_info, | 122 | orion_sata_init(sata_data, ORION5X_SATA_PHYS_BASE, IRQ_ORION5X_SATA); |
125 | ORION5X_SATA_PHYS_BASE, IRQ_ORION5X_SATA); | ||
126 | } | 123 | } |
127 | 124 | ||
128 | 125 | ||
@@ -158,8 +155,7 @@ void __init orion5x_uart1_init(void) | |||
158 | ****************************************************************************/ | 155 | ****************************************************************************/ |
159 | void __init orion5x_xor_init(void) | 156 | void __init orion5x_xor_init(void) |
160 | { | 157 | { |
161 | orion_xor0_init(&orion5x_mbus_dram_info, | 158 | orion_xor0_init(ORION5X_XOR_PHYS_BASE, |
162 | ORION5X_XOR_PHYS_BASE, | ||
163 | ORION5X_XOR_PHYS_BASE + 0x200, | 159 | ORION5X_XOR_PHYS_BASE + 0x200, |
164 | IRQ_ORION5X_XOR0, IRQ_ORION5X_XOR1); | 160 | IRQ_ORION5X_XOR0, IRQ_ORION5X_XOR1); |
165 | } | 161 | } |
@@ -169,12 +165,7 @@ void __init orion5x_xor_init(void) | |||
169 | ****************************************************************************/ | 165 | ****************************************************************************/ |
170 | static void __init orion5x_crypto_init(void) | 166 | static void __init orion5x_crypto_init(void) |
171 | { | 167 | { |
172 | int ret; | 168 | orion5x_setup_sram_win(); |
173 | |||
174 | ret = orion5x_setup_sram_win(); | ||
175 | if (ret) | ||
176 | return; | ||
177 | |||
178 | orion_crypto_init(ORION5X_CRYPTO_PHYS_BASE, ORION5X_SRAM_PHYS_BASE, | 169 | orion_crypto_init(ORION5X_CRYPTO_PHYS_BASE, ORION5X_SRAM_PHYS_BASE, |
179 | SZ_8K, IRQ_ORION5X_CESA); | 170 | SZ_8K, IRQ_ORION5X_CESA); |
180 | } | 171 | } |
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index 909489f4d23e..889d80c7a151 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h | |||
@@ -20,14 +20,13 @@ extern struct sys_timer orion5x_timer; | |||
20 | * functions to map its interfaces and by the machine-setup to map its on- | 20 | * functions to map its interfaces and by the machine-setup to map its on- |
21 | * board devices. Details in /mach-orion/addr-map.c | 21 | * board devices. Details in /mach-orion/addr-map.c |
22 | */ | 22 | */ |
23 | extern struct mbus_dram_target_info orion5x_mbus_dram_info; | ||
24 | void orion5x_setup_cpu_mbus_bridge(void); | 23 | void orion5x_setup_cpu_mbus_bridge(void); |
25 | void orion5x_setup_dev_boot_win(u32 base, u32 size); | 24 | void orion5x_setup_dev_boot_win(u32 base, u32 size); |
26 | void orion5x_setup_dev0_win(u32 base, u32 size); | 25 | void orion5x_setup_dev0_win(u32 base, u32 size); |
27 | void orion5x_setup_dev1_win(u32 base, u32 size); | 26 | void orion5x_setup_dev1_win(u32 base, u32 size); |
28 | void orion5x_setup_dev2_win(u32 base, u32 size); | 27 | void orion5x_setup_dev2_win(u32 base, u32 size); |
29 | void orion5x_setup_pcie_wa_win(u32 base, u32 size); | 28 | void orion5x_setup_pcie_wa_win(u32 base, u32 size); |
30 | int orion5x_setup_sram_win(void); | 29 | void orion5x_setup_sram_win(void); |
31 | 30 | ||
32 | void orion5x_ehci0_init(void); | 31 | void orion5x_ehci0_init(void); |
33 | void orion5x_ehci1_init(void); | 32 | void orion5x_ehci1_init(void); |
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h index 0a28bbc76891..2745f5d95b3f 100644 --- a/arch/arm/mach-orion5x/include/mach/orion5x.h +++ b/arch/arm/mach-orion5x/include/mach/orion5x.h | |||
@@ -69,7 +69,7 @@ | |||
69 | ******************************************************************************/ | 69 | ******************************************************************************/ |
70 | 70 | ||
71 | #define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x00000) | 71 | #define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x00000) |
72 | 72 | #define ORION5X_DDR_WINDOW_CPU_BASE (ORION5X_DDR_VIRT_BASE | 0x1500) | |
73 | #define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000) | 73 | #define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000) |
74 | #define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000) | 74 | #define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000) |
75 | #define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x)) | 75 | #define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x)) |
diff --git a/arch/arm/mach-orion5x/mpp.c b/arch/arm/mach-orion5x/mpp.c index b6ddd7a5db6a..5b70026f478c 100644 --- a/arch/arm/mach-orion5x/mpp.c +++ b/arch/arm/mach-orion5x/mpp.c | |||
@@ -10,7 +10,6 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/mbus.h> | ||
14 | #include <linux/io.h> | 13 | #include <linux/io.h> |
15 | #include <mach/hardware.h> | 14 | #include <mach/hardware.h> |
16 | #include <plat/mpp.h> | 15 | #include <plat/mpp.h> |
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index bc4a920e26ee..a494c470e3e4 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
19 | #include <asm/mach/pci.h> | 19 | #include <asm/mach/pci.h> |
20 | #include <plat/pcie.h> | 20 | #include <plat/pcie.h> |
21 | #include <plat/addr-map.h> | ||
21 | #include "common.h" | 22 | #include "common.h" |
22 | 23 | ||
23 | /***************************************************************************** | 24 | /***************************************************************************** |
@@ -145,7 +146,7 @@ static int __init pcie_setup(struct pci_sys_data *sys) | |||
145 | /* | 146 | /* |
146 | * Generic PCIe unit setup. | 147 | * Generic PCIe unit setup. |
147 | */ | 148 | */ |
148 | orion_pcie_setup(PCIE_BASE, &orion5x_mbus_dram_info); | 149 | orion_pcie_setup(PCIE_BASE); |
149 | 150 | ||
150 | /* | 151 | /* |
151 | * Check whether to apply Orion-1/Orion-NAS PCIe config | 152 | * Check whether to apply Orion-1/Orion-NAS PCIe config |
@@ -477,7 +478,7 @@ static int __init pci_setup(struct pci_sys_data *sys) | |||
477 | /* | 478 | /* |
478 | * Point PCI unit MBUS decode windows to DRAM space. | 479 | * Point PCI unit MBUS decode windows to DRAM space. |
479 | */ | 480 | */ |
480 | orion5x_setup_pci_wins(&orion5x_mbus_dram_info); | 481 | orion5x_setup_pci_wins(&orion_mbus_dram_info); |
481 | 482 | ||
482 | /* | 483 | /* |
483 | * Master + Slave enable | 484 | * Master + Slave enable |
diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c index cb53160f6c5d..26ebb57719df 100644 --- a/arch/arm/mach-prima2/pm.c +++ b/arch/arm/mach-prima2/pm.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/suspend.h> | 10 | #include <linux/suspend.h> |
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/module.h> | ||
12 | #include <linux/of.h> | 13 | #include <linux/of.h> |
13 | #include <linux/of_address.h> | 14 | #include <linux/of_address.h> |
14 | #include <linux/of_device.h> | 15 | #include <linux/of_device.h> |
diff --git a/arch/arm/mach-prima2/prima2.c b/arch/arm/mach-prima2/prima2.c index ef555c041962..a12b689a8702 100644 --- a/arch/arm/mach-prima2/prima2.c +++ b/arch/arm/mach-prima2/prima2.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <asm/sizes.h> | ||
11 | #include <asm/mach-types.h> | 12 | #include <asm/mach-types.h> |
12 | #include <asm/mach/arch.h> | 13 | #include <asm/mach/arch.h> |
13 | #include <linux/of.h> | 14 | #include <linux/of.h> |
diff --git a/arch/arm/mach-s3c64xx/dev-spi.c b/arch/arm/mach-s3c64xx/dev-spi.c index 5e6b42089eb4..3341fd118723 100644 --- a/arch/arm/mach-s3c64xx/dev-spi.c +++ b/arch/arm/mach-s3c64xx/dev-spi.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
13 | #include <linux/export.h> | ||
13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
14 | #include <linux/dma-mapping.h> | 15 | #include <linux/dma-mapping.h> |
15 | #include <linux/gpio.h> | 16 | #include <linux/gpio.h> |
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c index 7a3bc32df425..51c00f2453c6 100644 --- a/arch/arm/mach-s3c64xx/s3c6400.c +++ b/arch/arm/mach-s3c64xx/s3c6400.c | |||
@@ -70,7 +70,7 @@ void __init s3c6400_init_irq(void) | |||
70 | s3c64xx_init_irq(~0 & ~(0xf << 5), ~0); | 70 | s3c64xx_init_irq(~0 & ~(0xf << 5), ~0); |
71 | } | 71 | } |
72 | 72 | ||
73 | struct sysdev_class s3c6400_sysclass = { | 73 | static struct sysdev_class s3c6400_sysclass = { |
74 | .name = "s3c6400-core", | 74 | .name = "s3c6400-core", |
75 | }; | 75 | }; |
76 | 76 | ||
diff --git a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c index 83d2afb79e9f..2cf80026c58d 100644 --- a/arch/arm/mach-s3c64xx/setup-fb-24bpp.c +++ b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <plat/fb.h> | 20 | #include <plat/fb.h> |
21 | #include <plat/gpio-cfg.h> | 21 | #include <plat/gpio-cfg.h> |
22 | 22 | ||
23 | extern void s3c64xx_fb_gpio_setup_24bpp(void) | 23 | void s3c64xx_fb_gpio_setup_24bpp(void) |
24 | { | 24 | { |
25 | s3c_gpio_cfgrange_nopull(S3C64XX_GPI(0), 16, S3C_GPIO_SFN(2)); | 25 | s3c_gpio_cfgrange_nopull(S3C64XX_GPI(0), 16, S3C_GPIO_SFN(2)); |
26 | s3c_gpio_cfgrange_nopull(S3C64XX_GPJ(0), 12, S3C_GPIO_SFN(2)); | 26 | s3c_gpio_cfgrange_nopull(S3C64XX_GPJ(0), 12, S3C_GPIO_SFN(2)); |
diff --git a/arch/arm/mach-sa1100/Makefile.boot b/arch/arm/mach-sa1100/Makefile.boot index 5a616f6e5612..f7951aa04562 100644 --- a/arch/arm/mach-sa1100/Makefile.boot +++ b/arch/arm/mach-sa1100/Makefile.boot | |||
@@ -1,5 +1,5 @@ | |||
1 | ifeq ($(CONFIG_ARCH_SA1100),y) | 1 | ifeq ($(CONFIG_SA1111),y) |
2 | zreladdr-$(CONFIG_SA1111) += 0xc0208000 | 2 | zreladdr-y += 0xc0208000 |
3 | else | 3 | else |
4 | zreladdr-y += 0xc0008000 | 4 | zreladdr-y += 0xc0008000 |
5 | endif | 5 | endif |
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index 6826faeecc68..cf93dca97b9a 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c | |||
@@ -132,6 +132,42 @@ void mop500_sdi_tc35892_init(void) | |||
132 | } | 132 | } |
133 | 133 | ||
134 | /* | 134 | /* |
135 | * SDI1 (SDIO WLAN) | ||
136 | */ | ||
137 | #ifdef CONFIG_STE_DMA40 | ||
138 | static struct stedma40_chan_cfg sdi1_dma_cfg_rx = { | ||
139 | .mode = STEDMA40_MODE_LOGICAL, | ||
140 | .dir = STEDMA40_PERIPH_TO_MEM, | ||
141 | .src_dev_type = DB8500_DMA_DEV32_SD_MM1_RX, | ||
142 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
143 | .src_info.data_width = STEDMA40_WORD_WIDTH, | ||
144 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | ||
145 | }; | ||
146 | |||
147 | static struct stedma40_chan_cfg sdi1_dma_cfg_tx = { | ||
148 | .mode = STEDMA40_MODE_LOGICAL, | ||
149 | .dir = STEDMA40_MEM_TO_PERIPH, | ||
150 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | ||
151 | .dst_dev_type = DB8500_DMA_DEV32_SD_MM1_TX, | ||
152 | .src_info.data_width = STEDMA40_WORD_WIDTH, | ||
153 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | ||
154 | }; | ||
155 | #endif | ||
156 | |||
157 | static struct mmci_platform_data mop500_sdi1_data = { | ||
158 | .ocr_mask = MMC_VDD_29_30, | ||
159 | .f_max = 50000000, | ||
160 | .capabilities = MMC_CAP_4_BIT_DATA, | ||
161 | .gpio_cd = -1, | ||
162 | .gpio_wp = -1, | ||
163 | #ifdef CONFIG_STE_DMA40 | ||
164 | .dma_filter = stedma40_filter, | ||
165 | .dma_rx_param = &sdi1_dma_cfg_rx, | ||
166 | .dma_tx_param = &sdi1_dma_cfg_tx, | ||
167 | #endif | ||
168 | }; | ||
169 | |||
170 | /* | ||
135 | * SDI 2 (POP eMMC, not on DB8500ed) | 171 | * SDI 2 (POP eMMC, not on DB8500ed) |
136 | */ | 172 | */ |
137 | 173 | ||
@@ -260,4 +296,6 @@ void __init hrefv60_sdi_init(void) | |||
260 | sdi0_en = HREFV60_SDMMC_EN_GPIO; | 296 | sdi0_en = HREFV60_SDMMC_EN_GPIO; |
261 | sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO; | 297 | sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO; |
262 | sdi0_configure(); | 298 | sdi0_configure(); |
299 | |||
300 | db8500_add_sdi1(&mop500_sdi1_data, periphid); | ||
263 | } | 301 | } |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index de1f5f8f7330..9361a5290177 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -673,7 +673,7 @@ static void __init hrefv60_init_machine(void) | |||
673 | ARRAY_SIZE(mop500_platform_devs)); | 673 | ARRAY_SIZE(mop500_platform_devs)); |
674 | 674 | ||
675 | mop500_i2c_init(); | 675 | mop500_i2c_init(); |
676 | mop500_sdi_init(); | 676 | hrefv60_sdi_init(); |
677 | mop500_spi_init(); | 677 | mop500_spi_init(); |
678 | mop500_uart_init(); | 678 | mop500_uart_init(); |
679 | 679 | ||
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index de18a2a23e6e..f926d3db6207 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h | |||
@@ -7,40 +7,77 @@ | |||
7 | #ifndef __BOARD_MOP500_H | 7 | #ifndef __BOARD_MOP500_H |
8 | #define __BOARD_MOP500_H | 8 | #define __BOARD_MOP500_H |
9 | 9 | ||
10 | /* snowball GPIO for MMC card */ | 10 | /* Snowball specific GPIO assignments, this board has no GPIO expander */ |
11 | #define SNOWBALL_SDMMC_EN_GPIO 217 | 11 | #define SNOWBALL_ACCEL_INT1_GPIO 163 |
12 | #define SNOWBALL_SDMMC_1V8_3V_GPIO 228 | 12 | #define SNOWBALL_ACCEL_INT2_GPIO 164 |
13 | #define SNOWBALL_SDMMC_CD_GPIO 218 | 13 | #define SNOWBALL_MAGNET_DRDY_GPIO 165 |
14 | #define SNOWBALL_SDMMC_EN_GPIO 217 | ||
15 | #define SNOWBALL_SDMMC_1V8_3V_GPIO 228 | ||
16 | #define SNOWBALL_SDMMC_CD_GPIO 218 | ||
14 | 17 | ||
15 | /* HREFv60-specific GPIO assignments, this board has no GPIO expander */ | 18 | /* HREFv60-specific GPIO assignments, this board has no GPIO expander */ |
16 | #define HREFV60_TOUCH_RST_GPIO 143 | ||
17 | #define HREFV60_PROX_SENSE_GPIO 217 | ||
18 | #define HREFV60_HAL_SW_GPIO 145 | ||
19 | #define HREFV60_SDMMC_EN_GPIO 169 | ||
20 | #define HREFV60_SDMMC_1V8_3V_GPIO 5 | 19 | #define HREFV60_SDMMC_1V8_3V_GPIO 5 |
21 | #define HREFV60_SDMMC_CD_GPIO 95 | 20 | #define HREFV60_CAMERA_FLASH_ENABLE 21 |
22 | #define HREFV60_ACCEL_INT1_GPIO 82 | ||
23 | #define HREFV60_ACCEL_INT2_GPIO 83 | ||
24 | #define HREFV60_MAGNET_DRDY_GPIO 32 | 21 | #define HREFV60_MAGNET_DRDY_GPIO 32 |
25 | #define HREFV60_DISP1_RST_GPIO 65 | 22 | #define HREFV60_DISP1_RST_GPIO 65 |
26 | #define HREFV60_DISP2_RST_GPIO 66 | 23 | #define HREFV60_DISP2_RST_GPIO 66 |
24 | #define HREFV60_ACCEL_INT1_GPIO 82 | ||
25 | #define HREFV60_ACCEL_INT2_GPIO 83 | ||
26 | #define HREFV60_SDMMC_CD_GPIO 95 | ||
27 | #define HREFV60_XSHUTDOWN_SECONDARY_SENSOR 140 | ||
28 | #define HREFV60_TOUCH_RST_GPIO 143 | ||
29 | #define HREFV60_HAL_SW_GPIO 145 | ||
30 | #define HREFV60_SDMMC_EN_GPIO 169 | ||
31 | #define HREFV60_MMIO_XENON_CHARGE 170 | ||
32 | #define HREFV60_PROX_SENSE_GPIO 217 | ||
33 | |||
34 | /* MOP500 generic GPIOs */ | ||
35 | #define CAMERA_FLASH_INT_PIN 7 | ||
36 | #define CYPRESS_TOUCH_INT_PIN 84 | ||
37 | #define XSHUTDOWN_PRIMARY_SENSOR 141 | ||
38 | #define XSHUTDOWN_SECONDARY_SENSOR 142 | ||
39 | #define CYPRESS_TOUCH_RST_GPIO 143 | ||
40 | #define MOP500_HDMI_RST_GPIO 196 | ||
41 | #define CYPRESS_SLAVE_SELECT_GPIO 216 | ||
27 | 42 | ||
28 | /* GPIOs on the TC35892 expander */ | 43 | /* GPIOs on the TC35892 expander */ |
29 | #define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x)) | 44 | #define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x)) |
45 | #define GPIO_MAGNET_DRDY MOP500_EGPIO(1) | ||
30 | #define GPIO_SDMMC_CD MOP500_EGPIO(3) | 46 | #define GPIO_SDMMC_CD MOP500_EGPIO(3) |
47 | #define GPIO_CAMERA_FLASH_ENABLE MOP500_EGPIO(4) | ||
48 | #define GPIO_MMIO_XENON_CHARGE MOP500_EGPIO(5) | ||
31 | #define GPIO_PROX_SENSOR MOP500_EGPIO(7) | 49 | #define GPIO_PROX_SENSOR MOP500_EGPIO(7) |
50 | #define GPIO_HAL_SENSOR MOP500_EGPIO(8) | ||
51 | #define GPIO_ACCEL_INT1 MOP500_EGPIO(10) | ||
52 | #define GPIO_ACCEL_INT2 MOP500_EGPIO(11) | ||
32 | #define GPIO_BU21013_CS MOP500_EGPIO(13) | 53 | #define GPIO_BU21013_CS MOP500_EGPIO(13) |
54 | #define MOP500_DISP2_RST_GPIO MOP500_EGPIO(14) | ||
55 | #define MOP500_DISP1_RST_GPIO MOP500_EGPIO(15) | ||
33 | #define GPIO_SDMMC_EN MOP500_EGPIO(17) | 56 | #define GPIO_SDMMC_EN MOP500_EGPIO(17) |
34 | #define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18) | 57 | #define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18) |
35 | #define MOP500_EGPIO_END MOP500_EGPIO(24) | 58 | #define MOP500_EGPIO_END MOP500_EGPIO(24) |
36 | 59 | ||
37 | /* GPIOs on the AB8500 mixed-signals circuit */ | 60 | /* |
38 | #define MOP500_AB8500_GPIO(x) (MOP500_EGPIO_END + (x)) | 61 | * GPIOs on the AB8500 mixed-signals circuit |
62 | * Notice that we subtract 1 from the number passed into the macro, this is | ||
63 | * because the AB8500 GPIO pins are enumbered starting from 1, so the value in | ||
64 | * parens matches the GPIO pin number in the data sheet. | ||
65 | */ | ||
66 | #define MOP500_AB8500_GPIO(x) (MOP500_EGPIO_END + (x) - 1) | ||
67 | /*Snowball AB8500 GPIO */ | ||
68 | #define SNOWBALL_VSMPS2_1V8_GPIO MOP500_AB8500_PIN_GPIO(1) /* SYSCLKREQ2/GPIO1 */ | ||
69 | #define SNOWBALL_PM_GPIO1_GPIO MOP500_AB8500_PIN_GPIO(2) /* SYSCLKREQ3/GPIO2 */ | ||
70 | #define SNOWBALL_WLAN_CLK_REQ_GPIO MOP500_AB8500_PIN_GPIO(3) /* SYSCLKREQ4/GPIO3 */ | ||
71 | #define SNOWBALL_PM_GPIO4_GPIO MOP500_AB8500_PIN_GPIO(4) /* SYSCLKREQ6/GPIO4 */ | ||
72 | #define SNOWBALL_EN_3V6_GPIO MOP500_AB8500_PIN_GPIO(16) /* PWMOUT3/GPIO16 */ | ||
73 | #define SNOWBALL_PME_ETH_GPIO MOP500_AB8500_PIN_GPIO(24) /* SYSCLKREQ7/GPIO24 */ | ||
74 | #define SNOWBALL_EN_3V3_ETH_GPIO MOP500_AB8500_PIN_GPIO(26) /* GPIO26 */ | ||
39 | 75 | ||
40 | struct i2c_board_info; | 76 | struct i2c_board_info; |
41 | 77 | ||
42 | extern void mop500_sdi_init(void); | 78 | extern void mop500_sdi_init(void); |
43 | extern void snowball_sdi_init(void); | 79 | extern void snowball_sdi_init(void); |
80 | extern void hrefv60_sdi_init(void); | ||
44 | extern void mop500_sdi_tc35892_init(void); | 81 | extern void mop500_sdi_tc35892_init(void); |
45 | void __init mop500_u8500uib_init(void); | 82 | void __init mop500_u8500uib_init(void); |
46 | void __init mop500_stuib_init(void); | 83 | void __init mop500_stuib_init(void); |
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h index 387a9638991b..b299b8d201c8 100644 --- a/arch/arm/plat-omap/include/plat/clkdev_omap.h +++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h | |||
@@ -40,6 +40,7 @@ struct omap_clk { | |||
40 | #define CK_443X (1 << 11) | 40 | #define CK_443X (1 << 11) |
41 | #define CK_TI816X (1 << 12) | 41 | #define CK_TI816X (1 << 12) |
42 | #define CK_446X (1 << 13) | 42 | #define CK_446X (1 << 13) |
43 | #define CK_1710 (1 << 15) /* 1710 extra for rate selection */ | ||
43 | 44 | ||
44 | 45 | ||
45 | #define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS) | 46 | #define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS) |
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 8b28664d1c62..6b058a621e8d 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -141,11 +141,9 @@ static void __init omap_detect_sram(void) | |||
141 | omap_sram_size = 0x32000; /* 200K */ | 141 | omap_sram_size = 0x32000; /* 200K */ |
142 | else if (cpu_is_omap15xx()) | 142 | else if (cpu_is_omap15xx()) |
143 | omap_sram_size = 0x30000; /* 192K */ | 143 | omap_sram_size = 0x30000; /* 192K */ |
144 | else if (cpu_is_omap1610() || cpu_is_omap1621() || | 144 | else if (cpu_is_omap1610() || cpu_is_omap1611() || |
145 | cpu_is_omap1710()) | 145 | cpu_is_omap1621() || cpu_is_omap1710()) |
146 | omap_sram_size = 0x4000; /* 16K */ | 146 | omap_sram_size = 0x4000; /* 16K */ |
147 | else if (cpu_is_omap1611()) | ||
148 | omap_sram_size = SZ_256K; | ||
149 | else { | 147 | else { |
150 | pr_err("Could not detect SRAM size\n"); | 148 | pr_err("Could not detect SRAM size\n"); |
151 | omap_sram_size = 0x4000; | 149 | omap_sram_size = 0x4000; |
@@ -224,6 +222,9 @@ static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl); | |||
224 | void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl) | 222 | void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl) |
225 | { | 223 | { |
226 | BUG_ON(!_omap_sram_reprogram_clock); | 224 | BUG_ON(!_omap_sram_reprogram_clock); |
225 | /* On 730, bit 13 must always be 1 */ | ||
226 | if (cpu_is_omap7xx()) | ||
227 | ckctl |= 0x2000; | ||
227 | _omap_sram_reprogram_clock(dpllctl, ckctl); | 228 | _omap_sram_reprogram_clock(dpllctl, ckctl); |
228 | } | 229 | } |
229 | 230 | ||
diff --git a/arch/arm/plat-orion/Makefile b/arch/arm/plat-orion/Makefile index 95a5fc53b6db..c20ce0f5ce33 100644 --- a/arch/arm/plat-orion/Makefile +++ b/arch/arm/plat-orion/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := irq.o pcie.o time.o common.o mpp.o | 5 | obj-y := irq.o pcie.o time.o common.o mpp.o addr-map.o |
6 | obj-m := | 6 | obj-m := |
7 | obj-n := | 7 | obj-n := |
8 | obj- := | 8 | obj- := |
diff --git a/arch/arm/plat-orion/addr-map.c b/arch/arm/plat-orion/addr-map.c new file mode 100644 index 000000000000..367ca89ac403 --- /dev/null +++ b/arch/arm/plat-orion/addr-map.c | |||
@@ -0,0 +1,174 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-orion/addr-map.c | ||
3 | * | ||
4 | * Address map functions for Marvell Orion based SoCs | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/mbus.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <plat/addr-map.h> | ||
17 | |||
18 | struct mbus_dram_target_info orion_mbus_dram_info; | ||
19 | |||
20 | const struct mbus_dram_target_info *mv_mbus_dram_info(void) | ||
21 | { | ||
22 | return &orion_mbus_dram_info; | ||
23 | } | ||
24 | EXPORT_SYMBOL_GPL(mv_mbus_dram_info); | ||
25 | |||
26 | /* | ||
27 | * DDR target is the same on all Orion platforms. | ||
28 | */ | ||
29 | #define TARGET_DDR 0 | ||
30 | |||
31 | /* | ||
32 | * Helpers to get DDR bank info | ||
33 | */ | ||
34 | #define DDR_BASE_CS_OFF(n) (0x0000 + ((n) << 3)) | ||
35 | #define DDR_SIZE_CS_OFF(n) (0x0004 + ((n) << 3)) | ||
36 | |||
37 | /* | ||
38 | * CPU Address Decode Windows registers | ||
39 | */ | ||
40 | #define WIN_CTRL_OFF 0x0000 | ||
41 | #define WIN_BASE_OFF 0x0004 | ||
42 | #define WIN_REMAP_LO_OFF 0x0008 | ||
43 | #define WIN_REMAP_HI_OFF 0x000c | ||
44 | |||
45 | /* | ||
46 | * Default implementation | ||
47 | */ | ||
48 | static void __init __iomem * | ||
49 | orion_win_cfg_base(const struct orion_addr_map_cfg *cfg, int win) | ||
50 | { | ||
51 | return (void __iomem *)(cfg->bridge_virt_base + (win << 4)); | ||
52 | } | ||
53 | |||
54 | /* | ||
55 | * Default implementation | ||
56 | */ | ||
57 | static int __init orion_cpu_win_can_remap(const struct orion_addr_map_cfg *cfg, | ||
58 | const int win) | ||
59 | { | ||
60 | if (win < cfg->remappable_wins) | ||
61 | return 1; | ||
62 | |||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg, | ||
67 | const int win, const u32 base, | ||
68 | const u32 size, const u8 target, | ||
69 | const u8 attr, const int remap) | ||
70 | { | ||
71 | void __iomem *addr = cfg->win_cfg_base(cfg, win); | ||
72 | u32 ctrl, base_high, remap_addr; | ||
73 | |||
74 | if (win >= cfg->num_wins) { | ||
75 | printk(KERN_ERR "setup_cpu_win: trying to allocate window " | ||
76 | "%d when only %d allowed\n", win, cfg->num_wins); | ||
77 | } | ||
78 | |||
79 | base_high = base & 0xffff0000; | ||
80 | ctrl = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1; | ||
81 | |||
82 | writel(base_high, addr + WIN_BASE_OFF); | ||
83 | writel(ctrl, addr + WIN_CTRL_OFF); | ||
84 | if (cfg->cpu_win_can_remap(cfg, win)) { | ||
85 | if (remap < 0) | ||
86 | remap_addr = base; | ||
87 | else | ||
88 | remap_addr = remap; | ||
89 | writel(remap_addr & 0xffff0000, addr + WIN_REMAP_LO_OFF); | ||
90 | writel(0, addr + WIN_REMAP_HI_OFF); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | /* | ||
95 | * Configure a number of windows. | ||
96 | */ | ||
97 | static void __init orion_setup_cpu_wins(const struct orion_addr_map_cfg * cfg, | ||
98 | const struct orion_addr_map_info *info) | ||
99 | { | ||
100 | while (info->win != -1) { | ||
101 | orion_setup_cpu_win(cfg, info->win, info->base, info->size, | ||
102 | info->target, info->attr, info->remap); | ||
103 | info++; | ||
104 | } | ||
105 | } | ||
106 | |||
107 | static void __init orion_disable_wins(const struct orion_addr_map_cfg * cfg) | ||
108 | { | ||
109 | void __iomem *addr; | ||
110 | int i; | ||
111 | |||
112 | for (i = 0; i < cfg->num_wins; i++) { | ||
113 | addr = cfg->win_cfg_base(cfg, i); | ||
114 | |||
115 | writel(0, addr + WIN_BASE_OFF); | ||
116 | writel(0, addr + WIN_CTRL_OFF); | ||
117 | if (cfg->cpu_win_can_remap(cfg, i)) { | ||
118 | writel(0, addr + WIN_REMAP_LO_OFF); | ||
119 | writel(0, addr + WIN_REMAP_HI_OFF); | ||
120 | } | ||
121 | } | ||
122 | } | ||
123 | |||
124 | /* | ||
125 | * Disable, clear and configure windows. | ||
126 | */ | ||
127 | void __init orion_config_wins(struct orion_addr_map_cfg * cfg, | ||
128 | const struct orion_addr_map_info *info) | ||
129 | { | ||
130 | if (!cfg->cpu_win_can_remap) | ||
131 | cfg->cpu_win_can_remap = orion_cpu_win_can_remap; | ||
132 | |||
133 | if (!cfg->win_cfg_base) | ||
134 | cfg->win_cfg_base = orion_win_cfg_base; | ||
135 | |||
136 | orion_disable_wins(cfg); | ||
137 | |||
138 | if (info) | ||
139 | orion_setup_cpu_wins(cfg, info); | ||
140 | } | ||
141 | |||
142 | /* | ||
143 | * Setup MBUS dram target info. | ||
144 | */ | ||
145 | void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, | ||
146 | const u32 ddr_window_cpu_base) | ||
147 | { | ||
148 | void __iomem *addr; | ||
149 | int i; | ||
150 | int cs; | ||
151 | |||
152 | orion_mbus_dram_info.mbus_dram_target_id = TARGET_DDR; | ||
153 | |||
154 | addr = (void __iomem *)ddr_window_cpu_base; | ||
155 | |||
156 | for (i = 0, cs = 0; i < 4; i++) { | ||
157 | u32 base = readl(addr + DDR_BASE_CS_OFF(i)); | ||
158 | u32 size = readl(addr + DDR_SIZE_CS_OFF(i)); | ||
159 | |||
160 | /* | ||
161 | * Chip select enabled? | ||
162 | */ | ||
163 | if (size & 1) { | ||
164 | struct mbus_dram_window *w; | ||
165 | |||
166 | w = &orion_mbus_dram_info.cs[cs++]; | ||
167 | w->cs_index = i; | ||
168 | w->mbus_attr = 0xf & ~(1 << i); | ||
169 | w->base = base & 0xffff0000; | ||
170 | w->size = (size | 0x0000ffff) + 1; | ||
171 | } | ||
172 | } | ||
173 | orion_mbus_dram_info.num_cs = cs; | ||
174 | } | ||
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index 9e5451b3c8e3..e5a2fde29b19 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/dma-mapping.h> | 14 | #include <linux/dma-mapping.h> |
15 | #include <linux/serial_8250.h> | 15 | #include <linux/serial_8250.h> |
16 | #include <linux/mbus.h> | ||
17 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
18 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
19 | #include <linux/mv643xx_i2c.h> | 18 | #include <linux/mv643xx_i2c.h> |
@@ -203,13 +202,12 @@ void __init orion_rtc_init(unsigned long mapbase, | |||
203 | ****************************************************************************/ | 202 | ****************************************************************************/ |
204 | static __init void ge_complete( | 203 | static __init void ge_complete( |
205 | struct mv643xx_eth_shared_platform_data *orion_ge_shared_data, | 204 | struct mv643xx_eth_shared_platform_data *orion_ge_shared_data, |
206 | struct mbus_dram_target_info *mbus_dram_info, int tclk, | 205 | int tclk, |
207 | struct resource *orion_ge_resource, unsigned long irq, | 206 | struct resource *orion_ge_resource, unsigned long irq, |
208 | struct platform_device *orion_ge_shared, | 207 | struct platform_device *orion_ge_shared, |
209 | struct mv643xx_eth_platform_data *eth_data, | 208 | struct mv643xx_eth_platform_data *eth_data, |
210 | struct platform_device *orion_ge) | 209 | struct platform_device *orion_ge) |
211 | { | 210 | { |
212 | orion_ge_shared_data->dram = mbus_dram_info; | ||
213 | orion_ge_shared_data->t_clk = tclk; | 211 | orion_ge_shared_data->t_clk = tclk; |
214 | orion_ge_resource->start = irq; | 212 | orion_ge_resource->start = irq; |
215 | orion_ge_resource->end = irq; | 213 | orion_ge_resource->end = irq; |
@@ -259,7 +257,6 @@ static struct platform_device orion_ge00 = { | |||
259 | }; | 257 | }; |
260 | 258 | ||
261 | void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, | 259 | void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, |
262 | struct mbus_dram_target_info *mbus_dram_info, | ||
263 | unsigned long mapbase, | 260 | unsigned long mapbase, |
264 | unsigned long irq, | 261 | unsigned long irq, |
265 | unsigned long irq_err, | 262 | unsigned long irq_err, |
@@ -267,7 +264,7 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, | |||
267 | { | 264 | { |
268 | fill_resources(&orion_ge00_shared, orion_ge00_shared_resources, | 265 | fill_resources(&orion_ge00_shared, orion_ge00_shared_resources, |
269 | mapbase + 0x2000, SZ_16K - 1, irq_err); | 266 | mapbase + 0x2000, SZ_16K - 1, irq_err); |
270 | ge_complete(&orion_ge00_shared_data, mbus_dram_info, tclk, | 267 | ge_complete(&orion_ge00_shared_data, tclk, |
271 | orion_ge00_resources, irq, &orion_ge00_shared, | 268 | orion_ge00_resources, irq, &orion_ge00_shared, |
272 | eth_data, &orion_ge00); | 269 | eth_data, &orion_ge00); |
273 | } | 270 | } |
@@ -313,7 +310,6 @@ static struct platform_device orion_ge01 = { | |||
313 | }; | 310 | }; |
314 | 311 | ||
315 | void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, | 312 | void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, |
316 | struct mbus_dram_target_info *mbus_dram_info, | ||
317 | unsigned long mapbase, | 313 | unsigned long mapbase, |
318 | unsigned long irq, | 314 | unsigned long irq, |
319 | unsigned long irq_err, | 315 | unsigned long irq_err, |
@@ -321,7 +317,7 @@ void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, | |||
321 | { | 317 | { |
322 | fill_resources(&orion_ge01_shared, orion_ge01_shared_resources, | 318 | fill_resources(&orion_ge01_shared, orion_ge01_shared_resources, |
323 | mapbase + 0x2000, SZ_16K - 1, irq_err); | 319 | mapbase + 0x2000, SZ_16K - 1, irq_err); |
324 | ge_complete(&orion_ge01_shared_data, mbus_dram_info, tclk, | 320 | ge_complete(&orion_ge01_shared_data, tclk, |
325 | orion_ge01_resources, irq, &orion_ge01_shared, | 321 | orion_ge01_resources, irq, &orion_ge01_shared, |
326 | eth_data, &orion_ge01); | 322 | eth_data, &orion_ge01); |
327 | } | 323 | } |
@@ -367,7 +363,6 @@ static struct platform_device orion_ge10 = { | |||
367 | }; | 363 | }; |
368 | 364 | ||
369 | void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, | 365 | void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, |
370 | struct mbus_dram_target_info *mbus_dram_info, | ||
371 | unsigned long mapbase, | 366 | unsigned long mapbase, |
372 | unsigned long irq, | 367 | unsigned long irq, |
373 | unsigned long irq_err, | 368 | unsigned long irq_err, |
@@ -375,7 +370,7 @@ void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, | |||
375 | { | 370 | { |
376 | fill_resources(&orion_ge10_shared, orion_ge10_shared_resources, | 371 | fill_resources(&orion_ge10_shared, orion_ge10_shared_resources, |
377 | mapbase + 0x2000, SZ_16K - 1, irq_err); | 372 | mapbase + 0x2000, SZ_16K - 1, irq_err); |
378 | ge_complete(&orion_ge10_shared_data, mbus_dram_info, tclk, | 373 | ge_complete(&orion_ge10_shared_data, tclk, |
379 | orion_ge10_resources, irq, &orion_ge10_shared, | 374 | orion_ge10_resources, irq, &orion_ge10_shared, |
380 | eth_data, &orion_ge10); | 375 | eth_data, &orion_ge10); |
381 | } | 376 | } |
@@ -421,7 +416,6 @@ static struct platform_device orion_ge11 = { | |||
421 | }; | 416 | }; |
422 | 417 | ||
423 | void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, | 418 | void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, |
424 | struct mbus_dram_target_info *mbus_dram_info, | ||
425 | unsigned long mapbase, | 419 | unsigned long mapbase, |
426 | unsigned long irq, | 420 | unsigned long irq, |
427 | unsigned long irq_err, | 421 | unsigned long irq_err, |
@@ -429,7 +423,7 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, | |||
429 | { | 423 | { |
430 | fill_resources(&orion_ge11_shared, orion_ge11_shared_resources, | 424 | fill_resources(&orion_ge11_shared, orion_ge11_shared_resources, |
431 | mapbase + 0x2000, SZ_16K - 1, irq_err); | 425 | mapbase + 0x2000, SZ_16K - 1, irq_err); |
432 | ge_complete(&orion_ge11_shared_data, mbus_dram_info, tclk, | 426 | ge_complete(&orion_ge11_shared_data, tclk, |
433 | orion_ge11_resources, irq, &orion_ge11_shared, | 427 | orion_ge11_resources, irq, &orion_ge11_shared, |
434 | eth_data, &orion_ge11); | 428 | eth_data, &orion_ge11); |
435 | } | 429 | } |
@@ -592,8 +586,6 @@ void __init orion_wdt_init(unsigned long tclk) | |||
592 | /***************************************************************************** | 586 | /***************************************************************************** |
593 | * XOR | 587 | * XOR |
594 | ****************************************************************************/ | 588 | ****************************************************************************/ |
595 | static struct mv_xor_platform_shared_data orion_xor_shared_data; | ||
596 | |||
597 | static u64 orion_xor_dmamask = DMA_BIT_MASK(32); | 589 | static u64 orion_xor_dmamask = DMA_BIT_MASK(32); |
598 | 590 | ||
599 | void __init orion_xor_init_channels( | 591 | void __init orion_xor_init_channels( |
@@ -632,9 +624,6 @@ static struct resource orion_xor0_shared_resources[] = { | |||
632 | static struct platform_device orion_xor0_shared = { | 624 | static struct platform_device orion_xor0_shared = { |
633 | .name = MV_XOR_SHARED_NAME, | 625 | .name = MV_XOR_SHARED_NAME, |
634 | .id = 0, | 626 | .id = 0, |
635 | .dev = { | ||
636 | .platform_data = &orion_xor_shared_data, | ||
637 | }, | ||
638 | .num_resources = ARRAY_SIZE(orion_xor0_shared_resources), | 627 | .num_resources = ARRAY_SIZE(orion_xor0_shared_resources), |
639 | .resource = orion_xor0_shared_resources, | 628 | .resource = orion_xor0_shared_resources, |
640 | }; | 629 | }; |
@@ -687,14 +676,11 @@ static struct platform_device orion_xor01_channel = { | |||
687 | }, | 676 | }, |
688 | }; | 677 | }; |
689 | 678 | ||
690 | void __init orion_xor0_init(struct mbus_dram_target_info *mbus_dram_info, | 679 | void __init orion_xor0_init(unsigned long mapbase_low, |
691 | unsigned long mapbase_low, | ||
692 | unsigned long mapbase_high, | 680 | unsigned long mapbase_high, |
693 | unsigned long irq_0, | 681 | unsigned long irq_0, |
694 | unsigned long irq_1) | 682 | unsigned long irq_1) |
695 | { | 683 | { |
696 | orion_xor_shared_data.dram = mbus_dram_info; | ||
697 | |||
698 | orion_xor0_shared_resources[0].start = mapbase_low; | 684 | orion_xor0_shared_resources[0].start = mapbase_low; |
699 | orion_xor0_shared_resources[0].end = mapbase_low + 0xff; | 685 | orion_xor0_shared_resources[0].end = mapbase_low + 0xff; |
700 | orion_xor0_shared_resources[1].start = mapbase_high; | 686 | orion_xor0_shared_resources[1].start = mapbase_high; |
@@ -727,9 +713,6 @@ static struct resource orion_xor1_shared_resources[] = { | |||
727 | static struct platform_device orion_xor1_shared = { | 713 | static struct platform_device orion_xor1_shared = { |
728 | .name = MV_XOR_SHARED_NAME, | 714 | .name = MV_XOR_SHARED_NAME, |
729 | .id = 1, | 715 | .id = 1, |
730 | .dev = { | ||
731 | .platform_data = &orion_xor_shared_data, | ||
732 | }, | ||
733 | .num_resources = ARRAY_SIZE(orion_xor1_shared_resources), | 716 | .num_resources = ARRAY_SIZE(orion_xor1_shared_resources), |
734 | .resource = orion_xor1_shared_resources, | 717 | .resource = orion_xor1_shared_resources, |
735 | }; | 718 | }; |
@@ -828,11 +811,9 @@ static struct platform_device orion_ehci = { | |||
828 | }, | 811 | }, |
829 | }; | 812 | }; |
830 | 813 | ||
831 | void __init orion_ehci_init(struct mbus_dram_target_info *mbus_dram_info, | 814 | void __init orion_ehci_init(unsigned long mapbase, |
832 | unsigned long mapbase, | ||
833 | unsigned long irq) | 815 | unsigned long irq) |
834 | { | 816 | { |
835 | orion_ehci_data.dram = mbus_dram_info; | ||
836 | fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1, | 817 | fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1, |
837 | irq); | 818 | irq); |
838 | 819 | ||
@@ -854,11 +835,9 @@ static struct platform_device orion_ehci_1 = { | |||
854 | }, | 835 | }, |
855 | }; | 836 | }; |
856 | 837 | ||
857 | void __init orion_ehci_1_init(struct mbus_dram_target_info *mbus_dram_info, | 838 | void __init orion_ehci_1_init(unsigned long mapbase, |
858 | unsigned long mapbase, | ||
859 | unsigned long irq) | 839 | unsigned long irq) |
860 | { | 840 | { |
861 | orion_ehci_data.dram = mbus_dram_info; | ||
862 | fill_resources(&orion_ehci_1, orion_ehci_1_resources, | 841 | fill_resources(&orion_ehci_1, orion_ehci_1_resources, |
863 | mapbase, SZ_4K - 1, irq); | 842 | mapbase, SZ_4K - 1, irq); |
864 | 843 | ||
@@ -880,11 +859,9 @@ static struct platform_device orion_ehci_2 = { | |||
880 | }, | 859 | }, |
881 | }; | 860 | }; |
882 | 861 | ||
883 | void __init orion_ehci_2_init(struct mbus_dram_target_info *mbus_dram_info, | 862 | void __init orion_ehci_2_init(unsigned long mapbase, |
884 | unsigned long mapbase, | ||
885 | unsigned long irq) | 863 | unsigned long irq) |
886 | { | 864 | { |
887 | orion_ehci_data.dram = mbus_dram_info; | ||
888 | fill_resources(&orion_ehci_2, orion_ehci_2_resources, | 865 | fill_resources(&orion_ehci_2, orion_ehci_2_resources, |
889 | mapbase, SZ_4K - 1, irq); | 866 | mapbase, SZ_4K - 1, irq); |
890 | 867 | ||
@@ -911,11 +888,9 @@ static struct platform_device orion_sata = { | |||
911 | }; | 888 | }; |
912 | 889 | ||
913 | void __init orion_sata_init(struct mv_sata_platform_data *sata_data, | 890 | void __init orion_sata_init(struct mv_sata_platform_data *sata_data, |
914 | struct mbus_dram_target_info *mbus_dram_info, | ||
915 | unsigned long mapbase, | 891 | unsigned long mapbase, |
916 | unsigned long irq) | 892 | unsigned long irq) |
917 | { | 893 | { |
918 | sata_data->dram = mbus_dram_info; | ||
919 | orion_sata.dev.platform_data = sata_data; | 894 | orion_sata.dev.platform_data = sata_data; |
920 | fill_resources(&orion_sata, orion_sata_resources, | 895 | fill_resources(&orion_sata, orion_sata_resources, |
921 | mapbase, 0x5000 - 1, irq); | 896 | mapbase, 0x5000 - 1, irq); |
diff --git a/arch/arm/plat-orion/include/plat/addr-map.h b/arch/arm/plat-orion/include/plat/addr-map.h new file mode 100644 index 000000000000..fd556f77562c --- /dev/null +++ b/arch/arm/plat-orion/include/plat/addr-map.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-orion/include/plat/addr-map.h | ||
3 | * | ||
4 | * Marvell Orion SoC address map handling. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __PLAT_ADDR_MAP_H | ||
12 | #define __PLAT_ADDR_MAP_H | ||
13 | |||
14 | extern struct mbus_dram_target_info orion_mbus_dram_info; | ||
15 | |||
16 | struct orion_addr_map_cfg { | ||
17 | const int num_wins; /* Total number of windows */ | ||
18 | const int remappable_wins; | ||
19 | const u32 bridge_virt_base; | ||
20 | |||
21 | /* If NULL, the default cpu_win_can_remap will be used, using | ||
22 | the value in remappable_wins */ | ||
23 | int (*cpu_win_can_remap) (const struct orion_addr_map_cfg *cfg, | ||
24 | const int win); | ||
25 | /* If NULL, the default win_cfg_base will be used, using the | ||
26 | value in bridge_virt_base */ | ||
27 | void __iomem *(*win_cfg_base) (const struct orion_addr_map_cfg *cfg, | ||
28 | const int win); | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * Information needed to setup one address mapping. | ||
33 | */ | ||
34 | struct orion_addr_map_info { | ||
35 | const int win; | ||
36 | const u32 base; | ||
37 | const u32 size; | ||
38 | const u8 target; | ||
39 | const u8 attr; | ||
40 | const int remap; | ||
41 | }; | ||
42 | |||
43 | void __init orion_config_wins(struct orion_addr_map_cfg *cfg, | ||
44 | const struct orion_addr_map_info *info); | ||
45 | |||
46 | void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg, | ||
47 | const int win, const u32 base, | ||
48 | const u32 size, const u8 target, | ||
49 | const u8 attr, const int remap); | ||
50 | |||
51 | void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, | ||
52 | const u32 ddr_window_cpu_base); | ||
53 | #endif | ||
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h index 9cf1f781329b..885f8abd927b 100644 --- a/arch/arm/plat-orion/include/plat/audio.h +++ b/arch/arm/plat-orion/include/plat/audio.h | |||
@@ -1,11 +1,8 @@ | |||
1 | #ifndef __PLAT_AUDIO_H | 1 | #ifndef __PLAT_AUDIO_H |
2 | #define __PLAT_AUDIO_H | 2 | #define __PLAT_AUDIO_H |
3 | 3 | ||
4 | #include <linux/mbus.h> | ||
5 | |||
6 | struct kirkwood_asoc_platform_data { | 4 | struct kirkwood_asoc_platform_data { |
7 | u32 tclk; | 5 | u32 tclk; |
8 | struct mbus_dram_target_info *dram; | ||
9 | int burst; | 6 | int burst; |
10 | }; | 7 | }; |
11 | #endif | 8 | #endif |
diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h index a63c357e2ab1..0fe08d77e835 100644 --- a/arch/arm/plat-orion/include/plat/common.h +++ b/arch/arm/plat-orion/include/plat/common.h | |||
@@ -37,28 +37,24 @@ void __init orion_rtc_init(unsigned long mapbase, | |||
37 | unsigned long irq); | 37 | unsigned long irq); |
38 | 38 | ||
39 | void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, | 39 | void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, |
40 | struct mbus_dram_target_info *mbus_dram_info, | ||
41 | unsigned long mapbase, | 40 | unsigned long mapbase, |
42 | unsigned long irq, | 41 | unsigned long irq, |
43 | unsigned long irq_err, | 42 | unsigned long irq_err, |
44 | int tclk); | 43 | int tclk); |
45 | 44 | ||
46 | void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, | 45 | void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, |
47 | struct mbus_dram_target_info *mbus_dram_info, | ||
48 | unsigned long mapbase, | 46 | unsigned long mapbase, |
49 | unsigned long irq, | 47 | unsigned long irq, |
50 | unsigned long irq_err, | 48 | unsigned long irq_err, |
51 | int tclk); | 49 | int tclk); |
52 | 50 | ||
53 | void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, | 51 | void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, |
54 | struct mbus_dram_target_info *mbus_dram_info, | ||
55 | unsigned long mapbase, | 52 | unsigned long mapbase, |
56 | unsigned long irq, | 53 | unsigned long irq, |
57 | unsigned long irq_err, | 54 | unsigned long irq_err, |
58 | int tclk); | 55 | int tclk); |
59 | 56 | ||
60 | void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, | 57 | void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, |
61 | struct mbus_dram_target_info *mbus_dram_info, | ||
62 | unsigned long mapbase, | 58 | unsigned long mapbase, |
63 | unsigned long irq, | 59 | unsigned long irq, |
64 | unsigned long irq_err, | 60 | unsigned long irq_err, |
@@ -82,8 +78,7 @@ void __init orion_spi_1_init(unsigned long mapbase, | |||
82 | 78 | ||
83 | void __init orion_wdt_init(unsigned long tclk); | 79 | void __init orion_wdt_init(unsigned long tclk); |
84 | 80 | ||
85 | void __init orion_xor0_init(struct mbus_dram_target_info *mbus_dram_info, | 81 | void __init orion_xor0_init(unsigned long mapbase_low, |
86 | unsigned long mapbase_low, | ||
87 | unsigned long mapbase_high, | 82 | unsigned long mapbase_high, |
88 | unsigned long irq_0, | 83 | unsigned long irq_0, |
89 | unsigned long irq_1); | 84 | unsigned long irq_1); |
@@ -93,20 +88,16 @@ void __init orion_xor1_init(unsigned long mapbase_low, | |||
93 | unsigned long irq_0, | 88 | unsigned long irq_0, |
94 | unsigned long irq_1); | 89 | unsigned long irq_1); |
95 | 90 | ||
96 | void __init orion_ehci_init(struct mbus_dram_target_info *mbus_dram_info, | 91 | void __init orion_ehci_init(unsigned long mapbase, |
97 | unsigned long mapbase, | ||
98 | unsigned long irq); | 92 | unsigned long irq); |
99 | 93 | ||
100 | void __init orion_ehci_1_init(struct mbus_dram_target_info *mbus_dram_info, | 94 | void __init orion_ehci_1_init(unsigned long mapbase, |
101 | unsigned long mapbase, | ||
102 | unsigned long irq); | 95 | unsigned long irq); |
103 | 96 | ||
104 | void __init orion_ehci_2_init(struct mbus_dram_target_info *mbus_dram_info, | 97 | void __init orion_ehci_2_init(unsigned long mapbase, |
105 | unsigned long mapbase, | ||
106 | unsigned long irq); | 98 | unsigned long irq); |
107 | 99 | ||
108 | void __init orion_sata_init(struct mv_sata_platform_data *sata_data, | 100 | void __init orion_sata_init(struct mv_sata_platform_data *sata_data, |
109 | struct mbus_dram_target_info *mbus_dram_info, | ||
110 | unsigned long mapbase, | 101 | unsigned long mapbase, |
111 | unsigned long irq); | 102 | unsigned long irq); |
112 | 103 | ||
diff --git a/arch/arm/plat-orion/include/plat/ehci-orion.h b/arch/arm/plat-orion/include/plat/ehci-orion.h index 4ec668e77460..6fc78e430420 100644 --- a/arch/arm/plat-orion/include/plat/ehci-orion.h +++ b/arch/arm/plat-orion/include/plat/ehci-orion.h | |||
@@ -19,7 +19,6 @@ enum orion_ehci_phy_ver { | |||
19 | }; | 19 | }; |
20 | 20 | ||
21 | struct orion_ehci_data { | 21 | struct orion_ehci_data { |
22 | struct mbus_dram_target_info *dram; | ||
23 | enum orion_ehci_phy_ver phy_version; | 22 | enum orion_ehci_phy_ver phy_version; |
24 | }; | 23 | }; |
25 | 24 | ||
diff --git a/arch/arm/plat-orion/include/plat/mv_xor.h b/arch/arm/plat-orion/include/plat/mv_xor.h index bd5f3bdb4ae3..2ba1f7d76eef 100644 --- a/arch/arm/plat-orion/include/plat/mv_xor.h +++ b/arch/arm/plat-orion/include/plat/mv_xor.h | |||
@@ -13,12 +13,6 @@ | |||
13 | #define MV_XOR_SHARED_NAME "mv_xor_shared" | 13 | #define MV_XOR_SHARED_NAME "mv_xor_shared" |
14 | #define MV_XOR_NAME "mv_xor" | 14 | #define MV_XOR_NAME "mv_xor" |
15 | 15 | ||
16 | struct mbus_dram_target_info; | ||
17 | |||
18 | struct mv_xor_platform_shared_data { | ||
19 | struct mbus_dram_target_info *dram; | ||
20 | }; | ||
21 | |||
22 | struct mv_xor_platform_data { | 16 | struct mv_xor_platform_data { |
23 | struct platform_device *shared; | 17 | struct platform_device *shared; |
24 | int hw_id; | 18 | int hw_id; |
diff --git a/arch/arm/plat-orion/include/plat/mvsdio.h b/arch/arm/plat-orion/include/plat/mvsdio.h index 14ca88676002..1190efedcb94 100644 --- a/arch/arm/plat-orion/include/plat/mvsdio.h +++ b/arch/arm/plat-orion/include/plat/mvsdio.h | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/mbus.h> | 12 | #include <linux/mbus.h> |
13 | 13 | ||
14 | struct mvsdio_platform_data { | 14 | struct mvsdio_platform_data { |
15 | struct mbus_dram_target_info *dram; | ||
16 | unsigned int clock; | 15 | unsigned int clock; |
17 | int gpio_card_detect; | 16 | int gpio_card_detect; |
18 | int gpio_write_protect; | 17 | int gpio_write_protect; |
diff --git a/arch/arm/plat-orion/include/plat/pcie.h b/arch/arm/plat-orion/include/plat/pcie.h index cc99163e73fd..fe5b9e862747 100644 --- a/arch/arm/plat-orion/include/plat/pcie.h +++ b/arch/arm/plat-orion/include/plat/pcie.h | |||
@@ -20,8 +20,7 @@ int orion_pcie_x4_mode(void __iomem *base); | |||
20 | int orion_pcie_get_local_bus_nr(void __iomem *base); | 20 | int orion_pcie_get_local_bus_nr(void __iomem *base); |
21 | void orion_pcie_set_local_bus_nr(void __iomem *base, int nr); | 21 | void orion_pcie_set_local_bus_nr(void __iomem *base, int nr); |
22 | void orion_pcie_reset(void __iomem *base); | 22 | void orion_pcie_reset(void __iomem *base); |
23 | void orion_pcie_setup(void __iomem *base, | 23 | void orion_pcie_setup(void __iomem *base); |
24 | struct mbus_dram_target_info *dram); | ||
25 | int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus, | 24 | int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus, |
26 | u32 devfn, int where, int size, u32 *val); | 25 | u32 devfn, int where, int size, u32 *val); |
27 | int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus, | 26 | int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus, |
diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c index af2d733c50b5..86dbb5bdb172 100644 --- a/arch/arm/plat-orion/pcie.c +++ b/arch/arm/plat-orion/pcie.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/mbus.h> | 13 | #include <linux/mbus.h> |
14 | #include <asm/mach/pci.h> | 14 | #include <asm/mach/pci.h> |
15 | #include <plat/pcie.h> | 15 | #include <plat/pcie.h> |
16 | #include <plat/addr-map.h> | ||
16 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
17 | 18 | ||
18 | /* | 19 | /* |
@@ -175,8 +176,7 @@ static void __init orion_pcie_setup_wins(void __iomem *base, | |||
175 | writel(((size - 1) & 0xffff0000) | 1, base + PCIE_BAR_CTRL_OFF(1)); | 176 | writel(((size - 1) & 0xffff0000) | 1, base + PCIE_BAR_CTRL_OFF(1)); |
176 | } | 177 | } |
177 | 178 | ||
178 | void __init orion_pcie_setup(void __iomem *base, | 179 | void __init orion_pcie_setup(void __iomem *base) |
179 | struct mbus_dram_target_info *dram) | ||
180 | { | 180 | { |
181 | u16 cmd; | 181 | u16 cmd; |
182 | u32 mask; | 182 | u32 mask; |
@@ -184,7 +184,7 @@ void __init orion_pcie_setup(void __iomem *base, | |||
184 | /* | 184 | /* |
185 | * Point PCIe unit MBUS decode windows to DRAM space. | 185 | * Point PCIe unit MBUS decode windows to DRAM space. |
186 | */ | 186 | */ |
187 | orion_pcie_setup_wins(base, dram); | 187 | orion_pcie_setup_wins(base, &orion_mbus_dram_info); |
188 | 188 | ||
189 | /* | 189 | /* |
190 | * Master + slave enable. | 190 | * Master + slave enable. |
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 43f984e93970..303192fc9260 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
@@ -350,10 +350,12 @@ | |||
350 | #define __NR_clock_adjtime 342 | 350 | #define __NR_clock_adjtime 342 |
351 | #define __NR_syncfs 343 | 351 | #define __NR_syncfs 343 |
352 | #define __NR_setns 344 | 352 | #define __NR_setns 344 |
353 | #define __NR_process_vm_readv 345 | ||
354 | #define __NR_process_vm_writev 346 | ||
353 | 355 | ||
354 | #ifdef __KERNEL__ | 356 | #ifdef __KERNEL__ |
355 | 357 | ||
356 | #define NR_syscalls 345 | 358 | #define NR_syscalls 347 |
357 | 359 | ||
358 | #define __ARCH_WANT_IPC_PARSE_VERSION | 360 | #define __ARCH_WANT_IPC_PARSE_VERSION |
359 | #define __ARCH_WANT_OLD_READDIR | 361 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S index c468f2edaa85..ce827b376110 100644 --- a/arch/m68k/kernel/syscalltable.S +++ b/arch/m68k/kernel/syscalltable.S | |||
@@ -365,4 +365,6 @@ ENTRY(sys_call_table) | |||
365 | .long sys_clock_adjtime | 365 | .long sys_clock_adjtime |
366 | .long sys_syncfs | 366 | .long sys_syncfs |
367 | .long sys_setns | 367 | .long sys_setns |
368 | .long sys_process_vm_readv /* 345 */ | ||
369 | .long sys_process_vm_writev | ||
368 | 370 | ||
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index 4f2971bcf8e5..315fc0b250f8 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c | |||
@@ -623,7 +623,7 @@ static int mipspmu_event_init(struct perf_event *event) | |||
623 | if (!atomic_inc_not_zero(&active_events)) { | 623 | if (!atomic_inc_not_zero(&active_events)) { |
624 | if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) { | 624 | if (atomic_read(&active_events) > MIPS_MAX_HWEVENTS) { |
625 | atomic_dec(&active_events); | 625 | atomic_dec(&active_events); |
626 | return -ENOSPC; | 626 | return -EINVAL; |
627 | } | 627 | } |
628 | 628 | ||
629 | mutex_lock(&pmu_reserve_mutex); | 629 | mutex_lock(&pmu_reserve_mutex); |
@@ -732,15 +732,15 @@ static int validate_group(struct perf_event *event) | |||
732 | memset(&fake_cpuc, 0, sizeof(fake_cpuc)); | 732 | memset(&fake_cpuc, 0, sizeof(fake_cpuc)); |
733 | 733 | ||
734 | if (!validate_event(&fake_cpuc, leader)) | 734 | if (!validate_event(&fake_cpuc, leader)) |
735 | return -ENOSPC; | 735 | return -EINVAL; |
736 | 736 | ||
737 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { | 737 | list_for_each_entry(sibling, &leader->sibling_list, group_entry) { |
738 | if (!validate_event(&fake_cpuc, sibling)) | 738 | if (!validate_event(&fake_cpuc, sibling)) |
739 | return -ENOSPC; | 739 | return -EINVAL; |
740 | } | 740 | } |
741 | 741 | ||
742 | if (!validate_event(&fake_cpuc, event)) | 742 | if (!validate_event(&fake_cpuc, event)) |
743 | return -ENOSPC; | 743 | return -EINVAL; |
744 | 744 | ||
745 | return 0; | 745 | return 0; |
746 | } | 746 | } |
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 524d23b8610c..4f289ff0b7fe 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -599,10 +599,10 @@ static inline pgste_t pgste_update_all(pte_t *ptep, pgste_t pgste) | |||
599 | skey = page_get_storage_key(address); | 599 | skey = page_get_storage_key(address); |
600 | bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED); | 600 | bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED); |
601 | /* Clear page changed & referenced bit in the storage key */ | 601 | /* Clear page changed & referenced bit in the storage key */ |
602 | if (bits) { | 602 | if (bits & _PAGE_CHANGED) |
603 | skey ^= bits; | 603 | page_set_storage_key(address, skey ^ bits, 1); |
604 | page_set_storage_key(address, skey, 1); | 604 | else if (bits) |
605 | } | 605 | page_reset_referenced(address); |
606 | /* Transfer page changed & referenced bit to guest bits in pgste */ | 606 | /* Transfer page changed & referenced bit to guest bits in pgste */ |
607 | pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */ | 607 | pgste_val(pgste) |= bits << 48; /* RCP_GR_BIT & RCP_GC_BIT */ |
608 | /* Get host changed & referenced bits from pgste */ | 608 | /* Get host changed & referenced bits from pgste */ |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 450931a45b68..573bc29551ef 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -296,13 +296,6 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) | |||
296 | ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA)))) | 296 | ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA)))) |
297 | /* Invalid psw mask. */ | 297 | /* Invalid psw mask. */ |
298 | return -EINVAL; | 298 | return -EINVAL; |
299 | if (addr == (addr_t) &dummy->regs.psw.addr) | ||
300 | /* | ||
301 | * The debugger changed the instruction address, | ||
302 | * reset system call restart, see signal.c:do_signal | ||
303 | */ | ||
304 | task_thread_info(child)->system_call = 0; | ||
305 | |||
306 | *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data; | 299 | *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data; |
307 | 300 | ||
308 | } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { | 301 | } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { |
@@ -614,11 +607,6 @@ static int __poke_user_compat(struct task_struct *child, | |||
614 | /* Transfer 31 bit amode bit to psw mask. */ | 607 | /* Transfer 31 bit amode bit to psw mask. */ |
615 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) | | 608 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) | |
616 | (__u64)(tmp & PSW32_ADDR_AMODE); | 609 | (__u64)(tmp & PSW32_ADDR_AMODE); |
617 | /* | ||
618 | * The debugger changed the instruction address, | ||
619 | * reset system call restart, see signal.c:do_signal | ||
620 | */ | ||
621 | task_thread_info(child)->system_call = 0; | ||
622 | } else { | 610 | } else { |
623 | /* gpr 0-15 */ | 611 | /* gpr 0-15 */ |
624 | *(__u32*)((addr_t) ®s->psw + addr*2 + 4) = tmp; | 612 | *(__u32*)((addr_t) ®s->psw + addr*2 + 4) = tmp; |
@@ -905,6 +893,14 @@ static int s390_last_break_get(struct task_struct *target, | |||
905 | return 0; | 893 | return 0; |
906 | } | 894 | } |
907 | 895 | ||
896 | static int s390_last_break_set(struct task_struct *target, | ||
897 | const struct user_regset *regset, | ||
898 | unsigned int pos, unsigned int count, | ||
899 | const void *kbuf, const void __user *ubuf) | ||
900 | { | ||
901 | return 0; | ||
902 | } | ||
903 | |||
908 | #endif | 904 | #endif |
909 | 905 | ||
910 | static int s390_system_call_get(struct task_struct *target, | 906 | static int s390_system_call_get(struct task_struct *target, |
@@ -951,6 +947,7 @@ static const struct user_regset s390_regsets[] = { | |||
951 | .size = sizeof(long), | 947 | .size = sizeof(long), |
952 | .align = sizeof(long), | 948 | .align = sizeof(long), |
953 | .get = s390_last_break_get, | 949 | .get = s390_last_break_get, |
950 | .set = s390_last_break_set, | ||
954 | }, | 951 | }, |
955 | #endif | 952 | #endif |
956 | [REGSET_SYSTEM_CALL] = { | 953 | [REGSET_SYSTEM_CALL] = { |
@@ -1116,6 +1113,14 @@ static int s390_compat_last_break_get(struct task_struct *target, | |||
1116 | return 0; | 1113 | return 0; |
1117 | } | 1114 | } |
1118 | 1115 | ||
1116 | static int s390_compat_last_break_set(struct task_struct *target, | ||
1117 | const struct user_regset *regset, | ||
1118 | unsigned int pos, unsigned int count, | ||
1119 | const void *kbuf, const void __user *ubuf) | ||
1120 | { | ||
1121 | return 0; | ||
1122 | } | ||
1123 | |||
1119 | static const struct user_regset s390_compat_regsets[] = { | 1124 | static const struct user_regset s390_compat_regsets[] = { |
1120 | [REGSET_GENERAL] = { | 1125 | [REGSET_GENERAL] = { |
1121 | .core_note_type = NT_PRSTATUS, | 1126 | .core_note_type = NT_PRSTATUS, |
@@ -1139,6 +1144,7 @@ static const struct user_regset s390_compat_regsets[] = { | |||
1139 | .size = sizeof(long), | 1144 | .size = sizeof(long), |
1140 | .align = sizeof(long), | 1145 | .align = sizeof(long), |
1141 | .get = s390_compat_last_break_get, | 1146 | .get = s390_compat_last_break_get, |
1147 | .set = s390_compat_last_break_set, | ||
1142 | }, | 1148 | }, |
1143 | [REGSET_SYSTEM_CALL] = { | 1149 | [REGSET_SYSTEM_CALL] = { |
1144 | .core_note_type = NT_S390_SYSTEM_CALL, | 1150 | .core_note_type = NT_S390_SYSTEM_CALL, |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index e58a462949b1..e54c4ff8abaa 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -579,7 +579,7 @@ static unsigned long __init find_crash_base(unsigned long crash_size, | |||
579 | *msg = "first memory chunk must be at least crashkernel size"; | 579 | *msg = "first memory chunk must be at least crashkernel size"; |
580 | return 0; | 580 | return 0; |
581 | } | 581 | } |
582 | if (is_kdump_kernel() && (crash_size == OLDMEM_SIZE)) | 582 | if (OLDMEM_BASE && crash_size == OLDMEM_SIZE) |
583 | return OLDMEM_BASE; | 583 | return OLDMEM_BASE; |
584 | 584 | ||
585 | for (i = MEMORY_CHUNKS - 1; i >= 0; i--) { | 585 | for (i = MEMORY_CHUNKS - 1; i >= 0; i--) { |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 05a85bc14c98..7f6f9f354545 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -460,9 +460,9 @@ void do_signal(struct pt_regs *regs) | |||
460 | regs->svc_code >> 16); | 460 | regs->svc_code >> 16); |
461 | break; | 461 | break; |
462 | } | 462 | } |
463 | /* No longer in a system call */ | ||
464 | clear_thread_flag(TIF_SYSCALL); | ||
465 | } | 463 | } |
464 | /* No longer in a system call */ | ||
465 | clear_thread_flag(TIF_SYSCALL); | ||
466 | 466 | ||
467 | if ((is_compat_task() ? | 467 | if ((is_compat_task() ? |
468 | handle_signal32(signr, &ka, &info, oldset, regs) : | 468 | handle_signal32(signr, &ka, &info, oldset, regs) : |
@@ -486,6 +486,7 @@ void do_signal(struct pt_regs *regs) | |||
486 | } | 486 | } |
487 | 487 | ||
488 | /* No handlers present - check for system call restart */ | 488 | /* No handlers present - check for system call restart */ |
489 | clear_thread_flag(TIF_SYSCALL); | ||
489 | if (current_thread_info()->system_call) { | 490 | if (current_thread_info()->system_call) { |
490 | regs->svc_code = current_thread_info()->system_call; | 491 | regs->svc_code = current_thread_info()->system_call; |
491 | switch (regs->gprs[2]) { | 492 | switch (regs->gprs[2]) { |
@@ -500,9 +501,6 @@ void do_signal(struct pt_regs *regs) | |||
500 | regs->gprs[2] = regs->orig_gpr2; | 501 | regs->gprs[2] = regs->orig_gpr2; |
501 | set_thread_flag(TIF_SYSCALL); | 502 | set_thread_flag(TIF_SYSCALL); |
502 | break; | 503 | break; |
503 | default: | ||
504 | clear_thread_flag(TIF_SYSCALL); | ||
505 | break; | ||
506 | } | 504 | } |
507 | } | 505 | } |
508 | 506 | ||
diff --git a/arch/tile/include/asm/irq.h b/arch/tile/include/asm/irq.h index 94e9a511de84..f80f8ceabc67 100644 --- a/arch/tile/include/asm/irq.h +++ b/arch/tile/include/asm/irq.h | |||
@@ -74,16 +74,6 @@ enum { | |||
74 | */ | 74 | */ |
75 | void tile_irq_activate(unsigned int irq, int tile_irq_type); | 75 | void tile_irq_activate(unsigned int irq, int tile_irq_type); |
76 | 76 | ||
77 | /* | ||
78 | * For onboard, non-PCI (e.g. TILE_IRQ_PERCPU) devices, drivers know | ||
79 | * how to use enable/disable_percpu_irq() to manage interrupts on each | ||
80 | * core. We can't use the generic enable/disable_irq() because they | ||
81 | * use a single reference count per irq, rather than per cpu per irq. | ||
82 | */ | ||
83 | void enable_percpu_irq(unsigned int irq); | ||
84 | void disable_percpu_irq(unsigned int irq); | ||
85 | |||
86 | |||
87 | void setup_irq_regs(void); | 77 | void setup_irq_regs(void); |
88 | 78 | ||
89 | #endif /* _ASM_TILE_IRQ_H */ | 79 | #endif /* _ASM_TILE_IRQ_H */ |
diff --git a/arch/tile/kernel/irq.c b/arch/tile/kernel/irq.c index aa0134db2dd6..02e628065012 100644 --- a/arch/tile/kernel/irq.c +++ b/arch/tile/kernel/irq.c | |||
@@ -152,14 +152,13 @@ void tile_dev_intr(struct pt_regs *regs, int intnum) | |||
152 | * Remove an irq from the disabled mask. If we're in an interrupt | 152 | * Remove an irq from the disabled mask. If we're in an interrupt |
153 | * context, defer enabling the HW interrupt until we leave. | 153 | * context, defer enabling the HW interrupt until we leave. |
154 | */ | 154 | */ |
155 | void enable_percpu_irq(unsigned int irq) | 155 | static void tile_irq_chip_enable(struct irq_data *d) |
156 | { | 156 | { |
157 | get_cpu_var(irq_disable_mask) &= ~(1UL << irq); | 157 | get_cpu_var(irq_disable_mask) &= ~(1UL << d->irq); |
158 | if (__get_cpu_var(irq_depth) == 0) | 158 | if (__get_cpu_var(irq_depth) == 0) |
159 | unmask_irqs(1UL << irq); | 159 | unmask_irqs(1UL << d->irq); |
160 | put_cpu_var(irq_disable_mask); | 160 | put_cpu_var(irq_disable_mask); |
161 | } | 161 | } |
162 | EXPORT_SYMBOL(enable_percpu_irq); | ||
163 | 162 | ||
164 | /* | 163 | /* |
165 | * Add an irq to the disabled mask. We disable the HW interrupt | 164 | * Add an irq to the disabled mask. We disable the HW interrupt |
@@ -167,13 +166,12 @@ EXPORT_SYMBOL(enable_percpu_irq); | |||
167 | * in an interrupt context, the return path is careful to avoid | 166 | * in an interrupt context, the return path is careful to avoid |
168 | * unmasking a newly disabled interrupt. | 167 | * unmasking a newly disabled interrupt. |
169 | */ | 168 | */ |
170 | void disable_percpu_irq(unsigned int irq) | 169 | static void tile_irq_chip_disable(struct irq_data *d) |
171 | { | 170 | { |
172 | get_cpu_var(irq_disable_mask) |= (1UL << irq); | 171 | get_cpu_var(irq_disable_mask) |= (1UL << d->irq); |
173 | mask_irqs(1UL << irq); | 172 | mask_irqs(1UL << d->irq); |
174 | put_cpu_var(irq_disable_mask); | 173 | put_cpu_var(irq_disable_mask); |
175 | } | 174 | } |
176 | EXPORT_SYMBOL(disable_percpu_irq); | ||
177 | 175 | ||
178 | /* Mask an interrupt. */ | 176 | /* Mask an interrupt. */ |
179 | static void tile_irq_chip_mask(struct irq_data *d) | 177 | static void tile_irq_chip_mask(struct irq_data *d) |
@@ -209,6 +207,8 @@ static void tile_irq_chip_eoi(struct irq_data *d) | |||
209 | 207 | ||
210 | static struct irq_chip tile_irq_chip = { | 208 | static struct irq_chip tile_irq_chip = { |
211 | .name = "tile_irq_chip", | 209 | .name = "tile_irq_chip", |
210 | .irq_enable = tile_irq_chip_enable, | ||
211 | .irq_disable = tile_irq_chip_disable, | ||
212 | .irq_ack = tile_irq_chip_ack, | 212 | .irq_ack = tile_irq_chip_ack, |
213 | .irq_eoi = tile_irq_chip_eoi, | 213 | .irq_eoi = tile_irq_chip_eoi, |
214 | .irq_mask = tile_irq_chip_mask, | 214 | .irq_mask = tile_irq_chip_mask, |
diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c index 658f2ce426a4..b3ed19f8779c 100644 --- a/arch/tile/kernel/pci-dma.c +++ b/arch/tile/kernel/pci-dma.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/dma-mapping.h> | 16 | #include <linux/dma-mapping.h> |
17 | #include <linux/vmalloc.h> | 17 | #include <linux/vmalloc.h> |
18 | #include <linux/export.h> | ||
18 | #include <asm/tlbflush.h> | 19 | #include <asm/tlbflush.h> |
19 | #include <asm/homecache.h> | 20 | #include <asm/homecache.h> |
20 | 21 | ||
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c index 2a8014cb1ff5..9d610d3fb11e 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/uaccess.h> | 26 | #include <linux/uaccess.h> |
27 | #include <linux/export.h> | ||
27 | 28 | ||
28 | #include <asm/processor.h> | 29 | #include <asm/processor.h> |
29 | #include <asm/sections.h> | 30 | #include <asm/sections.h> |
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c index b671a86f4515..602908268093 100644 --- a/arch/tile/kernel/sysfs.c +++ b/arch/tile/kernel/sysfs.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/cpu.h> | 18 | #include <linux/cpu.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/smp.h> | 20 | #include <linux/smp.h> |
21 | #include <linux/stat.h> | ||
21 | #include <hv/hypervisor.h> | 22 | #include <hv/hypervisor.h> |
22 | 23 | ||
23 | /* Return a string queried from the hypervisor, truncated to page size. */ | 24 | /* Return a string queried from the hypervisor, truncated to page size. */ |
diff --git a/arch/tile/lib/exports.c b/arch/tile/lib/exports.c index a87d2a859ba9..2a81d32de0da 100644 --- a/arch/tile/lib/exports.c +++ b/arch/tile/lib/exports.c | |||
@@ -39,6 +39,9 @@ EXPORT_SYMBOL(finv_user_asm); | |||
39 | EXPORT_SYMBOL(current_text_addr); | 39 | EXPORT_SYMBOL(current_text_addr); |
40 | EXPORT_SYMBOL(dump_stack); | 40 | EXPORT_SYMBOL(dump_stack); |
41 | 41 | ||
42 | /* arch/tile/kernel/head.S */ | ||
43 | EXPORT_SYMBOL(empty_zero_page); | ||
44 | |||
42 | /* arch/tile/lib/, various memcpy files */ | 45 | /* arch/tile/lib/, various memcpy files */ |
43 | EXPORT_SYMBOL(memcpy); | 46 | EXPORT_SYMBOL(memcpy); |
44 | EXPORT_SYMBOL(__copy_to_user_inatomic); | 47 | EXPORT_SYMBOL(__copy_to_user_inatomic); |
diff --git a/arch/tile/mm/homecache.c b/arch/tile/mm/homecache.c index cbe6f4f9eca3..1cc6ae477c98 100644 --- a/arch/tile/mm/homecache.c +++ b/arch/tile/mm/homecache.c | |||
@@ -449,9 +449,12 @@ void homecache_free_pages(unsigned long addr, unsigned int order) | |||
449 | VM_BUG_ON(!virt_addr_valid((void *)addr)); | 449 | VM_BUG_ON(!virt_addr_valid((void *)addr)); |
450 | page = virt_to_page((void *)addr); | 450 | page = virt_to_page((void *)addr); |
451 | if (put_page_testzero(page)) { | 451 | if (put_page_testzero(page)) { |
452 | int pages = (1 << order); | ||
453 | homecache_change_page_home(page, order, initial_page_home()); | 452 | homecache_change_page_home(page, order, initial_page_home()); |
454 | while (pages--) | 453 | if (order == 0) { |
455 | __free_page(page++); | 454 | free_hot_cold_page(page, 0); |
455 | } else { | ||
456 | init_page_count(page); | ||
457 | __free_pages(page, order); | ||
458 | } | ||
456 | } | 459 | } |
457 | } | 460 | } |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index cb9a1044a771..efb42949cc09 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -390,7 +390,7 @@ config X86_INTEL_CE | |||
390 | This option compiles in support for the CE4100 SOC for settop | 390 | This option compiles in support for the CE4100 SOC for settop |
391 | boxes and media devices. | 391 | boxes and media devices. |
392 | 392 | ||
393 | config X86_INTEL_MID | 393 | config X86_WANT_INTEL_MID |
394 | bool "Intel MID platform support" | 394 | bool "Intel MID platform support" |
395 | depends on X86_32 | 395 | depends on X86_32 |
396 | depends on X86_EXTENDED_PLATFORM | 396 | depends on X86_EXTENDED_PLATFORM |
@@ -399,7 +399,10 @@ config X86_INTEL_MID | |||
399 | systems which do not have the PCI legacy interfaces (Moorestown, | 399 | systems which do not have the PCI legacy interfaces (Moorestown, |
400 | Medfield). If you are building for a PC class system say N here. | 400 | Medfield). If you are building for a PC class system say N here. |
401 | 401 | ||
402 | if X86_INTEL_MID | 402 | if X86_WANT_INTEL_MID |
403 | |||
404 | config X86_INTEL_MID | ||
405 | bool | ||
403 | 406 | ||
404 | config X86_MRST | 407 | config X86_MRST |
405 | bool "Moorestown MID platform" | 408 | bool "Moorestown MID platform" |
@@ -411,6 +414,7 @@ config X86_MRST | |||
411 | select SPI | 414 | select SPI |
412 | select INTEL_SCU_IPC | 415 | select INTEL_SCU_IPC |
413 | select X86_PLATFORM_DEVICES | 416 | select X86_PLATFORM_DEVICES |
417 | select X86_INTEL_MID | ||
414 | ---help--- | 418 | ---help--- |
415 | Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin | 419 | Moorestown is Intel's Low Power Intel Architecture (LPIA) based Moblin |
416 | Internet Device(MID) platform. Moorestown consists of two chips: | 420 | Internet Device(MID) platform. Moorestown consists of two chips: |
diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h index 908b96957d88..c9547033e38e 100644 --- a/arch/x86/include/asm/e820.h +++ b/arch/x86/include/asm/e820.h | |||
@@ -53,6 +53,13 @@ | |||
53 | */ | 53 | */ |
54 | #define E820_RESERVED_KERN 128 | 54 | #define E820_RESERVED_KERN 128 |
55 | 55 | ||
56 | /* | ||
57 | * Address ranges that need to be mapped by the kernel direct | ||
58 | * mapping. This is used to make sure regions such as | ||
59 | * EFI_RUNTIME_SERVICES_DATA are directly mapped. See setup_arch(). | ||
60 | */ | ||
61 | #define E820_RESERVED_EFI 129 | ||
62 | |||
56 | #ifndef __ASSEMBLY__ | 63 | #ifndef __ASSEMBLY__ |
57 | #include <linux/types.h> | 64 | #include <linux/types.h> |
58 | struct e820entry { | 65 | struct e820entry { |
@@ -115,6 +122,7 @@ static inline void early_memtest(unsigned long start, unsigned long end) | |||
115 | } | 122 | } |
116 | #endif | 123 | #endif |
117 | 124 | ||
125 | extern unsigned long e820_end_pfn(unsigned long limit_pfn, unsigned type); | ||
118 | extern unsigned long e820_end_of_ram_pfn(void); | 126 | extern unsigned long e820_end_of_ram_pfn(void); |
119 | extern unsigned long e820_end_of_low_ram_pfn(void); | 127 | extern unsigned long e820_end_of_low_ram_pfn(void); |
120 | extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align); | 128 | extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align); |
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 7093e4a6a0bc..b8d8bfcd44a9 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -33,8 +33,6 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); | |||
33 | #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ | 33 | #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ |
34 | efi_call_virt(f, a1, a2, a3, a4, a5, a6) | 34 | efi_call_virt(f, a1, a2, a3, a4, a5, a6) |
35 | 35 | ||
36 | #define efi_ioremap(addr, size, type) ioremap_cache(addr, size) | ||
37 | |||
38 | #else /* !CONFIG_X86_32 */ | 36 | #else /* !CONFIG_X86_32 */ |
39 | 37 | ||
40 | extern u64 efi_call0(void *fp); | 38 | extern u64 efi_call0(void *fp); |
@@ -84,9 +82,6 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3, | |||
84 | efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ | 82 | efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ |
85 | (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) | 83 | (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) |
86 | 84 | ||
87 | extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, | ||
88 | u32 type); | ||
89 | |||
90 | #endif /* CONFIG_X86_32 */ | 85 | #endif /* CONFIG_X86_32 */ |
91 | 86 | ||
92 | extern int add_efi_memmap; | 87 | extern int add_efi_memmap; |
diff --git a/arch/x86/include/asm/intel_scu_ipc.h b/arch/x86/include/asm/intel_scu_ipc.h index 4420993acc47..925b605eb5c6 100644 --- a/arch/x86/include/asm/intel_scu_ipc.h +++ b/arch/x86/include/asm/intel_scu_ipc.h | |||
@@ -3,11 +3,15 @@ | |||
3 | 3 | ||
4 | #include <linux/notifier.h> | 4 | #include <linux/notifier.h> |
5 | 5 | ||
6 | #define IPCMSG_VRTC 0xFA /* Set vRTC device */ | 6 | #define IPCMSG_WARM_RESET 0xF0 |
7 | 7 | #define IPCMSG_COLD_RESET 0xF1 | |
8 | /* Command id associated with message IPCMSG_VRTC */ | 8 | #define IPCMSG_SOFT_RESET 0xF2 |
9 | #define IPC_CMD_VRTC_SETTIME 1 /* Set time */ | 9 | #define IPCMSG_COLD_BOOT 0xF3 |
10 | #define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */ | 10 | |
11 | #define IPCMSG_VRTC 0xFA /* Set vRTC device */ | ||
12 | /* Command id associated with message IPCMSG_VRTC */ | ||
13 | #define IPC_CMD_VRTC_SETTIME 1 /* Set time */ | ||
14 | #define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */ | ||
11 | 15 | ||
12 | /* Read single register */ | 16 | /* Read single register */ |
13 | int intel_scu_ipc_ioread8(u16 addr, u8 *data); | 17 | int intel_scu_ipc_ioread8(u16 addr, u8 *data); |
diff --git a/arch/x86/include/asm/mrst.h b/arch/x86/include/asm/mrst.h index e6283129c821..93f79094c224 100644 --- a/arch/x86/include/asm/mrst.h +++ b/arch/x86/include/asm/mrst.h | |||
@@ -31,11 +31,20 @@ enum mrst_cpu_type { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | extern enum mrst_cpu_type __mrst_cpu_chip; | 33 | extern enum mrst_cpu_type __mrst_cpu_chip; |
34 | |||
35 | #ifdef CONFIG_X86_INTEL_MID | ||
36 | |||
34 | static inline enum mrst_cpu_type mrst_identify_cpu(void) | 37 | static inline enum mrst_cpu_type mrst_identify_cpu(void) |
35 | { | 38 | { |
36 | return __mrst_cpu_chip; | 39 | return __mrst_cpu_chip; |
37 | } | 40 | } |
38 | 41 | ||
42 | #else /* !CONFIG_X86_INTEL_MID */ | ||
43 | |||
44 | #define mrst_identify_cpu() (0) | ||
45 | |||
46 | #endif /* !CONFIG_X86_INTEL_MID */ | ||
47 | |||
39 | enum mrst_timer_options { | 48 | enum mrst_timer_options { |
40 | MRST_TIMER_DEFAULT, | 49 | MRST_TIMER_DEFAULT, |
41 | MRST_TIMER_APBT_ONLY, | 50 | MRST_TIMER_APBT_ONLY, |
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 084ef95274cd..95203d40ffdd 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h | |||
@@ -169,7 +169,14 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high) | |||
169 | return native_write_msr_safe(msr, low, high); | 169 | return native_write_msr_safe(msr, low, high); |
170 | } | 170 | } |
171 | 171 | ||
172 | /* rdmsr with exception handling */ | 172 | /* |
173 | * rdmsr with exception handling. | ||
174 | * | ||
175 | * Please note that the exception handling works only after we've | ||
176 | * switched to the "smart" #GP handler in trap_init() which knows about | ||
177 | * exception tables - using this macro earlier than that causes machine | ||
178 | * hangs on boxes which do not implement the @msr in the first argument. | ||
179 | */ | ||
173 | #define rdmsr_safe(msr, p1, p2) \ | 180 | #define rdmsr_safe(msr, p1, p2) \ |
174 | ({ \ | 181 | ({ \ |
175 | int __err; \ | 182 | int __err; \ |
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h index c2ff2a1d845e..2d2f01ce6dcb 100644 --- a/arch/x86/include/asm/system.h +++ b/arch/x86/include/asm/system.h | |||
@@ -401,6 +401,7 @@ extern unsigned long arch_align_stack(unsigned long sp); | |||
401 | extern void free_init_pages(char *what, unsigned long begin, unsigned long end); | 401 | extern void free_init_pages(char *what, unsigned long begin, unsigned long end); |
402 | 402 | ||
403 | void default_idle(void); | 403 | void default_idle(void); |
404 | bool set_pm_idle_to_default(void); | ||
404 | 405 | ||
405 | void stop_this_cpu(void *dummy); | 406 | void stop_this_cpu(void *dummy); |
406 | 407 | ||
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h index fa7b9176b76c..431793e5d484 100644 --- a/arch/x86/include/asm/timer.h +++ b/arch/x86/include/asm/timer.h | |||
@@ -32,6 +32,22 @@ extern int no_timer_check; | |||
32 | * (mathieu.desnoyers@polymtl.ca) | 32 | * (mathieu.desnoyers@polymtl.ca) |
33 | * | 33 | * |
34 | * -johnstul@us.ibm.com "math is hard, lets go shopping!" | 34 | * -johnstul@us.ibm.com "math is hard, lets go shopping!" |
35 | * | ||
36 | * In: | ||
37 | * | ||
38 | * ns = cycles * cyc2ns_scale / SC | ||
39 | * | ||
40 | * Although we may still have enough bits to store the value of ns, | ||
41 | * in some cases, we may not have enough bits to store cycles * cyc2ns_scale, | ||
42 | * leading to an incorrect result. | ||
43 | * | ||
44 | * To avoid this, we can decompose 'cycles' into quotient and remainder | ||
45 | * of division by SC. Then, | ||
46 | * | ||
47 | * ns = (quot * SC + rem) * cyc2ns_scale / SC | ||
48 | * = quot * cyc2ns_scale + (rem * cyc2ns_scale) / SC | ||
49 | * | ||
50 | * - sqazi@google.com | ||
35 | */ | 51 | */ |
36 | 52 | ||
37 | DECLARE_PER_CPU(unsigned long, cyc2ns); | 53 | DECLARE_PER_CPU(unsigned long, cyc2ns); |
@@ -41,9 +57,14 @@ DECLARE_PER_CPU(unsigned long long, cyc2ns_offset); | |||
41 | 57 | ||
42 | static inline unsigned long long __cycles_2_ns(unsigned long long cyc) | 58 | static inline unsigned long long __cycles_2_ns(unsigned long long cyc) |
43 | { | 59 | { |
60 | unsigned long long quot; | ||
61 | unsigned long long rem; | ||
44 | int cpu = smp_processor_id(); | 62 | int cpu = smp_processor_id(); |
45 | unsigned long long ns = per_cpu(cyc2ns_offset, cpu); | 63 | unsigned long long ns = per_cpu(cyc2ns_offset, cpu); |
46 | ns += cyc * per_cpu(cyc2ns, cpu) >> CYC2NS_SCALE_FACTOR; | 64 | quot = (cyc >> CYC2NS_SCALE_FACTOR); |
65 | rem = cyc & ((1ULL << CYC2NS_SCALE_FACTOR) - 1); | ||
66 | ns += quot * per_cpu(cyc2ns, cpu) + | ||
67 | ((rem * per_cpu(cyc2ns, cpu)) >> CYC2NS_SCALE_FACTOR); | ||
47 | return ns; | 68 | return ns; |
48 | } | 69 | } |
49 | 70 | ||
diff --git a/arch/x86/include/asm/uv/uv_mmrs.h b/arch/x86/include/asm/uv/uv_mmrs.h index 10474fb1185d..cf1d73643f60 100644 --- a/arch/x86/include/asm/uv/uv_mmrs.h +++ b/arch/x86/include/asm/uv/uv_mmrs.h | |||
@@ -57,6 +57,7 @@ | |||
57 | 57 | ||
58 | #define UV1_HUB_PART_NUMBER 0x88a5 | 58 | #define UV1_HUB_PART_NUMBER 0x88a5 |
59 | #define UV2_HUB_PART_NUMBER 0x8eb8 | 59 | #define UV2_HUB_PART_NUMBER 0x8eb8 |
60 | #define UV2_HUB_PART_NUMBER_X 0x1111 | ||
60 | 61 | ||
61 | /* Compat: if this #define is present, UV headers support UV2 */ | 62 | /* Compat: if this #define is present, UV headers support UV2 */ |
62 | #define UV2_HUB_IS_SUPPORTED 1 | 63 | #define UV2_HUB_IS_SUPPORTED 1 |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 62ae3001ae02..9d59bbacd4e3 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -93,6 +93,8 @@ static int __init early_get_pnodeid(void) | |||
93 | 93 | ||
94 | if (node_id.s.part_number == UV2_HUB_PART_NUMBER) | 94 | if (node_id.s.part_number == UV2_HUB_PART_NUMBER) |
95 | uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1; | 95 | uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1; |
96 | if (node_id.s.part_number == UV2_HUB_PART_NUMBER_X) | ||
97 | uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1; | ||
96 | 98 | ||
97 | uv_hub_info->hub_revision = uv_min_hub_revision_id; | 99 | uv_hub_info->hub_revision = uv_min_hub_revision_id; |
98 | pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1); | 100 | pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1); |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index c7e46cb35327..0bab2b18bb20 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -442,8 +442,6 @@ static void __cpuinit bsp_init_amd(struct cpuinfo_x86 *c) | |||
442 | 442 | ||
443 | static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | 443 | static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) |
444 | { | 444 | { |
445 | u32 dummy; | ||
446 | |||
447 | early_init_amd_mc(c); | 445 | early_init_amd_mc(c); |
448 | 446 | ||
449 | /* | 447 | /* |
@@ -473,12 +471,12 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | |||
473 | set_cpu_cap(c, X86_FEATURE_EXTD_APICID); | 471 | set_cpu_cap(c, X86_FEATURE_EXTD_APICID); |
474 | } | 472 | } |
475 | #endif | 473 | #endif |
476 | |||
477 | rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy); | ||
478 | } | 474 | } |
479 | 475 | ||
480 | static void __cpuinit init_amd(struct cpuinfo_x86 *c) | 476 | static void __cpuinit init_amd(struct cpuinfo_x86 *c) |
481 | { | 477 | { |
478 | u32 dummy; | ||
479 | |||
482 | #ifdef CONFIG_SMP | 480 | #ifdef CONFIG_SMP |
483 | unsigned long long value; | 481 | unsigned long long value; |
484 | 482 | ||
@@ -657,6 +655,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
657 | checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask); | 655 | checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask); |
658 | } | 656 | } |
659 | } | 657 | } |
658 | |||
659 | rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy); | ||
660 | } | 660 | } |
661 | 661 | ||
662 | #ifdef CONFIG_X86_32 | 662 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index a71efcdbb092..97b26356e9ee 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c | |||
@@ -547,6 +547,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base, | |||
547 | 547 | ||
548 | if (tmp != mask_lo) { | 548 | if (tmp != mask_lo) { |
549 | printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n"); | 549 | printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n"); |
550 | add_taint(TAINT_FIRMWARE_WORKAROUND); | ||
550 | mask_lo = tmp; | 551 | mask_lo = tmp; |
551 | } | 552 | } |
552 | } | 553 | } |
@@ -693,6 +694,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock) | |||
693 | 694 | ||
694 | /* Disable MTRRs, and set the default type to uncached */ | 695 | /* Disable MTRRs, and set the default type to uncached */ |
695 | mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi); | 696 | mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi); |
697 | wbinvd(); | ||
696 | } | 698 | } |
697 | 699 | ||
698 | static void post_set(void) __releases(set_atomicity_lock) | 700 | static void post_set(void) __releases(set_atomicity_lock) |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 640891014b2a..2bda212a0010 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -312,12 +312,8 @@ int x86_setup_perfctr(struct perf_event *event) | |||
312 | return -EOPNOTSUPP; | 312 | return -EOPNOTSUPP; |
313 | } | 313 | } |
314 | 314 | ||
315 | /* | ||
316 | * Do not allow config1 (extended registers) to propagate, | ||
317 | * there's no sane user-space generalization yet: | ||
318 | */ | ||
319 | if (attr->type == PERF_TYPE_RAW) | 315 | if (attr->type == PERF_TYPE_RAW) |
320 | return 0; | 316 | return x86_pmu_extra_regs(event->attr.config, event); |
321 | 317 | ||
322 | if (attr->type == PERF_TYPE_HW_CACHE) | 318 | if (attr->type == PERF_TYPE_HW_CACHE) |
323 | return set_ext_hw_attr(hwc, event); | 319 | return set_ext_hw_attr(hwc, event); |
@@ -588,7 +584,7 @@ done: | |||
588 | x86_pmu.put_event_constraints(cpuc, cpuc->event_list[i]); | 584 | x86_pmu.put_event_constraints(cpuc, cpuc->event_list[i]); |
589 | } | 585 | } |
590 | } | 586 | } |
591 | return num ? -ENOSPC : 0; | 587 | return num ? -EINVAL : 0; |
592 | } | 588 | } |
593 | 589 | ||
594 | /* | 590 | /* |
@@ -607,7 +603,7 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader, | |||
607 | 603 | ||
608 | if (is_x86_event(leader)) { | 604 | if (is_x86_event(leader)) { |
609 | if (n >= max_count) | 605 | if (n >= max_count) |
610 | return -ENOSPC; | 606 | return -EINVAL; |
611 | cpuc->event_list[n] = leader; | 607 | cpuc->event_list[n] = leader; |
612 | n++; | 608 | n++; |
613 | } | 609 | } |
@@ -620,7 +616,7 @@ static int collect_events(struct cpu_hw_events *cpuc, struct perf_event *leader, | |||
620 | continue; | 616 | continue; |
621 | 617 | ||
622 | if (n >= max_count) | 618 | if (n >= max_count) |
623 | return -ENOSPC; | 619 | return -EINVAL; |
624 | 620 | ||
625 | cpuc->event_list[n] = event; | 621 | cpuc->event_list[n] = event; |
626 | n++; | 622 | n++; |
@@ -1316,7 +1312,7 @@ static int validate_event(struct perf_event *event) | |||
1316 | c = x86_pmu.get_event_constraints(fake_cpuc, event); | 1312 | c = x86_pmu.get_event_constraints(fake_cpuc, event); |
1317 | 1313 | ||
1318 | if (!c || !c->weight) | 1314 | if (!c || !c->weight) |
1319 | ret = -ENOSPC; | 1315 | ret = -EINVAL; |
1320 | 1316 | ||
1321 | if (x86_pmu.put_event_constraints) | 1317 | if (x86_pmu.put_event_constraints) |
1322 | x86_pmu.put_event_constraints(fake_cpuc, event); | 1318 | x86_pmu.put_event_constraints(fake_cpuc, event); |
@@ -1341,7 +1337,7 @@ static int validate_group(struct perf_event *event) | |||
1341 | { | 1337 | { |
1342 | struct perf_event *leader = event->group_leader; | 1338 | struct perf_event *leader = event->group_leader; |
1343 | struct cpu_hw_events *fake_cpuc; | 1339 | struct cpu_hw_events *fake_cpuc; |
1344 | int ret = -ENOSPC, n; | 1340 | int ret = -EINVAL, n; |
1345 | 1341 | ||
1346 | fake_cpuc = allocate_fake_cpuc(); | 1342 | fake_cpuc = allocate_fake_cpuc(); |
1347 | if (IS_ERR(fake_cpuc)) | 1343 | if (IS_ERR(fake_cpuc)) |
diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c index ab6343d21825..3b8a2d30d14e 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c +++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c | |||
@@ -199,8 +199,7 @@ static int force_ibs_eilvt_setup(void) | |||
199 | goto out; | 199 | goto out; |
200 | } | 200 | } |
201 | 201 | ||
202 | pr_err(FW_BUG "using offset %d for IBS interrupts\n", offset); | 202 | pr_info("IBS: LVT offset %d assigned\n", offset); |
203 | pr_err(FW_BUG "workaround enabled for IBS LVT offset\n"); | ||
204 | 203 | ||
205 | return 0; | 204 | return 0; |
206 | out: | 205 | out: |
@@ -265,19 +264,23 @@ perf_ibs_cpu_notifier(struct notifier_block *self, unsigned long action, void *h | |||
265 | static __init int amd_ibs_init(void) | 264 | static __init int amd_ibs_init(void) |
266 | { | 265 | { |
267 | u32 caps; | 266 | u32 caps; |
268 | int ret; | 267 | int ret = -EINVAL; |
269 | 268 | ||
270 | caps = __get_ibs_caps(); | 269 | caps = __get_ibs_caps(); |
271 | if (!caps) | 270 | if (!caps) |
272 | return -ENODEV; /* ibs not supported by the cpu */ | 271 | return -ENODEV; /* ibs not supported by the cpu */ |
273 | 272 | ||
274 | if (!ibs_eilvt_valid()) { | 273 | /* |
275 | ret = force_ibs_eilvt_setup(); | 274 | * Force LVT offset assignment for family 10h: The offsets are |
276 | if (ret) { | 275 | * not assigned by the BIOS for this family, so the OS is |
277 | pr_err("Failed to setup IBS, %d\n", ret); | 276 | * responsible for doing it. If the OS assignment fails, fall |
278 | return ret; | 277 | * back to BIOS settings and try to setup this. |
279 | } | 278 | */ |
280 | } | 279 | if (boot_cpu_data.x86 == 0x10) |
280 | force_ibs_eilvt_setup(); | ||
281 | |||
282 | if (!ibs_eilvt_valid()) | ||
283 | goto out; | ||
281 | 284 | ||
282 | get_online_cpus(); | 285 | get_online_cpus(); |
283 | ibs_caps = caps; | 286 | ibs_caps = caps; |
@@ -287,7 +290,11 @@ static __init int amd_ibs_init(void) | |||
287 | smp_call_function(setup_APIC_ibs, NULL, 1); | 290 | smp_call_function(setup_APIC_ibs, NULL, 1); |
288 | put_online_cpus(); | 291 | put_online_cpus(); |
289 | 292 | ||
290 | return perf_event_ibs_init(); | 293 | ret = perf_event_ibs_init(); |
294 | out: | ||
295 | if (ret) | ||
296 | pr_err("Failed to setup IBS, %d\n", ret); | ||
297 | return ret; | ||
291 | } | 298 | } |
292 | 299 | ||
293 | /* Since we need the pci subsystem to init ibs we can't do this earlier: */ | 300 | /* Since we need the pci subsystem to init ibs we can't do this earlier: */ |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 2be5ebe99872..8d601b18bf9f 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -1545,6 +1545,13 @@ static void intel_clovertown_quirks(void) | |||
1545 | x86_pmu.pebs_constraints = NULL; | 1545 | x86_pmu.pebs_constraints = NULL; |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | static void intel_sandybridge_quirks(void) | ||
1549 | { | ||
1550 | printk(KERN_WARNING "PEBS disabled due to CPU errata.\n"); | ||
1551 | x86_pmu.pebs = 0; | ||
1552 | x86_pmu.pebs_constraints = NULL; | ||
1553 | } | ||
1554 | |||
1548 | __init int intel_pmu_init(void) | 1555 | __init int intel_pmu_init(void) |
1549 | { | 1556 | { |
1550 | union cpuid10_edx edx; | 1557 | union cpuid10_edx edx; |
@@ -1694,6 +1701,7 @@ __init int intel_pmu_init(void) | |||
1694 | break; | 1701 | break; |
1695 | 1702 | ||
1696 | case 42: /* SandyBridge */ | 1703 | case 42: /* SandyBridge */ |
1704 | x86_pmu.quirks = intel_sandybridge_quirks; | ||
1697 | case 45: /* SandyBridge, "Romely-EP" */ | 1705 | case 45: /* SandyBridge, "Romely-EP" */ |
1698 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, | 1706 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, |
1699 | sizeof(hw_cache_event_ids)); | 1707 | sizeof(hw_cache_event_ids)); |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c index c0d238f49db8..73da6b64f5b7 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c | |||
@@ -493,6 +493,7 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs) | |||
493 | unsigned long from = cpuc->lbr_entries[0].from; | 493 | unsigned long from = cpuc->lbr_entries[0].from; |
494 | unsigned long old_to, to = cpuc->lbr_entries[0].to; | 494 | unsigned long old_to, to = cpuc->lbr_entries[0].to; |
495 | unsigned long ip = regs->ip; | 495 | unsigned long ip = regs->ip; |
496 | int is_64bit = 0; | ||
496 | 497 | ||
497 | /* | 498 | /* |
498 | * We don't need to fixup if the PEBS assist is fault like | 499 | * We don't need to fixup if the PEBS assist is fault like |
@@ -544,7 +545,10 @@ static int intel_pmu_pebs_fixup_ip(struct pt_regs *regs) | |||
544 | } else | 545 | } else |
545 | kaddr = (void *)to; | 546 | kaddr = (void *)to; |
546 | 547 | ||
547 | kernel_insn_init(&insn, kaddr); | 548 | #ifdef CONFIG_X86_64 |
549 | is_64bit = kernel_ip(to) || !test_thread_flag(TIF_IA32); | ||
550 | #endif | ||
551 | insn_init(&insn, kaddr, is_64bit); | ||
548 | insn_get_length(&insn); | 552 | insn_get_length(&insn); |
549 | to += insn.length; | 553 | to += insn.length; |
550 | } while (to < ip); | 554 | } while (to < ip); |
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index 492bf1358a7c..ef484d9d0a25 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -1268,7 +1268,7 @@ reserve: | |||
1268 | } | 1268 | } |
1269 | 1269 | ||
1270 | done: | 1270 | done: |
1271 | return num ? -ENOSPC : 0; | 1271 | return num ? -EINVAL : 0; |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | static __initconst const struct x86_pmu p4_pmu = { | 1274 | static __initconst const struct x86_pmu p4_pmu = { |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 303a0e48f076..65ffd110a81b 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -135,6 +135,7 @@ static void __init e820_print_type(u32 type) | |||
135 | printk(KERN_CONT "(usable)"); | 135 | printk(KERN_CONT "(usable)"); |
136 | break; | 136 | break; |
137 | case E820_RESERVED: | 137 | case E820_RESERVED: |
138 | case E820_RESERVED_EFI: | ||
138 | printk(KERN_CONT "(reserved)"); | 139 | printk(KERN_CONT "(reserved)"); |
139 | break; | 140 | break; |
140 | case E820_ACPI: | 141 | case E820_ACPI: |
@@ -783,7 +784,7 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align) | |||
783 | /* | 784 | /* |
784 | * Find the highest page frame number we have available | 785 | * Find the highest page frame number we have available |
785 | */ | 786 | */ |
786 | static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type) | 787 | unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type) |
787 | { | 788 | { |
788 | int i; | 789 | int i; |
789 | unsigned long last_pfn = 0; | 790 | unsigned long last_pfn = 0; |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index b946a9eac7d9..1bb0bf4d92cd 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -1049,6 +1049,14 @@ int hpet_rtc_timer_init(void) | |||
1049 | } | 1049 | } |
1050 | EXPORT_SYMBOL_GPL(hpet_rtc_timer_init); | 1050 | EXPORT_SYMBOL_GPL(hpet_rtc_timer_init); |
1051 | 1051 | ||
1052 | static void hpet_disable_rtc_channel(void) | ||
1053 | { | ||
1054 | unsigned long cfg; | ||
1055 | cfg = hpet_readl(HPET_T1_CFG); | ||
1056 | cfg &= ~HPET_TN_ENABLE; | ||
1057 | hpet_writel(cfg, HPET_T1_CFG); | ||
1058 | } | ||
1059 | |||
1052 | /* | 1060 | /* |
1053 | * The functions below are called from rtc driver. | 1061 | * The functions below are called from rtc driver. |
1054 | * Return 0 if HPET is not being used. | 1062 | * Return 0 if HPET is not being used. |
@@ -1060,6 +1068,9 @@ int hpet_mask_rtc_irq_bit(unsigned long bit_mask) | |||
1060 | return 0; | 1068 | return 0; |
1061 | 1069 | ||
1062 | hpet_rtc_flags &= ~bit_mask; | 1070 | hpet_rtc_flags &= ~bit_mask; |
1071 | if (unlikely(!hpet_rtc_flags)) | ||
1072 | hpet_disable_rtc_channel(); | ||
1073 | |||
1063 | return 1; | 1074 | return 1; |
1064 | } | 1075 | } |
1065 | EXPORT_SYMBOL_GPL(hpet_mask_rtc_irq_bit); | 1076 | EXPORT_SYMBOL_GPL(hpet_mask_rtc_irq_bit); |
@@ -1125,15 +1136,11 @@ EXPORT_SYMBOL_GPL(hpet_rtc_dropped_irq); | |||
1125 | 1136 | ||
1126 | static void hpet_rtc_timer_reinit(void) | 1137 | static void hpet_rtc_timer_reinit(void) |
1127 | { | 1138 | { |
1128 | unsigned int cfg, delta; | 1139 | unsigned int delta; |
1129 | int lost_ints = -1; | 1140 | int lost_ints = -1; |
1130 | 1141 | ||
1131 | if (unlikely(!hpet_rtc_flags)) { | 1142 | if (unlikely(!hpet_rtc_flags)) |
1132 | cfg = hpet_readl(HPET_T1_CFG); | 1143 | hpet_disable_rtc_channel(); |
1133 | cfg &= ~HPET_TN_ENABLE; | ||
1134 | hpet_writel(cfg, HPET_T1_CFG); | ||
1135 | return; | ||
1136 | } | ||
1137 | 1144 | ||
1138 | if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit) | 1145 | if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit) |
1139 | delta = hpet_default_delta; | 1146 | delta = hpet_default_delta; |
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index acf8fbf8fbda..69bca468c47a 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c | |||
@@ -38,6 +38,9 @@ static inline void stack_overflow_check(struct pt_regs *regs) | |||
38 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 38 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
39 | u64 curbase = (u64)task_stack_page(current); | 39 | u64 curbase = (u64)task_stack_page(current); |
40 | 40 | ||
41 | if (user_mode_vm(regs)) | ||
42 | return; | ||
43 | |||
41 | WARN_ONCE(regs->sp >= curbase && | 44 | WARN_ONCE(regs->sp >= curbase && |
42 | regs->sp <= curbase + THREAD_SIZE && | 45 | regs->sp <= curbase + THREAD_SIZE && |
43 | regs->sp < curbase + sizeof(struct thread_info) + | 46 | regs->sp < curbase + sizeof(struct thread_info) + |
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index f2d2a664e797..9d46f5e43b51 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
@@ -256,7 +256,7 @@ static int __init microcode_dev_init(void) | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | 258 | ||
259 | static void microcode_dev_exit(void) | 259 | static void __exit microcode_dev_exit(void) |
260 | { | 260 | { |
261 | misc_deregister(µcode_dev); | 261 | misc_deregister(µcode_dev); |
262 | } | 262 | } |
@@ -519,10 +519,8 @@ static int __init microcode_init(void) | |||
519 | 519 | ||
520 | microcode_pdev = platform_device_register_simple("microcode", -1, | 520 | microcode_pdev = platform_device_register_simple("microcode", -1, |
521 | NULL, 0); | 521 | NULL, 0); |
522 | if (IS_ERR(microcode_pdev)) { | 522 | if (IS_ERR(microcode_pdev)) |
523 | microcode_dev_exit(); | ||
524 | return PTR_ERR(microcode_pdev); | 523 | return PTR_ERR(microcode_pdev); |
525 | } | ||
526 | 524 | ||
527 | get_online_cpus(); | 525 | get_online_cpus(); |
528 | mutex_lock(µcode_mutex); | 526 | mutex_lock(µcode_mutex); |
@@ -532,14 +530,12 @@ static int __init microcode_init(void) | |||
532 | mutex_unlock(µcode_mutex); | 530 | mutex_unlock(µcode_mutex); |
533 | put_online_cpus(); | 531 | put_online_cpus(); |
534 | 532 | ||
535 | if (error) { | 533 | if (error) |
536 | platform_device_unregister(microcode_pdev); | 534 | goto out_pdev; |
537 | return error; | ||
538 | } | ||
539 | 535 | ||
540 | error = microcode_dev_init(); | 536 | error = microcode_dev_init(); |
541 | if (error) | 537 | if (error) |
542 | return error; | 538 | goto out_sysdev_driver; |
543 | 539 | ||
544 | register_syscore_ops(&mc_syscore_ops); | 540 | register_syscore_ops(&mc_syscore_ops); |
545 | register_hotcpu_notifier(&mc_cpu_notifier); | 541 | register_hotcpu_notifier(&mc_cpu_notifier); |
@@ -548,6 +544,20 @@ static int __init microcode_init(void) | |||
548 | " <tigran@aivazian.fsnet.co.uk>, Peter Oruba\n"); | 544 | " <tigran@aivazian.fsnet.co.uk>, Peter Oruba\n"); |
549 | 545 | ||
550 | return 0; | 546 | return 0; |
547 | |||
548 | out_sysdev_driver: | ||
549 | get_online_cpus(); | ||
550 | mutex_lock(µcode_mutex); | ||
551 | |||
552 | sysdev_driver_unregister(&cpu_sysdev_class, &mc_sysdev_driver); | ||
553 | |||
554 | mutex_unlock(µcode_mutex); | ||
555 | put_online_cpus(); | ||
556 | |||
557 | out_pdev: | ||
558 | platform_device_unregister(microcode_pdev); | ||
559 | return error; | ||
560 | |||
551 | } | 561 | } |
552 | module_init(microcode_init); | 562 | module_init(microcode_init); |
553 | 563 | ||
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 9103b89c145a..0741b062a304 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -95,8 +95,8 @@ static void __init MP_bus_info(struct mpc_bus *m) | |||
95 | } | 95 | } |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | set_bit(m->busid, mp_bus_not_pci); | ||
98 | if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { | 99 | if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { |
99 | set_bit(m->busid, mp_bus_not_pci); | ||
100 | #if defined(CONFIG_EISA) || defined(CONFIG_MCA) | 100 | #if defined(CONFIG_EISA) || defined(CONFIG_MCA) |
101 | mp_bus_id_to_type[m->busid] = MP_BUS_ISA; | 101 | mp_bus_id_to_type[m->busid] = MP_BUS_ISA; |
102 | #endif | 102 | #endif |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index b9b3b1a51643..ee5d4fbd53b4 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -403,6 +403,14 @@ void default_idle(void) | |||
403 | EXPORT_SYMBOL(default_idle); | 403 | EXPORT_SYMBOL(default_idle); |
404 | #endif | 404 | #endif |
405 | 405 | ||
406 | bool set_pm_idle_to_default(void) | ||
407 | { | ||
408 | bool ret = !!pm_idle; | ||
409 | |||
410 | pm_idle = default_idle; | ||
411 | |||
412 | return ret; | ||
413 | } | ||
406 | void stop_this_cpu(void *dummy) | 414 | void stop_this_cpu(void *dummy) |
407 | { | 415 | { |
408 | local_irq_disable(); | 416 | local_irq_disable(); |
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index b78643d0f9a5..03920a15a632 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c | |||
@@ -553,4 +553,17 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC, | |||
553 | quirk_amd_nb_node); | 553 | quirk_amd_nb_node); |
554 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_LINK, | 554 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_LINK, |
555 | quirk_amd_nb_node); | 555 | quirk_amd_nb_node); |
556 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F0, | ||
557 | quirk_amd_nb_node); | ||
558 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F1, | ||
559 | quirk_amd_nb_node); | ||
560 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F2, | ||
561 | quirk_amd_nb_node); | ||
562 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F3, | ||
563 | quirk_amd_nb_node); | ||
564 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F4, | ||
565 | quirk_amd_nb_node); | ||
566 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F5, | ||
567 | quirk_amd_nb_node); | ||
568 | |||
556 | #endif | 569 | #endif |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index e334be1182b9..37a458b521a6 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -124,7 +124,7 @@ __setup("reboot=", reboot_setup); | |||
124 | */ | 124 | */ |
125 | 125 | ||
126 | /* | 126 | /* |
127 | * Some machines require the "reboot=b" commandline option, | 127 | * Some machines require the "reboot=b" or "reboot=k" commandline options, |
128 | * this quirk makes that automatic. | 128 | * this quirk makes that automatic. |
129 | */ | 129 | */ |
130 | static int __init set_bios_reboot(const struct dmi_system_id *d) | 130 | static int __init set_bios_reboot(const struct dmi_system_id *d) |
@@ -136,6 +136,15 @@ static int __init set_bios_reboot(const struct dmi_system_id *d) | |||
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | 138 | ||
139 | static int __init set_kbd_reboot(const struct dmi_system_id *d) | ||
140 | { | ||
141 | if (reboot_type != BOOT_KBD) { | ||
142 | reboot_type = BOOT_KBD; | ||
143 | printk(KERN_INFO "%s series board detected. Selecting KBD-method for reboot.\n", d->ident); | ||
144 | } | ||
145 | return 0; | ||
146 | } | ||
147 | |||
139 | static struct dmi_system_id __initdata reboot_dmi_table[] = { | 148 | static struct dmi_system_id __initdata reboot_dmi_table[] = { |
140 | { /* Handle problems with rebooting on Dell E520's */ | 149 | { /* Handle problems with rebooting on Dell E520's */ |
141 | .callback = set_bios_reboot, | 150 | .callback = set_bios_reboot, |
@@ -295,7 +304,7 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
295 | }, | 304 | }, |
296 | }, | 305 | }, |
297 | { /* Handle reboot issue on Acer Aspire one */ | 306 | { /* Handle reboot issue on Acer Aspire one */ |
298 | .callback = set_bios_reboot, | 307 | .callback = set_kbd_reboot, |
299 | .ident = "Acer Aspire One A110", | 308 | .ident = "Acer Aspire One A110", |
300 | .matches = { | 309 | .matches = { |
301 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 310 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
@@ -443,6 +452,14 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = { | |||
443 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"), | 452 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"), |
444 | }, | 453 | }, |
445 | }, | 454 | }, |
455 | { /* Handle problems with rebooting on the OptiPlex 990. */ | ||
456 | .callback = set_pci_reboot, | ||
457 | .ident = "Dell OptiPlex 990", | ||
458 | .matches = { | ||
459 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
460 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"), | ||
461 | }, | ||
462 | }, | ||
446 | { } | 463 | { } |
447 | }; | 464 | }; |
448 | 465 | ||
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index 348ce016a835..af6db6ec5b2a 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/vsyscall.h> | 12 | #include <asm/vsyscall.h> |
13 | #include <asm/x86_init.h> | 13 | #include <asm/x86_init.h> |
14 | #include <asm/time.h> | 14 | #include <asm/time.h> |
15 | #include <asm/mrst.h> | ||
15 | 16 | ||
16 | #ifdef CONFIG_X86_32 | 17 | #ifdef CONFIG_X86_32 |
17 | /* | 18 | /* |
@@ -242,6 +243,10 @@ static __init int add_rtc_cmos(void) | |||
242 | if (of_have_populated_dt()) | 243 | if (of_have_populated_dt()) |
243 | return 0; | 244 | return 0; |
244 | 245 | ||
246 | /* Intel MID platforms don't have ioport rtc */ | ||
247 | if (mrst_identify_cpu()) | ||
248 | return -ENODEV; | ||
249 | |||
245 | platform_device_register(&rtc_device); | 250 | platform_device_register(&rtc_device); |
246 | dev_info(&rtc_device.dev, | 251 | dev_info(&rtc_device.dev, |
247 | "registered platform RTC device (no PNP device found)\n"); | 252 | "registered platform RTC device (no PNP device found)\n"); |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index cf0ef986cb6d..9a9e40fb091c 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -691,6 +691,8 @@ early_param("reservelow", parse_reservelow); | |||
691 | 691 | ||
692 | void __init setup_arch(char **cmdline_p) | 692 | void __init setup_arch(char **cmdline_p) |
693 | { | 693 | { |
694 | unsigned long end_pfn; | ||
695 | |||
694 | #ifdef CONFIG_X86_32 | 696 | #ifdef CONFIG_X86_32 |
695 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); | 697 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); |
696 | visws_early_detect(); | 698 | visws_early_detect(); |
@@ -932,7 +934,24 @@ void __init setup_arch(char **cmdline_p) | |||
932 | init_gbpages(); | 934 | init_gbpages(); |
933 | 935 | ||
934 | /* max_pfn_mapped is updated here */ | 936 | /* max_pfn_mapped is updated here */ |
935 | max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT); | 937 | end_pfn = max_low_pfn; |
938 | |||
939 | #ifdef CONFIG_X86_64 | ||
940 | /* | ||
941 | * There may be regions after the last E820_RAM region that we | ||
942 | * want to include in the kernel direct mapping, such as | ||
943 | * EFI_RUNTIME_SERVICES_DATA. | ||
944 | */ | ||
945 | if (efi_enabled) { | ||
946 | unsigned long efi_end; | ||
947 | |||
948 | efi_end = e820_end_pfn(MAXMEM>>PAGE_SHIFT, E820_RESERVED_EFI); | ||
949 | if (efi_end > max_low_pfn) | ||
950 | end_pfn = efi_end; | ||
951 | } | ||
952 | #endif | ||
953 | |||
954 | max_low_pfn_mapped = init_memory_mapping(0, end_pfn << PAGE_SHIFT); | ||
936 | max_pfn_mapped = max_low_pfn_mapped; | 955 | max_pfn_mapped = max_low_pfn_mapped; |
937 | 956 | ||
938 | #ifdef CONFIG_X86_64 | 957 | #ifdef CONFIG_X86_64 |
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index ea305856151c..dd74e46828c0 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c | |||
@@ -201,6 +201,8 @@ static noinline int gup_huge_pud(pud_t pud, unsigned long addr, | |||
201 | do { | 201 | do { |
202 | VM_BUG_ON(compound_head(page) != head); | 202 | VM_BUG_ON(compound_head(page) != head); |
203 | pages[*nr] = page; | 203 | pages[*nr] = page; |
204 | if (PageTail(page)) | ||
205 | get_huge_page_tail(page); | ||
204 | (*nr)++; | 206 | (*nr)++; |
205 | page++; | 207 | page++; |
206 | refs++; | 208 | refs++; |
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index b49962662101..f4f29b19fac5 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c | |||
@@ -45,6 +45,7 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot) | |||
45 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 45 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
46 | BUG_ON(!pte_none(*(kmap_pte-idx))); | 46 | BUG_ON(!pte_none(*(kmap_pte-idx))); |
47 | set_pte(kmap_pte-idx, mk_pte(page, prot)); | 47 | set_pte(kmap_pte-idx, mk_pte(page, prot)); |
48 | arch_flush_lazy_mmu_mode(); | ||
48 | 49 | ||
49 | return (void *)vaddr; | 50 | return (void *)vaddr; |
50 | } | 51 | } |
@@ -88,6 +89,7 @@ void __kunmap_atomic(void *kvaddr) | |||
88 | */ | 89 | */ |
89 | kpte_clear_flush(kmap_pte-idx, vaddr); | 90 | kpte_clear_flush(kmap_pte-idx, vaddr); |
90 | kmap_atomic_idx_pop(); | 91 | kmap_atomic_idx_pop(); |
92 | arch_flush_lazy_mmu_mode(); | ||
91 | } | 93 | } |
92 | #ifdef CONFIG_DEBUG_HIGHMEM | 94 | #ifdef CONFIG_DEBUG_HIGHMEM |
93 | else { | 95 | else { |
diff --git a/arch/x86/oprofile/init.c b/arch/x86/oprofile/init.c index cdfe4c54deca..f148cf652678 100644 --- a/arch/x86/oprofile/init.c +++ b/arch/x86/oprofile/init.c | |||
@@ -21,6 +21,7 @@ extern int op_nmi_timer_init(struct oprofile_operations *ops); | |||
21 | extern void op_nmi_exit(void); | 21 | extern void op_nmi_exit(void); |
22 | extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); | 22 | extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); |
23 | 23 | ||
24 | static int nmi_timer; | ||
24 | 25 | ||
25 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 26 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
26 | { | 27 | { |
@@ -31,8 +32,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
31 | #ifdef CONFIG_X86_LOCAL_APIC | 32 | #ifdef CONFIG_X86_LOCAL_APIC |
32 | ret = op_nmi_init(ops); | 33 | ret = op_nmi_init(ops); |
33 | #endif | 34 | #endif |
35 | nmi_timer = (ret != 0); | ||
34 | #ifdef CONFIG_X86_IO_APIC | 36 | #ifdef CONFIG_X86_IO_APIC |
35 | if (ret < 0) | 37 | if (nmi_timer) |
36 | ret = op_nmi_timer_init(ops); | 38 | ret = op_nmi_timer_init(ops); |
37 | #endif | 39 | #endif |
38 | ops->backtrace = x86_backtrace; | 40 | ops->backtrace = x86_backtrace; |
@@ -44,6 +46,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
44 | void oprofile_arch_exit(void) | 46 | void oprofile_arch_exit(void) |
45 | { | 47 | { |
46 | #ifdef CONFIG_X86_LOCAL_APIC | 48 | #ifdef CONFIG_X86_LOCAL_APIC |
47 | op_nmi_exit(); | 49 | if (!nmi_timer) |
50 | op_nmi_exit(); | ||
48 | #endif | 51 | #endif |
49 | } | 52 | } |
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 37718f0f053d..c9718a16be15 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -323,10 +323,13 @@ static void __init do_add_efi_memmap(void) | |||
323 | case EFI_UNUSABLE_MEMORY: | 323 | case EFI_UNUSABLE_MEMORY: |
324 | e820_type = E820_UNUSABLE; | 324 | e820_type = E820_UNUSABLE; |
325 | break; | 325 | break; |
326 | case EFI_RUNTIME_SERVICES_DATA: | ||
327 | e820_type = E820_RESERVED_EFI; | ||
328 | break; | ||
326 | default: | 329 | default: |
327 | /* | 330 | /* |
328 | * EFI_RESERVED_TYPE EFI_RUNTIME_SERVICES_CODE | 331 | * EFI_RESERVED_TYPE EFI_RUNTIME_SERVICES_CODE |
329 | * EFI_RUNTIME_SERVICES_DATA EFI_MEMORY_MAPPED_IO | 332 | * EFI_MEMORY_MAPPED_IO |
330 | * EFI_MEMORY_MAPPED_IO_PORT_SPACE EFI_PAL_CODE | 333 | * EFI_MEMORY_MAPPED_IO_PORT_SPACE EFI_PAL_CODE |
331 | */ | 334 | */ |
332 | e820_type = E820_RESERVED; | 335 | e820_type = E820_RESERVED; |
@@ -671,10 +674,21 @@ void __init efi_enter_virtual_mode(void) | |||
671 | end_pfn = PFN_UP(end); | 674 | end_pfn = PFN_UP(end); |
672 | if (end_pfn <= max_low_pfn_mapped | 675 | if (end_pfn <= max_low_pfn_mapped |
673 | || (end_pfn > (1UL << (32 - PAGE_SHIFT)) | 676 | || (end_pfn > (1UL << (32 - PAGE_SHIFT)) |
674 | && end_pfn <= max_pfn_mapped)) | 677 | && end_pfn <= max_pfn_mapped)) { |
675 | va = __va(md->phys_addr); | 678 | va = __va(md->phys_addr); |
676 | else | 679 | |
677 | va = efi_ioremap(md->phys_addr, size, md->type); | 680 | if (!(md->attribute & EFI_MEMORY_WB)) { |
681 | addr = (u64) (unsigned long)va; | ||
682 | npages = md->num_pages; | ||
683 | memrange_efi_to_native(&addr, &npages); | ||
684 | set_memory_uc(addr, npages); | ||
685 | } | ||
686 | } else { | ||
687 | if (!(md->attribute & EFI_MEMORY_WB)) | ||
688 | va = ioremap_nocache(md->phys_addr, size); | ||
689 | else | ||
690 | va = ioremap_cache(md->phys_addr, size); | ||
691 | } | ||
678 | 692 | ||
679 | md->virt_addr = (u64) (unsigned long) va; | 693 | md->virt_addr = (u64) (unsigned long) va; |
680 | 694 | ||
@@ -684,13 +698,6 @@ void __init efi_enter_virtual_mode(void) | |||
684 | continue; | 698 | continue; |
685 | } | 699 | } |
686 | 700 | ||
687 | if (!(md->attribute & EFI_MEMORY_WB)) { | ||
688 | addr = md->virt_addr; | ||
689 | npages = md->num_pages; | ||
690 | memrange_efi_to_native(&addr, &npages); | ||
691 | set_memory_uc(addr, npages); | ||
692 | } | ||
693 | |||
694 | systab = (u64) (unsigned long) efi_phys.systab; | 701 | systab = (u64) (unsigned long) efi_phys.systab; |
695 | if (md->phys_addr <= systab && systab < end) { | 702 | if (md->phys_addr <= systab && systab < end) { |
696 | systab += md->virt_addr - md->phys_addr; | 703 | systab += md->virt_addr - md->phys_addr; |
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index ac3aa54e2654..312250c6b2de 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c | |||
@@ -80,20 +80,3 @@ void __init efi_call_phys_epilog(void) | |||
80 | local_irq_restore(efi_flags); | 80 | local_irq_restore(efi_flags); |
81 | early_code_mapping_set_exec(0); | 81 | early_code_mapping_set_exec(0); |
82 | } | 82 | } |
83 | |||
84 | void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, | ||
85 | u32 type) | ||
86 | { | ||
87 | unsigned long last_map_pfn; | ||
88 | |||
89 | if (type == EFI_MEMORY_MAPPED_IO) | ||
90 | return ioremap(phys_addr, size); | ||
91 | |||
92 | last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); | ||
93 | if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) { | ||
94 | unsigned long top = last_map_pfn << PAGE_SHIFT; | ||
95 | efi_ioremap(top, size - (top - phys_addr), type); | ||
96 | } | ||
97 | |||
98 | return (void __iomem *)__va(phys_addr); | ||
99 | } | ||
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index b1489a06a49d..ad4ec1cb097e 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c | |||
@@ -76,6 +76,20 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX]; | |||
76 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); | 76 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); |
77 | int sfi_mrtc_num; | 77 | int sfi_mrtc_num; |
78 | 78 | ||
79 | static void mrst_power_off(void) | ||
80 | { | ||
81 | if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) | ||
82 | intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1); | ||
83 | } | ||
84 | |||
85 | static void mrst_reboot(void) | ||
86 | { | ||
87 | if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) | ||
88 | intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0); | ||
89 | else | ||
90 | intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); | ||
91 | } | ||
92 | |||
79 | /* parse all the mtimer info to a static mtimer array */ | 93 | /* parse all the mtimer info to a static mtimer array */ |
80 | static int __init sfi_parse_mtmr(struct sfi_table_header *table) | 94 | static int __init sfi_parse_mtmr(struct sfi_table_header *table) |
81 | { | 95 | { |
@@ -265,17 +279,6 @@ static int mrst_i8042_detect(void) | |||
265 | return 0; | 279 | return 0; |
266 | } | 280 | } |
267 | 281 | ||
268 | /* Reboot and power off are handled by the SCU on a MID device */ | ||
269 | static void mrst_power_off(void) | ||
270 | { | ||
271 | intel_scu_ipc_simple_command(0xf1, 1); | ||
272 | } | ||
273 | |||
274 | static void mrst_reboot(void) | ||
275 | { | ||
276 | intel_scu_ipc_simple_command(0xf1, 0); | ||
277 | } | ||
278 | |||
279 | /* | 282 | /* |
280 | * Moorestown does not have external NMI source nor port 0x61 to report | 283 | * Moorestown does not have external NMI source nor port 0x61 to report |
281 | * NMI status. The possible NMI sources are from pmu as a result of NMI | 284 | * NMI status. The possible NMI sources are from pmu as a result of NMI |
@@ -484,6 +487,46 @@ static void __init *max7315_platform_data(void *info) | |||
484 | return max7315; | 487 | return max7315; |
485 | } | 488 | } |
486 | 489 | ||
490 | static void *tca6416_platform_data(void *info) | ||
491 | { | ||
492 | static struct pca953x_platform_data tca6416; | ||
493 | struct i2c_board_info *i2c_info = info; | ||
494 | int gpio_base, intr; | ||
495 | char base_pin_name[SFI_NAME_LEN + 1]; | ||
496 | char intr_pin_name[SFI_NAME_LEN + 1]; | ||
497 | |||
498 | strcpy(i2c_info->type, "tca6416"); | ||
499 | strcpy(base_pin_name, "tca6416_base"); | ||
500 | strcpy(intr_pin_name, "tca6416_int"); | ||
501 | |||
502 | gpio_base = get_gpio_by_name(base_pin_name); | ||
503 | intr = get_gpio_by_name(intr_pin_name); | ||
504 | |||
505 | if (gpio_base == -1) | ||
506 | return NULL; | ||
507 | tca6416.gpio_base = gpio_base; | ||
508 | if (intr != -1) { | ||
509 | i2c_info->irq = intr + MRST_IRQ_OFFSET; | ||
510 | tca6416.irq_base = gpio_base + MRST_IRQ_OFFSET; | ||
511 | } else { | ||
512 | i2c_info->irq = -1; | ||
513 | tca6416.irq_base = -1; | ||
514 | } | ||
515 | return &tca6416; | ||
516 | } | ||
517 | |||
518 | static void *mpu3050_platform_data(void *info) | ||
519 | { | ||
520 | struct i2c_board_info *i2c_info = info; | ||
521 | int intr = get_gpio_by_name("mpu3050_int"); | ||
522 | |||
523 | if (intr == -1) | ||
524 | return NULL; | ||
525 | |||
526 | i2c_info->irq = intr + MRST_IRQ_OFFSET; | ||
527 | return NULL; | ||
528 | } | ||
529 | |||
487 | static void __init *emc1403_platform_data(void *info) | 530 | static void __init *emc1403_platform_data(void *info) |
488 | { | 531 | { |
489 | static short intr2nd_pdata; | 532 | static short intr2nd_pdata; |
@@ -646,12 +689,15 @@ static void *msic_ocd_platform_data(void *info) | |||
646 | static const struct devs_id __initconst device_ids[] = { | 689 | static const struct devs_id __initconst device_ids[] = { |
647 | {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data}, | 690 | {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data}, |
648 | {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, | 691 | {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, |
692 | {"pmic_gpio", SFI_DEV_TYPE_IPC, 1, &pmic_gpio_platform_data}, | ||
649 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, | 693 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, |
650 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 694 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
651 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 695 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
696 | {"tca6416", SFI_DEV_TYPE_I2C, 1, &tca6416_platform_data}, | ||
652 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, | 697 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, |
653 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, | 698 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, |
654 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, | 699 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, |
700 | {"mpu3050", SFI_DEV_TYPE_I2C, 1, &mpu3050_platform_data}, | ||
655 | 701 | ||
656 | /* MSIC subdevices */ | 702 | /* MSIC subdevices */ |
657 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, | 703 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 38d0af4fefec..1093f80c162d 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -410,6 +410,6 @@ void __init xen_arch_setup(void) | |||
410 | #endif | 410 | #endif |
411 | disable_cpuidle(); | 411 | disable_cpuidle(); |
412 | boot_option_idle_override = IDLE_HALT; | 412 | boot_option_idle_override = IDLE_HALT; |
413 | 413 | WARN_ON(set_pm_idle_to_default()); | |
414 | fiddle_vdso(); | 414 | fiddle_vdso(); |
415 | } | 415 | } |