diff options
Diffstat (limited to 'arch')
92 files changed, 1727 insertions, 1228 deletions
diff --git a/arch/arm/configs/n770_defconfig b/arch/arm/configs/n770_defconfig index 672f6db06a52..a1657b73683f 100644 --- a/arch/arm/configs/n770_defconfig +++ b/arch/arm/configs/n770_defconfig | |||
@@ -875,7 +875,7 @@ CONFIG_FB_OMAP_LCDC_EXTERNAL=y | |||
875 | CONFIG_FB_OMAP_LCDC_HWA742=y | 875 | CONFIG_FB_OMAP_LCDC_HWA742=y |
876 | # CONFIG_FB_OMAP_LCDC_BLIZZARD is not set | 876 | # CONFIG_FB_OMAP_LCDC_BLIZZARD is not set |
877 | CONFIG_FB_OMAP_MANUAL_UPDATE=y | 877 | CONFIG_FB_OMAP_MANUAL_UPDATE=y |
878 | # CONFIG_FB_OMAP_LCD_MIPID is not set | 878 | CONFIG_FB_OMAP_LCD_MIPID=y |
879 | # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set | 879 | # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set |
880 | CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2 | 880 | CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2 |
881 | # CONFIG_FB_OMAP_DMA_TUNE is not set | 881 | # CONFIG_FB_OMAP_DMA_TUNE is not set |
diff --git a/arch/arm/configs/nhk8815_defconfig b/arch/arm/configs/nhk8815_defconfig index 9bb45b932f04..600cb270f2bf 100644 --- a/arch/arm/configs/nhk8815_defconfig +++ b/arch/arm/configs/nhk8815_defconfig | |||
@@ -498,7 +498,7 @@ CONFIG_MTD_CFI_I2=y | |||
498 | # CONFIG_MTD_DOC2001PLUS is not set | 498 | # CONFIG_MTD_DOC2001PLUS is not set |
499 | CONFIG_MTD_NAND=y | 499 | CONFIG_MTD_NAND=y |
500 | CONFIG_MTD_NAND_VERIFY_WRITE=y | 500 | CONFIG_MTD_NAND_VERIFY_WRITE=y |
501 | # CONFIG_MTD_NAND_ECC_SMC is not set | 501 | CONFIG_MTD_NAND_ECC_SMC=y |
502 | # CONFIG_MTD_NAND_MUSEUM_IDS is not set | 502 | # CONFIG_MTD_NAND_MUSEUM_IDS is not set |
503 | # CONFIG_MTD_NAND_GPIO is not set | 503 | # CONFIG_MTD_NAND_GPIO is not set |
504 | CONFIG_MTD_NAND_IDS=y | 504 | CONFIG_MTD_NAND_IDS=y |
diff --git a/arch/arm/configs/omap3_beagle_defconfig b/arch/arm/configs/omap3_beagle_defconfig index 51c0fa8897cd..357d4021e2d0 100644 --- a/arch/arm/configs/omap3_beagle_defconfig +++ b/arch/arm/configs/omap3_beagle_defconfig | |||
@@ -778,7 +778,33 @@ CONFIG_DAB=y | |||
778 | # | 778 | # |
779 | # CONFIG_VGASTATE is not set | 779 | # CONFIG_VGASTATE is not set |
780 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | 780 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set |
781 | # CONFIG_FB is not set | 781 | CONFIG_FB=y |
782 | # CONFIG_FIRMWARE_EDID is not set | ||
783 | # CONFIG_FB_DDC is not set | ||
784 | CONFIG_FB_CFB_FILLRECT=y | ||
785 | CONFIG_FB_CFB_COPYAREA=y | ||
786 | CONFIG_FB_CFB_IMAGEBLIT=y | ||
787 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
788 | # CONFIG_FB_SYS_FILLRECT is not set | ||
789 | # CONFIG_FB_SYS_COPYAREA is not set | ||
790 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
791 | # CONFIG_FB_FOREIGN_ENDIAN is not set | ||
792 | # CONFIG_FB_SYS_FOPS is not set | ||
793 | # CONFIG_FB_SVGALIB is not set | ||
794 | # CONFIG_FB_MACMODES is not set | ||
795 | # CONFIG_FB_BACKLIGHT is not set | ||
796 | # CONFIG_FB_MODE_HELPERS is not set | ||
797 | # CONFIG_FB_TILEBLITTING is not set | ||
798 | |||
799 | # | ||
800 | # Frame buffer hardware drivers | ||
801 | # | ||
802 | # CONFIG_FB_S1D13XXX is not set | ||
803 | # CONFIG_FB_VIRTUAL is not set | ||
804 | CONFIG_FB_OMAP=y | ||
805 | # CONFIG_FB_OMAP_LCDC_EXTERNAL is not set | ||
806 | # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set | ||
807 | CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2 | ||
782 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | 808 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set |
783 | 809 | ||
784 | # | 810 | # |
@@ -791,6 +817,25 @@ CONFIG_DAB=y | |||
791 | # | 817 | # |
792 | # CONFIG_VGA_CONSOLE is not set | 818 | # CONFIG_VGA_CONSOLE is not set |
793 | CONFIG_DUMMY_CONSOLE=y | 819 | CONFIG_DUMMY_CONSOLE=y |
820 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
821 | # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set | ||
822 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y | ||
823 | CONFIG_FONTS=y | ||
824 | CONFIG_FONT_8x8=y | ||
825 | CONFIG_FONT_8x16=y | ||
826 | # CONFIG_FONT_6x11 is not set | ||
827 | # CONFIG_FONT_7x14 is not set | ||
828 | # CONFIG_FONT_PEARL_8x8 is not set | ||
829 | # CONFIG_FONT_ACORN_8x8 is not set | ||
830 | # CONFIG_FONT_MINI_4x6 is not set | ||
831 | # CONFIG_FONT_SUN8x16 is not set | ||
832 | # CONFIG_FONT_SUN12x22 is not set | ||
833 | # CONFIG_FONT_10x18 is not set | ||
834 | # CONFIG_LOGO is not set | ||
835 | |||
836 | # | ||
837 | # Sound | ||
838 | # | ||
794 | # CONFIG_SOUND is not set | 839 | # CONFIG_SOUND is not set |
795 | # CONFIG_HID_SUPPORT is not set | 840 | # CONFIG_HID_SUPPORT is not set |
796 | CONFIG_USB_SUPPORT=y | 841 | CONFIG_USB_SUPPORT=y |
diff --git a/arch/arm/configs/omap_3430sdp_defconfig b/arch/arm/configs/omap_3430sdp_defconfig index 9a510eab75a6..8a4a7e2ba87b 100644 --- a/arch/arm/configs/omap_3430sdp_defconfig +++ b/arch/arm/configs/omap_3430sdp_defconfig | |||
@@ -1313,8 +1313,33 @@ CONFIG_DVB_ISL6421=m | |||
1313 | # Graphics support | 1313 | # Graphics support |
1314 | # | 1314 | # |
1315 | # CONFIG_VGASTATE is not set | 1315 | # CONFIG_VGASTATE is not set |
1316 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | 1316 | CONFIG_FB=y |
1317 | # CONFIG_FB is not set | 1317 | # CONFIG_FIRMWARE_EDID is not set |
1318 | # CONFIG_FB_DDC is not set | ||
1319 | CONFIG_FB_CFB_FILLRECT=y | ||
1320 | CONFIG_FB_CFB_COPYAREA=y | ||
1321 | CONFIG_FB_CFB_IMAGEBLIT=y | ||
1322 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
1323 | # CONFIG_FB_SYS_FILLRECT is not set | ||
1324 | # CONFIG_FB_SYS_COPYAREA is not set | ||
1325 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
1326 | # CONFIG_FB_FOREIGN_ENDIAN is not set | ||
1327 | # CONFIG_FB_SYS_FOPS is not set | ||
1328 | # CONFIG_FB_SVGALIB is not set | ||
1329 | # CONFIG_FB_MACMODES is not set | ||
1330 | # CONFIG_FB_BACKLIGHT is not set | ||
1331 | # CONFIG_FB_MODE_HELPERS is not set | ||
1332 | # CONFIG_FB_TILEBLITTING is not set | ||
1333 | |||
1334 | # | ||
1335 | # Frame buffer hardware drivers | ||
1336 | # | ||
1337 | # CONFIG_FB_S1D13XXX is not set | ||
1338 | # CONFIG_FB_VIRTUAL is not set | ||
1339 | CONFIG_FB_OMAP=y | ||
1340 | # CONFIG_FB_OMAP_LCDC_EXTERNAL is not set | ||
1341 | # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set | ||
1342 | CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2 | ||
1318 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | 1343 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set |
1319 | 1344 | ||
1320 | # | 1345 | # |
@@ -1331,6 +1356,16 @@ CONFIG_DISPLAY_SUPPORT=y | |||
1331 | # | 1356 | # |
1332 | # CONFIG_VGA_CONSOLE is not set | 1357 | # CONFIG_VGA_CONSOLE is not set |
1333 | CONFIG_DUMMY_CONSOLE=y | 1358 | CONFIG_DUMMY_CONSOLE=y |
1359 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
1360 | # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set | ||
1361 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
1362 | # CONFIG_FONTS is not set | ||
1363 | CONFIG_FONT_8x8=y | ||
1364 | CONFIG_FONT_8x16=y | ||
1365 | CONFIG_LOGO=y | ||
1366 | CONFIG_LOGO_LINUX_MONO=y | ||
1367 | CONFIG_LOGO_LINUX_VGA16=y | ||
1368 | CONFIG_LOGO_LINUX_CLUT224=y | ||
1334 | CONFIG_SOUND=y | 1369 | CONFIG_SOUND=y |
1335 | CONFIG_SOUND_OSS_CORE=y | 1370 | CONFIG_SOUND_OSS_CORE=y |
1336 | CONFIG_SND=y | 1371 | CONFIG_SND=y |
diff --git a/arch/arm/configs/omap_ldp_defconfig b/arch/arm/configs/omap_ldp_defconfig index 679a4a3e265e..b9c48919a68c 100644 --- a/arch/arm/configs/omap_ldp_defconfig +++ b/arch/arm/configs/omap_ldp_defconfig | |||
@@ -690,6 +690,7 @@ CONFIG_GPIOLIB=y | |||
690 | # CONFIG_GPIO_MAX732X is not set | 690 | # CONFIG_GPIO_MAX732X is not set |
691 | # CONFIG_GPIO_PCA953X is not set | 691 | # CONFIG_GPIO_PCA953X is not set |
692 | # CONFIG_GPIO_PCF857X is not set | 692 | # CONFIG_GPIO_PCF857X is not set |
693 | CONFIG_GPIO_TWL4030=y | ||
693 | 694 | ||
694 | # | 695 | # |
695 | # PCI GPIO expanders: | 696 | # PCI GPIO expanders: |
@@ -742,6 +743,7 @@ CONFIG_SSB_POSSIBLE=y | |||
742 | # CONFIG_MFD_SM501 is not set | 743 | # CONFIG_MFD_SM501 is not set |
743 | # CONFIG_HTC_EGPIO is not set | 744 | # CONFIG_HTC_EGPIO is not set |
744 | # CONFIG_HTC_PASIC3 is not set | 745 | # CONFIG_HTC_PASIC3 is not set |
746 | CONFIG_TWL4030_CORE=y | ||
745 | # CONFIG_MFD_TMIO is not set | 747 | # CONFIG_MFD_TMIO is not set |
746 | # CONFIG_MFD_T7L66XB is not set | 748 | # CONFIG_MFD_T7L66XB is not set |
747 | # CONFIG_MFD_TC6387XB is not set | 749 | # CONFIG_MFD_TC6387XB is not set |
@@ -767,8 +769,46 @@ CONFIG_DAB=y | |||
767 | # | 769 | # |
768 | # CONFIG_VGASTATE is not set | 770 | # CONFIG_VGASTATE is not set |
769 | CONFIG_VIDEO_OUTPUT_CONTROL=m | 771 | CONFIG_VIDEO_OUTPUT_CONTROL=m |
770 | # CONFIG_FB is not set | 772 | CONFIG_FB=y |
771 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | 773 | CONFIG_FIRMWARE_EDID=y |
774 | # CONFIG_FB_DDC is not set | ||
775 | # CONFIG_FB_BOOT_VESA_SUPPORT is not set | ||
776 | CONFIG_FB_CFB_FILLRECT=y | ||
777 | CONFIG_FB_CFB_COPYAREA=y | ||
778 | CONFIG_FB_CFB_IMAGEBLIT=y | ||
779 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
780 | # CONFIG_FB_SYS_FILLRECT is not set | ||
781 | # CONFIG_FB_SYS_COPYAREA is not set | ||
782 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
783 | # CONFIG_FB_FOREIGN_ENDIAN is not set | ||
784 | # CONFIG_FB_SYS_FOPS is not set | ||
785 | # CONFIG_FB_SVGALIB is not set | ||
786 | # CONFIG_FB_MACMODES is not set | ||
787 | # CONFIG_FB_BACKLIGHT is not set | ||
788 | CONFIG_FB_MODE_HELPERS=y | ||
789 | CONFIG_FB_TILEBLITTING=y | ||
790 | |||
791 | # | ||
792 | # Frame buffer hardware drivers | ||
793 | # | ||
794 | # CONFIG_FB_S1D13XXX is not set | ||
795 | # CONFIG_FB_VIRTUAL is not set | ||
796 | # CONFIG_FB_METRONOME is not set | ||
797 | CONFIG_FB_OMAP=y | ||
798 | CONFIG_FB_OMAP_LCD_VGA=y | ||
799 | # CONFIG_FB_OMAP_LCDC_EXTERNAL is not set | ||
800 | # CONFIG_FB_OMAP_BOOTLOADER_INIT is not set | ||
801 | CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=4 | ||
802 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
803 | CONFIG_LCD_CLASS_DEVICE=y | ||
804 | # CONFIG_LCD_LTV350QV is not set | ||
805 | # CONFIG_LCD_ILI9320 is not set | ||
806 | # CONFIG_LCD_TDO24M is not set | ||
807 | # CONFIG_LCD_VGG2432A4 is not set | ||
808 | CONFIG_LCD_PLATFORM=y | ||
809 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
810 | # CONFIG_BACKLIGHT_CORGI is not set | ||
811 | # CONFIG_BACKLIGHT_GENERIC is not set | ||
772 | 812 | ||
773 | # | 813 | # |
774 | # Display device support | 814 | # Display device support |
@@ -780,6 +820,16 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m | |||
780 | # | 820 | # |
781 | # CONFIG_VGA_CONSOLE is not set | 821 | # CONFIG_VGA_CONSOLE is not set |
782 | CONFIG_DUMMY_CONSOLE=y | 822 | CONFIG_DUMMY_CONSOLE=y |
823 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
824 | # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set | ||
825 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
826 | # CONFIG_FONTS is not set | ||
827 | CONFIG_FONT_8x8=y | ||
828 | CONFIG_FONT_8x16=y | ||
829 | CONFIG_LOGO=y | ||
830 | CONFIG_LOGO_LINUX_MONO=y | ||
831 | CONFIG_LOGO_LINUX_VGA16=y | ||
832 | CONFIG_LOGO_LINUX_CLUT224=y | ||
783 | CONFIG_SOUND=y | 833 | CONFIG_SOUND=y |
784 | CONFIG_SND=y | 834 | CONFIG_SND=y |
785 | # CONFIG_SND_SEQUENCER is not set | 835 | # CONFIG_SND_SEQUENCER is not set |
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index a24d824c428b..e35d54d43e70 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -289,6 +289,13 @@ config MACH_NEOCORE926 | |||
289 | help | 289 | help |
290 | Select this if you are using the Adeneo Neocore 926 board. | 290 | Select this if you are using the Adeneo Neocore 926 board. |
291 | 291 | ||
292 | config MACH_AT91SAM9G20EK_2MMC | ||
293 | bool "Atmel AT91SAM9G20-EK Evaluation Kit modified for 2 MMC Slots" | ||
294 | depends on ARCH_AT91SAM9G20 | ||
295 | help | ||
296 | Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit | ||
297 | Rev A or B modified for 2 MMC Slots. | ||
298 | |||
292 | endif | 299 | endif |
293 | 300 | ||
294 | # ---------------------------------------------------------- | 301 | # ---------------------------------------------------------- |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index a6ed015d82ed..ada440aab0c5 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -59,6 +59,7 @@ obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o | |||
59 | 59 | ||
60 | # AT91SAM9G20 board-specific support | 60 | # AT91SAM9G20 board-specific support |
61 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o | 61 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o |
62 | obj-$(CONFIG_MACH_AT91SAM9G20EK_2MMC) += board-sam9g20ek-2slot-mmc.o | ||
62 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o | 63 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o |
63 | 64 | ||
64 | # AT91SAM9G45 board-specific support | 65 | # AT91SAM9G45 board-specific support |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index ee4ea0e720cf..07eb7b07e442 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -278,6 +278,102 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) | |||
278 | void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} | 278 | void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} |
279 | #endif | 279 | #endif |
280 | 280 | ||
281 | /* -------------------------------------------------------------------- | ||
282 | * MMC / SD Slot for Atmel MCI Driver | ||
283 | * -------------------------------------------------------------------- */ | ||
284 | |||
285 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
286 | static u64 mmc_dmamask = DMA_BIT_MASK(32); | ||
287 | static struct mci_platform_data mmc_data; | ||
288 | |||
289 | static struct resource mmc_resources[] = { | ||
290 | [0] = { | ||
291 | .start = AT91SAM9260_BASE_MCI, | ||
292 | .end = AT91SAM9260_BASE_MCI + SZ_16K - 1, | ||
293 | .flags = IORESOURCE_MEM, | ||
294 | }, | ||
295 | [1] = { | ||
296 | .start = AT91SAM9260_ID_MCI, | ||
297 | .end = AT91SAM9260_ID_MCI, | ||
298 | .flags = IORESOURCE_IRQ, | ||
299 | }, | ||
300 | }; | ||
301 | |||
302 | static struct platform_device at91sam9260_mmc_device = { | ||
303 | .name = "atmel_mci", | ||
304 | .id = -1, | ||
305 | .dev = { | ||
306 | .dma_mask = &mmc_dmamask, | ||
307 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
308 | .platform_data = &mmc_data, | ||
309 | }, | ||
310 | .resource = mmc_resources, | ||
311 | .num_resources = ARRAY_SIZE(mmc_resources), | ||
312 | }; | ||
313 | |||
314 | void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) | ||
315 | { | ||
316 | unsigned int i; | ||
317 | unsigned int slot_count = 0; | ||
318 | |||
319 | if (!data) | ||
320 | return; | ||
321 | |||
322 | for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) { | ||
323 | if (data->slot[i].bus_width) { | ||
324 | /* input/irq */ | ||
325 | if (data->slot[i].detect_pin) { | ||
326 | at91_set_gpio_input(data->slot[i].detect_pin, 1); | ||
327 | at91_set_deglitch(data->slot[i].detect_pin, 1); | ||
328 | } | ||
329 | if (data->slot[i].wp_pin) | ||
330 | at91_set_gpio_input(data->slot[i].wp_pin, 1); | ||
331 | |||
332 | switch (i) { | ||
333 | case 0: | ||
334 | /* CMD */ | ||
335 | at91_set_A_periph(AT91_PIN_PA7, 1); | ||
336 | /* DAT0, maybe DAT1..DAT3 */ | ||
337 | at91_set_A_periph(AT91_PIN_PA6, 1); | ||
338 | if (data->slot[i].bus_width == 4) { | ||
339 | at91_set_A_periph(AT91_PIN_PA9, 1); | ||
340 | at91_set_A_periph(AT91_PIN_PA10, 1); | ||
341 | at91_set_A_periph(AT91_PIN_PA11, 1); | ||
342 | } | ||
343 | slot_count++; | ||
344 | break; | ||
345 | case 1: | ||
346 | /* CMD */ | ||
347 | at91_set_B_periph(AT91_PIN_PA1, 1); | ||
348 | /* DAT0, maybe DAT1..DAT3 */ | ||
349 | at91_set_B_periph(AT91_PIN_PA0, 1); | ||
350 | if (data->slot[i].bus_width == 4) { | ||
351 | at91_set_B_periph(AT91_PIN_PA5, 1); | ||
352 | at91_set_B_periph(AT91_PIN_PA4, 1); | ||
353 | at91_set_B_periph(AT91_PIN_PA3, 1); | ||
354 | } | ||
355 | slot_count++; | ||
356 | break; | ||
357 | default: | ||
358 | printk(KERN_ERR | ||
359 | "AT91: SD/MMC slot %d not available\n", i); | ||
360 | break; | ||
361 | } | ||
362 | } | ||
363 | } | ||
364 | |||
365 | if (slot_count) { | ||
366 | /* CLK */ | ||
367 | at91_set_A_periph(AT91_PIN_PA8, 0); | ||
368 | |||
369 | mmc_data = *data; | ||
370 | platform_device_register(&at91sam9260_mmc_device); | ||
371 | } | ||
372 | } | ||
373 | #else | ||
374 | void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {} | ||
375 | #endif | ||
376 | |||
281 | 377 | ||
282 | /* -------------------------------------------------------------------- | 378 | /* -------------------------------------------------------------------- |
283 | * NAND / SmartMedia | 379 | * NAND / SmartMedia |
diff --git a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c new file mode 100644 index 000000000000..a28e53faf71d --- /dev/null +++ b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c | |||
@@ -0,0 +1,277 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 SAN People | ||
3 | * Copyright (C) 2008 Atmel | ||
4 | * Copyright (C) 2009 Rob Emanuele | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/mm.h> | ||
24 | #include <linux/module.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/spi/spi.h> | ||
27 | #include <linux/spi/at73c213.h> | ||
28 | #include <linux/clk.h> | ||
29 | |||
30 | #include <mach/hardware.h> | ||
31 | #include <asm/setup.h> | ||
32 | #include <asm/mach-types.h> | ||
33 | #include <asm/irq.h> | ||
34 | |||
35 | #include <asm/mach/arch.h> | ||
36 | #include <asm/mach/map.h> | ||
37 | #include <asm/mach/irq.h> | ||
38 | |||
39 | #include <mach/board.h> | ||
40 | #include <mach/gpio.h> | ||
41 | #include <mach/at91sam9_smc.h> | ||
42 | |||
43 | #include "sam9_smc.h" | ||
44 | #include "generic.h" | ||
45 | |||
46 | |||
47 | static void __init ek_map_io(void) | ||
48 | { | ||
49 | /* Initialize processor: 18.432 MHz crystal */ | ||
50 | at91sam9260_initialize(18432000); | ||
51 | |||
52 | /* DGBU on ttyS0. (Rx & Tx only) */ | ||
53 | at91_register_uart(0, 0, 0); | ||
54 | |||
55 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
56 | at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
57 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
58 | | ATMEL_UART_RI); | ||
59 | |||
60 | /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ | ||
61 | at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
62 | |||
63 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
64 | at91_set_serial_console(0); | ||
65 | } | ||
66 | |||
67 | static void __init ek_init_irq(void) | ||
68 | { | ||
69 | at91sam9260_init_interrupts(NULL); | ||
70 | } | ||
71 | |||
72 | |||
73 | /* | ||
74 | * USB Host port | ||
75 | */ | ||
76 | static struct at91_usbh_data __initdata ek_usbh_data = { | ||
77 | .ports = 2, | ||
78 | }; | ||
79 | |||
80 | /* | ||
81 | * USB Device port | ||
82 | */ | ||
83 | static struct at91_udc_data __initdata ek_udc_data = { | ||
84 | .vbus_pin = AT91_PIN_PC5, | ||
85 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
86 | }; | ||
87 | |||
88 | |||
89 | /* | ||
90 | * SPI devices. | ||
91 | */ | ||
92 | static struct spi_board_info ek_spi_devices[] = { | ||
93 | #if !defined(CONFIG_MMC_ATMELMCI) | ||
94 | { /* DataFlash chip */ | ||
95 | .modalias = "mtd_dataflash", | ||
96 | .chip_select = 1, | ||
97 | .max_speed_hz = 15 * 1000 * 1000, | ||
98 | .bus_num = 0, | ||
99 | }, | ||
100 | #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) | ||
101 | { /* DataFlash card */ | ||
102 | .modalias = "mtd_dataflash", | ||
103 | .chip_select = 0, | ||
104 | .max_speed_hz = 15 * 1000 * 1000, | ||
105 | .bus_num = 0, | ||
106 | }, | ||
107 | #endif | ||
108 | #endif | ||
109 | }; | ||
110 | |||
111 | |||
112 | /* | ||
113 | * MACB Ethernet device | ||
114 | */ | ||
115 | static struct at91_eth_data __initdata ek_macb_data = { | ||
116 | .phy_irq_pin = AT91_PIN_PC12, | ||
117 | .is_rmii = 1, | ||
118 | }; | ||
119 | |||
120 | |||
121 | /* | ||
122 | * NAND flash | ||
123 | */ | ||
124 | static struct mtd_partition __initdata ek_nand_partition[] = { | ||
125 | { | ||
126 | .name = "Bootstrap", | ||
127 | .offset = 0, | ||
128 | .size = 4 * SZ_1M, | ||
129 | }, | ||
130 | { | ||
131 | .name = "Partition 1", | ||
132 | .offset = MTDPART_OFS_NXTBLK, | ||
133 | .size = 60 * SZ_1M, | ||
134 | }, | ||
135 | { | ||
136 | .name = "Partition 2", | ||
137 | .offset = MTDPART_OFS_NXTBLK, | ||
138 | .size = MTDPART_SIZ_FULL, | ||
139 | }, | ||
140 | }; | ||
141 | |||
142 | static struct mtd_partition * __init nand_partitions(int size, int *num_partitions) | ||
143 | { | ||
144 | *num_partitions = ARRAY_SIZE(ek_nand_partition); | ||
145 | return ek_nand_partition; | ||
146 | } | ||
147 | |||
148 | /* det_pin is not connected */ | ||
149 | static struct atmel_nand_data __initdata ek_nand_data = { | ||
150 | .ale = 21, | ||
151 | .cle = 22, | ||
152 | .rdy_pin = AT91_PIN_PC13, | ||
153 | .enable_pin = AT91_PIN_PC14, | ||
154 | .partition_info = nand_partitions, | ||
155 | #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16) | ||
156 | .bus_width_16 = 1, | ||
157 | #else | ||
158 | .bus_width_16 = 0, | ||
159 | #endif | ||
160 | }; | ||
161 | |||
162 | static struct sam9_smc_config __initdata ek_nand_smc_config = { | ||
163 | .ncs_read_setup = 0, | ||
164 | .nrd_setup = 2, | ||
165 | .ncs_write_setup = 0, | ||
166 | .nwe_setup = 2, | ||
167 | |||
168 | .ncs_read_pulse = 4, | ||
169 | .nrd_pulse = 4, | ||
170 | .ncs_write_pulse = 4, | ||
171 | .nwe_pulse = 4, | ||
172 | |||
173 | .read_cycle = 7, | ||
174 | .write_cycle = 7, | ||
175 | |||
176 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE, | ||
177 | .tdf_cycles = 3, | ||
178 | }; | ||
179 | |||
180 | static void __init ek_add_device_nand(void) | ||
181 | { | ||
182 | /* setup bus-width (8 or 16) */ | ||
183 | if (ek_nand_data.bus_width_16) | ||
184 | ek_nand_smc_config.mode |= AT91_SMC_DBW_16; | ||
185 | else | ||
186 | ek_nand_smc_config.mode |= AT91_SMC_DBW_8; | ||
187 | |||
188 | /* configure chip-select 3 (NAND) */ | ||
189 | sam9_smc_configure(3, &ek_nand_smc_config); | ||
190 | |||
191 | at91_add_device_nand(&ek_nand_data); | ||
192 | } | ||
193 | |||
194 | |||
195 | /* | ||
196 | * MCI (SD/MMC) | ||
197 | * det_pin and wp_pin are not connected | ||
198 | */ | ||
199 | #if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) | ||
200 | static struct mci_platform_data __initdata ek_mmc_data = { | ||
201 | .slot[0] = { | ||
202 | .bus_width = 4, | ||
203 | .detect_pin = -ENODEV, | ||
204 | .wp_pin = -ENODEV, | ||
205 | }, | ||
206 | .slot[1] = { | ||
207 | .bus_width = 4, | ||
208 | .detect_pin = -ENODEV, | ||
209 | .wp_pin = -ENODEV, | ||
210 | }, | ||
211 | |||
212 | }; | ||
213 | #else | ||
214 | static struct amci_platform_data __initdata ek_mmc_data = { | ||
215 | }; | ||
216 | #endif | ||
217 | |||
218 | /* | ||
219 | * LEDs | ||
220 | */ | ||
221 | static struct gpio_led ek_leds[] = { | ||
222 | { /* "bottom" led, green, userled1 to be defined */ | ||
223 | .name = "ds5", | ||
224 | .gpio = AT91_PIN_PB12, | ||
225 | .active_low = 1, | ||
226 | .default_trigger = "none", | ||
227 | }, | ||
228 | { /* "power" led, yellow */ | ||
229 | .name = "ds1", | ||
230 | .gpio = AT91_PIN_PB13, | ||
231 | .default_trigger = "heartbeat", | ||
232 | } | ||
233 | }; | ||
234 | |||
235 | static struct i2c_board_info __initdata ek_i2c_devices[] = { | ||
236 | { | ||
237 | I2C_BOARD_INFO("24c512", 0x50), | ||
238 | }, | ||
239 | }; | ||
240 | |||
241 | |||
242 | static void __init ek_board_init(void) | ||
243 | { | ||
244 | /* Serial */ | ||
245 | at91_add_device_serial(); | ||
246 | /* USB Host */ | ||
247 | at91_add_device_usbh(&ek_usbh_data); | ||
248 | /* USB Device */ | ||
249 | at91_add_device_udc(&ek_udc_data); | ||
250 | /* SPI */ | ||
251 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); | ||
252 | /* NAND */ | ||
253 | ek_add_device_nand(); | ||
254 | /* Ethernet */ | ||
255 | at91_add_device_eth(&ek_macb_data); | ||
256 | /* MMC */ | ||
257 | at91_add_device_mci(0, &ek_mmc_data); | ||
258 | /* I2C */ | ||
259 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); | ||
260 | /* LEDs */ | ||
261 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | ||
262 | /* PCK0 provides MCLK to the WM8731 */ | ||
263 | at91_set_B_periph(AT91_PIN_PC1, 0); | ||
264 | /* SSC (for WM8731) */ | ||
265 | at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); | ||
266 | } | ||
267 | |||
268 | MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") | ||
269 | /* Maintainer: Rob Emanuele */ | ||
270 | .phys_io = AT91_BASE_SYS, | ||
271 | .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, | ||
272 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
273 | .timer = &at91sam926x_timer, | ||
274 | .map_io = ek_map_io, | ||
275 | .init_irq = ek_init_irq, | ||
276 | .init_machine = ek_board_init, | ||
277 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index 13f27a4b882d..583f38a38df7 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/leds.h> | 37 | #include <linux/leds.h> |
38 | #include <linux/spi/spi.h> | 38 | #include <linux/spi/spi.h> |
39 | #include <linux/usb/atmel_usba_udc.h> | 39 | #include <linux/usb/atmel_usba_udc.h> |
40 | #include <linux/atmel-mci.h> | ||
40 | #include <sound/atmel-ac97c.h> | 41 | #include <sound/atmel-ac97c.h> |
41 | 42 | ||
42 | /* USB Device */ | 43 | /* USB Device */ |
@@ -64,6 +65,7 @@ struct at91_cf_data { | |||
64 | extern void __init at91_add_device_cf(struct at91_cf_data *data); | 65 | extern void __init at91_add_device_cf(struct at91_cf_data *data); |
65 | 66 | ||
66 | /* MMC / SD */ | 67 | /* MMC / SD */ |
68 | /* at91_mci platform config */ | ||
67 | struct at91_mmc_data { | 69 | struct at91_mmc_data { |
68 | u8 det_pin; /* card detect IRQ */ | 70 | u8 det_pin; /* card detect IRQ */ |
69 | unsigned slot_b:1; /* uses Slot B */ | 71 | unsigned slot_b:1; /* uses Slot B */ |
@@ -73,6 +75,9 @@ struct at91_mmc_data { | |||
73 | }; | 75 | }; |
74 | extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data); | 76 | extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data); |
75 | 77 | ||
78 | /* atmel-mci platform config */ | ||
79 | extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data); | ||
80 | |||
76 | /* Ethernet (EMAC & MACB) */ | 81 | /* Ethernet (EMAC & MACB) */ |
77 | struct at91_eth_data { | 82 | struct at91_eth_data { |
78 | u32 phy_mask; | 83 | u32 phy_mask; |
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 3dd0e2a23095..dda19cd76194 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
@@ -37,7 +37,7 @@ struct clk { | |||
37 | static unsigned long get_uart_rate(struct clk *clk); | 37 | static unsigned long get_uart_rate(struct clk *clk); |
38 | 38 | ||
39 | static int set_keytchclk_rate(struct clk *clk, unsigned long rate); | 39 | static int set_keytchclk_rate(struct clk *clk, unsigned long rate); |
40 | 40 | static int set_div_rate(struct clk *clk, unsigned long rate); | |
41 | 41 | ||
42 | static struct clk clk_uart1 = { | 42 | static struct clk clk_uart1 = { |
43 | .sw_locked = 1, | 43 | .sw_locked = 1, |
@@ -76,6 +76,13 @@ static struct clk clk_pwm = { | |||
76 | .rate = EP93XX_EXT_CLK_RATE, | 76 | .rate = EP93XX_EXT_CLK_RATE, |
77 | }; | 77 | }; |
78 | 78 | ||
79 | static struct clk clk_video = { | ||
80 | .sw_locked = 1, | ||
81 | .enable_reg = EP93XX_SYSCON_VIDCLKDIV, | ||
82 | .enable_mask = EP93XX_SYSCON_CLKDIV_ENABLE, | ||
83 | .set_rate = set_div_rate, | ||
84 | }; | ||
85 | |||
79 | /* DMA Clocks */ | 86 | /* DMA Clocks */ |
80 | static struct clk clk_m2p0 = { | 87 | static struct clk clk_m2p0 = { |
81 | .enable_reg = EP93XX_SYSCON_PWRCNT, | 88 | .enable_reg = EP93XX_SYSCON_PWRCNT, |
@@ -140,6 +147,7 @@ static struct clk_lookup clocks[] = { | |||
140 | INIT_CK(NULL, "pll2", &clk_pll2), | 147 | INIT_CK(NULL, "pll2", &clk_pll2), |
141 | INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), | 148 | INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), |
142 | INIT_CK("ep93xx-keypad", NULL, &clk_keypad), | 149 | INIT_CK("ep93xx-keypad", NULL, &clk_keypad), |
150 | INIT_CK("ep93xx-fb", NULL, &clk_video), | ||
143 | INIT_CK(NULL, "pwm_clk", &clk_pwm), | 151 | INIT_CK(NULL, "pwm_clk", &clk_pwm), |
144 | INIT_CK(NULL, "m2p0", &clk_m2p0), | 152 | INIT_CK(NULL, "m2p0", &clk_m2p0), |
145 | INIT_CK(NULL, "m2p1", &clk_m2p1), | 153 | INIT_CK(NULL, "m2p1", &clk_m2p1), |
@@ -236,6 +244,84 @@ static int set_keytchclk_rate(struct clk *clk, unsigned long rate) | |||
236 | return 0; | 244 | return 0; |
237 | } | 245 | } |
238 | 246 | ||
247 | static unsigned long calc_clk_div(unsigned long rate, int *psel, int *esel, | ||
248 | int *pdiv, int *div) | ||
249 | { | ||
250 | unsigned long max_rate, best_rate = 0, | ||
251 | actual_rate = 0, mclk_rate = 0, rate_err = -1; | ||
252 | int i, found = 0, __div = 0, __pdiv = 0; | ||
253 | |||
254 | /* Don't exceed the maximum rate */ | ||
255 | max_rate = max(max(clk_pll1.rate / 4, clk_pll2.rate / 4), | ||
256 | (unsigned long)EP93XX_EXT_CLK_RATE / 4); | ||
257 | rate = min(rate, max_rate); | ||
258 | |||
259 | /* | ||
260 | * Try the two pll's and the external clock | ||
261 | * Because the valid predividers are 2, 2.5 and 3, we multiply | ||
262 | * all the clocks by 2 to avoid floating point math. | ||
263 | * | ||
264 | * This is based on the algorithm in the ep93xx raster guide: | ||
265 | * http://be-a-maverick.com/en/pubs/appNote/AN269REV1.pdf | ||
266 | * | ||
267 | */ | ||
268 | for (i = 0; i < 3; i++) { | ||
269 | if (i == 0) | ||
270 | mclk_rate = EP93XX_EXT_CLK_RATE * 2; | ||
271 | else if (i == 1) | ||
272 | mclk_rate = clk_pll1.rate * 2; | ||
273 | else if (i == 2) | ||
274 | mclk_rate = clk_pll2.rate * 2; | ||
275 | |||
276 | /* Try each predivider value */ | ||
277 | for (__pdiv = 4; __pdiv <= 6; __pdiv++) { | ||
278 | __div = mclk_rate / (rate * __pdiv); | ||
279 | if (__div < 2 || __div > 127) | ||
280 | continue; | ||
281 | |||
282 | actual_rate = mclk_rate / (__pdiv * __div); | ||
283 | |||
284 | if (!found || abs(actual_rate - rate) < rate_err) { | ||
285 | *pdiv = __pdiv - 3; | ||
286 | *div = __div; | ||
287 | *psel = (i == 2); | ||
288 | *esel = (i != 0); | ||
289 | best_rate = actual_rate; | ||
290 | rate_err = abs(actual_rate - rate); | ||
291 | found = 1; | ||
292 | } | ||
293 | } | ||
294 | } | ||
295 | |||
296 | if (!found) | ||
297 | return 0; | ||
298 | |||
299 | return best_rate; | ||
300 | } | ||
301 | |||
302 | static int set_div_rate(struct clk *clk, unsigned long rate) | ||
303 | { | ||
304 | unsigned long actual_rate; | ||
305 | int psel = 0, esel = 0, pdiv = 0, div = 0; | ||
306 | u32 val; | ||
307 | |||
308 | actual_rate = calc_clk_div(rate, &psel, &esel, &pdiv, &div); | ||
309 | if (actual_rate == 0) | ||
310 | return -EINVAL; | ||
311 | clk->rate = actual_rate; | ||
312 | |||
313 | /* Clear the esel, psel, pdiv and div bits */ | ||
314 | val = __raw_readl(clk->enable_reg); | ||
315 | val &= ~0x7fff; | ||
316 | |||
317 | /* Set the new esel, psel, pdiv and div bits for the new clock rate */ | ||
318 | val |= (esel ? EP93XX_SYSCON_CLKDIV_ESEL : 0) | | ||
319 | (psel ? EP93XX_SYSCON_CLKDIV_PSEL : 0) | | ||
320 | (pdiv << EP93XX_SYSCON_CLKDIV_PDIV_SHIFT) | div; | ||
321 | ep93xx_syscon_swlocked_write(val, clk->enable_reg); | ||
322 | return 0; | ||
323 | } | ||
324 | |||
239 | int clk_set_rate(struct clk *clk, unsigned long rate) | 325 | int clk_set_rate(struct clk *clk, unsigned long rate) |
240 | { | 326 | { |
241 | if (clk->set_rate) | 327 | if (clk->set_rate) |
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 16b92c37ec99..f7ebed942f66 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/i2c-gpio.h> | 30 | #include <linux/i2c-gpio.h> |
31 | 31 | ||
32 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
33 | #include <mach/fb.h> | ||
33 | 34 | ||
34 | #include <asm/mach/map.h> | 35 | #include <asm/mach/map.h> |
35 | #include <asm/mach/time.h> | 36 | #include <asm/mach/time.h> |
@@ -682,6 +683,37 @@ void ep93xx_pwm_release_gpio(struct platform_device *pdev) | |||
682 | EXPORT_SYMBOL(ep93xx_pwm_release_gpio); | 683 | EXPORT_SYMBOL(ep93xx_pwm_release_gpio); |
683 | 684 | ||
684 | 685 | ||
686 | /************************************************************************* | ||
687 | * EP93xx video peripheral handling | ||
688 | *************************************************************************/ | ||
689 | static struct ep93xxfb_mach_info ep93xxfb_data; | ||
690 | |||
691 | static struct resource ep93xx_fb_resource[] = { | ||
692 | { | ||
693 | .start = EP93XX_RASTER_PHYS_BASE, | ||
694 | .end = EP93XX_RASTER_PHYS_BASE + 0x800 - 1, | ||
695 | .flags = IORESOURCE_MEM, | ||
696 | }, | ||
697 | }; | ||
698 | |||
699 | static struct platform_device ep93xx_fb_device = { | ||
700 | .name = "ep93xx-fb", | ||
701 | .id = -1, | ||
702 | .dev = { | ||
703 | .platform_data = &ep93xxfb_data, | ||
704 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
705 | .dma_mask = &ep93xx_fb_device.dev.coherent_dma_mask, | ||
706 | }, | ||
707 | .num_resources = ARRAY_SIZE(ep93xx_fb_resource), | ||
708 | .resource = ep93xx_fb_resource, | ||
709 | }; | ||
710 | |||
711 | void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) | ||
712 | { | ||
713 | ep93xxfb_data = *data; | ||
714 | platform_device_register(&ep93xx_fb_device); | ||
715 | } | ||
716 | |||
685 | extern void ep93xx_gpio_init(void); | 717 | extern void ep93xx_gpio_init(void); |
686 | 718 | ||
687 | void __init ep93xx_init_devices(void) | 719 | void __init ep93xx_init_devices(void) |
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h index ea78e908fc82..0fbf87b16338 100644 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | |||
@@ -70,6 +70,7 @@ | |||
70 | #define EP93XX_USB_PHYS_BASE (EP93XX_AHB_PHYS_BASE + 0x00020000) | 70 | #define EP93XX_USB_PHYS_BASE (EP93XX_AHB_PHYS_BASE + 0x00020000) |
71 | #define EP93XX_USB_BASE EP93XX_AHB_IOMEM(0x00020000) | 71 | #define EP93XX_USB_BASE EP93XX_AHB_IOMEM(0x00020000) |
72 | 72 | ||
73 | #define EP93XX_RASTER_PHYS_BASE (EP93XX_AHB_PHYS_BASE + 0x00030000) | ||
73 | #define EP93XX_RASTER_BASE EP93XX_AHB_IOMEM(0x00030000) | 74 | #define EP93XX_RASTER_BASE EP93XX_AHB_IOMEM(0x00030000) |
74 | 75 | ||
75 | #define EP93XX_GRAPHICS_ACCEL_BASE EP93XX_AHB_IOMEM(0x00040000) | 76 | #define EP93XX_GRAPHICS_ACCEL_BASE EP93XX_AHB_IOMEM(0x00040000) |
@@ -207,6 +208,11 @@ | |||
207 | #define EP93XX_SYSCON_DEVCFG_ADCPD (1<<2) | 208 | #define EP93XX_SYSCON_DEVCFG_ADCPD (1<<2) |
208 | #define EP93XX_SYSCON_DEVCFG_KEYS (1<<1) | 209 | #define EP93XX_SYSCON_DEVCFG_KEYS (1<<1) |
209 | #define EP93XX_SYSCON_DEVCFG_SHENA (1<<0) | 210 | #define EP93XX_SYSCON_DEVCFG_SHENA (1<<0) |
211 | #define EP93XX_SYSCON_VIDCLKDIV EP93XX_SYSCON_REG(0x84) | ||
212 | #define EP93XX_SYSCON_CLKDIV_ENABLE (1<<15) | ||
213 | #define EP93XX_SYSCON_CLKDIV_ESEL (1<<14) | ||
214 | #define EP93XX_SYSCON_CLKDIV_PSEL (1<<13) | ||
215 | #define EP93XX_SYSCON_CLKDIV_PDIV_SHIFT 8 | ||
210 | #define EP93XX_SYSCON_KEYTCHCLKDIV EP93XX_SYSCON_REG(0x90) | 216 | #define EP93XX_SYSCON_KEYTCHCLKDIV EP93XX_SYSCON_REG(0x90) |
211 | #define EP93XX_SYSCON_KEYTCHCLKDIV_TSEN (1<<31) | 217 | #define EP93XX_SYSCON_KEYTCHCLKDIV_TSEN (1<<31) |
212 | #define EP93XX_SYSCON_KEYTCHCLKDIV_ADIV (1<<16) | 218 | #define EP93XX_SYSCON_KEYTCHCLKDIV_ADIV (1<<16) |
diff --git a/arch/arm/mach-ep93xx/include/mach/fb.h b/arch/arm/mach-ep93xx/include/mach/fb.h new file mode 100644 index 000000000000..d5ae11d7c453 --- /dev/null +++ b/arch/arm/mach-ep93xx/include/mach/fb.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ep93xx/include/mach/fb.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __ASM_ARCH_EP93XXFB_H | ||
6 | #define __ASM_ARCH_EP93XXFB_H | ||
7 | |||
8 | struct platform_device; | ||
9 | struct fb_videomode; | ||
10 | struct fb_info; | ||
11 | |||
12 | #define EP93XXFB_USE_MODEDB 0 | ||
13 | |||
14 | /* VideoAttributes flags */ | ||
15 | #define EP93XXFB_STATE_MACHINE_ENABLE (1 << 0) | ||
16 | #define EP93XXFB_PIXEL_CLOCK_ENABLE (1 << 1) | ||
17 | #define EP93XXFB_VSYNC_ENABLE (1 << 2) | ||
18 | #define EP93XXFB_PIXEL_DATA_ENABLE (1 << 3) | ||
19 | #define EP93XXFB_COMPOSITE_SYNC (1 << 4) | ||
20 | #define EP93XXFB_SYNC_VERT_HIGH (1 << 5) | ||
21 | #define EP93XXFB_SYNC_HORIZ_HIGH (1 << 6) | ||
22 | #define EP93XXFB_SYNC_BLANK_HIGH (1 << 7) | ||
23 | #define EP93XXFB_PCLK_FALLING (1 << 8) | ||
24 | #define EP93XXFB_ENABLE_AC (1 << 9) | ||
25 | #define EP93XXFB_ENABLE_LCD (1 << 10) | ||
26 | #define EP93XXFB_ENABLE_CCIR (1 << 12) | ||
27 | #define EP93XXFB_USE_PARALLEL_INTERFACE (1 << 13) | ||
28 | #define EP93XXFB_ENABLE_INTERRUPT (1 << 14) | ||
29 | #define EP93XXFB_USB_INTERLACE (1 << 16) | ||
30 | #define EP93XXFB_USE_EQUALIZATION (1 << 17) | ||
31 | #define EP93XXFB_USE_DOUBLE_HORZ (1 << 18) | ||
32 | #define EP93XXFB_USE_DOUBLE_VERT (1 << 19) | ||
33 | #define EP93XXFB_USE_BLANK_PIXEL (1 << 20) | ||
34 | #define EP93XXFB_USE_SDCSN0 (0 << 21) | ||
35 | #define EP93XXFB_USE_SDCSN1 (1 << 21) | ||
36 | #define EP93XXFB_USE_SDCSN2 (2 << 21) | ||
37 | #define EP93XXFB_USE_SDCSN3 (3 << 21) | ||
38 | |||
39 | #define EP93XXFB_ENABLE (EP93XXFB_STATE_MACHINE_ENABLE | \ | ||
40 | EP93XXFB_PIXEL_CLOCK_ENABLE | \ | ||
41 | EP93XXFB_VSYNC_ENABLE | \ | ||
42 | EP93XXFB_PIXEL_DATA_ENABLE) | ||
43 | |||
44 | struct ep93xxfb_mach_info { | ||
45 | unsigned int num_modes; | ||
46 | const struct fb_videomode *modes; | ||
47 | const struct fb_videomode *default_mode; | ||
48 | int bpp; | ||
49 | unsigned int flags; | ||
50 | |||
51 | int (*setup)(struct platform_device *pdev); | ||
52 | void (*teardown)(struct platform_device *pdev); | ||
53 | void (*blank)(int blank_mode, struct fb_info *info); | ||
54 | }; | ||
55 | |||
56 | #endif /* __ASM_ARCH_EP93XXFB_H */ | ||
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index 5f5fa6574d34..01a0f0838e5b 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | struct i2c_board_info; | 7 | struct i2c_board_info; |
8 | struct platform_device; | 8 | struct platform_device; |
9 | struct ep93xxfb_mach_info; | ||
9 | 10 | ||
10 | struct ep93xx_eth_data | 11 | struct ep93xx_eth_data |
11 | { | 12 | { |
@@ -33,6 +34,7 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits) | |||
33 | 34 | ||
34 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); | 35 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); |
35 | void ep93xx_register_i2c(struct i2c_board_info *devices, int num); | 36 | void ep93xx_register_i2c(struct i2c_board_info *devices, int num); |
37 | void ep93xx_register_fb(struct ep93xxfb_mach_info *data); | ||
36 | void ep93xx_register_pwm(int pwm0, int pwm1); | 38 | void ep93xx_register_pwm(int pwm0, int pwm1); |
37 | int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); | 39 | int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); |
38 | void ep93xx_pwm_release_gpio(struct platform_device *pdev); | 40 | void ep93xx_pwm_release_gpio(struct platform_device *pdev); |
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index 79bdea943eb4..6bfd537d5afb 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c | |||
@@ -16,12 +16,164 @@ | |||
16 | #include <linux/amba/bus.h> | 16 | #include <linux/amba/bus.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/mtd/mtd.h> | ||
20 | #include <linux/mtd/nand.h> | ||
21 | #include <linux/mtd/partitions.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <asm/sizes.h> | ||
19 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
20 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
21 | #include <asm/mach/irq.h> | 26 | #include <asm/mach/irq.h> |
27 | #include <asm/mach/flash.h> | ||
22 | #include <mach/setup.h> | 28 | #include <mach/setup.h> |
29 | #include <mach/nand.h> | ||
30 | #include <mach/fsmc.h> | ||
23 | #include "clock.h" | 31 | #include "clock.h" |
24 | 32 | ||
33 | /* These adresses span 16MB, so use three individual pages */ | ||
34 | static struct resource nhk8815_nand_resources[] = { | ||
35 | { | ||
36 | .name = "nand_addr", | ||
37 | .start = NAND_IO_ADDR, | ||
38 | .end = NAND_IO_ADDR + 0xfff, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }, { | ||
41 | .name = "nand_cmd", | ||
42 | .start = NAND_IO_CMD, | ||
43 | .end = NAND_IO_CMD + 0xfff, | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | }, { | ||
46 | .name = "nand_data", | ||
47 | .start = NAND_IO_DATA, | ||
48 | .end = NAND_IO_DATA + 0xfff, | ||
49 | .flags = IORESOURCE_MEM, | ||
50 | } | ||
51 | }; | ||
52 | |||
53 | static int nhk8815_nand_init(void) | ||
54 | { | ||
55 | /* FSMC setup for nand chip select (8-bit nand in 8815NHK) */ | ||
56 | writel(0x0000000E, FSMC_PCR(0)); | ||
57 | writel(0x000D0A00, FSMC_PMEM(0)); | ||
58 | writel(0x00100A00, FSMC_PATT(0)); | ||
59 | |||
60 | /* enable access to the chip select area */ | ||
61 | writel(readl(FSMC_PCR(0)) | 0x04, FSMC_PCR(0)); | ||
62 | |||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | /* | ||
67 | * These partitions are the same as those used in the 2.6.20 release | ||
68 | * shipped by the vendor; the first two partitions are mandated | ||
69 | * by the boot ROM, and the bootloader area is somehow oversized... | ||
70 | */ | ||
71 | static struct mtd_partition nhk8815_partitions[] = { | ||
72 | { | ||
73 | .name = "X-Loader(NAND)", | ||
74 | .offset = 0, | ||
75 | .size = SZ_256K, | ||
76 | }, { | ||
77 | .name = "MemInit(NAND)", | ||
78 | .offset = MTDPART_OFS_APPEND, | ||
79 | .size = SZ_256K, | ||
80 | }, { | ||
81 | .name = "BootLoader(NAND)", | ||
82 | .offset = MTDPART_OFS_APPEND, | ||
83 | .size = SZ_2M, | ||
84 | }, { | ||
85 | .name = "Kernel zImage(NAND)", | ||
86 | .offset = MTDPART_OFS_APPEND, | ||
87 | .size = 3 * SZ_1M, | ||
88 | }, { | ||
89 | .name = "Root Filesystem(NAND)", | ||
90 | .offset = MTDPART_OFS_APPEND, | ||
91 | .size = 22 * SZ_1M, | ||
92 | }, { | ||
93 | .name = "User Filesystem(NAND)", | ||
94 | .offset = MTDPART_OFS_APPEND, | ||
95 | .size = MTDPART_SIZ_FULL, | ||
96 | } | ||
97 | }; | ||
98 | |||
99 | static struct nomadik_nand_platform_data nhk8815_nand_data = { | ||
100 | .parts = nhk8815_partitions, | ||
101 | .nparts = ARRAY_SIZE(nhk8815_partitions), | ||
102 | .options = NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING \ | ||
103 | | NAND_NO_READRDY | NAND_NO_AUTOINCR, | ||
104 | .init = nhk8815_nand_init, | ||
105 | }; | ||
106 | |||
107 | static struct platform_device nhk8815_nand_device = { | ||
108 | .name = "nomadik_nand", | ||
109 | .dev = { | ||
110 | .platform_data = &nhk8815_nand_data, | ||
111 | }, | ||
112 | .resource = nhk8815_nand_resources, | ||
113 | .num_resources = ARRAY_SIZE(nhk8815_nand_resources), | ||
114 | }; | ||
115 | |||
116 | /* These are the partitions for the OneNand device, different from above */ | ||
117 | static struct mtd_partition nhk8815_onenand_partitions[] = { | ||
118 | { | ||
119 | .name = "X-Loader(OneNAND)", | ||
120 | .offset = 0, | ||
121 | .size = SZ_256K, | ||
122 | }, { | ||
123 | .name = "MemInit(OneNAND)", | ||
124 | .offset = MTDPART_OFS_APPEND, | ||
125 | .size = SZ_256K, | ||
126 | }, { | ||
127 | .name = "BootLoader(OneNAND)", | ||
128 | .offset = MTDPART_OFS_APPEND, | ||
129 | .size = SZ_2M-SZ_256K, | ||
130 | }, { | ||
131 | .name = "SysImage(OneNAND)", | ||
132 | .offset = MTDPART_OFS_APPEND, | ||
133 | .size = 4 * SZ_1M, | ||
134 | }, { | ||
135 | .name = "Root Filesystem(OneNAND)", | ||
136 | .offset = MTDPART_OFS_APPEND, | ||
137 | .size = 22 * SZ_1M, | ||
138 | }, { | ||
139 | .name = "User Filesystem(OneNAND)", | ||
140 | .offset = MTDPART_OFS_APPEND, | ||
141 | .size = MTDPART_SIZ_FULL, | ||
142 | } | ||
143 | }; | ||
144 | |||
145 | static struct flash_platform_data nhk8815_onenand_data = { | ||
146 | .parts = nhk8815_onenand_partitions, | ||
147 | .nr_parts = ARRAY_SIZE(nhk8815_onenand_partitions), | ||
148 | }; | ||
149 | |||
150 | static struct resource nhk8815_onenand_resource[] = { | ||
151 | { | ||
152 | .start = 0x30000000, | ||
153 | .end = 0x30000000 + SZ_128K - 1, | ||
154 | .flags = IORESOURCE_MEM, | ||
155 | }, | ||
156 | }; | ||
157 | |||
158 | static struct platform_device nhk8815_onenand_device = { | ||
159 | .name = "onenand", | ||
160 | .id = -1, | ||
161 | .dev = { | ||
162 | .platform_data = &nhk8815_onenand_data, | ||
163 | }, | ||
164 | .resource = nhk8815_onenand_resource, | ||
165 | .num_resources = ARRAY_SIZE(nhk8815_onenand_resource), | ||
166 | }; | ||
167 | |||
168 | static void __init nhk8815_onenand_init(void) | ||
169 | { | ||
170 | #ifdef CONFIG_ONENAND | ||
171 | /* Set up SMCS0 for OneNand */ | ||
172 | writel(0x000030db, FSMC_BCR0); | ||
173 | writel(0x02100551, FSMC_BTR0); | ||
174 | #endif | ||
175 | } | ||
176 | |||
25 | #define __MEM_4K_RESOURCE(x) \ | 177 | #define __MEM_4K_RESOURCE(x) \ |
26 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} | 178 | .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} |
27 | 179 | ||
@@ -81,6 +233,8 @@ static int __init nhk8815_eth_init(void) | |||
81 | device_initcall(nhk8815_eth_init); | 233 | device_initcall(nhk8815_eth_init); |
82 | 234 | ||
83 | static struct platform_device *nhk8815_platform_devices[] __initdata = { | 235 | static struct platform_device *nhk8815_platform_devices[] __initdata = { |
236 | &nhk8815_nand_device, | ||
237 | &nhk8815_onenand_device, | ||
84 | &nhk8815_eth_device, | 238 | &nhk8815_eth_device, |
85 | /* will add more devices */ | 239 | /* will add more devices */ |
86 | }; | 240 | }; |
@@ -90,6 +244,7 @@ static void __init nhk8815_platform_init(void) | |||
90 | int i; | 244 | int i; |
91 | 245 | ||
92 | cpu8815_platform_init(); | 246 | cpu8815_platform_init(); |
247 | nhk8815_onenand_init(); | ||
93 | platform_add_devices(nhk8815_platform_devices, | 248 | platform_add_devices(nhk8815_platform_devices, |
94 | ARRAY_SIZE(nhk8815_platform_devices)); | 249 | ARRAY_SIZE(nhk8815_platform_devices)); |
95 | 250 | ||
diff --git a/arch/arm/mach-nomadik/include/mach/fsmc.h b/arch/arm/mach-nomadik/include/mach/fsmc.h new file mode 100644 index 000000000000..8c2c05183685 --- /dev/null +++ b/arch/arm/mach-nomadik/include/mach/fsmc.h | |||
@@ -0,0 +1,29 @@ | |||
1 | |||
2 | /* Definitions for the Nomadik FSMC "Flexible Static Memory controller" */ | ||
3 | |||
4 | #ifndef __ASM_ARCH_FSMC_H | ||
5 | #define __ASM_ARCH_FSMC_H | ||
6 | |||
7 | #include <mach/hardware.h> | ||
8 | /* | ||
9 | * Register list | ||
10 | */ | ||
11 | |||
12 | /* bus control reg. and bus timing reg. for CS0..CS3 */ | ||
13 | #define FSMC_BCR(x) (NOMADIK_FSMC_VA + (x << 3)) | ||
14 | #define FSMC_BTR(x) (NOMADIK_FSMC_VA + (x << 3) + 0x04) | ||
15 | |||
16 | /* PC-card and NAND: | ||
17 | * PCR = control register | ||
18 | * PMEM = memory timing | ||
19 | * PATT = attribute timing | ||
20 | * PIO = I/O timing | ||
21 | * PECCR = ECC result | ||
22 | */ | ||
23 | #define FSMC_PCR(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x00) | ||
24 | #define FSMC_PMEM(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x08) | ||
25 | #define FSMC_PATT(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x0c) | ||
26 | #define FSMC_PIO(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x10) | ||
27 | #define FSMC_PECCR(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x14) | ||
28 | |||
29 | #endif /* __ASM_ARCH_FSMC_H */ | ||
diff --git a/arch/arm/mach-nomadik/include/mach/nand.h b/arch/arm/mach-nomadik/include/mach/nand.h new file mode 100644 index 000000000000..c3c8254c22a5 --- /dev/null +++ b/arch/arm/mach-nomadik/include/mach/nand.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __ASM_ARCH_NAND_H | ||
2 | #define __ASM_ARCH_NAND_H | ||
3 | |||
4 | struct nomadik_nand_platform_data { | ||
5 | struct mtd_partition *parts; | ||
6 | int nparts; | ||
7 | int options; | ||
8 | int (*init) (void); | ||
9 | int (*exit) (void); | ||
10 | }; | ||
11 | |||
12 | #define NAND_IO_DATA 0x40000000 | ||
13 | #define NAND_IO_CMD 0x40800000 | ||
14 | #define NAND_IO_ADDR 0x41000000 | ||
15 | |||
16 | #endif /* __ASM_ARCH_NAND_H */ | ||
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 7a2b54c7291a..a1132288c701 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -87,7 +87,7 @@ static struct mtd_partition apollon_partitions[] = { | |||
87 | }, | 87 | }, |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static struct flash_platform_data apollon_flash_data = { | 90 | static struct onenand_platform_data apollon_flash_data = { |
91 | .parts = apollon_partitions, | 91 | .parts = apollon_partitions, |
92 | .nr_parts = ARRAY_SIZE(apollon_partitions), | 92 | .nr_parts = ARRAY_SIZE(apollon_partitions), |
93 | }; | 93 | }; |
@@ -99,7 +99,7 @@ static struct resource apollon_flash_resource[] = { | |||
99 | }; | 99 | }; |
100 | 100 | ||
101 | static struct platform_device apollon_onenand_device = { | 101 | static struct platform_device apollon_onenand_device = { |
102 | .name = "onenand", | 102 | .name = "onenand-flash", |
103 | .id = -1, | 103 | .id = -1, |
104 | .dev = { | 104 | .dev = { |
105 | .platform_data = &apollon_flash_data, | 105 | .platform_data = &apollon_flash_data, |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index e70baa799018..e6e8290b7828 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/regulator/machine.h> | 20 | #include <linux/regulator/machine.h> |
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/mmc/host.h> | ||
22 | 23 | ||
23 | #include <mach/mcspi.h> | 24 | #include <mach/mcspi.h> |
24 | #include <mach/mux.h> | 25 | #include <mach/mux.h> |
@@ -102,6 +103,7 @@ static struct twl4030_hsmmc_info mmc[] = { | |||
102 | .cover_only = true, | 103 | .cover_only = true, |
103 | .gpio_cd = 160, | 104 | .gpio_cd = 160, |
104 | .gpio_wp = -EINVAL, | 105 | .gpio_wp = -EINVAL, |
106 | .power_saving = true, | ||
105 | }, | 107 | }, |
106 | { | 108 | { |
107 | .name = "internal", | 109 | .name = "internal", |
@@ -109,6 +111,8 @@ static struct twl4030_hsmmc_info mmc[] = { | |||
109 | .wires = 8, | 111 | .wires = 8, |
110 | .gpio_cd = -EINVAL, | 112 | .gpio_cd = -EINVAL, |
111 | .gpio_wp = -EINVAL, | 113 | .gpio_wp = -EINVAL, |
114 | .nonremovable = true, | ||
115 | .power_saving = true, | ||
112 | }, | 116 | }, |
113 | {} /* Terminator */ | 117 | {} /* Terminator */ |
114 | }; | 118 | }; |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index a2e915639b72..bcfcfc7fdb9b 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -257,6 +257,11 @@ static inline void omap_init_sti(void) {} | |||
257 | #define OMAP2_MCSPI3_BASE 0x480b8000 | 257 | #define OMAP2_MCSPI3_BASE 0x480b8000 |
258 | #define OMAP2_MCSPI4_BASE 0x480ba000 | 258 | #define OMAP2_MCSPI4_BASE 0x480ba000 |
259 | 259 | ||
260 | #define OMAP4_MCSPI1_BASE 0x48098100 | ||
261 | #define OMAP4_MCSPI2_BASE 0x4809a100 | ||
262 | #define OMAP4_MCSPI3_BASE 0x480b8100 | ||
263 | #define OMAP4_MCSPI4_BASE 0x480ba100 | ||
264 | |||
260 | static struct omap2_mcspi_platform_config omap2_mcspi1_config = { | 265 | static struct omap2_mcspi_platform_config omap2_mcspi1_config = { |
261 | .num_cs = 4, | 266 | .num_cs = 4, |
262 | }; | 267 | }; |
@@ -301,7 +306,8 @@ static struct platform_device omap2_mcspi2 = { | |||
301 | }, | 306 | }, |
302 | }; | 307 | }; |
303 | 308 | ||
304 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) | 309 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ |
310 | defined(CONFIG_ARCH_OMAP4) | ||
305 | static struct omap2_mcspi_platform_config omap2_mcspi3_config = { | 311 | static struct omap2_mcspi_platform_config omap2_mcspi3_config = { |
306 | .num_cs = 2, | 312 | .num_cs = 2, |
307 | }; | 313 | }; |
@@ -325,7 +331,7 @@ static struct platform_device omap2_mcspi3 = { | |||
325 | }; | 331 | }; |
326 | #endif | 332 | #endif |
327 | 333 | ||
328 | #ifdef CONFIG_ARCH_OMAP3 | 334 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
329 | static struct omap2_mcspi_platform_config omap2_mcspi4_config = { | 335 | static struct omap2_mcspi_platform_config omap2_mcspi4_config = { |
330 | .num_cs = 1, | 336 | .num_cs = 1, |
331 | }; | 337 | }; |
@@ -351,14 +357,25 @@ static struct platform_device omap2_mcspi4 = { | |||
351 | 357 | ||
352 | static void omap_init_mcspi(void) | 358 | static void omap_init_mcspi(void) |
353 | { | 359 | { |
360 | if (cpu_is_omap44xx()) { | ||
361 | omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; | ||
362 | omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; | ||
363 | omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; | ||
364 | omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; | ||
365 | omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; | ||
366 | omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; | ||
367 | omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; | ||
368 | omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; | ||
369 | } | ||
354 | platform_device_register(&omap2_mcspi1); | 370 | platform_device_register(&omap2_mcspi1); |
355 | platform_device_register(&omap2_mcspi2); | 371 | platform_device_register(&omap2_mcspi2); |
356 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) | 372 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ |
357 | if (cpu_is_omap2430() || cpu_is_omap343x()) | 373 | defined(CONFIG_ARCH_OMAP4) |
374 | if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx()) | ||
358 | platform_device_register(&omap2_mcspi3); | 375 | platform_device_register(&omap2_mcspi3); |
359 | #endif | 376 | #endif |
360 | #ifdef CONFIG_ARCH_OMAP3 | 377 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
361 | if (cpu_is_omap343x()) | 378 | if (cpu_is_omap343x() || cpu_is_omap44xx()) |
362 | platform_device_register(&omap2_mcspi4); | 379 | platform_device_register(&omap2_mcspi4); |
363 | #endif | 380 | #endif |
364 | } | 381 | } |
@@ -397,7 +414,7 @@ static inline void omap_init_sha1_md5(void) { } | |||
397 | 414 | ||
398 | /*-------------------------------------------------------------------------*/ | 415 | /*-------------------------------------------------------------------------*/ |
399 | 416 | ||
400 | #ifdef CONFIG_ARCH_OMAP3 | 417 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
401 | 418 | ||
402 | #define MMCHS_SYSCONFIG 0x0010 | 419 | #define MMCHS_SYSCONFIG 0x0010 |
403 | #define MMCHS_SYSCONFIG_SWRESET (1 << 1) | 420 | #define MMCHS_SYSCONFIG_SWRESET (1 << 1) |
@@ -424,8 +441,8 @@ static struct platform_device dummy_pdev = { | |||
424 | **/ | 441 | **/ |
425 | static void __init omap_hsmmc_reset(void) | 442 | static void __init omap_hsmmc_reset(void) |
426 | { | 443 | { |
427 | u32 i, nr_controllers = cpu_is_omap34xx() ? OMAP34XX_NR_MMC : | 444 | u32 i, nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC : |
428 | OMAP24XX_NR_MMC; | 445 | (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC); |
429 | 446 | ||
430 | for (i = 0; i < nr_controllers; i++) { | 447 | for (i = 0; i < nr_controllers; i++) { |
431 | u32 v, base = 0; | 448 | u32 v, base = 0; |
@@ -442,8 +459,21 @@ static void __init omap_hsmmc_reset(void) | |||
442 | case 2: | 459 | case 2: |
443 | base = OMAP3_MMC3_BASE; | 460 | base = OMAP3_MMC3_BASE; |
444 | break; | 461 | break; |
462 | case 3: | ||
463 | if (!cpu_is_omap44xx()) | ||
464 | return; | ||
465 | base = OMAP4_MMC4_BASE; | ||
466 | break; | ||
467 | case 4: | ||
468 | if (!cpu_is_omap44xx()) | ||
469 | return; | ||
470 | base = OMAP4_MMC5_BASE; | ||
471 | break; | ||
445 | } | 472 | } |
446 | 473 | ||
474 | if (cpu_is_omap44xx()) | ||
475 | base += OMAP4_MMC_REG_OFFSET; | ||
476 | |||
447 | dummy_pdev.id = i; | 477 | dummy_pdev.id = i; |
448 | dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i); | 478 | dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i); |
449 | iclk = clk_get(dev, "ick"); | 479 | iclk = clk_get(dev, "ick"); |
@@ -581,11 +611,23 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | |||
581 | irq = INT_24XX_MMC2_IRQ; | 611 | irq = INT_24XX_MMC2_IRQ; |
582 | break; | 612 | break; |
583 | case 2: | 613 | case 2: |
584 | if (!cpu_is_omap34xx()) | 614 | if (!cpu_is_omap44xx() && !cpu_is_omap34xx()) |
585 | return; | 615 | return; |
586 | base = OMAP3_MMC3_BASE; | 616 | base = OMAP3_MMC3_BASE; |
587 | irq = INT_34XX_MMC3_IRQ; | 617 | irq = INT_34XX_MMC3_IRQ; |
588 | break; | 618 | break; |
619 | case 3: | ||
620 | if (!cpu_is_omap44xx()) | ||
621 | return; | ||
622 | base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET; | ||
623 | irq = INT_44XX_MMC4_IRQ; | ||
624 | break; | ||
625 | case 4: | ||
626 | if (!cpu_is_omap44xx()) | ||
627 | return; | ||
628 | base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET; | ||
629 | irq = INT_44XX_MMC5_IRQ; | ||
630 | break; | ||
589 | default: | 631 | default: |
590 | continue; | 632 | continue; |
591 | } | 633 | } |
@@ -593,8 +635,15 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | |||
593 | if (cpu_is_omap2420()) { | 635 | if (cpu_is_omap2420()) { |
594 | size = OMAP2420_MMC_SIZE; | 636 | size = OMAP2420_MMC_SIZE; |
595 | name = "mmci-omap"; | 637 | name = "mmci-omap"; |
638 | } else if (cpu_is_omap44xx()) { | ||
639 | if (i < 3) { | ||
640 | base += OMAP4_MMC_REG_OFFSET; | ||
641 | irq += IRQ_GIC_START; | ||
642 | } | ||
643 | size = OMAP4_HSMMC_SIZE; | ||
644 | name = "mmci-omap-hs"; | ||
596 | } else { | 645 | } else { |
597 | size = HSMMC_SIZE; | 646 | size = OMAP3_HSMMC_SIZE; |
598 | name = "mmci-omap-hs"; | 647 | name = "mmci-omap-hs"; |
599 | } | 648 | } |
600 | omap_mmc_add(name, i, base, size, irq, mmc_data[i]); | 649 | omap_mmc_add(name, i, base, size, irq, mmc_data[i]); |
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index f91934b2b092..15876828db23 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -57,6 +57,11 @@ | |||
57 | #define GPMC_CHUNK_SHIFT 24 /* 16 MB */ | 57 | #define GPMC_CHUNK_SHIFT 24 /* 16 MB */ |
58 | #define GPMC_SECTION_SHIFT 28 /* 128 MB */ | 58 | #define GPMC_SECTION_SHIFT 28 /* 128 MB */ |
59 | 59 | ||
60 | #define PREFETCH_FIFOTHRESHOLD (0x40 << 8) | ||
61 | #define CS_NUM_SHIFT 24 | ||
62 | #define ENABLE_PREFETCH (0x1 << 7) | ||
63 | #define DMA_MPU_MODE 2 | ||
64 | |||
60 | static struct resource gpmc_mem_root; | 65 | static struct resource gpmc_mem_root; |
61 | static struct resource gpmc_cs_mem[GPMC_CS_NUM]; | 66 | static struct resource gpmc_cs_mem[GPMC_CS_NUM]; |
62 | static DEFINE_SPINLOCK(gpmc_mem_lock); | 67 | static DEFINE_SPINLOCK(gpmc_mem_lock); |
@@ -386,6 +391,63 @@ void gpmc_cs_free(int cs) | |||
386 | } | 391 | } |
387 | EXPORT_SYMBOL(gpmc_cs_free); | 392 | EXPORT_SYMBOL(gpmc_cs_free); |
388 | 393 | ||
394 | /** | ||
395 | * gpmc_prefetch_enable - configures and starts prefetch transfer | ||
396 | * @cs: nand cs (chip select) number | ||
397 | * @dma_mode: dma mode enable (1) or disable (0) | ||
398 | * @u32_count: number of bytes to be transferred | ||
399 | * @is_write: prefetch read(0) or write post(1) mode | ||
400 | */ | ||
401 | int gpmc_prefetch_enable(int cs, int dma_mode, | ||
402 | unsigned int u32_count, int is_write) | ||
403 | { | ||
404 | uint32_t prefetch_config1; | ||
405 | |||
406 | if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { | ||
407 | /* Set the amount of bytes to be prefetched */ | ||
408 | gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count); | ||
409 | |||
410 | /* Set dma/mpu mode, the prefetch read / post write and | ||
411 | * enable the engine. Set which cs is has requested for. | ||
412 | */ | ||
413 | prefetch_config1 = ((cs << CS_NUM_SHIFT) | | ||
414 | PREFETCH_FIFOTHRESHOLD | | ||
415 | ENABLE_PREFETCH | | ||
416 | (dma_mode << DMA_MPU_MODE) | | ||
417 | (0x1 & is_write)); | ||
418 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, prefetch_config1); | ||
419 | } else { | ||
420 | return -EBUSY; | ||
421 | } | ||
422 | /* Start the prefetch engine */ | ||
423 | gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1); | ||
424 | |||
425 | return 0; | ||
426 | } | ||
427 | EXPORT_SYMBOL(gpmc_prefetch_enable); | ||
428 | |||
429 | /** | ||
430 | * gpmc_prefetch_reset - disables and stops the prefetch engine | ||
431 | */ | ||
432 | void gpmc_prefetch_reset(void) | ||
433 | { | ||
434 | /* Stop the PFPW engine */ | ||
435 | gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0); | ||
436 | |||
437 | /* Reset/disable the PFPW engine */ | ||
438 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0); | ||
439 | } | ||
440 | EXPORT_SYMBOL(gpmc_prefetch_reset); | ||
441 | |||
442 | /** | ||
443 | * gpmc_prefetch_status - reads prefetch status of engine | ||
444 | */ | ||
445 | int gpmc_prefetch_status(void) | ||
446 | { | ||
447 | return gpmc_read_reg(GPMC_PREFETCH_STATUS); | ||
448 | } | ||
449 | EXPORT_SYMBOL(gpmc_prefetch_status); | ||
450 | |||
389 | static void __init gpmc_mem_init(void) | 451 | static void __init gpmc_mem_init(void) |
390 | { | 452 | { |
391 | int cs; | 453 | int cs; |
@@ -452,6 +514,5 @@ void __init gpmc_init(void) | |||
452 | l &= 0x03 << 3; | 514 | l &= 0x03 << 3; |
453 | l |= (0x02 << 3) | (1 << 0); | 515 | l |= (0x02 << 3) | (1 << 0); |
454 | gpmc_write_reg(GPMC_SYSCONFIG, l); | 516 | gpmc_write_reg(GPMC_SYSCONFIG, l); |
455 | |||
456 | gpmc_mem_init(); | 517 | gpmc_mem_init(); |
457 | } | 518 | } |
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 3c04c2f1b23f..c9c59a2db4e2 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c | |||
@@ -198,6 +198,18 @@ static int twl_mmc_resume(struct device *dev, int slot) | |||
198 | #define twl_mmc_resume NULL | 198 | #define twl_mmc_resume NULL |
199 | #endif | 199 | #endif |
200 | 200 | ||
201 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | ||
202 | |||
203 | static int twl4030_mmc_get_context_loss(struct device *dev) | ||
204 | { | ||
205 | /* FIXME: PM DPS not implemented yet */ | ||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | #else | ||
210 | #define twl4030_mmc_get_context_loss NULL | ||
211 | #endif | ||
212 | |||
201 | static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, | 213 | static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, |
202 | int vdd) | 214 | int vdd) |
203 | { | 215 | { |
@@ -328,6 +340,61 @@ static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int v | |||
328 | return ret; | 340 | return ret; |
329 | } | 341 | } |
330 | 342 | ||
343 | static int twl_mmc1_set_sleep(struct device *dev, int slot, int sleep, int vdd, | ||
344 | int cardsleep) | ||
345 | { | ||
346 | struct twl_mmc_controller *c = &hsmmc[0]; | ||
347 | int mode = sleep ? REGULATOR_MODE_STANDBY : REGULATOR_MODE_NORMAL; | ||
348 | |||
349 | return regulator_set_mode(c->vcc, mode); | ||
350 | } | ||
351 | |||
352 | static int twl_mmc23_set_sleep(struct device *dev, int slot, int sleep, int vdd, | ||
353 | int cardsleep) | ||
354 | { | ||
355 | struct twl_mmc_controller *c = NULL; | ||
356 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
357 | int i, err, mode; | ||
358 | |||
359 | for (i = 1; i < ARRAY_SIZE(hsmmc); i++) { | ||
360 | if (mmc == hsmmc[i].mmc) { | ||
361 | c = &hsmmc[i]; | ||
362 | break; | ||
363 | } | ||
364 | } | ||
365 | |||
366 | if (c == NULL) | ||
367 | return -ENODEV; | ||
368 | |||
369 | /* | ||
370 | * If we don't see a Vcc regulator, assume it's a fixed | ||
371 | * voltage always-on regulator. | ||
372 | */ | ||
373 | if (!c->vcc) | ||
374 | return 0; | ||
375 | |||
376 | mode = sleep ? REGULATOR_MODE_STANDBY : REGULATOR_MODE_NORMAL; | ||
377 | |||
378 | if (!c->vcc_aux) | ||
379 | return regulator_set_mode(c->vcc, mode); | ||
380 | |||
381 | if (cardsleep) { | ||
382 | /* VCC can be turned off if card is asleep */ | ||
383 | struct regulator *vcc_aux = c->vcc_aux; | ||
384 | |||
385 | c->vcc_aux = NULL; | ||
386 | if (sleep) | ||
387 | err = twl_mmc23_set_power(dev, slot, 0, 0); | ||
388 | else | ||
389 | err = twl_mmc23_set_power(dev, slot, 1, vdd); | ||
390 | c->vcc_aux = vcc_aux; | ||
391 | } else | ||
392 | err = regulator_set_mode(c->vcc, mode); | ||
393 | if (err) | ||
394 | return err; | ||
395 | return regulator_set_mode(c->vcc_aux, mode); | ||
396 | } | ||
397 | |||
331 | static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; | 398 | static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; |
332 | 399 | ||
333 | void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) | 400 | void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) |
@@ -390,6 +457,9 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) | |||
390 | } else | 457 | } else |
391 | mmc->slots[0].switch_pin = -EINVAL; | 458 | mmc->slots[0].switch_pin = -EINVAL; |
392 | 459 | ||
460 | mmc->get_context_loss_count = | ||
461 | twl4030_mmc_get_context_loss; | ||
462 | |||
393 | /* write protect normally uses an OMAP gpio */ | 463 | /* write protect normally uses an OMAP gpio */ |
394 | if (gpio_is_valid(c->gpio_wp)) { | 464 | if (gpio_is_valid(c->gpio_wp)) { |
395 | gpio_request(c->gpio_wp, "mmc_wp"); | 465 | gpio_request(c->gpio_wp, "mmc_wp"); |
@@ -400,6 +470,12 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) | |||
400 | } else | 470 | } else |
401 | mmc->slots[0].gpio_wp = -EINVAL; | 471 | mmc->slots[0].gpio_wp = -EINVAL; |
402 | 472 | ||
473 | if (c->nonremovable) | ||
474 | mmc->slots[0].nonremovable = 1; | ||
475 | |||
476 | if (c->power_saving) | ||
477 | mmc->slots[0].power_saving = 1; | ||
478 | |||
403 | /* NOTE: MMC slots should have a Vcc regulator set up. | 479 | /* NOTE: MMC slots should have a Vcc regulator set up. |
404 | * This may be from a TWL4030-family chip, another | 480 | * This may be from a TWL4030-family chip, another |
405 | * controllable regulator, or a fixed supply. | 481 | * controllable regulator, or a fixed supply. |
@@ -412,6 +488,7 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) | |||
412 | case 1: | 488 | case 1: |
413 | /* on-chip level shifting via PBIAS0/PBIAS1 */ | 489 | /* on-chip level shifting via PBIAS0/PBIAS1 */ |
414 | mmc->slots[0].set_power = twl_mmc1_set_power; | 490 | mmc->slots[0].set_power = twl_mmc1_set_power; |
491 | mmc->slots[0].set_sleep = twl_mmc1_set_sleep; | ||
415 | break; | 492 | break; |
416 | case 2: | 493 | case 2: |
417 | if (c->ext_clock) | 494 | if (c->ext_clock) |
@@ -422,6 +499,7 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) | |||
422 | case 3: | 499 | case 3: |
423 | /* off-chip level shifting, or none */ | 500 | /* off-chip level shifting, or none */ |
424 | mmc->slots[0].set_power = twl_mmc23_set_power; | 501 | mmc->slots[0].set_power = twl_mmc23_set_power; |
502 | mmc->slots[0].set_sleep = twl_mmc23_set_sleep; | ||
425 | break; | 503 | break; |
426 | default: | 504 | default: |
427 | pr_err("MMC%d configuration not supported!\n", c->mmc); | 505 | pr_err("MMC%d configuration not supported!\n", c->mmc); |
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h index 3807c45c9a6c..a47e68563fb6 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.h +++ b/arch/arm/mach-omap2/mmc-twl4030.h | |||
@@ -12,6 +12,8 @@ struct twl4030_hsmmc_info { | |||
12 | bool transceiver; /* MMC-2 option */ | 12 | bool transceiver; /* MMC-2 option */ |
13 | bool ext_clock; /* use external pin for input clock */ | 13 | bool ext_clock; /* use external pin for input clock */ |
14 | bool cover_only; /* No card detect - just cover switch */ | 14 | bool cover_only; /* No card detect - just cover switch */ |
15 | bool nonremovable; /* Nonremovable e.g. eMMC */ | ||
16 | bool power_saving; /* Try to sleep or power off when possible */ | ||
15 | int gpio_cd; /* or -EINVAL */ | 17 | int gpio_cd; /* or -EINVAL */ |
16 | int gpio_wp; /* or -EINVAL */ | 18 | int gpio_wp; /* or -EINVAL */ |
17 | char *name; /* or NULL for default */ | 19 | char *name; /* or NULL for default */ |
diff --git a/arch/arm/plat-mxc/include/mach/spi.h b/arch/arm/plat-mxc/include/mach/spi.h new file mode 100644 index 000000000000..08be445e8eb8 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/spi.h | |||
@@ -0,0 +1,27 @@ | |||
1 | |||
2 | #ifndef __MACH_SPI_H_ | ||
3 | #define __MACH_SPI_H_ | ||
4 | |||
5 | /* | ||
6 | * struct spi_imx_master - device.platform_data for SPI controller devices. | ||
7 | * @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio | ||
8 | * pins, numbers < 0 mean internal CSPI chipselects according | ||
9 | * to MXC_SPI_CS(). Normally you want to use gpio based chip | ||
10 | * selects as the CSPI module tries to be intelligent about | ||
11 | * when to assert the chipselect: The CSPI module deasserts the | ||
12 | * chipselect once it runs out of input data. The other problem | ||
13 | * is that it is not possible to mix between high active and low | ||
14 | * active chipselects on one single bus using the internal | ||
15 | * chipselects. Unfortunately Freescale decided to put some | ||
16 | * chipselects on dedicated pins which are not usable as gpios, | ||
17 | * so we have to support the internal chipselects. | ||
18 | * @num_chipselect: ARRAY_SIZE(chipselect) | ||
19 | */ | ||
20 | struct spi_imx_master { | ||
21 | int *chipselect; | ||
22 | int num_chipselect; | ||
23 | }; | ||
24 | |||
25 | #define MXC_SPI_CS(no) ((no) - 32) | ||
26 | |||
27 | #endif /* __MACH_SPI_H_*/ | ||
diff --git a/arch/arm/plat-omap/include/mach/gpmc.h b/arch/arm/plat-omap/include/mach/gpmc.h index 921b16532ff5..9c99cda77ba6 100644 --- a/arch/arm/plat-omap/include/mach/gpmc.h +++ b/arch/arm/plat-omap/include/mach/gpmc.h | |||
@@ -103,6 +103,10 @@ extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base); | |||
103 | extern void gpmc_cs_free(int cs); | 103 | extern void gpmc_cs_free(int cs); |
104 | extern int gpmc_cs_set_reserved(int cs, int reserved); | 104 | extern int gpmc_cs_set_reserved(int cs, int reserved); |
105 | extern int gpmc_cs_reserved(int cs); | 105 | extern int gpmc_cs_reserved(int cs); |
106 | extern int gpmc_prefetch_enable(int cs, int dma_mode, | ||
107 | unsigned int u32_count, int is_write); | ||
108 | extern void gpmc_prefetch_reset(void); | ||
109 | extern int gpmc_prefetch_status(void); | ||
106 | extern void __init gpmc_init(void); | 110 | extern void __init gpmc_init(void); |
107 | 111 | ||
108 | #endif | 112 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/irqs.h b/arch/arm/plat-omap/include/mach/irqs.h index fb7cb7723990..28a165058b61 100644 --- a/arch/arm/plat-omap/include/mach/irqs.h +++ b/arch/arm/plat-omap/include/mach/irqs.h | |||
@@ -503,6 +503,7 @@ | |||
503 | #define INT_44XX_FPKA_READY_IRQ (50 + IRQ_GIC_START) | 503 | #define INT_44XX_FPKA_READY_IRQ (50 + IRQ_GIC_START) |
504 | #define INT_44XX_SHA1MD51_IRQ (51 + IRQ_GIC_START) | 504 | #define INT_44XX_SHA1MD51_IRQ (51 + IRQ_GIC_START) |
505 | #define INT_44XX_RNG_IRQ (52 + IRQ_GIC_START) | 505 | #define INT_44XX_RNG_IRQ (52 + IRQ_GIC_START) |
506 | #define INT_44XX_MMC5_IRQ (59 + IRQ_GIC_START) | ||
506 | #define INT_44XX_I2C3_IRQ (61 + IRQ_GIC_START) | 507 | #define INT_44XX_I2C3_IRQ (61 + IRQ_GIC_START) |
507 | #define INT_44XX_FPKA_ERROR_IRQ (64 + IRQ_GIC_START) | 508 | #define INT_44XX_FPKA_ERROR_IRQ (64 + IRQ_GIC_START) |
508 | #define INT_44XX_PBIAS_IRQ (75 + IRQ_GIC_START) | 509 | #define INT_44XX_PBIAS_IRQ (75 + IRQ_GIC_START) |
@@ -511,6 +512,7 @@ | |||
511 | #define INT_44XX_TLL_IRQ (78 + IRQ_GIC_START) | 512 | #define INT_44XX_TLL_IRQ (78 + IRQ_GIC_START) |
512 | #define INT_44XX_PARTHASH_IRQ (79 + IRQ_GIC_START) | 513 | #define INT_44XX_PARTHASH_IRQ (79 + IRQ_GIC_START) |
513 | #define INT_44XX_MMC3_IRQ (94 + IRQ_GIC_START) | 514 | #define INT_44XX_MMC3_IRQ (94 + IRQ_GIC_START) |
515 | #define INT_44XX_MMC4_IRQ (96 + IRQ_GIC_START) | ||
514 | 516 | ||
515 | 517 | ||
516 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and | 518 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and |
diff --git a/arch/arm/plat-omap/include/mach/lcd_mipid.h b/arch/arm/plat-omap/include/mach/lcd_mipid.h index f8fbc4801e52..8e52c6572281 100644 --- a/arch/arm/plat-omap/include/mach/lcd_mipid.h +++ b/arch/arm/plat-omap/include/mach/lcd_mipid.h | |||
@@ -16,7 +16,12 @@ enum mipid_test_result { | |||
16 | struct mipid_platform_data { | 16 | struct mipid_platform_data { |
17 | int nreset_gpio; | 17 | int nreset_gpio; |
18 | int data_lines; | 18 | int data_lines; |
19 | |||
19 | void (*shutdown)(struct mipid_platform_data *pdata); | 20 | void (*shutdown)(struct mipid_platform_data *pdata); |
21 | void (*set_bklight_level)(struct mipid_platform_data *pdata, | ||
22 | int level); | ||
23 | int (*get_bklight_level)(struct mipid_platform_data *pdata); | ||
24 | int (*get_bklight_max)(struct mipid_platform_data *pdata); | ||
20 | }; | 25 | }; |
21 | 26 | ||
22 | #endif | 27 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h index 81d5b36534b3..7229b9593301 100644 --- a/arch/arm/plat-omap/include/mach/mmc.h +++ b/arch/arm/plat-omap/include/mach/mmc.h | |||
@@ -25,11 +25,18 @@ | |||
25 | 25 | ||
26 | #define OMAP24XX_NR_MMC 2 | 26 | #define OMAP24XX_NR_MMC 2 |
27 | #define OMAP34XX_NR_MMC 3 | 27 | #define OMAP34XX_NR_MMC 3 |
28 | #define OMAP44XX_NR_MMC 5 | ||
28 | #define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE | 29 | #define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE |
29 | #define HSMMC_SIZE 0x200 | 30 | #define OMAP3_HSMMC_SIZE 0x200 |
31 | #define OMAP4_HSMMC_SIZE 0x1000 | ||
30 | #define OMAP2_MMC1_BASE 0x4809c000 | 32 | #define OMAP2_MMC1_BASE 0x4809c000 |
31 | #define OMAP2_MMC2_BASE 0x480b4000 | 33 | #define OMAP2_MMC2_BASE 0x480b4000 |
32 | #define OMAP3_MMC3_BASE 0x480ad000 | 34 | #define OMAP3_MMC3_BASE 0x480ad000 |
35 | #define OMAP4_MMC4_BASE 0x480d1000 | ||
36 | #define OMAP4_MMC5_BASE 0x480d5000 | ||
37 | #define OMAP4_MMC_REG_OFFSET 0x100 | ||
38 | #define HSMMC5 (1 << 4) | ||
39 | #define HSMMC4 (1 << 3) | ||
33 | #define HSMMC3 (1 << 2) | 40 | #define HSMMC3 (1 << 2) |
34 | #define HSMMC2 (1 << 1) | 41 | #define HSMMC2 (1 << 1) |
35 | #define HSMMC1 (1 << 0) | 42 | #define HSMMC1 (1 << 0) |
@@ -59,6 +66,9 @@ struct omap_mmc_platform_data { | |||
59 | int (*suspend)(struct device *dev, int slot); | 66 | int (*suspend)(struct device *dev, int slot); |
60 | int (*resume)(struct device *dev, int slot); | 67 | int (*resume)(struct device *dev, int slot); |
61 | 68 | ||
69 | /* Return context loss count due to PM states changing */ | ||
70 | int (*get_context_loss_count)(struct device *dev); | ||
71 | |||
62 | u64 dma_mask; | 72 | u64 dma_mask; |
63 | 73 | ||
64 | struct omap_mmc_slot_data { | 74 | struct omap_mmc_slot_data { |
@@ -80,12 +90,20 @@ struct omap_mmc_platform_data { | |||
80 | /* use the internal clock */ | 90 | /* use the internal clock */ |
81 | unsigned internal_clock:1; | 91 | unsigned internal_clock:1; |
82 | 92 | ||
93 | /* nonremovable e.g. eMMC */ | ||
94 | unsigned nonremovable:1; | ||
95 | |||
96 | /* Try to sleep or power off when possible */ | ||
97 | unsigned power_saving:1; | ||
98 | |||
83 | int switch_pin; /* gpio (card detect) */ | 99 | int switch_pin; /* gpio (card detect) */ |
84 | int gpio_wp; /* gpio (write protect) */ | 100 | int gpio_wp; /* gpio (write protect) */ |
85 | 101 | ||
86 | int (* set_bus_mode)(struct device *dev, int slot, int bus_mode); | 102 | int (* set_bus_mode)(struct device *dev, int slot, int bus_mode); |
87 | int (* set_power)(struct device *dev, int slot, int power_on, int vdd); | 103 | int (* set_power)(struct device *dev, int slot, int power_on, int vdd); |
88 | int (* get_ro)(struct device *dev, int slot); | 104 | int (* get_ro)(struct device *dev, int slot); |
105 | int (*set_sleep)(struct device *dev, int slot, int sleep, | ||
106 | int vdd, int cardsleep); | ||
89 | 107 | ||
90 | /* return MMC cover switch state, can be NULL if not supported. | 108 | /* return MMC cover switch state, can be NULL if not supported. |
91 | * | 109 | * |
diff --git a/arch/arm/plat-omap/include/mach/omapfb.h b/arch/arm/plat-omap/include/mach/omapfb.h index 7b74d1255e0b..b226bdf45739 100644 --- a/arch/arm/plat-omap/include/mach/omapfb.h +++ b/arch/arm/plat-omap/include/mach/omapfb.h | |||
@@ -276,8 +276,8 @@ typedef int (*omapfb_notifier_callback_t)(struct notifier_block *, | |||
276 | void *fbi); | 276 | void *fbi); |
277 | 277 | ||
278 | struct omapfb_mem_region { | 278 | struct omapfb_mem_region { |
279 | dma_addr_t paddr; | 279 | u32 paddr; |
280 | void *vaddr; | 280 | void __iomem *vaddr; |
281 | unsigned long size; | 281 | unsigned long size; |
282 | u8 type; /* OMAPFB_PLANE_MEM_* */ | 282 | u8 type; /* OMAPFB_PLANE_MEM_* */ |
283 | unsigned alloc:1; /* allocated by the driver */ | 283 | unsigned alloc:1; /* allocated by the driver */ |
diff --git a/arch/blackfin/include/asm/sections.h b/arch/blackfin/include/asm/sections.h index e7fd0ecd73f7..ae4dae1e370b 100644 --- a/arch/blackfin/include/asm/sections.h +++ b/arch/blackfin/include/asm/sections.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #ifndef _BLACKFIN_SECTIONS_H | 1 | #ifndef _BLACKFIN_SECTIONS_H |
2 | #define _BLACKFIN_SECTIONS_H | 2 | #define _BLACKFIN_SECTIONS_H |
3 | 3 | ||
4 | /* nothing to see, move along */ | ||
5 | #include <asm-generic/sections.h> | ||
6 | |||
7 | /* only used when MTD_UCLINUX */ | 4 | /* only used when MTD_UCLINUX */ |
8 | extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size; | 5 | extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size; |
9 | 6 | ||
@@ -15,4 +12,39 @@ extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[], | |||
15 | _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[], | 12 | _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[], |
16 | _ebss_l2[], _l2_lma_start[]; | 13 | _ebss_l2[], _l2_lma_start[]; |
17 | 14 | ||
15 | #include <asm/mem_map.h> | ||
16 | |||
17 | /* Blackfin systems have discontinuous memory map and no virtualized memory */ | ||
18 | static inline int arch_is_kernel_text(unsigned long addr) | ||
19 | { | ||
20 | return | ||
21 | (L1_CODE_LENGTH && | ||
22 | addr >= (unsigned long)_stext_l1 && | ||
23 | addr < (unsigned long)_etext_l1) | ||
24 | || | ||
25 | (L2_LENGTH && | ||
26 | addr >= (unsigned long)_stext_l2 && | ||
27 | addr < (unsigned long)_etext_l2); | ||
28 | } | ||
29 | #define arch_is_kernel_text(addr) arch_is_kernel_text(addr) | ||
30 | |||
31 | static inline int arch_is_kernel_data(unsigned long addr) | ||
32 | { | ||
33 | return | ||
34 | (L1_DATA_A_LENGTH && | ||
35 | addr >= (unsigned long)_sdata_l1 && | ||
36 | addr < (unsigned long)_ebss_l1) | ||
37 | || | ||
38 | (L1_DATA_B_LENGTH && | ||
39 | addr >= (unsigned long)_sdata_b_l1 && | ||
40 | addr < (unsigned long)_ebss_b_l1) | ||
41 | || | ||
42 | (L2_LENGTH && | ||
43 | addr >= (unsigned long)_sdata_l2 && | ||
44 | addr < (unsigned long)_ebss_l2); | ||
45 | } | ||
46 | #define arch_is_kernel_data(addr) arch_is_kernel_data(addr) | ||
47 | |||
48 | #include <asm-generic/sections.h> | ||
49 | |||
18 | #endif | 50 | #endif |
diff --git a/arch/frv/include/asm/gdb-stub.h b/arch/frv/include/asm/gdb-stub.h index 24f9738670bd..2da716407ff2 100644 --- a/arch/frv/include/asm/gdb-stub.h +++ b/arch/frv/include/asm/gdb-stub.h | |||
@@ -90,7 +90,6 @@ extern void gdbstub_do_rx(void); | |||
90 | extern asmlinkage void __debug_stub_init_break(void); | 90 | extern asmlinkage void __debug_stub_init_break(void); |
91 | extern asmlinkage void __break_hijack_kernel_event(void); | 91 | extern asmlinkage void __break_hijack_kernel_event(void); |
92 | extern asmlinkage void __break_hijack_kernel_event_breaks_here(void); | 92 | extern asmlinkage void __break_hijack_kernel_event_breaks_here(void); |
93 | extern asmlinkage void start_kernel(void); | ||
94 | 93 | ||
95 | extern asmlinkage void gdbstub_rx_handler(void); | 94 | extern asmlinkage void gdbstub_rx_handler(void); |
96 | extern asmlinkage void gdbstub_rx_irq(void); | 95 | extern asmlinkage void gdbstub_rx_irq(void); |
diff --git a/arch/frv/kernel/debug-stub.c b/arch/frv/kernel/debug-stub.c index 2f6c60c921e0..2845139c8077 100644 --- a/arch/frv/kernel/debug-stub.c +++ b/arch/frv/kernel/debug-stub.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/serial_reg.h> | 17 | #include <linux/serial_reg.h> |
18 | #include <linux/start_kernel.h> | ||
18 | 19 | ||
19 | #include <asm/system.h> | 20 | #include <asm/system.h> |
20 | #include <asm/serial-regs.h> | 21 | #include <asm/serial-regs.h> |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 011a1cdf0eb5..6851e52ed5a2 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -500,6 +500,10 @@ config HAVE_ARCH_NODEDATA_EXTENSION | |||
500 | def_bool y | 500 | def_bool y |
501 | depends on NUMA | 501 | depends on NUMA |
502 | 502 | ||
503 | config ARCH_PROC_KCORE_TEXT | ||
504 | def_bool y | ||
505 | depends on PROC_KCORE | ||
506 | |||
503 | config IA32_SUPPORT | 507 | config IA32_SUPPORT |
504 | bool "Support for Linux/x86 binaries" | 508 | bool "Support for Linux/x86 binaries" |
505 | help | 509 | help |
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index 8cfb001092ab..674a8374c6d9 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
@@ -2026,24 +2026,21 @@ acpi_sba_ioc_add(struct acpi_device *device) | |||
2026 | struct ioc *ioc; | 2026 | struct ioc *ioc; |
2027 | acpi_status status; | 2027 | acpi_status status; |
2028 | u64 hpa, length; | 2028 | u64 hpa, length; |
2029 | struct acpi_buffer buffer; | ||
2030 | struct acpi_device_info *dev_info; | 2029 | struct acpi_device_info *dev_info; |
2031 | 2030 | ||
2032 | status = hp_acpi_csr_space(device->handle, &hpa, &length); | 2031 | status = hp_acpi_csr_space(device->handle, &hpa, &length); |
2033 | if (ACPI_FAILURE(status)) | 2032 | if (ACPI_FAILURE(status)) |
2034 | return 1; | 2033 | return 1; |
2035 | 2034 | ||
2036 | buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; | 2035 | status = acpi_get_object_info(device->handle, &dev_info); |
2037 | status = acpi_get_object_info(device->handle, &buffer); | ||
2038 | if (ACPI_FAILURE(status)) | 2036 | if (ACPI_FAILURE(status)) |
2039 | return 1; | 2037 | return 1; |
2040 | dev_info = buffer.pointer; | ||
2041 | 2038 | ||
2042 | /* | 2039 | /* |
2043 | * For HWP0001, only SBA appears in ACPI namespace. It encloses the PCI | 2040 | * For HWP0001, only SBA appears in ACPI namespace. It encloses the PCI |
2044 | * root bridges, and its CSR space includes the IOC function. | 2041 | * root bridges, and its CSR space includes the IOC function. |
2045 | */ | 2042 | */ |
2046 | if (strncmp("HWP0001", dev_info->hardware_id.value, 7) == 0) { | 2043 | if (strncmp("HWP0001", dev_info->hardware_id.string, 7) == 0) { |
2047 | hpa += ZX1_IOC_OFFSET; | 2044 | hpa += ZX1_IOC_OFFSET; |
2048 | /* zx1 based systems default to kernel page size iommu pages */ | 2045 | /* zx1 based systems default to kernel page size iommu pages */ |
2049 | if (!iovp_shift) | 2046 | if (!iovp_shift) |
diff --git a/arch/ia64/include/asm/cputime.h b/arch/ia64/include/asm/cputime.h index d20b998cb91d..7fa8a8594660 100644 --- a/arch/ia64/include/asm/cputime.h +++ b/arch/ia64/include/asm/cputime.h | |||
@@ -30,6 +30,7 @@ typedef u64 cputime_t; | |||
30 | typedef u64 cputime64_t; | 30 | typedef u64 cputime64_t; |
31 | 31 | ||
32 | #define cputime_zero ((cputime_t)0) | 32 | #define cputime_zero ((cputime_t)0) |
33 | #define cputime_one_jiffy jiffies_to_cputime(1) | ||
33 | #define cputime_max ((~((cputime_t)0) >> 1) - 1) | 34 | #define cputime_max ((~((cputime_t)0) >> 1) - 1) |
34 | #define cputime_add(__a, __b) ((__a) + (__b)) | 35 | #define cputime_add(__a, __b) ((__a) + (__b)) |
35 | #define cputime_sub(__a, __b) ((__a) - (__b)) | 36 | #define cputime_sub(__a, __b) ((__a) - (__b)) |
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c index 223abb134105..285aae8431c6 100644 --- a/arch/ia64/kernel/pci-swiotlb.c +++ b/arch/ia64/kernel/pci-swiotlb.c | |||
@@ -46,7 +46,7 @@ void __init swiotlb_dma_init(void) | |||
46 | 46 | ||
47 | void __init pci_swiotlb_init(void) | 47 | void __init pci_swiotlb_init(void) |
48 | { | 48 | { |
49 | if (!iommu_detected || iommu_pass_through) { | 49 | if (!iommu_detected) { |
50 | #ifdef CONFIG_IA64_GENERIC | 50 | #ifdef CONFIG_IA64_GENERIC |
51 | swiotlb = 1; | 51 | swiotlb = 1; |
52 | printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n"); | 52 | printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n"); |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 1d286244a562..1857766a63c1 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -617,7 +617,6 @@ mem_init (void) | |||
617 | long reserved_pages, codesize, datasize, initsize; | 617 | long reserved_pages, codesize, datasize, initsize; |
618 | pg_data_t *pgdat; | 618 | pg_data_t *pgdat; |
619 | int i; | 619 | int i; |
620 | static struct kcore_list kcore_mem, kcore_vmem, kcore_kernel; | ||
621 | 620 | ||
622 | BUG_ON(PTRS_PER_PGD * sizeof(pgd_t) != PAGE_SIZE); | 621 | BUG_ON(PTRS_PER_PGD * sizeof(pgd_t) != PAGE_SIZE); |
623 | BUG_ON(PTRS_PER_PMD * sizeof(pmd_t) != PAGE_SIZE); | 622 | BUG_ON(PTRS_PER_PMD * sizeof(pmd_t) != PAGE_SIZE); |
@@ -639,10 +638,6 @@ mem_init (void) | |||
639 | 638 | ||
640 | high_memory = __va(max_low_pfn * PAGE_SIZE); | 639 | high_memory = __va(max_low_pfn * PAGE_SIZE); |
641 | 640 | ||
642 | kclist_add(&kcore_mem, __va(0), max_low_pfn * PAGE_SIZE); | ||
643 | kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); | ||
644 | kclist_add(&kcore_kernel, _stext, _end - _stext); | ||
645 | |||
646 | for_each_online_pgdat(pgdat) | 641 | for_each_online_pgdat(pgdat) |
647 | if (pgdat->bdata->node_bootmem_map) | 642 | if (pgdat->bdata->node_bootmem_map) |
648 | totalram_pages += free_all_bootmem_node(pgdat); | 643 | totalram_pages += free_all_bootmem_node(pgdat); |
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 1f4ee4797a6e..15aa1902a788 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -352,7 +352,6 @@ void __init paging_init(void) | |||
352 | free_area_init_nodes(max_zone_pfns); | 352 | free_area_init_nodes(max_zone_pfns); |
353 | } | 353 | } |
354 | 354 | ||
355 | static struct kcore_list kcore_mem, kcore_vmalloc; | ||
356 | #ifdef CONFIG_64BIT | 355 | #ifdef CONFIG_64BIT |
357 | static struct kcore_list kcore_kseg0; | 356 | static struct kcore_list kcore_kseg0; |
358 | #endif | 357 | #endif |
@@ -409,11 +408,9 @@ void __init mem_init(void) | |||
409 | if ((unsigned long) &_text > (unsigned long) CKSEG0) | 408 | if ((unsigned long) &_text > (unsigned long) CKSEG0) |
410 | /* The -4 is a hack so that user tools don't have to handle | 409 | /* The -4 is a hack so that user tools don't have to handle |
411 | the overflow. */ | 410 | the overflow. */ |
412 | kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4); | 411 | kclist_add(&kcore_kseg0, (void *) CKSEG0, |
412 | 0x80000000 - 4, KCORE_TEXT); | ||
413 | #endif | 413 | #endif |
414 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); | ||
415 | kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, | ||
416 | VMALLOC_END-VMALLOC_START); | ||
417 | 414 | ||
418 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " | 415 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " |
419 | "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", | 416 | "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", |
diff --git a/arch/mn10300/include/asm/gdb-stub.h b/arch/mn10300/include/asm/gdb-stub.h index e5a6368559af..556cce992548 100644 --- a/arch/mn10300/include/asm/gdb-stub.h +++ b/arch/mn10300/include/asm/gdb-stub.h | |||
@@ -109,7 +109,6 @@ extern asmlinkage int gdbstub_intercept(struct pt_regs *, enum exception_code); | |||
109 | extern asmlinkage void gdbstub_exception(struct pt_regs *, enum exception_code); | 109 | extern asmlinkage void gdbstub_exception(struct pt_regs *, enum exception_code); |
110 | extern asmlinkage void __gdbstub_bug_trap(void); | 110 | extern asmlinkage void __gdbstub_bug_trap(void); |
111 | extern asmlinkage void __gdbstub_pause(void); | 111 | extern asmlinkage void __gdbstub_pause(void); |
112 | extern asmlinkage void start_kernel(void); | ||
113 | 112 | ||
114 | #ifndef CONFIG_MN10300_CACHE_DISABLED | 113 | #ifndef CONFIG_MN10300_CACHE_DISABLED |
115 | extern asmlinkage void gdbstub_purge_cache(void); | 114 | extern asmlinkage void gdbstub_purge_cache(void); |
diff --git a/arch/mn10300/kernel/setup.c b/arch/mn10300/kernel/setup.c index 79890edfd67a..3f24c298a3af 100644 --- a/arch/mn10300/kernel/setup.c +++ b/arch/mn10300/kernel/setup.c | |||
@@ -285,7 +285,7 @@ static void c_stop(struct seq_file *m, void *v) | |||
285 | { | 285 | { |
286 | } | 286 | } |
287 | 287 | ||
288 | struct seq_operations cpuinfo_op = { | 288 | const struct seq_operations cpuinfo_op = { |
289 | .start = c_start, | 289 | .start = c_start, |
290 | .next = c_next, | 290 | .next = c_next, |
291 | .stop = c_stop, | 291 | .stop = c_stop, |
diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts index f32c2811c6d9..855782c5e5ec 100644 --- a/arch/powerpc/boot/dts/mpc8377_mds.dts +++ b/arch/powerpc/boot/dts/mpc8377_mds.dts | |||
@@ -159,6 +159,7 @@ | |||
159 | reg = <0x2e000 0x1000>; | 159 | reg = <0x2e000 0x1000>; |
160 | interrupts = <42 0x8>; | 160 | interrupts = <42 0x8>; |
161 | interrupt-parent = <&ipic>; | 161 | interrupt-parent = <&ipic>; |
162 | sdhci,wp-inverted; | ||
162 | /* Filled in by U-Boot */ | 163 | /* Filled in by U-Boot */ |
163 | clock-frequency = <0>; | 164 | clock-frequency = <0>; |
164 | }; | 165 | }; |
diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts b/arch/powerpc/boot/dts/mpc8377_rdb.dts index 28e022ac4179..9e2264b10008 100644 --- a/arch/powerpc/boot/dts/mpc8377_rdb.dts +++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts | |||
@@ -173,6 +173,7 @@ | |||
173 | reg = <0x2e000 0x1000>; | 173 | reg = <0x2e000 0x1000>; |
174 | interrupts = <42 0x8>; | 174 | interrupts = <42 0x8>; |
175 | interrupt-parent = <&ipic>; | 175 | interrupt-parent = <&ipic>; |
176 | sdhci,wp-inverted; | ||
176 | /* Filled in by U-Boot */ | 177 | /* Filled in by U-Boot */ |
177 | clock-frequency = <111111111>; | 178 | clock-frequency = <111111111>; |
178 | }; | 179 | }; |
diff --git a/arch/powerpc/boot/dts/mpc8377_wlan.dts b/arch/powerpc/boot/dts/mpc8377_wlan.dts index 3febc4e91b10..9a603695723b 100644 --- a/arch/powerpc/boot/dts/mpc8377_wlan.dts +++ b/arch/powerpc/boot/dts/mpc8377_wlan.dts | |||
@@ -150,6 +150,7 @@ | |||
150 | reg = <0x2e000 0x1000>; | 150 | reg = <0x2e000 0x1000>; |
151 | interrupts = <42 0x8>; | 151 | interrupts = <42 0x8>; |
152 | interrupt-parent = <&ipic>; | 152 | interrupt-parent = <&ipic>; |
153 | sdhci,wp-inverted; | ||
153 | clock-frequency = <133333333>; | 154 | clock-frequency = <133333333>; |
154 | }; | 155 | }; |
155 | }; | 156 | }; |
diff --git a/arch/powerpc/boot/dts/mpc8378_mds.dts b/arch/powerpc/boot/dts/mpc8378_mds.dts index f720ab9af30d..f70cf6000839 100644 --- a/arch/powerpc/boot/dts/mpc8378_mds.dts +++ b/arch/powerpc/boot/dts/mpc8378_mds.dts | |||
@@ -159,6 +159,7 @@ | |||
159 | reg = <0x2e000 0x1000>; | 159 | reg = <0x2e000 0x1000>; |
160 | interrupts = <42 0x8>; | 160 | interrupts = <42 0x8>; |
161 | interrupt-parent = <&ipic>; | 161 | interrupt-parent = <&ipic>; |
162 | sdhci,wp-inverted; | ||
162 | /* Filled in by U-Boot */ | 163 | /* Filled in by U-Boot */ |
163 | clock-frequency = <0>; | 164 | clock-frequency = <0>; |
164 | }; | 165 | }; |
diff --git a/arch/powerpc/boot/dts/mpc8378_rdb.dts b/arch/powerpc/boot/dts/mpc8378_rdb.dts index a11ead8214b4..4e6a1a407bbd 100644 --- a/arch/powerpc/boot/dts/mpc8378_rdb.dts +++ b/arch/powerpc/boot/dts/mpc8378_rdb.dts | |||
@@ -173,6 +173,7 @@ | |||
173 | reg = <0x2e000 0x1000>; | 173 | reg = <0x2e000 0x1000>; |
174 | interrupts = <42 0x8>; | 174 | interrupts = <42 0x8>; |
175 | interrupt-parent = <&ipic>; | 175 | interrupt-parent = <&ipic>; |
176 | sdhci,wp-inverted; | ||
176 | /* Filled in by U-Boot */ | 177 | /* Filled in by U-Boot */ |
177 | clock-frequency = <111111111>; | 178 | clock-frequency = <111111111>; |
178 | }; | 179 | }; |
diff --git a/arch/powerpc/boot/dts/mpc8379_mds.dts b/arch/powerpc/boot/dts/mpc8379_mds.dts index 4fa221fd9bdc..645ec51cc6e1 100644 --- a/arch/powerpc/boot/dts/mpc8379_mds.dts +++ b/arch/powerpc/boot/dts/mpc8379_mds.dts | |||
@@ -157,6 +157,7 @@ | |||
157 | reg = <0x2e000 0x1000>; | 157 | reg = <0x2e000 0x1000>; |
158 | interrupts = <42 0x8>; | 158 | interrupts = <42 0x8>; |
159 | interrupt-parent = <&ipic>; | 159 | interrupt-parent = <&ipic>; |
160 | sdhci,wp-inverted; | ||
160 | /* Filled in by U-Boot */ | 161 | /* Filled in by U-Boot */ |
161 | clock-frequency = <0>; | 162 | clock-frequency = <0>; |
162 | }; | 163 | }; |
diff --git a/arch/powerpc/boot/dts/mpc8379_rdb.dts b/arch/powerpc/boot/dts/mpc8379_rdb.dts index e35dfba587c8..72336d504528 100644 --- a/arch/powerpc/boot/dts/mpc8379_rdb.dts +++ b/arch/powerpc/boot/dts/mpc8379_rdb.dts | |||
@@ -171,6 +171,7 @@ | |||
171 | reg = <0x2e000 0x1000>; | 171 | reg = <0x2e000 0x1000>; |
172 | interrupts = <42 0x8>; | 172 | interrupts = <42 0x8>; |
173 | interrupt-parent = <&ipic>; | 173 | interrupt-parent = <&ipic>; |
174 | sdhci,wp-inverted; | ||
174 | /* Filled in by U-Boot */ | 175 | /* Filled in by U-Boot */ |
175 | clock-frequency = <111111111>; | 176 | clock-frequency = <111111111>; |
176 | }; | 177 | }; |
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index f42e623030ee..fa19f3fe05ff 100644 --- a/arch/powerpc/include/asm/cputime.h +++ b/arch/powerpc/include/asm/cputime.h | |||
@@ -18,6 +18,9 @@ | |||
18 | 18 | ||
19 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 19 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING |
20 | #include <asm-generic/cputime.h> | 20 | #include <asm-generic/cputime.h> |
21 | #ifdef __KERNEL__ | ||
22 | static inline void setup_cputime_one_jiffy(void) { } | ||
23 | #endif | ||
21 | #else | 24 | #else |
22 | 25 | ||
23 | #include <linux/types.h> | 26 | #include <linux/types.h> |
@@ -49,6 +52,11 @@ typedef u64 cputime64_t; | |||
49 | #ifdef __KERNEL__ | 52 | #ifdef __KERNEL__ |
50 | 53 | ||
51 | /* | 54 | /* |
55 | * One jiffy in timebase units computed during initialization | ||
56 | */ | ||
57 | extern cputime_t cputime_one_jiffy; | ||
58 | |||
59 | /* | ||
52 | * Convert cputime <-> jiffies | 60 | * Convert cputime <-> jiffies |
53 | */ | 61 | */ |
54 | extern u64 __cputime_jiffies_factor; | 62 | extern u64 __cputime_jiffies_factor; |
@@ -89,6 +97,11 @@ static inline cputime_t jiffies_to_cputime(const unsigned long jif) | |||
89 | return ct; | 97 | return ct; |
90 | } | 98 | } |
91 | 99 | ||
100 | static inline void setup_cputime_one_jiffy(void) | ||
101 | { | ||
102 | cputime_one_jiffy = jiffies_to_cputime(1); | ||
103 | } | ||
104 | |||
92 | static inline cputime64_t jiffies64_to_cputime64(const u64 jif) | 105 | static inline cputime64_t jiffies64_to_cputime64(const u64 jif) |
93 | { | 106 | { |
94 | cputime_t ct; | 107 | cputime_t ct; |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 02fed27af7f6..1d5570a1e456 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -328,7 +328,7 @@ static void c_stop(struct seq_file *m, void *v) | |||
328 | { | 328 | { |
329 | } | 329 | } |
330 | 330 | ||
331 | struct seq_operations cpuinfo_op = { | 331 | const struct seq_operations cpuinfo_op = { |
332 | .start =c_start, | 332 | .start =c_start, |
333 | .next = c_next, | 333 | .next = c_next, |
334 | .stop = c_stop, | 334 | .stop = c_stop, |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index df45a7449a66..92dc844299b6 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -193,6 +193,8 @@ EXPORT_SYMBOL(__cputime_clockt_factor); | |||
193 | DEFINE_PER_CPU(unsigned long, cputime_last_delta); | 193 | DEFINE_PER_CPU(unsigned long, cputime_last_delta); |
194 | DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta); | 194 | DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta); |
195 | 195 | ||
196 | cputime_t cputime_one_jiffy; | ||
197 | |||
196 | static void calc_cputime_factors(void) | 198 | static void calc_cputime_factors(void) |
197 | { | 199 | { |
198 | struct div_result res; | 200 | struct div_result res; |
@@ -501,6 +503,7 @@ static int __init iSeries_tb_recal(void) | |||
501 | tb_to_xs = divres.result_low; | 503 | tb_to_xs = divres.result_low; |
502 | vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; | 504 | vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; |
503 | vdso_data->tb_to_xs = tb_to_xs; | 505 | vdso_data->tb_to_xs = tb_to_xs; |
506 | setup_cputime_one_jiffy(); | ||
504 | } | 507 | } |
505 | else { | 508 | else { |
506 | printk( "Titan recalibrate: FAILED (difference > 4 percent)\n" | 509 | printk( "Titan recalibrate: FAILED (difference > 4 percent)\n" |
@@ -960,6 +963,7 @@ void __init time_init(void) | |||
960 | tb_ticks_per_usec = ppc_tb_freq / 1000000; | 963 | tb_ticks_per_usec = ppc_tb_freq / 1000000; |
961 | tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); | 964 | tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); |
962 | calc_cputime_factors(); | 965 | calc_cputime_factors(); |
966 | setup_cputime_one_jiffy(); | ||
963 | 967 | ||
964 | /* | 968 | /* |
965 | * Calculate the length of each tick in ns. It will not be | 969 | * Calculate the length of each tick in ns. It will not be |
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c index 3ef5084b90ca..9ddcfb4dc139 100644 --- a/arch/powerpc/mm/init_32.c +++ b/arch/powerpc/mm/init_32.c | |||
@@ -242,39 +242,3 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
242 | } | 242 | } |
243 | #endif | 243 | #endif |
244 | 244 | ||
245 | #ifdef CONFIG_PROC_KCORE | ||
246 | static struct kcore_list kcore_vmem; | ||
247 | |||
248 | static int __init setup_kcore(void) | ||
249 | { | ||
250 | int i; | ||
251 | |||
252 | for (i = 0; i < lmb.memory.cnt; i++) { | ||
253 | unsigned long base; | ||
254 | unsigned long size; | ||
255 | struct kcore_list *kcore_mem; | ||
256 | |||
257 | base = lmb.memory.region[i].base; | ||
258 | size = lmb.memory.region[i].size; | ||
259 | |||
260 | kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC); | ||
261 | if (!kcore_mem) | ||
262 | panic("%s: kmalloc failed\n", __func__); | ||
263 | |||
264 | /* must stay under 32 bits */ | ||
265 | if ( 0xfffffffful - (unsigned long)__va(base) < size) { | ||
266 | size = 0xfffffffful - (unsigned long)(__va(base)); | ||
267 | printk(KERN_DEBUG "setup_kcore: restrict size=%lx\n", | ||
268 | size); | ||
269 | } | ||
270 | |||
271 | kclist_add(kcore_mem, __va(base), size); | ||
272 | } | ||
273 | |||
274 | kclist_add(&kcore_vmem, (void *)VMALLOC_START, | ||
275 | VMALLOC_END-VMALLOC_START); | ||
276 | |||
277 | return 0; | ||
278 | } | ||
279 | module_init(setup_kcore); | ||
280 | #endif | ||
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index 31582329cd67..335c578b9cc3 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -109,35 +109,6 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
109 | } | 109 | } |
110 | #endif | 110 | #endif |
111 | 111 | ||
112 | #ifdef CONFIG_PROC_KCORE | ||
113 | static struct kcore_list kcore_vmem; | ||
114 | |||
115 | static int __init setup_kcore(void) | ||
116 | { | ||
117 | int i; | ||
118 | |||
119 | for (i=0; i < lmb.memory.cnt; i++) { | ||
120 | unsigned long base, size; | ||
121 | struct kcore_list *kcore_mem; | ||
122 | |||
123 | base = lmb.memory.region[i].base; | ||
124 | size = lmb.memory.region[i].size; | ||
125 | |||
126 | /* GFP_ATOMIC to avoid might_sleep warnings during boot */ | ||
127 | kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC); | ||
128 | if (!kcore_mem) | ||
129 | panic("%s: kmalloc failed\n", __func__); | ||
130 | |||
131 | kclist_add(kcore_mem, __va(base), size); | ||
132 | } | ||
133 | |||
134 | kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); | ||
135 | |||
136 | return 0; | ||
137 | } | ||
138 | module_init(setup_kcore); | ||
139 | #endif | ||
140 | |||
141 | static void pgd_ctor(void *addr) | 112 | static void pgd_ctor(void *addr) |
142 | { | 113 | { |
143 | memset(addr, 0, PGD_TABLE_SIZE); | 114 | memset(addr, 0, PGD_TABLE_SIZE); |
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 0e5c59b995ef..59736317bf0e 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -143,8 +143,8 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
143 | * memory regions, find holes and callback for contiguous regions. | 143 | * memory regions, find holes and callback for contiguous regions. |
144 | */ | 144 | */ |
145 | int | 145 | int |
146 | walk_memory_resource(unsigned long start_pfn, unsigned long nr_pages, void *arg, | 146 | walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, |
147 | int (*func)(unsigned long, unsigned long, void *)) | 147 | void *arg, int (*func)(unsigned long, unsigned long, void *)) |
148 | { | 148 | { |
149 | struct lmb_property res; | 149 | struct lmb_property res; |
150 | unsigned long pfn, len; | 150 | unsigned long pfn, len; |
@@ -166,7 +166,7 @@ walk_memory_resource(unsigned long start_pfn, unsigned long nr_pages, void *arg, | |||
166 | } | 166 | } |
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |
169 | EXPORT_SYMBOL_GPL(walk_memory_resource); | 169 | EXPORT_SYMBOL_GPL(walk_system_ram_range); |
170 | 170 | ||
171 | /* | 171 | /* |
172 | * Initialize the bootmem system and give it all the memory we | 172 | * Initialize the bootmem system and give it all the memory we |
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index eae51ef9af24..3631a4f277eb 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c | |||
@@ -71,7 +71,7 @@ static int hc_show(struct seq_file *m, void *p) | |||
71 | return 0; | 71 | return 0; |
72 | } | 72 | } |
73 | 73 | ||
74 | static struct seq_operations hcall_inst_seq_ops = { | 74 | static const struct seq_operations hcall_inst_seq_ops = { |
75 | .start = hc_start, | 75 | .start = hc_start, |
76 | .next = hc_next, | 76 | .next = hc_next, |
77 | .stop = hc_stop, | 77 | .stop = hc_stop, |
diff --git a/arch/s390/defconfig b/arch/s390/defconfig index 4e91a2573cc4..ab4464486b7a 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.30 | 3 | # Linux kernel version: 2.6.31 |
4 | # Mon Jun 22 11:08:16 2009 | 4 | # Tue Sep 22 17:43:13 2009 |
5 | # | 5 | # |
6 | CONFIG_SCHED_MC=y | 6 | CONFIG_SCHED_MC=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -24,6 +24,7 @@ CONFIG_PGSTE=y | |||
24 | CONFIG_VIRT_CPU_ACCOUNTING=y | 24 | CONFIG_VIRT_CPU_ACCOUNTING=y |
25 | CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y | 25 | CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y |
26 | CONFIG_S390=y | 26 | CONFIG_S390=y |
27 | CONFIG_SCHED_OMIT_FRAME_POINTER=y | ||
27 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | 28 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
28 | CONFIG_CONSTRUCTORS=y | 29 | CONFIG_CONSTRUCTORS=y |
29 | 30 | ||
@@ -48,11 +49,12 @@ CONFIG_AUDIT=y | |||
48 | # | 49 | # |
49 | # RCU Subsystem | 50 | # RCU Subsystem |
50 | # | 51 | # |
51 | CONFIG_CLASSIC_RCU=y | 52 | CONFIG_TREE_RCU=y |
52 | # CONFIG_TREE_RCU is not set | 53 | # CONFIG_TREE_PREEMPT_RCU is not set |
53 | # CONFIG_PREEMPT_RCU is not set | 54 | # CONFIG_RCU_TRACE is not set |
55 | CONFIG_RCU_FANOUT=64 | ||
56 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
54 | # CONFIG_TREE_RCU_TRACE is not set | 57 | # CONFIG_TREE_RCU_TRACE is not set |
55 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
56 | CONFIG_IKCONFIG=y | 58 | CONFIG_IKCONFIG=y |
57 | CONFIG_IKCONFIG_PROC=y | 59 | CONFIG_IKCONFIG_PROC=y |
58 | CONFIG_LOG_BUF_SHIFT=17 | 60 | CONFIG_LOG_BUF_SHIFT=17 |
@@ -103,11 +105,12 @@ CONFIG_TIMERFD=y | |||
103 | CONFIG_EVENTFD=y | 105 | CONFIG_EVENTFD=y |
104 | CONFIG_SHMEM=y | 106 | CONFIG_SHMEM=y |
105 | CONFIG_AIO=y | 107 | CONFIG_AIO=y |
106 | CONFIG_HAVE_PERF_COUNTERS=y | 108 | CONFIG_HAVE_PERF_EVENTS=y |
107 | 109 | ||
108 | # | 110 | # |
109 | # Performance Counters | 111 | # Kernel Performance Events And Counters |
110 | # | 112 | # |
113 | # CONFIG_PERF_EVENTS is not set | ||
111 | # CONFIG_PERF_COUNTERS is not set | 114 | # CONFIG_PERF_COUNTERS is not set |
112 | CONFIG_VM_EVENT_COUNTERS=y | 115 | CONFIG_VM_EVENT_COUNTERS=y |
113 | # CONFIG_STRIP_ASM_SYMS is not set | 116 | # CONFIG_STRIP_ASM_SYMS is not set |
@@ -116,7 +119,6 @@ CONFIG_SLAB=y | |||
116 | # CONFIG_SLUB is not set | 119 | # CONFIG_SLUB is not set |
117 | # CONFIG_SLOB is not set | 120 | # CONFIG_SLOB is not set |
118 | # CONFIG_PROFILING is not set | 121 | # CONFIG_PROFILING is not set |
119 | # CONFIG_MARKERS is not set | ||
120 | CONFIG_HAVE_OPROFILE=y | 122 | CONFIG_HAVE_OPROFILE=y |
121 | CONFIG_KPROBES=y | 123 | CONFIG_KPROBES=y |
122 | CONFIG_HAVE_SYSCALL_WRAPPERS=y | 124 | CONFIG_HAVE_SYSCALL_WRAPPERS=y |
@@ -176,6 +178,7 @@ CONFIG_NO_HZ=y | |||
176 | CONFIG_HIGH_RES_TIMERS=y | 178 | CONFIG_HIGH_RES_TIMERS=y |
177 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | 179 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y |
178 | CONFIG_64BIT=y | 180 | CONFIG_64BIT=y |
181 | # CONFIG_KTIME_SCALAR is not set | ||
179 | CONFIG_SMP=y | 182 | CONFIG_SMP=y |
180 | CONFIG_NR_CPUS=32 | 183 | CONFIG_NR_CPUS=32 |
181 | CONFIG_HOTPLUG_CPU=y | 184 | CONFIG_HOTPLUG_CPU=y |
@@ -257,7 +260,6 @@ CONFIG_FORCE_MAX_ZONEORDER=9 | |||
257 | CONFIG_PFAULT=y | 260 | CONFIG_PFAULT=y |
258 | # CONFIG_SHARED_KERNEL is not set | 261 | # CONFIG_SHARED_KERNEL is not set |
259 | # CONFIG_CMM is not set | 262 | # CONFIG_CMM is not set |
260 | # CONFIG_PAGE_STATES is not set | ||
261 | # CONFIG_APPLDATA_BASE is not set | 263 | # CONFIG_APPLDATA_BASE is not set |
262 | CONFIG_HZ_100=y | 264 | CONFIG_HZ_100=y |
263 | # CONFIG_HZ_250 is not set | 265 | # CONFIG_HZ_250 is not set |
@@ -280,6 +282,7 @@ CONFIG_PM_SLEEP_SMP=y | |||
280 | CONFIG_PM_SLEEP=y | 282 | CONFIG_PM_SLEEP=y |
281 | CONFIG_HIBERNATION=y | 283 | CONFIG_HIBERNATION=y |
282 | CONFIG_PM_STD_PARTITION="" | 284 | CONFIG_PM_STD_PARTITION="" |
285 | # CONFIG_PM_RUNTIME is not set | ||
283 | CONFIG_NET=y | 286 | CONFIG_NET=y |
284 | 287 | ||
285 | # | 288 | # |
@@ -394,6 +397,7 @@ CONFIG_IP_SCTP=m | |||
394 | # CONFIG_SCTP_HMAC_NONE is not set | 397 | # CONFIG_SCTP_HMAC_NONE is not set |
395 | # CONFIG_SCTP_HMAC_SHA1 is not set | 398 | # CONFIG_SCTP_HMAC_SHA1 is not set |
396 | CONFIG_SCTP_HMAC_MD5=y | 399 | CONFIG_SCTP_HMAC_MD5=y |
400 | # CONFIG_RDS is not set | ||
397 | # CONFIG_TIPC is not set | 401 | # CONFIG_TIPC is not set |
398 | # CONFIG_ATM is not set | 402 | # CONFIG_ATM is not set |
399 | # CONFIG_BRIDGE is not set | 403 | # CONFIG_BRIDGE is not set |
@@ -487,6 +491,7 @@ CONFIG_CCW=y | |||
487 | # Generic Driver Options | 491 | # Generic Driver Options |
488 | # | 492 | # |
489 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 493 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
494 | # CONFIG_DEVTMPFS is not set | ||
490 | CONFIG_STANDALONE=y | 495 | CONFIG_STANDALONE=y |
491 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 496 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
492 | CONFIG_FW_LOADER=y | 497 | CONFIG_FW_LOADER=y |
@@ -501,6 +506,7 @@ CONFIG_BLK_DEV=y | |||
501 | CONFIG_BLK_DEV_LOOP=m | 506 | CONFIG_BLK_DEV_LOOP=m |
502 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | 507 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set |
503 | CONFIG_BLK_DEV_NBD=m | 508 | CONFIG_BLK_DEV_NBD=m |
509 | # CONFIG_BLK_DEV_OSD is not set | ||
504 | CONFIG_BLK_DEV_RAM=y | 510 | CONFIG_BLK_DEV_RAM=y |
505 | CONFIG_BLK_DEV_RAM_COUNT=16 | 511 | CONFIG_BLK_DEV_RAM_COUNT=16 |
506 | CONFIG_BLK_DEV_RAM_SIZE=4096 | 512 | CONFIG_BLK_DEV_RAM_SIZE=4096 |
@@ -594,8 +600,11 @@ CONFIG_BLK_DEV_DM=y | |||
594 | CONFIG_DM_CRYPT=y | 600 | CONFIG_DM_CRYPT=y |
595 | CONFIG_DM_SNAPSHOT=y | 601 | CONFIG_DM_SNAPSHOT=y |
596 | CONFIG_DM_MIRROR=y | 602 | CONFIG_DM_MIRROR=y |
603 | # CONFIG_DM_LOG_USERSPACE is not set | ||
597 | CONFIG_DM_ZERO=y | 604 | CONFIG_DM_ZERO=y |
598 | CONFIG_DM_MULTIPATH=m | 605 | CONFIG_DM_MULTIPATH=m |
606 | # CONFIG_DM_MULTIPATH_QL is not set | ||
607 | # CONFIG_DM_MULTIPATH_ST is not set | ||
599 | # CONFIG_DM_DELAY is not set | 608 | # CONFIG_DM_DELAY is not set |
600 | # CONFIG_DM_UEVENT is not set | 609 | # CONFIG_DM_UEVENT is not set |
601 | CONFIG_NETDEVICES=y | 610 | CONFIG_NETDEVICES=y |
@@ -615,7 +624,6 @@ CONFIG_NET_ETHERNET=y | |||
615 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | 624 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set |
616 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | 625 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set |
617 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | 626 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set |
618 | # CONFIG_KS8842 is not set | ||
619 | CONFIG_NETDEV_1000=y | 627 | CONFIG_NETDEV_1000=y |
620 | CONFIG_NETDEV_10000=y | 628 | CONFIG_NETDEV_10000=y |
621 | # CONFIG_TR is not set | 629 | # CONFIG_TR is not set |
@@ -678,6 +686,7 @@ CONFIG_SCLP_CONSOLE=y | |||
678 | CONFIG_SCLP_VT220_TTY=y | 686 | CONFIG_SCLP_VT220_TTY=y |
679 | CONFIG_SCLP_VT220_CONSOLE=y | 687 | CONFIG_SCLP_VT220_CONSOLE=y |
680 | CONFIG_SCLP_CPI=m | 688 | CONFIG_SCLP_CPI=m |
689 | CONFIG_SCLP_ASYNC=m | ||
681 | CONFIG_S390_TAPE=m | 690 | CONFIG_S390_TAPE=m |
682 | 691 | ||
683 | # | 692 | # |
@@ -737,6 +746,7 @@ CONFIG_FS_POSIX_ACL=y | |||
737 | # CONFIG_GFS2_FS is not set | 746 | # CONFIG_GFS2_FS is not set |
738 | # CONFIG_OCFS2_FS is not set | 747 | # CONFIG_OCFS2_FS is not set |
739 | # CONFIG_BTRFS_FS is not set | 748 | # CONFIG_BTRFS_FS is not set |
749 | # CONFIG_NILFS2_FS is not set | ||
740 | CONFIG_FILE_LOCKING=y | 750 | CONFIG_FILE_LOCKING=y |
741 | CONFIG_FSNOTIFY=y | 751 | CONFIG_FSNOTIFY=y |
742 | CONFIG_DNOTIFY=y | 752 | CONFIG_DNOTIFY=y |
@@ -798,7 +808,6 @@ CONFIG_MISC_FILESYSTEMS=y | |||
798 | # CONFIG_SYSV_FS is not set | 808 | # CONFIG_SYSV_FS is not set |
799 | # CONFIG_UFS_FS is not set | 809 | # CONFIG_UFS_FS is not set |
800 | # CONFIG_EXOFS_FS is not set | 810 | # CONFIG_EXOFS_FS is not set |
801 | # CONFIG_NILFS2_FS is not set | ||
802 | CONFIG_NETWORK_FILESYSTEMS=y | 811 | CONFIG_NETWORK_FILESYSTEMS=y |
803 | CONFIG_NFS_FS=y | 812 | CONFIG_NFS_FS=y |
804 | CONFIG_NFS_V3=y | 813 | CONFIG_NFS_V3=y |
@@ -885,11 +894,13 @@ CONFIG_DEBUG_MEMORY_INIT=y | |||
885 | # CONFIG_DEBUG_LIST is not set | 894 | # CONFIG_DEBUG_LIST is not set |
886 | # CONFIG_DEBUG_SG is not set | 895 | # CONFIG_DEBUG_SG is not set |
887 | # CONFIG_DEBUG_NOTIFIERS is not set | 896 | # CONFIG_DEBUG_NOTIFIERS is not set |
897 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
888 | # CONFIG_RCU_TORTURE_TEST is not set | 898 | # CONFIG_RCU_TORTURE_TEST is not set |
889 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | 899 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set |
890 | # CONFIG_KPROBES_SANITY_TEST is not set | 900 | # CONFIG_KPROBES_SANITY_TEST is not set |
891 | # CONFIG_BACKTRACE_SELF_TEST is not set | 901 | # CONFIG_BACKTRACE_SELF_TEST is not set |
892 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | 902 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set |
903 | CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y | ||
893 | # CONFIG_LKDTM is not set | 904 | # CONFIG_LKDTM is not set |
894 | # CONFIG_FAULT_INJECTION is not set | 905 | # CONFIG_FAULT_INJECTION is not set |
895 | # CONFIG_LATENCYTOP is not set | 906 | # CONFIG_LATENCYTOP is not set |
@@ -979,11 +990,13 @@ CONFIG_CRYPTO_PCBC=m | |||
979 | # | 990 | # |
980 | CONFIG_CRYPTO_HMAC=m | 991 | CONFIG_CRYPTO_HMAC=m |
981 | # CONFIG_CRYPTO_XCBC is not set | 992 | # CONFIG_CRYPTO_XCBC is not set |
993 | CONFIG_CRYPTO_VMAC=m | ||
982 | 994 | ||
983 | # | 995 | # |
984 | # Digest | 996 | # Digest |
985 | # | 997 | # |
986 | CONFIG_CRYPTO_CRC32C=m | 998 | CONFIG_CRYPTO_CRC32C=m |
999 | CONFIG_CRYPTO_GHASH=m | ||
987 | # CONFIG_CRYPTO_MD4 is not set | 1000 | # CONFIG_CRYPTO_MD4 is not set |
988 | CONFIG_CRYPTO_MD5=m | 1001 | CONFIG_CRYPTO_MD5=m |
989 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | 1002 | # CONFIG_CRYPTO_MICHAEL_MIC is not set |
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 7a3817a656df..24b1244aadb9 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
@@ -42,6 +42,7 @@ __div(unsigned long long n, unsigned int base) | |||
42 | #endif /* __s390x__ */ | 42 | #endif /* __s390x__ */ |
43 | 43 | ||
44 | #define cputime_zero (0ULL) | 44 | #define cputime_zero (0ULL) |
45 | #define cputime_one_jiffy jiffies_to_cputime(1) | ||
45 | #define cputime_max ((~0UL >> 1) - 1) | 46 | #define cputime_max ((~0UL >> 1) - 1) |
46 | #define cputime_add(__a, __b) ((__a) + (__b)) | 47 | #define cputime_add(__a, __b) ((__a) + (__b)) |
47 | #define cputime_sub(__a, __b) ((__a) - (__b)) | 48 | #define cputime_sub(__a, __b) ((__a) - (__b)) |
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index 6bc9426a6fbf..f2ef4b619ce1 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h | |||
@@ -86,6 +86,7 @@ | |||
86 | #define __LC_PGM_OLD_PSW 0x0150 | 86 | #define __LC_PGM_OLD_PSW 0x0150 |
87 | #define __LC_MCK_OLD_PSW 0x0160 | 87 | #define __LC_MCK_OLD_PSW 0x0160 |
88 | #define __LC_IO_OLD_PSW 0x0170 | 88 | #define __LC_IO_OLD_PSW 0x0170 |
89 | #define __LC_RESTART_PSW 0x01a0 | ||
89 | #define __LC_EXT_NEW_PSW 0x01b0 | 90 | #define __LC_EXT_NEW_PSW 0x01b0 |
90 | #define __LC_SVC_NEW_PSW 0x01c0 | 91 | #define __LC_SVC_NEW_PSW 0x01c0 |
91 | #define __LC_PGM_NEW_PSW 0x01d0 | 92 | #define __LC_PGM_NEW_PSW 0x01d0 |
@@ -189,6 +190,14 @@ union save_area { | |||
189 | #define SAVE_AREA_BASE SAVE_AREA_BASE_S390X | 190 | #define SAVE_AREA_BASE SAVE_AREA_BASE_S390X |
190 | #endif | 191 | #endif |
191 | 192 | ||
193 | #ifndef __s390x__ | ||
194 | #define LC_ORDER 0 | ||
195 | #else | ||
196 | #define LC_ORDER 1 | ||
197 | #endif | ||
198 | |||
199 | #define LC_PAGES (1UL << LC_ORDER) | ||
200 | |||
192 | struct _lowcore | 201 | struct _lowcore |
193 | { | 202 | { |
194 | #ifndef __s390x__ | 203 | #ifndef __s390x__ |
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index cf8eed3fa779..b42715458312 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -295,7 +295,7 @@ static inline void ATTRIB_NORET disabled_wait(unsigned long code) | |||
295 | " oi 0x384(1),0x10\n"/* fake protection bit */ | 295 | " oi 0x384(1),0x10\n"/* fake protection bit */ |
296 | " lpswe 0(%1)" | 296 | " lpswe 0(%1)" |
297 | : "=m" (ctl_buf) | 297 | : "=m" (ctl_buf) |
298 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc", "0"); | 298 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc", "0", "1"); |
299 | #endif /* __s390x__ */ | 299 | #endif /* __s390x__ */ |
300 | while (1); | 300 | while (1); |
301 | } | 301 | } |
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c index fa9905ce7d0b..63e46433e81d 100644 --- a/arch/s390/kernel/asm-offsets.c +++ b/arch/s390/kernel/asm-offsets.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/kbuild.h> | 8 | #include <linux/kbuild.h> |
9 | #include <asm/vdso.h> | 9 | #include <asm/vdso.h> |
10 | #include <asm/sigp.h> | ||
10 | 11 | ||
11 | int main(void) | 12 | int main(void) |
12 | { | 13 | { |
@@ -59,6 +60,10 @@ int main(void) | |||
59 | DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); | 60 | DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); |
60 | DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); | 61 | DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); |
61 | DEFINE(CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC); | 62 | DEFINE(CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC); |
62 | 63 | /* constants for SIGP */ | |
64 | DEFINE(__SIGP_STOP, sigp_stop); | ||
65 | DEFINE(__SIGP_RESTART, sigp_restart); | ||
66 | DEFINE(__SIGP_SENSE, sigp_sense); | ||
67 | DEFINE(__SIGP_INITIAL_CPU_RESET, sigp_initial_cpu_reset); | ||
63 | return 0; | 68 | return 0; |
64 | } | 69 | } |
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 9ab188d67a3d..5519cb745106 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -443,66 +443,28 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) | |||
443 | * sys32_execve() executes a new program after the asm stub has set | 443 | * sys32_execve() executes a new program after the asm stub has set |
444 | * things up for us. This should basically do what I want it to. | 444 | * things up for us. This should basically do what I want it to. |
445 | */ | 445 | */ |
446 | asmlinkage long sys32_execve(void) | 446 | asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, |
447 | compat_uptr_t __user *envp) | ||
447 | { | 448 | { |
448 | struct pt_regs *regs = task_pt_regs(current); | 449 | struct pt_regs *regs = task_pt_regs(current); |
449 | char *filename; | 450 | char *filename; |
450 | unsigned long result; | 451 | long rc; |
451 | int rc; | 452 | |
452 | 453 | filename = getname(name); | |
453 | filename = getname(compat_ptr(regs->orig_gpr2)); | 454 | rc = PTR_ERR(filename); |
454 | if (IS_ERR(filename)) { | 455 | if (IS_ERR(filename)) |
455 | result = PTR_ERR(filename); | 456 | return rc; |
456 | goto out; | 457 | rc = compat_do_execve(filename, argv, envp, regs); |
457 | } | 458 | if (rc) |
458 | rc = compat_do_execve(filename, compat_ptr(regs->gprs[3]), | 459 | goto out; |
459 | compat_ptr(regs->gprs[4]), regs); | ||
460 | if (rc) { | ||
461 | result = rc; | ||
462 | goto out_putname; | ||
463 | } | ||
464 | current->thread.fp_regs.fpc=0; | 460 | current->thread.fp_regs.fpc=0; |
465 | asm volatile("sfpc %0,0" : : "d" (0)); | 461 | asm volatile("sfpc %0,0" : : "d" (0)); |
466 | result = regs->gprs[2]; | 462 | rc = regs->gprs[2]; |
467 | out_putname: | ||
468 | putname(filename); | ||
469 | out: | 463 | out: |
470 | return result; | 464 | putname(filename); |
471 | } | 465 | return rc; |
472 | |||
473 | |||
474 | #ifdef CONFIG_MODULES | ||
475 | |||
476 | asmlinkage long | ||
477 | sys32_init_module(void __user *umod, unsigned long len, | ||
478 | const char __user *uargs) | ||
479 | { | ||
480 | return sys_init_module(umod, len, uargs); | ||
481 | } | ||
482 | |||
483 | asmlinkage long | ||
484 | sys32_delete_module(const char __user *name_user, unsigned int flags) | ||
485 | { | ||
486 | return sys_delete_module(name_user, flags); | ||
487 | } | ||
488 | |||
489 | #else /* CONFIG_MODULES */ | ||
490 | |||
491 | asmlinkage long | ||
492 | sys32_init_module(void __user *umod, unsigned long len, | ||
493 | const char __user *uargs) | ||
494 | { | ||
495 | return -ENOSYS; | ||
496 | } | 466 | } |
497 | 467 | ||
498 | asmlinkage long | ||
499 | sys32_delete_module(const char __user *name_user, unsigned int flags) | ||
500 | { | ||
501 | return -ENOSYS; | ||
502 | } | ||
503 | |||
504 | #endif /* CONFIG_MODULES */ | ||
505 | |||
506 | asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, | 468 | asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, |
507 | size_t count, u32 poshi, u32 poslo) | 469 | size_t count, u32 poshi, u32 poslo) |
508 | { | 470 | { |
@@ -801,23 +763,6 @@ asmlinkage long sys32_write(unsigned int fd, char __user * buf, size_t count) | |||
801 | return sys_write(fd, buf, count); | 763 | return sys_write(fd, buf, count); |
802 | } | 764 | } |
803 | 765 | ||
804 | asmlinkage long sys32_clone(void) | ||
805 | { | ||
806 | struct pt_regs *regs = task_pt_regs(current); | ||
807 | unsigned long clone_flags; | ||
808 | unsigned long newsp; | ||
809 | int __user *parent_tidptr, *child_tidptr; | ||
810 | |||
811 | clone_flags = regs->gprs[3] & 0xffffffffUL; | ||
812 | newsp = regs->orig_gpr2 & 0x7fffffffUL; | ||
813 | parent_tidptr = compat_ptr(regs->gprs[4]); | ||
814 | child_tidptr = compat_ptr(regs->gprs[5]); | ||
815 | if (!newsp) | ||
816 | newsp = regs->gprs[15]; | ||
817 | return do_fork(clone_flags, newsp, regs, 0, | ||
818 | parent_tidptr, child_tidptr); | ||
819 | } | ||
820 | |||
821 | /* | 766 | /* |
822 | * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64. | 767 | * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64. |
823 | * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE} | 768 | * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE} |
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index 836a28842900..c07f9ca05ade 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h | |||
@@ -198,7 +198,8 @@ long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | |||
198 | compat_sigset_t __user *oset, size_t sigsetsize); | 198 | compat_sigset_t __user *oset, size_t sigsetsize); |
199 | long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); | 199 | long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); |
200 | long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); | 200 | long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); |
201 | long sys32_execve(void); | 201 | long sys32_execve(char __user *name, compat_uptr_t __user *argv, |
202 | compat_uptr_t __user *envp); | ||
202 | long sys32_init_module(void __user *umod, unsigned long len, | 203 | long sys32_init_module(void __user *umod, unsigned long len, |
203 | const char __user *uargs); | 204 | const char __user *uargs); |
204 | long sys32_delete_module(const char __user *name_user, unsigned int flags); | 205 | long sys32_delete_module(const char __user *name_user, unsigned int flags); |
@@ -222,7 +223,6 @@ unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg); | |||
222 | long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg); | 223 | long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg); |
223 | long sys32_read(unsigned int fd, char __user * buf, size_t count); | 224 | long sys32_read(unsigned int fd, char __user * buf, size_t count); |
224 | long sys32_write(unsigned int fd, char __user * buf, size_t count); | 225 | long sys32_write(unsigned int fd, char __user * buf, size_t count); |
225 | long sys32_clone(void); | ||
226 | long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); | 226 | long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); |
227 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); | 227 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); |
228 | long sys32_sigaction(int sig, const struct old_sigaction32 __user *act, | 228 | long sys32_sigaction(int sig, const struct old_sigaction32 __user *act, |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 624790042d41..682fb69dba21 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -568,18 +568,18 @@ compat_sys_sigprocmask_wrapper: | |||
568 | llgtr %r4,%r4 # compat_old_sigset_t * | 568 | llgtr %r4,%r4 # compat_old_sigset_t * |
569 | jg compat_sys_sigprocmask # branch to system call | 569 | jg compat_sys_sigprocmask # branch to system call |
570 | 570 | ||
571 | .globl sys32_init_module_wrapper | 571 | .globl sys_init_module_wrapper |
572 | sys32_init_module_wrapper: | 572 | sys_init_module_wrapper: |
573 | llgtr %r2,%r2 # void * | 573 | llgtr %r2,%r2 # void * |
574 | llgfr %r3,%r3 # unsigned long | 574 | llgfr %r3,%r3 # unsigned long |
575 | llgtr %r4,%r4 # char * | 575 | llgtr %r4,%r4 # char * |
576 | jg sys32_init_module # branch to system call | 576 | jg sys_init_module # branch to system call |
577 | 577 | ||
578 | .globl sys32_delete_module_wrapper | 578 | .globl sys_delete_module_wrapper |
579 | sys32_delete_module_wrapper: | 579 | sys_delete_module_wrapper: |
580 | llgtr %r2,%r2 # const char * | 580 | llgtr %r2,%r2 # const char * |
581 | llgfr %r3,%r3 # unsigned int | 581 | llgfr %r3,%r3 # unsigned int |
582 | jg sys32_delete_module # branch to system call | 582 | jg sys_delete_module # branch to system call |
583 | 583 | ||
584 | .globl sys32_quotactl_wrapper | 584 | .globl sys32_quotactl_wrapper |
585 | sys32_quotactl_wrapper: | 585 | sys32_quotactl_wrapper: |
@@ -1840,3 +1840,18 @@ sys_perf_event_open_wrapper: | |||
1840 | lgfr %r5,%r5 # int | 1840 | lgfr %r5,%r5 # int |
1841 | llgfr %r6,%r6 # unsigned long | 1841 | llgfr %r6,%r6 # unsigned long |
1842 | jg sys_perf_event_open # branch to system call | 1842 | jg sys_perf_event_open # branch to system call |
1843 | |||
1844 | .globl sys_clone_wrapper | ||
1845 | sys_clone_wrapper: | ||
1846 | llgfr %r2,%r2 # unsigned long | ||
1847 | llgfr %r3,%r3 # unsigned long | ||
1848 | llgtr %r4,%r4 # int * | ||
1849 | llgtr %r5,%r5 # int * | ||
1850 | jg sys_clone # branch to system call | ||
1851 | |||
1852 | .globl sys32_execve_wrapper | ||
1853 | sys32_execve_wrapper: | ||
1854 | llgtr %r2,%r2 # char * | ||
1855 | llgtr %r3,%r3 # compat_uptr_t * | ||
1856 | llgtr %r4,%r4 # compat_uptr_t * | ||
1857 | jg sys32_execve # branch to system call | ||
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index 950c59c6688b..e1e5e767ab56 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
@@ -42,10 +42,12 @@ long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args); | |||
42 | long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, | 42 | long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, |
43 | u32 len_low); | 43 | u32 len_low); |
44 | long sys_fork(void); | 44 | long sys_fork(void); |
45 | long sys_clone(void); | 45 | long sys_clone(unsigned long newsp, unsigned long clone_flags, |
46 | int __user *parent_tidptr, int __user *child_tidptr); | ||
46 | long sys_vfork(void); | 47 | long sys_vfork(void); |
47 | void execve_tail(void); | 48 | void execve_tail(void); |
48 | long sys_execve(void); | 49 | long sys_execve(char __user *name, char __user * __user *argv, |
50 | char __user * __user *envp); | ||
49 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); | 51 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); |
50 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | 52 | long sys_sigaction(int sig, const struct old_sigaction __user *act, |
51 | struct old_sigaction __user *oact); | 53 | struct old_sigaction __user *oact); |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 5a43f27eec13..59fe6ecc6ed3 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/elfcore.h> | 32 | #include <linux/elfcore.h> |
33 | #include <linux/kernel_stat.h> | 33 | #include <linux/kernel_stat.h> |
34 | #include <linux/syscalls.h> | 34 | #include <linux/syscalls.h> |
35 | #include <linux/compat.h> | ||
35 | #include <asm/compat.h> | 36 | #include <asm/compat.h> |
36 | #include <asm/uaccess.h> | 37 | #include <asm/uaccess.h> |
37 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
@@ -230,17 +231,11 @@ SYSCALL_DEFINE0(fork) | |||
230 | return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); | 231 | return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); |
231 | } | 232 | } |
232 | 233 | ||
233 | SYSCALL_DEFINE0(clone) | 234 | SYSCALL_DEFINE4(clone, unsigned long, newsp, unsigned long, clone_flags, |
235 | int __user *, parent_tidptr, int __user *, child_tidptr) | ||
234 | { | 236 | { |
235 | struct pt_regs *regs = task_pt_regs(current); | 237 | struct pt_regs *regs = task_pt_regs(current); |
236 | unsigned long clone_flags; | ||
237 | unsigned long newsp; | ||
238 | int __user *parent_tidptr, *child_tidptr; | ||
239 | 238 | ||
240 | clone_flags = regs->gprs[3]; | ||
241 | newsp = regs->orig_gpr2; | ||
242 | parent_tidptr = (int __user *) regs->gprs[4]; | ||
243 | child_tidptr = (int __user *) regs->gprs[5]; | ||
244 | if (!newsp) | 239 | if (!newsp) |
245 | newsp = regs->gprs[15]; | 240 | newsp = regs->gprs[15]; |
246 | return do_fork(clone_flags, newsp, regs, 0, | 241 | return do_fork(clone_flags, newsp, regs, 0, |
@@ -274,30 +269,25 @@ asmlinkage void execve_tail(void) | |||
274 | /* | 269 | /* |
275 | * sys_execve() executes a new program. | 270 | * sys_execve() executes a new program. |
276 | */ | 271 | */ |
277 | SYSCALL_DEFINE0(execve) | 272 | SYSCALL_DEFINE3(execve, char __user *, name, char __user * __user *, argv, |
273 | char __user * __user *, envp) | ||
278 | { | 274 | { |
279 | struct pt_regs *regs = task_pt_regs(current); | 275 | struct pt_regs *regs = task_pt_regs(current); |
280 | char *filename; | 276 | char *filename; |
281 | unsigned long result; | 277 | long rc; |
282 | int rc; | ||
283 | 278 | ||
284 | filename = getname((char __user *) regs->orig_gpr2); | 279 | filename = getname(name); |
285 | if (IS_ERR(filename)) { | 280 | rc = PTR_ERR(filename); |
286 | result = PTR_ERR(filename); | 281 | if (IS_ERR(filename)) |
282 | return rc; | ||
283 | rc = do_execve(filename, argv, envp, regs); | ||
284 | if (rc) | ||
287 | goto out; | 285 | goto out; |
288 | } | ||
289 | rc = do_execve(filename, (char __user * __user *) regs->gprs[3], | ||
290 | (char __user * __user *) regs->gprs[4], regs); | ||
291 | if (rc) { | ||
292 | result = rc; | ||
293 | goto out_putname; | ||
294 | } | ||
295 | execve_tail(); | 286 | execve_tail(); |
296 | result = regs->gprs[2]; | 287 | rc = regs->gprs[2]; |
297 | out_putname: | ||
298 | putname(filename); | ||
299 | out: | 288 | out: |
300 | return result; | 289 | putname(filename); |
290 | return rc; | ||
301 | } | 291 | } |
302 | 292 | ||
303 | /* | 293 | /* |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index f3ddd7ac06c5..a8738676b26c 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -339,24 +339,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
339 | int copied, ret; | 339 | int copied, ret; |
340 | 340 | ||
341 | switch (request) { | 341 | switch (request) { |
342 | case PTRACE_PEEKTEXT: | ||
343 | case PTRACE_PEEKDATA: | ||
344 | /* Remove high order bit from address (only for 31 bit). */ | ||
345 | addr &= PSW_ADDR_INSN; | ||
346 | /* read word at location addr. */ | ||
347 | return generic_ptrace_peekdata(child, addr, data); | ||
348 | |||
349 | case PTRACE_PEEKUSR: | 342 | case PTRACE_PEEKUSR: |
350 | /* read the word at location addr in the USER area. */ | 343 | /* read the word at location addr in the USER area. */ |
351 | return peek_user(child, addr, data); | 344 | return peek_user(child, addr, data); |
352 | 345 | ||
353 | case PTRACE_POKETEXT: | ||
354 | case PTRACE_POKEDATA: | ||
355 | /* Remove high order bit from address (only for 31 bit). */ | ||
356 | addr &= PSW_ADDR_INSN; | ||
357 | /* write the word at location addr. */ | ||
358 | return generic_ptrace_pokedata(child, addr, data); | ||
359 | |||
360 | case PTRACE_POKEUSR: | 346 | case PTRACE_POKEUSR: |
361 | /* write the word at location addr in the USER area */ | 347 | /* write the word at location addr in the USER area */ |
362 | return poke_user(child, addr, data); | 348 | return poke_user(child, addr, data); |
@@ -386,8 +372,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
386 | copied += sizeof(unsigned long); | 372 | copied += sizeof(unsigned long); |
387 | } | 373 | } |
388 | return 0; | 374 | return 0; |
375 | default: | ||
376 | /* Removing high order bit from addr (only for 31 bit). */ | ||
377 | addr &= PSW_ADDR_INSN; | ||
378 | return ptrace_request(child, request, addr, data); | ||
389 | } | 379 | } |
390 | return ptrace_request(child, request, addr, data); | ||
391 | } | 380 | } |
392 | 381 | ||
393 | #ifdef CONFIG_COMPAT | 382 | #ifdef CONFIG_COMPAT |
diff --git a/arch/s390/kernel/sclp.S b/arch/s390/kernel/sclp.S index 20639dfe0c42..e27ca63076d1 100644 --- a/arch/s390/kernel/sclp.S +++ b/arch/s390/kernel/sclp.S | |||
@@ -24,8 +24,6 @@ LC_EXT_INT_CODE = 0x86 # addr of ext int code | |||
24 | # R3 = external interruption parameter if R2=0 | 24 | # R3 = external interruption parameter if R2=0 |
25 | # | 25 | # |
26 | 26 | ||
27 | .section ".init.text","ax" | ||
28 | |||
29 | _sclp_wait_int: | 27 | _sclp_wait_int: |
30 | stm %r6,%r15,24(%r15) # save registers | 28 | stm %r6,%r15,24(%r15) # save registers |
31 | basr %r13,0 # get base register | 29 | basr %r13,0 # get base register |
@@ -318,9 +316,8 @@ _sclp_print_early: | |||
318 | .long _sclp_work_area | 316 | .long _sclp_work_area |
319 | .Lascebc: | 317 | .Lascebc: |
320 | .long _ascebc | 318 | .long _ascebc |
321 | .previous | ||
322 | 319 | ||
323 | .section ".init.data","a" | 320 | .section .data,"aw",@progbits |
324 | .balign 4096 | 321 | .balign 4096 |
325 | _sclp_work_area: | 322 | _sclp_work_area: |
326 | .fill 4096 | 323 | .fill 4096 |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 56c16876b919..b4b6396e6cf0 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -475,10 +475,8 @@ static int __cpuinit smp_alloc_lowcore(int cpu) | |||
475 | { | 475 | { |
476 | unsigned long async_stack, panic_stack; | 476 | unsigned long async_stack, panic_stack; |
477 | struct _lowcore *lowcore; | 477 | struct _lowcore *lowcore; |
478 | int lc_order; | ||
479 | 478 | ||
480 | lc_order = sizeof(long) == 8 ? 1 : 0; | 479 | lowcore = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, LC_ORDER); |
481 | lowcore = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, lc_order); | ||
482 | if (!lowcore) | 480 | if (!lowcore) |
483 | return -ENOMEM; | 481 | return -ENOMEM; |
484 | async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER); | 482 | async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER); |
@@ -509,16 +507,14 @@ static int __cpuinit smp_alloc_lowcore(int cpu) | |||
509 | out: | 507 | out: |
510 | free_page(panic_stack); | 508 | free_page(panic_stack); |
511 | free_pages(async_stack, ASYNC_ORDER); | 509 | free_pages(async_stack, ASYNC_ORDER); |
512 | free_pages((unsigned long) lowcore, lc_order); | 510 | free_pages((unsigned long) lowcore, LC_ORDER); |
513 | return -ENOMEM; | 511 | return -ENOMEM; |
514 | } | 512 | } |
515 | 513 | ||
516 | static void smp_free_lowcore(int cpu) | 514 | static void smp_free_lowcore(int cpu) |
517 | { | 515 | { |
518 | struct _lowcore *lowcore; | 516 | struct _lowcore *lowcore; |
519 | int lc_order; | ||
520 | 517 | ||
521 | lc_order = sizeof(long) == 8 ? 1 : 0; | ||
522 | lowcore = lowcore_ptr[cpu]; | 518 | lowcore = lowcore_ptr[cpu]; |
523 | #ifndef CONFIG_64BIT | 519 | #ifndef CONFIG_64BIT |
524 | if (MACHINE_HAS_IEEE) | 520 | if (MACHINE_HAS_IEEE) |
@@ -528,7 +524,7 @@ static void smp_free_lowcore(int cpu) | |||
528 | #endif | 524 | #endif |
529 | free_page(lowcore->panic_stack - PAGE_SIZE); | 525 | free_page(lowcore->panic_stack - PAGE_SIZE); |
530 | free_pages(lowcore->async_stack - ASYNC_SIZE, ASYNC_ORDER); | 526 | free_pages(lowcore->async_stack - ASYNC_SIZE, ASYNC_ORDER); |
531 | free_pages((unsigned long) lowcore, lc_order); | 527 | free_pages((unsigned long) lowcore, LC_ORDER); |
532 | lowcore_ptr[cpu] = NULL; | 528 | lowcore_ptr[cpu] = NULL; |
533 | } | 529 | } |
534 | 530 | ||
@@ -664,7 +660,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
664 | unsigned long async_stack, panic_stack; | 660 | unsigned long async_stack, panic_stack; |
665 | struct _lowcore *lowcore; | 661 | struct _lowcore *lowcore; |
666 | unsigned int cpu; | 662 | unsigned int cpu; |
667 | int lc_order; | ||
668 | 663 | ||
669 | smp_detect_cpus(); | 664 | smp_detect_cpus(); |
670 | 665 | ||
@@ -674,8 +669,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
674 | print_cpu_info(); | 669 | print_cpu_info(); |
675 | 670 | ||
676 | /* Reallocate current lowcore, but keep its contents. */ | 671 | /* Reallocate current lowcore, but keep its contents. */ |
677 | lc_order = sizeof(long) == 8 ? 1 : 0; | 672 | lowcore = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, LC_ORDER); |
678 | lowcore = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, lc_order); | ||
679 | panic_stack = __get_free_page(GFP_KERNEL); | 673 | panic_stack = __get_free_page(GFP_KERNEL); |
680 | async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER); | 674 | async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER); |
681 | BUG_ON(!lowcore || !panic_stack || !async_stack); | 675 | BUG_ON(!lowcore || !panic_stack || !async_stack); |
@@ -1047,42 +1041,6 @@ out: | |||
1047 | static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show, | 1041 | static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show, |
1048 | dispatching_store); | 1042 | dispatching_store); |
1049 | 1043 | ||
1050 | /* | ||
1051 | * If the resume kernel runs on another cpu than the suspended kernel, | ||
1052 | * we have to switch the cpu IDs in the logical map. | ||
1053 | */ | ||
1054 | void smp_switch_boot_cpu_in_resume(u32 resume_phys_cpu_id, | ||
1055 | struct _lowcore *suspend_lowcore) | ||
1056 | { | ||
1057 | int cpu, suspend_cpu_id, resume_cpu_id; | ||
1058 | u32 suspend_phys_cpu_id; | ||
1059 | |||
1060 | suspend_phys_cpu_id = __cpu_logical_map[suspend_lowcore->cpu_nr]; | ||
1061 | suspend_cpu_id = suspend_lowcore->cpu_nr; | ||
1062 | |||
1063 | for_each_present_cpu(cpu) { | ||
1064 | if (__cpu_logical_map[cpu] == resume_phys_cpu_id) { | ||
1065 | resume_cpu_id = cpu; | ||
1066 | goto found; | ||
1067 | } | ||
1068 | } | ||
1069 | panic("Could not find resume cpu in logical map.\n"); | ||
1070 | |||
1071 | found: | ||
1072 | printk("Resume cpu ID: %i/%i\n", resume_phys_cpu_id, resume_cpu_id); | ||
1073 | printk("Suspend cpu ID: %i/%i\n", suspend_phys_cpu_id, suspend_cpu_id); | ||
1074 | |||
1075 | __cpu_logical_map[resume_cpu_id] = suspend_phys_cpu_id; | ||
1076 | __cpu_logical_map[suspend_cpu_id] = resume_phys_cpu_id; | ||
1077 | |||
1078 | lowcore_ptr[suspend_cpu_id]->cpu_addr = resume_phys_cpu_id; | ||
1079 | } | ||
1080 | |||
1081 | u32 smp_get_phys_cpu_id(void) | ||
1082 | { | ||
1083 | return __cpu_logical_map[smp_processor_id()]; | ||
1084 | } | ||
1085 | |||
1086 | static int __init topology_init(void) | 1044 | static int __init topology_init(void) |
1087 | { | 1045 | { |
1088 | int cpu; | 1046 | int cpu; |
diff --git a/arch/s390/kernel/suspend.c b/arch/s390/kernel/suspend.c index 086bee970cae..cf9e5c6d5527 100644 --- a/arch/s390/kernel/suspend.c +++ b/arch/s390/kernel/suspend.c | |||
@@ -6,36 +6,26 @@ | |||
6 | * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com> | 6 | * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com> |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/suspend.h> | ||
10 | #include <linux/reboot.h> | ||
11 | #include <linux/pfn.h> | 9 | #include <linux/pfn.h> |
12 | #include <linux/mm.h> | ||
13 | #include <asm/sections.h> | ||
14 | #include <asm/system.h> | 10 | #include <asm/system.h> |
15 | #include <asm/ipl.h> | ||
16 | 11 | ||
17 | /* | 12 | /* |
18 | * References to section boundaries | 13 | * References to section boundaries |
19 | */ | 14 | */ |
20 | extern const void __nosave_begin, __nosave_end; | 15 | extern const void __nosave_begin, __nosave_end; |
21 | 16 | ||
22 | /* | ||
23 | * check if given pfn is in the 'nosave' or in the read only NSS section | ||
24 | */ | ||
25 | int pfn_is_nosave(unsigned long pfn) | 17 | int pfn_is_nosave(unsigned long pfn) |
26 | { | 18 | { |
27 | unsigned long nosave_begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT; | 19 | unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin)); |
28 | unsigned long nosave_end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) | 20 | unsigned long nosave_end_pfn = PFN_DOWN(__pa(&__nosave_end)); |
29 | >> PAGE_SHIFT; | ||
30 | unsigned long eshared_pfn = PFN_DOWN(__pa(&_eshared)) - 1; | ||
31 | unsigned long stext_pfn = PFN_DOWN(__pa(&_stext)); | ||
32 | 21 | ||
22 | /* Always save lowcore pages (LC protection might be enabled). */ | ||
23 | if (pfn <= LC_PAGES) | ||
24 | return 0; | ||
33 | if (pfn >= nosave_begin_pfn && pfn < nosave_end_pfn) | 25 | if (pfn >= nosave_begin_pfn && pfn < nosave_end_pfn) |
34 | return 1; | 26 | return 1; |
35 | if (pfn >= stext_pfn && pfn <= eshared_pfn) { | 27 | /* Skip memory holes and read-only pages (NSS, DCSS, ...). */ |
36 | if (ipl_info.type == IPL_TYPE_NSS) | 28 | if (tprot(PFN_PHYS(pfn))) |
37 | return 1; | ||
38 | } else if ((tprot(pfn * PAGE_SIZE) && pfn > 0)) | ||
39 | return 1; | 29 | return 1; |
40 | return 0; | 30 | return 0; |
41 | } | 31 | } |
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S index 7cd6b096f0d1..fe927d0bc20b 100644 --- a/arch/s390/kernel/swsusp_asm64.S +++ b/arch/s390/kernel/swsusp_asm64.S | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #include <asm/page.h> | 10 | #include <asm/page.h> |
11 | #include <asm/ptrace.h> | 11 | #include <asm/ptrace.h> |
12 | #include <asm/thread_info.h> | ||
12 | #include <asm/asm-offsets.h> | 13 | #include <asm/asm-offsets.h> |
13 | 14 | ||
14 | /* | 15 | /* |
@@ -41,6 +42,9 @@ swsusp_arch_suspend: | |||
41 | /* Get pointer to save area */ | 42 | /* Get pointer to save area */ |
42 | lghi %r1,0x1000 | 43 | lghi %r1,0x1000 |
43 | 44 | ||
45 | /* Save CPU address */ | ||
46 | stap __LC_CPU_ADDRESS(%r1) | ||
47 | |||
44 | /* Store registers */ | 48 | /* Store registers */ |
45 | mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */ | 49 | mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */ |
46 | stfpc 0x31c(%r1) /* store fpu control */ | 50 | stfpc 0x31c(%r1) /* store fpu control */ |
@@ -102,11 +106,10 @@ swsusp_arch_resume: | |||
102 | aghi %r15,-STACK_FRAME_OVERHEAD | 106 | aghi %r15,-STACK_FRAME_OVERHEAD |
103 | stg %r1,__SF_BACKCHAIN(%r15) | 107 | stg %r1,__SF_BACKCHAIN(%r15) |
104 | 108 | ||
105 | #ifdef CONFIG_SMP | 109 | /* Make all free pages stable */ |
106 | /* Save boot cpu number */ | 110 | lghi %r2,1 |
107 | brasl %r14,smp_get_phys_cpu_id | 111 | brasl %r14,arch_set_page_states |
108 | lgr %r10,%r2 | 112 | |
109 | #endif | ||
110 | /* Deactivate DAT */ | 113 | /* Deactivate DAT */ |
111 | stnsm __SF_EMPTY(%r15),0xfb | 114 | stnsm __SF_EMPTY(%r15),0xfb |
112 | 115 | ||
@@ -133,6 +136,69 @@ swsusp_arch_resume: | |||
133 | 2: | 136 | 2: |
134 | ptlb /* flush tlb */ | 137 | ptlb /* flush tlb */ |
135 | 138 | ||
139 | /* Reset System */ | ||
140 | larl %r1,restart_entry | ||
141 | larl %r2,.Lrestart_diag308_psw | ||
142 | og %r1,0(%r2) | ||
143 | stg %r1,0(%r0) | ||
144 | larl %r1,.Lnew_pgm_check_psw | ||
145 | epsw %r2,%r3 | ||
146 | stm %r2,%r3,0(%r1) | ||
147 | mvc __LC_PGM_NEW_PSW(16,%r0),0(%r1) | ||
148 | lghi %r0,0 | ||
149 | diag %r0,%r0,0x308 | ||
150 | restart_entry: | ||
151 | lhi %r1,1 | ||
152 | sigp %r1,%r0,0x12 | ||
153 | sam64 | ||
154 | larl %r1,.Lnew_pgm_check_psw | ||
155 | lpswe 0(%r1) | ||
156 | pgm_check_entry: | ||
157 | |||
158 | /* Switch to original suspend CPU */ | ||
159 | larl %r1,.Lresume_cpu /* Resume CPU address: r2 */ | ||
160 | stap 0(%r1) | ||
161 | llgh %r2,0(%r1) | ||
162 | lghi %r3,0x1000 | ||
163 | llgh %r1,__LC_CPU_ADDRESS(%r3) /* Suspend CPU address: r1 */ | ||
164 | cgr %r1,%r2 | ||
165 | je restore_registers /* r1 = r2 -> nothing to do */ | ||
166 | larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */ | ||
167 | mvc __LC_RESTART_PSW(16,%r0),0(%r4) | ||
168 | 3: | ||
169 | sigp %r9,%r1,__SIGP_INITIAL_CPU_RESET | ||
170 | brc 8,4f /* accepted */ | ||
171 | brc 2,3b /* busy, try again */ | ||
172 | |||
173 | /* Suspend CPU not available -> panic */ | ||
174 | larl %r15,init_thread_union | ||
175 | ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) | ||
176 | larl %r2,.Lpanic_string | ||
177 | larl %r3,_sclp_print_early | ||
178 | lghi %r1,0 | ||
179 | sam31 | ||
180 | sigp %r1,%r0,0x12 | ||
181 | basr %r14,%r3 | ||
182 | larl %r3,.Ldisabled_wait_31 | ||
183 | lpsw 0(%r3) | ||
184 | 4: | ||
185 | /* Switch to suspend CPU */ | ||
186 | sigp %r9,%r1,__SIGP_RESTART /* start suspend CPU */ | ||
187 | brc 2,4b /* busy, try again */ | ||
188 | 5: | ||
189 | sigp %r9,%r2,__SIGP_STOP /* stop resume (current) CPU */ | ||
190 | 6: j 6b | ||
191 | |||
192 | restart_suspend: | ||
193 | larl %r1,.Lresume_cpu | ||
194 | llgh %r2,0(%r1) | ||
195 | 7: | ||
196 | sigp %r9,%r2,__SIGP_SENSE /* Wait for resume CPU */ | ||
197 | brc 2,7b /* busy, try again */ | ||
198 | tmll %r9,0x40 /* Test if resume CPU is stopped */ | ||
199 | jz 7b | ||
200 | |||
201 | restore_registers: | ||
136 | /* Restore registers */ | 202 | /* Restore registers */ |
137 | lghi %r13,0x1000 /* %r1 = pointer to save arae */ | 203 | lghi %r13,0x1000 /* %r1 = pointer to save arae */ |
138 | 204 | ||
@@ -166,19 +232,33 @@ swsusp_arch_resume: | |||
166 | /* Pointer to save area */ | 232 | /* Pointer to save area */ |
167 | lghi %r13,0x1000 | 233 | lghi %r13,0x1000 |
168 | 234 | ||
169 | #ifdef CONFIG_SMP | ||
170 | /* Switch CPUs */ | ||
171 | lgr %r2,%r10 /* get cpu id */ | ||
172 | llgf %r3,0x318(%r13) | ||
173 | brasl %r14,smp_switch_boot_cpu_in_resume | ||
174 | #endif | ||
175 | /* Restore prefix register */ | 235 | /* Restore prefix register */ |
176 | spx 0x318(%r13) | 236 | spx 0x318(%r13) |
177 | 237 | ||
178 | /* Activate DAT */ | 238 | /* Activate DAT */ |
179 | stosm __SF_EMPTY(%r15),0x04 | 239 | stosm __SF_EMPTY(%r15),0x04 |
180 | 240 | ||
241 | /* Make all free pages unstable */ | ||
242 | lghi %r2,0 | ||
243 | brasl %r14,arch_set_page_states | ||
244 | |||
181 | /* Return 0 */ | 245 | /* Return 0 */ |
182 | lmg %r6,%r15,STACK_FRAME_OVERHEAD + __SF_GPRS(%r15) | 246 | lmg %r6,%r15,STACK_FRAME_OVERHEAD + __SF_GPRS(%r15) |
183 | lghi %r2,0 | 247 | lghi %r2,0 |
184 | br %r14 | 248 | br %r14 |
249 | |||
250 | .section .data.nosave,"aw",@progbits | ||
251 | .align 8 | ||
252 | .Ldisabled_wait_31: | ||
253 | .long 0x000a0000,0x00000000 | ||
254 | .Lpanic_string: | ||
255 | .asciz "Resume not possible because suspend CPU is no longer available" | ||
256 | .align 8 | ||
257 | .Lrestart_diag308_psw: | ||
258 | .long 0x00080000,0x80000000 | ||
259 | .Lrestart_suspend_psw: | ||
260 | .quad 0x0000000180000000,restart_suspend | ||
261 | .Lnew_pgm_check_psw: | ||
262 | .quad 0,pgm_check_entry | ||
263 | .Lresume_cpu: | ||
264 | .byte 0,0 | ||
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 0b5083681e77..30eca070d426 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -19,7 +19,7 @@ SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_restart_syscall) | |||
19 | SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper) | 19 | SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper) |
20 | SYSCALL(sys_link,sys_link,sys32_link_wrapper) | 20 | SYSCALL(sys_link,sys_link,sys32_link_wrapper) |
21 | SYSCALL(sys_unlink,sys_unlink,sys32_unlink_wrapper) /* 10 */ | 21 | SYSCALL(sys_unlink,sys_unlink,sys32_unlink_wrapper) /* 10 */ |
22 | SYSCALL(sys_execve,sys_execve,sys32_execve) | 22 | SYSCALL(sys_execve,sys_execve,sys32_execve_wrapper) |
23 | SYSCALL(sys_chdir,sys_chdir,sys32_chdir_wrapper) | 23 | SYSCALL(sys_chdir,sys_chdir,sys32_chdir_wrapper) |
24 | SYSCALL(sys_time,sys_ni_syscall,sys32_time_wrapper) /* old time syscall */ | 24 | SYSCALL(sys_time,sys_ni_syscall,sys32_time_wrapper) /* old time syscall */ |
25 | SYSCALL(sys_mknod,sys_mknod,sys32_mknod_wrapper) | 25 | SYSCALL(sys_mknod,sys_mknod,sys32_mknod_wrapper) |
@@ -128,7 +128,7 @@ SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper) | |||
128 | SYSCALL(sys_ipc,sys_ipc,sys32_ipc_wrapper) | 128 | SYSCALL(sys_ipc,sys_ipc,sys32_ipc_wrapper) |
129 | SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) | 129 | SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) |
130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) | 130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) |
131 | SYSCALL(sys_clone,sys_clone,sys32_clone) /* 120 */ | 131 | SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */ |
132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) | 132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) |
133 | SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper) | 133 | SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper) |
134 | NI_SYSCALL /* modify_ldt for i386 */ | 134 | NI_SYSCALL /* modify_ldt for i386 */ |
@@ -136,8 +136,8 @@ SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) | |||
136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ | 136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ |
137 | SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper) | 137 | SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask_wrapper) |
138 | NI_SYSCALL /* old "create module" */ | 138 | NI_SYSCALL /* old "create module" */ |
139 | SYSCALL(sys_init_module,sys_init_module,sys32_init_module_wrapper) | 139 | SYSCALL(sys_init_module,sys_init_module,sys_init_module_wrapper) |
140 | SYSCALL(sys_delete_module,sys_delete_module,sys32_delete_module_wrapper) | 140 | SYSCALL(sys_delete_module,sys_delete_module,sys_delete_module_wrapper) |
141 | NI_SYSCALL /* 130: old get_kernel_syms */ | 141 | NI_SYSCALL /* 130: old get_kernel_syms */ |
142 | SYSCALL(sys_quotactl,sys_quotactl,sys32_quotactl_wrapper) | 142 | SYSCALL(sys_quotactl,sys_quotactl,sys32_quotactl_wrapper) |
143 | SYSCALL(sys_getpgid,sys_getpgid,sys32_getpgid_wrapper) | 143 | SYSCALL(sys_getpgid,sys_getpgid,sys32_getpgid_wrapper) |
diff --git a/arch/s390/mm/page-states.c b/arch/s390/mm/page-states.c index f92ec203ad92..098923ae458f 100644 --- a/arch/s390/mm/page-states.c +++ b/arch/s390/mm/page-states.c | |||
@@ -50,28 +50,64 @@ void __init cmma_init(void) | |||
50 | cmma_flag = 0; | 50 | cmma_flag = 0; |
51 | } | 51 | } |
52 | 52 | ||
53 | void arch_free_page(struct page *page, int order) | 53 | static inline void set_page_unstable(struct page *page, int order) |
54 | { | 54 | { |
55 | int i, rc; | 55 | int i, rc; |
56 | 56 | ||
57 | if (!cmma_flag) | ||
58 | return; | ||
59 | for (i = 0; i < (1 << order); i++) | 57 | for (i = 0; i < (1 << order); i++) |
60 | asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0" | 58 | asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0" |
61 | : "=&d" (rc) | 59 | : "=&d" (rc) |
62 | : "a" ((page_to_pfn(page) + i) << PAGE_SHIFT), | 60 | : "a" (page_to_phys(page + i)), |
63 | "i" (ESSA_SET_UNUSED)); | 61 | "i" (ESSA_SET_UNUSED)); |
64 | } | 62 | } |
65 | 63 | ||
66 | void arch_alloc_page(struct page *page, int order) | 64 | void arch_free_page(struct page *page, int order) |
67 | { | 65 | { |
68 | int i, rc; | ||
69 | |||
70 | if (!cmma_flag) | 66 | if (!cmma_flag) |
71 | return; | 67 | return; |
68 | set_page_unstable(page, order); | ||
69 | } | ||
70 | |||
71 | static inline void set_page_stable(struct page *page, int order) | ||
72 | { | ||
73 | int i, rc; | ||
74 | |||
72 | for (i = 0; i < (1 << order); i++) | 75 | for (i = 0; i < (1 << order); i++) |
73 | asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0" | 76 | asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0" |
74 | : "=&d" (rc) | 77 | : "=&d" (rc) |
75 | : "a" ((page_to_pfn(page) + i) << PAGE_SHIFT), | 78 | : "a" (page_to_phys(page + i)), |
76 | "i" (ESSA_SET_STABLE)); | 79 | "i" (ESSA_SET_STABLE)); |
77 | } | 80 | } |
81 | |||
82 | void arch_alloc_page(struct page *page, int order) | ||
83 | { | ||
84 | if (!cmma_flag) | ||
85 | return; | ||
86 | set_page_stable(page, order); | ||
87 | } | ||
88 | |||
89 | void arch_set_page_states(int make_stable) | ||
90 | { | ||
91 | unsigned long flags, order, t; | ||
92 | struct list_head *l; | ||
93 | struct page *page; | ||
94 | struct zone *zone; | ||
95 | |||
96 | if (!cmma_flag) | ||
97 | return; | ||
98 | if (make_stable) | ||
99 | drain_local_pages(NULL); | ||
100 | for_each_populated_zone(zone) { | ||
101 | spin_lock_irqsave(&zone->lock, flags); | ||
102 | for_each_migratetype_order(order, t) { | ||
103 | list_for_each(l, &zone->free_area[order].free_list[t]) { | ||
104 | page = list_entry(l, struct page, lru); | ||
105 | if (make_stable) | ||
106 | set_page_stable(page, order); | ||
107 | else | ||
108 | set_page_unstable(page, order); | ||
109 | } | ||
110 | } | ||
111 | spin_unlock_irqrestore(&zone->lock, flags); | ||
112 | } | ||
113 | } | ||
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index c70215247071..c60bfb309ce6 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -314,21 +314,18 @@ int s390_enable_sie(void) | |||
314 | } | 314 | } |
315 | EXPORT_SYMBOL_GPL(s390_enable_sie); | 315 | EXPORT_SYMBOL_GPL(s390_enable_sie); |
316 | 316 | ||
317 | #ifdef CONFIG_DEBUG_PAGEALLOC | 317 | #if defined(CONFIG_DEBUG_PAGEALLOC) && defined(CONFIG_HIBERNATION) |
318 | #ifdef CONFIG_HIBERNATION | ||
319 | bool kernel_page_present(struct page *page) | 318 | bool kernel_page_present(struct page *page) |
320 | { | 319 | { |
321 | unsigned long addr; | 320 | unsigned long addr; |
322 | int cc; | 321 | int cc; |
323 | 322 | ||
324 | addr = page_to_phys(page); | 323 | addr = page_to_phys(page); |
325 | asm("lra %1,0(%1)\n" | 324 | asm volatile( |
326 | "ipm %0\n" | 325 | " lra %1,0(%1)\n" |
327 | "srl %0,28" | 326 | " ipm %0\n" |
328 | :"=d"(cc),"+a"(addr)::"cc"); | 327 | " srl %0,28" |
328 | : "=d" (cc), "+a" (addr) : : "cc"); | ||
329 | return cc == 0; | 329 | return cc == 0; |
330 | } | 330 | } |
331 | 331 | #endif /* CONFIG_HIBERNATION && CONFIG_DEBUG_PAGEALLOC */ | |
332 | #endif /* CONFIG_HIBERNATION */ | ||
333 | #endif /* CONFIG_DEBUG_PAGEALLOC */ | ||
334 | |||
diff --git a/arch/score/include/asm/page.h b/arch/score/include/asm/page.h index ee5821042fcc..d92a5a2d36d4 100644 --- a/arch/score/include/asm/page.h +++ b/arch/score/include/asm/page.h | |||
@@ -2,10 +2,11 @@ | |||
2 | #define _ASM_SCORE_PAGE_H | 2 | #define _ASM_SCORE_PAGE_H |
3 | 3 | ||
4 | #include <linux/pfn.h> | 4 | #include <linux/pfn.h> |
5 | #include <linux/const.h> | ||
5 | 6 | ||
6 | /* PAGE_SHIFT determines the page size */ | 7 | /* PAGE_SHIFT determines the page size */ |
7 | #define PAGE_SHIFT (12) | 8 | #define PAGE_SHIFT (12) |
8 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 9 | #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) |
9 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 10 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
10 | 11 | ||
11 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h index 3a1122885528..55939992c27d 100644 --- a/arch/score/include/asm/thread_info.h +++ b/arch/score/include/asm/thread_info.h | |||
@@ -7,6 +7,15 @@ | |||
7 | #define KU_USER 0x08 | 7 | #define KU_USER 0x08 |
8 | #define KU_KERN 0x00 | 8 | #define KU_KERN 0x00 |
9 | 9 | ||
10 | #include <asm/page.h> | ||
11 | #include <linux/const.h> | ||
12 | |||
13 | /* thread information allocation */ | ||
14 | #define THREAD_SIZE_ORDER (1) | ||
15 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) | ||
16 | #define THREAD_MASK (THREAD_SIZE - _AC(1,UL)) | ||
17 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
18 | |||
10 | #ifndef __ASSEMBLY__ | 19 | #ifndef __ASSEMBLY__ |
11 | 20 | ||
12 | #include <asm/processor.h> | 21 | #include <asm/processor.h> |
@@ -62,12 +71,6 @@ struct thread_info { | |||
62 | register struct thread_info *__current_thread_info __asm__("r28"); | 71 | register struct thread_info *__current_thread_info __asm__("r28"); |
63 | #define current_thread_info() __current_thread_info | 72 | #define current_thread_info() __current_thread_info |
64 | 73 | ||
65 | /* thread information allocation */ | ||
66 | #define THREAD_SIZE_ORDER (1) | ||
67 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) | ||
68 | #define THREAD_MASK (THREAD_SIZE - 1UL) | ||
69 | #define __HAVE_ARCH_THREAD_INFO_ALLOCATOR | ||
70 | |||
71 | #define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL) | 74 | #define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL) |
72 | #define free_thread_info(info) kfree(info) | 75 | #define free_thread_info(info) kfree(info) |
73 | 76 | ||
diff --git a/arch/score/kernel/vmlinux.lds.S b/arch/score/kernel/vmlinux.lds.S index f85569831d5c..eebcbaa4e978 100644 --- a/arch/score/kernel/vmlinux.lds.S +++ b/arch/score/kernel/vmlinux.lds.S | |||
@@ -24,6 +24,8 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <asm-generic/vmlinux.lds.h> | 26 | #include <asm-generic/vmlinux.lds.h> |
27 | #include <asm/thread_info.h> | ||
28 | #include <asm/page.h> | ||
27 | 29 | ||
28 | OUTPUT_ARCH(score) | 30 | OUTPUT_ARCH(score) |
29 | ENTRY(_stext) | 31 | ENTRY(_stext) |
@@ -49,21 +51,9 @@ SECTIONS | |||
49 | . = ALIGN(16); | 51 | . = ALIGN(16); |
50 | RODATA | 52 | RODATA |
51 | 53 | ||
52 | /* Exception table */ | 54 | EXCEPTION_TABLE(16) |
53 | . = ALIGN(16); | ||
54 | __ex_table : { | ||
55 | __start___ex_table = .; | ||
56 | *(__ex_table) | ||
57 | __stop___ex_table = .; | ||
58 | } | ||
59 | 55 | ||
60 | /* writeable */ | 56 | RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) |
61 | .data ALIGN (4096): { | ||
62 | *(.data.init_task) | ||
63 | |||
64 | DATA_DATA | ||
65 | CONSTRUCTORS | ||
66 | } | ||
67 | 57 | ||
68 | /* We want the small data sections together, so single-instruction offsets | 58 | /* We want the small data sections together, so single-instruction offsets |
69 | can access them all, and initialized data all before uninitialized, so | 59 | can access them all, and initialized data all before uninitialized, so |
@@ -72,45 +62,14 @@ SECTIONS | |||
72 | .sdata : { | 62 | .sdata : { |
73 | *(.sdata) | 63 | *(.sdata) |
74 | } | 64 | } |
75 | |||
76 | . = ALIGN(32); | ||
77 | .data.cacheline_aligned : { | ||
78 | *(.data.cacheline_aligned) | ||
79 | } | ||
80 | _edata = .; /* End of data section */ | 65 | _edata = .; /* End of data section */ |
81 | 66 | ||
82 | /* will be freed after init */ | 67 | /* will be freed after init */ |
83 | . = ALIGN(4096); /* Init code and data */ | 68 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
84 | __init_begin = .; | 69 | __init_begin = .; |
85 | 70 | ||
86 | . = ALIGN(4096); | 71 | INIT_TEXT_SECTION(PAGE_SIZE) |
87 | .init.text : { | 72 | INIT_DATA_SECTION(16) |
88 | _sinittext = .; | ||
89 | INIT_TEXT | ||
90 | _einittext = .; | ||
91 | } | ||
92 | .init.data : { | ||
93 | INIT_DATA | ||
94 | } | ||
95 | . = ALIGN(16); | ||
96 | .init.setup : { | ||
97 | __setup_start = .; | ||
98 | *(.init.setup) | ||
99 | __setup_end = .; | ||
100 | } | ||
101 | |||
102 | .initcall.init : { | ||
103 | __initcall_start = .; | ||
104 | INITCALLS | ||
105 | __initcall_end = .; | ||
106 | } | ||
107 | |||
108 | .con_initcall.init : { | ||
109 | __con_initcall_start = .; | ||
110 | *(.con_initcall.init) | ||
111 | __con_initcall_end = .; | ||
112 | } | ||
113 | SECURITY_INIT | ||
114 | 73 | ||
115 | /* .exit.text is discarded at runtime, not link time, to deal with | 74 | /* .exit.text is discarded at runtime, not link time, to deal with |
116 | * references from .rodata | 75 | * references from .rodata |
@@ -121,28 +80,10 @@ SECTIONS | |||
121 | .exit.data : { | 80 | .exit.data : { |
122 | EXIT_DATA | 81 | EXIT_DATA |
123 | } | 82 | } |
124 | #if defined(CONFIG_BLK_DEV_INITRD) | 83 | . = ALIGN(PAGE_SIZE); |
125 | .init.ramfs ALIGN(4096): { | ||
126 | __initramfs_start = .; | ||
127 | *(.init.ramfs) | ||
128 | __initramfs_end = .; | ||
129 | . = ALIGN(4); | ||
130 | LONG(0); | ||
131 | } | ||
132 | #endif | ||
133 | . = ALIGN(4096); | ||
134 | __init_end = .; | 84 | __init_end = .; |
135 | /* freed after init ends here */ | 85 | /* freed after init ends here */ |
136 | 86 | ||
137 | __bss_start = .; /* BSS */ | 87 | BSS_SECTION(0, 0, 0) |
138 | .sbss : { | ||
139 | *(.sbss) | ||
140 | *(.scommon) | ||
141 | } | ||
142 | .bss : { | ||
143 | *(.bss) | ||
144 | *(COMMON) | ||
145 | } | ||
146 | __bss_stop = .; | ||
147 | _end = .; | 88 | _end = .; |
148 | } | 89 | } |
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index fabb7c6f48d2..8173e38afd38 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -186,8 +186,6 @@ void __init paging_init(void) | |||
186 | set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start)); | 186 | set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start)); |
187 | } | 187 | } |
188 | 188 | ||
189 | static struct kcore_list kcore_mem, kcore_vmalloc; | ||
190 | |||
191 | void __init mem_init(void) | 189 | void __init mem_init(void) |
192 | { | 190 | { |
193 | int codesize, datasize, initsize; | 191 | int codesize, datasize, initsize; |
@@ -226,10 +224,6 @@ void __init mem_init(void) | |||
226 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 224 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; |
227 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | 225 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; |
228 | 226 | ||
229 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); | ||
230 | kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, | ||
231 | VMALLOC_END - VMALLOC_START); | ||
232 | |||
233 | printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, " | 227 | printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, " |
234 | "%dk data, %dk init)\n", | 228 | "%dk data, %dk init)\n", |
235 | nr_free_pages() << (PAGE_SHIFT-10), | 229 | nr_free_pages() << (PAGE_SHIFT-10), |
diff --git a/arch/sparc/include/asm/vio.h b/arch/sparc/include/asm/vio.h index d4de32f0f8af..6cdbf7e7351d 100644 --- a/arch/sparc/include/asm/vio.h +++ b/arch/sparc/include/asm/vio.h | |||
@@ -258,7 +258,7 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr, | |||
258 | static inline u32 vio_dring_avail(struct vio_dring_state *dr, | 258 | static inline u32 vio_dring_avail(struct vio_dring_state *dr, |
259 | unsigned int ring_size) | 259 | unsigned int ring_size) |
260 | { | 260 | { |
261 | BUILD_BUG_ON(!is_power_of_2(ring_size)); | 261 | MAYBE_BUILD_BUG_ON(!is_power_of_2(ring_size)); |
262 | 262 | ||
263 | return (dr->pending - | 263 | return (dr->pending - |
264 | ((dr->prod - dr->cons) & (ring_size - 1))); | 264 | ((dr->prod - dr->cons) & (ring_size - 1))); |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e4ff5d1280ca..93698794aa3a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1204,6 +1204,10 @@ config ARCH_DISCONTIGMEM_DEFAULT | |||
1204 | def_bool y | 1204 | def_bool y |
1205 | depends on NUMA && X86_32 | 1205 | depends on NUMA && X86_32 |
1206 | 1206 | ||
1207 | config ARCH_PROC_KCORE_TEXT | ||
1208 | def_bool y | ||
1209 | depends on X86_64 && PROC_KCORE | ||
1210 | |||
1207 | config ARCH_SPARSEMEM_DEFAULT | 1211 | config ARCH_SPARSEMEM_DEFAULT |
1208 | def_bool y | 1212 | def_bool y |
1209 | depends on X86_64 | 1213 | depends on X86_64 |
@@ -1662,6 +1666,8 @@ source "kernel/power/Kconfig" | |||
1662 | 1666 | ||
1663 | source "drivers/acpi/Kconfig" | 1667 | source "drivers/acpi/Kconfig" |
1664 | 1668 | ||
1669 | source "drivers/sfi/Kconfig" | ||
1670 | |||
1665 | config X86_APM_BOOT | 1671 | config X86_APM_BOOT |
1666 | bool | 1672 | bool |
1667 | default y | 1673 | default y |
@@ -1857,7 +1863,7 @@ config PCI_DIRECT | |||
1857 | 1863 | ||
1858 | config PCI_MMCONFIG | 1864 | config PCI_MMCONFIG |
1859 | def_bool y | 1865 | def_bool y |
1860 | depends on X86_32 && PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY) | 1866 | depends on X86_32 && PCI && (ACPI || SFI) && (PCI_GOMMCONFIG || PCI_GOANY) |
1861 | 1867 | ||
1862 | config PCI_OLPC | 1868 | config PCI_OLPC |
1863 | def_bool y | 1869 | def_bool y |
@@ -1895,7 +1901,7 @@ config DMAR_DEFAULT_ON | |||
1895 | config DMAR_BROKEN_GFX_WA | 1901 | config DMAR_BROKEN_GFX_WA |
1896 | def_bool n | 1902 | def_bool n |
1897 | prompt "Workaround broken graphics drivers (going away soon)" | 1903 | prompt "Workaround broken graphics drivers (going away soon)" |
1898 | depends on DMAR | 1904 | depends on DMAR && BROKEN |
1899 | ---help--- | 1905 | ---help--- |
1900 | Current Graphics drivers tend to use physical address | 1906 | Current Graphics drivers tend to use physical address |
1901 | for DMA and avoid using DMA APIs. Setting this config | 1907 | for DMA and avoid using DMA APIs. Setting this config |
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 20d1465a2ab0..4518dc500903 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h | |||
@@ -144,7 +144,6 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate) | |||
144 | 144 | ||
145 | #else /* !CONFIG_ACPI */ | 145 | #else /* !CONFIG_ACPI */ |
146 | 146 | ||
147 | #define acpi_disabled 1 | ||
148 | #define acpi_lapic 0 | 147 | #define acpi_lapic 0 |
149 | #define acpi_ioapic 0 | 148 | #define acpi_ioapic 0 |
150 | static inline void acpi_noirq_set(void) { } | 149 | static inline void acpi_noirq_set(void) { } |
diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h index d82f39bb7905..8d33bc5462d1 100644 --- a/arch/x86/include/asm/syscall.h +++ b/arch/x86/include/asm/syscall.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Access to user system call parameters and results | 2 | * Access to user system call parameters and results |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | 4 | * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. |
5 | * | 5 | * |
6 | * This copyrighted material is made available to anyone wishing to use, | 6 | * This copyrighted material is made available to anyone wishing to use, |
7 | * modify, copy, or redistribute it subject to the terms and conditions | 7 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -16,13 +16,13 @@ | |||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | 18 | ||
19 | static inline long syscall_get_nr(struct task_struct *task, | 19 | /* |
20 | struct pt_regs *regs) | 20 | * Only the low 32 bits of orig_ax are meaningful, so we return int. |
21 | * This importantly ignores the high bits on 64-bit, so comparisons | ||
22 | * sign-extend the low 32 bits. | ||
23 | */ | ||
24 | static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) | ||
21 | { | 25 | { |
22 | /* | ||
23 | * We always sign-extend a -1 value being set here, | ||
24 | * so this is always either -1L or a syscall number. | ||
25 | */ | ||
26 | return regs->orig_ax; | 26 | return regs->orig_ax; |
27 | } | 27 | } |
28 | 28 | ||
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 4ba419b668a5..d8e5d0cdd678 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -56,6 +56,7 @@ obj-$(CONFIG_INTEL_TXT) += tboot.o | |||
56 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 56 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
57 | obj-y += cpu/ | 57 | obj-y += cpu/ |
58 | obj-y += acpi/ | 58 | obj-y += acpi/ |
59 | obj-$(CONFIG_SFI) += sfi.o | ||
59 | obj-y += reboot.o | 60 | obj-y += reboot.o |
60 | obj-$(CONFIG_MCA) += mca_32.o | 61 | obj-$(CONFIG_MCA) += mca_32.o |
61 | obj-$(CONFIG_X86_MSR) += msr.o | 62 | obj-$(CONFIG_X86_MSR) += msr.o |
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index b11cab3c323a..2acfd3fdc0cc 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c | |||
@@ -160,721 +160,6 @@ static struct console early_serial_console = { | |||
160 | .index = -1, | 160 | .index = -1, |
161 | }; | 161 | }; |
162 | 162 | ||
163 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
164 | |||
165 | static struct ehci_caps __iomem *ehci_caps; | ||
166 | static struct ehci_regs __iomem *ehci_regs; | ||
167 | static struct ehci_dbg_port __iomem *ehci_debug; | ||
168 | static unsigned int dbgp_endpoint_out; | ||
169 | |||
170 | struct ehci_dev { | ||
171 | u32 bus; | ||
172 | u32 slot; | ||
173 | u32 func; | ||
174 | }; | ||
175 | |||
176 | static struct ehci_dev ehci_dev; | ||
177 | |||
178 | #define USB_DEBUG_DEVNUM 127 | ||
179 | |||
180 | #define DBGP_DATA_TOGGLE 0x8800 | ||
181 | |||
182 | static inline u32 dbgp_pid_update(u32 x, u32 tok) | ||
183 | { | ||
184 | return ((x ^ DBGP_DATA_TOGGLE) & 0xffff00) | (tok & 0xff); | ||
185 | } | ||
186 | |||
187 | static inline u32 dbgp_len_update(u32 x, u32 len) | ||
188 | { | ||
189 | return (x & ~0x0f) | (len & 0x0f); | ||
190 | } | ||
191 | |||
192 | /* | ||
193 | * USB Packet IDs (PIDs) | ||
194 | */ | ||
195 | |||
196 | /* token */ | ||
197 | #define USB_PID_OUT 0xe1 | ||
198 | #define USB_PID_IN 0x69 | ||
199 | #define USB_PID_SOF 0xa5 | ||
200 | #define USB_PID_SETUP 0x2d | ||
201 | /* handshake */ | ||
202 | #define USB_PID_ACK 0xd2 | ||
203 | #define USB_PID_NAK 0x5a | ||
204 | #define USB_PID_STALL 0x1e | ||
205 | #define USB_PID_NYET 0x96 | ||
206 | /* data */ | ||
207 | #define USB_PID_DATA0 0xc3 | ||
208 | #define USB_PID_DATA1 0x4b | ||
209 | #define USB_PID_DATA2 0x87 | ||
210 | #define USB_PID_MDATA 0x0f | ||
211 | /* Special */ | ||
212 | #define USB_PID_PREAMBLE 0x3c | ||
213 | #define USB_PID_ERR 0x3c | ||
214 | #define USB_PID_SPLIT 0x78 | ||
215 | #define USB_PID_PING 0xb4 | ||
216 | #define USB_PID_UNDEF_0 0xf0 | ||
217 | |||
218 | #define USB_PID_DATA_TOGGLE 0x88 | ||
219 | #define DBGP_CLAIM (DBGP_OWNER | DBGP_ENABLED | DBGP_INUSE) | ||
220 | |||
221 | #define PCI_CAP_ID_EHCI_DEBUG 0xa | ||
222 | |||
223 | #define HUB_ROOT_RESET_TIME 50 /* times are in msec */ | ||
224 | #define HUB_SHORT_RESET_TIME 10 | ||
225 | #define HUB_LONG_RESET_TIME 200 | ||
226 | #define HUB_RESET_TIMEOUT 500 | ||
227 | |||
228 | #define DBGP_MAX_PACKET 8 | ||
229 | |||
230 | static int dbgp_wait_until_complete(void) | ||
231 | { | ||
232 | u32 ctrl; | ||
233 | int loop = 0x100000; | ||
234 | |||
235 | do { | ||
236 | ctrl = readl(&ehci_debug->control); | ||
237 | /* Stop when the transaction is finished */ | ||
238 | if (ctrl & DBGP_DONE) | ||
239 | break; | ||
240 | } while (--loop > 0); | ||
241 | |||
242 | if (!loop) | ||
243 | return -1; | ||
244 | |||
245 | /* | ||
246 | * Now that we have observed the completed transaction, | ||
247 | * clear the done bit. | ||
248 | */ | ||
249 | writel(ctrl | DBGP_DONE, &ehci_debug->control); | ||
250 | return (ctrl & DBGP_ERROR) ? -DBGP_ERRCODE(ctrl) : DBGP_LEN(ctrl); | ||
251 | } | ||
252 | |||
253 | static void __init dbgp_mdelay(int ms) | ||
254 | { | ||
255 | int i; | ||
256 | |||
257 | while (ms--) { | ||
258 | for (i = 0; i < 1000; i++) | ||
259 | outb(0x1, 0x80); | ||
260 | } | ||
261 | } | ||
262 | |||
263 | static void dbgp_breath(void) | ||
264 | { | ||
265 | /* Sleep to give the debug port a chance to breathe */ | ||
266 | } | ||
267 | |||
268 | static int dbgp_wait_until_done(unsigned ctrl) | ||
269 | { | ||
270 | u32 pids, lpid; | ||
271 | int ret; | ||
272 | int loop = 3; | ||
273 | |||
274 | retry: | ||
275 | writel(ctrl | DBGP_GO, &ehci_debug->control); | ||
276 | ret = dbgp_wait_until_complete(); | ||
277 | pids = readl(&ehci_debug->pids); | ||
278 | lpid = DBGP_PID_GET(pids); | ||
279 | |||
280 | if (ret < 0) | ||
281 | return ret; | ||
282 | |||
283 | /* | ||
284 | * If the port is getting full or it has dropped data | ||
285 | * start pacing ourselves, not necessary but it's friendly. | ||
286 | */ | ||
287 | if ((lpid == USB_PID_NAK) || (lpid == USB_PID_NYET)) | ||
288 | dbgp_breath(); | ||
289 | |||
290 | /* If I get a NACK reissue the transmission */ | ||
291 | if (lpid == USB_PID_NAK) { | ||
292 | if (--loop > 0) | ||
293 | goto retry; | ||
294 | } | ||
295 | |||
296 | return ret; | ||
297 | } | ||
298 | |||
299 | static void dbgp_set_data(const void *buf, int size) | ||
300 | { | ||
301 | const unsigned char *bytes = buf; | ||
302 | u32 lo, hi; | ||
303 | int i; | ||
304 | |||
305 | lo = hi = 0; | ||
306 | for (i = 0; i < 4 && i < size; i++) | ||
307 | lo |= bytes[i] << (8*i); | ||
308 | for (; i < 8 && i < size; i++) | ||
309 | hi |= bytes[i] << (8*(i - 4)); | ||
310 | writel(lo, &ehci_debug->data03); | ||
311 | writel(hi, &ehci_debug->data47); | ||
312 | } | ||
313 | |||
314 | static void __init dbgp_get_data(void *buf, int size) | ||
315 | { | ||
316 | unsigned char *bytes = buf; | ||
317 | u32 lo, hi; | ||
318 | int i; | ||
319 | |||
320 | lo = readl(&ehci_debug->data03); | ||
321 | hi = readl(&ehci_debug->data47); | ||
322 | for (i = 0; i < 4 && i < size; i++) | ||
323 | bytes[i] = (lo >> (8*i)) & 0xff; | ||
324 | for (; i < 8 && i < size; i++) | ||
325 | bytes[i] = (hi >> (8*(i - 4))) & 0xff; | ||
326 | } | ||
327 | |||
328 | static int dbgp_bulk_write(unsigned devnum, unsigned endpoint, | ||
329 | const char *bytes, int size) | ||
330 | { | ||
331 | u32 pids, addr, ctrl; | ||
332 | int ret; | ||
333 | |||
334 | if (size > DBGP_MAX_PACKET) | ||
335 | return -1; | ||
336 | |||
337 | addr = DBGP_EPADDR(devnum, endpoint); | ||
338 | |||
339 | pids = readl(&ehci_debug->pids); | ||
340 | pids = dbgp_pid_update(pids, USB_PID_OUT); | ||
341 | |||
342 | ctrl = readl(&ehci_debug->control); | ||
343 | ctrl = dbgp_len_update(ctrl, size); | ||
344 | ctrl |= DBGP_OUT; | ||
345 | ctrl |= DBGP_GO; | ||
346 | |||
347 | dbgp_set_data(bytes, size); | ||
348 | writel(addr, &ehci_debug->address); | ||
349 | writel(pids, &ehci_debug->pids); | ||
350 | |||
351 | ret = dbgp_wait_until_done(ctrl); | ||
352 | if (ret < 0) | ||
353 | return ret; | ||
354 | |||
355 | return ret; | ||
356 | } | ||
357 | |||
358 | static int __init dbgp_bulk_read(unsigned devnum, unsigned endpoint, void *data, | ||
359 | int size) | ||
360 | { | ||
361 | u32 pids, addr, ctrl; | ||
362 | int ret; | ||
363 | |||
364 | if (size > DBGP_MAX_PACKET) | ||
365 | return -1; | ||
366 | |||
367 | addr = DBGP_EPADDR(devnum, endpoint); | ||
368 | |||
369 | pids = readl(&ehci_debug->pids); | ||
370 | pids = dbgp_pid_update(pids, USB_PID_IN); | ||
371 | |||
372 | ctrl = readl(&ehci_debug->control); | ||
373 | ctrl = dbgp_len_update(ctrl, size); | ||
374 | ctrl &= ~DBGP_OUT; | ||
375 | ctrl |= DBGP_GO; | ||
376 | |||
377 | writel(addr, &ehci_debug->address); | ||
378 | writel(pids, &ehci_debug->pids); | ||
379 | ret = dbgp_wait_until_done(ctrl); | ||
380 | if (ret < 0) | ||
381 | return ret; | ||
382 | |||
383 | if (size > ret) | ||
384 | size = ret; | ||
385 | dbgp_get_data(data, size); | ||
386 | return ret; | ||
387 | } | ||
388 | |||
389 | static int __init dbgp_control_msg(unsigned devnum, int requesttype, | ||
390 | int request, int value, int index, void *data, int size) | ||
391 | { | ||
392 | u32 pids, addr, ctrl; | ||
393 | struct usb_ctrlrequest req; | ||
394 | int read; | ||
395 | int ret; | ||
396 | |||
397 | read = (requesttype & USB_DIR_IN) != 0; | ||
398 | if (size > (read ? DBGP_MAX_PACKET:0)) | ||
399 | return -1; | ||
400 | |||
401 | /* Compute the control message */ | ||
402 | req.bRequestType = requesttype; | ||
403 | req.bRequest = request; | ||
404 | req.wValue = cpu_to_le16(value); | ||
405 | req.wIndex = cpu_to_le16(index); | ||
406 | req.wLength = cpu_to_le16(size); | ||
407 | |||
408 | pids = DBGP_PID_SET(USB_PID_DATA0, USB_PID_SETUP); | ||
409 | addr = DBGP_EPADDR(devnum, 0); | ||
410 | |||
411 | ctrl = readl(&ehci_debug->control); | ||
412 | ctrl = dbgp_len_update(ctrl, sizeof(req)); | ||
413 | ctrl |= DBGP_OUT; | ||
414 | ctrl |= DBGP_GO; | ||
415 | |||
416 | /* Send the setup message */ | ||
417 | dbgp_set_data(&req, sizeof(req)); | ||
418 | writel(addr, &ehci_debug->address); | ||
419 | writel(pids, &ehci_debug->pids); | ||
420 | ret = dbgp_wait_until_done(ctrl); | ||
421 | if (ret < 0) | ||
422 | return ret; | ||
423 | |||
424 | /* Read the result */ | ||
425 | return dbgp_bulk_read(devnum, 0, data, size); | ||
426 | } | ||
427 | |||
428 | |||
429 | /* Find a PCI capability */ | ||
430 | static u32 __init find_cap(u32 num, u32 slot, u32 func, int cap) | ||
431 | { | ||
432 | u8 pos; | ||
433 | int bytes; | ||
434 | |||
435 | if (!(read_pci_config_16(num, slot, func, PCI_STATUS) & | ||
436 | PCI_STATUS_CAP_LIST)) | ||
437 | return 0; | ||
438 | |||
439 | pos = read_pci_config_byte(num, slot, func, PCI_CAPABILITY_LIST); | ||
440 | for (bytes = 0; bytes < 48 && pos >= 0x40; bytes++) { | ||
441 | u8 id; | ||
442 | |||
443 | pos &= ~3; | ||
444 | id = read_pci_config_byte(num, slot, func, pos+PCI_CAP_LIST_ID); | ||
445 | if (id == 0xff) | ||
446 | break; | ||
447 | if (id == cap) | ||
448 | return pos; | ||
449 | |||
450 | pos = read_pci_config_byte(num, slot, func, | ||
451 | pos+PCI_CAP_LIST_NEXT); | ||
452 | } | ||
453 | return 0; | ||
454 | } | ||
455 | |||
456 | static u32 __init __find_dbgp(u32 bus, u32 slot, u32 func) | ||
457 | { | ||
458 | u32 class; | ||
459 | |||
460 | class = read_pci_config(bus, slot, func, PCI_CLASS_REVISION); | ||
461 | if ((class >> 8) != PCI_CLASS_SERIAL_USB_EHCI) | ||
462 | return 0; | ||
463 | |||
464 | return find_cap(bus, slot, func, PCI_CAP_ID_EHCI_DEBUG); | ||
465 | } | ||
466 | |||
467 | static u32 __init find_dbgp(int ehci_num, u32 *rbus, u32 *rslot, u32 *rfunc) | ||
468 | { | ||
469 | u32 bus, slot, func; | ||
470 | |||
471 | for (bus = 0; bus < 256; bus++) { | ||
472 | for (slot = 0; slot < 32; slot++) { | ||
473 | for (func = 0; func < 8; func++) { | ||
474 | unsigned cap; | ||
475 | |||
476 | cap = __find_dbgp(bus, slot, func); | ||
477 | |||
478 | if (!cap) | ||
479 | continue; | ||
480 | if (ehci_num-- != 0) | ||
481 | continue; | ||
482 | *rbus = bus; | ||
483 | *rslot = slot; | ||
484 | *rfunc = func; | ||
485 | return cap; | ||
486 | } | ||
487 | } | ||
488 | } | ||
489 | return 0; | ||
490 | } | ||
491 | |||
492 | static int __init ehci_reset_port(int port) | ||
493 | { | ||
494 | u32 portsc; | ||
495 | u32 delay_time, delay; | ||
496 | int loop; | ||
497 | |||
498 | /* Reset the usb debug port */ | ||
499 | portsc = readl(&ehci_regs->port_status[port - 1]); | ||
500 | portsc &= ~PORT_PE; | ||
501 | portsc |= PORT_RESET; | ||
502 | writel(portsc, &ehci_regs->port_status[port - 1]); | ||
503 | |||
504 | delay = HUB_ROOT_RESET_TIME; | ||
505 | for (delay_time = 0; delay_time < HUB_RESET_TIMEOUT; | ||
506 | delay_time += delay) { | ||
507 | dbgp_mdelay(delay); | ||
508 | |||
509 | portsc = readl(&ehci_regs->port_status[port - 1]); | ||
510 | if (portsc & PORT_RESET) { | ||
511 | /* force reset to complete */ | ||
512 | loop = 2; | ||
513 | writel(portsc & ~(PORT_RWC_BITS | PORT_RESET), | ||
514 | &ehci_regs->port_status[port - 1]); | ||
515 | do { | ||
516 | portsc = readl(&ehci_regs->port_status[port-1]); | ||
517 | } while ((portsc & PORT_RESET) && (--loop > 0)); | ||
518 | } | ||
519 | |||
520 | /* Device went away? */ | ||
521 | if (!(portsc & PORT_CONNECT)) | ||
522 | return -ENOTCONN; | ||
523 | |||
524 | /* bomb out completely if something weird happend */ | ||
525 | if ((portsc & PORT_CSC)) | ||
526 | return -EINVAL; | ||
527 | |||
528 | /* If we've finished resetting, then break out of the loop */ | ||
529 | if (!(portsc & PORT_RESET) && (portsc & PORT_PE)) | ||
530 | return 0; | ||
531 | } | ||
532 | return -EBUSY; | ||
533 | } | ||
534 | |||
535 | static int __init ehci_wait_for_port(int port) | ||
536 | { | ||
537 | u32 status; | ||
538 | int ret, reps; | ||
539 | |||
540 | for (reps = 0; reps < 3; reps++) { | ||
541 | dbgp_mdelay(100); | ||
542 | status = readl(&ehci_regs->status); | ||
543 | if (status & STS_PCD) { | ||
544 | ret = ehci_reset_port(port); | ||
545 | if (ret == 0) | ||
546 | return 0; | ||
547 | } | ||
548 | } | ||
549 | return -ENOTCONN; | ||
550 | } | ||
551 | |||
552 | #ifdef DBGP_DEBUG | ||
553 | # define dbgp_printk early_printk | ||
554 | #else | ||
555 | static inline void dbgp_printk(const char *fmt, ...) { } | ||
556 | #endif | ||
557 | |||
558 | typedef void (*set_debug_port_t)(int port); | ||
559 | |||
560 | static void __init default_set_debug_port(int port) | ||
561 | { | ||
562 | } | ||
563 | |||
564 | static set_debug_port_t __initdata set_debug_port = default_set_debug_port; | ||
565 | |||
566 | static void __init nvidia_set_debug_port(int port) | ||
567 | { | ||
568 | u32 dword; | ||
569 | dword = read_pci_config(ehci_dev.bus, ehci_dev.slot, ehci_dev.func, | ||
570 | 0x74); | ||
571 | dword &= ~(0x0f<<12); | ||
572 | dword |= ((port & 0x0f)<<12); | ||
573 | write_pci_config(ehci_dev.bus, ehci_dev.slot, ehci_dev.func, 0x74, | ||
574 | dword); | ||
575 | dbgp_printk("set debug port to %d\n", port); | ||
576 | } | ||
577 | |||
578 | static void __init detect_set_debug_port(void) | ||
579 | { | ||
580 | u32 vendorid; | ||
581 | |||
582 | vendorid = read_pci_config(ehci_dev.bus, ehci_dev.slot, ehci_dev.func, | ||
583 | 0x00); | ||
584 | |||
585 | if ((vendorid & 0xffff) == 0x10de) { | ||
586 | dbgp_printk("using nvidia set_debug_port\n"); | ||
587 | set_debug_port = nvidia_set_debug_port; | ||
588 | } | ||
589 | } | ||
590 | |||
591 | static int __init ehci_setup(void) | ||
592 | { | ||
593 | struct usb_debug_descriptor dbgp_desc; | ||
594 | u32 cmd, ctrl, status, portsc, hcs_params; | ||
595 | u32 debug_port, new_debug_port = 0, n_ports; | ||
596 | u32 devnum; | ||
597 | int ret, i; | ||
598 | int loop; | ||
599 | int port_map_tried; | ||
600 | int playtimes = 3; | ||
601 | |||
602 | try_next_time: | ||
603 | port_map_tried = 0; | ||
604 | |||
605 | try_next_port: | ||
606 | |||
607 | hcs_params = readl(&ehci_caps->hcs_params); | ||
608 | debug_port = HCS_DEBUG_PORT(hcs_params); | ||
609 | n_ports = HCS_N_PORTS(hcs_params); | ||
610 | |||
611 | dbgp_printk("debug_port: %d\n", debug_port); | ||
612 | dbgp_printk("n_ports: %d\n", n_ports); | ||
613 | |||
614 | for (i = 1; i <= n_ports; i++) { | ||
615 | portsc = readl(&ehci_regs->port_status[i-1]); | ||
616 | dbgp_printk("portstatus%d: %08x\n", i, portsc); | ||
617 | } | ||
618 | |||
619 | if (port_map_tried && (new_debug_port != debug_port)) { | ||
620 | if (--playtimes) { | ||
621 | set_debug_port(new_debug_port); | ||
622 | goto try_next_time; | ||
623 | } | ||
624 | return -1; | ||
625 | } | ||
626 | |||
627 | loop = 100000; | ||
628 | /* Reset the EHCI controller */ | ||
629 | cmd = readl(&ehci_regs->command); | ||
630 | cmd |= CMD_RESET; | ||
631 | writel(cmd, &ehci_regs->command); | ||
632 | do { | ||
633 | cmd = readl(&ehci_regs->command); | ||
634 | } while ((cmd & CMD_RESET) && (--loop > 0)); | ||
635 | |||
636 | if (!loop) { | ||
637 | dbgp_printk("can not reset ehci\n"); | ||
638 | return -1; | ||
639 | } | ||
640 | dbgp_printk("ehci reset done\n"); | ||
641 | |||
642 | /* Claim ownership, but do not enable yet */ | ||
643 | ctrl = readl(&ehci_debug->control); | ||
644 | ctrl |= DBGP_OWNER; | ||
645 | ctrl &= ~(DBGP_ENABLED | DBGP_INUSE); | ||
646 | writel(ctrl, &ehci_debug->control); | ||
647 | |||
648 | /* Start the ehci running */ | ||
649 | cmd = readl(&ehci_regs->command); | ||
650 | cmd &= ~(CMD_LRESET | CMD_IAAD | CMD_PSE | CMD_ASE | CMD_RESET); | ||
651 | cmd |= CMD_RUN; | ||
652 | writel(cmd, &ehci_regs->command); | ||
653 | |||
654 | /* Ensure everything is routed to the EHCI */ | ||
655 | writel(FLAG_CF, &ehci_regs->configured_flag); | ||
656 | |||
657 | /* Wait until the controller is no longer halted */ | ||
658 | loop = 10; | ||
659 | do { | ||
660 | status = readl(&ehci_regs->status); | ||
661 | } while ((status & STS_HALT) && (--loop > 0)); | ||
662 | |||
663 | if (!loop) { | ||
664 | dbgp_printk("ehci can be started\n"); | ||
665 | return -1; | ||
666 | } | ||
667 | dbgp_printk("ehci started\n"); | ||
668 | |||
669 | /* Wait for a device to show up in the debug port */ | ||
670 | ret = ehci_wait_for_port(debug_port); | ||
671 | if (ret < 0) { | ||
672 | dbgp_printk("No device found in debug port\n"); | ||
673 | goto next_debug_port; | ||
674 | } | ||
675 | dbgp_printk("ehci wait for port done\n"); | ||
676 | |||
677 | /* Enable the debug port */ | ||
678 | ctrl = readl(&ehci_debug->control); | ||
679 | ctrl |= DBGP_CLAIM; | ||
680 | writel(ctrl, &ehci_debug->control); | ||
681 | ctrl = readl(&ehci_debug->control); | ||
682 | if ((ctrl & DBGP_CLAIM) != DBGP_CLAIM) { | ||
683 | dbgp_printk("No device in debug port\n"); | ||
684 | writel(ctrl & ~DBGP_CLAIM, &ehci_debug->control); | ||
685 | goto err; | ||
686 | } | ||
687 | dbgp_printk("debug ported enabled\n"); | ||
688 | |||
689 | /* Completely transfer the debug device to the debug controller */ | ||
690 | portsc = readl(&ehci_regs->port_status[debug_port - 1]); | ||
691 | portsc &= ~PORT_PE; | ||
692 | writel(portsc, &ehci_regs->port_status[debug_port - 1]); | ||
693 | |||
694 | dbgp_mdelay(100); | ||
695 | |||
696 | /* Find the debug device and make it device number 127 */ | ||
697 | for (devnum = 0; devnum <= 127; devnum++) { | ||
698 | ret = dbgp_control_msg(devnum, | ||
699 | USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE, | ||
700 | USB_REQ_GET_DESCRIPTOR, (USB_DT_DEBUG << 8), 0, | ||
701 | &dbgp_desc, sizeof(dbgp_desc)); | ||
702 | if (ret > 0) | ||
703 | break; | ||
704 | } | ||
705 | if (devnum > 127) { | ||
706 | dbgp_printk("Could not find attached debug device\n"); | ||
707 | goto err; | ||
708 | } | ||
709 | if (ret < 0) { | ||
710 | dbgp_printk("Attached device is not a debug device\n"); | ||
711 | goto err; | ||
712 | } | ||
713 | dbgp_endpoint_out = dbgp_desc.bDebugOutEndpoint; | ||
714 | |||
715 | /* Move the device to 127 if it isn't already there */ | ||
716 | if (devnum != USB_DEBUG_DEVNUM) { | ||
717 | ret = dbgp_control_msg(devnum, | ||
718 | USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE, | ||
719 | USB_REQ_SET_ADDRESS, USB_DEBUG_DEVNUM, 0, NULL, 0); | ||
720 | if (ret < 0) { | ||
721 | dbgp_printk("Could not move attached device to %d\n", | ||
722 | USB_DEBUG_DEVNUM); | ||
723 | goto err; | ||
724 | } | ||
725 | devnum = USB_DEBUG_DEVNUM; | ||
726 | dbgp_printk("debug device renamed to 127\n"); | ||
727 | } | ||
728 | |||
729 | /* Enable the debug interface */ | ||
730 | ret = dbgp_control_msg(USB_DEBUG_DEVNUM, | ||
731 | USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE, | ||
732 | USB_REQ_SET_FEATURE, USB_DEVICE_DEBUG_MODE, 0, NULL, 0); | ||
733 | if (ret < 0) { | ||
734 | dbgp_printk(" Could not enable the debug device\n"); | ||
735 | goto err; | ||
736 | } | ||
737 | dbgp_printk("debug interface enabled\n"); | ||
738 | |||
739 | /* Perform a small write to get the even/odd data state in sync | ||
740 | */ | ||
741 | ret = dbgp_bulk_write(USB_DEBUG_DEVNUM, dbgp_endpoint_out, " ", 1); | ||
742 | if (ret < 0) { | ||
743 | dbgp_printk("dbgp_bulk_write failed: %d\n", ret); | ||
744 | goto err; | ||
745 | } | ||
746 | dbgp_printk("small write doned\n"); | ||
747 | |||
748 | return 0; | ||
749 | err: | ||
750 | /* Things didn't work so remove my claim */ | ||
751 | ctrl = readl(&ehci_debug->control); | ||
752 | ctrl &= ~(DBGP_CLAIM | DBGP_OUT); | ||
753 | writel(ctrl, &ehci_debug->control); | ||
754 | return -1; | ||
755 | |||
756 | next_debug_port: | ||
757 | port_map_tried |= (1<<(debug_port - 1)); | ||
758 | new_debug_port = ((debug_port-1+1)%n_ports) + 1; | ||
759 | if (port_map_tried != ((1<<n_ports) - 1)) { | ||
760 | set_debug_port(new_debug_port); | ||
761 | goto try_next_port; | ||
762 | } | ||
763 | if (--playtimes) { | ||
764 | set_debug_port(new_debug_port); | ||
765 | goto try_next_time; | ||
766 | } | ||
767 | |||
768 | return -1; | ||
769 | } | ||
770 | |||
771 | static int __init early_dbgp_init(char *s) | ||
772 | { | ||
773 | u32 debug_port, bar, offset; | ||
774 | u32 bus, slot, func, cap; | ||
775 | void __iomem *ehci_bar; | ||
776 | u32 dbgp_num; | ||
777 | u32 bar_val; | ||
778 | char *e; | ||
779 | int ret; | ||
780 | u8 byte; | ||
781 | |||
782 | if (!early_pci_allowed()) | ||
783 | return -1; | ||
784 | |||
785 | dbgp_num = 0; | ||
786 | if (*s) | ||
787 | dbgp_num = simple_strtoul(s, &e, 10); | ||
788 | dbgp_printk("dbgp_num: %d\n", dbgp_num); | ||
789 | |||
790 | cap = find_dbgp(dbgp_num, &bus, &slot, &func); | ||
791 | if (!cap) | ||
792 | return -1; | ||
793 | |||
794 | dbgp_printk("Found EHCI debug port on %02x:%02x.%1x\n", bus, slot, | ||
795 | func); | ||
796 | |||
797 | debug_port = read_pci_config(bus, slot, func, cap); | ||
798 | bar = (debug_port >> 29) & 0x7; | ||
799 | bar = (bar * 4) + 0xc; | ||
800 | offset = (debug_port >> 16) & 0xfff; | ||
801 | dbgp_printk("bar: %02x offset: %03x\n", bar, offset); | ||
802 | if (bar != PCI_BASE_ADDRESS_0) { | ||
803 | dbgp_printk("only debug ports on bar 1 handled.\n"); | ||
804 | |||
805 | return -1; | ||
806 | } | ||
807 | |||
808 | bar_val = read_pci_config(bus, slot, func, PCI_BASE_ADDRESS_0); | ||
809 | dbgp_printk("bar_val: %02x offset: %03x\n", bar_val, offset); | ||
810 | if (bar_val & ~PCI_BASE_ADDRESS_MEM_MASK) { | ||
811 | dbgp_printk("only simple 32bit mmio bars supported\n"); | ||
812 | |||
813 | return -1; | ||
814 | } | ||
815 | |||
816 | /* double check if the mem space is enabled */ | ||
817 | byte = read_pci_config_byte(bus, slot, func, 0x04); | ||
818 | if (!(byte & 0x2)) { | ||
819 | byte |= 0x02; | ||
820 | write_pci_config_byte(bus, slot, func, 0x04, byte); | ||
821 | dbgp_printk("mmio for ehci enabled\n"); | ||
822 | } | ||
823 | |||
824 | /* | ||
825 | * FIXME I don't have the bar size so just guess PAGE_SIZE is more | ||
826 | * than enough. 1K is the biggest I have seen. | ||
827 | */ | ||
828 | set_fixmap_nocache(FIX_DBGP_BASE, bar_val & PAGE_MASK); | ||
829 | ehci_bar = (void __iomem *)__fix_to_virt(FIX_DBGP_BASE); | ||
830 | ehci_bar += bar_val & ~PAGE_MASK; | ||
831 | dbgp_printk("ehci_bar: %p\n", ehci_bar); | ||
832 | |||
833 | ehci_caps = ehci_bar; | ||
834 | ehci_regs = ehci_bar + HC_LENGTH(readl(&ehci_caps->hc_capbase)); | ||
835 | ehci_debug = ehci_bar + offset; | ||
836 | ehci_dev.bus = bus; | ||
837 | ehci_dev.slot = slot; | ||
838 | ehci_dev.func = func; | ||
839 | |||
840 | detect_set_debug_port(); | ||
841 | |||
842 | ret = ehci_setup(); | ||
843 | if (ret < 0) { | ||
844 | dbgp_printk("ehci_setup failed\n"); | ||
845 | ehci_debug = NULL; | ||
846 | |||
847 | return -1; | ||
848 | } | ||
849 | |||
850 | return 0; | ||
851 | } | ||
852 | |||
853 | static void early_dbgp_write(struct console *con, const char *str, u32 n) | ||
854 | { | ||
855 | int chunk, ret; | ||
856 | |||
857 | if (!ehci_debug) | ||
858 | return; | ||
859 | while (n > 0) { | ||
860 | chunk = n; | ||
861 | if (chunk > DBGP_MAX_PACKET) | ||
862 | chunk = DBGP_MAX_PACKET; | ||
863 | ret = dbgp_bulk_write(USB_DEBUG_DEVNUM, | ||
864 | dbgp_endpoint_out, str, chunk); | ||
865 | str += chunk; | ||
866 | n -= chunk; | ||
867 | } | ||
868 | } | ||
869 | |||
870 | static struct console early_dbgp_console = { | ||
871 | .name = "earlydbg", | ||
872 | .write = early_dbgp_write, | ||
873 | .flags = CON_PRINTBUFFER, | ||
874 | .index = -1, | ||
875 | }; | ||
876 | #endif | ||
877 | |||
878 | /* Direct interface for emergencies */ | 163 | /* Direct interface for emergencies */ |
879 | static struct console *early_console = &early_vga_console; | 164 | static struct console *early_console = &early_vga_console; |
880 | static int __initdata early_console_initialized; | 165 | static int __initdata early_console_initialized; |
@@ -891,10 +176,19 @@ asmlinkage void early_printk(const char *fmt, ...) | |||
891 | va_end(ap); | 176 | va_end(ap); |
892 | } | 177 | } |
893 | 178 | ||
179 | static inline void early_console_register(struct console *con, int keep_early) | ||
180 | { | ||
181 | early_console = con; | ||
182 | if (keep_early) | ||
183 | early_console->flags &= ~CON_BOOT; | ||
184 | else | ||
185 | early_console->flags |= CON_BOOT; | ||
186 | register_console(early_console); | ||
187 | } | ||
894 | 188 | ||
895 | static int __init setup_early_printk(char *buf) | 189 | static int __init setup_early_printk(char *buf) |
896 | { | 190 | { |
897 | int keep_early; | 191 | int keep; |
898 | 192 | ||
899 | if (!buf) | 193 | if (!buf) |
900 | return 0; | 194 | return 0; |
@@ -903,42 +197,34 @@ static int __init setup_early_printk(char *buf) | |||
903 | return 0; | 197 | return 0; |
904 | early_console_initialized = 1; | 198 | early_console_initialized = 1; |
905 | 199 | ||
906 | keep_early = (strstr(buf, "keep") != NULL); | 200 | keep = (strstr(buf, "keep") != NULL); |
907 | 201 | ||
908 | if (!strncmp(buf, "serial", 6)) { | 202 | while (*buf != '\0') { |
909 | early_serial_init(buf + 6); | 203 | if (!strncmp(buf, "serial", 6)) { |
910 | early_console = &early_serial_console; | 204 | early_serial_init(buf + 6); |
911 | } else if (!strncmp(buf, "ttyS", 4)) { | 205 | early_console_register(&early_serial_console, keep); |
912 | early_serial_init(buf); | 206 | } |
913 | early_console = &early_serial_console; | 207 | if (!strncmp(buf, "ttyS", 4)) { |
914 | } else if (!strncmp(buf, "vga", 3) | 208 | early_serial_init(buf + 4); |
915 | && boot_params.screen_info.orig_video_isVGA == 1) { | 209 | early_console_register(&early_serial_console, keep); |
916 | max_xpos = boot_params.screen_info.orig_video_cols; | 210 | } |
917 | max_ypos = boot_params.screen_info.orig_video_lines; | 211 | if (!strncmp(buf, "vga", 3) && |
918 | current_ypos = boot_params.screen_info.orig_y; | 212 | boot_params.screen_info.orig_video_isVGA == 1) { |
919 | early_console = &early_vga_console; | 213 | max_xpos = boot_params.screen_info.orig_video_cols; |
214 | max_ypos = boot_params.screen_info.orig_video_lines; | ||
215 | current_ypos = boot_params.screen_info.orig_y; | ||
216 | early_console_register(&early_vga_console, keep); | ||
217 | } | ||
920 | #ifdef CONFIG_EARLY_PRINTK_DBGP | 218 | #ifdef CONFIG_EARLY_PRINTK_DBGP |
921 | } else if (!strncmp(buf, "dbgp", 4)) { | 219 | if (!strncmp(buf, "dbgp", 4) && !early_dbgp_init(buf + 4)) |
922 | if (early_dbgp_init(buf+4) < 0) | 220 | early_console_register(&early_dbgp_console, keep); |
923 | return 0; | ||
924 | early_console = &early_dbgp_console; | ||
925 | /* | ||
926 | * usb subsys will reset ehci controller, so don't keep | ||
927 | * that early console | ||
928 | */ | ||
929 | keep_early = 0; | ||
930 | #endif | 221 | #endif |
931 | #ifdef CONFIG_HVC_XEN | 222 | #ifdef CONFIG_HVC_XEN |
932 | } else if (!strncmp(buf, "xen", 3)) { | 223 | if (!strncmp(buf, "xen", 3)) |
933 | early_console = &xenboot_console; | 224 | early_console_register(&xenboot_console, keep); |
934 | #endif | 225 | #endif |
226 | buf++; | ||
935 | } | 227 | } |
936 | |||
937 | if (keep_early) | ||
938 | early_console->flags &= ~CON_BOOT; | ||
939 | else | ||
940 | early_console->flags |= CON_BOOT; | ||
941 | register_console(early_console); | ||
942 | return 0; | 228 | return 0; |
943 | } | 229 | } |
944 | 230 | ||
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c index e8a35016115f..aaa6b7839f1e 100644 --- a/arch/x86/kernel/pci-swiotlb.c +++ b/arch/x86/kernel/pci-swiotlb.c | |||
@@ -46,9 +46,8 @@ void __init pci_swiotlb_init(void) | |||
46 | { | 46 | { |
47 | /* don't initialize swiotlb if iommu=off (no_iommu=1) */ | 47 | /* don't initialize swiotlb if iommu=off (no_iommu=1) */ |
48 | #ifdef CONFIG_X86_64 | 48 | #ifdef CONFIG_X86_64 |
49 | if ((!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN) || | 49 | if ((!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)) |
50 | iommu_pass_through) | 50 | swiotlb = 1; |
51 | swiotlb = 1; | ||
52 | #endif | 51 | #endif |
53 | if (swiotlb_force) | 52 | if (swiotlb_force) |
54 | swiotlb = 1; | 53 | swiotlb = 1; |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 8d7d5c9c1be3..7b058a2dc66a 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -325,16 +325,6 @@ static int putreg(struct task_struct *child, | |||
325 | return set_flags(child, value); | 325 | return set_flags(child, value); |
326 | 326 | ||
327 | #ifdef CONFIG_X86_64 | 327 | #ifdef CONFIG_X86_64 |
328 | /* | ||
329 | * Orig_ax is really just a flag with small positive and | ||
330 | * negative values, so make sure to always sign-extend it | ||
331 | * from 32 bits so that it works correctly regardless of | ||
332 | * whether we come from a 32-bit environment or not. | ||
333 | */ | ||
334 | case offsetof(struct user_regs_struct, orig_ax): | ||
335 | value = (long) (s32) value; | ||
336 | break; | ||
337 | |||
338 | case offsetof(struct user_regs_struct,fs_base): | 328 | case offsetof(struct user_regs_struct,fs_base): |
339 | if (value >= TASK_SIZE_OF(child)) | 329 | if (value >= TASK_SIZE_OF(child)) |
340 | return -EIO; | 330 | return -EIO; |
@@ -1126,10 +1116,15 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 value) | |||
1126 | 1116 | ||
1127 | case offsetof(struct user32, regs.orig_eax): | 1117 | case offsetof(struct user32, regs.orig_eax): |
1128 | /* | 1118 | /* |
1129 | * Sign-extend the value so that orig_eax = -1 | 1119 | * A 32-bit debugger setting orig_eax means to restore |
1130 | * causes (long)orig_ax < 0 tests to fire correctly. | 1120 | * the state of the task restarting a 32-bit syscall. |
1121 | * Make sure we interpret the -ERESTART* codes correctly | ||
1122 | * in case the task is not actually still sitting at the | ||
1123 | * exit from a 32-bit syscall with TS_COMPAT still set. | ||
1131 | */ | 1124 | */ |
1132 | regs->orig_ax = (long) (s32) value; | 1125 | regs->orig_ax = value; |
1126 | if (syscall_get_nr(child, regs) >= 0) | ||
1127 | task_thread_info(child)->status |= TS_COMPAT; | ||
1133 | break; | 1128 | break; |
1134 | 1129 | ||
1135 | case offsetof(struct user32, regs.eflags): | 1130 | case offsetof(struct user32, regs.eflags): |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f327bccf5089..e09f0e2c14b5 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/screen_info.h> | 27 | #include <linux/screen_info.h> |
28 | #include <linux/ioport.h> | 28 | #include <linux/ioport.h> |
29 | #include <linux/acpi.h> | 29 | #include <linux/acpi.h> |
30 | #include <linux/sfi.h> | ||
30 | #include <linux/apm_bios.h> | 31 | #include <linux/apm_bios.h> |
31 | #include <linux/initrd.h> | 32 | #include <linux/initrd.h> |
32 | #include <linux/bootmem.h> | 33 | #include <linux/bootmem.h> |
@@ -985,6 +986,8 @@ void __init setup_arch(char **cmdline_p) | |||
985 | */ | 986 | */ |
986 | acpi_boot_init(); | 987 | acpi_boot_init(); |
987 | 988 | ||
989 | sfi_init(); | ||
990 | |||
988 | /* | 991 | /* |
989 | * get boot-time SMP configuration: | 992 | * get boot-time SMP configuration: |
990 | */ | 993 | */ |
diff --git a/arch/x86/kernel/sfi.c b/arch/x86/kernel/sfi.c new file mode 100644 index 000000000000..34e099382651 --- /dev/null +++ b/arch/x86/kernel/sfi.c | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * sfi.c - x86 architecture SFI support. | ||
3 | * | ||
4 | * Copyright (c) 2009, Intel Corporation. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along with | ||
16 | * this program; if not, write to the Free Software Foundation, Inc., | ||
17 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | #define KMSG_COMPONENT "SFI" | ||
22 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | ||
23 | |||
24 | #include <linux/acpi.h> | ||
25 | #include <linux/init.h> | ||
26 | #include <linux/sfi.h> | ||
27 | #include <linux/io.h> | ||
28 | |||
29 | #include <asm/io_apic.h> | ||
30 | #include <asm/mpspec.h> | ||
31 | #include <asm/setup.h> | ||
32 | #include <asm/apic.h> | ||
33 | |||
34 | #ifdef CONFIG_X86_LOCAL_APIC | ||
35 | static unsigned long sfi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; | ||
36 | |||
37 | void __init mp_sfi_register_lapic_address(unsigned long address) | ||
38 | { | ||
39 | mp_lapic_addr = address; | ||
40 | |||
41 | set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr); | ||
42 | if (boot_cpu_physical_apicid == -1U) | ||
43 | boot_cpu_physical_apicid = read_apic_id(); | ||
44 | |||
45 | pr_info("Boot CPU = %d\n", boot_cpu_physical_apicid); | ||
46 | } | ||
47 | |||
48 | /* All CPUs enumerated by SFI must be present and enabled */ | ||
49 | void __cpuinit mp_sfi_register_lapic(u8 id) | ||
50 | { | ||
51 | if (MAX_APICS - id <= 0) { | ||
52 | pr_warning("Processor #%d invalid (max %d)\n", | ||
53 | id, MAX_APICS); | ||
54 | return; | ||
55 | } | ||
56 | |||
57 | pr_info("registering lapic[%d]\n", id); | ||
58 | |||
59 | generic_processor_info(id, GET_APIC_VERSION(apic_read(APIC_LVR))); | ||
60 | } | ||
61 | |||
62 | static int __init sfi_parse_cpus(struct sfi_table_header *table) | ||
63 | { | ||
64 | struct sfi_table_simple *sb; | ||
65 | struct sfi_cpu_table_entry *pentry; | ||
66 | int i; | ||
67 | int cpu_num; | ||
68 | |||
69 | sb = (struct sfi_table_simple *)table; | ||
70 | cpu_num = SFI_GET_NUM_ENTRIES(sb, struct sfi_cpu_table_entry); | ||
71 | pentry = (struct sfi_cpu_table_entry *)sb->pentry; | ||
72 | |||
73 | for (i = 0; i < cpu_num; i++) { | ||
74 | mp_sfi_register_lapic(pentry->apic_id); | ||
75 | pentry++; | ||
76 | } | ||
77 | |||
78 | smp_found_config = 1; | ||
79 | return 0; | ||
80 | } | ||
81 | #endif /* CONFIG_X86_LOCAL_APIC */ | ||
82 | |||
83 | #ifdef CONFIG_X86_IO_APIC | ||
84 | static u32 gsi_base; | ||
85 | |||
86 | static int __init sfi_parse_ioapic(struct sfi_table_header *table) | ||
87 | { | ||
88 | struct sfi_table_simple *sb; | ||
89 | struct sfi_apic_table_entry *pentry; | ||
90 | int i, num; | ||
91 | |||
92 | sb = (struct sfi_table_simple *)table; | ||
93 | num = SFI_GET_NUM_ENTRIES(sb, struct sfi_apic_table_entry); | ||
94 | pentry = (struct sfi_apic_table_entry *)sb->pentry; | ||
95 | |||
96 | for (i = 0; i < num; i++) { | ||
97 | mp_register_ioapic(i, pentry->phys_addr, gsi_base); | ||
98 | gsi_base += io_apic_get_redir_entries(i); | ||
99 | pentry++; | ||
100 | } | ||
101 | |||
102 | WARN(pic_mode, KERN_WARNING | ||
103 | "SFI: pic_mod shouldn't be 1 when IOAPIC table is present\n"); | ||
104 | pic_mode = 0; | ||
105 | return 0; | ||
106 | } | ||
107 | #endif /* CONFIG_X86_IO_APIC */ | ||
108 | |||
109 | /* | ||
110 | * sfi_platform_init(): register lapics & io-apics | ||
111 | */ | ||
112 | int __init sfi_platform_init(void) | ||
113 | { | ||
114 | #ifdef CONFIG_X86_LOCAL_APIC | ||
115 | mp_sfi_register_lapic_address(sfi_lapic_addr); | ||
116 | sfi_table_parse(SFI_SIG_CPUS, NULL, NULL, sfi_parse_cpus); | ||
117 | #endif | ||
118 | #ifdef CONFIG_X86_IO_APIC | ||
119 | sfi_table_parse(SFI_SIG_APIC, NULL, NULL, sfi_parse_ioapic); | ||
120 | #endif | ||
121 | return 0; | ||
122 | } | ||
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 4cb7d5d18b8e..7e59dc1d3fc2 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -1135,11 +1135,6 @@ static struct notifier_block paniced = { | |||
1135 | /* Setting up memory is fairly easy. */ | 1135 | /* Setting up memory is fairly easy. */ |
1136 | static __init char *lguest_memory_setup(void) | 1136 | static __init char *lguest_memory_setup(void) |
1137 | { | 1137 | { |
1138 | /* We do this here and not earlier because lockcheck used to barf if we | ||
1139 | * did it before start_kernel(). I think we fixed that, so it'd be | ||
1140 | * nice to move it back to lguest_init. Patch welcome... */ | ||
1141 | atomic_notifier_chain_register(&panic_notifier_list, &paniced); | ||
1142 | |||
1143 | /* | 1138 | /* |
1144 | *The Linux bootloader header contains an "e820" memory map: the | 1139 | *The Linux bootloader header contains an "e820" memory map: the |
1145 | * Launcher populated the first entry with our memory limit. | 1140 | * Launcher populated the first entry with our memory limit. |
@@ -1364,10 +1359,13 @@ __init void lguest_init(void) | |||
1364 | 1359 | ||
1365 | /* | 1360 | /* |
1366 | * If we don't initialize the lock dependency checker now, it crashes | 1361 | * If we don't initialize the lock dependency checker now, it crashes |
1367 | * paravirt_disable_iospace. | 1362 | * atomic_notifier_chain_register, then paravirt_disable_iospace. |
1368 | */ | 1363 | */ |
1369 | lockdep_init(); | 1364 | lockdep_init(); |
1370 | 1365 | ||
1366 | /* Hook in our special panic hypercall code. */ | ||
1367 | atomic_notifier_chain_register(&panic_notifier_list, &paniced); | ||
1368 | |||
1371 | /* | 1369 | /* |
1372 | * The IDE code spends about 3 seconds probing for disks: if we reserve | 1370 | * The IDE code spends about 3 seconds probing for disks: if we reserve |
1373 | * all the I/O ports up front it can't get them and so doesn't probe. | 1371 | * all the I/O ports up front it can't get them and so doesn't probe. |
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index b49b4f67453d..30938c1d8d5d 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -857,8 +857,6 @@ static void __init test_wp_bit(void) | |||
857 | } | 857 | } |
858 | } | 858 | } |
859 | 859 | ||
860 | static struct kcore_list kcore_mem, kcore_vmalloc; | ||
861 | |||
862 | void __init mem_init(void) | 860 | void __init mem_init(void) |
863 | { | 861 | { |
864 | int codesize, reservedpages, datasize, initsize; | 862 | int codesize, reservedpages, datasize, initsize; |
@@ -886,10 +884,6 @@ void __init mem_init(void) | |||
886 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 884 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; |
887 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | 885 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; |
888 | 886 | ||
889 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); | ||
890 | kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, | ||
891 | VMALLOC_END-VMALLOC_START); | ||
892 | |||
893 | printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, " | 887 | printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, " |
894 | "%dk reserved, %dk data, %dk init, %ldk highmem)\n", | 888 | "%dk reserved, %dk data, %dk init, %ldk highmem)\n", |
895 | nr_free_pages() << (PAGE_SHIFT-10), | 889 | nr_free_pages() << (PAGE_SHIFT-10), |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 810bd31e7f5f..5a4398a6006b 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -647,8 +647,7 @@ EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); | |||
647 | 647 | ||
648 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 648 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
649 | 649 | ||
650 | static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, | 650 | static struct kcore_list kcore_vsyscall; |
651 | kcore_modules, kcore_vsyscall; | ||
652 | 651 | ||
653 | void __init mem_init(void) | 652 | void __init mem_init(void) |
654 | { | 653 | { |
@@ -677,13 +676,8 @@ void __init mem_init(void) | |||
677 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | 676 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; |
678 | 677 | ||
679 | /* Register memory areas for /proc/kcore */ | 678 | /* Register memory areas for /proc/kcore */ |
680 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); | ||
681 | kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, | ||
682 | VMALLOC_END-VMALLOC_START); | ||
683 | kclist_add(&kcore_kernel, &_stext, _end - _stext); | ||
684 | kclist_add(&kcore_modules, (void *)MODULES_VADDR, MODULES_LEN); | ||
685 | kclist_add(&kcore_vsyscall, (void *)VSYSCALL_START, | 679 | kclist_add(&kcore_vsyscall, (void *)VSYSCALL_START, |
686 | VSYSCALL_END - VSYSCALL_START); | 680 | VSYSCALL_END - VSYSCALL_START, KCORE_OTHER); |
687 | 681 | ||
688 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " | 682 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " |
689 | "%ldk absent, %ldk reserved, %ldk data, %ldk init)\n", | 683 | "%ldk absent, %ldk reserved, %ldk data, %ldk init)\n", |
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 712443ec6d43..602c172d3bd5 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c | |||
@@ -13,10 +13,14 @@ | |||
13 | #include <linux/pci.h> | 13 | #include <linux/pci.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/acpi.h> | 15 | #include <linux/acpi.h> |
16 | #include <linux/sfi_acpi.h> | ||
16 | #include <linux/bitmap.h> | 17 | #include <linux/bitmap.h> |
17 | #include <linux/sort.h> | 18 | #include <linux/sort.h> |
18 | #include <asm/e820.h> | 19 | #include <asm/e820.h> |
19 | #include <asm/pci_x86.h> | 20 | #include <asm/pci_x86.h> |
21 | #include <asm/acpi.h> | ||
22 | |||
23 | #define PREFIX "PCI: " | ||
20 | 24 | ||
21 | /* aperture is up to 256MB but BIOS may reserve less */ | 25 | /* aperture is up to 256MB but BIOS may reserve less */ |
22 | #define MMCONFIG_APER_MIN (2 * 1024*1024) | 26 | #define MMCONFIG_APER_MIN (2 * 1024*1024) |
@@ -491,7 +495,7 @@ static void __init pci_mmcfg_reject_broken(int early) | |||
491 | (unsigned int)cfg->start_bus_number, | 495 | (unsigned int)cfg->start_bus_number, |
492 | (unsigned int)cfg->end_bus_number); | 496 | (unsigned int)cfg->end_bus_number); |
493 | 497 | ||
494 | if (!early) | 498 | if (!early && !acpi_disabled) |
495 | valid = is_mmconf_reserved(is_acpi_reserved, addr, size, i, cfg, 0); | 499 | valid = is_mmconf_reserved(is_acpi_reserved, addr, size, i, cfg, 0); |
496 | 500 | ||
497 | if (valid) | 501 | if (valid) |
@@ -606,7 +610,7 @@ static void __init __pci_mmcfg_init(int early) | |||
606 | } | 610 | } |
607 | 611 | ||
608 | if (!known_bridge) | 612 | if (!known_bridge) |
609 | acpi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg); | 613 | acpi_sfi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg); |
610 | 614 | ||
611 | pci_mmcfg_reject_broken(early); | 615 | pci_mmcfg_reject_broken(early); |
612 | 616 | ||
diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c index 8b2d561046a3..f10a7e94a84c 100644 --- a/arch/x86/pci/mmconfig_32.c +++ b/arch/x86/pci/mmconfig_32.c | |||
@@ -11,9 +11,9 @@ | |||
11 | 11 | ||
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/acpi.h> | ||
15 | #include <asm/e820.h> | 14 | #include <asm/e820.h> |
16 | #include <asm/pci_x86.h> | 15 | #include <asm/pci_x86.h> |
16 | #include <acpi/acpi.h> | ||
17 | 17 | ||
18 | /* Assume systems with more busses have correct MCFG */ | 18 | /* Assume systems with more busses have correct MCFG */ |
19 | #define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG)) | 19 | #define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG)) |