diff options
Diffstat (limited to 'arch')
314 files changed, 7419 insertions, 4657 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ca2ab3d28639..6344543974f6 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -7,7 +7,7 @@ config ARM | |||
| 7 | select HAVE_MEMBLOCK | 7 | select HAVE_MEMBLOCK |
| 8 | select RTC_LIB | 8 | select RTC_LIB |
| 9 | select SYS_SUPPORTS_APM_EMULATION | 9 | select SYS_SUPPORTS_APM_EMULATION |
| 10 | select GENERIC_ATOMIC64 if (!CPU_32v6K) | 10 | select GENERIC_ATOMIC64 if (!CPU_32v6K || !AEABI) |
| 11 | select HAVE_OPROFILE if (HAVE_PERF_EVENTS) | 11 | select HAVE_OPROFILE if (HAVE_PERF_EVENTS) |
| 12 | select HAVE_ARCH_KGDB | 12 | select HAVE_ARCH_KGDB |
| 13 | select HAVE_KPROBES if (!XIP_KERNEL) | 13 | select HAVE_KPROBES if (!XIP_KERNEL) |
| @@ -652,7 +652,7 @@ config ARCH_S3C2410 | |||
| 652 | select ARCH_HAS_CPUFREQ | 652 | select ARCH_HAS_CPUFREQ |
| 653 | select HAVE_CLK | 653 | select HAVE_CLK |
| 654 | select ARCH_USES_GETTIMEOFFSET | 654 | select ARCH_USES_GETTIMEOFFSET |
| 655 | select HAVE_S3C2410_I2C | 655 | select HAVE_S3C2410_I2C if I2C |
| 656 | help | 656 | help |
| 657 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics | 657 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics |
| 658 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or | 658 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or |
| @@ -682,8 +682,8 @@ config ARCH_S3C64XX | |||
| 682 | select S3C_DEV_NAND | 682 | select S3C_DEV_NAND |
| 683 | select USB_ARCH_HAS_OHCI | 683 | select USB_ARCH_HAS_OHCI |
| 684 | select SAMSUNG_GPIOLIB_4BIT | 684 | select SAMSUNG_GPIOLIB_4BIT |
| 685 | select HAVE_S3C2410_I2C | 685 | select HAVE_S3C2410_I2C if I2C |
| 686 | select HAVE_S3C2410_WATCHDOG | 686 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 687 | help | 687 | help |
| 688 | Samsung S3C64XX series based systems | 688 | Samsung S3C64XX series based systems |
| 689 | 689 | ||
| @@ -692,10 +692,10 @@ config ARCH_S5P64X0 | |||
| 692 | select CPU_V6 | 692 | select CPU_V6 |
| 693 | select GENERIC_GPIO | 693 | select GENERIC_GPIO |
| 694 | select HAVE_CLK | 694 | select HAVE_CLK |
| 695 | select HAVE_S3C2410_WATCHDOG | 695 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 696 | select ARCH_USES_GETTIMEOFFSET | 696 | select ARCH_USES_GETTIMEOFFSET |
| 697 | select HAVE_S3C2410_I2C | 697 | select HAVE_S3C2410_I2C if I2C |
| 698 | select HAVE_S3C_RTC | 698 | select HAVE_S3C_RTC if RTC_CLASS |
| 699 | help | 699 | help |
| 700 | Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, | 700 | Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, |
| 701 | SMDK6450. | 701 | SMDK6450. |
| @@ -706,7 +706,7 @@ config ARCH_S5P6442 | |||
| 706 | select GENERIC_GPIO | 706 | select GENERIC_GPIO |
| 707 | select HAVE_CLK | 707 | select HAVE_CLK |
| 708 | select ARCH_USES_GETTIMEOFFSET | 708 | select ARCH_USES_GETTIMEOFFSET |
| 709 | select HAVE_S3C2410_WATCHDOG | 709 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 710 | help | 710 | help |
| 711 | Samsung S5P6442 CPU based systems | 711 | Samsung S5P6442 CPU based systems |
| 712 | 712 | ||
| @@ -717,9 +717,9 @@ config ARCH_S5PC100 | |||
| 717 | select CPU_V7 | 717 | select CPU_V7 |
| 718 | select ARM_L1_CACHE_SHIFT_6 | 718 | select ARM_L1_CACHE_SHIFT_6 |
| 719 | select ARCH_USES_GETTIMEOFFSET | 719 | select ARCH_USES_GETTIMEOFFSET |
| 720 | select HAVE_S3C2410_I2C | 720 | select HAVE_S3C2410_I2C if I2C |
| 721 | select HAVE_S3C_RTC | 721 | select HAVE_S3C_RTC if RTC_CLASS |
| 722 | select HAVE_S3C2410_WATCHDOG | 722 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 723 | help | 723 | help |
| 724 | Samsung S5PC100 series based systems | 724 | Samsung S5PC100 series based systems |
| 725 | 725 | ||
| @@ -732,9 +732,9 @@ config ARCH_S5PV210 | |||
| 732 | select ARM_L1_CACHE_SHIFT_6 | 732 | select ARM_L1_CACHE_SHIFT_6 |
| 733 | select ARCH_HAS_CPUFREQ | 733 | select ARCH_HAS_CPUFREQ |
| 734 | select ARCH_USES_GETTIMEOFFSET | 734 | select ARCH_USES_GETTIMEOFFSET |
| 735 | select HAVE_S3C2410_I2C | 735 | select HAVE_S3C2410_I2C if I2C |
| 736 | select HAVE_S3C_RTC | 736 | select HAVE_S3C_RTC if RTC_CLASS |
| 737 | select HAVE_S3C2410_WATCHDOG | 737 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 738 | help | 738 | help |
| 739 | Samsung S5PV210/S5PC110 series based systems | 739 | Samsung S5PV210/S5PC110 series based systems |
| 740 | 740 | ||
| @@ -745,9 +745,9 @@ config ARCH_S5PV310 | |||
| 745 | select GENERIC_GPIO | 745 | select GENERIC_GPIO |
| 746 | select HAVE_CLK | 746 | select HAVE_CLK |
| 747 | select GENERIC_CLOCKEVENTS | 747 | select GENERIC_CLOCKEVENTS |
| 748 | select HAVE_S3C_RTC | 748 | select HAVE_S3C_RTC if RTC_CLASS |
| 749 | select HAVE_S3C2410_I2C | 749 | select HAVE_S3C2410_I2C if I2C |
| 750 | select HAVE_S3C2410_WATCHDOG | 750 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 751 | help | 751 | help |
| 752 | Samsung S5PV310 series based systems | 752 | Samsung S5PV310 series based systems |
| 753 | 753 | ||
| @@ -1240,7 +1240,7 @@ config SMP | |||
| 1240 | config SMP_ON_UP | 1240 | config SMP_ON_UP |
| 1241 | bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)" | 1241 | bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)" |
| 1242 | depends on EXPERIMENTAL | 1242 | depends on EXPERIMENTAL |
| 1243 | depends on SMP && !XIP && !THUMB2_KERNEL | 1243 | depends on SMP && !XIP |
| 1244 | default y | 1244 | default y |
| 1245 | help | 1245 | help |
| 1246 | SMP kernels contain instructions which fail on non-SMP processors. | 1246 | SMP kernels contain instructions which fail on non-SMP processors. |
| @@ -1259,6 +1259,7 @@ config HAVE_ARM_SCU | |||
| 1259 | config HAVE_ARM_TWD | 1259 | config HAVE_ARM_TWD |
| 1260 | bool | 1260 | bool |
| 1261 | depends on SMP | 1261 | depends on SMP |
| 1262 | select TICK_ONESHOT | ||
| 1262 | help | 1263 | help |
| 1263 | This options enables support for the ARM timer and watchdog unit | 1264 | This options enables support for the ARM timer and watchdog unit |
| 1264 | 1265 | ||
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 6825c34646d4..9be21ba648cd 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
| @@ -1084,6 +1084,6 @@ memdump: mov r12, r0 | |||
| 1084 | reloc_end: | 1084 | reloc_end: |
| 1085 | 1085 | ||
| 1086 | .align | 1086 | .align |
| 1087 | .section ".stack", "w" | 1087 | .section ".stack", "aw", %nobits |
| 1088 | user_stack: .space 4096 | 1088 | user_stack: .space 4096 |
| 1089 | user_stack_end: | 1089 | user_stack_end: |
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in index d08168941bd6..366a924019ac 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.in +++ b/arch/arm/boot/compressed/vmlinux.lds.in | |||
| @@ -57,7 +57,7 @@ SECTIONS | |||
| 57 | .bss : { *(.bss) } | 57 | .bss : { *(.bss) } |
| 58 | _end = .; | 58 | _end = .; |
| 59 | 59 | ||
| 60 | .stack (NOLOAD) : { *(.stack) } | 60 | .stack : { *(.stack) } |
| 61 | 61 | ||
| 62 | .stab 0 : { *(.stab) } | 62 | .stab 0 : { *(.stab) } |
| 63 | .stabstr 0 : { *(.stabstr) } | 63 | .stabstr 0 : { *(.stabstr) } |
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index ada6359160eb..772f95f1aecd 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c | |||
| @@ -251,15 +251,16 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | |||
| 251 | writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); | 251 | writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); |
| 252 | 252 | ||
| 253 | /* | 253 | /* |
| 254 | * Set priority on all interrupts. | 254 | * Set priority on all global interrupts. |
| 255 | */ | 255 | */ |
| 256 | for (i = 0; i < max_irq; i += 4) | 256 | for (i = 32; i < max_irq; i += 4) |
| 257 | writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4); | 257 | writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4); |
| 258 | 258 | ||
| 259 | /* | 259 | /* |
| 260 | * Disable all interrupts. | 260 | * Disable all interrupts. Leave the PPI and SGIs alone |
| 261 | * as these enables are banked registers. | ||
| 261 | */ | 262 | */ |
| 262 | for (i = 0; i < max_irq; i += 32) | 263 | for (i = 32; i < max_irq; i += 32) |
| 263 | writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32); | 264 | writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32); |
| 264 | 265 | ||
| 265 | /* | 266 | /* |
| @@ -277,11 +278,30 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | |||
| 277 | 278 | ||
| 278 | void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base) | 279 | void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base) |
| 279 | { | 280 | { |
| 281 | void __iomem *dist_base; | ||
| 282 | int i; | ||
| 283 | |||
| 280 | if (gic_nr >= MAX_GIC_NR) | 284 | if (gic_nr >= MAX_GIC_NR) |
| 281 | BUG(); | 285 | BUG(); |
| 282 | 286 | ||
| 287 | dist_base = gic_data[gic_nr].dist_base; | ||
| 288 | BUG_ON(!dist_base); | ||
| 289 | |||
| 283 | gic_data[gic_nr].cpu_base = base; | 290 | gic_data[gic_nr].cpu_base = base; |
| 284 | 291 | ||
| 292 | /* | ||
| 293 | * Deal with the banked PPI and SGI interrupts - disable all | ||
| 294 | * PPI interrupts, ensure all SGI interrupts are enabled. | ||
| 295 | */ | ||
| 296 | writel(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR); | ||
| 297 | writel(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET); | ||
| 298 | |||
| 299 | /* | ||
| 300 | * Set priority on PPI and SGI interrupts | ||
| 301 | */ | ||
| 302 | for (i = 0; i < 32; i += 4) | ||
| 303 | writel(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4); | ||
| 304 | |||
| 285 | writel(0xf0, base + GIC_CPU_PRIMASK); | 305 | writel(0xf0, base + GIC_CPU_PRIMASK); |
| 286 | writel(1, base + GIC_CPU_CTRL); | 306 | writel(1, base + GIC_CPU_CTRL); |
| 287 | } | 307 | } |
diff --git a/arch/arm/configs/at91rm9200_defconfig b/arch/arm/configs/at91rm9200_defconfig new file mode 100644 index 000000000000..38cb7c985426 --- /dev/null +++ b/arch/arm/configs/at91rm9200_defconfig | |||
| @@ -0,0 +1,341 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 3 | # CONFIG_SWAP is not set | ||
| 4 | CONFIG_SYSVIPC=y | ||
| 5 | CONFIG_IKCONFIG=y | ||
| 6 | CONFIG_IKCONFIG_PROC=y | ||
| 7 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 8 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
| 9 | CONFIG_BLK_DEV_INITRD=y | ||
| 10 | CONFIG_MODULES=y | ||
| 11 | CONFIG_MODULE_FORCE_LOAD=y | ||
| 12 | CONFIG_MODULE_UNLOAD=y | ||
| 13 | CONFIG_MODVERSIONS=y | ||
| 14 | CONFIG_MODULE_SRCVERSION_ALL=y | ||
| 15 | # CONFIG_BLK_DEV_BSG is not set | ||
| 16 | # CONFIG_IOSCHED_CFQ is not set | ||
| 17 | CONFIG_ARCH_AT91=y | ||
| 18 | CONFIG_MACH_ONEARM=y | ||
| 19 | CONFIG_ARCH_AT91RM9200DK=y | ||
| 20 | CONFIG_MACH_AT91RM9200EK=y | ||
| 21 | CONFIG_MACH_CSB337=y | ||
| 22 | CONFIG_MACH_CSB637=y | ||
| 23 | CONFIG_MACH_CARMEVA=y | ||
| 24 | CONFIG_MACH_ATEB9200=y | ||
| 25 | CONFIG_MACH_KB9200=y | ||
| 26 | CONFIG_MACH_PICOTUX2XX=y | ||
| 27 | CONFIG_MACH_KAFA=y | ||
| 28 | CONFIG_MACH_ECBAT91=y | ||
| 29 | CONFIG_MACH_YL9200=y | ||
| 30 | CONFIG_MACH_CPUAT91=y | ||
| 31 | CONFIG_MACH_ECO920=y | ||
| 32 | CONFIG_MTD_AT91_DATAFLASH_CARD=y | ||
| 33 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 34 | CONFIG_AT91_TIMER_HZ=100 | ||
| 35 | # CONFIG_ARM_THUMB is not set | ||
| 36 | CONFIG_PCCARD=y | ||
| 37 | CONFIG_AT91_CF=y | ||
| 38 | CONFIG_NO_HZ=y | ||
| 39 | CONFIG_HIGH_RES_TIMERS=y | ||
| 40 | CONFIG_PREEMPT=y | ||
| 41 | CONFIG_AEABI=y | ||
| 42 | CONFIG_LEDS=y | ||
| 43 | CONFIG_LEDS_CPU=y | ||
| 44 | CONFIG_ZBOOT_ROM_TEXT=0x10000000 | ||
| 45 | CONFIG_ZBOOT_ROM_BSS=0x20040000 | ||
| 46 | CONFIG_KEXEC=y | ||
| 47 | CONFIG_FPE_NWFPE=y | ||
| 48 | CONFIG_BINFMT_MISC=y | ||
| 49 | CONFIG_NET=y | ||
| 50 | CONFIG_PACKET=y | ||
| 51 | CONFIG_UNIX=y | ||
| 52 | CONFIG_XFRM_USER=m | ||
| 53 | CONFIG_INET=y | ||
| 54 | CONFIG_IP_MULTICAST=y | ||
| 55 | CONFIG_IP_PNP=y | ||
| 56 | CONFIG_IP_PNP_DHCP=y | ||
| 57 | CONFIG_IP_PNP_BOOTP=y | ||
| 58 | CONFIG_NET_IPIP=m | ||
| 59 | CONFIG_NET_IPGRE=m | ||
| 60 | CONFIG_INET_AH=m | ||
| 61 | CONFIG_INET_ESP=m | ||
| 62 | CONFIG_INET_IPCOMP=m | ||
| 63 | CONFIG_INET_XFRM_MODE_TRANSPORT=m | ||
| 64 | CONFIG_INET_XFRM_MODE_TUNNEL=m | ||
| 65 | CONFIG_INET_XFRM_MODE_BEET=m | ||
| 66 | CONFIG_IPV6_PRIVACY=y | ||
| 67 | CONFIG_IPV6_ROUTER_PREF=y | ||
| 68 | CONFIG_IPV6_ROUTE_INFO=y | ||
| 69 | CONFIG_INET6_AH=m | ||
| 70 | CONFIG_INET6_ESP=m | ||
| 71 | CONFIG_INET6_IPCOMP=m | ||
| 72 | CONFIG_IPV6_MIP6=m | ||
| 73 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m | ||
| 74 | CONFIG_IPV6_TUNNEL=m | ||
| 75 | CONFIG_BRIDGE=m | ||
| 76 | CONFIG_VLAN_8021Q=m | ||
| 77 | CONFIG_BT=m | ||
| 78 | CONFIG_BT_L2CAP=m | ||
| 79 | CONFIG_BT_SCO=m | ||
| 80 | CONFIG_BT_RFCOMM=m | ||
| 81 | CONFIG_BT_RFCOMM_TTY=y | ||
| 82 | CONFIG_BT_BNEP=m | ||
| 83 | CONFIG_BT_BNEP_MC_FILTER=y | ||
| 84 | CONFIG_BT_BNEP_PROTO_FILTER=y | ||
| 85 | CONFIG_BT_HIDP=m | ||
| 86 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 87 | CONFIG_MTD=y | ||
| 88 | CONFIG_MTD_CONCAT=y | ||
| 89 | CONFIG_MTD_PARTITIONS=y | ||
| 90 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 91 | CONFIG_MTD_AFS_PARTS=y | ||
| 92 | CONFIG_MTD_CHAR=y | ||
| 93 | CONFIG_MTD_BLOCK=y | ||
| 94 | CONFIG_MTD_CFI=y | ||
| 95 | CONFIG_MTD_JEDECPROBE=y | ||
| 96 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 97 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 98 | CONFIG_MTD_COMPLEX_MAPPINGS=y | ||
| 99 | CONFIG_MTD_PHYSMAP=y | ||
| 100 | CONFIG_MTD_PLATRAM=y | ||
| 101 | CONFIG_MTD_DATAFLASH=y | ||
| 102 | CONFIG_MTD_NAND=y | ||
| 103 | CONFIG_MTD_NAND_ATMEL=y | ||
| 104 | CONFIG_MTD_NAND_PLATFORM=y | ||
| 105 | CONFIG_MTD_UBI=y | ||
| 106 | CONFIG_MTD_UBI_GLUEBI=y | ||
| 107 | CONFIG_BLK_DEV_LOOP=y | ||
| 108 | CONFIG_BLK_DEV_NBD=y | ||
| 109 | CONFIG_BLK_DEV_RAM=y | ||
| 110 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 111 | CONFIG_ATMEL_TCLIB=y | ||
| 112 | CONFIG_EEPROM_LEGACY=m | ||
| 113 | CONFIG_SCSI=y | ||
| 114 | CONFIG_BLK_DEV_SD=y | ||
| 115 | CONFIG_BLK_DEV_SR=m | ||
| 116 | CONFIG_BLK_DEV_SR_VENDOR=y | ||
| 117 | CONFIG_CHR_DEV_SG=m | ||
| 118 | CONFIG_SCSI_MULTI_LUN=y | ||
| 119 | # CONFIG_SCSI_LOWLEVEL is not set | ||
| 120 | CONFIG_NETDEVICES=y | ||
| 121 | CONFIG_TUN=m | ||
| 122 | CONFIG_PHYLIB=y | ||
| 123 | CONFIG_DAVICOM_PHY=y | ||
| 124 | CONFIG_SMSC_PHY=y | ||
| 125 | CONFIG_MICREL_PHY=y | ||
| 126 | CONFIG_NET_ETHERNET=y | ||
| 127 | CONFIG_ARM_AT91_ETHER=y | ||
| 128 | # CONFIG_NETDEV_1000 is not set | ||
| 129 | # CONFIG_NETDEV_10000 is not set | ||
| 130 | CONFIG_USB_CATC=m | ||
| 131 | CONFIG_USB_KAWETH=m | ||
| 132 | CONFIG_USB_PEGASUS=m | ||
| 133 | CONFIG_USB_RTL8150=m | ||
| 134 | CONFIG_USB_USBNET=m | ||
| 135 | CONFIG_USB_NET_DM9601=m | ||
| 136 | CONFIG_USB_NET_GL620A=m | ||
| 137 | CONFIG_USB_NET_PLUSB=m | ||
| 138 | CONFIG_USB_NET_RNDIS_HOST=m | ||
| 139 | CONFIG_USB_ALI_M5632=y | ||
| 140 | CONFIG_USB_AN2720=y | ||
| 141 | CONFIG_USB_EPSON2888=y | ||
| 142 | CONFIG_PPP=y | ||
| 143 | CONFIG_PPP_MULTILINK=y | ||
| 144 | CONFIG_PPP_FILTER=y | ||
| 145 | CONFIG_PPP_ASYNC=y | ||
| 146 | CONFIG_PPP_DEFLATE=y | ||
| 147 | CONFIG_PPP_BSDCOMP=y | ||
| 148 | CONFIG_PPP_MPPE=m | ||
| 149 | CONFIG_PPPOE=m | ||
| 150 | CONFIG_SLIP=m | ||
| 151 | CONFIG_SLIP_COMPRESSED=y | ||
| 152 | CONFIG_SLIP_SMART=y | ||
| 153 | CONFIG_SLIP_MODE_SLIP6=y | ||
| 154 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 155 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=640 | ||
| 156 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480 | ||
| 157 | CONFIG_INPUT_EVDEV=y | ||
| 158 | CONFIG_KEYBOARD_GPIO=y | ||
| 159 | # CONFIG_INPUT_MOUSE is not set | ||
| 160 | CONFIG_INPUT_TOUCHSCREEN=y | ||
| 161 | CONFIG_SERIAL_ATMEL=y | ||
| 162 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 163 | CONFIG_LEGACY_PTY_COUNT=32 | ||
| 164 | CONFIG_HW_RANDOM=y | ||
| 165 | CONFIG_I2C=y | ||
| 166 | CONFIG_I2C_CHARDEV=y | ||
| 167 | CONFIG_I2C_GPIO=y | ||
| 168 | CONFIG_SPI=y | ||
| 169 | CONFIG_SPI_ATMEL=y | ||
| 170 | CONFIG_SPI_BITBANG=y | ||
| 171 | CONFIG_GPIO_SYSFS=y | ||
| 172 | CONFIG_HWMON=m | ||
| 173 | CONFIG_SENSORS_ADM1021=m | ||
| 174 | CONFIG_SENSORS_ADM1025=m | ||
| 175 | CONFIG_SENSORS_ADM1026=m | ||
| 176 | CONFIG_SENSORS_ADM1029=m | ||
| 177 | CONFIG_SENSORS_ADM1031=m | ||
| 178 | CONFIG_SENSORS_ADM9240=m | ||
| 179 | CONFIG_SENSORS_DS1621=m | ||
| 180 | CONFIG_SENSORS_GL518SM=m | ||
| 181 | CONFIG_SENSORS_GL520SM=m | ||
| 182 | CONFIG_SENSORS_IT87=m | ||
| 183 | CONFIG_SENSORS_LM63=m | ||
| 184 | CONFIG_SENSORS_LM73=m | ||
| 185 | CONFIG_SENSORS_LM75=m | ||
| 186 | CONFIG_SENSORS_LM77=m | ||
| 187 | CONFIG_SENSORS_LM78=m | ||
| 188 | CONFIG_SENSORS_LM80=m | ||
| 189 | CONFIG_SENSORS_LM83=m | ||
| 190 | CONFIG_SENSORS_LM85=m | ||
| 191 | CONFIG_SENSORS_LM87=m | ||
| 192 | CONFIG_SENSORS_LM90=m | ||
| 193 | CONFIG_SENSORS_LM92=m | ||
| 194 | CONFIG_SENSORS_MAX1619=m | ||
| 195 | CONFIG_SENSORS_PCF8591=m | ||
| 196 | CONFIG_SENSORS_SMSC47B397=m | ||
| 197 | CONFIG_SENSORS_W83781D=m | ||
| 198 | CONFIG_SENSORS_W83791D=m | ||
| 199 | CONFIG_SENSORS_W83792D=m | ||
| 200 | CONFIG_SENSORS_W83793=m | ||
| 201 | CONFIG_SENSORS_W83L785TS=m | ||
| 202 | CONFIG_WATCHDOG=y | ||
| 203 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 204 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 205 | CONFIG_FB=y | ||
| 206 | CONFIG_FB_MODE_HELPERS=y | ||
| 207 | CONFIG_FB_TILEBLITTING=y | ||
| 208 | CONFIG_FB_S1D13XXX=y | ||
| 209 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 210 | CONFIG_LCD_CLASS_DEVICE=y | ||
| 211 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 212 | # CONFIG_BACKLIGHT_GENERIC is not set | ||
| 213 | CONFIG_DISPLAY_SUPPORT=y | ||
| 214 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
| 215 | CONFIG_FONTS=y | ||
| 216 | CONFIG_FONT_MINI_4x6=y | ||
| 217 | CONFIG_LOGO=y | ||
| 218 | # CONFIG_LOGO_LINUX_MONO is not set | ||
| 219 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
| 220 | CONFIG_USB=y | ||
| 221 | CONFIG_USB_DEVICEFS=y | ||
| 222 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 223 | CONFIG_USB_MON=y | ||
| 224 | CONFIG_USB_OHCI_HCD=y | ||
| 225 | CONFIG_USB_ACM=m | ||
| 226 | CONFIG_USB_PRINTER=m | ||
| 227 | CONFIG_USB_STORAGE=y | ||
| 228 | CONFIG_USB_SERIAL=y | ||
| 229 | CONFIG_USB_SERIAL_CONSOLE=y | ||
| 230 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 231 | CONFIG_USB_SERIAL_FTDI_SIO=y | ||
| 232 | CONFIG_USB_SERIAL_KEYSPAN=y | ||
| 233 | CONFIG_USB_SERIAL_KEYSPAN_MPR=y | ||
| 234 | CONFIG_USB_SERIAL_KEYSPAN_USA28=y | ||
| 235 | CONFIG_USB_SERIAL_KEYSPAN_USA28X=y | ||
| 236 | CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y | ||
| 237 | CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y | ||
| 238 | CONFIG_USB_SERIAL_KEYSPAN_USA19=y | ||
| 239 | CONFIG_USB_SERIAL_KEYSPAN_USA18X=y | ||
| 240 | CONFIG_USB_SERIAL_KEYSPAN_USA19W=y | ||
| 241 | CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y | ||
| 242 | CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y | ||
| 243 | CONFIG_USB_SERIAL_KEYSPAN_USA49W=y | ||
| 244 | CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y | ||
| 245 | CONFIG_USB_SERIAL_MCT_U232=y | ||
| 246 | CONFIG_USB_SERIAL_PL2303=y | ||
| 247 | CONFIG_USB_GADGET=y | ||
| 248 | CONFIG_USB_ETH=m | ||
| 249 | CONFIG_USB_MASS_STORAGE=m | ||
| 250 | CONFIG_MMC=y | ||
| 251 | CONFIG_MMC_AT91=y | ||
| 252 | CONFIG_NEW_LEDS=y | ||
| 253 | CONFIG_LEDS_CLASS=y | ||
| 254 | CONFIG_LEDS_GPIO=y | ||
| 255 | CONFIG_LEDS_TRIGGERS=y | ||
| 256 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
| 257 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 258 | CONFIG_LEDS_TRIGGER_GPIO=y | ||
| 259 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
| 260 | CONFIG_RTC_CLASS=y | ||
| 261 | # CONFIG_RTC_HCTOSYS is not set | ||
| 262 | CONFIG_RTC_DRV_DS1307=y | ||
| 263 | CONFIG_RTC_DRV_PCF8563=y | ||
| 264 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 265 | CONFIG_EXT2_FS=y | ||
| 266 | CONFIG_EXT2_FS_XATTR=y | ||
| 267 | CONFIG_EXT3_FS=y | ||
| 268 | # CONFIG_EXT3_FS_XATTR is not set | ||
| 269 | CONFIG_REISERFS_FS=y | ||
| 270 | CONFIG_AUTOFS4_FS=y | ||
| 271 | CONFIG_ISO9660_FS=y | ||
| 272 | CONFIG_JOLIET=y | ||
| 273 | CONFIG_ZISOFS=y | ||
| 274 | CONFIG_UDF_FS=y | ||
| 275 | CONFIG_MSDOS_FS=y | ||
| 276 | CONFIG_VFAT_FS=y | ||
| 277 | CONFIG_NTFS_FS=m | ||
| 278 | CONFIG_TMPFS=y | ||
| 279 | CONFIG_CONFIGFS_FS=y | ||
| 280 | CONFIG_JFFS2_FS=y | ||
| 281 | CONFIG_JFFS2_SUMMARY=y | ||
| 282 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
| 283 | CONFIG_JFFS2_LZO=y | ||
| 284 | CONFIG_JFFS2_RUBIN=y | ||
| 285 | CONFIG_CRAMFS=y | ||
| 286 | CONFIG_MINIX_FS=y | ||
| 287 | CONFIG_NFS_FS=y | ||
| 288 | CONFIG_NFS_V3=y | ||
| 289 | CONFIG_NFS_V3_ACL=y | ||
| 290 | CONFIG_NFS_V4=y | ||
| 291 | CONFIG_ROOT_NFS=y | ||
| 292 | CONFIG_NFSD=y | ||
| 293 | CONFIG_SMB_FS=m | ||
| 294 | CONFIG_CIFS=m | ||
| 295 | CONFIG_PARTITION_ADVANCED=y | ||
| 296 | CONFIG_MAC_PARTITION=y | ||
| 297 | CONFIG_NLS_CODEPAGE_437=y | ||
| 298 | CONFIG_NLS_CODEPAGE_737=m | ||
| 299 | CONFIG_NLS_CODEPAGE_775=m | ||
| 300 | CONFIG_NLS_CODEPAGE_850=m | ||
| 301 | CONFIG_NLS_CODEPAGE_852=m | ||
| 302 | CONFIG_NLS_CODEPAGE_855=m | ||
| 303 | CONFIG_NLS_CODEPAGE_857=m | ||
| 304 | CONFIG_NLS_CODEPAGE_860=m | ||
| 305 | CONFIG_NLS_CODEPAGE_861=m | ||
| 306 | CONFIG_NLS_CODEPAGE_862=m | ||
| 307 | CONFIG_NLS_CODEPAGE_863=m | ||
| 308 | CONFIG_NLS_CODEPAGE_864=m | ||
| 309 | CONFIG_NLS_CODEPAGE_865=m | ||
| 310 | CONFIG_NLS_CODEPAGE_866=m | ||
| 311 | CONFIG_NLS_CODEPAGE_869=m | ||
| 312 | CONFIG_NLS_CODEPAGE_936=m | ||
| 313 | CONFIG_NLS_CODEPAGE_950=m | ||
| 314 | CONFIG_NLS_CODEPAGE_932=m | ||
| 315 | CONFIG_NLS_CODEPAGE_949=m | ||
| 316 | CONFIG_NLS_CODEPAGE_874=m | ||
| 317 | CONFIG_NLS_ISO8859_8=m | ||
| 318 | CONFIG_NLS_CODEPAGE_1250=m | ||
| 319 | CONFIG_NLS_CODEPAGE_1251=m | ||
| 320 | CONFIG_NLS_ASCII=m | ||
| 321 | CONFIG_NLS_ISO8859_1=y | ||
| 322 | CONFIG_NLS_ISO8859_2=m | ||
| 323 | CONFIG_NLS_ISO8859_3=m | ||
| 324 | CONFIG_NLS_ISO8859_4=m | ||
| 325 | CONFIG_NLS_ISO8859_5=m | ||
| 326 | CONFIG_NLS_ISO8859_6=m | ||
| 327 | CONFIG_NLS_ISO8859_7=m | ||
| 328 | CONFIG_NLS_ISO8859_9=m | ||
| 329 | CONFIG_NLS_ISO8859_13=m | ||
| 330 | CONFIG_NLS_ISO8859_14=m | ||
| 331 | CONFIG_NLS_ISO8859_15=m | ||
| 332 | CONFIG_NLS_KOI8_R=m | ||
| 333 | CONFIG_NLS_KOI8_U=m | ||
| 334 | CONFIG_NLS_UTF8=y | ||
| 335 | CONFIG_MAGIC_SYSRQ=y | ||
| 336 | CONFIG_DEBUG_FS=y | ||
| 337 | CONFIG_DEBUG_KERNEL=y | ||
| 338 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
| 339 | # CONFIG_FTRACE is not set | ||
| 340 | CONFIG_CRYPTO_PCBC=y | ||
| 341 | CONFIG_CRYPTO_SHA1=y | ||
diff --git a/arch/arm/configs/at91rm9200dk_defconfig b/arch/arm/configs/at91rm9200dk_defconfig deleted file mode 100644 index 4438e64f3bfb..000000000000 --- a/arch/arm/configs/at91rm9200dk_defconfig +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 5 | CONFIG_BLK_DEV_INITRD=y | ||
| 6 | CONFIG_MODULES=y | ||
| 7 | CONFIG_MODULE_UNLOAD=y | ||
| 8 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 9 | # CONFIG_IOSCHED_CFQ is not set | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_ARCH_AT91RM9200DK=y | ||
| 12 | CONFIG_MACH_ECO920=y | ||
| 13 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 14 | # CONFIG_ARM_THUMB is not set | ||
| 15 | CONFIG_PCCARD=y | ||
| 16 | CONFIG_AT91_CF=y | ||
| 17 | CONFIG_LEDS=y | ||
| 18 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 19 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 20 | CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 21 | CONFIG_FPE_NWFPE=y | ||
| 22 | CONFIG_NET=y | ||
| 23 | CONFIG_PACKET=y | ||
| 24 | CONFIG_UNIX=y | ||
| 25 | CONFIG_INET=y | ||
| 26 | CONFIG_IP_PNP=y | ||
| 27 | CONFIG_IP_PNP_BOOTP=y | ||
| 28 | # CONFIG_IPV6 is not set | ||
| 29 | CONFIG_MTD=y | ||
| 30 | CONFIG_MTD_PARTITIONS=y | ||
| 31 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 32 | CONFIG_MTD_CHAR=y | ||
| 33 | CONFIG_MTD_BLOCK=y | ||
| 34 | CONFIG_MTD_CFI=y | ||
| 35 | CONFIG_MTD_JEDECPROBE=y | ||
| 36 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 37 | CONFIG_MTD_PHYSMAP=y | ||
| 38 | CONFIG_BLK_DEV_RAM=y | ||
| 39 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 40 | CONFIG_NETDEVICES=y | ||
| 41 | CONFIG_NET_ETHERNET=y | ||
| 42 | CONFIG_ARM_AT91_ETHER=y | ||
| 43 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 44 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 45 | # CONFIG_INPUT_MOUSE is not set | ||
| 46 | # CONFIG_SERIO is not set | ||
| 47 | CONFIG_SERIAL_ATMEL=y | ||
| 48 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 49 | CONFIG_I2C=y | ||
| 50 | CONFIG_I2C_CHARDEV=y | ||
| 51 | CONFIG_I2C_GPIO=y | ||
| 52 | CONFIG_WATCHDOG=y | ||
| 53 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 54 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 55 | # CONFIG_VGA_CONSOLE is not set | ||
| 56 | # CONFIG_USB_HID is not set | ||
| 57 | CONFIG_USB=y | ||
| 58 | CONFIG_USB_DEBUG=y | ||
| 59 | CONFIG_USB_DEVICEFS=y | ||
| 60 | CONFIG_USB_MON=y | ||
| 61 | CONFIG_USB_OHCI_HCD=y | ||
| 62 | CONFIG_USB_GADGET=y | ||
| 63 | CONFIG_MMC=y | ||
| 64 | CONFIG_RTC_CLASS=y | ||
| 65 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 66 | CONFIG_EXT2_FS=y | ||
| 67 | CONFIG_INOTIFY=y | ||
| 68 | CONFIG_TMPFS=y | ||
| 69 | CONFIG_CRAMFS=y | ||
| 70 | CONFIG_DEBUG_KERNEL=y | ||
| 71 | CONFIG_DEBUG_USER=y | ||
| 72 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/at91rm9200ek_defconfig b/arch/arm/configs/at91rm9200ek_defconfig deleted file mode 100644 index ccd517c64bc7..000000000000 --- a/arch/arm/configs/at91rm9200ek_defconfig +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 3 | # CONFIG_SWAP is not set | ||
| 4 | CONFIG_SYSVIPC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_BLK_DEV_INITRD=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 10 | # CONFIG_IOSCHED_CFQ is not set | ||
| 11 | CONFIG_ARCH_AT91=y | ||
| 12 | CONFIG_MACH_AT91RM9200EK=y | ||
| 13 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 14 | # CONFIG_ARM_THUMB is not set | ||
| 15 | CONFIG_LEDS=y | ||
| 16 | CONFIG_LEDS_CPU=y | ||
| 17 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 18 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 19 | CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 20 | CONFIG_FPE_NWFPE=y | ||
| 21 | CONFIG_NET=y | ||
| 22 | CONFIG_PACKET=y | ||
| 23 | CONFIG_UNIX=y | ||
| 24 | CONFIG_INET=y | ||
| 25 | CONFIG_IP_PNP=y | ||
| 26 | CONFIG_IP_PNP_BOOTP=y | ||
| 27 | # CONFIG_IPV6 is not set | ||
| 28 | CONFIG_MTD=y | ||
| 29 | CONFIG_MTD_PARTITIONS=y | ||
| 30 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 31 | CONFIG_MTD_CHAR=y | ||
| 32 | CONFIG_MTD_BLOCK=y | ||
| 33 | CONFIG_MTD_CFI=y | ||
| 34 | CONFIG_MTD_JEDECPROBE=y | ||
| 35 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 36 | CONFIG_MTD_PHYSMAP=y | ||
| 37 | CONFIG_BLK_DEV_RAM=y | ||
| 38 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 39 | CONFIG_NETDEVICES=y | ||
| 40 | CONFIG_NET_ETHERNET=y | ||
| 41 | CONFIG_ARM_AT91_ETHER=y | ||
| 42 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 43 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 44 | # CONFIG_INPUT_MOUSE is not set | ||
| 45 | # CONFIG_SERIO is not set | ||
| 46 | CONFIG_SERIAL_ATMEL=y | ||
| 47 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 48 | CONFIG_I2C=y | ||
| 49 | CONFIG_I2C_CHARDEV=y | ||
| 50 | CONFIG_I2C_GPIO=y | ||
| 51 | CONFIG_WATCHDOG=y | ||
| 52 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 53 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 54 | CONFIG_FB=y | ||
| 55 | CONFIG_FB_S1D13XXX=y | ||
| 56 | # CONFIG_VGA_CONSOLE is not set | ||
| 57 | # CONFIG_USB_HID is not set | ||
| 58 | CONFIG_USB=y | ||
| 59 | CONFIG_USB_DEBUG=y | ||
| 60 | CONFIG_USB_DEVICEFS=y | ||
| 61 | CONFIG_USB_MON=y | ||
| 62 | CONFIG_USB_OHCI_HCD=y | ||
| 63 | CONFIG_USB_GADGET=y | ||
| 64 | CONFIG_MMC=y | ||
| 65 | CONFIG_RTC_CLASS=y | ||
| 66 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 67 | CONFIG_EXT2_FS=y | ||
| 68 | CONFIG_INOTIFY=y | ||
| 69 | CONFIG_TMPFS=y | ||
| 70 | CONFIG_CRAMFS=y | ||
| 71 | CONFIG_DEBUG_KERNEL=y | ||
| 72 | CONFIG_DEBUG_USER=y | ||
| 73 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/ateb9200_defconfig b/arch/arm/configs/ateb9200_defconfig deleted file mode 100644 index 1b0e9a1689bb..000000000000 --- a/arch/arm/configs/ateb9200_defconfig +++ /dev/null | |||
| @@ -1,131 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | ||
| 3 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 4 | CONFIG_EMBEDDED=y | ||
| 5 | CONFIG_SLAB=y | ||
| 6 | CONFIG_PROFILING=y | ||
| 7 | CONFIG_OPROFILE=m | ||
| 8 | CONFIG_MODULES=y | ||
| 9 | CONFIG_MODULE_UNLOAD=y | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_MACH_ATEB9200=y | ||
| 12 | CONFIG_PCCARD=m | ||
| 13 | CONFIG_AT91_CF=m | ||
| 14 | CONFIG_PREEMPT=y | ||
| 15 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 16 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 17 | CONFIG_FPE_NWFPE=y | ||
| 18 | CONFIG_PM=y | ||
| 19 | CONFIG_NET=y | ||
| 20 | CONFIG_PACKET=y | ||
| 21 | CONFIG_UNIX=y | ||
| 22 | CONFIG_NET_KEY=y | ||
| 23 | CONFIG_INET=y | ||
| 24 | # CONFIG_IPV6 is not set | ||
| 25 | CONFIG_BRIDGE=m | ||
| 26 | CONFIG_VLAN_8021Q=m | ||
| 27 | CONFIG_MTD=y | ||
| 28 | CONFIG_MTD_PARTITIONS=y | ||
| 29 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 30 | CONFIG_MTD_CHAR=y | ||
| 31 | CONFIG_MTD_BLOCK_RO=y | ||
| 32 | CONFIG_BLK_DEV_LOOP=m | ||
| 33 | CONFIG_BLK_DEV_NBD=m | ||
| 34 | CONFIG_SCSI=m | ||
| 35 | CONFIG_BLK_DEV_SD=m | ||
| 36 | CONFIG_BLK_DEV_SR=m | ||
| 37 | CONFIG_BLK_DEV_SR_VENDOR=y | ||
| 38 | CONFIG_CHR_DEV_SG=m | ||
| 39 | CONFIG_SCSI_MULTI_LUN=y | ||
| 40 | CONFIG_NETDEVICES=y | ||
| 41 | CONFIG_DUMMY=m | ||
| 42 | CONFIG_TUN=m | ||
| 43 | CONFIG_PHYLIB=y | ||
| 44 | CONFIG_DAVICOM_PHY=y | ||
| 45 | CONFIG_NET_ETHERNET=y | ||
| 46 | CONFIG_ARM_AT91_ETHER=y | ||
| 47 | CONFIG_USB_USBNET=y | ||
| 48 | CONFIG_USB_NET_GL620A=y | ||
| 49 | CONFIG_USB_NET_PLUSB=y | ||
| 50 | CONFIG_USB_NET_RNDIS_HOST=y | ||
| 51 | CONFIG_USB_ALI_M5632=y | ||
| 52 | CONFIG_USB_AN2720=y | ||
| 53 | CONFIG_USB_EPSON2888=y | ||
| 54 | CONFIG_PPP=m | ||
| 55 | CONFIG_PPP_ASYNC=m | ||
| 56 | CONFIG_PPP_SYNC_TTY=m | ||
| 57 | CONFIG_PPP_DEFLATE=m | ||
| 58 | CONFIG_PPP_BSDCOMP=m | ||
| 59 | CONFIG_PPPOE=m | ||
| 60 | CONFIG_SERIAL_ATMEL=y | ||
| 61 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 62 | CONFIG_I2C=m | ||
| 63 | CONFIG_I2C_CHARDEV=m | ||
| 64 | CONFIG_I2C_GPIO=m | ||
| 65 | # CONFIG_VGA_CONSOLE is not set | ||
| 66 | CONFIG_SOUND=y | ||
| 67 | CONFIG_USB_HID=m | ||
| 68 | CONFIG_HID_PID=y | ||
| 69 | CONFIG_USB_HIDDEV=y | ||
| 70 | CONFIG_USB=y | ||
| 71 | CONFIG_USB_DEVICEFS=y | ||
| 72 | CONFIG_USB_MON=y | ||
| 73 | CONFIG_USB_OHCI_HCD=y | ||
| 74 | CONFIG_USB_ACM=m | ||
| 75 | CONFIG_USB_PRINTER=m | ||
| 76 | CONFIG_USB_STORAGE=m | ||
| 77 | CONFIG_USB_STORAGE_DATAFAB=m | ||
| 78 | CONFIG_USB_STORAGE_FREECOM=m | ||
| 79 | CONFIG_USB_STORAGE_USBAT=m | ||
| 80 | CONFIG_USB_STORAGE_SDDR09=m | ||
| 81 | CONFIG_USB_STORAGE_SDDR55=m | ||
| 82 | CONFIG_USB_STORAGE_JUMPSHOT=m | ||
| 83 | CONFIG_USB_SERIAL=m | ||
| 84 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 85 | CONFIG_USB_SERIAL_FTDI_SIO=m | ||
| 86 | CONFIG_USB_SERIAL_PL2303=m | ||
| 87 | CONFIG_USB_GADGET=m | ||
| 88 | CONFIG_USB_ETH=m | ||
| 89 | CONFIG_USB_GADGETFS=m | ||
| 90 | CONFIG_USB_FILE_STORAGE=m | ||
| 91 | CONFIG_USB_G_SERIAL=m | ||
| 92 | CONFIG_MMC=m | ||
| 93 | CONFIG_MMC_DEBUG=y | ||
| 94 | CONFIG_RTC_CLASS=y | ||
| 95 | # CONFIG_RTC_HCTOSYS is not set | ||
| 96 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 97 | CONFIG_EXT2_FS=m | ||
| 98 | CONFIG_EXT3_FS=m | ||
| 99 | CONFIG_REISERFS_FS=m | ||
| 100 | CONFIG_INOTIFY=y | ||
| 101 | CONFIG_ISO9660_FS=m | ||
| 102 | CONFIG_JOLIET=y | ||
| 103 | CONFIG_ZISOFS=y | ||
| 104 | CONFIG_UDF_FS=m | ||
| 105 | CONFIG_MSDOS_FS=m | ||
| 106 | CONFIG_VFAT_FS=m | ||
| 107 | CONFIG_NTFS_FS=m | ||
| 108 | CONFIG_NTFS_RW=y | ||
| 109 | CONFIG_TMPFS=y | ||
| 110 | CONFIG_CRAMFS=y | ||
| 111 | CONFIG_NFS_FS=m | ||
| 112 | CONFIG_NFS_V3=y | ||
| 113 | CONFIG_NFS_V3_ACL=y | ||
| 114 | CONFIG_NFS_V4=y | ||
| 115 | CONFIG_NFSD=m | ||
| 116 | CONFIG_NFSD_V4=y | ||
| 117 | CONFIG_PARTITION_ADVANCED=y | ||
| 118 | CONFIG_MAC_PARTITION=y | ||
| 119 | CONFIG_BSD_DISKLABEL=y | ||
| 120 | CONFIG_MINIX_SUBPARTITION=y | ||
| 121 | CONFIG_SOLARIS_X86_PARTITION=y | ||
| 122 | CONFIG_UNIXWARE_DISKLABEL=y | ||
| 123 | CONFIG_NLS_CODEPAGE_932=m | ||
| 124 | CONFIG_NLS_ASCII=m | ||
| 125 | CONFIG_NLS_ISO8859_15=m | ||
| 126 | CONFIG_NLS_UTF8=m | ||
| 127 | CONFIG_CRYPTO_MD5=y | ||
| 128 | CONFIG_CRYPTO_MICHAEL_MIC=m | ||
| 129 | CONFIG_CRYPTO_ARC4=m | ||
| 130 | CONFIG_CRC16=m | ||
| 131 | CONFIG_LIBCRC32C=m | ||
diff --git a/arch/arm/configs/carmeva_defconfig b/arch/arm/configs/carmeva_defconfig deleted file mode 100644 index ac64dbd8a49c..000000000000 --- a/arch/arm/configs/carmeva_defconfig +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 3 | CONFIG_BLK_DEV_INITRD=y | ||
| 4 | CONFIG_EMBEDDED=y | ||
| 5 | # CONFIG_HOTPLUG is not set | ||
| 6 | CONFIG_MODULES=y | ||
| 7 | CONFIG_MODULE_UNLOAD=y | ||
| 8 | CONFIG_MODULE_FORCE_UNLOAD=y | ||
| 9 | CONFIG_ARCH_AT91=y | ||
| 10 | CONFIG_MACH_CARMEVA=y | ||
| 11 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 12 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 13 | CONFIG_FPE_NWFPE=y | ||
| 14 | CONFIG_NET=y | ||
| 15 | CONFIG_UNIX=y | ||
| 16 | CONFIG_INET=y | ||
| 17 | CONFIG_IP_MULTICAST=y | ||
| 18 | CONFIG_IP_PNP=y | ||
| 19 | # CONFIG_IPV6 is not set | ||
| 20 | CONFIG_MTD=y | ||
| 21 | CONFIG_MTD_PARTITIONS=y | ||
| 22 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 23 | CONFIG_MTD_CHAR=y | ||
| 24 | CONFIG_MTD_BLOCK=y | ||
| 25 | CONFIG_BLK_DEV_RAM=y | ||
| 26 | CONFIG_NETDEVICES=y | ||
| 27 | CONFIG_NET_ETHERNET=y | ||
| 28 | CONFIG_ARM_AT91_ETHER=y | ||
| 29 | # CONFIG_INPUT_MOUSEDEV is not set | ||
| 30 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 31 | # CONFIG_INPUT_MOUSE is not set | ||
| 32 | CONFIG_SERIO=m | ||
| 33 | CONFIG_SERIAL_ATMEL=y | ||
| 34 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 35 | # CONFIG_VGA_CONSOLE is not set | ||
| 36 | CONFIG_MMC=m | ||
| 37 | CONFIG_MMC_DEBUG=y | ||
| 38 | CONFIG_EXT2_FS=y | ||
| 39 | CONFIG_EXT2_FS_XATTR=y | ||
| 40 | # CONFIG_DNOTIFY is not set | ||
| 41 | CONFIG_JFFS2_FS=y | ||
| 42 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
| 43 | CONFIG_NFS_FS=y | ||
| 44 | CONFIG_NFS_V3=y | ||
| 45 | CONFIG_NFS_V4=y | ||
| 46 | CONFIG_ROOT_NFS=y | ||
| 47 | CONFIG_NFSD=y | ||
diff --git a/arch/arm/configs/cpuat91_defconfig b/arch/arm/configs/cpuat91_defconfig deleted file mode 100644 index 022aeb55b676..000000000000 --- a/arch/arm/configs/cpuat91_defconfig +++ /dev/null | |||
| @@ -1,112 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 3 | # CONFIG_SWAP is not set | ||
| 4 | CONFIG_SYSVIPC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_BLK_DEV_BSG is not set | ||
| 10 | # CONFIG_IOSCHED_CFQ is not set | ||
| 11 | CONFIG_ARCH_AT91=y | ||
| 12 | CONFIG_MACH_CPUAT91=y | ||
| 13 | CONFIG_AT91_TIMER_HZ=100 | ||
| 14 | # CONFIG_ARM_THUMB is not set | ||
| 15 | CONFIG_PREEMPT=y | ||
| 16 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 17 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 18 | CONFIG_NET=y | ||
| 19 | CONFIG_PACKET=y | ||
| 20 | CONFIG_UNIX=y | ||
| 21 | CONFIG_INET=y | ||
| 22 | CONFIG_IP_PNP=y | ||
| 23 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
| 24 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
| 25 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
| 26 | # CONFIG_IPV6 is not set | ||
| 27 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 28 | CONFIG_MTD=y | ||
| 29 | CONFIG_MTD_PARTITIONS=y | ||
| 30 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 31 | CONFIG_MTD_CHAR=y | ||
| 32 | CONFIG_MTD_BLOCK=y | ||
| 33 | CONFIG_MTD_CFI=y | ||
| 34 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 35 | CONFIG_MTD_PHYSMAP=y | ||
| 36 | CONFIG_MTD_PLATRAM=y | ||
| 37 | CONFIG_BLK_DEV_LOOP=y | ||
| 38 | CONFIG_BLK_DEV_NBD=y | ||
| 39 | CONFIG_BLK_DEV_RAM=y | ||
| 40 | # CONFIG_MISC_DEVICES is not set | ||
| 41 | CONFIG_SCSI=y | ||
| 42 | CONFIG_BLK_DEV_SD=y | ||
| 43 | CONFIG_SCSI_MULTI_LUN=y | ||
| 44 | # CONFIG_SCSI_LOWLEVEL is not set | ||
| 45 | CONFIG_NETDEVICES=y | ||
| 46 | CONFIG_PHYLIB=y | ||
| 47 | CONFIG_NET_ETHERNET=y | ||
| 48 | CONFIG_ARM_AT91_ETHER=y | ||
| 49 | # CONFIG_NETDEV_1000 is not set | ||
| 50 | # CONFIG_NETDEV_10000 is not set | ||
| 51 | CONFIG_PPP=y | ||
| 52 | CONFIG_PPP_ASYNC=y | ||
| 53 | CONFIG_PPP_DEFLATE=y | ||
| 54 | CONFIG_PPP_BSDCOMP=y | ||
| 55 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 56 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 57 | # CONFIG_INPUT_MOUSE is not set | ||
| 58 | # CONFIG_SERIO is not set | ||
| 59 | CONFIG_SERIAL_ATMEL=y | ||
| 60 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 61 | CONFIG_LEGACY_PTY_COUNT=32 | ||
| 62 | # CONFIG_HW_RANDOM is not set | ||
| 63 | CONFIG_I2C=y | ||
| 64 | CONFIG_I2C_CHARDEV=y | ||
| 65 | CONFIG_I2C_GPIO=y | ||
| 66 | CONFIG_GPIO_SYSFS=y | ||
| 67 | # CONFIG_HWMON is not set | ||
| 68 | CONFIG_WATCHDOG=y | ||
| 69 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 70 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 71 | # CONFIG_VGA_CONSOLE is not set | ||
| 72 | # CONFIG_HID_SUPPORT is not set | ||
| 73 | CONFIG_USB=y | ||
| 74 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 75 | CONFIG_USB_OHCI_HCD=y | ||
| 76 | CONFIG_USB_STORAGE=y | ||
| 77 | CONFIG_USB_GADGET=y | ||
| 78 | CONFIG_USB_ETH=m | ||
| 79 | CONFIG_MMC=y | ||
| 80 | CONFIG_MMC_AT91=m | ||
| 81 | CONFIG_NEW_LEDS=y | ||
| 82 | CONFIG_LEDS_CLASS=y | ||
| 83 | CONFIG_LEDS_GPIO=y | ||
| 84 | CONFIG_LEDS_TRIGGERS=y | ||
| 85 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
| 86 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 87 | CONFIG_LEDS_TRIGGER_GPIO=y | ||
| 88 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
| 89 | CONFIG_RTC_CLASS=y | ||
| 90 | # CONFIG_RTC_HCTOSYS is not set | ||
| 91 | CONFIG_RTC_DRV_DS1307=y | ||
| 92 | CONFIG_RTC_DRV_PCF8563=y | ||
| 93 | CONFIG_EXT2_FS=y | ||
| 94 | CONFIG_EXT3_FS=y | ||
| 95 | # CONFIG_EXT3_FS_XATTR is not set | ||
| 96 | CONFIG_INOTIFY=y | ||
| 97 | CONFIG_AUTOFS4_FS=y | ||
| 98 | CONFIG_MSDOS_FS=y | ||
| 99 | CONFIG_VFAT_FS=y | ||
| 100 | CONFIG_TMPFS=y | ||
| 101 | CONFIG_JFFS2_FS=y | ||
| 102 | CONFIG_JFFS2_SUMMARY=y | ||
| 103 | CONFIG_CRAMFS=y | ||
| 104 | CONFIG_MINIX_FS=y | ||
| 105 | CONFIG_NFS_FS=y | ||
| 106 | CONFIG_NFS_V3=y | ||
| 107 | CONFIG_ROOT_NFS=y | ||
| 108 | CONFIG_PARTITION_ADVANCED=y | ||
| 109 | CONFIG_NLS_CODEPAGE_437=y | ||
| 110 | CONFIG_NLS_ISO8859_1=y | ||
| 111 | CONFIG_NLS_UTF8=y | ||
| 112 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
diff --git a/arch/arm/configs/csb337_defconfig b/arch/arm/configs/csb337_defconfig deleted file mode 100644 index a24c448840c4..000000000000 --- a/arch/arm/configs/csb337_defconfig +++ /dev/null | |||
| @@ -1,104 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 5 | CONFIG_BLK_DEV_INITRD=y | ||
| 6 | CONFIG_MODULES=y | ||
| 7 | CONFIG_MODULE_UNLOAD=y | ||
| 8 | # CONFIG_BLK_DEV_BSG is not set | ||
| 9 | CONFIG_ARCH_AT91=y | ||
| 10 | CONFIG_MACH_CSB337=y | ||
| 11 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 12 | # CONFIG_ARM_THUMB is not set | ||
| 13 | CONFIG_PCCARD=y | ||
| 14 | CONFIG_AT91_CF=y | ||
| 15 | CONFIG_LEDS=y | ||
| 16 | CONFIG_LEDS_CPU=y | ||
| 17 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 18 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 19 | CONFIG_CMDLINE="mem=32M console=ttyS0,38400 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 20 | CONFIG_FPE_NWFPE=y | ||
| 21 | CONFIG_NET=y | ||
| 22 | CONFIG_PACKET=y | ||
| 23 | CONFIG_UNIX=y | ||
| 24 | CONFIG_INET=y | ||
| 25 | CONFIG_IP_PNP=y | ||
| 26 | CONFIG_IP_PNP_DHCP=y | ||
| 27 | CONFIG_IP_PNP_BOOTP=y | ||
| 28 | # CONFIG_INET_LRO is not set | ||
| 29 | # CONFIG_IPV6 is not set | ||
| 30 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 31 | CONFIG_MTD=y | ||
| 32 | CONFIG_MTD_PARTITIONS=y | ||
| 33 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 34 | CONFIG_MTD_CHAR=y | ||
| 35 | CONFIG_MTD_BLOCK=y | ||
| 36 | CONFIG_MTD_CFI=y | ||
| 37 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 38 | CONFIG_MTD_PHYSMAP=y | ||
| 39 | CONFIG_BLK_DEV_LOOP=y | ||
| 40 | CONFIG_BLK_DEV_RAM=y | ||
| 41 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 42 | CONFIG_ATMEL_SSC=y | ||
| 43 | CONFIG_SCSI=y | ||
| 44 | CONFIG_NETDEVICES=y | ||
| 45 | CONFIG_NET_ETHERNET=y | ||
| 46 | CONFIG_ARM_AT91_ETHER=y | ||
| 47 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 48 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 49 | # CONFIG_INPUT_MOUSE is not set | ||
| 50 | # CONFIG_SERIO is not set | ||
| 51 | CONFIG_SERIAL_ATMEL=y | ||
| 52 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 53 | # CONFIG_HW_RANDOM is not set | ||
| 54 | CONFIG_I2C=y | ||
| 55 | CONFIG_I2C_CHARDEV=y | ||
| 56 | CONFIG_I2C_GPIO=y | ||
| 57 | # CONFIG_HWMON is not set | ||
| 58 | CONFIG_WATCHDOG=y | ||
| 59 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 60 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 61 | # CONFIG_VGA_CONSOLE is not set | ||
| 62 | # CONFIG_USB_HID is not set | ||
| 63 | CONFIG_USB=y | ||
| 64 | CONFIG_USB_DEBUG=y | ||
| 65 | CONFIG_USB_DEVICEFS=y | ||
| 66 | CONFIG_USB_MON=y | ||
| 67 | CONFIG_USB_OHCI_HCD=y | ||
| 68 | CONFIG_USB_STORAGE=y | ||
| 69 | CONFIG_USB_SERIAL=y | ||
| 70 | CONFIG_USB_SERIAL_CONSOLE=y | ||
| 71 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 72 | CONFIG_USB_SERIAL_FTDI_SIO=y | ||
| 73 | CONFIG_USB_SERIAL_KEYSPAN=y | ||
| 74 | CONFIG_USB_SERIAL_KEYSPAN_MPR=y | ||
| 75 | CONFIG_USB_SERIAL_KEYSPAN_USA28=y | ||
| 76 | CONFIG_USB_SERIAL_KEYSPAN_USA28X=y | ||
| 77 | CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y | ||
| 78 | CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y | ||
| 79 | CONFIG_USB_SERIAL_KEYSPAN_USA19=y | ||
| 80 | CONFIG_USB_SERIAL_KEYSPAN_USA18X=y | ||
| 81 | CONFIG_USB_SERIAL_KEYSPAN_USA19W=y | ||
| 82 | CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y | ||
| 83 | CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y | ||
| 84 | CONFIG_USB_SERIAL_KEYSPAN_USA49W=y | ||
| 85 | CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y | ||
| 86 | CONFIG_USB_SERIAL_MCT_U232=y | ||
| 87 | CONFIG_USB_GADGET=y | ||
| 88 | CONFIG_MMC=y | ||
| 89 | CONFIG_RTC_CLASS=y | ||
| 90 | CONFIG_RTC_HCTOSYS_DEVICE="rtc1" | ||
| 91 | # CONFIG_RTC_INTF_SYSFS is not set | ||
| 92 | CONFIG_RTC_DRV_DS1307=y | ||
| 93 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 94 | CONFIG_EXT2_FS=y | ||
| 95 | CONFIG_INOTIFY=y | ||
| 96 | CONFIG_TMPFS=y | ||
| 97 | CONFIG_CRAMFS=y | ||
| 98 | CONFIG_NFS_FS=y | ||
| 99 | CONFIG_NFS_V3=y | ||
| 100 | CONFIG_NFS_V4=y | ||
| 101 | CONFIG_ROOT_NFS=y | ||
| 102 | CONFIG_DEBUG_KERNEL=y | ||
| 103 | CONFIG_DEBUG_USER=y | ||
| 104 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/csb637_defconfig b/arch/arm/configs/csb637_defconfig deleted file mode 100644 index 98552adac5fb..000000000000 --- a/arch/arm/configs/csb637_defconfig +++ /dev/null | |||
| @@ -1,98 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 5 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
| 6 | CONFIG_BLK_DEV_INITRD=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_BLK_DEV_BSG is not set | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_MACH_CSB637=y | ||
| 12 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 13 | # CONFIG_ARM_THUMB is not set | ||
| 14 | CONFIG_PCCARD=y | ||
| 15 | CONFIG_AT91_CF=y | ||
| 16 | CONFIG_LEDS=y | ||
| 17 | CONFIG_LEDS_CPU=y | ||
| 18 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 19 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 20 | CONFIG_CMDLINE="mem=32M console=ttyS0,38400 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 21 | CONFIG_FPE_NWFPE=y | ||
| 22 | CONFIG_NET=y | ||
| 23 | CONFIG_PACKET=y | ||
| 24 | CONFIG_UNIX=y | ||
| 25 | CONFIG_INET=y | ||
| 26 | CONFIG_IP_PNP=y | ||
| 27 | CONFIG_IP_PNP_DHCP=y | ||
| 28 | CONFIG_IP_PNP_BOOTP=y | ||
| 29 | # CONFIG_INET_LRO is not set | ||
| 30 | # CONFIG_IPV6 is not set | ||
| 31 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 32 | CONFIG_MTD=y | ||
| 33 | CONFIG_MTD_PARTITIONS=y | ||
| 34 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 35 | CONFIG_MTD_CHAR=y | ||
| 36 | CONFIG_MTD_BLOCK=y | ||
| 37 | CONFIG_MTD_CFI=y | ||
| 38 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 39 | CONFIG_MTD_PHYSMAP=y | ||
| 40 | CONFIG_BLK_DEV_LOOP=y | ||
| 41 | CONFIG_BLK_DEV_RAM=y | ||
| 42 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 43 | CONFIG_SCSI=y | ||
| 44 | CONFIG_NETDEVICES=y | ||
| 45 | CONFIG_NET_ETHERNET=y | ||
| 46 | CONFIG_ARM_AT91_ETHER=y | ||
| 47 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 48 | # CONFIG_INPUT_MOUSE is not set | ||
| 49 | # CONFIG_SERIO is not set | ||
| 50 | CONFIG_SERIAL_ATMEL=y | ||
| 51 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 52 | CONFIG_I2C=y | ||
| 53 | CONFIG_I2C_CHARDEV=y | ||
| 54 | CONFIG_WATCHDOG=y | ||
| 55 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 56 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 57 | # CONFIG_VGA_CONSOLE is not set | ||
| 58 | # CONFIG_USB_HID is not set | ||
| 59 | CONFIG_USB=y | ||
| 60 | CONFIG_USB_DEBUG=y | ||
| 61 | CONFIG_USB_DEVICEFS=y | ||
| 62 | CONFIG_USB_MON=y | ||
| 63 | CONFIG_USB_OHCI_HCD=y | ||
| 64 | CONFIG_USB_STORAGE=y | ||
| 65 | CONFIG_USB_SERIAL=y | ||
| 66 | CONFIG_USB_SERIAL_CONSOLE=y | ||
| 67 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 68 | CONFIG_USB_SERIAL_FTDI_SIO=y | ||
| 69 | CONFIG_USB_SERIAL_KEYSPAN=y | ||
| 70 | CONFIG_USB_SERIAL_KEYSPAN_MPR=y | ||
| 71 | CONFIG_USB_SERIAL_KEYSPAN_USA28=y | ||
| 72 | CONFIG_USB_SERIAL_KEYSPAN_USA28X=y | ||
| 73 | CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y | ||
| 74 | CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y | ||
| 75 | CONFIG_USB_SERIAL_KEYSPAN_USA19=y | ||
| 76 | CONFIG_USB_SERIAL_KEYSPAN_USA18X=y | ||
| 77 | CONFIG_USB_SERIAL_KEYSPAN_USA19W=y | ||
| 78 | CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y | ||
| 79 | CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y | ||
| 80 | CONFIG_USB_SERIAL_KEYSPAN_USA49W=y | ||
| 81 | CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y | ||
| 82 | CONFIG_USB_SERIAL_MCT_U232=y | ||
| 83 | CONFIG_NEW_LEDS=y | ||
| 84 | CONFIG_LEDS_CLASS=y | ||
| 85 | CONFIG_LEDS_GPIO=y | ||
| 86 | CONFIG_LEDS_TRIGGERS=y | ||
| 87 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 88 | CONFIG_EXT2_FS=y | ||
| 89 | CONFIG_INOTIFY=y | ||
| 90 | CONFIG_TMPFS=y | ||
| 91 | CONFIG_CRAMFS=y | ||
| 92 | CONFIG_NFS_FS=y | ||
| 93 | CONFIG_NFS_V3=y | ||
| 94 | CONFIG_NFS_V4=y | ||
| 95 | CONFIG_ROOT_NFS=y | ||
| 96 | CONFIG_DEBUG_KERNEL=y | ||
| 97 | CONFIG_DEBUG_USER=y | ||
| 98 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/ecbat91_defconfig b/arch/arm/configs/ecbat91_defconfig deleted file mode 100644 index 6bb6abdcea8c..000000000000 --- a/arch/arm/configs/ecbat91_defconfig +++ /dev/null | |||
| @@ -1,99 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | ||
| 3 | CONFIG_IKCONFIG=y | ||
| 4 | CONFIG_IKCONFIG_PROC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_SLAB=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 10 | # CONFIG_IOSCHED_CFQ is not set | ||
| 11 | CONFIG_ARCH_AT91=y | ||
| 12 | CONFIG_MACH_ECBAT91=y | ||
| 13 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 14 | CONFIG_PCCARD=y | ||
| 15 | CONFIG_AT91_CF=y | ||
| 16 | CONFIG_PREEMPT=y | ||
| 17 | CONFIG_LEDS=y | ||
| 18 | CONFIG_LEDS_CPU=y | ||
| 19 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 20 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 21 | CONFIG_CMDLINE="rootfstype=reiserfs root=/dev/mmcblk0p1 console=ttyS0,115200n8 rootdelay=1" | ||
| 22 | CONFIG_FPE_NWFPE=y | ||
| 23 | CONFIG_NET=y | ||
| 24 | CONFIG_PACKET=y | ||
| 25 | CONFIG_UNIX=y | ||
| 26 | CONFIG_INET=y | ||
| 27 | CONFIG_IP_PNP=y | ||
| 28 | CONFIG_IP_PNP_DHCP=y | ||
| 29 | # CONFIG_IPV6 is not set | ||
| 30 | CONFIG_CFG80211=y | ||
| 31 | CONFIG_MAC80211=y | ||
| 32 | # CONFIG_STANDALONE is not set | ||
| 33 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | ||
| 34 | CONFIG_MTD=y | ||
| 35 | CONFIG_MTD_PARTITIONS=y | ||
| 36 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 37 | CONFIG_MTD_AFS_PARTS=y | ||
| 38 | CONFIG_MTD_CHAR=y | ||
| 39 | CONFIG_MTD_BLOCK=y | ||
| 40 | CONFIG_MTD_DATAFLASH=y | ||
| 41 | CONFIG_BLK_DEV_LOOP=y | ||
| 42 | CONFIG_SCSI=y | ||
| 43 | CONFIG_BLK_DEV_SD=y | ||
| 44 | CONFIG_CHR_DEV_SG=y | ||
| 45 | CONFIG_NETDEVICES=y | ||
| 46 | CONFIG_NET_ETHERNET=y | ||
| 47 | CONFIG_ARM_AT91_ETHER=y | ||
| 48 | # CONFIG_NETDEV_1000 is not set | ||
| 49 | # CONFIG_NETDEV_10000 is not set | ||
| 50 | CONFIG_PPP=y | ||
| 51 | CONFIG_PPP_MULTILINK=y | ||
| 52 | CONFIG_PPP_FILTER=y | ||
| 53 | CONFIG_PPP_ASYNC=y | ||
| 54 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 55 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 56 | # CONFIG_INPUT_MOUSE is not set | ||
| 57 | # CONFIG_SERIO is not set | ||
| 58 | CONFIG_SERIAL_ATMEL=y | ||
| 59 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 60 | CONFIG_HW_RANDOM=y | ||
| 61 | CONFIG_I2C=y | ||
| 62 | CONFIG_I2C_CHARDEV=y | ||
| 63 | CONFIG_SPI=y | ||
| 64 | CONFIG_SPI_BITBANG=y | ||
| 65 | CONFIG_WATCHDOG=y | ||
| 66 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 67 | # CONFIG_VGA_CONSOLE is not set | ||
| 68 | # CONFIG_USB_HID is not set | ||
| 69 | CONFIG_USB=y | ||
| 70 | CONFIG_USB_DEVICEFS=y | ||
| 71 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 72 | CONFIG_USB_OHCI_HCD=y | ||
| 73 | CONFIG_USB_PRINTER=y | ||
| 74 | CONFIG_USB_STORAGE=y | ||
| 75 | CONFIG_USB_GADGET=y | ||
| 76 | CONFIG_MMC=y | ||
| 77 | CONFIG_MMC_DEBUG=y | ||
| 78 | CONFIG_MMC_AT91=m | ||
| 79 | CONFIG_NEW_LEDS=y | ||
| 80 | CONFIG_LEDS_CLASS=y | ||
| 81 | CONFIG_RTC_CLASS=y | ||
| 82 | # CONFIG_RTC_HCTOSYS is not set | ||
| 83 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 84 | CONFIG_EXT2_FS=y | ||
| 85 | CONFIG_EXT3_FS=y | ||
| 86 | CONFIG_REISERFS_FS=y | ||
| 87 | CONFIG_INOTIFY=y | ||
| 88 | CONFIG_TMPFS=y | ||
| 89 | CONFIG_CONFIGFS_FS=y | ||
| 90 | CONFIG_CRAMFS=y | ||
| 91 | CONFIG_NFS_FS=y | ||
| 92 | CONFIG_NFS_V3=y | ||
| 93 | CONFIG_NFS_V3_ACL=y | ||
| 94 | CONFIG_NFS_V4=y | ||
| 95 | CONFIG_ROOT_NFS=y | ||
| 96 | CONFIG_PARTITION_ADVANCED=y | ||
| 97 | CONFIG_DEBUG_USER=y | ||
| 98 | CONFIG_CRYPTO_PCBC=y | ||
| 99 | CONFIG_CRYPTO_SHA1=y | ||
diff --git a/arch/arm/configs/kafa_defconfig b/arch/arm/configs/kafa_defconfig deleted file mode 100644 index 896dbe00dc6e..000000000000 --- a/arch/arm/configs/kafa_defconfig +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 3 | # CONFIG_SWAP is not set | ||
| 4 | CONFIG_SYSVIPC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_SLAB=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_IOSCHED_CFQ is not set | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_MACH_KAFA=y | ||
| 12 | # CONFIG_ARM_THUMB is not set | ||
| 13 | CONFIG_PREEMPT=y | ||
| 14 | CONFIG_LEDS=y | ||
| 15 | CONFIG_LEDS_CPU=y | ||
| 16 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 17 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 18 | CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20800000,10M root=/dev/ram0 rw" | ||
| 19 | CONFIG_FPE_NWFPE=y | ||
| 20 | CONFIG_BINFMT_MISC=y | ||
| 21 | CONFIG_NET=y | ||
| 22 | CONFIG_PACKET=y | ||
| 23 | CONFIG_UNIX=y | ||
| 24 | CONFIG_INET=y | ||
| 25 | # CONFIG_INET_DIAG is not set | ||
| 26 | # CONFIG_IPV6 is not set | ||
| 27 | CONFIG_MTD=y | ||
| 28 | CONFIG_MTD_PARTITIONS=y | ||
| 29 | CONFIG_MTD_CHAR=y | ||
| 30 | CONFIG_MTD_BLOCK_RO=y | ||
| 31 | CONFIG_NETDEVICES=y | ||
| 32 | CONFIG_PHYLIB=y | ||
| 33 | CONFIG_DAVICOM_PHY=y | ||
| 34 | CONFIG_NET_ETHERNET=y | ||
| 35 | CONFIG_ARM_AT91_ETHER=y | ||
| 36 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 37 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 38 | # CONFIG_INPUT_MOUSE is not set | ||
| 39 | # CONFIG_SERIO is not set | ||
| 40 | CONFIG_SERIAL_ATMEL=y | ||
| 41 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 42 | CONFIG_LEGACY_PTY_COUNT=32 | ||
| 43 | CONFIG_I2C=y | ||
| 44 | CONFIG_I2C_CHARDEV=y | ||
| 45 | CONFIG_I2C_GPIO=y | ||
| 46 | # CONFIG_HWMON is not set | ||
| 47 | CONFIG_WATCHDOG=y | ||
| 48 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 49 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 50 | # CONFIG_VGA_CONSOLE is not set | ||
| 51 | CONFIG_RTC_CLASS=y | ||
| 52 | # CONFIG_RTC_HCTOSYS is not set | ||
| 53 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 54 | CONFIG_EXT3_FS=y | ||
| 55 | # CONFIG_EXT3_FS_XATTR is not set | ||
| 56 | CONFIG_TMPFS=y | ||
| 57 | CONFIG_CRAMFS=y | ||
| 58 | CONFIG_NFS_FS=m | ||
| 59 | CONFIG_NFS_V3=y | ||
| 60 | CONFIG_CRYPTO_MD5=y | ||
| 61 | CONFIG_CRYPTO_DES=y | ||
diff --git a/arch/arm/configs/kb9202_defconfig b/arch/arm/configs/kb9202_defconfig deleted file mode 100644 index 9f906a85f5c2..000000000000 --- a/arch/arm/configs/kb9202_defconfig +++ /dev/null | |||
| @@ -1,127 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_POSIX_MQUEUE=y | ||
| 5 | CONFIG_BSD_PROCESS_ACCT=y | ||
| 6 | CONFIG_AUDIT=y | ||
| 7 | CONFIG_IKCONFIG=y | ||
| 8 | CONFIG_IKCONFIG_PROC=y | ||
| 9 | CONFIG_BLK_DEV_INITRD=y | ||
| 10 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
| 11 | CONFIG_MODULES=y | ||
| 12 | CONFIG_MODULE_UNLOAD=y | ||
| 13 | CONFIG_MODVERSIONS=y | ||
| 14 | CONFIG_MODULE_SRCVERSION_ALL=y | ||
| 15 | # CONFIG_BLK_DEV_BSG is not set | ||
| 16 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 17 | CONFIG_ARCH_AT91=y | ||
| 18 | CONFIG_MACH_KB9200=y | ||
| 19 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 20 | CONFIG_NO_HZ=y | ||
| 21 | CONFIG_HIGH_RES_TIMERS=y | ||
| 22 | CONFIG_PREEMPT=y | ||
| 23 | CONFIG_AEABI=y | ||
| 24 | CONFIG_ZBOOT_ROM_TEXT=0x10000000 | ||
| 25 | CONFIG_ZBOOT_ROM_BSS=0x20040000 | ||
| 26 | CONFIG_CMDLINE="noinitrd root=/dev/mtdblock0 rootfstype=jffs2 mem=64M" | ||
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_FPE_NWFPE=y | ||
| 29 | CONFIG_BINFMT_MISC=y | ||
| 30 | CONFIG_NET=y | ||
| 31 | CONFIG_PACKET=y | ||
| 32 | CONFIG_UNIX=y | ||
| 33 | CONFIG_INET=y | ||
| 34 | CONFIG_IP_PNP=y | ||
| 35 | CONFIG_IP_PNP_DHCP=y | ||
| 36 | CONFIG_IP_PNP_BOOTP=y | ||
| 37 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
| 38 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
| 39 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
| 40 | # CONFIG_INET_LRO is not set | ||
| 41 | # CONFIG_INET_DIAG is not set | ||
| 42 | # CONFIG_IPV6 is not set | ||
| 43 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 44 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
| 45 | CONFIG_MTD=y | ||
| 46 | CONFIG_MTD_CONCAT=y | ||
| 47 | CONFIG_MTD_PARTITIONS=y | ||
| 48 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 49 | CONFIG_MTD_CHAR=y | ||
| 50 | CONFIG_MTD_BLOCK=y | ||
| 51 | CONFIG_MTD_CFI=y | ||
| 52 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 53 | CONFIG_MTD_COMPLEX_MAPPINGS=y | ||
| 54 | CONFIG_MTD_PHYSMAP=y | ||
| 55 | CONFIG_MTD_NAND=y | ||
| 56 | CONFIG_MTD_NAND_ATMEL=y | ||
| 57 | CONFIG_MTD_UBI=y | ||
| 58 | CONFIG_MTD_UBI_GLUEBI=y | ||
| 59 | CONFIG_BLK_DEV_LOOP=y | ||
| 60 | CONFIG_BLK_DEV_RAM=y | ||
| 61 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
| 62 | CONFIG_ATMEL_TCLIB=y | ||
| 63 | CONFIG_ATMEL_SSC=y | ||
| 64 | CONFIG_SCSI=y | ||
| 65 | CONFIG_BLK_DEV_SD=y | ||
| 66 | CONFIG_CHR_DEV_SG=y | ||
| 67 | CONFIG_SCSI_MULTI_LUN=y | ||
| 68 | CONFIG_SCSI_CONSTANTS=y | ||
| 69 | CONFIG_SCSI_LOGGING=y | ||
| 70 | CONFIG_SCSI_SPI_ATTRS=m | ||
| 71 | # CONFIG_SCSI_LOWLEVEL is not set | ||
| 72 | CONFIG_NETDEVICES=y | ||
| 73 | CONFIG_NET_ETHERNET=y | ||
| 74 | CONFIG_ARM_AT91_ETHER=y | ||
| 75 | # CONFIG_NETDEV_1000 is not set | ||
| 76 | # CONFIG_NETDEV_10000 is not set | ||
| 77 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 78 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 79 | # CONFIG_INPUT_MOUSE is not set | ||
| 80 | # CONFIG_SERIO is not set | ||
| 81 | CONFIG_SERIAL_ATMEL=y | ||
| 82 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 83 | # CONFIG_LEGACY_PTYS is not set | ||
| 84 | # CONFIG_HW_RANDOM is not set | ||
| 85 | # CONFIG_HWMON is not set | ||
| 86 | CONFIG_WATCHDOG=y | ||
| 87 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 88 | CONFIG_FB=y | ||
| 89 | CONFIG_FB_MODE_HELPERS=y | ||
| 90 | CONFIG_FB_TILEBLITTING=y | ||
| 91 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 92 | # CONFIG_LCD_CLASS_DEVICE is not set | ||
| 93 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 94 | # CONFIG_BACKLIGHT_GENERIC is not set | ||
| 95 | # CONFIG_VGA_CONSOLE is not set | ||
| 96 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
| 97 | CONFIG_FONTS=y | ||
| 98 | CONFIG_FONT_MINI_4x6=y | ||
| 99 | # CONFIG_HID_SUPPORT is not set | ||
| 100 | CONFIG_USB=y | ||
| 101 | CONFIG_USB_DEVICEFS=y | ||
| 102 | CONFIG_USB_OHCI_HCD=y | ||
| 103 | CONFIG_USB_STORAGE=y | ||
| 104 | CONFIG_USB_LIBUSUAL=y | ||
| 105 | CONFIG_MMC=y | ||
| 106 | CONFIG_MMC_AT91=m | ||
| 107 | CONFIG_RTC_CLASS=y | ||
| 108 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 109 | CONFIG_EXT2_FS=y | ||
| 110 | CONFIG_EXT3_FS=y | ||
| 111 | # CONFIG_DNOTIFY is not set | ||
| 112 | CONFIG_INOTIFY=y | ||
| 113 | CONFIG_VFAT_FS=y | ||
| 114 | CONFIG_TMPFS=y | ||
| 115 | CONFIG_CONFIGFS_FS=y | ||
| 116 | CONFIG_JFFS2_FS=y | ||
| 117 | CONFIG_NFS_FS=y | ||
| 118 | CONFIG_NFS_V3=y | ||
| 119 | CONFIG_ROOT_NFS=y | ||
| 120 | CONFIG_NLS_CODEPAGE_437=y | ||
| 121 | CONFIG_NLS_UTF8=y | ||
| 122 | CONFIG_MAGIC_SYSRQ=y | ||
| 123 | CONFIG_DEBUG_FS=y | ||
| 124 | CONFIG_DEBUG_KERNEL=y | ||
| 125 | # CONFIG_SCHED_DEBUG is not set | ||
| 126 | # CONFIG_DEBUG_PREEMPT is not set | ||
| 127 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
diff --git a/arch/arm/configs/onearm_defconfig b/arch/arm/configs/onearm_defconfig deleted file mode 100644 index 1579857aeeaa..000000000000 --- a/arch/arm/configs/onearm_defconfig +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 5 | CONFIG_BLK_DEV_INITRD=y | ||
| 6 | CONFIG_EMBEDDED=y | ||
| 7 | CONFIG_SLAB=y | ||
| 8 | CONFIG_MODULES=y | ||
| 9 | CONFIG_MODULE_UNLOAD=y | ||
| 10 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 11 | # CONFIG_IOSCHED_CFQ is not set | ||
| 12 | CONFIG_ARCH_AT91=y | ||
| 13 | CONFIG_MACH_ONEARM=y | ||
| 14 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 15 | # CONFIG_ARM_THUMB is not set | ||
| 16 | CONFIG_PCCARD=y | ||
| 17 | CONFIG_AT91_CF=y | ||
| 18 | CONFIG_LEDS=y | ||
| 19 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 20 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 21 | CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp mem=64M" | ||
| 22 | CONFIG_FPE_NWFPE=y | ||
| 23 | CONFIG_NET=y | ||
| 24 | CONFIG_PACKET=y | ||
| 25 | CONFIG_UNIX=y | ||
| 26 | CONFIG_INET=y | ||
| 27 | CONFIG_IP_PNP=y | ||
| 28 | CONFIG_IP_PNP_BOOTP=y | ||
| 29 | CONFIG_IPV6=y | ||
| 30 | # CONFIG_INET6_XFRM_MODE_TRANSPORT is not set | ||
| 31 | # CONFIG_INET6_XFRM_MODE_TUNNEL is not set | ||
| 32 | # CONFIG_INET6_XFRM_MODE_BEET is not set | ||
| 33 | # CONFIG_IPV6_SIT is not set | ||
| 34 | CONFIG_MTD=y | ||
| 35 | CONFIG_MTD_PARTITIONS=y | ||
| 36 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 37 | CONFIG_MTD_CHAR=y | ||
| 38 | CONFIG_MTD_BLOCK=y | ||
| 39 | CONFIG_MTD_CFI=y | ||
| 40 | CONFIG_MTD_JEDECPROBE=y | ||
| 41 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 42 | CONFIG_MTD_PHYSMAP=y | ||
| 43 | CONFIG_BLK_DEV_NBD=y | ||
| 44 | CONFIG_BLK_DEV_RAM=y | ||
| 45 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 46 | CONFIG_NETDEVICES=y | ||
| 47 | CONFIG_NET_ETHERNET=y | ||
| 48 | CONFIG_ARM_AT91_ETHER=y | ||
| 49 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 50 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 51 | # CONFIG_INPUT_MOUSE is not set | ||
| 52 | # CONFIG_SERIO is not set | ||
| 53 | # CONFIG_VT is not set | ||
| 54 | CONFIG_SERIAL_ATMEL=y | ||
| 55 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 56 | # CONFIG_HW_RANDOM is not set | ||
| 57 | CONFIG_I2C=y | ||
| 58 | CONFIG_I2C_CHARDEV=y | ||
| 59 | CONFIG_WATCHDOG=y | ||
| 60 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 61 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 62 | # CONFIG_USB_HID is not set | ||
| 63 | CONFIG_USB=y | ||
| 64 | CONFIG_USB_DEBUG=y | ||
| 65 | CONFIG_USB_DEVICEFS=y | ||
| 66 | CONFIG_USB_MON=y | ||
| 67 | CONFIG_USB_OHCI_HCD=y | ||
| 68 | CONFIG_USB_GADGET=y | ||
| 69 | CONFIG_MMC=y | ||
| 70 | CONFIG_EXT2_FS=y | ||
| 71 | CONFIG_INOTIFY=y | ||
| 72 | CONFIG_TMPFS=y | ||
| 73 | CONFIG_CRAMFS=y | ||
| 74 | CONFIG_NFS_FS=y | ||
| 75 | CONFIG_NFS_V3=y | ||
| 76 | CONFIG_NFS_V3_ACL=y | ||
| 77 | CONFIG_ROOT_NFS=y | ||
| 78 | CONFIG_DEBUG_KERNEL=y | ||
| 79 | CONFIG_DEBUG_USER=y | ||
| 80 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/picotux200_defconfig b/arch/arm/configs/picotux200_defconfig deleted file mode 100644 index 4c9afa478d57..000000000000 --- a/arch/arm/configs/picotux200_defconfig +++ /dev/null | |||
| @@ -1,242 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | ||
| 3 | CONFIG_IKCONFIG=m | ||
| 4 | CONFIG_IKCONFIG_PROC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_EMBEDDED=y | ||
| 7 | # CONFIG_KALLSYMS is not set | ||
| 8 | CONFIG_SLAB=y | ||
| 9 | CONFIG_MODULES=y | ||
| 10 | CONFIG_MODULE_UNLOAD=y | ||
| 11 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 12 | # CONFIG_IOSCHED_CFQ is not set | ||
| 13 | CONFIG_ARCH_AT91=y | ||
| 14 | CONFIG_MACH_PICOTUX2XX=y | ||
| 15 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 16 | CONFIG_AEABI=y | ||
| 17 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 18 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 19 | CONFIG_KEXEC=y | ||
| 20 | CONFIG_FPE_NWFPE=y | ||
| 21 | CONFIG_BINFMT_MISC=m | ||
| 22 | CONFIG_NET=y | ||
| 23 | CONFIG_PACKET=m | ||
| 24 | CONFIG_UNIX=y | ||
| 25 | CONFIG_XFRM_USER=m | ||
| 26 | CONFIG_INET=y | ||
| 27 | CONFIG_IP_PNP=y | ||
| 28 | CONFIG_IP_PNP_BOOTP=y | ||
| 29 | CONFIG_NET_IPIP=m | ||
| 30 | CONFIG_NET_IPGRE=m | ||
| 31 | CONFIG_INET_AH=m | ||
| 32 | CONFIG_INET_ESP=m | ||
| 33 | CONFIG_INET_IPCOMP=m | ||
| 34 | CONFIG_INET_XFRM_MODE_TRANSPORT=m | ||
| 35 | CONFIG_INET_XFRM_MODE_TUNNEL=m | ||
| 36 | CONFIG_INET_XFRM_MODE_BEET=m | ||
| 37 | CONFIG_INET_DIAG=m | ||
| 38 | CONFIG_IPV6_PRIVACY=y | ||
| 39 | CONFIG_IPV6_ROUTER_PREF=y | ||
| 40 | CONFIG_IPV6_ROUTE_INFO=y | ||
| 41 | CONFIG_INET6_AH=m | ||
| 42 | CONFIG_INET6_ESP=m | ||
| 43 | CONFIG_INET6_IPCOMP=m | ||
| 44 | CONFIG_IPV6_MIP6=m | ||
| 45 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m | ||
| 46 | CONFIG_IPV6_TUNNEL=m | ||
| 47 | CONFIG_BRIDGE=m | ||
| 48 | CONFIG_VLAN_8021Q=m | ||
| 49 | CONFIG_BT=m | ||
| 50 | CONFIG_BT_L2CAP=m | ||
| 51 | CONFIG_BT_SCO=m | ||
| 52 | CONFIG_BT_RFCOMM=m | ||
| 53 | CONFIG_BT_RFCOMM_TTY=y | ||
| 54 | CONFIG_BT_BNEP=m | ||
| 55 | CONFIG_BT_BNEP_MC_FILTER=y | ||
| 56 | CONFIG_BT_BNEP_PROTO_FILTER=y | ||
| 57 | CONFIG_BT_HIDP=m | ||
| 58 | CONFIG_FW_LOADER=m | ||
| 59 | CONFIG_MTD=y | ||
| 60 | CONFIG_MTD_PARTITIONS=y | ||
| 61 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 62 | CONFIG_MTD_CHAR=y | ||
| 63 | CONFIG_MTD_BLOCK=y | ||
| 64 | CONFIG_MTD_CFI=y | ||
| 65 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 66 | CONFIG_MTD_PHYSMAP=y | ||
| 67 | CONFIG_BLK_DEV_LOOP=m | ||
| 68 | CONFIG_EEPROM_LEGACY=m | ||
| 69 | CONFIG_SCSI=m | ||
| 70 | CONFIG_BLK_DEV_SD=m | ||
| 71 | CONFIG_BLK_DEV_SR=m | ||
| 72 | CONFIG_BLK_DEV_SR_VENDOR=y | ||
| 73 | CONFIG_CHR_DEV_SG=m | ||
| 74 | CONFIG_NETDEVICES=y | ||
| 75 | CONFIG_TUN=m | ||
| 76 | CONFIG_NET_ETHERNET=y | ||
| 77 | CONFIG_ARM_AT91_ETHER=y | ||
| 78 | CONFIG_USB_CATC=m | ||
| 79 | CONFIG_USB_KAWETH=m | ||
| 80 | CONFIG_USB_PEGASUS=m | ||
| 81 | CONFIG_USB_RTL8150=m | ||
| 82 | CONFIG_USB_USBNET=m | ||
| 83 | CONFIG_USB_NET_DM9601=m | ||
| 84 | CONFIG_USB_NET_GL620A=m | ||
| 85 | CONFIG_USB_NET_PLUSB=m | ||
| 86 | CONFIG_USB_NET_MCS7830=m | ||
| 87 | CONFIG_USB_NET_RNDIS_HOST=m | ||
| 88 | CONFIG_USB_ALI_M5632=y | ||
| 89 | CONFIG_USB_AN2720=y | ||
| 90 | CONFIG_USB_EPSON2888=y | ||
| 91 | CONFIG_USB_KC2190=y | ||
| 92 | CONFIG_PPP=m | ||
| 93 | CONFIG_PPP_FILTER=y | ||
| 94 | CONFIG_PPP_ASYNC=m | ||
| 95 | CONFIG_PPP_DEFLATE=m | ||
| 96 | CONFIG_PPP_BSDCOMP=m | ||
| 97 | CONFIG_PPP_MPPE=m | ||
| 98 | CONFIG_PPPOE=m | ||
| 99 | CONFIG_SLIP=m | ||
| 100 | CONFIG_SLIP_COMPRESSED=y | ||
| 101 | CONFIG_SLIP_SMART=y | ||
| 102 | CONFIG_SLIP_MODE_SLIP6=y | ||
| 103 | # CONFIG_INPUT_MOUSEDEV is not set | ||
| 104 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 105 | # CONFIG_INPUT_MOUSE is not set | ||
| 106 | # CONFIG_SERIO is not set | ||
| 107 | # CONFIG_VT is not set | ||
| 108 | CONFIG_SERIAL_ATMEL=y | ||
| 109 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 110 | # CONFIG_LEGACY_PTYS is not set | ||
| 111 | CONFIG_I2C=m | ||
| 112 | CONFIG_I2C_CHARDEV=m | ||
| 113 | CONFIG_I2C_GPIO=m | ||
| 114 | CONFIG_HWMON=m | ||
| 115 | CONFIG_SENSORS_ADM1021=m | ||
| 116 | CONFIG_SENSORS_ADM1025=m | ||
| 117 | CONFIG_SENSORS_ADM1026=m | ||
| 118 | CONFIG_SENSORS_ADM1029=m | ||
| 119 | CONFIG_SENSORS_ADM1031=m | ||
| 120 | CONFIG_SENSORS_ADM9240=m | ||
| 121 | CONFIG_SENSORS_DS1621=m | ||
| 122 | CONFIG_SENSORS_GL518SM=m | ||
| 123 | CONFIG_SENSORS_GL520SM=m | ||
| 124 | CONFIG_SENSORS_IT87=m | ||
| 125 | CONFIG_SENSORS_LM63=m | ||
| 126 | CONFIG_SENSORS_LM75=m | ||
| 127 | CONFIG_SENSORS_LM77=m | ||
| 128 | CONFIG_SENSORS_LM78=m | ||
| 129 | CONFIG_SENSORS_LM80=m | ||
| 130 | CONFIG_SENSORS_LM83=m | ||
| 131 | CONFIG_SENSORS_LM85=m | ||
| 132 | CONFIG_SENSORS_LM87=m | ||
| 133 | CONFIG_SENSORS_LM90=m | ||
| 134 | CONFIG_SENSORS_LM92=m | ||
| 135 | CONFIG_SENSORS_MAX1619=m | ||
| 136 | CONFIG_SENSORS_PCF8591=m | ||
| 137 | CONFIG_SENSORS_SMSC47B397=m | ||
| 138 | CONFIG_SENSORS_W83781D=m | ||
| 139 | CONFIG_SENSORS_W83791D=m | ||
| 140 | CONFIG_SENSORS_W83792D=m | ||
| 141 | CONFIG_SENSORS_W83793=m | ||
| 142 | CONFIG_SENSORS_W83L785TS=m | ||
| 143 | CONFIG_WATCHDOG=y | ||
| 144 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 145 | CONFIG_AT91RM9200_WATCHDOG=m | ||
| 146 | CONFIG_HID=m | ||
| 147 | CONFIG_USB=m | ||
| 148 | CONFIG_USB_DEVICEFS=y | ||
| 149 | CONFIG_USB_OHCI_HCD=m | ||
| 150 | CONFIG_USB_ACM=m | ||
| 151 | CONFIG_USB_PRINTER=m | ||
| 152 | CONFIG_USB_STORAGE=m | ||
| 153 | CONFIG_USB_SERIAL=m | ||
| 154 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 155 | CONFIG_USB_SERIAL_PL2303=m | ||
| 156 | CONFIG_MMC=m | ||
| 157 | CONFIG_MMC_AT91=m | ||
| 158 | CONFIG_RTC_CLASS=m | ||
| 159 | CONFIG_RTC_DRV_AT91RM9200=m | ||
| 160 | CONFIG_EXT2_FS=m | ||
| 161 | CONFIG_EXT3_FS=m | ||
| 162 | # CONFIG_EXT3_FS_XATTR is not set | ||
| 163 | CONFIG_INOTIFY=y | ||
| 164 | CONFIG_ISO9660_FS=m | ||
| 165 | CONFIG_JOLIET=y | ||
| 166 | CONFIG_UDF_FS=m | ||
| 167 | CONFIG_MSDOS_FS=m | ||
| 168 | CONFIG_VFAT_FS=m | ||
| 169 | CONFIG_NTFS_FS=m | ||
| 170 | CONFIG_TMPFS=y | ||
| 171 | CONFIG_JFFS2_FS=y | ||
| 172 | CONFIG_JFFS2_SUMMARY=y | ||
| 173 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
| 174 | CONFIG_NFS_FS=m | ||
| 175 | CONFIG_SMB_FS=m | ||
| 176 | CONFIG_CIFS=m | ||
| 177 | CONFIG_PARTITION_ADVANCED=y | ||
| 178 | CONFIG_AMIGA_PARTITION=y | ||
| 179 | CONFIG_NLS_DEFAULT="utf-8" | ||
| 180 | CONFIG_NLS_CODEPAGE_437=m | ||
| 181 | CONFIG_NLS_CODEPAGE_737=m | ||
| 182 | CONFIG_NLS_CODEPAGE_775=m | ||
| 183 | CONFIG_NLS_CODEPAGE_850=m | ||
| 184 | CONFIG_NLS_CODEPAGE_852=m | ||
| 185 | CONFIG_NLS_CODEPAGE_855=m | ||
| 186 | CONFIG_NLS_CODEPAGE_857=m | ||
| 187 | CONFIG_NLS_CODEPAGE_860=m | ||
| 188 | CONFIG_NLS_CODEPAGE_861=m | ||
| 189 | CONFIG_NLS_CODEPAGE_862=m | ||
| 190 | CONFIG_NLS_CODEPAGE_863=m | ||
| 191 | CONFIG_NLS_CODEPAGE_864=m | ||
| 192 | CONFIG_NLS_CODEPAGE_865=m | ||
| 193 | CONFIG_NLS_CODEPAGE_866=m | ||
| 194 | CONFIG_NLS_CODEPAGE_869=m | ||
| 195 | CONFIG_NLS_CODEPAGE_936=m | ||
| 196 | CONFIG_NLS_CODEPAGE_950=m | ||
| 197 | CONFIG_NLS_CODEPAGE_932=m | ||
| 198 | CONFIG_NLS_CODEPAGE_949=m | ||
| 199 | CONFIG_NLS_CODEPAGE_874=m | ||
| 200 | CONFIG_NLS_ISO8859_8=m | ||
| 201 | CONFIG_NLS_CODEPAGE_1250=m | ||
| 202 | CONFIG_NLS_CODEPAGE_1251=m | ||
| 203 | CONFIG_NLS_ASCII=m | ||
| 204 | CONFIG_NLS_ISO8859_1=m | ||
| 205 | CONFIG_NLS_ISO8859_2=m | ||
| 206 | CONFIG_NLS_ISO8859_3=m | ||
| 207 | CONFIG_NLS_ISO8859_4=m | ||
| 208 | CONFIG_NLS_ISO8859_5=m | ||
| 209 | CONFIG_NLS_ISO8859_6=m | ||
| 210 | CONFIG_NLS_ISO8859_7=m | ||
| 211 | CONFIG_NLS_ISO8859_9=m | ||
| 212 | CONFIG_NLS_ISO8859_13=m | ||
| 213 | CONFIG_NLS_ISO8859_14=m | ||
| 214 | CONFIG_NLS_ISO8859_15=m | ||
| 215 | CONFIG_NLS_KOI8_R=m | ||
| 216 | CONFIG_NLS_KOI8_U=m | ||
| 217 | CONFIG_NLS_UTF8=m | ||
| 218 | CONFIG_DEBUG_KERNEL=y | ||
| 219 | # CONFIG_DEBUG_BUGVERBOSE is not set | ||
| 220 | CONFIG_DEBUG_LL=y | ||
| 221 | CONFIG_CRYPTO_NULL=m | ||
| 222 | CONFIG_CRYPTO_TEST=m | ||
| 223 | CONFIG_CRYPTO_LRW=m | ||
| 224 | CONFIG_CRYPTO_PCBC=m | ||
| 225 | CONFIG_CRYPTO_XCBC=m | ||
| 226 | CONFIG_CRYPTO_MD4=m | ||
| 227 | CONFIG_CRYPTO_MICHAEL_MIC=m | ||
| 228 | CONFIG_CRYPTO_SHA256=m | ||
| 229 | CONFIG_CRYPTO_SHA512=m | ||
| 230 | CONFIG_CRYPTO_TGR192=m | ||
| 231 | CONFIG_CRYPTO_WP512=m | ||
| 232 | CONFIG_CRYPTO_ANUBIS=m | ||
| 233 | CONFIG_CRYPTO_BLOWFISH=m | ||
| 234 | CONFIG_CRYPTO_CAMELLIA=m | ||
| 235 | CONFIG_CRYPTO_CAST5=m | ||
| 236 | CONFIG_CRYPTO_CAST6=m | ||
| 237 | CONFIG_CRYPTO_FCRYPT=m | ||
| 238 | CONFIG_CRYPTO_KHAZAD=m | ||
| 239 | CONFIG_CRYPTO_SERPENT=m | ||
| 240 | CONFIG_CRYPTO_TEA=m | ||
| 241 | CONFIG_CRYPTO_TWOFISH=m | ||
| 242 | CONFIG_LIBCRC32C=m | ||
diff --git a/arch/arm/configs/yl9200_defconfig b/arch/arm/configs/yl9200_defconfig deleted file mode 100644 index 30c537f61089..000000000000 --- a/arch/arm/configs/yl9200_defconfig +++ /dev/null | |||
| @@ -1,137 +0,0 @@ | |||
| 1 | # CONFIG_SWAP is not set | ||
| 2 | CONFIG_SYSVIPC=y | ||
| 3 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 4 | CONFIG_BLK_DEV_INITRD=y | ||
| 5 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
| 6 | CONFIG_MODULES=y | ||
| 7 | CONFIG_MODULE_UNLOAD=y | ||
| 8 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 9 | # CONFIG_IOSCHED_CFQ is not set | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_ARCH_AT91RM9200DK=y | ||
| 12 | CONFIG_MACH_YL9200=y | ||
| 13 | # CONFIG_ARM_THUMB is not set | ||
| 14 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 15 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 16 | CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 17 | CONFIG_FPE_NWFPE=y | ||
| 18 | CONFIG_NET=y | ||
| 19 | CONFIG_PACKET=y | ||
| 20 | CONFIG_UNIX=y | ||
| 21 | CONFIG_INET=y | ||
| 22 | CONFIG_IP_PNP=y | ||
| 23 | CONFIG_IP_PNP_DHCP=y | ||
| 24 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
| 25 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
| 26 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
| 27 | # CONFIG_INET_LRO is not set | ||
| 28 | # CONFIG_INET_DIAG is not set | ||
| 29 | # CONFIG_IPV6 is not set | ||
| 30 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 31 | CONFIG_MTD=y | ||
| 32 | CONFIG_MTD_CONCAT=y | ||
| 33 | CONFIG_MTD_PARTITIONS=y | ||
| 34 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 35 | CONFIG_MTD_CHAR=y | ||
| 36 | CONFIG_MTD_BLOCK=y | ||
| 37 | CONFIG_MTD_CFI=y | ||
| 38 | CONFIG_MTD_JEDECPROBE=y | ||
| 39 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 40 | CONFIG_MTD_COMPLEX_MAPPINGS=y | ||
| 41 | CONFIG_MTD_PHYSMAP=y | ||
| 42 | CONFIG_MTD_PLATRAM=y | ||
| 43 | CONFIG_MTD_NAND=y | ||
| 44 | CONFIG_MTD_NAND_ATMEL=y | ||
| 45 | CONFIG_MTD_NAND_PLATFORM=y | ||
| 46 | CONFIG_BLK_DEV_LOOP=y | ||
| 47 | CONFIG_BLK_DEV_RAM=y | ||
| 48 | CONFIG_BLK_DEV_RAM_COUNT=3 | ||
| 49 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 50 | # CONFIG_MISC_DEVICES is not set | ||
| 51 | CONFIG_BLK_DEV_SD=y | ||
| 52 | CONFIG_ATA=y | ||
| 53 | CONFIG_NETDEVICES=y | ||
| 54 | CONFIG_PHYLIB=y | ||
| 55 | CONFIG_DAVICOM_PHY=y | ||
| 56 | CONFIG_NET_ETHERNET=y | ||
| 57 | CONFIG_ARM_AT91_ETHER=y | ||
| 58 | # CONFIG_NETDEV_1000 is not set | ||
| 59 | # CONFIG_NETDEV_10000 is not set | ||
| 60 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 61 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=640 | ||
| 62 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480 | ||
| 63 | CONFIG_INPUT_EVDEV=y | ||
| 64 | # CONFIG_KEYBOARD_ATKBD is not set | ||
| 65 | CONFIG_KEYBOARD_GPIO=y | ||
| 66 | CONFIG_INPUT_TOUCHSCREEN=y | ||
| 67 | CONFIG_TOUCHSCREEN_ADS7846=y | ||
| 68 | # CONFIG_SERIO_SERPORT is not set | ||
| 69 | CONFIG_SERIAL_ATMEL=y | ||
| 70 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 71 | # CONFIG_HW_RANDOM is not set | ||
| 72 | CONFIG_I2C=y | ||
| 73 | CONFIG_SPI=y | ||
| 74 | CONFIG_SPI_DEBUG=y | ||
| 75 | CONFIG_SPI_ATMEL=y | ||
| 76 | CONFIG_FB=y | ||
| 77 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 78 | CONFIG_LCD_CLASS_DEVICE=y | ||
| 79 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 80 | CONFIG_DISPLAY_SUPPORT=y | ||
| 81 | # CONFIG_VGA_CONSOLE is not set | ||
| 82 | CONFIG_LOGO=y | ||
| 83 | # CONFIG_LOGO_LINUX_MONO is not set | ||
| 84 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
| 85 | CONFIG_USB=y | ||
| 86 | CONFIG_USB_DEBUG=y | ||
| 87 | CONFIG_USB_DEVICEFS=y | ||
| 88 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 89 | CONFIG_USB_MON=y | ||
| 90 | CONFIG_USB_OHCI_HCD=y | ||
| 91 | CONFIG_USB_STORAGE=y | ||
| 92 | CONFIG_USB_GADGET=y | ||
| 93 | CONFIG_USB_GADGET_M66592=y | ||
| 94 | CONFIG_USB_FILE_STORAGE=m | ||
| 95 | CONFIG_MMC=y | ||
| 96 | CONFIG_MMC_DEBUG=y | ||
| 97 | # CONFIG_MMC_BLOCK_BOUNCE is not set | ||
| 98 | CONFIG_MMC_AT91=m | ||
| 99 | CONFIG_NEW_LEDS=y | ||
| 100 | CONFIG_LEDS_CLASS=y | ||
| 101 | CONFIG_LEDS_GPIO=y | ||
| 102 | CONFIG_LEDS_TRIGGERS=y | ||
| 103 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
| 104 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 105 | CONFIG_RTC_CLASS=y | ||
| 106 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 107 | CONFIG_EXT2_FS=y | ||
| 108 | CONFIG_EXT2_FS_XATTR=y | ||
| 109 | CONFIG_EXT3_FS=y | ||
| 110 | CONFIG_REISERFS_FS=y | ||
| 111 | CONFIG_INOTIFY=y | ||
| 112 | CONFIG_ISO9660_FS=y | ||
| 113 | CONFIG_JOLIET=y | ||
| 114 | CONFIG_ZISOFS=y | ||
| 115 | CONFIG_UDF_FS=y | ||
| 116 | CONFIG_MSDOS_FS=y | ||
| 117 | CONFIG_VFAT_FS=y | ||
| 118 | CONFIG_TMPFS=y | ||
| 119 | CONFIG_JFFS2_FS=y | ||
| 120 | CONFIG_JFFS2_FS_DEBUG=1 | ||
| 121 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
| 122 | CONFIG_JFFS2_RUBIN=y | ||
| 123 | CONFIG_CRAMFS=y | ||
| 124 | CONFIG_PARTITION_ADVANCED=y | ||
| 125 | CONFIG_MAC_PARTITION=y | ||
| 126 | CONFIG_NLS_CODEPAGE_437=y | ||
| 127 | CONFIG_NLS_ISO8859_1=y | ||
| 128 | # CONFIG_ENABLE_MUST_CHECK is not set | ||
| 129 | CONFIG_DEBUG_FS=y | ||
| 130 | CONFIG_DEBUG_KERNEL=y | ||
| 131 | CONFIG_SLUB_DEBUG_ON=y | ||
| 132 | CONFIG_DEBUG_KOBJECT=y | ||
| 133 | CONFIG_DEBUG_INFO=y | ||
| 134 | CONFIG_DEBUG_LIST=y | ||
| 135 | CONFIG_DEBUG_USER=y | ||
| 136 | CONFIG_DEBUG_ERRORS=y | ||
| 137 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 4e84d09c9c1b..bc2d2d75f706 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
| @@ -158,16 +158,24 @@ | |||
| 158 | #ifdef CONFIG_SMP | 158 | #ifdef CONFIG_SMP |
| 159 | #define ALT_SMP(instr...) \ | 159 | #define ALT_SMP(instr...) \ |
| 160 | 9998: instr | 160 | 9998: instr |
| 161 | /* | ||
| 162 | * Note: if you get assembler errors from ALT_UP() when building with | ||
| 163 | * CONFIG_THUMB2_KERNEL, you almost certainly need to use | ||
| 164 | * ALT_SMP( W(instr) ... ) | ||
| 165 | */ | ||
| 161 | #define ALT_UP(instr...) \ | 166 | #define ALT_UP(instr...) \ |
| 162 | .pushsection ".alt.smp.init", "a" ;\ | 167 | .pushsection ".alt.smp.init", "a" ;\ |
| 163 | .long 9998b ;\ | 168 | .long 9998b ;\ |
| 164 | instr ;\ | 169 | 9997: instr ;\ |
| 170 | .if . - 9997b != 4 ;\ | ||
| 171 | .error "ALT_UP() content must assemble to exactly 4 bytes";\ | ||
| 172 | .endif ;\ | ||
| 165 | .popsection | 173 | .popsection |
| 166 | #define ALT_UP_B(label) \ | 174 | #define ALT_UP_B(label) \ |
| 167 | .equ up_b_offset, label - 9998b ;\ | 175 | .equ up_b_offset, label - 9998b ;\ |
| 168 | .pushsection ".alt.smp.init", "a" ;\ | 176 | .pushsection ".alt.smp.init", "a" ;\ |
| 169 | .long 9998b ;\ | 177 | .long 9998b ;\ |
| 170 | b . + up_b_offset ;\ | 178 | W(b) . + up_b_offset ;\ |
| 171 | .popsection | 179 | .popsection |
| 172 | #else | 180 | #else |
| 173 | #define ALT_SMP(instr...) | 181 | #define ALT_SMP(instr...) |
| @@ -178,16 +186,24 @@ | |||
| 178 | /* | 186 | /* |
| 179 | * SMP data memory barrier | 187 | * SMP data memory barrier |
| 180 | */ | 188 | */ |
| 181 | .macro smp_dmb | 189 | .macro smp_dmb mode |
| 182 | #ifdef CONFIG_SMP | 190 | #ifdef CONFIG_SMP |
| 183 | #if __LINUX_ARM_ARCH__ >= 7 | 191 | #if __LINUX_ARM_ARCH__ >= 7 |
| 192 | .ifeqs "\mode","arm" | ||
| 184 | ALT_SMP(dmb) | 193 | ALT_SMP(dmb) |
| 194 | .else | ||
| 195 | ALT_SMP(W(dmb)) | ||
| 196 | .endif | ||
| 185 | #elif __LINUX_ARM_ARCH__ == 6 | 197 | #elif __LINUX_ARM_ARCH__ == 6 |
| 186 | ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb | 198 | ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb |
| 187 | #else | 199 | #else |
| 188 | #error Incompatible SMP platform | 200 | #error Incompatible SMP platform |
| 189 | #endif | 201 | #endif |
| 202 | .ifeqs "\mode","arm" | ||
| 190 | ALT_UP(nop) | 203 | ALT_UP(nop) |
| 204 | .else | ||
| 205 | ALT_UP(W(nop)) | ||
| 206 | .endif | ||
| 191 | #endif | 207 | #endif |
| 192 | .endm | 208 | .endm |
| 193 | 209 | ||
| @@ -239,7 +255,7 @@ | |||
| 239 | @ Slightly optimised to avoid incrementing the pointer twice | 255 | @ Slightly optimised to avoid incrementing the pointer twice |
| 240 | usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort | 256 | usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort |
| 241 | .if \rept == 2 | 257 | .if \rept == 2 |
| 242 | usraccoff \instr, \reg, \ptr, \inc, 4, \cond, \abort | 258 | usraccoff \instr, \reg, \ptr, \inc, \inc, \cond, \abort |
| 243 | .endif | 259 | .endif |
| 244 | 260 | ||
| 245 | add\cond \ptr, #\rept * \inc | 261 | add\cond \ptr, #\rept * \inc |
diff --git a/arch/arm/include/asm/entry-macro-multi.S b/arch/arm/include/asm/entry-macro-multi.S index 44f21d4584e8..ec0bbf79c71f 100644 --- a/arch/arm/include/asm/entry-macro-multi.S +++ b/arch/arm/include/asm/entry-macro-multi.S | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | */ | 20 | */ |
| 21 | ALT_SMP(test_for_ipi r0, r6, r5, lr) | 21 | ALT_SMP(test_for_ipi r0, r6, r5, lr) |
| 22 | ALT_UP_B(9997f) | 22 | ALT_UP_B(9997f) |
| 23 | movne r0, sp | 23 | movne r1, sp |
| 24 | adrne lr, BSYM(1b) | 24 | adrne lr, BSYM(1b) |
| 25 | bne do_IPI | 25 | bne do_IPI |
| 26 | 26 | ||
diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h index 6d7485aff955..89ad1805e579 100644 --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h | |||
| @@ -5,13 +5,31 @@ | |||
| 5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
| 6 | #include <asm/irq.h> | 6 | #include <asm/irq.h> |
| 7 | 7 | ||
| 8 | #define NR_IPI 5 | ||
| 9 | |||
| 8 | typedef struct { | 10 | typedef struct { |
| 9 | unsigned int __softirq_pending; | 11 | unsigned int __softirq_pending; |
| 12 | #ifdef CONFIG_LOCAL_TIMERS | ||
| 10 | unsigned int local_timer_irqs; | 13 | unsigned int local_timer_irqs; |
| 14 | #endif | ||
| 15 | #ifdef CONFIG_SMP | ||
| 16 | unsigned int ipi_irqs[NR_IPI]; | ||
| 17 | #endif | ||
| 11 | } ____cacheline_aligned irq_cpustat_t; | 18 | } ____cacheline_aligned irq_cpustat_t; |
| 12 | 19 | ||
| 13 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 20 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
| 14 | 21 | ||
| 22 | #define __inc_irq_stat(cpu, member) __IRQ_STAT(cpu, member)++ | ||
| 23 | #define __get_irq_stat(cpu, member) __IRQ_STAT(cpu, member) | ||
| 24 | |||
| 25 | #ifdef CONFIG_SMP | ||
| 26 | u64 smp_irq_stat_cpu(unsigned int cpu); | ||
| 27 | #else | ||
| 28 | #define smp_irq_stat_cpu(cpu) 0 | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #define arch_irq_stat_cpu smp_irq_stat_cpu | ||
| 32 | |||
| 15 | #if NR_IRQS > 512 | 33 | #if NR_IRQS > 512 |
| 16 | #define HARDIRQ_BITS 10 | 34 | #define HARDIRQ_BITS 10 |
| 17 | #elif NR_IRQS > 256 | 35 | #elif NR_IRQS > 256 |
diff --git a/arch/arm/include/asm/hardware/it8152.h b/arch/arm/include/asm/hardware/it8152.h index 6700c7fc7ebd..21fa272301f8 100644 --- a/arch/arm/include/asm/hardware/it8152.h +++ b/arch/arm/include/asm/hardware/it8152.h | |||
| @@ -75,7 +75,7 @@ extern unsigned long it8152_base_address; | |||
| 75 | IT8152_PD_IRQ(1) USB (USBR) | 75 | IT8152_PD_IRQ(1) USB (USBR) |
| 76 | IT8152_PD_IRQ(0) Audio controller (ACR) | 76 | IT8152_PD_IRQ(0) Audio controller (ACR) |
| 77 | */ | 77 | */ |
| 78 | #define IT8152_IRQ(x) (IRQ_BOARD_END + (x)) | 78 | #define IT8152_IRQ(x) (IRQ_BOARD_START + (x)) |
| 79 | 79 | ||
| 80 | /* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */ | 80 | /* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */ |
| 81 | #define IT8152_LD_IRQ_COUNT 9 | 81 | #define IT8152_LD_IRQ_COUNT 9 |
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h index 50c7e7cfd670..6bc63ab498ce 100644 --- a/arch/arm/include/asm/localtimer.h +++ b/arch/arm/include/asm/localtimer.h | |||
| @@ -30,7 +30,6 @@ asmlinkage void do_local_timer(struct pt_regs *); | |||
| 30 | #include "smp_twd.h" | 30 | #include "smp_twd.h" |
| 31 | 31 | ||
| 32 | #define local_timer_ack() twd_timer_ack() | 32 | #define local_timer_ack() twd_timer_ack() |
| 33 | #define local_timer_stop() twd_timer_stop() | ||
| 34 | 33 | ||
| 35 | #else | 34 | #else |
| 36 | 35 | ||
| @@ -40,11 +39,6 @@ asmlinkage void do_local_timer(struct pt_regs *); | |||
| 40 | */ | 39 | */ |
| 41 | int local_timer_ack(void); | 40 | int local_timer_ack(void); |
| 42 | 41 | ||
| 43 | /* | ||
| 44 | * Stop a local timer interrupt. | ||
| 45 | */ | ||
| 46 | void local_timer_stop(void); | ||
| 47 | |||
| 48 | #endif | 42 | #endif |
| 49 | 43 | ||
| 50 | /* | 44 | /* |
| @@ -52,12 +46,6 @@ void local_timer_stop(void); | |||
| 52 | */ | 46 | */ |
| 53 | void local_timer_setup(struct clock_event_device *); | 47 | void local_timer_setup(struct clock_event_device *); |
| 54 | 48 | ||
| 55 | #else | ||
| 56 | |||
| 57 | static inline void local_timer_stop(void) | ||
| 58 | { | ||
| 59 | } | ||
| 60 | |||
| 61 | #endif | 49 | #endif |
| 62 | 50 | ||
| 63 | #endif | 51 | #endif |
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h index 831e81453f81..22ac140edd9e 100644 --- a/arch/arm/include/asm/mach/irq.h +++ b/arch/arm/include/asm/mach/irq.h | |||
| @@ -18,7 +18,7 @@ struct seq_file; | |||
| 18 | * This is internal. Do not use it. | 18 | * This is internal. Do not use it. |
| 19 | */ | 19 | */ |
| 20 | extern void init_FIQ(void); | 20 | extern void init_FIQ(void); |
| 21 | extern int show_fiq_list(struct seq_file *, void *); | 21 | extern int show_fiq_list(struct seq_file *, int); |
| 22 | 22 | ||
| 23 | #ifdef CONFIG_MULTI_IRQ_HANDLER | 23 | #ifdef CONFIG_MULTI_IRQ_HANDLER |
| 24 | extern void (*handle_arch_irq)(struct pt_regs *); | 24 | extern void (*handle_arch_irq)(struct pt_regs *); |
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index 68870c776671..b4ffe9d5b526 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h | |||
| @@ -13,6 +13,10 @@ typedef struct { | |||
| 13 | 13 | ||
| 14 | #ifdef CONFIG_CPU_HAS_ASID | 14 | #ifdef CONFIG_CPU_HAS_ASID |
| 15 | #define ASID(mm) ((mm)->context.id & 255) | 15 | #define ASID(mm) ((mm)->context.id & 255) |
| 16 | |||
| 17 | /* init_mm.context.id_lock should be initialized. */ | ||
| 18 | #define INIT_MM_CONTEXT(name) \ | ||
| 19 | .context.id_lock = __SPIN_LOCK_UNLOCKED(name.context.id_lock), | ||
| 16 | #else | 20 | #else |
| 17 | #define ASID(mm) (0) | 21 | #define ASID(mm) (0) |
| 18 | #endif | 22 | #endif |
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index b155414192da..53d1d5deb111 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
| @@ -374,6 +374,9 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd) | |||
| 374 | 374 | ||
| 375 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd))) | 375 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd))) |
| 376 | 376 | ||
| 377 | /* we don't need complex calculations here as the pmd is folded into the pgd */ | ||
| 378 | #define pmd_addr_end(addr,end) (end) | ||
| 379 | |||
| 377 | /* | 380 | /* |
| 378 | * Conversion functions: convert a page and protection to a page entry, | 381 | * Conversion functions: convert a page and protection to a page entry, |
| 379 | * and a page entry and page directory to the page they refer to. | 382 | * and a page entry and page directory to the page they refer to. |
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 3d05190797cb..96ed521f2408 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
| @@ -33,27 +33,23 @@ struct seq_file; | |||
| 33 | /* | 33 | /* |
| 34 | * generate IPI list text | 34 | * generate IPI list text |
| 35 | */ | 35 | */ |
| 36 | extern void show_ipi_list(struct seq_file *p); | 36 | extern void show_ipi_list(struct seq_file *, int); |
| 37 | 37 | ||
| 38 | /* | 38 | /* |
| 39 | * Called from assembly code, this handles an IPI. | 39 | * Called from assembly code, this handles an IPI. |
| 40 | */ | 40 | */ |
| 41 | asmlinkage void do_IPI(struct pt_regs *regs); | 41 | asmlinkage void do_IPI(int ipinr, struct pt_regs *regs); |
| 42 | 42 | ||
| 43 | /* | 43 | /* |
| 44 | * Setup the set of possible CPUs (via set_cpu_possible) | 44 | * Setup the set of possible CPUs (via set_cpu_possible) |
| 45 | */ | 45 | */ |
| 46 | extern void smp_init_cpus(void); | 46 | extern void smp_init_cpus(void); |
| 47 | 47 | ||
| 48 | /* | ||
| 49 | * Move global data into per-processor storage. | ||
| 50 | */ | ||
| 51 | extern void smp_store_cpu_info(unsigned int cpuid); | ||
| 52 | 48 | ||
| 53 | /* | 49 | /* |
| 54 | * Raise an IPI cross call on CPUs in callmap. | 50 | * Raise an IPI cross call on CPUs in callmap. |
| 55 | */ | 51 | */ |
| 56 | extern void smp_cross_call(const struct cpumask *mask); | 52 | extern void smp_cross_call(const struct cpumask *mask, int ipi); |
| 57 | 53 | ||
| 58 | /* | 54 | /* |
| 59 | * Boot a secondary CPU, and assign it the specified idle task. | 55 | * Boot a secondary CPU, and assign it the specified idle task. |
| @@ -73,6 +69,11 @@ asmlinkage void secondary_start_kernel(void); | |||
| 73 | extern void platform_secondary_init(unsigned int cpu); | 69 | extern void platform_secondary_init(unsigned int cpu); |
| 74 | 70 | ||
| 75 | /* | 71 | /* |
| 72 | * Initialize cpu_possible map, and enable coherency | ||
| 73 | */ | ||
| 74 | extern void platform_smp_prepare_cpus(unsigned int); | ||
| 75 | |||
| 76 | /* | ||
| 76 | * Initial data for bringing up a secondary CPU. | 77 | * Initial data for bringing up a secondary CPU. |
| 77 | */ | 78 | */ |
| 78 | struct secondary_data { | 79 | struct secondary_data { |
| @@ -97,6 +98,6 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | |||
| 97 | /* | 98 | /* |
| 98 | * show local interrupt info | 99 | * show local interrupt info |
| 99 | */ | 100 | */ |
| 100 | extern void show_local_irqs(struct seq_file *); | 101 | extern void show_local_irqs(struct seq_file *, int); |
| 101 | 102 | ||
| 102 | #endif /* ifndef __ASM_ARM_SMP_H */ | 103 | #endif /* ifndef __ASM_ARM_SMP_H */ |
diff --git a/arch/arm/include/asm/smp_mpidr.h b/arch/arm/include/asm/smp_mpidr.h deleted file mode 100644 index 6a9307d64900..000000000000 --- a/arch/arm/include/asm/smp_mpidr.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #ifndef ASMARM_SMP_MIDR_H | ||
| 2 | #define ASMARM_SMP_MIDR_H | ||
| 3 | |||
| 4 | #define hard_smp_processor_id() \ | ||
| 5 | ({ \ | ||
| 6 | unsigned int cpunum; \ | ||
| 7 | __asm__("\n" \ | ||
| 8 | "1: mrc p15, 0, %0, c0, c0, 5\n" \ | ||
| 9 | " .pushsection \".alt.smp.init\", \"a\"\n"\ | ||
| 10 | " .long 1b\n" \ | ||
| 11 | " mov %0, #0\n" \ | ||
| 12 | " .popsection" \ | ||
| 13 | : "=r" (cpunum)); \ | ||
| 14 | cpunum &= 0x0F; \ | ||
| 15 | }) | ||
| 16 | |||
| 17 | #endif | ||
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h index 634f357be6bb..fed9981fba08 100644 --- a/arch/arm/include/asm/smp_twd.h +++ b/arch/arm/include/asm/smp_twd.h | |||
| @@ -22,7 +22,6 @@ struct clock_event_device; | |||
| 22 | 22 | ||
| 23 | extern void __iomem *twd_base; | 23 | extern void __iomem *twd_base; |
| 24 | 24 | ||
| 25 | void twd_timer_stop(void); | ||
| 26 | int twd_timer_ack(void); | 25 | int twd_timer_ack(void); |
| 27 | void twd_timer_setup(struct clock_event_device *); | 26 | void twd_timer_setup(struct clock_event_device *); |
| 28 | 27 | ||
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 4036a5926465..0e1067957029 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
| @@ -29,7 +29,7 @@ obj-$(CONFIG_MODULES) += armksyms.o module.o | |||
| 29 | obj-$(CONFIG_ARTHUR) += arthur.o | 29 | obj-$(CONFIG_ARTHUR) += arthur.o |
| 30 | obj-$(CONFIG_ISA_DMA) += dma-isa.o | 30 | obj-$(CONFIG_ISA_DMA) += dma-isa.o |
| 31 | obj-$(CONFIG_PCI) += bios32.o isa.o | 31 | obj-$(CONFIG_PCI) += bios32.o isa.o |
| 32 | obj-$(CONFIG_SMP) += smp.o | 32 | obj-$(CONFIG_SMP) += smp.o smp_tlb.o |
| 33 | obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o | 33 | obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o |
| 34 | obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o | 34 | obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o |
| 35 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | 35 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a866dce611d0..8e2dacdbdccb 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
| @@ -822,7 +822,7 @@ __kuser_helper_start: | |||
| 822 | */ | 822 | */ |
| 823 | 823 | ||
| 824 | __kuser_memory_barrier: @ 0xffff0fa0 | 824 | __kuser_memory_barrier: @ 0xffff0fa0 |
| 825 | smp_dmb | 825 | smp_dmb arm |
| 826 | usr_ret lr | 826 | usr_ret lr |
| 827 | 827 | ||
| 828 | .align 5 | 828 | .align 5 |
| @@ -939,7 +939,7 @@ kuser_cmpxchg_fixup: | |||
| 939 | 939 | ||
| 940 | #else | 940 | #else |
| 941 | 941 | ||
| 942 | smp_dmb | 942 | smp_dmb arm |
| 943 | 1: ldrex r3, [r2] | 943 | 1: ldrex r3, [r2] |
| 944 | subs r3, r3, r0 | 944 | subs r3, r3, r0 |
| 945 | strexeq r3, r1, [r2] | 945 | strexeq r3, r1, [r2] |
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index d601ef297eb6..e72dc34eea1c 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c | |||
| @@ -68,10 +68,11 @@ static struct fiq_handler default_owner = { | |||
| 68 | 68 | ||
| 69 | static struct fiq_handler *current_fiq = &default_owner; | 69 | static struct fiq_handler *current_fiq = &default_owner; |
| 70 | 70 | ||
| 71 | int show_fiq_list(struct seq_file *p, void *v) | 71 | int show_fiq_list(struct seq_file *p, int prec) |
| 72 | { | 72 | { |
| 73 | if (current_fiq != &default_owner) | 73 | if (current_fiq != &default_owner) |
| 74 | seq_printf(p, "FIQ: %s\n", current_fiq->name); | 74 | seq_printf(p, "%*s: %s\n", prec, "FIQ", |
| 75 | current_fiq->name); | ||
| 75 | 76 | ||
| 76 | return 0; | 77 | return 0; |
| 77 | } | 78 | } |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index dd6b369ac69c..359e54e83bd5 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
| @@ -89,6 +89,11 @@ ENTRY(stext) | |||
| 89 | bl __lookup_machine_type @ r5=machinfo | 89 | bl __lookup_machine_type @ r5=machinfo |
| 90 | movs r8, r5 @ invalid machine (r5=0)? | 90 | movs r8, r5 @ invalid machine (r5=0)? |
| 91 | beq __error_a @ yes, error 'a' | 91 | beq __error_a @ yes, error 'a' |
| 92 | |||
| 93 | /* | ||
| 94 | * r1 = machine no, r2 = atags, | ||
| 95 | * r8 = machinfo, r9 = cpuid, r10 = procinfo | ||
| 96 | */ | ||
| 92 | bl __vet_atags | 97 | bl __vet_atags |
| 93 | #ifdef CONFIG_SMP_ON_UP | 98 | #ifdef CONFIG_SMP_ON_UP |
| 94 | bl __fixup_smp | 99 | bl __fixup_smp |
| @@ -381,19 +386,19 @@ ENDPROC(__turn_mmu_on) | |||
| 381 | 386 | ||
| 382 | #ifdef CONFIG_SMP_ON_UP | 387 | #ifdef CONFIG_SMP_ON_UP |
| 383 | __fixup_smp: | 388 | __fixup_smp: |
| 384 | mov r7, #0x00070000 | 389 | mov r4, #0x00070000 |
| 385 | orr r6, r7, #0xff000000 @ mask 0xff070000 | 390 | orr r3, r4, #0xff000000 @ mask 0xff070000 |
| 386 | orr r7, r7, #0x41000000 @ val 0x41070000 | 391 | orr r4, r4, #0x41000000 @ val 0x41070000 |
| 387 | and r0, r9, r6 | 392 | and r0, r9, r3 |
| 388 | teq r0, r7 @ ARM CPU and ARMv6/v7? | 393 | teq r0, r4 @ ARM CPU and ARMv6/v7? |
| 389 | bne __fixup_smp_on_up @ no, assume UP | 394 | bne __fixup_smp_on_up @ no, assume UP |
| 390 | 395 | ||
| 391 | orr r6, r6, #0x0000ff00 | 396 | orr r3, r3, #0x0000ff00 |
| 392 | orr r6, r6, #0x000000f0 @ mask 0xff07fff0 | 397 | orr r3, r3, #0x000000f0 @ mask 0xff07fff0 |
| 393 | orr r7, r7, #0x0000b000 | 398 | orr r4, r4, #0x0000b000 |
| 394 | orr r7, r7, #0x00000020 @ val 0x4107b020 | 399 | orr r4, r4, #0x00000020 @ val 0x4107b020 |
| 395 | and r0, r9, r6 | 400 | and r0, r9, r3 |
| 396 | teq r0, r7 @ ARM 11MPCore? | 401 | teq r0, r4 @ ARM 11MPCore? |
| 397 | moveq pc, lr @ yes, assume SMP | 402 | moveq pc, lr @ yes, assume SMP |
| 398 | 403 | ||
| 399 | mrc p15, 0, r0, c0, c0, 5 @ read MPIDR | 404 | mrc p15, 0, r0, c0, c0, 5 @ read MPIDR |
| @@ -402,15 +407,22 @@ __fixup_smp: | |||
| 402 | 407 | ||
| 403 | __fixup_smp_on_up: | 408 | __fixup_smp_on_up: |
| 404 | adr r0, 1f | 409 | adr r0, 1f |
| 405 | ldmia r0, {r3, r6, r7} | 410 | ldmia r0, {r3 - r5} |
| 406 | sub r3, r0, r3 | 411 | sub r3, r0, r3 |
| 407 | add r6, r6, r3 | 412 | add r4, r4, r3 |
| 408 | add r7, r7, r3 | 413 | add r5, r5, r3 |
| 409 | 2: cmp r6, r7 | 414 | 2: cmp r4, r5 |
| 410 | ldmia r6!, {r0, r4} | 415 | movhs pc, lr |
| 411 | strlo r4, [r0, r3] | 416 | ldmia r4!, {r0, r6} |
| 412 | blo 2b | 417 | ARM( str r6, [r0, r3] ) |
| 413 | mov pc, lr | 418 | THUMB( add r0, r0, r3 ) |
| 419 | #ifdef __ARMEB__ | ||
| 420 | THUMB( mov r6, r6, ror #16 ) @ Convert word order for big-endian. | ||
| 421 | #endif | ||
| 422 | THUMB( strh r6, [r0], #2 ) @ For Thumb-2, store as two halfwords | ||
| 423 | THUMB( mov r6, r6, lsr #16 ) @ to be robust against misaligned r3. | ||
| 424 | THUMB( strh r6, [r0] ) | ||
| 425 | b 2b | ||
| 414 | ENDPROC(__fixup_smp) | 426 | ENDPROC(__fixup_smp) |
| 415 | 427 | ||
| 416 | 1: .word . | 428 | 1: .word . |
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index 54593b0c241b..21e3a4ab3b8c 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c | |||
| @@ -748,8 +748,7 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr, | |||
| 748 | breakpoint_handler(addr, regs); | 748 | breakpoint_handler(addr, regs); |
| 749 | break; | 749 | break; |
| 750 | case ARM_ENTRY_ASYNC_WATCHPOINT: | 750 | case ARM_ENTRY_ASYNC_WATCHPOINT: |
| 751 | WARN_ON("Asynchronous watchpoint exception taken. " | 751 | WARN(1, "Asynchronous watchpoint exception taken. Debugging results may be unreliable\n"); |
| 752 | "Debugging results may be unreliable"); | ||
| 753 | case ARM_ENTRY_SYNC_WATCHPOINT: | 752 | case ARM_ENTRY_SYNC_WATCHPOINT: |
| 754 | watchpoint_handler(addr, regs); | 753 | watchpoint_handler(addr, regs); |
| 755 | break; | 754 | break; |
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index a591971dbf7b..c1269944cc59 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c | |||
| @@ -56,11 +56,20 @@ int show_interrupts(struct seq_file *p, void *v) | |||
| 56 | struct irq_desc *desc; | 56 | struct irq_desc *desc; |
| 57 | struct irqaction * action; | 57 | struct irqaction * action; |
| 58 | unsigned long flags; | 58 | unsigned long flags; |
| 59 | int prec, n; | ||
| 60 | |||
| 61 | for (prec = 3, n = 1000; prec < 10 && n <= nr_irqs; prec++) | ||
| 62 | n *= 10; | ||
| 63 | |||
| 64 | #ifdef CONFIG_SMP | ||
| 65 | if (prec < 4) | ||
| 66 | prec = 4; | ||
| 67 | #endif | ||
| 59 | 68 | ||
| 60 | if (i == 0) { | 69 | if (i == 0) { |
| 61 | char cpuname[12]; | 70 | char cpuname[12]; |
| 62 | 71 | ||
| 63 | seq_printf(p, " "); | 72 | seq_printf(p, "%*s ", prec, ""); |
| 64 | for_each_present_cpu(cpu) { | 73 | for_each_present_cpu(cpu) { |
| 65 | sprintf(cpuname, "CPU%d", cpu); | 74 | sprintf(cpuname, "CPU%d", cpu); |
| 66 | seq_printf(p, " %10s", cpuname); | 75 | seq_printf(p, " %10s", cpuname); |
| @@ -75,7 +84,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
| 75 | if (!action) | 84 | if (!action) |
| 76 | goto unlock; | 85 | goto unlock; |
| 77 | 86 | ||
| 78 | seq_printf(p, "%3d: ", i); | 87 | seq_printf(p, "%*d: ", prec, i); |
| 79 | for_each_present_cpu(cpu) | 88 | for_each_present_cpu(cpu) |
| 80 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); | 89 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); |
| 81 | seq_printf(p, " %10s", desc->chip->name ? : "-"); | 90 | seq_printf(p, " %10s", desc->chip->name ? : "-"); |
| @@ -88,13 +97,15 @@ unlock: | |||
| 88 | raw_spin_unlock_irqrestore(&desc->lock, flags); | 97 | raw_spin_unlock_irqrestore(&desc->lock, flags); |
| 89 | } else if (i == nr_irqs) { | 98 | } else if (i == nr_irqs) { |
| 90 | #ifdef CONFIG_FIQ | 99 | #ifdef CONFIG_FIQ |
| 91 | show_fiq_list(p, v); | 100 | show_fiq_list(p, prec); |
| 92 | #endif | 101 | #endif |
| 93 | #ifdef CONFIG_SMP | 102 | #ifdef CONFIG_SMP |
| 94 | show_ipi_list(p); | 103 | show_ipi_list(p, prec); |
| 95 | show_local_irqs(p); | 104 | #endif |
| 105 | #ifdef CONFIG_LOCAL_TIMERS | ||
| 106 | show_local_irqs(p, prec); | ||
| 96 | #endif | 107 | #endif |
| 97 | seq_printf(p, "Err: %10lu\n", irq_err_count); | 108 | seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count); |
| 98 | } | 109 | } |
| 99 | return 0; | 110 | return 0; |
| 100 | } | 111 | } |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 49643b1467e6..07a50357492a 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
| @@ -1749,7 +1749,7 @@ static inline int armv7_pmnc_has_overflowed(unsigned long pmnc) | |||
| 1749 | static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc, | 1749 | static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc, |
| 1750 | enum armv7_counters counter) | 1750 | enum armv7_counters counter) |
| 1751 | { | 1751 | { |
| 1752 | int ret; | 1752 | int ret = 0; |
| 1753 | 1753 | ||
| 1754 | if (counter == ARMV7_CYCLE_COUNTER) | 1754 | if (counter == ARMV7_CYCLE_COUNTER) |
| 1755 | ret = pmnc & ARMV7_FLAG_C; | 1755 | ret = pmnc & ARMV7_FLAG_C; |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 8c1959590252..5341b0b19701 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
| 25 | #include <linux/percpu.h> | 25 | #include <linux/percpu.h> |
| 26 | #include <linux/clockchips.h> | 26 | #include <linux/clockchips.h> |
| 27 | #include <linux/completion.h> | ||
| 27 | 28 | ||
| 28 | #include <asm/atomic.h> | 29 | #include <asm/atomic.h> |
| 29 | #include <asm/cacheflush.h> | 30 | #include <asm/cacheflush.h> |
| @@ -37,7 +38,6 @@ | |||
| 37 | #include <asm/tlbflush.h> | 38 | #include <asm/tlbflush.h> |
| 38 | #include <asm/ptrace.h> | 39 | #include <asm/ptrace.h> |
| 39 | #include <asm/localtimer.h> | 40 | #include <asm/localtimer.h> |
| 40 | #include <asm/smp_plat.h> | ||
| 41 | 41 | ||
| 42 | /* | 42 | /* |
| 43 | * as from 2.5, kernels no longer have an init_tasks structure | 43 | * as from 2.5, kernels no longer have an init_tasks structure |
| @@ -46,22 +46,8 @@ | |||
| 46 | */ | 46 | */ |
| 47 | struct secondary_data secondary_data; | 47 | struct secondary_data secondary_data; |
| 48 | 48 | ||
| 49 | /* | ||
| 50 | * structures for inter-processor calls | ||
| 51 | * - A collection of single bit ipi messages. | ||
| 52 | */ | ||
| 53 | struct ipi_data { | ||
| 54 | spinlock_t lock; | ||
| 55 | unsigned long ipi_count; | ||
| 56 | unsigned long bits; | ||
| 57 | }; | ||
| 58 | |||
| 59 | static DEFINE_PER_CPU(struct ipi_data, ipi_data) = { | ||
| 60 | .lock = SPIN_LOCK_UNLOCKED, | ||
| 61 | }; | ||
| 62 | |||
| 63 | enum ipi_msg_type { | 49 | enum ipi_msg_type { |
| 64 | IPI_TIMER, | 50 | IPI_TIMER = 2, |
| 65 | IPI_RESCHEDULE, | 51 | IPI_RESCHEDULE, |
| 66 | IPI_CALL_FUNC, | 52 | IPI_CALL_FUNC, |
| 67 | IPI_CALL_FUNC_SINGLE, | 53 | IPI_CALL_FUNC_SINGLE, |
| @@ -177,8 +163,12 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
| 177 | barrier(); | 163 | barrier(); |
| 178 | } | 164 | } |
| 179 | 165 | ||
| 180 | if (!cpu_online(cpu)) | 166 | if (!cpu_online(cpu)) { |
| 167 | pr_crit("CPU%u: failed to come online\n", cpu); | ||
| 181 | ret = -EIO; | 168 | ret = -EIO; |
| 169 | } | ||
| 170 | } else { | ||
| 171 | pr_err("CPU%u: failed to boot: %d\n", cpu, ret); | ||
| 182 | } | 172 | } |
| 183 | 173 | ||
| 184 | secondary_data.stack = NULL; | 174 | secondary_data.stack = NULL; |
| @@ -194,18 +184,12 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
| 194 | 184 | ||
| 195 | pgd_free(&init_mm, pgd); | 185 | pgd_free(&init_mm, pgd); |
| 196 | 186 | ||
| 197 | if (ret) { | ||
| 198 | printk(KERN_CRIT "CPU%u: processor failed to boot\n", cpu); | ||
| 199 | |||
| 200 | /* | ||
| 201 | * FIXME: We need to clean up the new idle thread. --rmk | ||
| 202 | */ | ||
| 203 | } | ||
| 204 | |||
| 205 | return ret; | 187 | return ret; |
| 206 | } | 188 | } |
| 207 | 189 | ||
| 208 | #ifdef CONFIG_HOTPLUG_CPU | 190 | #ifdef CONFIG_HOTPLUG_CPU |
| 191 | static void percpu_timer_stop(void); | ||
| 192 | |||
| 209 | /* | 193 | /* |
| 210 | * __cpu_disable runs on the processor to be shutdown. | 194 | * __cpu_disable runs on the processor to be shutdown. |
| 211 | */ | 195 | */ |
| @@ -233,7 +217,7 @@ int __cpu_disable(void) | |||
| 233 | /* | 217 | /* |
| 234 | * Stop the local timer for this CPU. | 218 | * Stop the local timer for this CPU. |
| 235 | */ | 219 | */ |
| 236 | local_timer_stop(); | 220 | percpu_timer_stop(); |
| 237 | 221 | ||
| 238 | /* | 222 | /* |
| 239 | * Flush user cache and TLB mappings, and then remove this CPU | 223 | * Flush user cache and TLB mappings, and then remove this CPU |
| @@ -252,12 +236,20 @@ int __cpu_disable(void) | |||
| 252 | return 0; | 236 | return 0; |
| 253 | } | 237 | } |
| 254 | 238 | ||
| 239 | static DECLARE_COMPLETION(cpu_died); | ||
| 240 | |||
| 255 | /* | 241 | /* |
| 256 | * called on the thread which is asking for a CPU to be shutdown - | 242 | * called on the thread which is asking for a CPU to be shutdown - |
| 257 | * waits until shutdown has completed, or it is timed out. | 243 | * waits until shutdown has completed, or it is timed out. |
| 258 | */ | 244 | */ |
| 259 | void __cpu_die(unsigned int cpu) | 245 | void __cpu_die(unsigned int cpu) |
| 260 | { | 246 | { |
| 247 | if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) { | ||
| 248 | pr_err("CPU%u: cpu didn't die\n", cpu); | ||
| 249 | return; | ||
| 250 | } | ||
| 251 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
| 252 | |||
| 261 | if (!platform_cpu_kill(cpu)) | 253 | if (!platform_cpu_kill(cpu)) |
| 262 | printk("CPU%u: unable to kill\n", cpu); | 254 | printk("CPU%u: unable to kill\n", cpu); |
| 263 | } | 255 | } |
| @@ -274,12 +266,17 @@ void __ref cpu_die(void) | |||
| 274 | { | 266 | { |
| 275 | unsigned int cpu = smp_processor_id(); | 267 | unsigned int cpu = smp_processor_id(); |
| 276 | 268 | ||
| 277 | local_irq_disable(); | ||
| 278 | idle_task_exit(); | 269 | idle_task_exit(); |
| 279 | 270 | ||
| 271 | local_irq_disable(); | ||
| 272 | mb(); | ||
| 273 | |||
| 274 | /* Tell __cpu_die() that this CPU is now safe to dispose of */ | ||
| 275 | complete(&cpu_died); | ||
| 276 | |||
| 280 | /* | 277 | /* |
| 281 | * actual CPU shutdown procedure is at least platform (if not | 278 | * actual CPU shutdown procedure is at least platform (if not |
| 282 | * CPU) specific | 279 | * CPU) specific. |
| 283 | */ | 280 | */ |
| 284 | platform_cpu_die(cpu); | 281 | platform_cpu_die(cpu); |
| 285 | 282 | ||
| @@ -289,6 +286,7 @@ void __ref cpu_die(void) | |||
| 289 | * to be repeated to undo the effects of taking the CPU offline. | 286 | * to be repeated to undo the effects of taking the CPU offline. |
| 290 | */ | 287 | */ |
| 291 | __asm__("mov sp, %0\n" | 288 | __asm__("mov sp, %0\n" |
| 289 | " mov fp, #0\n" | ||
| 292 | " b secondary_start_kernel" | 290 | " b secondary_start_kernel" |
| 293 | : | 291 | : |
| 294 | : "r" (task_stack_page(current) + THREAD_SIZE - 8)); | 292 | : "r" (task_stack_page(current) + THREAD_SIZE - 8)); |
| @@ -296,6 +294,17 @@ void __ref cpu_die(void) | |||
| 296 | #endif /* CONFIG_HOTPLUG_CPU */ | 294 | #endif /* CONFIG_HOTPLUG_CPU */ |
| 297 | 295 | ||
| 298 | /* | 296 | /* |
| 297 | * Called by both boot and secondaries to move global data into | ||
| 298 | * per-processor storage. | ||
| 299 | */ | ||
| 300 | static void __cpuinit smp_store_cpu_info(unsigned int cpuid) | ||
| 301 | { | ||
| 302 | struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); | ||
| 303 | |||
| 304 | cpu_info->loops_per_jiffy = loops_per_jiffy; | ||
| 305 | } | ||
| 306 | |||
| 307 | /* | ||
| 299 | * This is the secondary CPU boot entry. We're using this CPUs | 308 | * This is the secondary CPU boot entry. We're using this CPUs |
| 300 | * idle thread stack, but a set of temporary page tables. | 309 | * idle thread stack, but a set of temporary page tables. |
| 301 | */ | 310 | */ |
| @@ -320,6 +329,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
| 320 | 329 | ||
| 321 | cpu_init(); | 330 | cpu_init(); |
| 322 | preempt_disable(); | 331 | preempt_disable(); |
| 332 | trace_hardirqs_off(); | ||
| 323 | 333 | ||
| 324 | /* | 334 | /* |
| 325 | * Give the platform a chance to do its own initialisation. | 335 | * Give the platform a chance to do its own initialisation. |
| @@ -353,17 +363,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
| 353 | cpu_idle(); | 363 | cpu_idle(); |
| 354 | } | 364 | } |
| 355 | 365 | ||
| 356 | /* | ||
| 357 | * Called by both boot and secondaries to move global data into | ||
| 358 | * per-processor storage. | ||
| 359 | */ | ||
| 360 | void __cpuinit smp_store_cpu_info(unsigned int cpuid) | ||
| 361 | { | ||
| 362 | struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); | ||
| 363 | |||
| 364 | cpu_info->loops_per_jiffy = loops_per_jiffy; | ||
| 365 | } | ||
| 366 | |||
| 367 | void __init smp_cpus_done(unsigned int max_cpus) | 366 | void __init smp_cpus_done(unsigned int max_cpus) |
| 368 | { | 367 | { |
| 369 | int cpu; | 368 | int cpu; |
| @@ -386,61 +385,80 @@ void __init smp_prepare_boot_cpu(void) | |||
| 386 | per_cpu(cpu_data, cpu).idle = current; | 385 | per_cpu(cpu_data, cpu).idle = current; |
| 387 | } | 386 | } |
| 388 | 387 | ||
| 389 | static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg) | 388 | void __init smp_prepare_cpus(unsigned int max_cpus) |
| 390 | { | 389 | { |
| 391 | unsigned long flags; | 390 | unsigned int ncores = num_possible_cpus(); |
| 392 | unsigned int cpu; | ||
| 393 | |||
| 394 | local_irq_save(flags); | ||
| 395 | 391 | ||
| 396 | for_each_cpu(cpu, mask) { | 392 | smp_store_cpu_info(smp_processor_id()); |
| 397 | struct ipi_data *ipi = &per_cpu(ipi_data, cpu); | ||
| 398 | |||
| 399 | spin_lock(&ipi->lock); | ||
| 400 | ipi->bits |= 1 << msg; | ||
| 401 | spin_unlock(&ipi->lock); | ||
| 402 | } | ||
| 403 | 393 | ||
| 404 | /* | 394 | /* |
| 405 | * Call the platform specific cross-CPU call function. | 395 | * are we trying to boot more cores than exist? |
| 406 | */ | 396 | */ |
| 407 | smp_cross_call(mask); | 397 | if (max_cpus > ncores) |
| 398 | max_cpus = ncores; | ||
| 399 | |||
| 400 | if (max_cpus > 1) { | ||
| 401 | /* | ||
| 402 | * Enable the local timer or broadcast device for the | ||
| 403 | * boot CPU, but only if we have more than one CPU. | ||
| 404 | */ | ||
| 405 | percpu_timer_setup(); | ||
| 408 | 406 | ||
| 409 | local_irq_restore(flags); | 407 | /* |
| 408 | * Initialise the SCU if there are more than one CPU | ||
| 409 | * and let them know where to start. | ||
| 410 | */ | ||
| 411 | platform_smp_prepare_cpus(max_cpus); | ||
| 412 | } | ||
| 410 | } | 413 | } |
| 411 | 414 | ||
| 412 | void arch_send_call_function_ipi_mask(const struct cpumask *mask) | 415 | void arch_send_call_function_ipi_mask(const struct cpumask *mask) |
| 413 | { | 416 | { |
| 414 | send_ipi_message(mask, IPI_CALL_FUNC); | 417 | smp_cross_call(mask, IPI_CALL_FUNC); |
| 415 | } | 418 | } |
| 416 | 419 | ||
| 417 | void arch_send_call_function_single_ipi(int cpu) | 420 | void arch_send_call_function_single_ipi(int cpu) |
| 418 | { | 421 | { |
| 419 | send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); | 422 | smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); |
| 420 | } | 423 | } |
| 421 | 424 | ||
| 422 | void show_ipi_list(struct seq_file *p) | 425 | static const char *ipi_types[NR_IPI] = { |
| 426 | #define S(x,s) [x - IPI_TIMER] = s | ||
| 427 | S(IPI_TIMER, "Timer broadcast interrupts"), | ||
| 428 | S(IPI_RESCHEDULE, "Rescheduling interrupts"), | ||
| 429 | S(IPI_CALL_FUNC, "Function call interrupts"), | ||
| 430 | S(IPI_CALL_FUNC_SINGLE, "Single function call interrupts"), | ||
| 431 | S(IPI_CPU_STOP, "CPU stop interrupts"), | ||
| 432 | }; | ||
| 433 | |||
| 434 | void show_ipi_list(struct seq_file *p, int prec) | ||
| 423 | { | 435 | { |
| 424 | unsigned int cpu; | 436 | unsigned int cpu, i; |
| 425 | 437 | ||
| 426 | seq_puts(p, "IPI:"); | 438 | for (i = 0; i < NR_IPI; i++) { |
| 439 | seq_printf(p, "%*s%u: ", prec - 1, "IPI", i); | ||
| 427 | 440 | ||
| 428 | for_each_present_cpu(cpu) | 441 | for_each_present_cpu(cpu) |
| 429 | seq_printf(p, " %10lu", per_cpu(ipi_data, cpu).ipi_count); | 442 | seq_printf(p, "%10u ", |
| 443 | __get_irq_stat(cpu, ipi_irqs[i])); | ||
| 430 | 444 | ||
| 431 | seq_putc(p, '\n'); | 445 | seq_printf(p, " %s\n", ipi_types[i]); |
| 446 | } | ||
| 432 | } | 447 | } |
| 433 | 448 | ||
| 434 | void show_local_irqs(struct seq_file *p) | 449 | u64 smp_irq_stat_cpu(unsigned int cpu) |
| 435 | { | 450 | { |
| 436 | unsigned int cpu; | 451 | u64 sum = 0; |
| 452 | int i; | ||
| 437 | 453 | ||
| 438 | seq_printf(p, "LOC: "); | 454 | for (i = 0; i < NR_IPI; i++) |
| 455 | sum += __get_irq_stat(cpu, ipi_irqs[i]); | ||
| 439 | 456 | ||
| 440 | for_each_present_cpu(cpu) | 457 | #ifdef CONFIG_LOCAL_TIMERS |
| 441 | seq_printf(p, "%10u ", irq_stat[cpu].local_timer_irqs); | 458 | sum += __get_irq_stat(cpu, local_timer_irqs); |
| 459 | #endif | ||
| 442 | 460 | ||
| 443 | seq_putc(p, '\n'); | 461 | return sum; |
| 444 | } | 462 | } |
| 445 | 463 | ||
| 446 | /* | 464 | /* |
| @@ -463,18 +481,30 @@ asmlinkage void __exception do_local_timer(struct pt_regs *regs) | |||
| 463 | int cpu = smp_processor_id(); | 481 | int cpu = smp_processor_id(); |
| 464 | 482 | ||
| 465 | if (local_timer_ack()) { | 483 | if (local_timer_ack()) { |
| 466 | irq_stat[cpu].local_timer_irqs++; | 484 | __inc_irq_stat(cpu, local_timer_irqs); |
| 467 | ipi_timer(); | 485 | ipi_timer(); |
| 468 | } | 486 | } |
| 469 | 487 | ||
| 470 | set_irq_regs(old_regs); | 488 | set_irq_regs(old_regs); |
| 471 | } | 489 | } |
| 490 | |||
| 491 | void show_local_irqs(struct seq_file *p, int prec) | ||
| 492 | { | ||
| 493 | unsigned int cpu; | ||
| 494 | |||
| 495 | seq_printf(p, "%*s: ", prec, "LOC"); | ||
| 496 | |||
| 497 | for_each_present_cpu(cpu) | ||
| 498 | seq_printf(p, "%10u ", __get_irq_stat(cpu, local_timer_irqs)); | ||
| 499 | |||
| 500 | seq_printf(p, " Local timer interrupts\n"); | ||
| 501 | } | ||
| 472 | #endif | 502 | #endif |
| 473 | 503 | ||
| 474 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | 504 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
| 475 | static void smp_timer_broadcast(const struct cpumask *mask) | 505 | static void smp_timer_broadcast(const struct cpumask *mask) |
| 476 | { | 506 | { |
| 477 | send_ipi_message(mask, IPI_TIMER); | 507 | smp_cross_call(mask, IPI_TIMER); |
| 478 | } | 508 | } |
| 479 | #else | 509 | #else |
| 480 | #define smp_timer_broadcast NULL | 510 | #define smp_timer_broadcast NULL |
| @@ -511,6 +541,21 @@ void __cpuinit percpu_timer_setup(void) | |||
| 511 | local_timer_setup(evt); | 541 | local_timer_setup(evt); |
| 512 | } | 542 | } |
| 513 | 543 | ||
| 544 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 545 | /* | ||
| 546 | * The generic clock events code purposely does not stop the local timer | ||
| 547 | * on CPU_DEAD/CPU_DEAD_FROZEN hotplug events, so we have to do it | ||
| 548 | * manually here. | ||
| 549 | */ | ||
| 550 | static void percpu_timer_stop(void) | ||
| 551 | { | ||
| 552 | unsigned int cpu = smp_processor_id(); | ||
| 553 | struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); | ||
| 554 | |||
| 555 | evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); | ||
| 556 | } | ||
| 557 | #endif | ||
| 558 | |||
| 514 | static DEFINE_SPINLOCK(stop_lock); | 559 | static DEFINE_SPINLOCK(stop_lock); |
| 515 | 560 | ||
| 516 | /* | 561 | /* |
| @@ -537,216 +582,76 @@ static void ipi_cpu_stop(unsigned int cpu) | |||
| 537 | 582 | ||
| 538 | /* | 583 | /* |
| 539 | * Main handler for inter-processor interrupts | 584 | * Main handler for inter-processor interrupts |
| 540 | * | ||
| 541 | * For ARM, the ipimask now only identifies a single | ||
| 542 | * category of IPI (Bit 1 IPIs have been replaced by a | ||
| 543 | * different mechanism): | ||
| 544 | * | ||
| 545 | * Bit 0 - Inter-processor function call | ||
| 546 | */ | 585 | */ |
| 547 | asmlinkage void __exception do_IPI(struct pt_regs *regs) | 586 | asmlinkage void __exception do_IPI(int ipinr, struct pt_regs *regs) |
| 548 | { | 587 | { |
| 549 | unsigned int cpu = smp_processor_id(); | 588 | unsigned int cpu = smp_processor_id(); |
| 550 | struct ipi_data *ipi = &per_cpu(ipi_data, cpu); | ||
| 551 | struct pt_regs *old_regs = set_irq_regs(regs); | 589 | struct pt_regs *old_regs = set_irq_regs(regs); |
| 552 | 590 | ||
| 553 | ipi->ipi_count++; | 591 | if (ipinr >= IPI_TIMER && ipinr < IPI_TIMER + NR_IPI) |
| 554 | 592 | __inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_TIMER]); | |
| 555 | for (;;) { | ||
| 556 | unsigned long msgs; | ||
| 557 | 593 | ||
| 558 | spin_lock(&ipi->lock); | 594 | switch (ipinr) { |
| 559 | msgs = ipi->bits; | 595 | case IPI_TIMER: |
| 560 | ipi->bits = 0; | 596 | ipi_timer(); |
| 561 | spin_unlock(&ipi->lock); | 597 | break; |
| 562 | |||
| 563 | if (!msgs) | ||
| 564 | break; | ||
| 565 | |||
| 566 | do { | ||
| 567 | unsigned nextmsg; | ||
| 568 | |||
| 569 | nextmsg = msgs & -msgs; | ||
| 570 | msgs &= ~nextmsg; | ||
| 571 | nextmsg = ffz(~nextmsg); | ||
| 572 | |||
| 573 | switch (nextmsg) { | ||
| 574 | case IPI_TIMER: | ||
| 575 | ipi_timer(); | ||
| 576 | break; | ||
| 577 | 598 | ||
| 578 | case IPI_RESCHEDULE: | 599 | case IPI_RESCHEDULE: |
| 579 | /* | 600 | /* |
| 580 | * nothing more to do - eveything is | 601 | * nothing more to do - eveything is |
| 581 | * done on the interrupt return path | 602 | * done on the interrupt return path |
| 582 | */ | 603 | */ |
| 583 | break; | 604 | break; |
| 584 | 605 | ||
| 585 | case IPI_CALL_FUNC: | 606 | case IPI_CALL_FUNC: |
| 586 | generic_smp_call_function_interrupt(); | 607 | generic_smp_call_function_interrupt(); |
| 587 | break; | 608 | break; |
| 588 | 609 | ||
| 589 | case IPI_CALL_FUNC_SINGLE: | 610 | case IPI_CALL_FUNC_SINGLE: |
| 590 | generic_smp_call_function_single_interrupt(); | 611 | generic_smp_call_function_single_interrupt(); |
| 591 | break; | 612 | break; |
| 592 | 613 | ||
| 593 | case IPI_CPU_STOP: | 614 | case IPI_CPU_STOP: |
| 594 | ipi_cpu_stop(cpu); | 615 | ipi_cpu_stop(cpu); |
| 595 | break; | 616 | break; |
| 596 | 617 | ||
| 597 | default: | 618 | default: |
| 598 | printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n", | 619 | printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n", |
| 599 | cpu, nextmsg); | 620 | cpu, ipinr); |
| 600 | break; | 621 | break; |
| 601 | } | ||
| 602 | } while (msgs); | ||
| 603 | } | 622 | } |
| 604 | |||
| 605 | set_irq_regs(old_regs); | 623 | set_irq_regs(old_regs); |
| 606 | } | 624 | } |
| 607 | 625 | ||
| 608 | void smp_send_reschedule(int cpu) | 626 | void smp_send_reschedule(int cpu) |
| 609 | { | 627 | { |
| 610 | send_ipi_message(cpumask_of(cpu), IPI_RESCHEDULE); | 628 | smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE); |
| 611 | } | 629 | } |
| 612 | 630 | ||
| 613 | void smp_send_stop(void) | 631 | void smp_send_stop(void) |
| 614 | { | 632 | { |
| 615 | cpumask_t mask = cpu_online_map; | 633 | unsigned long timeout; |
| 616 | cpu_clear(smp_processor_id(), mask); | ||
| 617 | if (!cpus_empty(mask)) | ||
| 618 | send_ipi_message(&mask, IPI_CPU_STOP); | ||
| 619 | } | ||
| 620 | 634 | ||
| 621 | /* | 635 | if (num_online_cpus() > 1) { |
| 622 | * not supported here | 636 | cpumask_t mask = cpu_online_map; |
| 623 | */ | 637 | cpu_clear(smp_processor_id(), mask); |
| 624 | int setup_profiling_timer(unsigned int multiplier) | ||
| 625 | { | ||
| 626 | return -EINVAL; | ||
| 627 | } | ||
| 628 | 638 | ||
| 629 | static void | 639 | smp_cross_call(&mask, IPI_CPU_STOP); |
| 630 | on_each_cpu_mask(void (*func)(void *), void *info, int wait, | 640 | } |
| 631 | const struct cpumask *mask) | ||
| 632 | { | ||
| 633 | preempt_disable(); | ||
| 634 | 641 | ||
| 635 | smp_call_function_many(mask, func, info, wait); | 642 | /* Wait up to one second for other CPUs to stop */ |
| 636 | if (cpumask_test_cpu(smp_processor_id(), mask)) | 643 | timeout = USEC_PER_SEC; |
| 637 | func(info); | 644 | while (num_online_cpus() > 1 && timeout--) |
| 645 | udelay(1); | ||
| 638 | 646 | ||
| 639 | preempt_enable(); | 647 | if (num_online_cpus() > 1) |
| 648 | pr_warning("SMP: failed to stop secondary CPUs\n"); | ||
| 640 | } | 649 | } |
| 641 | 650 | ||
| 642 | /**********************************************************************/ | ||
| 643 | |||
| 644 | /* | 651 | /* |
| 645 | * TLB operations | 652 | * not supported here |
| 646 | */ | 653 | */ |
| 647 | struct tlb_args { | 654 | int setup_profiling_timer(unsigned int multiplier) |
| 648 | struct vm_area_struct *ta_vma; | ||
| 649 | unsigned long ta_start; | ||
| 650 | unsigned long ta_end; | ||
| 651 | }; | ||
| 652 | |||
| 653 | static inline void ipi_flush_tlb_all(void *ignored) | ||
| 654 | { | ||
| 655 | local_flush_tlb_all(); | ||
| 656 | } | ||
| 657 | |||
| 658 | static inline void ipi_flush_tlb_mm(void *arg) | ||
| 659 | { | ||
| 660 | struct mm_struct *mm = (struct mm_struct *)arg; | ||
| 661 | |||
| 662 | local_flush_tlb_mm(mm); | ||
| 663 | } | ||
| 664 | |||
| 665 | static inline void ipi_flush_tlb_page(void *arg) | ||
| 666 | { | ||
| 667 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
| 668 | |||
| 669 | local_flush_tlb_page(ta->ta_vma, ta->ta_start); | ||
| 670 | } | ||
| 671 | |||
| 672 | static inline void ipi_flush_tlb_kernel_page(void *arg) | ||
| 673 | { | ||
| 674 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
| 675 | |||
| 676 | local_flush_tlb_kernel_page(ta->ta_start); | ||
| 677 | } | ||
| 678 | |||
| 679 | static inline void ipi_flush_tlb_range(void *arg) | ||
| 680 | { | ||
| 681 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
| 682 | |||
| 683 | local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end); | ||
| 684 | } | ||
| 685 | |||
| 686 | static inline void ipi_flush_tlb_kernel_range(void *arg) | ||
| 687 | { | ||
| 688 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
| 689 | |||
| 690 | local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end); | ||
| 691 | } | ||
| 692 | |||
| 693 | void flush_tlb_all(void) | ||
| 694 | { | ||
| 695 | if (tlb_ops_need_broadcast()) | ||
| 696 | on_each_cpu(ipi_flush_tlb_all, NULL, 1); | ||
| 697 | else | ||
| 698 | local_flush_tlb_all(); | ||
| 699 | } | ||
| 700 | |||
| 701 | void flush_tlb_mm(struct mm_struct *mm) | ||
| 702 | { | ||
| 703 | if (tlb_ops_need_broadcast()) | ||
| 704 | on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mm_cpumask(mm)); | ||
| 705 | else | ||
| 706 | local_flush_tlb_mm(mm); | ||
| 707 | } | ||
| 708 | |||
| 709 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | ||
| 710 | { | ||
| 711 | if (tlb_ops_need_broadcast()) { | ||
| 712 | struct tlb_args ta; | ||
| 713 | ta.ta_vma = vma; | ||
| 714 | ta.ta_start = uaddr; | ||
| 715 | on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mm_cpumask(vma->vm_mm)); | ||
| 716 | } else | ||
| 717 | local_flush_tlb_page(vma, uaddr); | ||
| 718 | } | ||
| 719 | |||
| 720 | void flush_tlb_kernel_page(unsigned long kaddr) | ||
| 721 | { | ||
| 722 | if (tlb_ops_need_broadcast()) { | ||
| 723 | struct tlb_args ta; | ||
| 724 | ta.ta_start = kaddr; | ||
| 725 | on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); | ||
| 726 | } else | ||
| 727 | local_flush_tlb_kernel_page(kaddr); | ||
| 728 | } | ||
| 729 | |||
| 730 | void flush_tlb_range(struct vm_area_struct *vma, | ||
| 731 | unsigned long start, unsigned long end) | ||
| 732 | { | ||
| 733 | if (tlb_ops_need_broadcast()) { | ||
| 734 | struct tlb_args ta; | ||
| 735 | ta.ta_vma = vma; | ||
| 736 | ta.ta_start = start; | ||
| 737 | ta.ta_end = end; | ||
| 738 | on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mm_cpumask(vma->vm_mm)); | ||
| 739 | } else | ||
| 740 | local_flush_tlb_range(vma, start, end); | ||
| 741 | } | ||
| 742 | |||
| 743 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
| 744 | { | 655 | { |
| 745 | if (tlb_ops_need_broadcast()) { | 656 | return -EINVAL; |
| 746 | struct tlb_args ta; | ||
| 747 | ta.ta_start = start; | ||
| 748 | ta.ta_end = end; | ||
| 749 | on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1); | ||
| 750 | } else | ||
| 751 | local_flush_tlb_kernel_range(start, end); | ||
| 752 | } | 657 | } |
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c new file mode 100644 index 000000000000..7dcb35285be7 --- /dev/null +++ b/arch/arm/kernel/smp_tlb.c | |||
| @@ -0,0 +1,139 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/kernel/smp_tlb.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 ARM Limited, All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #include <linux/preempt.h> | ||
| 11 | #include <linux/smp.h> | ||
| 12 | |||
| 13 | #include <asm/smp_plat.h> | ||
| 14 | #include <asm/tlbflush.h> | ||
| 15 | |||
| 16 | static void on_each_cpu_mask(void (*func)(void *), void *info, int wait, | ||
| 17 | const struct cpumask *mask) | ||
| 18 | { | ||
| 19 | preempt_disable(); | ||
| 20 | |||
| 21 | smp_call_function_many(mask, func, info, wait); | ||
| 22 | if (cpumask_test_cpu(smp_processor_id(), mask)) | ||
| 23 | func(info); | ||
| 24 | |||
| 25 | preempt_enable(); | ||
| 26 | } | ||
| 27 | |||
| 28 | /**********************************************************************/ | ||
| 29 | |||
| 30 | /* | ||
| 31 | * TLB operations | ||
| 32 | */ | ||
| 33 | struct tlb_args { | ||
| 34 | struct vm_area_struct *ta_vma; | ||
| 35 | unsigned long ta_start; | ||
| 36 | unsigned long ta_end; | ||
| 37 | }; | ||
| 38 | |||
| 39 | static inline void ipi_flush_tlb_all(void *ignored) | ||
| 40 | { | ||
| 41 | local_flush_tlb_all(); | ||
| 42 | } | ||
| 43 | |||
| 44 | static inline void ipi_flush_tlb_mm(void *arg) | ||
| 45 | { | ||
| 46 | struct mm_struct *mm = (struct mm_struct *)arg; | ||
| 47 | |||
| 48 | local_flush_tlb_mm(mm); | ||
| 49 | } | ||
| 50 | |||
| 51 | static inline void ipi_flush_tlb_page(void *arg) | ||
| 52 | { | ||
| 53 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
| 54 | |||
| 55 | local_flush_tlb_page(ta->ta_vma, ta->ta_start); | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline void ipi_flush_tlb_kernel_page(void *arg) | ||
| 59 | { | ||
| 60 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
| 61 | |||
| 62 | local_flush_tlb_kernel_page(ta->ta_start); | ||
| 63 | } | ||
| 64 | |||
| 65 | static inline void ipi_flush_tlb_range(void *arg) | ||
| 66 | { | ||
| 67 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
| 68 | |||
| 69 | local_flush_tlb_range(ta->ta_vma, ta->ta_start, ta->ta_end); | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline void ipi_flush_tlb_kernel_range(void *arg) | ||
| 73 | { | ||
| 74 | struct tlb_args *ta = (struct tlb_args *)arg; | ||
| 75 | |||
| 76 | local_flush_tlb_kernel_range(ta->ta_start, ta->ta_end); | ||
| 77 | } | ||
| 78 | |||
| 79 | void flush_tlb_all(void) | ||
| 80 | { | ||
| 81 | if (tlb_ops_need_broadcast()) | ||
| 82 | on_each_cpu(ipi_flush_tlb_all, NULL, 1); | ||
| 83 | else | ||
| 84 | local_flush_tlb_all(); | ||
| 85 | } | ||
| 86 | |||
| 87 | void flush_tlb_mm(struct mm_struct *mm) | ||
| 88 | { | ||
| 89 | if (tlb_ops_need_broadcast()) | ||
| 90 | on_each_cpu_mask(ipi_flush_tlb_mm, mm, 1, mm_cpumask(mm)); | ||
| 91 | else | ||
| 92 | local_flush_tlb_mm(mm); | ||
| 93 | } | ||
| 94 | |||
| 95 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) | ||
| 96 | { | ||
| 97 | if (tlb_ops_need_broadcast()) { | ||
| 98 | struct tlb_args ta; | ||
| 99 | ta.ta_vma = vma; | ||
| 100 | ta.ta_start = uaddr; | ||
| 101 | on_each_cpu_mask(ipi_flush_tlb_page, &ta, 1, mm_cpumask(vma->vm_mm)); | ||
| 102 | } else | ||
| 103 | local_flush_tlb_page(vma, uaddr); | ||
| 104 | } | ||
| 105 | |||
| 106 | void flush_tlb_kernel_page(unsigned long kaddr) | ||
| 107 | { | ||
| 108 | if (tlb_ops_need_broadcast()) { | ||
| 109 | struct tlb_args ta; | ||
| 110 | ta.ta_start = kaddr; | ||
| 111 | on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); | ||
| 112 | } else | ||
| 113 | local_flush_tlb_kernel_page(kaddr); | ||
| 114 | } | ||
| 115 | |||
| 116 | void flush_tlb_range(struct vm_area_struct *vma, | ||
| 117 | unsigned long start, unsigned long end) | ||
| 118 | { | ||
| 119 | if (tlb_ops_need_broadcast()) { | ||
| 120 | struct tlb_args ta; | ||
| 121 | ta.ta_vma = vma; | ||
| 122 | ta.ta_start = start; | ||
| 123 | ta.ta_end = end; | ||
| 124 | on_each_cpu_mask(ipi_flush_tlb_range, &ta, 1, mm_cpumask(vma->vm_mm)); | ||
| 125 | } else | ||
| 126 | local_flush_tlb_range(vma, start, end); | ||
| 127 | } | ||
| 128 | |||
| 129 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
| 130 | { | ||
| 131 | if (tlb_ops_need_broadcast()) { | ||
| 132 | struct tlb_args ta; | ||
| 133 | ta.ta_start = start; | ||
| 134 | ta.ta_end = end; | ||
| 135 | on_each_cpu(ipi_flush_tlb_kernel_range, &ta, 1); | ||
| 136 | } else | ||
| 137 | local_flush_tlb_kernel_range(start, end); | ||
| 138 | } | ||
| 139 | |||
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 35882fbf37f9..24585d97c104 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
| @@ -150,13 +150,3 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk) | |||
| 150 | 150 | ||
| 151 | clockevents_register_device(clk); | 151 | clockevents_register_device(clk); |
| 152 | } | 152 | } |
| 153 | |||
| 154 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 155 | /* | ||
| 156 | * take a local timer down | ||
| 157 | */ | ||
| 158 | void twd_timer_stop(void) | ||
| 159 | { | ||
| 160 | __raw_writel(0, twd_base + TWD_TIMER_CONTROL); | ||
| 161 | } | ||
| 162 | #endif | ||
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c index 20b7411e47fd..c2e112e1a05f 100644 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c | |||
| @@ -28,7 +28,7 @@ int notrace unwind_frame(struct stackframe *frame) | |||
| 28 | 28 | ||
| 29 | /* only go to a higher address on the stack */ | 29 | /* only go to a higher address on the stack */ |
| 30 | low = frame->sp; | 30 | low = frame->sp; |
| 31 | high = ALIGN(low, THREAD_SIZE) + THREAD_SIZE; | 31 | high = ALIGN(low, THREAD_SIZE); |
| 32 | 32 | ||
| 33 | /* check current frame pointer is within bounds */ | 33 | /* check current frame pointer is within bounds */ |
| 34 | if (fp < (low + 12) || fp + 4 >= high) | 34 | if (fp < (low + 12) || fp + 4 >= high) |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 87abca018054..e02f4f7537c5 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
| @@ -55,10 +55,7 @@ static void dump_mem(const char *, const char *, unsigned long, unsigned long); | |||
| 55 | void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) | 55 | void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) |
| 56 | { | 56 | { |
| 57 | #ifdef CONFIG_KALLSYMS | 57 | #ifdef CONFIG_KALLSYMS |
| 58 | char sym1[KSYM_SYMBOL_LEN], sym2[KSYM_SYMBOL_LEN]; | 58 | printk("[<%08lx>] (%pS) from [<%08lx>] (%pS)\n", where, (void *)where, from, (void *)from); |
| 59 | sprint_symbol(sym1, where); | ||
| 60 | sprint_symbol(sym2, from); | ||
| 61 | printk("[<%08lx>] (%s) from [<%08lx>] (%s)\n", where, sym1, from, sym2); | ||
| 62 | #else | 59 | #else |
| 63 | printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); | 60 | printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); |
| 64 | #endif | 61 | #endif |
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index 2a161765f6d5..d2cb0b3c9872 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c | |||
| @@ -279,7 +279,7 @@ int unwind_frame(struct stackframe *frame) | |||
| 279 | 279 | ||
| 280 | /* only go to a higher address on the stack */ | 280 | /* only go to a higher address on the stack */ |
| 281 | low = frame->sp; | 281 | low = frame->sp; |
| 282 | high = ALIGN(low, THREAD_SIZE) + THREAD_SIZE; | 282 | high = ALIGN(low, THREAD_SIZE); |
| 283 | 283 | ||
| 284 | pr_debug("%s(pc = %08lx lr = %08lx sp = %08lx)\n", __func__, | 284 | pr_debug("%s(pc = %08lx lr = %08lx sp = %08lx)\n", __func__, |
| 285 | frame->pc, frame->lr, frame->sp); | 285 | frame->pc, frame->lr, frame->sp); |
diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S index 1e4cbd4e7be9..64f6bc1a9132 100644 --- a/arch/arm/lib/findbit.S +++ b/arch/arm/lib/findbit.S | |||
| @@ -174,8 +174,8 @@ ENDPROC(_find_next_bit_be) | |||
| 174 | */ | 174 | */ |
| 175 | .L_found: | 175 | .L_found: |
| 176 | #if __LINUX_ARM_ARCH__ >= 5 | 176 | #if __LINUX_ARM_ARCH__ >= 5 |
| 177 | rsb r1, r3, #0 | 177 | rsb r0, r3, #0 |
| 178 | and r3, r3, r1 | 178 | and r3, r3, r0 |
| 179 | clz r3, r3 | 179 | clz r3, r3 |
| 180 | rsb r3, r3, #31 | 180 | rsb r3, r3, #31 |
| 181 | add r0, r2, r3 | 181 | add r0, r2, r3 |
| @@ -190,5 +190,7 @@ ENDPROC(_find_next_bit_be) | |||
| 190 | addeq r2, r2, #1 | 190 | addeq r2, r2, #1 |
| 191 | mov r0, r2 | 191 | mov r0, r2 |
| 192 | #endif | 192 | #endif |
| 193 | cmp r1, r0 @ Clamp to maxbit | ||
| 194 | movlo r0, r1 | ||
| 193 | mov pc, lr | 195 | mov pc, lr |
| 194 | 196 | ||
diff --git a/arch/arm/mach-aaec2000/include/mach/vmalloc.h b/arch/arm/mach-aaec2000/include/mach/vmalloc.h index cff4e0a996ce..a6299e8321bd 100644 --- a/arch/arm/mach-aaec2000/include/mach/vmalloc.h +++ b/arch/arm/mach-aaec2000/include/mach/vmalloc.h | |||
| @@ -11,6 +11,6 @@ | |||
| 11 | #ifndef __ASM_ARCH_VMALLOC_H | 11 | #ifndef __ASM_ARCH_VMALLOC_H |
| 12 | #define __ASM_ARCH_VMALLOC_H | 12 | #define __ASM_ARCH_VMALLOC_H |
| 13 | 13 | ||
| 14 | #define VMALLOC_END 0xd0000000 | 14 | #define VMALLOC_END 0xd0000000UL |
| 15 | 15 | ||
| 16 | #endif /* __ASM_ARCH_VMALLOC_H */ | 16 | #endif /* __ASM_ARCH_VMALLOC_H */ |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 821eb842795f..62d686f0b426 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
| @@ -24,8 +24,8 @@ obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o | |||
| 24 | 24 | ||
| 25 | # AT91RM9200 board-specific support | 25 | # AT91RM9200 board-specific support |
| 26 | obj-$(CONFIG_MACH_ONEARM) += board-1arm.o | 26 | obj-$(CONFIG_MACH_ONEARM) += board-1arm.o |
| 27 | obj-$(CONFIG_ARCH_AT91RM9200DK) += board-dk.o | 27 | obj-$(CONFIG_ARCH_AT91RM9200DK) += board-rm9200dk.o |
| 28 | obj-$(CONFIG_MACH_AT91RM9200EK) += board-ek.o | 28 | obj-$(CONFIG_MACH_AT91RM9200EK) += board-rm9200ek.o |
| 29 | obj-$(CONFIG_MACH_CSB337) += board-csb337.o | 29 | obj-$(CONFIG_MACH_CSB337) += board-csb337.o |
| 30 | obj-$(CONFIG_MACH_CSB637) += board-csb637.o | 30 | obj-$(CONFIG_MACH_CSB637) += board-csb637.o |
| 31 | obj-$(CONFIG_MACH_CARMEVA) += board-carmeva.o | 31 | obj-$(CONFIG_MACH_CARMEVA) += board-carmeva.o |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 9338825cfcd7..7b539228e0ef 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
| @@ -1106,51 +1106,6 @@ static inline void configure_usart3_pins(unsigned pins) | |||
| 1106 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 1106 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
| 1107 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 1107 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
| 1108 | 1108 | ||
| 1109 | void __init __deprecated at91_init_serial(struct at91_uart_config *config) | ||
| 1110 | { | ||
| 1111 | int i; | ||
| 1112 | |||
| 1113 | /* Fill in list of supported UARTs */ | ||
| 1114 | for (i = 0; i < config->nr_tty; i++) { | ||
| 1115 | switch (config->tty_map[i]) { | ||
| 1116 | case 0: | ||
| 1117 | configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
| 1118 | at91_uarts[i] = &at91rm9200_uart0_device; | ||
| 1119 | at91_clock_associate("usart0_clk", &at91rm9200_uart0_device.dev, "usart"); | ||
| 1120 | break; | ||
| 1121 | case 1: | ||
| 1122 | configure_usart1_pins(ATMEL_UART_CTS | ATMEL_UART_RTS | ATMEL_UART_DSR | ATMEL_UART_DTR | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
| 1123 | at91_uarts[i] = &at91rm9200_uart1_device; | ||
| 1124 | at91_clock_associate("usart1_clk", &at91rm9200_uart1_device.dev, "usart"); | ||
| 1125 | break; | ||
| 1126 | case 2: | ||
| 1127 | configure_usart2_pins(0); | ||
| 1128 | at91_uarts[i] = &at91rm9200_uart2_device; | ||
| 1129 | at91_clock_associate("usart2_clk", &at91rm9200_uart2_device.dev, "usart"); | ||
| 1130 | break; | ||
| 1131 | case 3: | ||
| 1132 | configure_usart3_pins(0); | ||
| 1133 | at91_uarts[i] = &at91rm9200_uart3_device; | ||
| 1134 | at91_clock_associate("usart3_clk", &at91rm9200_uart3_device.dev, "usart"); | ||
| 1135 | break; | ||
| 1136 | case 4: | ||
| 1137 | configure_dbgu_pins(); | ||
| 1138 | at91_uarts[i] = &at91rm9200_dbgu_device; | ||
| 1139 | at91_clock_associate("mck", &at91rm9200_dbgu_device.dev, "usart"); | ||
| 1140 | break; | ||
| 1141 | default: | ||
| 1142 | continue; | ||
| 1143 | } | ||
| 1144 | at91_uarts[i]->id = i; /* update ID number to mapped ID */ | ||
| 1145 | } | ||
| 1146 | |||
| 1147 | /* Set serial console device */ | ||
| 1148 | if (config->console_tty < ATMEL_MAX_UART) | ||
| 1149 | atmel_default_console_device = at91_uarts[config->console_tty]; | ||
| 1150 | if (!atmel_default_console_device) | ||
| 1151 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
| 1152 | } | ||
| 1153 | |||
| 1154 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1109 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
| 1155 | { | 1110 | { |
| 1156 | struct platform_device *pdev; | 1111 | struct platform_device *pdev; |
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c index 46bdc82d3fbf..8a3fc84847c1 100644 --- a/arch/arm/mach-at91/board-1arm.c +++ b/arch/arm/mach-at91/board-1arm.c | |||
| @@ -39,24 +39,24 @@ | |||
| 39 | #include "generic.h" | 39 | #include "generic.h" |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | /* | ||
| 43 | * Serial port configuration. | ||
| 44 | * 0 .. 3 = USART0 .. USART3 | ||
| 45 | * 4 = DBGU | ||
| 46 | */ | ||
| 47 | static struct at91_uart_config __initdata onearm_uart_config = { | ||
| 48 | .console_tty = 0, /* ttyS0 */ | ||
| 49 | .nr_tty = 3, | ||
| 50 | .tty_map = { 4, 0, 1, -1, -1 }, /* ttyS0, ..., ttyS4 */ | ||
| 51 | }; | ||
| 52 | |||
| 53 | static void __init onearm_map_io(void) | 42 | static void __init onearm_map_io(void) |
| 54 | { | 43 | { |
| 55 | /* Initialize processor: 18.432 MHz crystal */ | 44 | /* Initialize processor: 18.432 MHz crystal */ |
| 56 | at91rm9200_initialize(18432000, AT91RM9200_PQFP); | 45 | at91rm9200_initialize(18432000, AT91RM9200_PQFP); |
| 57 | 46 | ||
| 58 | /* Setup the serial ports and console */ | 47 | /* DBGU on ttyS0. (Rx & Tx only) */ |
| 59 | at91_init_serial(&onearm_uart_config); | 48 | at91_register_uart(0, 0, 0); |
| 49 | |||
| 50 | /* USART0 on ttyS1 (Rx, Tx, CTS, RTS) */ | ||
| 51 | at91_register_uart(AT91RM9200_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
| 52 | |||
| 53 | /* USART1 on ttyS2 (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
| 54 | at91_register_uart(AT91RM9200_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
| 55 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
| 56 | | ATMEL_UART_RI); | ||
| 57 | |||
| 58 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
| 59 | at91_set_serial_console(0); | ||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | static void __init onearm_init_irq(void) | 62 | static void __init onearm_init_irq(void) |
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c index c0ce79d431a0..d2e1f4ec1fcc 100644 --- a/arch/arm/mach-at91/board-kafa.c +++ b/arch/arm/mach-at91/board-kafa.c | |||
| @@ -39,17 +39,6 @@ | |||
| 39 | #include "generic.h" | 39 | #include "generic.h" |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | /* | ||
| 43 | * Serial port configuration. | ||
| 44 | * 0 .. 3 = USART0 .. USART3 | ||
| 45 | * 4 = DBGU | ||
| 46 | */ | ||
| 47 | static struct at91_uart_config __initdata kafa_uart_config = { | ||
| 48 | .console_tty = 0, /* ttyS0 */ | ||
| 49 | .nr_tty = 2, | ||
| 50 | .tty_map = { 4, 0, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ | ||
| 51 | }; | ||
| 52 | |||
| 53 | static void __init kafa_map_io(void) | 42 | static void __init kafa_map_io(void) |
| 54 | { | 43 | { |
| 55 | /* Initialize processor: 18.432 MHz crystal */ | 44 | /* Initialize processor: 18.432 MHz crystal */ |
| @@ -58,8 +47,14 @@ static void __init kafa_map_io(void) | |||
| 58 | /* Set up the LEDs */ | 47 | /* Set up the LEDs */ |
| 59 | at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4); | 48 | at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4); |
| 60 | 49 | ||
| 61 | /* Setup the serial ports and console */ | 50 | /* DBGU on ttyS0. (Rx & Tx only) */ |
| 62 | at91_init_serial(&kafa_uart_config); | 51 | at91_register_uart(0, 0, 0); |
| 52 | |||
| 53 | /* USART0 on ttyS1 (Rx, Tx, CTS, RTS) */ | ||
| 54 | at91_register_uart(AT91RM9200_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
| 55 | |||
| 56 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
| 57 | at91_set_serial_console(0); | ||
| 63 | } | 58 | } |
| 64 | 59 | ||
| 65 | static void __init kafa_init_irq(void) | 60 | static void __init kafa_init_irq(void) |
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c index 9d833bbc592d..55dad3a46547 100644 --- a/arch/arm/mach-at91/board-picotux200.c +++ b/arch/arm/mach-at91/board-picotux200.c | |||
| @@ -43,24 +43,21 @@ | |||
| 43 | #include "generic.h" | 43 | #include "generic.h" |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | /* | ||
| 47 | * Serial port configuration. | ||
| 48 | * 0 .. 3 = USART0 .. USART3 | ||
| 49 | * 4 = DBGU | ||
| 50 | */ | ||
| 51 | static struct at91_uart_config __initdata picotux200_uart_config = { | ||
| 52 | .console_tty = 0, /* ttyS0 */ | ||
| 53 | .nr_tty = 2, | ||
| 54 | .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ | ||
| 55 | }; | ||
| 56 | |||
| 57 | static void __init picotux200_map_io(void) | 46 | static void __init picotux200_map_io(void) |
| 58 | { | 47 | { |
| 59 | /* Initialize processor: 18.432 MHz crystal */ | 48 | /* Initialize processor: 18.432 MHz crystal */ |
| 60 | at91rm9200_initialize(18432000, AT91RM9200_BGA); | 49 | at91rm9200_initialize(18432000, AT91RM9200_BGA); |
| 61 | 50 | ||
| 62 | /* Setup the serial ports and console */ | 51 | /* DBGU on ttyS0. (Rx & Tx only) */ |
| 63 | at91_init_serial(&picotux200_uart_config); | 52 | at91_register_uart(0, 0, 0); |
| 53 | |||
| 54 | /* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
| 55 | at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
| 56 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
| 57 | | ATMEL_UART_RI); | ||
| 58 | |||
| 59 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
| 60 | at91_set_serial_console(0); | ||
| 64 | } | 61 | } |
| 65 | 62 | ||
| 66 | static void __init picotux200_init_irq(void) | 63 | static void __init picotux200_init_irq(void) |
| @@ -77,11 +74,6 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = { | |||
| 77 | .ports = 1, | 74 | .ports = 1, |
| 78 | }; | 75 | }; |
| 79 | 76 | ||
| 80 | // static struct at91_udc_data __initdata picotux200_udc_data = { | ||
| 81 | // .vbus_pin = AT91_PIN_PD4, | ||
| 82 | // .pullup_pin = AT91_PIN_PD5, | ||
| 83 | // }; | ||
| 84 | |||
| 85 | static struct at91_mmc_data __initdata picotux200_mmc_data = { | 77 | static struct at91_mmc_data __initdata picotux200_mmc_data = { |
| 86 | .det_pin = AT91_PIN_PB27, | 78 | .det_pin = AT91_PIN_PB27, |
| 87 | .slot_b = 0, | 79 | .slot_b = 0, |
| @@ -89,21 +81,6 @@ static struct at91_mmc_data __initdata picotux200_mmc_data = { | |||
| 89 | .wp_pin = AT91_PIN_PA17, | 81 | .wp_pin = AT91_PIN_PA17, |
| 90 | }; | 82 | }; |
| 91 | 83 | ||
| 92 | // static struct spi_board_info picotux200_spi_devices[] = { | ||
| 93 | // { /* DataFlash chip */ | ||
| 94 | // .modalias = "mtd_dataflash", | ||
| 95 | // .chip_select = 0, | ||
| 96 | // .max_speed_hz = 15 * 1000 * 1000, | ||
| 97 | // }, | ||
| 98 | // #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | ||
| 99 | // { /* DataFlash card */ | ||
| 100 | // .modalias = "mtd_dataflash", | ||
| 101 | // .chip_select = 3, | ||
| 102 | // .max_speed_hz = 15 * 1000 * 1000, | ||
| 103 | // }, | ||
| 104 | // #endif | ||
| 105 | // }; | ||
| 106 | |||
| 107 | #define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 | 84 | #define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 |
| 108 | #define PICOTUX200_FLASH_SIZE SZ_4M | 85 | #define PICOTUX200_FLASH_SIZE SZ_4M |
| 109 | 86 | ||
| @@ -135,21 +112,11 @@ static void __init picotux200_board_init(void) | |||
| 135 | at91_add_device_eth(&picotux200_eth_data); | 112 | at91_add_device_eth(&picotux200_eth_data); |
| 136 | /* USB Host */ | 113 | /* USB Host */ |
| 137 | at91_add_device_usbh(&picotux200_usbh_data); | 114 | at91_add_device_usbh(&picotux200_usbh_data); |
| 138 | /* USB Device */ | ||
| 139 | // at91_add_device_udc(&picotux200_udc_data); | ||
| 140 | // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ | ||
| 141 | /* I2C */ | 115 | /* I2C */ |
| 142 | at91_add_device_i2c(NULL, 0); | 116 | at91_add_device_i2c(NULL, 0); |
| 143 | /* SPI */ | ||
| 144 | // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices)); | ||
| 145 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | ||
| 146 | /* DataFlash card */ | ||
| 147 | at91_set_gpio_output(AT91_PIN_PB22, 0); | ||
| 148 | #else | ||
| 149 | /* MMC */ | 117 | /* MMC */ |
| 150 | at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ | 118 | at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ |
| 151 | at91_add_device_mmc(0, &picotux200_mmc_data); | 119 | at91_add_device_mmc(0, &picotux200_mmc_data); |
| 152 | #endif | ||
| 153 | /* NOR Flash */ | 120 | /* NOR Flash */ |
| 154 | platform_device_register(&picotux200_flash); | 121 | platform_device_register(&picotux200_flash); |
| 155 | } | 122 | } |
diff --git a/arch/arm/mach-at91/board-dk.c b/arch/arm/mach-at91/board-rm9200dk.c index e14f0e165680..4c1047c8200d 100644 --- a/arch/arm/mach-at91/board-dk.c +++ b/arch/arm/mach-at91/board-rm9200dk.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-at91/board-dk.c | 2 | * linux/arch/arm/mach-at91/board-rm9200dk.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005 SAN People | 4 | * Copyright (C) 2005 SAN People |
| 5 | * | 5 | * |
| @@ -91,10 +91,12 @@ static struct at91_cf_data __initdata dk_cf_data = { | |||
| 91 | // .vcc_pin = ... always powered | 91 | // .vcc_pin = ... always powered |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD | ||
| 94 | static struct at91_mmc_data __initdata dk_mmc_data = { | 95 | static struct at91_mmc_data __initdata dk_mmc_data = { |
| 95 | .slot_b = 0, | 96 | .slot_b = 0, |
| 96 | .wire4 = 1, | 97 | .wire4 = 1, |
| 97 | }; | 98 | }; |
| 99 | #endif | ||
| 98 | 100 | ||
| 99 | static struct spi_board_info dk_spi_devices[] = { | 101 | static struct spi_board_info dk_spi_devices[] = { |
| 100 | { /* DataFlash chip */ | 102 | { /* DataFlash chip */ |
diff --git a/arch/arm/mach-at91/board-ek.c b/arch/arm/mach-at91/board-rm9200ek.c index 56e92c4bbc2a..9df1be8818c0 100644 --- a/arch/arm/mach-at91/board-ek.c +++ b/arch/arm/mach-at91/board-rm9200ek.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-at91/board-ek.c | 2 | * linux/arch/arm/mach-at91/board-rm9200ek.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005 SAN People | 4 | * Copyright (C) 2005 SAN People |
| 5 | * | 5 | * |
| @@ -84,12 +84,14 @@ static struct at91_udc_data __initdata ek_udc_data = { | |||
| 84 | .pullup_pin = AT91_PIN_PD5, | 84 | .pullup_pin = AT91_PIN_PD5, |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD | ||
| 87 | static struct at91_mmc_data __initdata ek_mmc_data = { | 88 | static struct at91_mmc_data __initdata ek_mmc_data = { |
| 88 | .det_pin = AT91_PIN_PB27, | 89 | .det_pin = AT91_PIN_PB27, |
| 89 | .slot_b = 0, | 90 | .slot_b = 0, |
| 90 | .wire4 = 1, | 91 | .wire4 = 1, |
| 91 | .wp_pin = AT91_PIN_PA17, | 92 | .wp_pin = AT91_PIN_PA17, |
| 92 | }; | 93 | }; |
| 94 | #endif | ||
| 93 | 95 | ||
| 94 | static struct spi_board_info ek_spi_devices[] = { | 96 | static struct spi_board_info ek_spi_devices[] = { |
| 95 | { /* DataFlash chip */ | 97 | { /* DataFlash chip */ |
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c index 89df00a9d2f7..e0f0080eb639 100644 --- a/arch/arm/mach-at91/board-yl-9200.c +++ b/arch/arm/mach-at91/board-yl-9200.c | |||
| @@ -387,7 +387,7 @@ static struct spi_board_info yl9200_spi_devices[] = { | |||
| 387 | * EPSON S1D13806 FB (discontinued chip) | 387 | * EPSON S1D13806 FB (discontinued chip) |
| 388 | * EPSON S1D13506 FB | 388 | * EPSON S1D13506 FB |
| 389 | */ | 389 | */ |
| 390 | #if defined(CONFIG_FB_S1D135XX) || defined(CONFIG_FB_S1D13XXX_MODULE) | 390 | #if defined(CONFIG_FB_S1D13XXX) || defined(CONFIG_FB_S1D13XXX_MODULE) |
| 391 | #include <video/s1d13xxxfb.h> | 391 | #include <video/s1d13xxxfb.h> |
| 392 | 392 | ||
| 393 | 393 | ||
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index 58528aa9c8a8..2b499eb343a1 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
| @@ -137,13 +137,7 @@ extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_de | |||
| 137 | extern void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins); | 137 | extern void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins); |
| 138 | extern void __init at91_set_serial_console(unsigned portnr); | 138 | extern void __init at91_set_serial_console(unsigned portnr); |
| 139 | 139 | ||
| 140 | struct at91_uart_config { | ||
| 141 | unsigned short console_tty; /* tty number of serial console */ | ||
| 142 | unsigned short nr_tty; /* number of serial tty's */ | ||
| 143 | short tty_map[]; /* map UART to tty number */ | ||
| 144 | }; | ||
| 145 | extern struct platform_device *atmel_default_console_device; | 140 | extern struct platform_device *atmel_default_console_device; |
| 146 | extern void __init __deprecated at91_init_serial(struct at91_uart_config *config); | ||
| 147 | 141 | ||
| 148 | struct atmel_uart_data { | 142 | struct atmel_uart_data { |
| 149 | short use_dma_tx; /* use transmit DMA? */ | 143 | short use_dma_tx; /* use transmit DMA? */ |
diff --git a/arch/arm/mach-bcmring/include/mach/vmalloc.h b/arch/arm/mach-bcmring/include/mach/vmalloc.h index 3db3a09fd398..7397bd7817d9 100644 --- a/arch/arm/mach-bcmring/include/mach/vmalloc.h +++ b/arch/arm/mach-bcmring/include/mach/vmalloc.h | |||
| @@ -22,4 +22,4 @@ | |||
| 22 | * 0xe0000000 to 0xefffffff. This gives us 256 MB of vm space and handles | 22 | * 0xe0000000 to 0xefffffff. This gives us 256 MB of vm space and handles |
| 23 | * larger physical memory designs better. | 23 | * larger physical memory designs better. |
| 24 | */ | 24 | */ |
| 25 | #define VMALLOC_END 0xf0000000 | 25 | #define VMALLOC_END 0xf0000000UL |
diff --git a/arch/arm/mach-clps711x/include/mach/vmalloc.h b/arch/arm/mach-clps711x/include/mach/vmalloc.h index 30b3a287ed88..467b96137e47 100644 --- a/arch/arm/mach-clps711x/include/mach/vmalloc.h +++ b/arch/arm/mach-clps711x/include/mach/vmalloc.h | |||
| @@ -17,4 +17,4 @@ | |||
| 17 | * along with this program; if not, write to the Free Software | 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 | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ | 19 | */ |
| 20 | #define VMALLOC_END 0xd0000000 | 20 | #define VMALLOC_END 0xd0000000UL |
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 9be261beae7d..2652af124acd 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c | |||
| @@ -359,8 +359,8 @@ static struct clk_lookup dm355_clks[] = { | |||
| 359 | CLK(NULL, "uart1", &uart1_clk), | 359 | CLK(NULL, "uart1", &uart1_clk), |
| 360 | CLK(NULL, "uart2", &uart2_clk), | 360 | CLK(NULL, "uart2", &uart2_clk), |
| 361 | CLK("i2c_davinci.1", NULL, &i2c_clk), | 361 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
| 362 | CLK("davinci-asp.0", NULL, &asp0_clk), | 362 | CLK("davinci-mcbsp.0", NULL, &asp0_clk), |
| 363 | CLK("davinci-asp.1", NULL, &asp1_clk), | 363 | CLK("davinci-mcbsp.1", NULL, &asp1_clk), |
| 364 | CLK("davinci_mmc.0", NULL, &mmcsd0_clk), | 364 | CLK("davinci_mmc.0", NULL, &mmcsd0_clk), |
| 365 | CLK("davinci_mmc.1", NULL, &mmcsd1_clk), | 365 | CLK("davinci_mmc.1", NULL, &mmcsd1_clk), |
| 366 | CLK("spi_davinci.0", NULL, &spi0_clk), | 366 | CLK("spi_davinci.0", NULL, &spi0_clk), |
| @@ -664,7 +664,7 @@ static struct resource dm355_asp1_resources[] = { | |||
| 664 | }; | 664 | }; |
| 665 | 665 | ||
| 666 | static struct platform_device dm355_asp1_device = { | 666 | static struct platform_device dm355_asp1_device = { |
| 667 | .name = "davinci-asp", | 667 | .name = "davinci-mcbsp", |
| 668 | .id = 1, | 668 | .id = 1, |
| 669 | .num_resources = ARRAY_SIZE(dm355_asp1_resources), | 669 | .num_resources = ARRAY_SIZE(dm355_asp1_resources), |
| 670 | .resource = dm355_asp1_resources, | 670 | .resource = dm355_asp1_resources, |
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index a12065e87266..c466d710d3c1 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
| @@ -459,7 +459,7 @@ static struct clk_lookup dm365_clks[] = { | |||
| 459 | CLK(NULL, "usb", &usb_clk), | 459 | CLK(NULL, "usb", &usb_clk), |
| 460 | CLK("davinci_emac.1", NULL, &emac_clk), | 460 | CLK("davinci_emac.1", NULL, &emac_clk), |
| 461 | CLK("davinci_voicecodec", NULL, &voicecodec_clk), | 461 | CLK("davinci_voicecodec", NULL, &voicecodec_clk), |
| 462 | CLK("davinci-asp.0", NULL, &asp0_clk), | 462 | CLK("davinci-mcbsp", NULL, &asp0_clk), |
| 463 | CLK(NULL, "rto", &rto_clk), | 463 | CLK(NULL, "rto", &rto_clk), |
| 464 | CLK(NULL, "mjcp", &mjcp_clk), | 464 | CLK(NULL, "mjcp", &mjcp_clk), |
| 465 | CLK(NULL, NULL, NULL), | 465 | CLK(NULL, NULL, NULL), |
| @@ -922,8 +922,8 @@ static struct resource dm365_asp_resources[] = { | |||
| 922 | }; | 922 | }; |
| 923 | 923 | ||
| 924 | static struct platform_device dm365_asp_device = { | 924 | static struct platform_device dm365_asp_device = { |
| 925 | .name = "davinci-asp", | 925 | .name = "davinci-mcbsp", |
| 926 | .id = 0, | 926 | .id = -1, |
| 927 | .num_resources = ARRAY_SIZE(dm365_asp_resources), | 927 | .num_resources = ARRAY_SIZE(dm365_asp_resources), |
| 928 | .resource = dm365_asp_resources, | 928 | .resource = dm365_asp_resources, |
| 929 | }; | 929 | }; |
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 0608dd776a16..9a2376b3137c 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
| @@ -302,7 +302,7 @@ static struct clk_lookup dm644x_clks[] = { | |||
| 302 | CLK("davinci_emac.1", NULL, &emac_clk), | 302 | CLK("davinci_emac.1", NULL, &emac_clk), |
| 303 | CLK("i2c_davinci.1", NULL, &i2c_clk), | 303 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
| 304 | CLK("palm_bk3710", NULL, &ide_clk), | 304 | CLK("palm_bk3710", NULL, &ide_clk), |
| 305 | CLK("davinci-asp", NULL, &asp_clk), | 305 | CLK("davinci-mcbsp", NULL, &asp_clk), |
| 306 | CLK("davinci_mmc.0", NULL, &mmcsd_clk), | 306 | CLK("davinci_mmc.0", NULL, &mmcsd_clk), |
| 307 | CLK(NULL, "spi", &spi_clk), | 307 | CLK(NULL, "spi", &spi_clk), |
| 308 | CLK(NULL, "gpio", &gpio_clk), | 308 | CLK(NULL, "gpio", &gpio_clk), |
| @@ -580,7 +580,7 @@ static struct resource dm644x_asp_resources[] = { | |||
| 580 | }; | 580 | }; |
| 581 | 581 | ||
| 582 | static struct platform_device dm644x_asp_device = { | 582 | static struct platform_device dm644x_asp_device = { |
| 583 | .name = "davinci-asp", | 583 | .name = "davinci-mcbsp", |
| 584 | .id = -1, | 584 | .id = -1, |
| 585 | .num_resources = ARRAY_SIZE(dm644x_asp_resources), | 585 | .num_resources = ARRAY_SIZE(dm644x_asp_resources), |
| 586 | .resource = dm644x_asp_resources, | 586 | .resource = dm644x_asp_resources, |
diff --git a/arch/arm/mach-ebsa110/include/mach/vmalloc.h b/arch/arm/mach-ebsa110/include/mach/vmalloc.h index 60bde56fba4c..ea141b7a3e03 100644 --- a/arch/arm/mach-ebsa110/include/mach/vmalloc.h +++ b/arch/arm/mach-ebsa110/include/mach/vmalloc.h | |||
| @@ -7,4 +7,4 @@ | |||
| 7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | #define VMALLOC_END 0xdf000000 | 10 | #define VMALLOC_END 0xdf000000UL |
diff --git a/arch/arm/mach-ep93xx/include/mach/dma.h b/arch/arm/mach-ep93xx/include/mach/dma.h index 3a5961d3f3b1..5e31b2b25da9 100644 --- a/arch/arm/mach-ep93xx/include/mach/dma.h +++ b/arch/arm/mach-ep93xx/include/mach/dma.h | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | /* | 1 | /** |
| 2 | * arch/arm/mach-ep93xx/include/mach/dma.h | 2 | * DOC: EP93xx DMA M2P memory to peripheral and peripheral to memory engine |
| 3 | * | ||
| 4 | * The EP93xx DMA M2P subsystem handles DMA transfers between memory and | ||
| 5 | * peripherals. DMA M2P channels are available for audio, UARTs and IrDA. | ||
| 6 | * See chapter 10 of the EP93xx users guide for full details on the DMA M2P | ||
| 7 | * engine. | ||
| 8 | * | ||
| 9 | * See sound/soc/ep93xx/ep93xx-pcm.c for an example use of the DMA M2P code. | ||
| 10 | * | ||
| 3 | */ | 11 | */ |
| 4 | 12 | ||
| 5 | #ifndef __ASM_ARCH_DMA_H | 13 | #ifndef __ASM_ARCH_DMA_H |
| @@ -8,12 +16,34 @@ | |||
| 8 | #include <linux/list.h> | 16 | #include <linux/list.h> |
| 9 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 10 | 18 | ||
| 19 | /** | ||
| 20 | * struct ep93xx_dma_buffer - Information about a buffer to be transferred | ||
| 21 | * using the DMA M2P engine | ||
| 22 | * | ||
| 23 | * @list: Entry in DMA buffer list | ||
| 24 | * @bus_addr: Physical address of the buffer | ||
| 25 | * @size: Size of the buffer in bytes | ||
| 26 | */ | ||
| 11 | struct ep93xx_dma_buffer { | 27 | struct ep93xx_dma_buffer { |
| 12 | struct list_head list; | 28 | struct list_head list; |
| 13 | u32 bus_addr; | 29 | u32 bus_addr; |
| 14 | u16 size; | 30 | u16 size; |
| 15 | }; | 31 | }; |
| 16 | 32 | ||
| 33 | /** | ||
| 34 | * struct ep93xx_dma_m2p_client - Information about a DMA M2P client | ||
| 35 | * | ||
| 36 | * @name: Unique name for this client | ||
| 37 | * @flags: Client flags | ||
| 38 | * @cookie: User data to pass to callback functions | ||
| 39 | * @buffer_started: Non NULL function to call when a transfer is started. | ||
| 40 | * The arguments are the user data cookie and the DMA | ||
| 41 | * buffer which is starting. | ||
| 42 | * @buffer_finished: Non NULL function to call when a transfer is completed. | ||
| 43 | * The arguments are the user data cookie, the DMA buffer | ||
| 44 | * which has completed, and a boolean flag indicating if | ||
| 45 | * the transfer had an error. | ||
| 46 | */ | ||
| 17 | struct ep93xx_dma_m2p_client { | 47 | struct ep93xx_dma_m2p_client { |
| 18 | char *name; | 48 | char *name; |
| 19 | u8 flags; | 49 | u8 flags; |
| @@ -24,10 +54,11 @@ struct ep93xx_dma_m2p_client { | |||
| 24 | struct ep93xx_dma_buffer *buf, | 54 | struct ep93xx_dma_buffer *buf, |
| 25 | int bytes, int error); | 55 | int bytes, int error); |
| 26 | 56 | ||
| 27 | /* Internal to the DMA code. */ | 57 | /* private: Internal use only */ |
| 28 | void *channel; | 58 | void *channel; |
| 29 | }; | 59 | }; |
| 30 | 60 | ||
| 61 | /* DMA M2P ports */ | ||
| 31 | #define EP93XX_DMA_M2P_PORT_I2S1 0x00 | 62 | #define EP93XX_DMA_M2P_PORT_I2S1 0x00 |
| 32 | #define EP93XX_DMA_M2P_PORT_I2S2 0x01 | 63 | #define EP93XX_DMA_M2P_PORT_I2S2 0x01 |
| 33 | #define EP93XX_DMA_M2P_PORT_AAC1 0x02 | 64 | #define EP93XX_DMA_M2P_PORT_AAC1 0x02 |
| @@ -39,18 +70,80 @@ struct ep93xx_dma_m2p_client { | |||
| 39 | #define EP93XX_DMA_M2P_PORT_UART3 0x08 | 70 | #define EP93XX_DMA_M2P_PORT_UART3 0x08 |
| 40 | #define EP93XX_DMA_M2P_PORT_IRDA 0x09 | 71 | #define EP93XX_DMA_M2P_PORT_IRDA 0x09 |
| 41 | #define EP93XX_DMA_M2P_PORT_MASK 0x0f | 72 | #define EP93XX_DMA_M2P_PORT_MASK 0x0f |
| 42 | #define EP93XX_DMA_M2P_TX 0x00 | ||
| 43 | #define EP93XX_DMA_M2P_RX 0x10 | ||
| 44 | #define EP93XX_DMA_M2P_ABORT_ON_ERROR 0x20 | ||
| 45 | #define EP93XX_DMA_M2P_IGNORE_ERROR 0x40 | ||
| 46 | #define EP93XX_DMA_M2P_ERROR_MASK 0x60 | ||
| 47 | 73 | ||
| 48 | int ep93xx_dma_m2p_client_register(struct ep93xx_dma_m2p_client *m2p); | 74 | /* DMA M2P client flags */ |
| 75 | #define EP93XX_DMA_M2P_TX 0x00 /* Memory to peripheral */ | ||
| 76 | #define EP93XX_DMA_M2P_RX 0x10 /* Peripheral to memory */ | ||
| 77 | |||
| 78 | /* | ||
| 79 | * DMA M2P client error handling flags. See the EP93xx users guide | ||
| 80 | * documentation on the DMA M2P CONTROL register for more details | ||
| 81 | */ | ||
| 82 | #define EP93XX_DMA_M2P_ABORT_ON_ERROR 0x20 /* Abort on peripheral error */ | ||
| 83 | #define EP93XX_DMA_M2P_IGNORE_ERROR 0x40 /* Ignore peripheral errors */ | ||
| 84 | #define EP93XX_DMA_M2P_ERROR_MASK 0x60 /* Mask of error bits */ | ||
| 85 | |||
| 86 | /** | ||
| 87 | * ep93xx_dma_m2p_client_register - Register a client with the DMA M2P | ||
| 88 | * subsystem | ||
| 89 | * | ||
| 90 | * @m2p: Client information to register | ||
| 91 | * returns 0 on success | ||
| 92 | * | ||
| 93 | * The DMA M2P subsystem allocates a channel and an interrupt line for the DMA | ||
| 94 | * client | ||
| 95 | */ | ||
| 96 | int ep93xx_dma_m2p_client_register(struct ep93xx_dma_m2p_client *m2p); | ||
| 97 | |||
| 98 | /** | ||
| 99 | * ep93xx_dma_m2p_client_unregister - Unregister a client from the DMA M2P | ||
| 100 | * subsystem | ||
| 101 | * | ||
| 102 | * @m2p: Client to unregister | ||
| 103 | * | ||
| 104 | * Any transfers currently in progress will be completed in hardware, but | ||
| 105 | * ignored in software. | ||
| 106 | */ | ||
| 49 | void ep93xx_dma_m2p_client_unregister(struct ep93xx_dma_m2p_client *m2p); | 107 | void ep93xx_dma_m2p_client_unregister(struct ep93xx_dma_m2p_client *m2p); |
| 108 | |||
| 109 | /** | ||
| 110 | * ep93xx_dma_m2p_submit - Submit a DMA M2P transfer | ||
| 111 | * | ||
| 112 | * @m2p: DMA Client to submit the transfer on | ||
| 113 | * @buf: DMA Buffer to submit | ||
| 114 | * | ||
| 115 | * If the current or next transfer positions are free on the M2P client then | ||
| 116 | * the transfer is started immediately. If not, the transfer is added to the | ||
| 117 | * list of pending transfers. This function must not be called from the | ||
| 118 | * buffer_finished callback for an M2P channel. | ||
| 119 | * | ||
| 120 | */ | ||
| 50 | void ep93xx_dma_m2p_submit(struct ep93xx_dma_m2p_client *m2p, | 121 | void ep93xx_dma_m2p_submit(struct ep93xx_dma_m2p_client *m2p, |
| 51 | struct ep93xx_dma_buffer *buf); | 122 | struct ep93xx_dma_buffer *buf); |
| 123 | |||
| 124 | /** | ||
| 125 | * ep93xx_dma_m2p_submit_recursive - Put a DMA transfer on the pending list | ||
| 126 | * for an M2P channel | ||
| 127 | * | ||
| 128 | * @m2p: DMA Client to submit the transfer on | ||
| 129 | * @buf: DMA Buffer to submit | ||
| 130 | * | ||
| 131 | * This function must only be called from the buffer_finished callback for an | ||
| 132 | * M2P channel. It is commonly used to add the next transfer in a chained list | ||
| 133 | * of DMA transfers. | ||
| 134 | */ | ||
| 52 | void ep93xx_dma_m2p_submit_recursive(struct ep93xx_dma_m2p_client *m2p, | 135 | void ep93xx_dma_m2p_submit_recursive(struct ep93xx_dma_m2p_client *m2p, |
| 53 | struct ep93xx_dma_buffer *buf); | 136 | struct ep93xx_dma_buffer *buf); |
| 137 | |||
| 138 | /** | ||
| 139 | * ep93xx_dma_m2p_flush - Flush all pending transfers on a DMA M2P client | ||
| 140 | * | ||
| 141 | * @m2p: DMA client to flush transfers on | ||
| 142 | * | ||
| 143 | * Any transfers currently in progress will be completed in hardware, but | ||
| 144 | * ignored in software. | ||
| 145 | * | ||
| 146 | */ | ||
| 54 | void ep93xx_dma_m2p_flush(struct ep93xx_dma_m2p_client *m2p); | 147 | void ep93xx_dma_m2p_flush(struct ep93xx_dma_m2p_client *m2p); |
| 55 | 148 | ||
| 56 | #endif /* __ASM_ARCH_DMA_H */ | 149 | #endif /* __ASM_ARCH_DMA_H */ |
diff --git a/arch/arm/mach-footbridge/include/mach/vmalloc.h b/arch/arm/mach-footbridge/include/mach/vmalloc.h index 0ffbb7c85e59..40ba78e5782b 100644 --- a/arch/arm/mach-footbridge/include/mach/vmalloc.h +++ b/arch/arm/mach-footbridge/include/mach/vmalloc.h | |||
| @@ -7,4 +7,4 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | #define VMALLOC_END 0xf0000000 | 10 | #define VMALLOC_END 0xf0000000UL |
diff --git a/arch/arm/mach-h720x/include/mach/vmalloc.h b/arch/arm/mach-h720x/include/mach/vmalloc.h index a45915b88756..8520b4a4d4e6 100644 --- a/arch/arm/mach-h720x/include/mach/vmalloc.h +++ b/arch/arm/mach-h720x/include/mach/vmalloc.h | |||
| @@ -5,6 +5,6 @@ | |||
| 5 | #ifndef __ARCH_ARM_VMALLOC_H | 5 | #ifndef __ARCH_ARM_VMALLOC_H |
| 6 | #define __ARCH_ARM_VMALLOC_H | 6 | #define __ARCH_ARM_VMALLOC_H |
| 7 | 7 | ||
| 8 | #define VMALLOC_END 0xd0000000 | 8 | #define VMALLOC_END 0xd0000000UL |
| 9 | 9 | ||
| 10 | #endif | 10 | #endif |
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index 026263c665ca..7e1e9dc2c8fc 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | |||
| @@ -250,9 +250,6 @@ static const struct imxuart_platform_data uart_pdata __initconst = { | |||
| 250 | .flags = IMXUART_HAVE_RTSCTS, | 250 | .flags = IMXUART_HAVE_RTSCTS, |
| 251 | }; | 251 | }; |
| 252 | 252 | ||
| 253 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) \ | ||
| 254 | || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
| 255 | |||
| 256 | #define ADS7846_PENDOWN (GPIO_PORTD | 25) | 253 | #define ADS7846_PENDOWN (GPIO_PORTD | 25) |
| 257 | 254 | ||
| 258 | static void ads7846_dev_init(void) | 255 | static void ads7846_dev_init(void) |
| @@ -273,9 +270,7 @@ static struct ads7846_platform_data ads7846_config __initdata = { | |||
| 273 | .get_pendown_state = ads7846_get_pendown_state, | 270 | .get_pendown_state = ads7846_get_pendown_state, |
| 274 | .keep_vref_on = 1, | 271 | .keep_vref_on = 1, |
| 275 | }; | 272 | }; |
| 276 | #endif | ||
| 277 | 273 | ||
| 278 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) | ||
| 279 | static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = { | 274 | static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = { |
| 280 | [0] = { | 275 | [0] = { |
| 281 | .modalias = "ads7846", | 276 | .modalias = "ads7846", |
| @@ -294,7 +289,6 @@ static const struct spi_imx_master eukrea_mbimx27_spi0_data __initconst = { | |||
| 294 | .chipselect = eukrea_mbimx27_spi_cs, | 289 | .chipselect = eukrea_mbimx27_spi_cs, |
| 295 | .num_chipselect = ARRAY_SIZE(eukrea_mbimx27_spi_cs), | 290 | .num_chipselect = ARRAY_SIZE(eukrea_mbimx27_spi_cs), |
| 296 | }; | 291 | }; |
| 297 | #endif | ||
| 298 | 292 | ||
| 299 | static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = { | 293 | static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = { |
| 300 | { | 294 | { |
diff --git a/arch/arm/mach-integrator/include/mach/vmalloc.h b/arch/arm/mach-integrator/include/mach/vmalloc.h index e056e7cf5645..2f5a2bafb11f 100644 --- a/arch/arm/mach-integrator/include/mach/vmalloc.h +++ b/arch/arm/mach-integrator/include/mach/vmalloc.h | |||
| @@ -17,4 +17,4 @@ | |||
| 17 | * along with this program; if not, write to the Free Software | 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 | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ | 19 | */ |
| 20 | #define VMALLOC_END 0xd0000000 | 20 | #define VMALLOC_END 0xd0000000UL |
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 51ff23b72d3a..3688123b5ad8 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
| @@ -854,10 +854,9 @@ int __init kirkwood_find_tclk(void) | |||
| 854 | 854 | ||
| 855 | kirkwood_pcie_id(&dev, &rev); | 855 | kirkwood_pcie_id(&dev, &rev); |
| 856 | 856 | ||
| 857 | if ((dev == MV88F6281_DEV_ID && (rev == MV88F6281_REV_A0 || | 857 | if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID) |
| 858 | rev == MV88F6281_REV_A1)) || | 858 | if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0) |
| 859 | (dev == MV88F6282_DEV_ID)) | 859 | return 200000000; |
| 860 | return 200000000; | ||
| 861 | 860 | ||
| 862 | return 166666667; | 861 | return 166666667; |
| 863 | } | 862 | } |
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c index 4aa86e4a152c..a31c9499ab36 100644 --- a/arch/arm/mach-kirkwood/d2net_v2-setup.c +++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c | |||
| @@ -225,5 +225,5 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2") | |||
| 225 | .init_machine = d2net_v2_init, | 225 | .init_machine = d2net_v2_init, |
| 226 | .map_io = kirkwood_map_io, | 226 | .map_io = kirkwood_map_io, |
| 227 | .init_irq = kirkwood_init_irq, | 227 | .init_irq = kirkwood_init_irq, |
| 228 | .timer = &lacie_v2_timer, | 228 | .timer = &kirkwood_timer, |
| 229 | MACHINE_END | 229 | MACHINE_END |
diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.c b/arch/arm/mach-kirkwood/lacie_v2-common.c index d3ea1b6c8a02..285edab776e9 100644 --- a/arch/arm/mach-kirkwood/lacie_v2-common.c +++ b/arch/arm/mach-kirkwood/lacie_v2-common.c | |||
| @@ -111,17 +111,3 @@ void __init lacie_v2_hdd_power_init(int hdd_num) | |||
| 111 | pr_err("Failed to power up HDD%d\n", i + 1); | 111 | pr_err("Failed to power up HDD%d\n", i + 1); |
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| 114 | |||
| 115 | /***************************************************************************** | ||
| 116 | * Timer | ||
| 117 | ****************************************************************************/ | ||
| 118 | |||
| 119 | static void lacie_v2_timer_init(void) | ||
| 120 | { | ||
| 121 | kirkwood_tclk = 166666667; | ||
| 122 | orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | ||
| 123 | } | ||
| 124 | |||
| 125 | struct sys_timer lacie_v2_timer = { | ||
| 126 | .init = lacie_v2_timer_init, | ||
| 127 | }; | ||
diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.h b/arch/arm/mach-kirkwood/lacie_v2-common.h index af521315b87b..fc64f578536e 100644 --- a/arch/arm/mach-kirkwood/lacie_v2-common.h +++ b/arch/arm/mach-kirkwood/lacie_v2-common.h | |||
| @@ -13,6 +13,4 @@ void lacie_v2_register_flash(void); | |||
| 13 | void lacie_v2_register_i2c_devices(void); | 13 | void lacie_v2_register_i2c_devices(void); |
| 14 | void lacie_v2_hdd_power_init(int hdd_num); | 14 | void lacie_v2_hdd_power_init(int hdd_num); |
| 15 | 15 | ||
| 16 | extern struct sys_timer lacie_v2_timer; | ||
| 17 | |||
| 18 | #endif | 16 | #endif |
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c index 065187d177c6..27901f702feb 100644 --- a/arch/arm/mach-kirkwood/mpp.c +++ b/arch/arm/mach-kirkwood/mpp.c | |||
| @@ -59,7 +59,7 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list) | |||
| 59 | } | 59 | } |
| 60 | printk("\n"); | 60 | printk("\n"); |
| 61 | 61 | ||
| 62 | while (*mpp_list) { | 62 | for ( ; *mpp_list; mpp_list++) { |
| 63 | unsigned int num = MPP_NUM(*mpp_list); | 63 | unsigned int num = MPP_NUM(*mpp_list); |
| 64 | unsigned int sel = MPP_SEL(*mpp_list); | 64 | unsigned int sel = MPP_SEL(*mpp_list); |
| 65 | int shift, gpio_mode; | 65 | int shift, gpio_mode; |
| @@ -88,8 +88,6 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list) | |||
| 88 | if (sel != 0) | 88 | if (sel != 0) |
| 89 | gpio_mode = 0; | 89 | gpio_mode = 0; |
| 90 | orion_gpio_set_valid(num, gpio_mode); | 90 | orion_gpio_set_valid(num, gpio_mode); |
| 91 | |||
| 92 | mpp_list++; | ||
| 93 | } | 91 | } |
| 94 | 92 | ||
| 95 | printk(KERN_DEBUG " final MPP regs:"); | 93 | printk(KERN_DEBUG " final MPP regs:"); |
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c index 5ea66f1f4178..65ee21fd2f3b 100644 --- a/arch/arm/mach-kirkwood/netspace_v2-setup.c +++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c | |||
| @@ -262,7 +262,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2") | |||
| 262 | .init_machine = netspace_v2_init, | 262 | .init_machine = netspace_v2_init, |
| 263 | .map_io = kirkwood_map_io, | 263 | .map_io = kirkwood_map_io, |
| 264 | .init_irq = kirkwood_init_irq, | 264 | .init_irq = kirkwood_init_irq, |
| 265 | .timer = &lacie_v2_timer, | 265 | .timer = &kirkwood_timer, |
| 266 | MACHINE_END | 266 | MACHINE_END |
| 267 | #endif | 267 | #endif |
| 268 | 268 | ||
| @@ -272,7 +272,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2") | |||
| 272 | .init_machine = netspace_v2_init, | 272 | .init_machine = netspace_v2_init, |
| 273 | .map_io = kirkwood_map_io, | 273 | .map_io = kirkwood_map_io, |
| 274 | .init_irq = kirkwood_init_irq, | 274 | .init_irq = kirkwood_init_irq, |
| 275 | .timer = &lacie_v2_timer, | 275 | .timer = &kirkwood_timer, |
| 276 | MACHINE_END | 276 | MACHINE_END |
| 277 | #endif | 277 | #endif |
| 278 | 278 | ||
| @@ -282,6 +282,6 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2") | |||
| 282 | .init_machine = netspace_v2_init, | 282 | .init_machine = netspace_v2_init, |
| 283 | .map_io = kirkwood_map_io, | 283 | .map_io = kirkwood_map_io, |
| 284 | .init_irq = kirkwood_init_irq, | 284 | .init_irq = kirkwood_init_irq, |
| 285 | .timer = &lacie_v2_timer, | 285 | .timer = &kirkwood_timer, |
| 286 | MACHINE_END | 286 | MACHINE_END |
| 287 | #endif | 287 | #endif |
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c index a1b45d501aef..93afd3c8bfd8 100644 --- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c +++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c | |||
| @@ -403,7 +403,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2") | |||
| 403 | .init_machine = netxbig_v2_init, | 403 | .init_machine = netxbig_v2_init, |
| 404 | .map_io = kirkwood_map_io, | 404 | .map_io = kirkwood_map_io, |
| 405 | .init_irq = kirkwood_init_irq, | 405 | .init_irq = kirkwood_init_irq, |
| 406 | .timer = &lacie_v2_timer, | 406 | .timer = &kirkwood_timer, |
| 407 | MACHINE_END | 407 | MACHINE_END |
| 408 | #endif | 408 | #endif |
| 409 | 409 | ||
| @@ -413,6 +413,6 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2") | |||
| 413 | .init_machine = netxbig_v2_init, | 413 | .init_machine = netxbig_v2_init, |
| 414 | .map_io = kirkwood_map_io, | 414 | .map_io = kirkwood_map_io, |
| 415 | .init_irq = kirkwood_init_irq, | 415 | .init_irq = kirkwood_init_irq, |
| 416 | .timer = &lacie_v2_timer, | 416 | .timer = &kirkwood_timer, |
| 417 | MACHINE_END | 417 | MACHINE_END |
| 418 | #endif | 418 | #endif |
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c index 8be09a0ce4ac..3587a281d993 100644 --- a/arch/arm/mach-kirkwood/ts41x-setup.c +++ b/arch/arm/mach-kirkwood/ts41x-setup.c | |||
| @@ -27,6 +27,10 @@ | |||
| 27 | #include "mpp.h" | 27 | #include "mpp.h" |
| 28 | #include "tsx1x-common.h" | 28 | #include "tsx1x-common.h" |
| 29 | 29 | ||
| 30 | /* for the PCIe reset workaround */ | ||
| 31 | #include <plat/pcie.h> | ||
| 32 | |||
| 33 | |||
| 30 | #define QNAP_TS41X_JUMPER_JP1 45 | 34 | #define QNAP_TS41X_JUMPER_JP1 45 |
| 31 | 35 | ||
| 32 | static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = { | 36 | static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = { |
| @@ -140,8 +144,16 @@ static void __init qnap_ts41x_init(void) | |||
| 140 | 144 | ||
| 141 | static int __init ts41x_pci_init(void) | 145 | static int __init ts41x_pci_init(void) |
| 142 | { | 146 | { |
| 143 | if (machine_is_ts41x()) | 147 | if (machine_is_ts41x()) { |
| 148 | /* | ||
| 149 | * Without this explicit reset, the PCIe SATA controller | ||
| 150 | * (Marvell 88sx7042/sata_mv) is known to stop working | ||
| 151 | * after a few minutes. | ||
| 152 | */ | ||
| 153 | orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE); | ||
| 154 | |||
| 144 | kirkwood_pcie_init(KW_PCIE0); | 155 | kirkwood_pcie_init(KW_PCIE0); |
| 156 | } | ||
| 145 | 157 | ||
| 146 | return 0; | 158 | return 0; |
| 147 | } | 159 | } |
diff --git a/arch/arm/mach-mmp/include/mach/cputype.h b/arch/arm/mach-mmp/include/mach/cputype.h index f43a68b213f1..8a3b56dfd35d 100644 --- a/arch/arm/mach-mmp/include/mach/cputype.h +++ b/arch/arm/mach-mmp/include/mach/cputype.h | |||
| @@ -46,7 +46,8 @@ static inline int cpu_is_pxa910(void) | |||
| 46 | #ifdef CONFIG_CPU_MMP2 | 46 | #ifdef CONFIG_CPU_MMP2 |
| 47 | static inline int cpu_is_mmp2(void) | 47 | static inline int cpu_is_mmp2(void) |
| 48 | { | 48 | { |
| 49 | return (((cpu_readid_id() >> 8) & 0xff) == 0x58); | 49 | return (((read_cpuid_id() >> 8) & 0xff) == 0x58); |
| 50 | } | ||
| 50 | #else | 51 | #else |
| 51 | #define cpu_is_mmp2() (0) | 52 | #define cpu_is_mmp2() (0) |
| 52 | #endif | 53 | #endif |
diff --git a/arch/arm/mach-msm/include/mach/smp.h b/arch/arm/mach-msm/include/mach/smp.h index 3ff7bf5e679e..a95f7b9efe31 100644 --- a/arch/arm/mach-msm/include/mach/smp.h +++ b/arch/arm/mach-msm/include/mach/smp.h | |||
| @@ -31,9 +31,9 @@ | |||
| 31 | 31 | ||
| 32 | #include <asm/hardware/gic.h> | 32 | #include <asm/hardware/gic.h> |
| 33 | 33 | ||
| 34 | static inline void smp_cross_call(const struct cpumask *mask) | 34 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
| 35 | { | 35 | { |
| 36 | gic_raise_softirq(mask, 1); | 36 | gic_raise_softirq(mask, ipi); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | #endif | 39 | #endif |
diff --git a/arch/arm/mach-msm/include/mach/vmalloc.h b/arch/arm/mach-msm/include/mach/vmalloc.h index 31a32ad062dc..d138448eff16 100644 --- a/arch/arm/mach-msm/include/mach/vmalloc.h +++ b/arch/arm/mach-msm/include/mach/vmalloc.h | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #ifndef __ASM_ARCH_MSM_VMALLOC_H | 16 | #ifndef __ASM_ARCH_MSM_VMALLOC_H |
| 17 | #define __ASM_ARCH_MSM_VMALLOC_H | 17 | #define __ASM_ARCH_MSM_VMALLOC_H |
| 18 | 18 | ||
| 19 | #define VMALLOC_END 0xd0000000 | 19 | #define VMALLOC_END 0xd0000000UL |
| 20 | 20 | ||
| 21 | #endif | 21 | #endif |
| 22 | 22 | ||
diff --git a/arch/arm/mach-mv78xx0/mpp.c b/arch/arm/mach-mv78xx0/mpp.c index 354ac514eb89..84db2dfc475c 100644 --- a/arch/arm/mach-mv78xx0/mpp.c +++ b/arch/arm/mach-mv78xx0/mpp.c | |||
| @@ -54,7 +54,7 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list) | |||
| 54 | } | 54 | } |
| 55 | printk("\n"); | 55 | printk("\n"); |
| 56 | 56 | ||
| 57 | while (*mpp_list) { | 57 | for ( ; *mpp_list; mpp_list++) { |
| 58 | unsigned int num = MPP_NUM(*mpp_list); | 58 | unsigned int num = MPP_NUM(*mpp_list); |
| 59 | unsigned int sel = MPP_SEL(*mpp_list); | 59 | unsigned int sel = MPP_SEL(*mpp_list); |
| 60 | int shift, gpio_mode; | 60 | int shift, gpio_mode; |
| @@ -83,8 +83,6 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list) | |||
| 83 | if (sel != 0) | 83 | if (sel != 0) |
| 84 | gpio_mode = 0; | 84 | gpio_mode = 0; |
| 85 | orion_gpio_set_valid(num, gpio_mode); | 85 | orion_gpio_set_valid(num, gpio_mode); |
| 86 | |||
| 87 | mpp_list++; | ||
| 88 | } | 86 | } |
| 89 | 87 | ||
| 90 | printk(KERN_DEBUG " final MPP regs:"); | 88 | printk(KERN_DEBUG " final MPP regs:"); |
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h index 93afa10b13cf..d94d282fa676 100644 --- a/arch/arm/mach-mx25/devices-imx25.h +++ b/arch/arm/mach-mx25/devices-imx25.h | |||
| @@ -42,9 +42,9 @@ extern const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst; | |||
| 42 | #define imx25_add_mxc_nand(pdata) \ | 42 | #define imx25_add_mxc_nand(pdata) \ |
| 43 | imx_add_mxc_nand(&imx25_mxc_nand_data, pdata) | 43 | imx_add_mxc_nand(&imx25_mxc_nand_data, pdata) |
| 44 | 44 | ||
| 45 | extern const struct imx_spi_imx_data imx25_spi_imx_data[] __initconst; | 45 | extern const struct imx_spi_imx_data imx25_cspi_data[] __initconst; |
| 46 | #define imx25_add_spi_imx(id, pdata) \ | 46 | #define imx25_add_spi_imx(id, pdata) \ |
| 47 | imx_add_spi_imx(&imx25_spi_imx_data[id], pdata) | 47 | imx_add_spi_imx(&imx25_cspi_data[id], pdata) |
| 48 | #define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) | 48 | #define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) |
| 49 | #define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) | 49 | #define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) |
| 50 | #define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) | 50 | #define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) |
diff --git a/arch/arm/mach-mx3/mach-pcm037_eet.c b/arch/arm/mach-mx3/mach-pcm037_eet.c index 99e0894e07db..fda56545d2fd 100644 --- a/arch/arm/mach-mx3/mach-pcm037_eet.c +++ b/arch/arm/mach-mx3/mach-pcm037_eet.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | #include <mach/common.h> | 15 | #include <mach/common.h> |
| 16 | #include <mach/iomux-mx3.h> | 16 | #include <mach/iomux-mx3.h> |
| 17 | #include <mach/spi.h> | ||
| 17 | 18 | ||
| 18 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
| 19 | 20 | ||
| @@ -59,14 +60,12 @@ static struct spi_board_info pcm037_spi_dev[] = { | |||
| 59 | }; | 60 | }; |
| 60 | 61 | ||
| 61 | /* Platform Data for MXC CSPI */ | 62 | /* Platform Data for MXC CSPI */ |
| 62 | #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) | ||
| 63 | static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)}; | 63 | static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)}; |
| 64 | 64 | ||
| 65 | static const struct spi_imx_master pcm037_spi1_pdata __initconst = { | 65 | static const struct spi_imx_master pcm037_spi1_pdata __initconst = { |
| 66 | .chipselect = pcm037_spi1_cs, | 66 | .chipselect = pcm037_spi1_cs, |
| 67 | .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs), | 67 | .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs), |
| 68 | }; | 68 | }; |
| 69 | #endif | ||
| 70 | 69 | ||
| 71 | /* GPIO-keys input device */ | 70 | /* GPIO-keys input device */ |
| 72 | static struct gpio_keys_button pcm037_gpio_keys[] = { | 71 | static struct gpio_keys_button pcm037_gpio_keys[] = { |
| @@ -171,7 +170,7 @@ static struct platform_device pcm037_gpio_keys_device = { | |||
| 171 | }, | 170 | }, |
| 172 | }; | 171 | }; |
| 173 | 172 | ||
| 174 | static int eet_init_devices(void) | 173 | static int __init eet_init_devices(void) |
| 175 | { | 174 | { |
| 176 | if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET) | 175 | if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET) |
| 177 | return 0; | 176 | return 0; |
diff --git a/arch/arm/mach-netx/include/mach/vmalloc.h b/arch/arm/mach-netx/include/mach/vmalloc.h index 7cca3574308f..871f1ef7bff5 100644 --- a/arch/arm/mach-netx/include/mach/vmalloc.h +++ b/arch/arm/mach-netx/include/mach/vmalloc.h | |||
| @@ -16,4 +16,4 @@ | |||
| 16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | */ | 18 | */ |
| 19 | #define VMALLOC_END 0xd0000000 | 19 | #define VMALLOC_END 0xd0000000UL |
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index ea0d80a89da7..e7f9ee63dce5 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c | |||
| @@ -321,10 +321,9 @@ static struct platform_device omap_wdt_device = { | |||
| 321 | static int __init omap_init_wdt(void) | 321 | static int __init omap_init_wdt(void) |
| 322 | { | 322 | { |
| 323 | if (!cpu_is_omap16xx()) | 323 | if (!cpu_is_omap16xx()) |
| 324 | return; | 324 | return -ENODEV; |
| 325 | 325 | ||
| 326 | platform_device_register(&omap_wdt_device); | 326 | return platform_device_register(&omap_wdt_device); |
| 327 | return 0; | ||
| 328 | } | 327 | } |
| 329 | subsys_initcall(omap_init_wdt); | 328 | subsys_initcall(omap_init_wdt); |
| 330 | #endif | 329 | #endif |
diff --git a/arch/arm/mach-omap1/include/mach/camera.h b/arch/arm/mach-omap1/include/mach/camera.h index fd54b452eb22..847d00f0bb0a 100644 --- a/arch/arm/mach-omap1/include/mach/camera.h +++ b/arch/arm/mach-omap1/include/mach/camera.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef __ASM_ARCH_CAMERA_H_ | 1 | #ifndef __ASM_ARCH_CAMERA_H_ |
| 2 | #define __ASM_ARCH_CAMERA_H_ | 2 | #define __ASM_ARCH_CAMERA_H_ |
| 3 | 3 | ||
| 4 | #include <media/omap1_camera.h> | ||
| 5 | |||
| 4 | void omap1_camera_init(void *); | 6 | void omap1_camera_init(void *); |
| 5 | 7 | ||
| 6 | static inline void omap1_set_camera_info(struct omap1_cam_platform_data *info) | 8 | static inline void omap1_set_camera_info(struct omap1_cam_platform_data *info) |
diff --git a/arch/arm/mach-omap1/include/mach/vmalloc.h b/arch/arm/mach-omap1/include/mach/vmalloc.h index b001f67d695b..22ec4a479577 100644 --- a/arch/arm/mach-omap1/include/mach/vmalloc.h +++ b/arch/arm/mach-omap1/include/mach/vmalloc.h | |||
| @@ -17,4 +17,4 @@ | |||
| 17 | * along with this program; if not, write to the Free Software | 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 | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ | 19 | */ |
| 20 | #define VMALLOC_END 0xd8000000 | 20 | #define VMALLOC_END 0xd8000000UL |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 067f4379c87f..53ac762518bd 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
| @@ -242,9 +242,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev, | |||
| 242 | mmc[0].gpio_cd = gpio + 0; | 242 | mmc[0].gpio_cd = gpio + 0; |
| 243 | omap2_hsmmc_init(mmc); | 243 | omap2_hsmmc_init(mmc); |
| 244 | 244 | ||
| 245 | /* link regulators to MMC adapters */ | ||
| 246 | devkit8000_vmmc1_supply.dev = mmc[0].dev; | ||
| 247 | |||
| 248 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | 245 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ |
| 249 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | 246 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
| 250 | 247 | ||
diff --git a/arch/arm/mach-omap2/include/mach/vmalloc.h b/arch/arm/mach-omap2/include/mach/vmalloc.h index 4da31e997efe..866319947760 100644 --- a/arch/arm/mach-omap2/include/mach/vmalloc.h +++ b/arch/arm/mach-omap2/include/mach/vmalloc.h | |||
| @@ -17,4 +17,4 @@ | |||
| 17 | * along with this program; if not, write to the Free Software | 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 | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ | 19 | */ |
| 20 | #define VMALLOC_END 0xf8000000 | 20 | #define VMALLOC_END 0xf8000000UL |
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c index 6cee456ca542..4976b9393e49 100644 --- a/arch/arm/mach-omap2/omap-hotplug.c +++ b/arch/arm/mach-omap2/omap-hotplug.c | |||
| @@ -17,16 +17,13 @@ | |||
| 17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
| 18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
| 19 | #include <linux/smp.h> | 19 | #include <linux/smp.h> |
| 20 | #include <linux/completion.h> | ||
| 21 | 20 | ||
| 22 | #include <asm/cacheflush.h> | 21 | #include <asm/cacheflush.h> |
| 23 | #include <mach/omap4-common.h> | 22 | #include <mach/omap4-common.h> |
| 24 | 23 | ||
| 25 | static DECLARE_COMPLETION(cpu_killed); | ||
| 26 | |||
| 27 | int platform_cpu_kill(unsigned int cpu) | 24 | int platform_cpu_kill(unsigned int cpu) |
| 28 | { | 25 | { |
| 29 | return wait_for_completion_timeout(&cpu_killed, 5000); | 26 | return 1; |
| 30 | } | 27 | } |
| 31 | 28 | ||
| 32 | /* | 29 | /* |
| @@ -35,15 +32,6 @@ int platform_cpu_kill(unsigned int cpu) | |||
| 35 | */ | 32 | */ |
| 36 | void platform_cpu_die(unsigned int cpu) | 33 | void platform_cpu_die(unsigned int cpu) |
| 37 | { | 34 | { |
| 38 | unsigned int this_cpu = hard_smp_processor_id(); | ||
| 39 | |||
| 40 | if (cpu != this_cpu) { | ||
| 41 | pr_crit("platform_cpu_die running on %u, should be %u\n", | ||
| 42 | this_cpu, cpu); | ||
| 43 | BUG(); | ||
| 44 | } | ||
| 45 | pr_notice("CPU%u: shutdown\n", cpu); | ||
| 46 | complete(&cpu_killed); | ||
| 47 | flush_cache_all(); | 35 | flush_cache_all(); |
| 48 | dsb(); | 36 | dsb(); |
| 49 | 37 | ||
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 9e9f70e18e3c..9fed631ba046 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
| 22 | 22 | ||
| 23 | #include <asm/cacheflush.h> | 23 | #include <asm/cacheflush.h> |
| 24 | #include <asm/localtimer.h> | ||
| 25 | #include <asm/smp_scu.h> | 24 | #include <asm/smp_scu.h> |
| 26 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
| 27 | #include <mach/omap4-common.h> | 26 | #include <mach/omap4-common.h> |
| @@ -29,22 +28,10 @@ | |||
| 29 | /* SCU base address */ | 28 | /* SCU base address */ |
| 30 | static void __iomem *scu_base; | 29 | static void __iomem *scu_base; |
| 31 | 30 | ||
| 32 | /* | ||
| 33 | * Use SCU config register to count number of cores | ||
| 34 | */ | ||
| 35 | static inline unsigned int get_core_count(void) | ||
| 36 | { | ||
| 37 | if (scu_base) | ||
| 38 | return scu_get_core_count(scu_base); | ||
| 39 | return 1; | ||
| 40 | } | ||
| 41 | |||
| 42 | static DEFINE_SPINLOCK(boot_lock); | 31 | static DEFINE_SPINLOCK(boot_lock); |
| 43 | 32 | ||
| 44 | void __cpuinit platform_secondary_init(unsigned int cpu) | 33 | void __cpuinit platform_secondary_init(unsigned int cpu) |
| 45 | { | 34 | { |
| 46 | trace_hardirqs_off(); | ||
| 47 | |||
| 48 | /* | 35 | /* |
| 49 | * If any interrupts are already enabled for the primary | 36 | * If any interrupts are already enabled for the primary |
| 50 | * core (e.g. timer irq), then they will not have been enabled | 37 | * core (e.g. timer irq), then they will not have been enabled |
| @@ -76,7 +63,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 76 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); | 63 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); |
| 77 | flush_cache_all(); | 64 | flush_cache_all(); |
| 78 | smp_wmb(); | 65 | smp_wmb(); |
| 79 | smp_cross_call(cpumask_of(cpu)); | 66 | smp_cross_call(cpumask_of(cpu), 1); |
| 80 | 67 | ||
| 81 | /* | 68 | /* |
| 82 | * Now the secondary core is starting up let it run its | 69 | * Now the secondary core is starting up let it run its |
| @@ -118,25 +105,9 @@ void __init smp_init_cpus(void) | |||
| 118 | scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); | 105 | scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); |
| 119 | BUG_ON(!scu_base); | 106 | BUG_ON(!scu_base); |
| 120 | 107 | ||
| 121 | ncores = get_core_count(); | 108 | ncores = scu_get_core_count(scu_base); |
| 122 | |||
| 123 | for (i = 0; i < ncores; i++) | ||
| 124 | set_cpu_possible(i, true); | ||
| 125 | } | ||
| 126 | |||
| 127 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
| 128 | { | ||
| 129 | unsigned int ncores = get_core_count(); | ||
| 130 | unsigned int cpu = smp_processor_id(); | ||
| 131 | int i; | ||
| 132 | 109 | ||
| 133 | /* sanity check */ | 110 | /* sanity check */ |
| 134 | if (ncores == 0) { | ||
| 135 | printk(KERN_ERR | ||
| 136 | "OMAP4: strange core count of 0? Default to 1\n"); | ||
| 137 | ncores = 1; | ||
| 138 | } | ||
| 139 | |||
| 140 | if (ncores > NR_CPUS) { | 111 | if (ncores > NR_CPUS) { |
| 141 | printk(KERN_WARNING | 112 | printk(KERN_WARNING |
| 142 | "OMAP4: no. of cores (%d) greater than configured " | 113 | "OMAP4: no. of cores (%d) greater than configured " |
| @@ -144,13 +115,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 144 | ncores, NR_CPUS); | 115 | ncores, NR_CPUS); |
| 145 | ncores = NR_CPUS; | 116 | ncores = NR_CPUS; |
| 146 | } | 117 | } |
| 147 | smp_store_cpu_info(cpu); | ||
| 148 | 118 | ||
| 149 | /* | 119 | for (i = 0; i < ncores; i++) |
| 150 | * are we trying to boot more cores than exist? | 120 | set_cpu_possible(i, true); |
| 151 | */ | 121 | } |
| 152 | if (max_cpus > ncores) | 122 | |
| 153 | max_cpus = ncores; | 123 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
| 124 | { | ||
| 125 | int i; | ||
| 154 | 126 | ||
| 155 | /* | 127 | /* |
| 156 | * Initialise the present map, which describes the set of CPUs | 128 | * Initialise the present map, which describes the set of CPUs |
| @@ -159,18 +131,10 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 159 | for (i = 0; i < max_cpus; i++) | 131 | for (i = 0; i < max_cpus; i++) |
| 160 | set_cpu_present(i, true); | 132 | set_cpu_present(i, true); |
| 161 | 133 | ||
| 162 | if (max_cpus > 1) { | 134 | /* |
| 163 | /* | 135 | * Initialise the SCU and wake up the secondary core using |
| 164 | * Enable the local timer or broadcast device for the | 136 | * wakeup_secondary(). |
| 165 | * boot CPU, but only if we have more than one CPU. | 137 | */ |
| 166 | */ | 138 | scu_enable(scu_base); |
| 167 | percpu_timer_setup(); | 139 | wakeup_secondary(); |
| 168 | |||
| 169 | /* | ||
| 170 | * Initialise the SCU and wake up the secondary core using | ||
| 171 | * wakeup_secondary(). | ||
| 172 | */ | ||
| 173 | scu_enable(scu_base); | ||
| 174 | wakeup_secondary(); | ||
| 175 | } | ||
| 176 | } | 140 | } |
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index a40457d81927..c85923e56b85 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/irq.h> | 30 | #include <linux/irq.h> |
| 31 | #include <linux/time.h> | 31 | #include <linux/time.h> |
| 32 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
| 33 | #include <linux/console.h> | ||
| 33 | 34 | ||
| 34 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
| 35 | #include <asm/mach/irq.h> | 36 | #include <asm/mach/irq.h> |
| @@ -118,6 +119,10 @@ static void omap2_enter_full_retention(void) | |||
| 118 | if (omap_irq_pending()) | 119 | if (omap_irq_pending()) |
| 119 | goto no_sleep; | 120 | goto no_sleep; |
| 120 | 121 | ||
| 122 | /* Block console output in case it is on one of the OMAP UARTs */ | ||
| 123 | if (try_acquire_console_sem()) | ||
| 124 | goto no_sleep; | ||
| 125 | |||
| 121 | omap_uart_prepare_idle(0); | 126 | omap_uart_prepare_idle(0); |
| 122 | omap_uart_prepare_idle(1); | 127 | omap_uart_prepare_idle(1); |
| 123 | omap_uart_prepare_idle(2); | 128 | omap_uart_prepare_idle(2); |
| @@ -131,6 +136,8 @@ static void omap2_enter_full_retention(void) | |||
| 131 | omap_uart_resume_idle(1); | 136 | omap_uart_resume_idle(1); |
| 132 | omap_uart_resume_idle(0); | 137 | omap_uart_resume_idle(0); |
| 133 | 138 | ||
| 139 | release_console_sem(); | ||
| 140 | |||
| 134 | no_sleep: | 141 | no_sleep: |
| 135 | if (omap2_pm_debug) { | 142 | if (omap2_pm_debug) { |
| 136 | unsigned long long tmp; | 143 | unsigned long long tmp; |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 75c0cd13ad8e..0ec8a04b7473 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
| 29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
| 30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
| 31 | #include <linux/console.h> | ||
| 31 | 32 | ||
| 32 | #include <plat/sram.h> | 33 | #include <plat/sram.h> |
| 33 | #include <plat/clockdomain.h> | 34 | #include <plat/clockdomain.h> |
| @@ -385,6 +386,12 @@ void omap_sram_idle(void) | |||
| 385 | omap3_enable_io_chain(); | 386 | omap3_enable_io_chain(); |
| 386 | } | 387 | } |
| 387 | 388 | ||
| 389 | /* Block console output in case it is on one of the OMAP UARTs */ | ||
| 390 | if (per_next_state < PWRDM_POWER_ON || | ||
| 391 | core_next_state < PWRDM_POWER_ON) | ||
| 392 | if (try_acquire_console_sem()) | ||
| 393 | goto console_still_active; | ||
| 394 | |||
| 388 | /* PER */ | 395 | /* PER */ |
| 389 | if (per_next_state < PWRDM_POWER_ON) { | 396 | if (per_next_state < PWRDM_POWER_ON) { |
| 390 | omap_uart_prepare_idle(2); | 397 | omap_uart_prepare_idle(2); |
| @@ -463,6 +470,9 @@ void omap_sram_idle(void) | |||
| 463 | omap_uart_resume_idle(3); | 470 | omap_uart_resume_idle(3); |
| 464 | } | 471 | } |
| 465 | 472 | ||
| 473 | release_console_sem(); | ||
| 474 | |||
| 475 | console_still_active: | ||
| 466 | /* Disable IO-PAD and IO-CHAIN wakeup */ | 476 | /* Disable IO-PAD and IO-CHAIN wakeup */ |
| 467 | if (omap3_has_io_wakeup() && | 477 | if (omap3_has_io_wakeup() && |
| 468 | (per_next_state < PWRDM_POWER_ON || | 478 | (per_next_state < PWRDM_POWER_ON || |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index becf0e38ef7e..d17960a1be25 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
| 28 | #include <linux/serial_8250.h> | 28 | #include <linux/serial_8250.h> |
| 29 | #include <linux/pm_runtime.h> | 29 | #include <linux/pm_runtime.h> |
| 30 | #include <linux/console.h> | ||
| 30 | 31 | ||
| 31 | #ifdef CONFIG_SERIAL_OMAP | 32 | #ifdef CONFIG_SERIAL_OMAP |
| 32 | #include <plat/omap-serial.h> | 33 | #include <plat/omap-serial.h> |
| @@ -406,7 +407,7 @@ void omap_uart_resume_idle(int num) | |||
| 406 | struct omap_uart_state *uart; | 407 | struct omap_uart_state *uart; |
| 407 | 408 | ||
| 408 | list_for_each_entry(uart, &uart_list, node) { | 409 | list_for_each_entry(uart, &uart_list, node) { |
| 409 | if (num == uart->num) { | 410 | if (num == uart->num && uart->can_sleep) { |
| 410 | omap_uart_enable_clocks(uart); | 411 | omap_uart_enable_clocks(uart); |
| 411 | 412 | ||
| 412 | /* Check for IO pad wakeup */ | 413 | /* Check for IO pad wakeup */ |
| @@ -807,6 +808,8 @@ void __init omap_serial_init_port(int port) | |||
| 807 | 808 | ||
| 808 | oh->dev_attr = uart; | 809 | oh->dev_attr = uart; |
| 809 | 810 | ||
| 811 | acquire_console_sem(); /* in case the earlycon is on the UART */ | ||
| 812 | |||
| 810 | /* | 813 | /* |
| 811 | * Because of early UART probing, UART did not get idled | 814 | * Because of early UART probing, UART did not get idled |
| 812 | * on init. Now that omap_device is ready, ensure full idle | 815 | * on init. Now that omap_device is ready, ensure full idle |
| @@ -831,6 +834,8 @@ void __init omap_serial_init_port(int port) | |||
| 831 | omap_uart_block_sleep(uart); | 834 | omap_uart_block_sleep(uart); |
| 832 | uart->timeout = DEFAULT_TIMEOUT; | 835 | uart->timeout = DEFAULT_TIMEOUT; |
| 833 | 836 | ||
| 837 | release_console_sem(); | ||
| 838 | |||
| 834 | if ((cpu_is_omap34xx() && uart->padconf) || | 839 | if ((cpu_is_omap34xx() && uart->padconf) || |
| 835 | (uart->wk_en && uart->wk_mask)) { | 840 | (uart->wk_en && uart->wk_mask)) { |
| 836 | device_init_wakeup(&od->pdev.dev, true); | 841 | device_init_wakeup(&od->pdev.dev, true); |
diff --git a/arch/arm/mach-orion5x/mpp.c b/arch/arm/mach-orion5x/mpp.c index bc4c3b9aaf83..db485d3b8144 100644 --- a/arch/arm/mach-orion5x/mpp.c +++ b/arch/arm/mach-orion5x/mpp.c | |||
| @@ -127,7 +127,7 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode) | |||
| 127 | /* Initialize gpiolib. */ | 127 | /* Initialize gpiolib. */ |
| 128 | orion_gpio_init(); | 128 | orion_gpio_init(); |
| 129 | 129 | ||
| 130 | while (mode->mpp >= 0) { | 130 | for ( ; mode->mpp >= 0; mode++) { |
| 131 | u32 *reg; | 131 | u32 *reg; |
| 132 | int num_type; | 132 | int num_type; |
| 133 | int shift; | 133 | int shift; |
| @@ -160,8 +160,6 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode) | |||
| 160 | orion_gpio_set_unused(mode->mpp); | 160 | orion_gpio_set_unused(mode->mpp); |
| 161 | 161 | ||
| 162 | orion_gpio_set_valid(mode->mpp, !!(mode->type == MPP_GPIO)); | 162 | orion_gpio_set_valid(mode->mpp, !!(mode->type == MPP_GPIO)); |
| 163 | |||
| 164 | mode++; | ||
| 165 | } | 163 | } |
| 166 | 164 | ||
| 167 | writel(mpp_0_7_ctrl, MPP_0_7_CTRL); | 165 | writel(mpp_0_7_ctrl, MPP_0_7_CTRL); |
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c index 16f1bd5324be..c1c1cd04bdde 100644 --- a/arch/arm/mach-orion5x/ts78xx-setup.c +++ b/arch/arm/mach-orion5x/ts78xx-setup.c | |||
| @@ -239,7 +239,7 @@ static struct platform_nand_data ts78xx_ts_nand_data = { | |||
| 239 | static struct resource ts78xx_ts_nand_resources = { | 239 | static struct resource ts78xx_ts_nand_resources = { |
| 240 | .start = TS_NAND_DATA, | 240 | .start = TS_NAND_DATA, |
| 241 | .end = TS_NAND_DATA + 4, | 241 | .end = TS_NAND_DATA + 4, |
| 242 | .flags = IORESOURCE_IO, | 242 | .flags = IORESOURCE_MEM, |
| 243 | }; | 243 | }; |
| 244 | 244 | ||
| 245 | static struct platform_device ts78xx_ts_nand_device = { | 245 | static struct platform_device ts78xx_ts_nand_device = { |
diff --git a/arch/arm/mach-pnx4008/include/mach/vmalloc.h b/arch/arm/mach-pnx4008/include/mach/vmalloc.h index 31b65ee07b0b..184913c71141 100644 --- a/arch/arm/mach-pnx4008/include/mach/vmalloc.h +++ b/arch/arm/mach-pnx4008/include/mach/vmalloc.h | |||
| @@ -17,4 +17,4 @@ | |||
| 17 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced | 17 | * The vmalloc() routines leaves a hole of 4kB between each vmalloced |
| 18 | * area for the same reason. ;) | 18 | * area for the same reason. ;) |
| 19 | */ | 19 | */ |
| 20 | #define VMALLOC_END 0xd0000000 | 20 | #define VMALLOC_END 0xd0000000UL |
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c index ac5598ce9724..d34b99febeb9 100644 --- a/arch/arm/mach-pxa/cm-x2xx.c +++ b/arch/arm/mach-pxa/cm-x2xx.c | |||
| @@ -476,8 +476,6 @@ static void __init cmx2xx_init(void) | |||
| 476 | 476 | ||
| 477 | static void __init cmx2xx_init_irq(void) | 477 | static void __init cmx2xx_init_irq(void) |
| 478 | { | 478 | { |
| 479 | pxa27x_init_irq(); | ||
| 480 | |||
| 481 | if (cpu_is_pxa25x()) { | 479 | if (cpu_is_pxa25x()) { |
| 482 | pxa25x_init_irq(); | 480 | pxa25x_init_irq(); |
| 483 | cmx2xx_pci_init_irq(CMX255_GPIO_IT8152_IRQ); | 481 | cmx2xx_pci_init_irq(CMX255_GPIO_IT8152_IRQ); |
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c index 4b521e045d75..ffa50e633ee6 100644 --- a/arch/arm/mach-pxa/saar.c +++ b/arch/arm/mach-pxa/saar.c | |||
| @@ -116,7 +116,7 @@ static struct platform_device smc91x_device = { | |||
| 116 | }, | 116 | }, |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | #if defined(CONFIG_FB_PXA) || (CONFIG_FB_PXA_MODULE) | 119 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
| 120 | static uint16_t lcd_power_on[] = { | 120 | static uint16_t lcd_power_on[] = { |
| 121 | /* single frame */ | 121 | /* single frame */ |
| 122 | SMART_CMD_NOOP, | 122 | SMART_CMD_NOOP, |
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c index f95521a5e5ce..a87523d095e6 100644 --- a/arch/arm/mach-realview/hotplug.c +++ b/arch/arm/mach-realview/hotplug.c | |||
| @@ -11,14 +11,11 @@ | |||
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
| 13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
| 14 | #include <linux/completion.h> | ||
| 15 | 14 | ||
| 16 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
| 17 | 16 | ||
| 18 | extern volatile int pen_release; | 17 | extern volatile int pen_release; |
| 19 | 18 | ||
| 20 | static DECLARE_COMPLETION(cpu_killed); | ||
| 21 | |||
| 22 | static inline void cpu_enter_lowpower(void) | 19 | static inline void cpu_enter_lowpower(void) |
| 23 | { | 20 | { |
| 24 | unsigned int v; | 21 | unsigned int v; |
| @@ -34,10 +31,10 @@ static inline void cpu_enter_lowpower(void) | |||
| 34 | " bic %0, %0, #0x20\n" | 31 | " bic %0, %0, #0x20\n" |
| 35 | " mcr p15, 0, %0, c1, c0, 1\n" | 32 | " mcr p15, 0, %0, c1, c0, 1\n" |
| 36 | " mrc p15, 0, %0, c1, c0, 0\n" | 33 | " mrc p15, 0, %0, c1, c0, 0\n" |
| 37 | " bic %0, %0, #0x04\n" | 34 | " bic %0, %0, %2\n" |
| 38 | " mcr p15, 0, %0, c1, c0, 0\n" | 35 | " mcr p15, 0, %0, c1, c0, 0\n" |
| 39 | : "=&r" (v) | 36 | : "=&r" (v) |
| 40 | : "r" (0) | 37 | : "r" (0), "Ir" (CR_C) |
| 41 | : "cc"); | 38 | : "cc"); |
| 42 | } | 39 | } |
| 43 | 40 | ||
| @@ -46,17 +43,17 @@ static inline void cpu_leave_lowpower(void) | |||
| 46 | unsigned int v; | 43 | unsigned int v; |
| 47 | 44 | ||
| 48 | asm volatile( "mrc p15, 0, %0, c1, c0, 0\n" | 45 | asm volatile( "mrc p15, 0, %0, c1, c0, 0\n" |
| 49 | " orr %0, %0, #0x04\n" | 46 | " orr %0, %0, %1\n" |
| 50 | " mcr p15, 0, %0, c1, c0, 0\n" | 47 | " mcr p15, 0, %0, c1, c0, 0\n" |
| 51 | " mrc p15, 0, %0, c1, c0, 1\n" | 48 | " mrc p15, 0, %0, c1, c0, 1\n" |
| 52 | " orr %0, %0, #0x20\n" | 49 | " orr %0, %0, #0x20\n" |
| 53 | " mcr p15, 0, %0, c1, c0, 1\n" | 50 | " mcr p15, 0, %0, c1, c0, 1\n" |
| 54 | : "=&r" (v) | 51 | : "=&r" (v) |
| 55 | : | 52 | : "Ir" (CR_C) |
| 56 | : "cc"); | 53 | : "cc"); |
| 57 | } | 54 | } |
| 58 | 55 | ||
| 59 | static inline void platform_do_lowpower(unsigned int cpu) | 56 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) |
| 60 | { | 57 | { |
| 61 | /* | 58 | /* |
| 62 | * there is no power-control hardware on this platform, so all | 59 | * there is no power-control hardware on this platform, so all |
| @@ -80,22 +77,19 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
| 80 | } | 77 | } |
| 81 | 78 | ||
| 82 | /* | 79 | /* |
| 83 | * getting here, means that we have come out of WFI without | 80 | * Getting here, means that we have come out of WFI without |
| 84 | * having been woken up - this shouldn't happen | 81 | * having been woken up - this shouldn't happen |
| 85 | * | 82 | * |
| 86 | * The trouble is, letting people know about this is not really | 83 | * Just note it happening - when we're woken, we can report |
| 87 | * possible, since we are currently running incoherently, and | 84 | * its occurrence. |
| 88 | * therefore cannot safely call printk() or anything else | ||
| 89 | */ | 85 | */ |
| 90 | #ifdef DEBUG | 86 | (*spurious)++; |
| 91 | printk("CPU%u: spurious wakeup call\n", cpu); | ||
| 92 | #endif | ||
| 93 | } | 87 | } |
| 94 | } | 88 | } |
| 95 | 89 | ||
| 96 | int platform_cpu_kill(unsigned int cpu) | 90 | int platform_cpu_kill(unsigned int cpu) |
| 97 | { | 91 | { |
| 98 | return wait_for_completion_timeout(&cpu_killed, 5000); | 92 | return 1; |
| 99 | } | 93 | } |
| 100 | 94 | ||
| 101 | /* | 95 | /* |
| @@ -105,30 +99,22 @@ int platform_cpu_kill(unsigned int cpu) | |||
| 105 | */ | 99 | */ |
| 106 | void platform_cpu_die(unsigned int cpu) | 100 | void platform_cpu_die(unsigned int cpu) |
| 107 | { | 101 | { |
| 108 | #ifdef DEBUG | 102 | int spurious = 0; |
| 109 | unsigned int this_cpu = hard_smp_processor_id(); | ||
| 110 | |||
| 111 | if (cpu != this_cpu) { | ||
| 112 | printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n", | ||
| 113 | this_cpu, cpu); | ||
| 114 | BUG(); | ||
| 115 | } | ||
| 116 | #endif | ||
| 117 | |||
| 118 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
| 119 | complete(&cpu_killed); | ||
| 120 | 103 | ||
| 121 | /* | 104 | /* |
| 122 | * we're ready for shutdown now, so do it | 105 | * we're ready for shutdown now, so do it |
| 123 | */ | 106 | */ |
| 124 | cpu_enter_lowpower(); | 107 | cpu_enter_lowpower(); |
| 125 | platform_do_lowpower(cpu); | 108 | platform_do_lowpower(cpu, &spurious); |
| 126 | 109 | ||
| 127 | /* | 110 | /* |
| 128 | * bring this CPU back into the world of cache | 111 | * bring this CPU back into the world of cache |
| 129 | * coherency, and then restore interrupts | 112 | * coherency, and then restore interrupts |
| 130 | */ | 113 | */ |
| 131 | cpu_leave_lowpower(); | 114 | cpu_leave_lowpower(); |
| 115 | |||
| 116 | if (spurious) | ||
| 117 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
| 132 | } | 118 | } |
| 133 | 119 | ||
| 134 | int platform_cpu_disable(unsigned int cpu) | 120 | int platform_cpu_disable(unsigned int cpu) |
diff --git a/arch/arm/mach-realview/include/mach/smp.h b/arch/arm/mach-realview/include/mach/smp.h index d3cd265cb058..c8221b38ee7c 100644 --- a/arch/arm/mach-realview/include/mach/smp.h +++ b/arch/arm/mach-realview/include/mach/smp.h | |||
| @@ -2,14 +2,13 @@ | |||
| 2 | #define ASMARM_ARCH_SMP_H | 2 | #define ASMARM_ARCH_SMP_H |
| 3 | 3 | ||
| 4 | #include <asm/hardware/gic.h> | 4 | #include <asm/hardware/gic.h> |
| 5 | #include <asm/smp_mpidr.h> | ||
| 6 | 5 | ||
| 7 | /* | 6 | /* |
| 8 | * We use IRQ1 as the IPI | 7 | * We use IRQ1 as the IPI |
| 9 | */ | 8 | */ |
| 10 | static inline void smp_cross_call(const struct cpumask *mask) | 9 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
| 11 | { | 10 | { |
| 12 | gic_raise_softirq(mask, 1); | 11 | gic_raise_softirq(mask, ipi); |
| 13 | } | 12 | } |
| 14 | 13 | ||
| 15 | #endif | 14 | #endif |
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c index 009265818d55..bb8d6c4e4315 100644 --- a/arch/arm/mach-realview/platsmp.c +++ b/arch/arm/mach-realview/platsmp.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
| 20 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
| 21 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
| 22 | #include <asm/localtimer.h> | ||
| 23 | #include <asm/unified.h> | 22 | #include <asm/unified.h> |
| 24 | 23 | ||
| 25 | #include <mach/board-eb.h> | 24 | #include <mach/board-eb.h> |
| @@ -37,6 +36,19 @@ extern void realview_secondary_startup(void); | |||
| 37 | */ | 36 | */ |
| 38 | volatile int __cpuinitdata pen_release = -1; | 37 | volatile int __cpuinitdata pen_release = -1; |
| 39 | 38 | ||
| 39 | /* | ||
| 40 | * Write pen_release in a way that is guaranteed to be visible to all | ||
| 41 | * observers, irrespective of whether they're taking part in coherency | ||
| 42 | * or not. This is necessary for the hotplug code to work reliably. | ||
| 43 | */ | ||
| 44 | static void write_pen_release(int val) | ||
| 45 | { | ||
| 46 | pen_release = val; | ||
| 47 | smp_wmb(); | ||
| 48 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
| 49 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
| 50 | } | ||
| 51 | |||
| 40 | static void __iomem *scu_base_addr(void) | 52 | static void __iomem *scu_base_addr(void) |
| 41 | { | 53 | { |
| 42 | if (machine_is_realview_eb_mp()) | 54 | if (machine_is_realview_eb_mp()) |
| @@ -50,20 +62,10 @@ static void __iomem *scu_base_addr(void) | |||
| 50 | return (void __iomem *)0; | 62 | return (void __iomem *)0; |
| 51 | } | 63 | } |
| 52 | 64 | ||
| 53 | static inline unsigned int get_core_count(void) | ||
| 54 | { | ||
| 55 | void __iomem *scu_base = scu_base_addr(); | ||
| 56 | if (scu_base) | ||
| 57 | return scu_get_core_count(scu_base); | ||
| 58 | return 1; | ||
| 59 | } | ||
| 60 | |||
| 61 | static DEFINE_SPINLOCK(boot_lock); | 65 | static DEFINE_SPINLOCK(boot_lock); |
| 62 | 66 | ||
| 63 | void __cpuinit platform_secondary_init(unsigned int cpu) | 67 | void __cpuinit platform_secondary_init(unsigned int cpu) |
| 64 | { | 68 | { |
| 65 | trace_hardirqs_off(); | ||
| 66 | |||
| 67 | /* | 69 | /* |
| 68 | * if any interrupts are already enabled for the primary | 70 | * if any interrupts are already enabled for the primary |
| 69 | * core (e.g. timer irq), then they will not have been enabled | 71 | * core (e.g. timer irq), then they will not have been enabled |
| @@ -75,8 +77,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
| 75 | * let the primary processor know we're out of the | 77 | * let the primary processor know we're out of the |
| 76 | * pen, then head off into the C entry point | 78 | * pen, then head off into the C entry point |
| 77 | */ | 79 | */ |
| 78 | pen_release = -1; | 80 | write_pen_release(-1); |
| 79 | smp_wmb(); | ||
| 80 | 81 | ||
| 81 | /* | 82 | /* |
| 82 | * Synchronise with the boot thread. | 83 | * Synchronise with the boot thread. |
| @@ -103,20 +104,14 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 103 | * Note that "pen_release" is the hardware CPU ID, whereas | 104 | * Note that "pen_release" is the hardware CPU ID, whereas |
| 104 | * "cpu" is Linux's internal ID. | 105 | * "cpu" is Linux's internal ID. |
| 105 | */ | 106 | */ |
| 106 | pen_release = cpu; | 107 | write_pen_release(cpu); |
| 107 | flush_cache_all(); | ||
| 108 | 108 | ||
| 109 | /* | 109 | /* |
| 110 | * XXX | 110 | * Send the secondary CPU a soft interrupt, thereby causing |
| 111 | * | 111 | * the boot monitor to read the system wide flags register, |
| 112 | * This is a later addition to the booting protocol: the | 112 | * and branch to the address found there. |
| 113 | * bootMonitor now puts secondary cores into WFI, so | ||
| 114 | * poke_milo() no longer gets the cores moving; we need | ||
| 115 | * to send a soft interrupt to wake the secondary core. | ||
| 116 | * Use smp_cross_call() for this, since there's little | ||
| 117 | * point duplicating the code here | ||
| 118 | */ | 113 | */ |
| 119 | smp_cross_call(cpumask_of(cpu)); | 114 | smp_cross_call(cpumask_of(cpu), 1); |
| 120 | 115 | ||
| 121 | timeout = jiffies + (1 * HZ); | 116 | timeout = jiffies + (1 * HZ); |
| 122 | while (time_before(jiffies, timeout)) { | 117 | while (time_before(jiffies, timeout)) { |
| @@ -136,48 +131,18 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 136 | return pen_release != -1 ? -ENOSYS : 0; | 131 | return pen_release != -1 ? -ENOSYS : 0; |
| 137 | } | 132 | } |
| 138 | 133 | ||
| 139 | static void __init poke_milo(void) | ||
| 140 | { | ||
| 141 | /* nobody is to be released from the pen yet */ | ||
| 142 | pen_release = -1; | ||
| 143 | |||
| 144 | /* | ||
| 145 | * Write the address of secondary startup into the system-wide flags | ||
| 146 | * register. The BootMonitor waits for this register to become | ||
| 147 | * non-zero. | ||
| 148 | */ | ||
| 149 | __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)), | ||
| 150 | __io_address(REALVIEW_SYS_FLAGSSET)); | ||
| 151 | |||
| 152 | mb(); | ||
| 153 | } | ||
| 154 | |||
| 155 | /* | 134 | /* |
| 156 | * Initialise the CPU possible map early - this describes the CPUs | 135 | * Initialise the CPU possible map early - this describes the CPUs |
| 157 | * which may be present or become present in the system. | 136 | * which may be present or become present in the system. |
| 158 | */ | 137 | */ |
| 159 | void __init smp_init_cpus(void) | 138 | void __init smp_init_cpus(void) |
| 160 | { | 139 | { |
| 161 | unsigned int i, ncores = get_core_count(); | 140 | void __iomem *scu_base = scu_base_addr(); |
| 141 | unsigned int i, ncores; | ||
| 162 | 142 | ||
| 163 | for (i = 0; i < ncores; i++) | 143 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; |
| 164 | set_cpu_possible(i, true); | ||
| 165 | } | ||
| 166 | |||
| 167 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
| 168 | { | ||
| 169 | unsigned int ncores = get_core_count(); | ||
| 170 | unsigned int cpu = smp_processor_id(); | ||
| 171 | int i; | ||
| 172 | 144 | ||
| 173 | /* sanity check */ | 145 | /* sanity check */ |
| 174 | if (ncores == 0) { | ||
| 175 | printk(KERN_ERR | ||
| 176 | "Realview: strange CM count of 0? Default to 1\n"); | ||
| 177 | |||
| 178 | ncores = 1; | ||
| 179 | } | ||
| 180 | |||
| 181 | if (ncores > NR_CPUS) { | 146 | if (ncores > NR_CPUS) { |
| 182 | printk(KERN_WARNING | 147 | printk(KERN_WARNING |
| 183 | "Realview: no. of cores (%d) greater than configured " | 148 | "Realview: no. of cores (%d) greater than configured " |
| @@ -186,13 +151,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 186 | ncores = NR_CPUS; | 151 | ncores = NR_CPUS; |
| 187 | } | 152 | } |
| 188 | 153 | ||
| 189 | smp_store_cpu_info(cpu); | 154 | for (i = 0; i < ncores; i++) |
| 155 | set_cpu_possible(i, true); | ||
| 156 | } | ||
| 190 | 157 | ||
| 191 | /* | 158 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
| 192 | * are we trying to boot more cores than exist? | 159 | { |
| 193 | */ | 160 | int i; |
| 194 | if (max_cpus > ncores) | ||
| 195 | max_cpus = ncores; | ||
| 196 | 161 | ||
| 197 | /* | 162 | /* |
| 198 | * Initialise the present map, which describes the set of CPUs | 163 | * Initialise the present map, which describes the set of CPUs |
| @@ -201,21 +166,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 201 | for (i = 0; i < max_cpus; i++) | 166 | for (i = 0; i < max_cpus; i++) |
| 202 | set_cpu_present(i, true); | 167 | set_cpu_present(i, true); |
| 203 | 168 | ||
| 169 | scu_enable(scu_base_addr()); | ||
| 170 | |||
| 204 | /* | 171 | /* |
| 205 | * Initialise the SCU if there are more than one CPU and let | 172 | * Write the address of secondary startup into the |
| 206 | * them know where to start. Note that, on modern versions of | 173 | * system-wide flags register. The BootMonitor waits |
| 207 | * MILO, the "poke" doesn't actually do anything until each | 174 | * until it receives a soft interrupt, and then the |
| 208 | * individual core is sent a soft interrupt to get it out of | 175 | * secondary CPU branches to this address. |
| 209 | * WFI | ||
| 210 | */ | 176 | */ |
| 211 | if (max_cpus > 1) { | 177 | __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)), |
| 212 | /* | 178 | __io_address(REALVIEW_SYS_FLAGSSET)); |
| 213 | * Enable the local timer or broadcast device for the | ||
| 214 | * boot CPU, but only if we have more than one CPU. | ||
| 215 | */ | ||
| 216 | percpu_timer_setup(); | ||
| 217 | |||
| 218 | scu_enable(scu_base_addr()); | ||
| 219 | poke_milo(); | ||
| 220 | } | ||
| 221 | } | 179 | } |
diff --git a/arch/arm/mach-rpc/include/mach/vmalloc.h b/arch/arm/mach-rpc/include/mach/vmalloc.h index 3bcd86fadb81..fb700228637a 100644 --- a/arch/arm/mach-rpc/include/mach/vmalloc.h +++ b/arch/arm/mach-rpc/include/mach/vmalloc.h | |||
| @@ -7,4 +7,4 @@ | |||
| 7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | #define VMALLOC_END 0xdc000000 | 10 | #define VMALLOC_END 0xdc000000UL |
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c index 8aa2f1902a94..6b86a722a7db 100644 --- a/arch/arm/mach-s3c2410/h1940-bluetooth.c +++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c | |||
| @@ -77,13 +77,13 @@ static int __devinit h1940bt_probe(struct platform_device *pdev) | |||
| 77 | 77 | ||
| 78 | /* Configures BT serial port GPIOs */ | 78 | /* Configures BT serial port GPIOs */ |
| 79 | s3c_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); | 79 | s3c_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); |
| 80 | s3c_gpio_cfgpull(S3C2410_GPH(0), S3C_GPIO_PULL_NONE); | 80 | s3c_gpio_setpull(S3C2410_GPH(0), S3C_GPIO_PULL_NONE); |
| 81 | s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); | 81 | s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); |
| 82 | s3c_gpio_cfgpull(S3C2410_GPH(1), S3C_GPIO_PULL_NONE); | 82 | s3c_gpio_setpull(S3C2410_GPH(1), S3C_GPIO_PULL_NONE); |
| 83 | s3c_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); | 83 | s3c_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); |
| 84 | s3c_gpio_cfgpull(S3C2410_GPH(2), S3C_GPIO_PULL_NONE); | 84 | s3c_gpio_setpull(S3C2410_GPH(2), S3C_GPIO_PULL_NONE); |
| 85 | s3c_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); | 85 | s3c_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); |
| 86 | s3c_gpio_cfgpull(S3C2410_GPH(3), S3C_GPIO_PULL_NONE); | 86 | s3c_gpio_setpull(S3C2410_GPH(3), S3C_GPIO_PULL_NONE); |
| 87 | 87 | ||
| 88 | 88 | ||
| 89 | rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, | 89 | rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, |
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c index 084d121f368c..00174daf1526 100644 --- a/arch/arm/mach-s3c2416/irq.c +++ b/arch/arm/mach-s3c2416/irq.c | |||
| @@ -168,12 +168,11 @@ static struct irq_chip s3c2416_irq_dma = { | |||
| 168 | 168 | ||
| 169 | static void s3c2416_irq_demux_uart3(unsigned int irq, struct irq_desc *desc) | 169 | static void s3c2416_irq_demux_uart3(unsigned int irq, struct irq_desc *desc) |
| 170 | { | 170 | { |
| 171 | s3c2416_irq_demux(IRQ_S3C2443_UART3, 3); | 171 | s3c2416_irq_demux(IRQ_S3C2443_RX3, 3); |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) | 174 | #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) |
| 175 | #define SUBMSK_UART3 (0xf << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) | 175 | #define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) |
| 176 | |||
| 177 | 176 | ||
| 178 | static void s3c2416_irq_uart3_mask(unsigned int irqno) | 177 | static void s3c2416_irq_uart3_mask(unsigned int irqno) |
| 179 | { | 178 | { |
diff --git a/arch/arm/mach-s3c2443/irq.c b/arch/arm/mach-s3c2443/irq.c index 0e0d693f3974..893424767ce1 100644 --- a/arch/arm/mach-s3c2443/irq.c +++ b/arch/arm/mach-s3c2443/irq.c | |||
| @@ -166,12 +166,11 @@ static struct irq_chip s3c2443_irq_dma = { | |||
| 166 | 166 | ||
| 167 | static void s3c2443_irq_demux_uart3(unsigned int irq, struct irq_desc *desc) | 167 | static void s3c2443_irq_demux_uart3(unsigned int irq, struct irq_desc *desc) |
| 168 | { | 168 | { |
| 169 | s3c2443_irq_demux(IRQ_S3C2443_UART3, 3); | 169 | s3c2443_irq_demux(IRQ_S3C2443_RX3, 3); |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) | 172 | #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) |
| 173 | #define SUBMSK_UART3 (0xf << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) | 173 | #define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) |
| 174 | |||
| 175 | 174 | ||
| 176 | static void s3c2443_irq_uart3_mask(unsigned int irqno) | 175 | static void s3c2443_irq_uart3_mask(unsigned int irqno) |
| 177 | { | 176 | { |
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 1ca7bdc6485c..579d2f0f4dd0 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig | |||
| @@ -143,7 +143,7 @@ config MACH_SMDK6410 | |||
| 143 | select S3C_DEV_USB_HSOTG | 143 | select S3C_DEV_USB_HSOTG |
| 144 | select S3C_DEV_WDT | 144 | select S3C_DEV_WDT |
| 145 | select SAMSUNG_DEV_KEYPAD | 145 | select SAMSUNG_DEV_KEYPAD |
| 146 | select HAVE_S3C2410_WATCHDOG | 146 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 147 | select S3C64XX_SETUP_SDHCI | 147 | select S3C64XX_SETUP_SDHCI |
| 148 | select S3C64XX_SETUP_I2C1 | 148 | select S3C64XX_SETUP_I2C1 |
| 149 | select S3C64XX_SETUP_IDE | 149 | select S3C64XX_SETUP_IDE |
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c index 249c62956471..89f35e02e883 100644 --- a/arch/arm/mach-s3c64xx/mach-mini6410.c +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c | |||
| @@ -45,7 +45,7 @@ | |||
| 45 | 45 | ||
| 46 | #include <video/platform_lcd.h> | 46 | #include <video/platform_lcd.h> |
| 47 | 47 | ||
| 48 | #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) | 48 | #define UCON S3C2410_UCON_DEFAULT |
| 49 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) | 49 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) |
| 50 | #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) | 50 | #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) |
| 51 | 51 | ||
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c index f9ef9b5c5f5a..4957ab0a0d4a 100644 --- a/arch/arm/mach-s3c64xx/mach-real6410.c +++ b/arch/arm/mach-s3c64xx/mach-real6410.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | 46 | ||
| 47 | #include <video/platform_lcd.h> | 47 | #include <video/platform_lcd.h> |
| 48 | 48 | ||
| 49 | #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) | 49 | #define UCON S3C2410_UCON_DEFAULT |
| 50 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) | 50 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) |
| 51 | #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) | 51 | #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) |
| 52 | 52 | ||
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c index 0ad7924fe62e..5dd1681c069e 100644 --- a/arch/arm/mach-s5pv210/mach-smdkc110.c +++ b/arch/arm/mach-s5pv210/mach-smdkc110.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
| 14 | #include <linux/serial_core.h> | 14 | #include <linux/serial_core.h> |
| 15 | #include <linux/i2c.h> | 15 | #include <linux/i2c.h> |
| 16 | #include <linux/sysdev.h> | ||
| 16 | 17 | ||
| 17 | #include <asm/mach/arch.h> | 18 | #include <asm/mach/arch.h> |
| 18 | #include <asm/mach/map.h> | 19 | #include <asm/mach/map.h> |
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c index bcd7a5d53401..1fbc45b2a432 100644 --- a/arch/arm/mach-s5pv210/mach-smdkv210.c +++ b/arch/arm/mach-s5pv210/mach-smdkv210.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/i2c.h> | 13 | #include <linux/i2c.h> |
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/serial_core.h> | 15 | #include <linux/serial_core.h> |
| 16 | #include <linux/sysdev.h> | ||
| 16 | 17 | ||
| 17 | #include <asm/mach/arch.h> | 18 | #include <asm/mach/arch.h> |
| 18 | #include <asm/mach/map.h> | 19 | #include <asm/mach/map.h> |
diff --git a/arch/arm/mach-s5pv310/hotplug.c b/arch/arm/mach-s5pv310/hotplug.c index 03652c3605f6..afa5392d9fc0 100644 --- a/arch/arm/mach-s5pv310/hotplug.c +++ b/arch/arm/mach-s5pv310/hotplug.c | |||
| @@ -13,14 +13,11 @@ | |||
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
| 15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
| 16 | #include <linux/completion.h> | ||
| 17 | 16 | ||
| 18 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
| 19 | 18 | ||
| 20 | extern volatile int pen_release; | 19 | extern volatile int pen_release; |
| 21 | 20 | ||
| 22 | static DECLARE_COMPLETION(cpu_killed); | ||
| 23 | |||
| 24 | static inline void cpu_enter_lowpower(void) | 21 | static inline void cpu_enter_lowpower(void) |
| 25 | { | 22 | { |
| 26 | unsigned int v; | 23 | unsigned int v; |
| @@ -33,13 +30,13 @@ static inline void cpu_enter_lowpower(void) | |||
| 33 | * Turn off coherency | 30 | * Turn off coherency |
| 34 | */ | 31 | */ |
| 35 | " mrc p15, 0, %0, c1, c0, 1\n" | 32 | " mrc p15, 0, %0, c1, c0, 1\n" |
| 36 | " bic %0, %0, #0x20\n" | 33 | " bic %0, %0, %2\n" |
| 37 | " mcr p15, 0, %0, c1, c0, 1\n" | 34 | " mcr p15, 0, %0, c1, c0, 1\n" |
| 38 | " mrc p15, 0, %0, c1, c0, 0\n" | 35 | " mrc p15, 0, %0, c1, c0, 0\n" |
| 39 | " bic %0, %0, #0x04\n" | 36 | " bic %0, %0, #0x04\n" |
| 40 | " mcr p15, 0, %0, c1, c0, 0\n" | 37 | " mcr p15, 0, %0, c1, c0, 0\n" |
| 41 | : "=&r" (v) | 38 | : "=&r" (v) |
| 42 | : "r" (0) | 39 | : "r" (0), "Ir" (CR_C) |
| 43 | : "cc"); | 40 | : "cc"); |
| 44 | } | 41 | } |
| 45 | 42 | ||
| @@ -49,17 +46,17 @@ static inline void cpu_leave_lowpower(void) | |||
| 49 | 46 | ||
| 50 | asm volatile( | 47 | asm volatile( |
| 51 | "mrc p15, 0, %0, c1, c0, 0\n" | 48 | "mrc p15, 0, %0, c1, c0, 0\n" |
| 52 | " orr %0, %0, #0x04\n" | 49 | " orr %0, %0, %1\n" |
| 53 | " mcr p15, 0, %0, c1, c0, 0\n" | 50 | " mcr p15, 0, %0, c1, c0, 0\n" |
| 54 | " mrc p15, 0, %0, c1, c0, 1\n" | 51 | " mrc p15, 0, %0, c1, c0, 1\n" |
| 55 | " orr %0, %0, #0x20\n" | 52 | " orr %0, %0, #0x20\n" |
| 56 | " mcr p15, 0, %0, c1, c0, 1\n" | 53 | " mcr p15, 0, %0, c1, c0, 1\n" |
| 57 | : "=&r" (v) | 54 | : "=&r" (v) |
| 58 | : | 55 | : "Ir" (CR_C) |
| 59 | : "cc"); | 56 | : "cc"); |
| 60 | } | 57 | } |
| 61 | 58 | ||
| 62 | static inline void platform_do_lowpower(unsigned int cpu) | 59 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) |
| 63 | { | 60 | { |
| 64 | /* | 61 | /* |
| 65 | * there is no power-control hardware on this platform, so all | 62 | * there is no power-control hardware on this platform, so all |
| @@ -83,22 +80,19 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
| 83 | } | 80 | } |
| 84 | 81 | ||
| 85 | /* | 82 | /* |
| 86 | * getting here, means that we have come out of WFI without | 83 | * Getting here, means that we have come out of WFI without |
| 87 | * having been woken up - this shouldn't happen | 84 | * having been woken up - this shouldn't happen |
| 88 | * | 85 | * |
| 89 | * The trouble is, letting people know about this is not really | 86 | * Just note it happening - when we're woken, we can report |
| 90 | * possible, since we are currently running incoherently, and | 87 | * its occurrence. |
| 91 | * therefore cannot safely call printk() or anything else | ||
| 92 | */ | 88 | */ |
| 93 | #ifdef DEBUG | 89 | (*spurious)++; |
| 94 | printk(KERN_WARN "CPU%u: spurious wakeup call\n", cpu); | ||
| 95 | #endif | ||
| 96 | } | 90 | } |
| 97 | } | 91 | } |
| 98 | 92 | ||
| 99 | int platform_cpu_kill(unsigned int cpu) | 93 | int platform_cpu_kill(unsigned int cpu) |
| 100 | { | 94 | { |
| 101 | return wait_for_completion_timeout(&cpu_killed, 5000); | 95 | return 1; |
| 102 | } | 96 | } |
| 103 | 97 | ||
| 104 | /* | 98 | /* |
| @@ -108,30 +102,22 @@ int platform_cpu_kill(unsigned int cpu) | |||
| 108 | */ | 102 | */ |
| 109 | void platform_cpu_die(unsigned int cpu) | 103 | void platform_cpu_die(unsigned int cpu) |
| 110 | { | 104 | { |
| 111 | #ifdef DEBUG | 105 | int spurious = 0; |
| 112 | unsigned int this_cpu = hard_smp_processor_id(); | ||
| 113 | |||
| 114 | if (cpu != this_cpu) { | ||
| 115 | printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n", | ||
| 116 | this_cpu, cpu); | ||
| 117 | BUG(); | ||
| 118 | } | ||
| 119 | #endif | ||
| 120 | |||
| 121 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
| 122 | complete(&cpu_killed); | ||
| 123 | 106 | ||
| 124 | /* | 107 | /* |
| 125 | * we're ready for shutdown now, so do it | 108 | * we're ready for shutdown now, so do it |
| 126 | */ | 109 | */ |
| 127 | cpu_enter_lowpower(); | 110 | cpu_enter_lowpower(); |
| 128 | platform_do_lowpower(cpu); | 111 | platform_do_lowpower(cpu, &spurious); |
| 129 | 112 | ||
| 130 | /* | 113 | /* |
| 131 | * bring this CPU back into the world of cache | 114 | * bring this CPU back into the world of cache |
| 132 | * coherency, and then restore interrupts | 115 | * coherency, and then restore interrupts |
| 133 | */ | 116 | */ |
| 134 | cpu_leave_lowpower(); | 117 | cpu_leave_lowpower(); |
| 118 | |||
| 119 | if (spurious) | ||
| 120 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
| 135 | } | 121 | } |
| 136 | 122 | ||
| 137 | int platform_cpu_disable(unsigned int cpu) | 123 | int platform_cpu_disable(unsigned int cpu) |
diff --git a/arch/arm/mach-s5pv310/include/mach/smp.h b/arch/arm/mach-s5pv310/include/mach/smp.h index b7ec252384f4..77e5a841f741 100644 --- a/arch/arm/mach-s5pv310/include/mach/smp.h +++ b/arch/arm/mach-s5pv310/include/mach/smp.h | |||
| @@ -7,16 +7,15 @@ | |||
| 7 | #define ASM_ARCH_SMP_H __FILE__ | 7 | #define ASM_ARCH_SMP_H __FILE__ |
| 8 | 8 | ||
| 9 | #include <asm/hardware/gic.h> | 9 | #include <asm/hardware/gic.h> |
| 10 | #include <asm/smp_mpidr.h> | ||
| 11 | 10 | ||
| 12 | extern void __iomem *gic_cpu_base_addr; | 11 | extern void __iomem *gic_cpu_base_addr; |
| 13 | 12 | ||
| 14 | /* | 13 | /* |
| 15 | * We use IRQ1 as the IPI | 14 | * We use IRQ1 as the IPI |
| 16 | */ | 15 | */ |
| 17 | static inline void smp_cross_call(const struct cpumask *mask) | 16 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
| 18 | { | 17 | { |
| 19 | gic_raise_softirq(mask, 1); | 18 | gic_raise_softirq(mask, ipi); |
| 20 | } | 19 | } |
| 21 | 20 | ||
| 22 | #endif | 21 | #endif |
diff --git a/arch/arm/mach-s5pv310/platsmp.c b/arch/arm/mach-s5pv310/platsmp.c index d357c198edee..98c04748ed84 100644 --- a/arch/arm/mach-s5pv310/platsmp.c +++ b/arch/arm/mach-s5pv310/platsmp.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
| 23 | 23 | ||
| 24 | #include <asm/cacheflush.h> | 24 | #include <asm/cacheflush.h> |
| 25 | #include <asm/localtimer.h> | ||
| 26 | #include <asm/smp_scu.h> | 25 | #include <asm/smp_scu.h> |
| 27 | #include <asm/unified.h> | 26 | #include <asm/unified.h> |
| 28 | 27 | ||
| @@ -38,6 +37,19 @@ extern void s5pv310_secondary_startup(void); | |||
| 38 | 37 | ||
| 39 | volatile int __cpuinitdata pen_release = -1; | 38 | volatile int __cpuinitdata pen_release = -1; |
| 40 | 39 | ||
| 40 | /* | ||
| 41 | * Write pen_release in a way that is guaranteed to be visible to all | ||
| 42 | * observers, irrespective of whether they're taking part in coherency | ||
| 43 | * or not. This is necessary for the hotplug code to work reliably. | ||
| 44 | */ | ||
| 45 | static void write_pen_release(int val) | ||
| 46 | { | ||
| 47 | pen_release = val; | ||
| 48 | smp_wmb(); | ||
| 49 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
| 50 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
| 51 | } | ||
| 52 | |||
| 41 | static void __iomem *scu_base_addr(void) | 53 | static void __iomem *scu_base_addr(void) |
| 42 | { | 54 | { |
| 43 | return (void __iomem *)(S5P_VA_SCU); | 55 | return (void __iomem *)(S5P_VA_SCU); |
| @@ -47,8 +59,6 @@ static DEFINE_SPINLOCK(boot_lock); | |||
| 47 | 59 | ||
| 48 | void __cpuinit platform_secondary_init(unsigned int cpu) | 60 | void __cpuinit platform_secondary_init(unsigned int cpu) |
| 49 | { | 61 | { |
| 50 | trace_hardirqs_off(); | ||
| 51 | |||
| 52 | /* | 62 | /* |
| 53 | * if any interrupts are already enabled for the primary | 63 | * if any interrupts are already enabled for the primary |
| 54 | * core (e.g. timer irq), then they will not have been enabled | 64 | * core (e.g. timer irq), then they will not have been enabled |
| @@ -60,8 +70,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
| 60 | * let the primary processor know we're out of the | 70 | * let the primary processor know we're out of the |
| 61 | * pen, then head off into the C entry point | 71 | * pen, then head off into the C entry point |
| 62 | */ | 72 | */ |
| 63 | pen_release = -1; | 73 | write_pen_release(-1); |
| 64 | smp_wmb(); | ||
| 65 | 74 | ||
| 66 | /* | 75 | /* |
| 67 | * Synchronise with the boot thread. | 76 | * Synchronise with the boot thread. |
| @@ -88,16 +97,14 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 88 | * Note that "pen_release" is the hardware CPU ID, whereas | 97 | * Note that "pen_release" is the hardware CPU ID, whereas |
| 89 | * "cpu" is Linux's internal ID. | 98 | * "cpu" is Linux's internal ID. |
| 90 | */ | 99 | */ |
| 91 | pen_release = cpu; | 100 | write_pen_release(cpu); |
| 92 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
| 93 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
| 94 | 101 | ||
| 95 | /* | 102 | /* |
| 96 | * Send the secondary CPU a soft interrupt, thereby causing | 103 | * Send the secondary CPU a soft interrupt, thereby causing |
| 97 | * the boot monitor to read the system wide flags register, | 104 | * the boot monitor to read the system wide flags register, |
| 98 | * and branch to the address found there. | 105 | * and branch to the address found there. |
| 99 | */ | 106 | */ |
| 100 | smp_cross_call(cpumask_of(cpu)); | 107 | smp_cross_call(cpumask_of(cpu), 1); |
| 101 | 108 | ||
| 102 | timeout = jiffies + (1 * HZ); | 109 | timeout = jiffies + (1 * HZ); |
| 103 | while (time_before(jiffies, timeout)) { | 110 | while (time_before(jiffies, timeout)) { |
| @@ -130,13 +137,6 @@ void __init smp_init_cpus(void) | |||
| 130 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; | 137 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; |
| 131 | 138 | ||
| 132 | /* sanity check */ | 139 | /* sanity check */ |
| 133 | if (ncores == 0) { | ||
| 134 | printk(KERN_ERR | ||
| 135 | "S5PV310: strange CM count of 0? Default to 1\n"); | ||
| 136 | |||
| 137 | ncores = 1; | ||
| 138 | } | ||
| 139 | |||
| 140 | if (ncores > NR_CPUS) { | 140 | if (ncores > NR_CPUS) { |
| 141 | printk(KERN_WARNING | 141 | printk(KERN_WARNING |
| 142 | "S5PV310: no. of cores (%d) greater than configured " | 142 | "S5PV310: no. of cores (%d) greater than configured " |
| @@ -149,18 +149,10 @@ void __init smp_init_cpus(void) | |||
| 149 | set_cpu_possible(i, true); | 149 | set_cpu_possible(i, true); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | void __init smp_prepare_cpus(unsigned int max_cpus) | 152 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
| 153 | { | 153 | { |
| 154 | unsigned int ncores = num_possible_cpus(); | ||
| 155 | unsigned int cpu = smp_processor_id(); | ||
| 156 | int i; | 154 | int i; |
| 157 | 155 | ||
| 158 | smp_store_cpu_info(cpu); | ||
| 159 | |||
| 160 | /* are we trying to boot more cores than exist? */ | ||
| 161 | if (max_cpus > ncores) | ||
| 162 | max_cpus = ncores; | ||
| 163 | |||
| 164 | /* | 156 | /* |
| 165 | * Initialise the present map, which describes the set of CPUs | 157 | * Initialise the present map, which describes the set of CPUs |
| 166 | * actually populated at the present time. | 158 | * actually populated at the present time. |
| @@ -168,25 +160,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 168 | for (i = 0; i < max_cpus; i++) | 160 | for (i = 0; i < max_cpus; i++) |
| 169 | set_cpu_present(i, true); | 161 | set_cpu_present(i, true); |
| 170 | 162 | ||
| 163 | scu_enable(scu_base_addr()); | ||
| 164 | |||
| 171 | /* | 165 | /* |
| 172 | * Initialise the SCU if there are more than one CPU and let | 166 | * Write the address of secondary startup into the |
| 173 | * them know where to start. | 167 | * system-wide flags register. The boot monitor waits |
| 168 | * until it receives a soft interrupt, and then the | ||
| 169 | * secondary CPU branches to this address. | ||
| 174 | */ | 170 | */ |
| 175 | if (max_cpus > 1) { | ||
| 176 | /* | ||
| 177 | * Enable the local timer or broadcast device for the | ||
| 178 | * boot CPU, but only if we have more than one CPU. | ||
| 179 | */ | ||
| 180 | percpu_timer_setup(); | ||
| 181 | |||
| 182 | scu_enable(scu_base_addr()); | ||
| 183 | |||
| 184 | /* | ||
| 185 | * Write the address of secondary startup into the | ||
| 186 | * system-wide flags register. The boot monitor waits | ||
| 187 | * until it receives a soft interrupt, and then the | ||
| 188 | * secondary CPU branches to this address. | ||
| 189 | */ | ||
| 190 | __raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)), S5P_VA_SYSRAM); | 171 | __raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)), S5P_VA_SYSRAM); |
| 191 | } | ||
| 192 | } | 172 | } |
diff --git a/arch/arm/mach-shark/include/mach/vmalloc.h b/arch/arm/mach-shark/include/mach/vmalloc.h index 8e845b6a7cb5..b10df988526d 100644 --- a/arch/arm/mach-shark/include/mach/vmalloc.h +++ b/arch/arm/mach-shark/include/mach/vmalloc.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/mach-shark/include/mach/vmalloc.h | 2 | * arch/arm/mach-shark/include/mach/vmalloc.h |
| 3 | */ | 3 | */ |
| 4 | #define VMALLOC_END 0xd0000000 | 4 | #define VMALLOC_END 0xd0000000UL |
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index f8f06e9fec35..632933357242 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
| @@ -116,4 +116,6 @@ endmenu | |||
| 116 | config SH_CLK_CPG | 116 | config SH_CLK_CPG |
| 117 | bool | 117 | bool |
| 118 | 118 | ||
| 119 | source "drivers/sh/Kconfig" | ||
| 120 | |||
| 119 | endif | 121 | endif |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 46ca4d4abf91..d440e5f456ad 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
| @@ -163,11 +163,13 @@ static struct mtd_partition nor_flash_partitions[] = { | |||
| 163 | .name = "loader", | 163 | .name = "loader", |
| 164 | .offset = 0x00000000, | 164 | .offset = 0x00000000, |
| 165 | .size = 512 * 1024, | 165 | .size = 512 * 1024, |
| 166 | .mask_flags = MTD_WRITEABLE, | ||
| 166 | }, | 167 | }, |
| 167 | { | 168 | { |
| 168 | .name = "bootenv", | 169 | .name = "bootenv", |
| 169 | .offset = MTDPART_OFS_APPEND, | 170 | .offset = MTDPART_OFS_APPEND, |
| 170 | .size = 512 * 1024, | 171 | .size = 512 * 1024, |
| 172 | .mask_flags = MTD_WRITEABLE, | ||
| 171 | }, | 173 | }, |
| 172 | { | 174 | { |
| 173 | .name = "kernel_ro", | 175 | .name = "kernel_ro", |
| @@ -565,12 +567,143 @@ static struct platform_device *qhd_devices[] __initdata = { | |||
| 565 | 567 | ||
| 566 | /* FSI */ | 568 | /* FSI */ |
| 567 | #define IRQ_FSI evt2irq(0x1840) | 569 | #define IRQ_FSI evt2irq(0x1840) |
| 570 | static int __fsi_set_rate(struct clk *clk, long rate, int enable) | ||
| 571 | { | ||
| 572 | int ret = 0; | ||
| 573 | |||
| 574 | if (rate <= 0) | ||
| 575 | return ret; | ||
| 576 | |||
| 577 | if (enable) { | ||
| 578 | ret = clk_set_rate(clk, rate); | ||
| 579 | if (0 == ret) | ||
| 580 | ret = clk_enable(clk); | ||
| 581 | } else { | ||
| 582 | clk_disable(clk); | ||
| 583 | } | ||
| 584 | |||
| 585 | return ret; | ||
| 586 | } | ||
| 587 | |||
| 588 | static int __fsi_set_round_rate(struct clk *clk, long rate, int enable) | ||
| 589 | { | ||
| 590 | return __fsi_set_rate(clk, clk_round_rate(clk, rate), enable); | ||
| 591 | } | ||
| 592 | |||
| 593 | static int fsi_ak4642_set_rate(struct device *dev, int rate, int enable) | ||
| 594 | { | ||
| 595 | struct clk *fsia_ick; | ||
| 596 | struct clk *fsiack; | ||
| 597 | int ret = -EIO; | ||
| 598 | |||
| 599 | fsia_ick = clk_get(dev, "icka"); | ||
| 600 | if (IS_ERR(fsia_ick)) | ||
| 601 | return PTR_ERR(fsia_ick); | ||
| 602 | |||
| 603 | /* | ||
| 604 | * FSIACK is connected to AK4642, | ||
| 605 | * and use external clock pin from it. | ||
| 606 | * it is parent of fsia_ick now. | ||
| 607 | */ | ||
| 608 | fsiack = clk_get_parent(fsia_ick); | ||
| 609 | if (!fsiack) | ||
| 610 | goto fsia_ick_out; | ||
| 611 | |||
| 612 | /* | ||
| 613 | * we get 1/1 divided clock by setting same rate to fsiack and fsia_ick | ||
| 614 | * | ||
| 615 | ** FIXME ** | ||
| 616 | * Because the freq_table of external clk (fsiack) are all 0, | ||
| 617 | * the return value of clk_round_rate became 0. | ||
| 618 | * So, it use __fsi_set_rate here. | ||
| 619 | */ | ||
| 620 | ret = __fsi_set_rate(fsiack, rate, enable); | ||
| 621 | if (ret < 0) | ||
| 622 | goto fsiack_out; | ||
| 623 | |||
| 624 | ret = __fsi_set_round_rate(fsia_ick, rate, enable); | ||
| 625 | if ((ret < 0) && enable) | ||
| 626 | __fsi_set_round_rate(fsiack, rate, 0); /* disable FSI ACK */ | ||
| 627 | |||
| 628 | fsiack_out: | ||
| 629 | clk_put(fsiack); | ||
| 630 | |||
| 631 | fsia_ick_out: | ||
| 632 | clk_put(fsia_ick); | ||
| 633 | |||
| 634 | return 0; | ||
| 635 | } | ||
| 636 | |||
| 637 | static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable) | ||
| 638 | { | ||
| 639 | struct clk *fsib_clk; | ||
| 640 | struct clk *fdiv_clk = &sh7372_fsidivb_clk; | ||
| 641 | long fsib_rate = 0; | ||
| 642 | long fdiv_rate = 0; | ||
| 643 | int ackmd_bpfmd; | ||
| 644 | int ret; | ||
| 645 | |||
| 646 | switch (rate) { | ||
| 647 | case 44100: | ||
| 648 | fsib_rate = rate * 256; | ||
| 649 | ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; | ||
| 650 | break; | ||
| 651 | case 48000: | ||
| 652 | fsib_rate = 85428000; /* around 48kHz x 256 x 7 */ | ||
| 653 | fdiv_rate = rate * 256; | ||
| 654 | ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; | ||
| 655 | break; | ||
| 656 | default: | ||
| 657 | pr_err("unsupported rate in FSI2 port B\n"); | ||
| 658 | return -EINVAL; | ||
| 659 | } | ||
| 660 | |||
| 661 | /* FSI B setting */ | ||
| 662 | fsib_clk = clk_get(dev, "ickb"); | ||
| 663 | if (IS_ERR(fsib_clk)) | ||
| 664 | return -EIO; | ||
| 665 | |||
| 666 | ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable); | ||
| 667 | clk_put(fsib_clk); | ||
| 668 | if (ret < 0) | ||
| 669 | return ret; | ||
| 670 | |||
| 671 | /* FSI DIV setting */ | ||
| 672 | ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable); | ||
| 673 | if (ret < 0) { | ||
| 674 | /* disable FSI B */ | ||
| 675 | if (enable) | ||
| 676 | __fsi_set_round_rate(fsib_clk, fsib_rate, 0); | ||
| 677 | return ret; | ||
| 678 | } | ||
| 679 | |||
| 680 | return ackmd_bpfmd; | ||
| 681 | } | ||
| 682 | |||
| 683 | static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable) | ||
| 684 | { | ||
| 685 | int ret; | ||
| 686 | |||
| 687 | if (is_porta) | ||
| 688 | ret = fsi_ak4642_set_rate(dev, rate, enable); | ||
| 689 | else | ||
| 690 | ret = fsi_hdmi_set_rate(dev, rate, enable); | ||
| 691 | |||
| 692 | return ret; | ||
| 693 | } | ||
| 694 | |||
| 568 | static struct sh_fsi_platform_info fsi_info = { | 695 | static struct sh_fsi_platform_info fsi_info = { |
| 569 | .porta_flags = SH_FSI_BRS_INV | | 696 | .porta_flags = SH_FSI_BRS_INV | |
| 570 | SH_FSI_OUT_SLAVE_MODE | | 697 | SH_FSI_OUT_SLAVE_MODE | |
| 571 | SH_FSI_IN_SLAVE_MODE | | 698 | SH_FSI_IN_SLAVE_MODE | |
| 572 | SH_FSI_OFMT(PCM) | | 699 | SH_FSI_OFMT(PCM) | |
| 573 | SH_FSI_IFMT(PCM), | 700 | SH_FSI_IFMT(PCM), |
| 701 | |||
| 702 | .portb_flags = SH_FSI_BRS_INV | | ||
| 703 | SH_FSI_BRM_INV | | ||
| 704 | SH_FSI_LRS_INV | | ||
| 705 | SH_FSI_OFMT(SPDIF), | ||
| 706 | .set_rate = fsi_set_rate, | ||
| 574 | }; | 707 | }; |
| 575 | 708 | ||
| 576 | static struct resource fsi_resources[] = { | 709 | static struct resource fsi_resources[] = { |
| @@ -634,6 +767,7 @@ static struct platform_device lcdc1_device = { | |||
| 634 | static struct sh_mobile_hdmi_info hdmi_info = { | 767 | static struct sh_mobile_hdmi_info hdmi_info = { |
| 635 | .lcd_chan = &sh_mobile_lcdc1_info.ch[0], | 768 | .lcd_chan = &sh_mobile_lcdc1_info.ch[0], |
| 636 | .lcd_dev = &lcdc1_device.dev, | 769 | .lcd_dev = &lcdc1_device.dev, |
| 770 | .flags = HDMI_SND_SRC_SPDIF, | ||
| 637 | }; | 771 | }; |
| 638 | 772 | ||
| 639 | static struct resource hdmi_resources[] = { | 773 | static struct resource hdmi_resources[] = { |
| @@ -835,6 +969,11 @@ static int __init hdmi_init_pm_clock(void) | |||
| 835 | goto out; | 969 | goto out; |
| 836 | } | 970 | } |
| 837 | 971 | ||
| 972 | ret = clk_enable(&sh7372_pllc2_clk); | ||
| 973 | if (ret < 0) { | ||
| 974 | pr_err("Cannot enable pllc2 clock\n"); | ||
| 975 | goto out; | ||
| 976 | } | ||
| 838 | pr_debug("PLLC2 set frequency %lu\n", rate); | 977 | pr_debug("PLLC2 set frequency %lu\n", rate); |
| 839 | 978 | ||
| 840 | ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk); | 979 | ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk); |
| @@ -851,23 +990,11 @@ out: | |||
| 851 | 990 | ||
| 852 | device_initcall(hdmi_init_pm_clock); | 991 | device_initcall(hdmi_init_pm_clock); |
| 853 | 992 | ||
| 854 | #define FSIACK_DUMMY_RATE 48000 | ||
| 855 | static int __init fsi_init_pm_clock(void) | 993 | static int __init fsi_init_pm_clock(void) |
| 856 | { | 994 | { |
| 857 | struct clk *fsia_ick; | 995 | struct clk *fsia_ick; |
| 858 | int ret; | 996 | int ret; |
| 859 | 997 | ||
| 860 | /* | ||
| 861 | * FSIACK is connected to AK4642, | ||
| 862 | * and the rate is depend on playing sound rate. | ||
| 863 | * So, set dummy rate (= 48k) here | ||
| 864 | */ | ||
| 865 | ret = clk_set_rate(&sh7372_fsiack_clk, FSIACK_DUMMY_RATE); | ||
| 866 | if (ret < 0) { | ||
| 867 | pr_err("Cannot set FSIACK dummy rate: %d\n", ret); | ||
| 868 | return ret; | ||
| 869 | } | ||
| 870 | |||
| 871 | fsia_ick = clk_get(&fsi_device.dev, "icka"); | 998 | fsia_ick = clk_get(&fsi_device.dev, "icka"); |
| 872 | if (IS_ERR(fsia_ick)) { | 999 | if (IS_ERR(fsia_ick)) { |
| 873 | ret = PTR_ERR(fsia_ick); | 1000 | ret = PTR_ERR(fsia_ick); |
| @@ -876,16 +1003,9 @@ static int __init fsi_init_pm_clock(void) | |||
| 876 | } | 1003 | } |
| 877 | 1004 | ||
| 878 | ret = clk_set_parent(fsia_ick, &sh7372_fsiack_clk); | 1005 | ret = clk_set_parent(fsia_ick, &sh7372_fsiack_clk); |
| 879 | if (ret < 0) { | ||
| 880 | pr_err("Cannot set FSI-A parent: %d\n", ret); | ||
| 881 | goto out; | ||
| 882 | } | ||
| 883 | |||
| 884 | ret = clk_set_rate(fsia_ick, FSIACK_DUMMY_RATE); | ||
| 885 | if (ret < 0) | 1006 | if (ret < 0) |
| 886 | pr_err("Cannot set FSI-A rate: %d\n", ret); | 1007 | pr_err("Cannot set FSI-A parent: %d\n", ret); |
| 887 | 1008 | ||
| 888 | out: | ||
| 889 | clk_put(fsia_ick); | 1009 | clk_put(fsia_ick); |
| 890 | 1010 | ||
| 891 | return ret; | 1011 | return ret; |
| @@ -992,6 +1112,7 @@ static void __init ap4evb_map_io(void) | |||
| 992 | 1112 | ||
| 993 | #define GPIO_PORT9CR 0xE6051009 | 1113 | #define GPIO_PORT9CR 0xE6051009 |
| 994 | #define GPIO_PORT10CR 0xE605100A | 1114 | #define GPIO_PORT10CR 0xE605100A |
| 1115 | #define USCCR1 0xE6058144 | ||
| 995 | static void __init ap4evb_init(void) | 1116 | static void __init ap4evb_init(void) |
| 996 | { | 1117 | { |
| 997 | u32 srcr4; | 1118 | u32 srcr4; |
| @@ -1062,7 +1183,7 @@ static void __init ap4evb_init(void) | |||
| 1062 | /* setup USB phy */ | 1183 | /* setup USB phy */ |
| 1063 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ | 1184 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ |
| 1064 | 1185 | ||
| 1065 | /* enable FSI2 */ | 1186 | /* enable FSI2 port A (ak4643) */ |
| 1066 | gpio_request(GPIO_FN_FSIAIBT, NULL); | 1187 | gpio_request(GPIO_FN_FSIAIBT, NULL); |
| 1067 | gpio_request(GPIO_FN_FSIAILR, NULL); | 1188 | gpio_request(GPIO_FN_FSIAILR, NULL); |
| 1068 | gpio_request(GPIO_FN_FSIAISLD, NULL); | 1189 | gpio_request(GPIO_FN_FSIAISLD, NULL); |
| @@ -1079,6 +1200,10 @@ static void __init ap4evb_init(void) | |||
| 1079 | gpio_request(GPIO_PORT41, NULL); | 1200 | gpio_request(GPIO_PORT41, NULL); |
| 1080 | gpio_direction_input(GPIO_PORT41); | 1201 | gpio_direction_input(GPIO_PORT41); |
| 1081 | 1202 | ||
| 1203 | /* setup FSI2 port B (HDMI) */ | ||
| 1204 | gpio_request(GPIO_FN_FSIBCK, NULL); | ||
| 1205 | __raw_writew(__raw_readw(USCCR1) & ~(1 << 6), USCCR1); /* use SPDIF */ | ||
| 1206 | |||
| 1082 | /* set SPU2 clock to 119.6 MHz */ | 1207 | /* set SPU2 clock to 119.6 MHz */ |
| 1083 | clk = clk_get(NULL, "spu_clk"); | 1208 | clk = clk_get(NULL, "spu_clk"); |
| 1084 | if (!IS_ERR(clk)) { | 1209 | if (!IS_ERR(clk)) { |
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index 445112adba46..d98deb497c2f 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
| @@ -50,6 +50,9 @@ | |||
| 50 | #define SMSTPCR3 0xe615013c | 50 | #define SMSTPCR3 0xe615013c |
| 51 | #define SMSTPCR4 0xe6150140 | 51 | #define SMSTPCR4 0xe6150140 |
| 52 | 52 | ||
| 53 | #define FSIDIVA 0xFE1F8000 | ||
| 54 | #define FSIDIVB 0xFE1F8008 | ||
| 55 | |||
| 53 | /* Platforms must set frequency on their DV_CLKI pin */ | 56 | /* Platforms must set frequency on their DV_CLKI pin */ |
| 54 | struct clk sh7372_dv_clki_clk = { | 57 | struct clk sh7372_dv_clki_clk = { |
| 55 | }; | 58 | }; |
| @@ -217,8 +220,7 @@ static void pllc2_disable(struct clk *clk) | |||
| 217 | __raw_writel(__raw_readl(PLLC2CR) & ~0x80000000, PLLC2CR); | 220 | __raw_writel(__raw_readl(PLLC2CR) & ~0x80000000, PLLC2CR); |
| 218 | } | 221 | } |
| 219 | 222 | ||
| 220 | static int pllc2_set_rate(struct clk *clk, | 223 | static int pllc2_set_rate(struct clk *clk, unsigned long rate) |
| 221 | unsigned long rate, int algo_id) | ||
| 222 | { | 224 | { |
| 223 | unsigned long value; | 225 | unsigned long value; |
| 224 | int idx; | 226 | int idx; |
| @@ -227,21 +229,13 @@ static int pllc2_set_rate(struct clk *clk, | |||
| 227 | if (idx < 0) | 229 | if (idx < 0) |
| 228 | return idx; | 230 | return idx; |
| 229 | 231 | ||
| 230 | if (rate == clk->parent->rate) { | 232 | if (rate == clk->parent->rate) |
| 231 | pllc2_disable(clk); | 233 | return -EINVAL; |
| 232 | return 0; | ||
| 233 | } | ||
| 234 | 234 | ||
| 235 | value = __raw_readl(PLLC2CR) & ~(0x3f << 24); | 235 | value = __raw_readl(PLLC2CR) & ~(0x3f << 24); |
| 236 | 236 | ||
| 237 | if (value & 0x80000000) | ||
| 238 | pllc2_disable(clk); | ||
| 239 | |||
| 240 | __raw_writel((value & ~0x80000000) | ((idx + 19) << 24), PLLC2CR); | 237 | __raw_writel((value & ~0x80000000) | ((idx + 19) << 24), PLLC2CR); |
| 241 | 238 | ||
| 242 | if (value & 0x80000000) | ||
| 243 | return pllc2_enable(clk); | ||
| 244 | |||
| 245 | return 0; | 239 | return 0; |
| 246 | } | 240 | } |
| 247 | 241 | ||
| @@ -288,6 +282,7 @@ struct clk sh7372_pllc2_clk = { | |||
| 288 | .ops = &pllc2_clk_ops, | 282 | .ops = &pllc2_clk_ops, |
| 289 | .parent = &extal1_div2_clk, | 283 | .parent = &extal1_div2_clk, |
| 290 | .freq_table = pllc2_freq_table, | 284 | .freq_table = pllc2_freq_table, |
| 285 | .nr_freqs = ARRAY_SIZE(pllc2_freq_table) - 1, | ||
| 291 | .parent_table = pllc2_parent, | 286 | .parent_table = pllc2_parent, |
| 292 | .parent_num = ARRAY_SIZE(pllc2_parent), | 287 | .parent_num = ARRAY_SIZE(pllc2_parent), |
| 293 | }; | 288 | }; |
| @@ -417,6 +412,93 @@ static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { | |||
| 417 | fsibckcr_parent, ARRAY_SIZE(fsibckcr_parent), 6, 2), | 412 | fsibckcr_parent, ARRAY_SIZE(fsibckcr_parent), 6, 2), |
| 418 | }; | 413 | }; |
| 419 | 414 | ||
| 415 | /* FSI DIV */ | ||
| 416 | static unsigned long fsidiv_recalc(struct clk *clk) | ||
| 417 | { | ||
| 418 | unsigned long value; | ||
| 419 | |||
| 420 | value = __raw_readl(clk->mapping->base); | ||
| 421 | |||
| 422 | if ((value & 0x3) != 0x3) | ||
| 423 | return 0; | ||
| 424 | |||
| 425 | value >>= 16; | ||
| 426 | if (value < 2) | ||
| 427 | return 0; | ||
| 428 | |||
| 429 | return clk->parent->rate / value; | ||
| 430 | } | ||
| 431 | |||
| 432 | static long fsidiv_round_rate(struct clk *clk, unsigned long rate) | ||
| 433 | { | ||
| 434 | return clk_rate_div_range_round(clk, 2, 0xffff, rate); | ||
| 435 | } | ||
| 436 | |||
| 437 | static void fsidiv_disable(struct clk *clk) | ||
| 438 | { | ||
| 439 | __raw_writel(0, clk->mapping->base); | ||
| 440 | } | ||
| 441 | |||
| 442 | static int fsidiv_enable(struct clk *clk) | ||
| 443 | { | ||
| 444 | unsigned long value; | ||
| 445 | |||
| 446 | value = __raw_readl(clk->mapping->base) >> 16; | ||
| 447 | if (value < 2) | ||
| 448 | return -EIO; | ||
| 449 | |||
| 450 | __raw_writel((value << 16) | 0x3, clk->mapping->base); | ||
| 451 | |||
| 452 | return 0; | ||
| 453 | } | ||
| 454 | |||
| 455 | static int fsidiv_set_rate(struct clk *clk, unsigned long rate) | ||
| 456 | { | ||
| 457 | int idx; | ||
| 458 | |||
| 459 | idx = (clk->parent->rate / rate) & 0xffff; | ||
| 460 | if (idx < 2) | ||
| 461 | return -EINVAL; | ||
| 462 | |||
| 463 | __raw_writel(idx << 16, clk->mapping->base); | ||
| 464 | return 0; | ||
| 465 | } | ||
| 466 | |||
| 467 | static struct clk_ops fsidiv_clk_ops = { | ||
| 468 | .recalc = fsidiv_recalc, | ||
| 469 | .round_rate = fsidiv_round_rate, | ||
| 470 | .set_rate = fsidiv_set_rate, | ||
| 471 | .enable = fsidiv_enable, | ||
| 472 | .disable = fsidiv_disable, | ||
| 473 | }; | ||
| 474 | |||
| 475 | static struct clk_mapping sh7372_fsidiva_clk_mapping = { | ||
| 476 | .phys = FSIDIVA, | ||
| 477 | .len = 8, | ||
| 478 | }; | ||
| 479 | |||
| 480 | struct clk sh7372_fsidiva_clk = { | ||
| 481 | .ops = &fsidiv_clk_ops, | ||
| 482 | .parent = &div6_reparent_clks[DIV6_FSIA], /* late install */ | ||
| 483 | .mapping = &sh7372_fsidiva_clk_mapping, | ||
| 484 | }; | ||
| 485 | |||
| 486 | static struct clk_mapping sh7372_fsidivb_clk_mapping = { | ||
| 487 | .phys = FSIDIVB, | ||
| 488 | .len = 8, | ||
| 489 | }; | ||
| 490 | |||
| 491 | struct clk sh7372_fsidivb_clk = { | ||
| 492 | .ops = &fsidiv_clk_ops, | ||
| 493 | .parent = &div6_reparent_clks[DIV6_FSIB], /* late install */ | ||
| 494 | .mapping = &sh7372_fsidivb_clk_mapping, | ||
| 495 | }; | ||
| 496 | |||
| 497 | static struct clk *late_main_clks[] = { | ||
| 498 | &sh7372_fsidiva_clk, | ||
| 499 | &sh7372_fsidivb_clk, | ||
| 500 | }; | ||
| 501 | |||
| 420 | enum { MSTP001, | 502 | enum { MSTP001, |
| 421 | MSTP131, MSTP130, | 503 | MSTP131, MSTP130, |
| 422 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, | 504 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, |
| @@ -510,8 +592,6 @@ static struct clk_lookup lookups[] = { | |||
| 510 | CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]), | 592 | CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]), |
| 511 | CLKDEV_CON_ID("fmsi_clk", &div6_clks[DIV6_FMSI]), | 593 | CLKDEV_CON_ID("fmsi_clk", &div6_clks[DIV6_FMSI]), |
| 512 | CLKDEV_CON_ID("fmso_clk", &div6_clks[DIV6_FMSO]), | 594 | CLKDEV_CON_ID("fmso_clk", &div6_clks[DIV6_FMSO]), |
| 513 | CLKDEV_CON_ID("fsia_clk", &div6_reparent_clks[DIV6_FSIA]), | ||
| 514 | CLKDEV_CON_ID("fsib_clk", &div6_reparent_clks[DIV6_FSIB]), | ||
| 515 | CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]), | 595 | CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]), |
| 516 | CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]), | 596 | CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]), |
| 517 | CLKDEV_CON_ID("vou_clk", &div6_clks[DIV6_VOU]), | 597 | CLKDEV_CON_ID("vou_clk", &div6_clks[DIV6_VOU]), |
| @@ -548,8 +628,8 @@ static struct clk_lookup lookups[] = { | |||
| 548 | CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ | 628 | CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ |
| 549 | CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */ | 629 | CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */ |
| 550 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */ | 630 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */ |
| 551 | CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP323]), /* USB0 */ | 631 | CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */ |
| 552 | CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP323]), /* USB0 */ | 632 | CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */ |
| 553 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ | 633 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ |
| 554 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ | 634 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ |
| 555 | CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */ | 635 | CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */ |
| @@ -585,6 +665,9 @@ void __init sh7372_clock_init(void) | |||
| 585 | if (!ret) | 665 | if (!ret) |
| 586 | ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); | 666 | ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); |
| 587 | 667 | ||
| 668 | for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++) | ||
| 669 | ret = clk_register(late_main_clks[k]); | ||
| 670 | |||
| 588 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 671 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 589 | 672 | ||
| 590 | if (!ret) | 673 | if (!ret) |
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h index 5bc6bd444d72..2b1bb9e43dda 100644 --- a/arch/arm/mach-shmobile/include/mach/gpio.h +++ b/arch/arm/mach-shmobile/include/mach/gpio.h | |||
| @@ -35,12 +35,12 @@ static inline int gpio_cansleep(unsigned gpio) | |||
| 35 | 35 | ||
| 36 | static inline int gpio_to_irq(unsigned gpio) | 36 | static inline int gpio_to_irq(unsigned gpio) |
| 37 | { | 37 | { |
| 38 | return -ENOSYS; | 38 | return __gpio_to_irq(gpio); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | static inline int irq_to_gpio(unsigned int irq) | 41 | static inline int irq_to_gpio(unsigned int irq) |
| 42 | { | 42 | { |
| 43 | return -EINVAL; | 43 | return -ENOSYS; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | #endif /* CONFIG_GPIOLIB */ | 46 | #endif /* CONFIG_GPIOLIB */ |
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h index 147775a94bce..e4f9004e7103 100644 --- a/arch/arm/mach-shmobile/include/mach/sh7372.h +++ b/arch/arm/mach-shmobile/include/mach/sh7372.h | |||
| @@ -464,5 +464,7 @@ extern struct clk sh7372_dv_clki_div2_clk; | |||
| 464 | extern struct clk sh7372_pllc2_clk; | 464 | extern struct clk sh7372_pllc2_clk; |
| 465 | extern struct clk sh7372_fsiack_clk; | 465 | extern struct clk sh7372_fsiack_clk; |
| 466 | extern struct clk sh7372_fsibck_clk; | 466 | extern struct clk sh7372_fsibck_clk; |
| 467 | extern struct clk sh7372_fsidiva_clk; | ||
| 468 | extern struct clk sh7372_fsidivb_clk; | ||
| 467 | 469 | ||
| 468 | #endif /* __ASM_SH7372_H__ */ | 470 | #endif /* __ASM_SH7372_H__ */ |
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index 4cd3cae38e72..30b2f400666a 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c | |||
| @@ -98,7 +98,7 @@ static struct intc_vect intca_vectors[] __initdata = { | |||
| 98 | INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0), | 98 | INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0), |
| 99 | INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220), | 99 | INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220), |
| 100 | INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260), | 100 | INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260), |
| 101 | INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ31A, 0x32a0), | 101 | INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ21A, 0x32a0), |
| 102 | INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0), | 102 | INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0), |
| 103 | INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320), | 103 | INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320), |
| 104 | INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360), | 104 | INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360), |
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c index 8e7f115aa21e..a5cb1ce76ff2 100644 --- a/arch/arm/mach-tegra/hotplug.c +++ b/arch/arm/mach-tegra/hotplug.c | |||
| @@ -11,12 +11,9 @@ | |||
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
| 13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
| 14 | #include <linux/completion.h> | ||
| 15 | 14 | ||
| 16 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
| 17 | 16 | ||
| 18 | static DECLARE_COMPLETION(cpu_killed); | ||
| 19 | |||
| 20 | static inline void cpu_enter_lowpower(void) | 17 | static inline void cpu_enter_lowpower(void) |
| 21 | { | 18 | { |
| 22 | unsigned int v; | 19 | unsigned int v; |
| @@ -29,13 +26,13 @@ static inline void cpu_enter_lowpower(void) | |||
| 29 | * Turn off coherency | 26 | * Turn off coherency |
| 30 | */ | 27 | */ |
| 31 | " mrc p15, 0, %0, c1, c0, 1\n" | 28 | " mrc p15, 0, %0, c1, c0, 1\n" |
| 32 | " bic %0, %0, #0x20\n" | 29 | " bic %0, %0, %2\n" |
| 33 | " mcr p15, 0, %0, c1, c0, 1\n" | 30 | " mcr p15, 0, %0, c1, c0, 1\n" |
| 34 | " mrc p15, 0, %0, c1, c0, 0\n" | 31 | " mrc p15, 0, %0, c1, c0, 0\n" |
| 35 | " bic %0, %0, #0x04\n" | 32 | " bic %0, %0, #0x04\n" |
| 36 | " mcr p15, 0, %0, c1, c0, 0\n" | 33 | " mcr p15, 0, %0, c1, c0, 0\n" |
| 37 | : "=&r" (v) | 34 | : "=&r" (v) |
| 38 | : "r" (0) | 35 | : "r" (0), "Ir" (CR_C) |
| 39 | : "cc"); | 36 | : "cc"); |
| 40 | } | 37 | } |
| 41 | 38 | ||
| @@ -45,17 +42,17 @@ static inline void cpu_leave_lowpower(void) | |||
| 45 | 42 | ||
| 46 | asm volatile( | 43 | asm volatile( |
| 47 | "mrc p15, 0, %0, c1, c0, 0\n" | 44 | "mrc p15, 0, %0, c1, c0, 0\n" |
| 48 | " orr %0, %0, #0x04\n" | 45 | " orr %0, %0, %1\n" |
| 49 | " mcr p15, 0, %0, c1, c0, 0\n" | 46 | " mcr p15, 0, %0, c1, c0, 0\n" |
| 50 | " mrc p15, 0, %0, c1, c0, 1\n" | 47 | " mrc p15, 0, %0, c1, c0, 1\n" |
| 51 | " orr %0, %0, #0x20\n" | 48 | " orr %0, %0, #0x20\n" |
| 52 | " mcr p15, 0, %0, c1, c0, 1\n" | 49 | " mcr p15, 0, %0, c1, c0, 1\n" |
| 53 | : "=&r" (v) | 50 | : "=&r" (v) |
| 54 | : | 51 | : "Ir" (CR_C) |
| 55 | : "cc"); | 52 | : "cc"); |
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | static inline void platform_do_lowpower(unsigned int cpu) | 55 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) |
| 59 | { | 56 | { |
| 60 | /* | 57 | /* |
| 61 | * there is no power-control hardware on this platform, so all | 58 | * there is no power-control hardware on this platform, so all |
| @@ -79,22 +76,19 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
| 79 | /*}*/ | 76 | /*}*/ |
| 80 | 77 | ||
| 81 | /* | 78 | /* |
| 82 | * getting here, means that we have come out of WFI without | 79 | * Getting here, means that we have come out of WFI without |
| 83 | * having been woken up - this shouldn't happen | 80 | * having been woken up - this shouldn't happen |
| 84 | * | 81 | * |
| 85 | * The trouble is, letting people know about this is not really | 82 | * Just note it happening - when we're woken, we can report |
| 86 | * possible, since we are currently running incoherently, and | 83 | * its occurrence. |
| 87 | * therefore cannot safely call printk() or anything else | ||
| 88 | */ | 84 | */ |
| 89 | #ifdef DEBUG | 85 | (*spurious)++; |
| 90 | printk(KERN_WARN "CPU%u: spurious wakeup call\n", cpu); | ||
| 91 | #endif | ||
| 92 | } | 86 | } |
| 93 | } | 87 | } |
| 94 | 88 | ||
| 95 | int platform_cpu_kill(unsigned int cpu) | 89 | int platform_cpu_kill(unsigned int cpu) |
| 96 | { | 90 | { |
| 97 | return wait_for_completion_timeout(&cpu_killed, 5000); | 91 | return 1; |
| 98 | } | 92 | } |
| 99 | 93 | ||
| 100 | /* | 94 | /* |
| @@ -104,30 +98,22 @@ int platform_cpu_kill(unsigned int cpu) | |||
| 104 | */ | 98 | */ |
| 105 | void platform_cpu_die(unsigned int cpu) | 99 | void platform_cpu_die(unsigned int cpu) |
| 106 | { | 100 | { |
| 107 | #ifdef DEBUG | 101 | int spurious = 0; |
| 108 | unsigned int this_cpu = hard_smp_processor_id(); | ||
| 109 | |||
| 110 | if (cpu != this_cpu) { | ||
| 111 | printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n", | ||
| 112 | this_cpu, cpu); | ||
| 113 | BUG(); | ||
| 114 | } | ||
| 115 | #endif | ||
| 116 | |||
| 117 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
| 118 | complete(&cpu_killed); | ||
| 119 | 102 | ||
| 120 | /* | 103 | /* |
| 121 | * we're ready for shutdown now, so do it | 104 | * we're ready for shutdown now, so do it |
| 122 | */ | 105 | */ |
| 123 | cpu_enter_lowpower(); | 106 | cpu_enter_lowpower(); |
| 124 | platform_do_lowpower(cpu); | 107 | platform_do_lowpower(cpu, &spurious); |
| 125 | 108 | ||
| 126 | /* | 109 | /* |
| 127 | * bring this CPU back into the world of cache | 110 | * bring this CPU back into the world of cache |
| 128 | * coherency, and then restore interrupts | 111 | * coherency, and then restore interrupts |
| 129 | */ | 112 | */ |
| 130 | cpu_leave_lowpower(); | 113 | cpu_leave_lowpower(); |
| 114 | |||
| 115 | if (spurious) | ||
| 116 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
| 131 | } | 117 | } |
| 132 | 118 | ||
| 133 | int platform_cpu_disable(unsigned int cpu) | 119 | int platform_cpu_disable(unsigned int cpu) |
diff --git a/arch/arm/mach-tegra/include/mach/smp.h b/arch/arm/mach-tegra/include/mach/smp.h index e4a34a35a544..c8221b38ee7c 100644 --- a/arch/arm/mach-tegra/include/mach/smp.h +++ b/arch/arm/mach-tegra/include/mach/smp.h | |||
| @@ -2,21 +2,13 @@ | |||
| 2 | #define ASMARM_ARCH_SMP_H | 2 | #define ASMARM_ARCH_SMP_H |
| 3 | 3 | ||
| 4 | #include <asm/hardware/gic.h> | 4 | #include <asm/hardware/gic.h> |
| 5 | #include <asm/smp_mpidr.h> | ||
| 6 | 5 | ||
| 7 | /* | 6 | /* |
| 8 | * We use IRQ1 as the IPI | 7 | * We use IRQ1 as the IPI |
| 9 | */ | 8 | */ |
| 10 | static inline void smp_cross_call(const struct cpumask *mask) | 9 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
| 11 | { | ||
| 12 | gic_raise_softirq(mask, 1); | ||
| 13 | } | ||
| 14 | |||
| 15 | /* | ||
| 16 | * Do nothing on MPcore. | ||
| 17 | */ | ||
| 18 | static inline void smp_cross_call_done(cpumask_t callmap) | ||
| 19 | { | 10 | { |
| 11 | gic_raise_softirq(mask, ipi); | ||
| 20 | } | 12 | } |
| 21 | 13 | ||
| 22 | #endif | 14 | #endif |
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c index 1c0fd92cab39..c729cd72cc3b 100644 --- a/arch/arm/mach-tegra/platsmp.c +++ b/arch/arm/mach-tegra/platsmp.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
| 23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
| 24 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
| 25 | #include <asm/localtimer.h> | ||
| 26 | #include <asm/smp_scu.h> | 25 | #include <asm/smp_scu.h> |
| 27 | 26 | ||
| 28 | #include <mach/iomap.h> | 27 | #include <mach/iomap.h> |
| @@ -41,8 +40,6 @@ static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE); | |||
| 41 | 40 | ||
| 42 | void __cpuinit platform_secondary_init(unsigned int cpu) | 41 | void __cpuinit platform_secondary_init(unsigned int cpu) |
| 43 | { | 42 | { |
| 44 | trace_hardirqs_off(); | ||
| 45 | |||
| 46 | /* | 43 | /* |
| 47 | * if any interrupts are already enabled for the primary | 44 | * if any interrupts are already enabled for the primary |
| 48 | * core (e.g. timer irq), then they will not have been enabled | 45 | * core (e.g. timer irq), then they will not have been enabled |
| @@ -117,24 +114,20 @@ void __init smp_init_cpus(void) | |||
| 117 | { | 114 | { |
| 118 | unsigned int i, ncores = scu_get_core_count(scu_base); | 115 | unsigned int i, ncores = scu_get_core_count(scu_base); |
| 119 | 116 | ||
| 117 | if (ncores > NR_CPUS) { | ||
| 118 | printk(KERN_ERR "Tegra: no. of cores (%u) greater than configured (%u), clipping\n", | ||
| 119 | ncores, NR_CPUS); | ||
| 120 | ncores = NR_CPUS; | ||
| 121 | } | ||
| 122 | |||
| 120 | for (i = 0; i < ncores; i++) | 123 | for (i = 0; i < ncores; i++) |
| 121 | cpu_set(i, cpu_possible_map); | 124 | cpu_set(i, cpu_possible_map); |
| 122 | } | 125 | } |
| 123 | 126 | ||
| 124 | void __init smp_prepare_cpus(unsigned int max_cpus) | 127 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
| 125 | { | 128 | { |
| 126 | unsigned int ncores = scu_get_core_count(scu_base); | ||
| 127 | unsigned int cpu = smp_processor_id(); | ||
| 128 | int i; | 129 | int i; |
| 129 | 130 | ||
| 130 | smp_store_cpu_info(cpu); | ||
| 131 | |||
| 132 | /* | ||
| 133 | * are we trying to boot more cores than exist? | ||
| 134 | */ | ||
| 135 | if (max_cpus > ncores) | ||
| 136 | max_cpus = ncores; | ||
| 137 | |||
| 138 | /* | 131 | /* |
| 139 | * Initialise the present map, which describes the set of CPUs | 132 | * Initialise the present map, which describes the set of CPUs |
| 140 | * actually populated at the present time. | 133 | * actually populated at the present time. |
| @@ -142,15 +135,5 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 142 | for (i = 0; i < max_cpus; i++) | 135 | for (i = 0; i < max_cpus; i++) |
| 143 | set_cpu_present(i, true); | 136 | set_cpu_present(i, true); |
| 144 | 137 | ||
| 145 | /* | 138 | scu_enable(scu_base); |
| 146 | * Initialise the SCU if there are more than one CPU and let | ||
| 147 | * them know where to start. Note that, on modern versions of | ||
| 148 | * MILO, the "poke" doesn't actually do anything until each | ||
| 149 | * individual core is sent a soft interrupt to get it out of | ||
| 150 | * WFI | ||
| 151 | */ | ||
| 152 | if (max_cpus > 1) { | ||
| 153 | percpu_timer_setup(); | ||
| 154 | scu_enable(scu_base); | ||
| 155 | } | ||
| 156 | } | 139 | } |
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index 73fb1a551ec6..608a1372b172 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c | |||
| @@ -75,14 +75,14 @@ void __init ux500_init_irq(void) | |||
| 75 | static inline void ux500_cache_wait(void __iomem *reg, unsigned long mask) | 75 | static inline void ux500_cache_wait(void __iomem *reg, unsigned long mask) |
| 76 | { | 76 | { |
| 77 | /* wait for the operation to complete */ | 77 | /* wait for the operation to complete */ |
| 78 | while (readl(reg) & mask) | 78 | while (readl_relaxed(reg) & mask) |
| 79 | ; | 79 | ; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static inline void ux500_cache_sync(void) | 82 | static inline void ux500_cache_sync(void) |
| 83 | { | 83 | { |
| 84 | void __iomem *base = __io_address(UX500_L2CC_BASE); | 84 | void __iomem *base = __io_address(UX500_L2CC_BASE); |
| 85 | writel(0, base + L2X0_CACHE_SYNC); | 85 | writel_relaxed(0, base + L2X0_CACHE_SYNC); |
| 86 | ux500_cache_wait(base + L2X0_CACHE_SYNC, 1); | 86 | ux500_cache_wait(base + L2X0_CACHE_SYNC, 1); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| @@ -107,7 +107,7 @@ static void ux500_l2x0_inv_all(void) | |||
| 107 | uint32_t l2x0_way_mask = (1<<16) - 1; /* Bitmask of active ways */ | 107 | uint32_t l2x0_way_mask = (1<<16) - 1; /* Bitmask of active ways */ |
| 108 | 108 | ||
| 109 | /* invalidate all ways */ | 109 | /* invalidate all ways */ |
| 110 | writel(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); | 110 | writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); |
| 111 | ux500_cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); | 111 | ux500_cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); |
| 112 | ux500_cache_sync(); | 112 | ux500_cache_sync(); |
| 113 | } | 113 | } |
diff --git a/arch/arm/mach-ux500/headsmp.S b/arch/arm/mach-ux500/headsmp.S index a6be2cdf2b2f..64fa451edcfd 100644 --- a/arch/arm/mach-ux500/headsmp.S +++ b/arch/arm/mach-ux500/headsmp.S | |||
| @@ -23,7 +23,6 @@ ENTRY(u8500_secondary_startup) | |||
| 23 | ldmia r4, {r5, r6} | 23 | ldmia r4, {r5, r6} |
| 24 | sub r4, r4, r5 | 24 | sub r4, r4, r5 |
| 25 | add r6, r6, r4 | 25 | add r6, r6, r4 |
| 26 | dsb | ||
| 27 | pen: ldr r7, [r6] | 26 | pen: ldr r7, [r6] |
| 28 | cmp r7, r0 | 27 | cmp r7, r0 |
| 29 | bne pen | 28 | bne pen |
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c index b782a03024be..dd8037ebccf8 100644 --- a/arch/arm/mach-ux500/hotplug.c +++ b/arch/arm/mach-ux500/hotplug.c | |||
| @@ -11,14 +11,11 @@ | |||
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
| 13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
| 14 | #include <linux/completion.h> | ||
| 15 | 14 | ||
| 16 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
| 17 | 16 | ||
| 18 | extern volatile int pen_release; | 17 | extern volatile int pen_release; |
| 19 | 18 | ||
| 20 | static DECLARE_COMPLETION(cpu_killed); | ||
| 21 | |||
| 22 | static inline void platform_do_lowpower(unsigned int cpu) | 19 | static inline void platform_do_lowpower(unsigned int cpu) |
| 23 | { | 20 | { |
| 24 | flush_cache_all(); | 21 | flush_cache_all(); |
| @@ -38,7 +35,7 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
| 38 | 35 | ||
| 39 | int platform_cpu_kill(unsigned int cpu) | 36 | int platform_cpu_kill(unsigned int cpu) |
| 40 | { | 37 | { |
| 41 | return wait_for_completion_timeout(&cpu_killed, 5000); | 38 | return 1; |
| 42 | } | 39 | } |
| 43 | 40 | ||
| 44 | /* | 41 | /* |
| @@ -48,19 +45,6 @@ int platform_cpu_kill(unsigned int cpu) | |||
| 48 | */ | 45 | */ |
| 49 | void platform_cpu_die(unsigned int cpu) | 46 | void platform_cpu_die(unsigned int cpu) |
| 50 | { | 47 | { |
| 51 | #ifdef DEBUG | ||
| 52 | unsigned int this_cpu = hard_smp_processor_id(); | ||
| 53 | |||
| 54 | if (cpu != this_cpu) { | ||
| 55 | printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n", | ||
| 56 | this_cpu, cpu); | ||
| 57 | BUG(); | ||
| 58 | } | ||
| 59 | #endif | ||
| 60 | |||
| 61 | printk(KERN_NOTICE "CPU%u: shutdown\n", cpu); | ||
| 62 | complete(&cpu_killed); | ||
| 63 | |||
| 64 | /* directly enter low power state, skipping secure registers */ | 48 | /* directly enter low power state, skipping secure registers */ |
| 65 | platform_do_lowpower(cpu); | 49 | platform_do_lowpower(cpu); |
| 66 | } | 50 | } |
diff --git a/arch/arm/mach-ux500/include/mach/smp.h b/arch/arm/mach-ux500/include/mach/smp.h index 197e8417375e..ca2b15b1b3b1 100644 --- a/arch/arm/mach-ux500/include/mach/smp.h +++ b/arch/arm/mach-ux500/include/mach/smp.h | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #define ASMARM_ARCH_SMP_H | 10 | #define ASMARM_ARCH_SMP_H |
| 11 | 11 | ||
| 12 | #include <asm/hardware/gic.h> | 12 | #include <asm/hardware/gic.h> |
| 13 | #include <asm/smp_mpidr.h> | ||
| 14 | 13 | ||
| 15 | /* This is required to wakeup the secondary core */ | 14 | /* This is required to wakeup the secondary core */ |
| 16 | extern void u8500_secondary_startup(void); | 15 | extern void u8500_secondary_startup(void); |
| @@ -18,8 +17,8 @@ extern void u8500_secondary_startup(void); | |||
| 18 | /* | 17 | /* |
| 19 | * We use IRQ1 as the IPI | 18 | * We use IRQ1 as the IPI |
| 20 | */ | 19 | */ |
| 21 | static inline void smp_cross_call(const struct cpumask *mask) | 20 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
| 22 | { | 21 | { |
| 23 | gic_raise_softirq(mask, 1); | 22 | gic_raise_softirq(mask, ipi); |
| 24 | } | 23 | } |
| 25 | #endif | 24 | #endif |
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index 9e4c678de785..f71175a766d7 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
| 19 | 19 | ||
| 20 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
| 21 | #include <asm/localtimer.h> | ||
| 22 | #include <asm/smp_scu.h> | 21 | #include <asm/smp_scu.h> |
| 23 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
| 24 | 23 | ||
| @@ -28,17 +27,23 @@ | |||
| 28 | */ | 27 | */ |
| 29 | volatile int __cpuinitdata pen_release = -1; | 28 | volatile int __cpuinitdata pen_release = -1; |
| 30 | 29 | ||
| 31 | static unsigned int __init get_core_count(void) | 30 | /* |
| 31 | * Write pen_release in a way that is guaranteed to be visible to all | ||
| 32 | * observers, irrespective of whether they're taking part in coherency | ||
| 33 | * or not. This is necessary for the hotplug code to work reliably. | ||
| 34 | */ | ||
| 35 | static void write_pen_release(int val) | ||
| 32 | { | 36 | { |
| 33 | return scu_get_core_count(__io_address(UX500_SCU_BASE)); | 37 | pen_release = val; |
| 38 | smp_wmb(); | ||
| 39 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
| 40 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
| 34 | } | 41 | } |
| 35 | 42 | ||
| 36 | static DEFINE_SPINLOCK(boot_lock); | 43 | static DEFINE_SPINLOCK(boot_lock); |
| 37 | 44 | ||
| 38 | void __cpuinit platform_secondary_init(unsigned int cpu) | 45 | void __cpuinit platform_secondary_init(unsigned int cpu) |
| 39 | { | 46 | { |
| 40 | trace_hardirqs_off(); | ||
| 41 | |||
| 42 | /* | 47 | /* |
| 43 | * if any interrupts are already enabled for the primary | 48 | * if any interrupts are already enabled for the primary |
| 44 | * core (e.g. timer irq), then they will not have been enabled | 49 | * core (e.g. timer irq), then they will not have been enabled |
| @@ -50,7 +55,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
| 50 | * let the primary processor know we're out of the | 55 | * let the primary processor know we're out of the |
| 51 | * pen, then head off into the C entry point | 56 | * pen, then head off into the C entry point |
| 52 | */ | 57 | */ |
| 53 | pen_release = -1; | 58 | write_pen_release(-1); |
| 54 | 59 | ||
| 55 | /* | 60 | /* |
| 56 | * Synchronise with the boot thread. | 61 | * Synchronise with the boot thread. |
| @@ -74,11 +79,9 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 74 | * the holding pen - release it, then wait for it to flag | 79 | * the holding pen - release it, then wait for it to flag |
| 75 | * that it has been released by resetting pen_release. | 80 | * that it has been released by resetting pen_release. |
| 76 | */ | 81 | */ |
| 77 | pen_release = cpu; | 82 | write_pen_release(cpu); |
| 78 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
| 79 | outer_clean_range(__pa(&pen_release), __pa(&pen_release) + 1); | ||
| 80 | 83 | ||
| 81 | smp_cross_call(cpumask_of(cpu)); | 84 | smp_cross_call(cpumask_of(cpu), 1); |
| 82 | 85 | ||
| 83 | timeout = jiffies + (1 * HZ); | 86 | timeout = jiffies + (1 * HZ); |
| 84 | while (time_before(jiffies, timeout)) { | 87 | while (time_before(jiffies, timeout)) { |
| @@ -97,9 +100,6 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 97 | 100 | ||
| 98 | static void __init wakeup_secondary(void) | 101 | static void __init wakeup_secondary(void) |
| 99 | { | 102 | { |
| 100 | /* nobody is to be released from the pen yet */ | ||
| 101 | pen_release = -1; | ||
| 102 | |||
| 103 | /* | 103 | /* |
| 104 | * write the address of secondary startup into the backup ram register | 104 | * write the address of secondary startup into the backup ram register |
| 105 | * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the | 105 | * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the |
| @@ -126,40 +126,26 @@ static void __init wakeup_secondary(void) | |||
| 126 | */ | 126 | */ |
| 127 | void __init smp_init_cpus(void) | 127 | void __init smp_init_cpus(void) |
| 128 | { | 128 | { |
| 129 | unsigned int i, ncores = get_core_count(); | 129 | unsigned int i, ncores; |
| 130 | 130 | ||
| 131 | for (i = 0; i < ncores; i++) | 131 | ncores = scu_get_core_count(__io_address(UX500_SCU_BASE)); |
| 132 | set_cpu_possible(i, true); | ||
| 133 | } | ||
| 134 | |||
| 135 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
| 136 | { | ||
| 137 | unsigned int ncores = get_core_count(); | ||
| 138 | unsigned int cpu = smp_processor_id(); | ||
| 139 | int i; | ||
| 140 | 132 | ||
| 141 | /* sanity check */ | 133 | /* sanity check */ |
| 142 | if (ncores == 0) { | 134 | if (ncores > NR_CPUS) { |
| 143 | printk(KERN_ERR | ||
| 144 | "U8500: strange CM count of 0? Default to 1\n"); | ||
| 145 | ncores = 1; | ||
| 146 | } | ||
| 147 | |||
| 148 | if (ncores > num_possible_cpus()) { | ||
| 149 | printk(KERN_WARNING | 135 | printk(KERN_WARNING |
| 150 | "U8500: no. of cores (%d) greater than configured " | 136 | "U8500: no. of cores (%d) greater than configured " |
| 151 | "maximum of %d - clipping\n", | 137 | "maximum of %d - clipping\n", |
| 152 | ncores, num_possible_cpus()); | 138 | ncores, NR_CPUS); |
| 153 | ncores = num_possible_cpus(); | 139 | ncores = NR_CPUS; |
| 154 | } | 140 | } |
| 155 | 141 | ||
| 156 | smp_store_cpu_info(cpu); | 142 | for (i = 0; i < ncores; i++) |
| 143 | set_cpu_possible(i, true); | ||
| 144 | } | ||
| 157 | 145 | ||
| 158 | /* | 146 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
| 159 | * are we trying to boot more cores than exist? | 147 | { |
| 160 | */ | 148 | int i; |
| 161 | if (max_cpus > ncores) | ||
| 162 | max_cpus = ncores; | ||
| 163 | 149 | ||
| 164 | /* | 150 | /* |
| 165 | * Initialise the present map, which describes the set of CPUs | 151 | * Initialise the present map, which describes the set of CPUs |
| @@ -168,13 +154,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 168 | for (i = 0; i < max_cpus; i++) | 154 | for (i = 0; i < max_cpus; i++) |
| 169 | set_cpu_present(i, true); | 155 | set_cpu_present(i, true); |
| 170 | 156 | ||
| 171 | if (max_cpus > 1) { | 157 | scu_enable(__io_address(UX500_SCU_BASE)); |
| 172 | /* | 158 | wakeup_secondary(); |
| 173 | * Enable the local timer or broadcast device for the | ||
| 174 | * boot CPU, but only if we have more than one CPU. | ||
| 175 | */ | ||
| 176 | percpu_timer_setup(); | ||
| 177 | scu_enable(__io_address(UX500_SCU_BASE)); | ||
| 178 | wakeup_secondary(); | ||
| 179 | } | ||
| 180 | } | 159 | } |
diff --git a/arch/arm/mach-versatile/include/mach/vmalloc.h b/arch/arm/mach-versatile/include/mach/vmalloc.h index ebd8a2543d3b..7d8e069ad51b 100644 --- a/arch/arm/mach-versatile/include/mach/vmalloc.h +++ b/arch/arm/mach-versatile/include/mach/vmalloc.h | |||
| @@ -18,4 +18,4 @@ | |||
| 18 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | */ | 20 | */ |
| 21 | #define VMALLOC_END 0xd8000000 | 21 | #define VMALLOC_END 0xd8000000UL |
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile index 1b71b77ade22..2c0ac7de2814 100644 --- a/arch/arm/mach-vexpress/Makefile +++ b/arch/arm/mach-vexpress/Makefile | |||
| @@ -5,4 +5,5 @@ | |||
| 5 | obj-y := v2m.o | 5 | obj-y := v2m.o |
| 6 | obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o | 6 | obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o |
| 7 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 7 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
| 8 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | ||
| 8 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o | 9 | obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o |
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c index 26a02eb57571..f4455e3ed6a4 100644 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ b/arch/arm/mach-vexpress/ct-ca9x4.c | |||
| @@ -53,7 +53,9 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = { | |||
| 53 | 53 | ||
| 54 | static void __init ct_ca9x4_map_io(void) | 54 | static void __init ct_ca9x4_map_io(void) |
| 55 | { | 55 | { |
| 56 | #ifdef CONFIG_LOCAL_TIMERS | ||
| 56 | twd_base = MMIO_P2V(A9_MPCORE_TWD); | 57 | twd_base = MMIO_P2V(A9_MPCORE_TWD); |
| 58 | #endif | ||
| 57 | v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); | 59 | v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); |
| 58 | } | 60 | } |
| 59 | 61 | ||
diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c new file mode 100644 index 000000000000..ea4cbfb90a66 --- /dev/null +++ b/arch/arm/mach-vexpress/hotplug.c | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-realview/hotplug.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 ARM Ltd. | ||
| 5 | * All Rights Reserved | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | #include <linux/kernel.h> | ||
| 12 | #include <linux/errno.h> | ||
| 13 | #include <linux/smp.h> | ||
| 14 | |||
| 15 | #include <asm/cacheflush.h> | ||
| 16 | |||
| 17 | extern volatile int pen_release; | ||
| 18 | |||
| 19 | static inline void cpu_enter_lowpower(void) | ||
| 20 | { | ||
| 21 | unsigned int v; | ||
| 22 | |||
| 23 | flush_cache_all(); | ||
| 24 | asm volatile( | ||
| 25 | "mcr p15, 0, %1, c7, c5, 0\n" | ||
| 26 | " mcr p15, 0, %1, c7, c10, 4\n" | ||
| 27 | /* | ||
| 28 | * Turn off coherency | ||
| 29 | */ | ||
| 30 | " mrc p15, 0, %0, c1, c0, 1\n" | ||
| 31 | " bic %0, %0, %3\n" | ||
| 32 | " mcr p15, 0, %0, c1, c0, 1\n" | ||
| 33 | " mrc p15, 0, %0, c1, c0, 0\n" | ||
| 34 | " bic %0, %0, %2\n" | ||
| 35 | " mcr p15, 0, %0, c1, c0, 0\n" | ||
| 36 | : "=&r" (v) | ||
| 37 | : "r" (0), "Ir" (CR_C), "Ir" (0x40) | ||
| 38 | : "cc"); | ||
| 39 | } | ||
| 40 | |||
| 41 | static inline void cpu_leave_lowpower(void) | ||
| 42 | { | ||
| 43 | unsigned int v; | ||
| 44 | |||
| 45 | asm volatile( | ||
| 46 | "mrc p15, 0, %0, c1, c0, 0\n" | ||
| 47 | " orr %0, %0, %1\n" | ||
| 48 | " mcr p15, 0, %0, c1, c0, 0\n" | ||
| 49 | " mrc p15, 0, %0, c1, c0, 1\n" | ||
| 50 | " orr %0, %0, %2\n" | ||
| 51 | " mcr p15, 0, %0, c1, c0, 1\n" | ||
| 52 | : "=&r" (v) | ||
| 53 | : "Ir" (CR_C), "Ir" (0x40) | ||
| 54 | : "cc"); | ||
| 55 | } | ||
| 56 | |||
| 57 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) | ||
| 58 | { | ||
| 59 | /* | ||
| 60 | * there is no power-control hardware on this platform, so all | ||
| 61 | * we can do is put the core into WFI; this is safe as the calling | ||
| 62 | * code will have already disabled interrupts | ||
| 63 | */ | ||
| 64 | for (;;) { | ||
| 65 | /* | ||
| 66 | * here's the WFI | ||
| 67 | */ | ||
| 68 | asm(".word 0xe320f003\n" | ||
| 69 | : | ||
| 70 | : | ||
| 71 | : "memory", "cc"); | ||
| 72 | |||
| 73 | if (pen_release == cpu) { | ||
| 74 | /* | ||
| 75 | * OK, proper wakeup, we're done | ||
| 76 | */ | ||
| 77 | break; | ||
| 78 | } | ||
| 79 | |||
| 80 | /* | ||
| 81 | * Getting here, means that we have come out of WFI without | ||
| 82 | * having been woken up - this shouldn't happen | ||
| 83 | * | ||
| 84 | * Just note it happening - when we're woken, we can report | ||
| 85 | * its occurrence. | ||
| 86 | */ | ||
| 87 | (*spurious)++; | ||
| 88 | } | ||
| 89 | } | ||
| 90 | |||
| 91 | int platform_cpu_kill(unsigned int cpu) | ||
| 92 | { | ||
| 93 | return 1; | ||
| 94 | } | ||
| 95 | |||
| 96 | /* | ||
| 97 | * platform-specific code to shutdown a CPU | ||
| 98 | * | ||
| 99 | * Called with IRQs disabled | ||
| 100 | */ | ||
| 101 | void platform_cpu_die(unsigned int cpu) | ||
| 102 | { | ||
| 103 | int spurious = 0; | ||
| 104 | |||
| 105 | /* | ||
| 106 | * we're ready for shutdown now, so do it | ||
| 107 | */ | ||
| 108 | cpu_enter_lowpower(); | ||
| 109 | platform_do_lowpower(cpu, &spurious); | ||
| 110 | |||
| 111 | /* | ||
| 112 | * bring this CPU back into the world of cache | ||
| 113 | * coherency, and then restore interrupts | ||
| 114 | */ | ||
| 115 | cpu_leave_lowpower(); | ||
| 116 | |||
| 117 | if (spurious) | ||
| 118 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
| 119 | } | ||
| 120 | |||
| 121 | int platform_cpu_disable(unsigned int cpu) | ||
| 122 | { | ||
| 123 | /* | ||
| 124 | * we don't allow CPU 0 to be shutdown (it is still too special | ||
| 125 | * e.g. clock tick interrupts) | ||
| 126 | */ | ||
| 127 | return cpu == 0 ? -EPERM : 0; | ||
| 128 | } | ||
diff --git a/arch/arm/mach-vexpress/include/mach/smp.h b/arch/arm/mach-vexpress/include/mach/smp.h index 5a6da4fd247e..4c05e4a9713a 100644 --- a/arch/arm/mach-vexpress/include/mach/smp.h +++ b/arch/arm/mach-vexpress/include/mach/smp.h | |||
| @@ -2,13 +2,12 @@ | |||
| 2 | #define __MACH_SMP_H | 2 | #define __MACH_SMP_H |
| 3 | 3 | ||
| 4 | #include <asm/hardware/gic.h> | 4 | #include <asm/hardware/gic.h> |
| 5 | #include <asm/smp_mpidr.h> | ||
| 6 | 5 | ||
| 7 | /* | 6 | /* |
| 8 | * We use IRQ1 as the IPI | 7 | * We use IRQ1 as the IPI |
| 9 | */ | 8 | */ |
| 10 | static inline void smp_cross_call(const struct cpumask *mask) | 9 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
| 11 | { | 10 | { |
| 12 | gic_raise_softirq(mask, 1); | 11 | gic_raise_softirq(mask, ipi); |
| 13 | } | 12 | } |
| 14 | #endif | 13 | #endif |
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c index 670970699ba9..8ce9fef29555 100644 --- a/arch/arm/mach-vexpress/platsmp.c +++ b/arch/arm/mach-vexpress/platsmp.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
| 18 | 18 | ||
| 19 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
| 20 | #include <asm/localtimer.h> | ||
| 21 | #include <asm/smp_scu.h> | 20 | #include <asm/smp_scu.h> |
| 22 | #include <asm/unified.h> | 21 | #include <asm/unified.h> |
| 23 | 22 | ||
| @@ -35,6 +34,19 @@ extern void vexpress_secondary_startup(void); | |||
| 35 | */ | 34 | */ |
| 36 | volatile int __cpuinitdata pen_release = -1; | 35 | volatile int __cpuinitdata pen_release = -1; |
| 37 | 36 | ||
| 37 | /* | ||
| 38 | * Write pen_release in a way that is guaranteed to be visible to all | ||
| 39 | * observers, irrespective of whether they're taking part in coherency | ||
| 40 | * or not. This is necessary for the hotplug code to work reliably. | ||
| 41 | */ | ||
| 42 | static void write_pen_release(int val) | ||
| 43 | { | ||
| 44 | pen_release = val; | ||
| 45 | smp_wmb(); | ||
| 46 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
| 47 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
| 48 | } | ||
| 49 | |||
| 38 | static void __iomem *scu_base_addr(void) | 50 | static void __iomem *scu_base_addr(void) |
| 39 | { | 51 | { |
| 40 | return MMIO_P2V(A9_MPCORE_SCU); | 52 | return MMIO_P2V(A9_MPCORE_SCU); |
| @@ -44,8 +56,6 @@ static DEFINE_SPINLOCK(boot_lock); | |||
| 44 | 56 | ||
| 45 | void __cpuinit platform_secondary_init(unsigned int cpu) | 57 | void __cpuinit platform_secondary_init(unsigned int cpu) |
| 46 | { | 58 | { |
| 47 | trace_hardirqs_off(); | ||
| 48 | |||
| 49 | /* | 59 | /* |
| 50 | * if any interrupts are already enabled for the primary | 60 | * if any interrupts are already enabled for the primary |
| 51 | * core (e.g. timer irq), then they will not have been enabled | 61 | * core (e.g. timer irq), then they will not have been enabled |
| @@ -57,8 +67,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
| 57 | * let the primary processor know we're out of the | 67 | * let the primary processor know we're out of the |
| 58 | * pen, then head off into the C entry point | 68 | * pen, then head off into the C entry point |
| 59 | */ | 69 | */ |
| 60 | pen_release = -1; | 70 | write_pen_release(-1); |
| 61 | smp_wmb(); | ||
| 62 | 71 | ||
| 63 | /* | 72 | /* |
| 64 | * Synchronise with the boot thread. | 73 | * Synchronise with the boot thread. |
| @@ -83,16 +92,14 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 83 | * since we haven't sent them a soft interrupt, they shouldn't | 92 | * since we haven't sent them a soft interrupt, they shouldn't |
| 84 | * be there. | 93 | * be there. |
| 85 | */ | 94 | */ |
| 86 | pen_release = cpu; | 95 | write_pen_release(cpu); |
| 87 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
| 88 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
| 89 | 96 | ||
| 90 | /* | 97 | /* |
| 91 | * Send the secondary CPU a soft interrupt, thereby causing | 98 | * Send the secondary CPU a soft interrupt, thereby causing |
| 92 | * the boot monitor to read the system wide flags register, | 99 | * the boot monitor to read the system wide flags register, |
| 93 | * and branch to the address found there. | 100 | * and branch to the address found there. |
| 94 | */ | 101 | */ |
| 95 | smp_cross_call(cpumask_of(cpu)); | 102 | smp_cross_call(cpumask_of(cpu), 1); |
| 96 | 103 | ||
| 97 | timeout = jiffies + (1 * HZ); | 104 | timeout = jiffies + (1 * HZ); |
| 98 | while (time_before(jiffies, timeout)) { | 105 | while (time_before(jiffies, timeout)) { |
| @@ -124,13 +131,6 @@ void __init smp_init_cpus(void) | |||
| 124 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; | 131 | ncores = scu_base ? scu_get_core_count(scu_base) : 1; |
| 125 | 132 | ||
| 126 | /* sanity check */ | 133 | /* sanity check */ |
| 127 | if (ncores == 0) { | ||
| 128 | printk(KERN_ERR | ||
| 129 | "vexpress: strange CM count of 0? Default to 1\n"); | ||
| 130 | |||
| 131 | ncores = 1; | ||
| 132 | } | ||
| 133 | |||
| 134 | if (ncores > NR_CPUS) { | 134 | if (ncores > NR_CPUS) { |
| 135 | printk(KERN_WARNING | 135 | printk(KERN_WARNING |
| 136 | "vexpress: no. of cores (%d) greater than configured " | 136 | "vexpress: no. of cores (%d) greater than configured " |
| @@ -143,20 +143,10 @@ void __init smp_init_cpus(void) | |||
| 143 | set_cpu_possible(i, true); | 143 | set_cpu_possible(i, true); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | void __init smp_prepare_cpus(unsigned int max_cpus) | 146 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
| 147 | { | 147 | { |
| 148 | unsigned int ncores = num_possible_cpus(); | ||
| 149 | unsigned int cpu = smp_processor_id(); | ||
| 150 | int i; | 148 | int i; |
| 151 | 149 | ||
| 152 | smp_store_cpu_info(cpu); | ||
| 153 | |||
| 154 | /* | ||
| 155 | * are we trying to boot more cores than exist? | ||
| 156 | */ | ||
| 157 | if (max_cpus > ncores) | ||
| 158 | max_cpus = ncores; | ||
| 159 | |||
| 160 | /* | 150 | /* |
| 161 | * Initialise the present map, which describes the set of CPUs | 151 | * Initialise the present map, which describes the set of CPUs |
| 162 | * actually populated at the present time. | 152 | * actually populated at the present time. |
| @@ -164,27 +154,15 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 164 | for (i = 0; i < max_cpus; i++) | 154 | for (i = 0; i < max_cpus; i++) |
| 165 | set_cpu_present(i, true); | 155 | set_cpu_present(i, true); |
| 166 | 156 | ||
| 157 | scu_enable(scu_base_addr()); | ||
| 158 | |||
| 167 | /* | 159 | /* |
| 168 | * Initialise the SCU if there are more than one CPU and let | 160 | * Write the address of secondary startup into the |
| 169 | * them know where to start. | 161 | * system-wide flags register. The boot monitor waits |
| 162 | * until it receives a soft interrupt, and then the | ||
| 163 | * secondary CPU branches to this address. | ||
| 170 | */ | 164 | */ |
| 171 | if (max_cpus > 1) { | 165 | writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR)); |
| 172 | /* | 166 | writel(BSYM(virt_to_phys(vexpress_secondary_startup)), |
| 173 | * Enable the local timer or broadcast device for the | 167 | MMIO_P2V(V2M_SYS_FLAGSSET)); |
| 174 | * boot CPU, but only if we have more than one CPU. | ||
| 175 | */ | ||
| 176 | percpu_timer_setup(); | ||
| 177 | |||
| 178 | scu_enable(scu_base_addr()); | ||
| 179 | |||
| 180 | /* | ||
| 181 | * Write the address of secondary startup into the | ||
| 182 | * system-wide flags register. The boot monitor waits | ||
| 183 | * until it receives a soft interrupt, and then the | ||
| 184 | * secondary CPU branches to this address. | ||
| 185 | */ | ||
| 186 | writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR)); | ||
| 187 | writel(BSYM(virt_to_phys(vexpress_secondary_startup)), | ||
| 188 | MMIO_P2V(V2M_SYS_FLAGSSET)); | ||
| 189 | } | ||
| 190 | } | 168 | } |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 85f9361f3e02..e24fe6d9c712 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
| @@ -198,7 +198,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot) | |||
| 198 | * fragmentation of the DMA space, and also prevents allocations | 198 | * fragmentation of the DMA space, and also prevents allocations |
| 199 | * smaller than a section from crossing a section boundary. | 199 | * smaller than a section from crossing a section boundary. |
| 200 | */ | 200 | */ |
| 201 | bit = fls(size - 1) + 1; | 201 | bit = fls(size - 1); |
| 202 | if (bit > SECTION_SHIFT) | 202 | if (bit > SECTION_SHIFT) |
| 203 | bit = SECTION_SHIFT; | 203 | bit = SECTION_SHIFT; |
| 204 | align = 1 << bit; | 204 | align = 1 << bit; |
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c index 02d989018059..3a705c7877dd 100644 --- a/arch/arm/plat-mxc/devices/platform-imx-dma.c +++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c | |||
| @@ -12,15 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <mach/hardware.h> | 13 | #include <mach/hardware.h> |
| 14 | #include <mach/devices-common.h> | 14 | #include <mach/devices-common.h> |
| 15 | #ifdef SDMA_IS_MERGED | ||
| 16 | #include <mach/sdma.h> | 15 | #include <mach/sdma.h> |
| 17 | #else | ||
| 18 | struct sdma_platform_data { | ||
| 19 | int sdma_version; | ||
| 20 | char *cpu_name; | ||
| 21 | int to_version; | ||
| 22 | }; | ||
| 23 | #endif | ||
| 24 | 16 | ||
| 25 | struct imx_imx_sdma_data { | 17 | struct imx_imx_sdma_data { |
| 26 | resource_size_t iobase; | 18 | resource_size_t iobase; |
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c index e48340ec331e..17f724c9452d 100644 --- a/arch/arm/plat-mxc/devices/platform-spi_imx.c +++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c | |||
| @@ -27,6 +27,7 @@ const struct imx_spi_imx_data imx21_cspi_data[] __initconst = { | |||
| 27 | imx_spi_imx_data_entry(MX21, CSPI, "imx21-cspi", _id, _hwid, SZ_4K) | 27 | imx_spi_imx_data_entry(MX21, CSPI, "imx21-cspi", _id, _hwid, SZ_4K) |
| 28 | imx21_cspi_data_entry(0, 1), | 28 | imx21_cspi_data_entry(0, 1), |
| 29 | imx21_cspi_data_entry(1, 2), | 29 | imx21_cspi_data_entry(1, 2), |
| 30 | }; | ||
| 30 | #endif | 31 | #endif |
| 31 | 32 | ||
| 32 | #ifdef CONFIG_ARCH_MX25 | 33 | #ifdef CONFIG_ARCH_MX25 |
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index aedf9c1d645e..63cdc6025bd7 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2008 STMicroelectronics | 4 | * Copyright (C) 2008 STMicroelectronics |
| 5 | * Copyright (C) 2010 Alessandro Rubini | 5 | * Copyright (C) 2010 Alessandro Rubini |
| 6 | * Copyright (C) 2010 Linus Walleij for ST-Ericsson | ||
| 6 | * | 7 | * |
| 7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2, as | 9 | * it under the terms of the GNU General Public License version 2, as |
| @@ -16,11 +17,13 @@ | |||
| 16 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
| 17 | #include <linux/jiffies.h> | 18 | #include <linux/jiffies.h> |
| 18 | #include <linux/err.h> | 19 | #include <linux/err.h> |
| 20 | #include <linux/cnt32_to_63.h> | ||
| 21 | #include <linux/timer.h> | ||
| 19 | #include <asm/mach/time.h> | 22 | #include <asm/mach/time.h> |
| 20 | 23 | ||
| 21 | #include <plat/mtu.h> | 24 | #include <plat/mtu.h> |
| 22 | 25 | ||
| 23 | void __iomem *mtu_base; /* ssigned by machine code */ | 26 | void __iomem *mtu_base; /* Assigned by machine code */ |
| 24 | 27 | ||
| 25 | /* | 28 | /* |
| 26 | * Kernel assumes that sched_clock can be called early | 29 | * Kernel assumes that sched_clock can be called early |
| @@ -48,16 +51,82 @@ static struct clocksource nmdk_clksrc = { | |||
| 48 | /* | 51 | /* |
| 49 | * Override the global weak sched_clock symbol with this | 52 | * Override the global weak sched_clock symbol with this |
| 50 | * local implementation which uses the clocksource to get some | 53 | * local implementation which uses the clocksource to get some |
| 51 | * better resolution when scheduling the kernel. We accept that | 54 | * better resolution when scheduling the kernel. |
| 52 | * this wraps around for now, since it is just a relative time | 55 | * |
| 53 | * stamp. (Inspired by OMAP implementation.) | 56 | * Because the hardware timer period may be quite short |
| 57 | * (32.3 secs on the 133 MHz MTU timer selection on ux500) | ||
| 58 | * and because cnt32_to_63() needs to be called at least once per | ||
| 59 | * half period to work properly, a kernel keepwarm() timer is set up | ||
| 60 | * to ensure this requirement is always met. | ||
| 61 | * | ||
| 62 | * Also the sched_clock timer will wrap around at some point, | ||
| 63 | * here we set it to run continously for a year. | ||
| 54 | */ | 64 | */ |
| 65 | #define SCHED_CLOCK_MIN_WRAP 3600*24*365 | ||
| 66 | static struct timer_list cnt32_to_63_keepwarm_timer; | ||
| 67 | static u32 sched_mult; | ||
| 68 | static u32 sched_shift; | ||
| 69 | |||
| 55 | unsigned long long notrace sched_clock(void) | 70 | unsigned long long notrace sched_clock(void) |
| 56 | { | 71 | { |
| 57 | return clocksource_cyc2ns(nmdk_clksrc.read( | 72 | u64 cycles; |
| 58 | &nmdk_clksrc), | 73 | |
| 59 | nmdk_clksrc.mult, | 74 | if (unlikely(!mtu_base)) |
| 60 | nmdk_clksrc.shift); | 75 | return 0; |
| 76 | |||
| 77 | cycles = cnt32_to_63(-readl(mtu_base + MTU_VAL(0))); | ||
| 78 | /* | ||
| 79 | * sched_mult is guaranteed to be even so will | ||
| 80 | * shift out bit 63 | ||
| 81 | */ | ||
| 82 | return (cycles * sched_mult) >> sched_shift; | ||
| 83 | } | ||
| 84 | |||
| 85 | /* Just kick sched_clock every so often */ | ||
| 86 | static void cnt32_to_63_keepwarm(unsigned long data) | ||
| 87 | { | ||
| 88 | mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + data)); | ||
| 89 | (void) sched_clock(); | ||
| 90 | } | ||
| 91 | |||
| 92 | /* | ||
| 93 | * Set up a timer to keep sched_clock():s 32_to_63 algorithm warm | ||
| 94 | * once in half a 32bit timer wrap interval. | ||
| 95 | */ | ||
| 96 | static void __init nmdk_sched_clock_init(unsigned long rate) | ||
| 97 | { | ||
| 98 | u32 v; | ||
| 99 | unsigned long delta; | ||
| 100 | u64 days; | ||
| 101 | |||
| 102 | /* Find the apropriate mult and shift factors */ | ||
| 103 | clocks_calc_mult_shift(&sched_mult, &sched_shift, | ||
| 104 | rate, NSEC_PER_SEC, SCHED_CLOCK_MIN_WRAP); | ||
| 105 | /* We need to multiply by an even number to get rid of bit 63 */ | ||
| 106 | if (sched_mult & 1) | ||
| 107 | sched_mult++; | ||
| 108 | |||
| 109 | /* Let's see what we get, take max counter and scale it */ | ||
| 110 | days = (0xFFFFFFFFFFFFFFFFLLU * sched_mult) >> sched_shift; | ||
| 111 | do_div(days, NSEC_PER_SEC); | ||
| 112 | do_div(days, (3600*24)); | ||
| 113 | |||
| 114 | pr_info("sched_clock: using %d bits @ %lu Hz wrap in %lu days\n", | ||
| 115 | (64 - sched_shift), rate, (unsigned long) days); | ||
| 116 | |||
| 117 | /* | ||
| 118 | * Program a timer to kick us at half 32bit wraparound | ||
| 119 | * Formula: seconds per wrap = (2^32) / f | ||
| 120 | */ | ||
| 121 | v = 0xFFFFFFFFUL / rate; | ||
| 122 | /* We want half of the wrap time to keep cnt32_to_63 warm */ | ||
| 123 | v /= 2; | ||
| 124 | pr_debug("sched_clock: prescaled timer rate: %lu Hz, " | ||
| 125 | "initialize keepwarm timer every %d seconds\n", rate, v); | ||
| 126 | /* Convert seconds to jiffies */ | ||
| 127 | delta = msecs_to_jiffies(v*1000); | ||
| 128 | setup_timer(&cnt32_to_63_keepwarm_timer, cnt32_to_63_keepwarm, delta); | ||
| 129 | mod_timer(&cnt32_to_63_keepwarm_timer, round_jiffies(jiffies + delta)); | ||
| 61 | } | 130 | } |
| 62 | 131 | ||
| 63 | /* Clockevent device: use one-shot mode */ | 132 | /* Clockevent device: use one-shot mode */ |
| @@ -161,13 +230,15 @@ void __init nmdk_timer_init(void) | |||
| 161 | writel(0, mtu_base + MTU_BGLR(0)); | 230 | writel(0, mtu_base + MTU_BGLR(0)); |
| 162 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); | 231 | writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); |
| 163 | 232 | ||
| 164 | /* Now the scheduling clock is ready */ | 233 | /* Now the clock source is ready */ |
| 165 | nmdk_clksrc.read = nmdk_read_timer; | 234 | nmdk_clksrc.read = nmdk_read_timer; |
| 166 | 235 | ||
| 167 | if (clocksource_register(&nmdk_clksrc)) | 236 | if (clocksource_register(&nmdk_clksrc)) |
| 168 | pr_err("timer: failed to initialize clock source %s\n", | 237 | pr_err("timer: failed to initialize clock source %s\n", |
| 169 | nmdk_clksrc.name); | 238 | nmdk_clksrc.name); |
| 170 | 239 | ||
| 240 | nmdk_sched_clock_init(rate); | ||
| 241 | |||
| 171 | /* Timer 1 is used for events */ | 242 | /* Timer 1 is used for events */ |
| 172 | 243 | ||
| 173 | clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); | 244 | clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); |
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index 6f42a18b8aa4..fc819120978d 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
| @@ -284,12 +284,14 @@ void __init omap_dsp_reserve_sdram_memblock(void) | |||
| 284 | if (!size) | 284 | if (!size) |
| 285 | return; | 285 | return; |
| 286 | 286 | ||
| 287 | paddr = __memblock_alloc_base(size, SZ_1M, MEMBLOCK_REAL_LIMIT); | 287 | paddr = memblock_alloc(size, SZ_1M); |
| 288 | if (!paddr) { | 288 | if (!paddr) { |
| 289 | pr_err("%s: failed to reserve %x bytes\n", | 289 | pr_err("%s: failed to reserve %x bytes\n", |
| 290 | __func__, size); | 290 | __func__, size); |
| 291 | return; | 291 | return; |
| 292 | } | 292 | } |
| 293 | memblock_free(paddr, size); | ||
| 294 | memblock_remove(paddr, size); | ||
| 293 | 295 | ||
| 294 | omap_dsp_phys_mempool_base = paddr; | 296 | omap_dsp_phys_mempool_base = paddr; |
| 295 | } | 297 | } |
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index f5c5b8da9a87..2c2826571d45 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
| @@ -1983,6 +1983,8 @@ static int omap2_dma_handle_ch(int ch) | |||
| 1983 | 1983 | ||
| 1984 | dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(ch)); | 1984 | dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(ch)); |
| 1985 | dma_write(1 << ch, IRQSTATUS_L0); | 1985 | dma_write(1 << ch, IRQSTATUS_L0); |
| 1986 | /* read back the register to flush the write */ | ||
| 1987 | dma_read(IRQSTATUS_L0); | ||
| 1986 | 1988 | ||
| 1987 | /* If the ch is not chained then chain_id will be -1 */ | 1989 | /* If the ch is not chained then chain_id will be -1 */ |
| 1988 | if (dma_chan[ch].chain_id != -1) { | 1990 | if (dma_chan[ch].chain_id != -1) { |
diff --git a/arch/arm/plat-omap/include/plat/smp.h b/arch/arm/plat-omap/include/plat/smp.h index ecd6a488c497..7a10257909ef 100644 --- a/arch/arm/plat-omap/include/plat/smp.h +++ b/arch/arm/plat-omap/include/plat/smp.h | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #define OMAP_ARCH_SMP_H | 18 | #define OMAP_ARCH_SMP_H |
| 19 | 19 | ||
| 20 | #include <asm/hardware/gic.h> | 20 | #include <asm/hardware/gic.h> |
| 21 | #include <asm/smp_mpidr.h> | ||
| 22 | 21 | ||
| 23 | /* Needed for secondary core boot */ | 22 | /* Needed for secondary core boot */ |
| 24 | extern void omap_secondary_startup(void); | 23 | extern void omap_secondary_startup(void); |
| @@ -29,9 +28,9 @@ extern u32 omap_read_auxcoreboot0(void); | |||
| 29 | /* | 28 | /* |
| 30 | * We use Soft IRQ1 as the IPI | 29 | * We use Soft IRQ1 as the IPI |
| 31 | */ | 30 | */ |
| 32 | static inline void smp_cross_call(const struct cpumask *mask) | 31 | static inline void smp_cross_call(const struct cpumask *mask, int ipi) |
| 33 | { | 32 | { |
| 34 | gic_raise_softirq(mask, 1); | 33 | gic_raise_softirq(mask, ipi); |
| 35 | } | 34 | } |
| 36 | 35 | ||
| 37 | #endif | 36 | #endif |
diff --git a/arch/arm/plat-orion/include/plat/pcie.h b/arch/arm/plat-orion/include/plat/pcie.h index 3ebfef72b4e7..cc99163e73fd 100644 --- a/arch/arm/plat-orion/include/plat/pcie.h +++ b/arch/arm/plat-orion/include/plat/pcie.h | |||
| @@ -11,12 +11,15 @@ | |||
| 11 | #ifndef __PLAT_PCIE_H | 11 | #ifndef __PLAT_PCIE_H |
| 12 | #define __PLAT_PCIE_H | 12 | #define __PLAT_PCIE_H |
| 13 | 13 | ||
| 14 | struct pci_bus; | ||
| 15 | |||
| 14 | u32 orion_pcie_dev_id(void __iomem *base); | 16 | u32 orion_pcie_dev_id(void __iomem *base); |
| 15 | u32 orion_pcie_rev(void __iomem *base); | 17 | u32 orion_pcie_rev(void __iomem *base); |
| 16 | int orion_pcie_link_up(void __iomem *base); | 18 | int orion_pcie_link_up(void __iomem *base); |
| 17 | int orion_pcie_x4_mode(void __iomem *base); | 19 | int orion_pcie_x4_mode(void __iomem *base); |
| 18 | int orion_pcie_get_local_bus_nr(void __iomem *base); | 20 | int orion_pcie_get_local_bus_nr(void __iomem *base); |
| 19 | void orion_pcie_set_local_bus_nr(void __iomem *base, int nr); | 21 | void orion_pcie_set_local_bus_nr(void __iomem *base, int nr); |
| 22 | void orion_pcie_reset(void __iomem *base); | ||
| 20 | void orion_pcie_setup(void __iomem *base, | 23 | void orion_pcie_setup(void __iomem *base, |
| 21 | struct mbus_dram_target_info *dram); | 24 | struct mbus_dram_target_info *dram); |
| 22 | int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus, | 25 | int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus, |
diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c index 779553a1595e..af2d733c50b5 100644 --- a/arch/arm/plat-orion/pcie.c +++ b/arch/arm/plat-orion/pcie.c | |||
| @@ -182,11 +182,6 @@ void __init orion_pcie_setup(void __iomem *base, | |||
| 182 | u32 mask; | 182 | u32 mask; |
| 183 | 183 | ||
| 184 | /* | 184 | /* |
| 185 | * soft reset PCIe unit | ||
| 186 | */ | ||
| 187 | orion_pcie_reset(base); | ||
| 188 | |||
| 189 | /* | ||
| 190 | * Point PCIe unit MBUS decode windows to DRAM space. | 185 | * Point PCIe unit MBUS decode windows to DRAM space. |
| 191 | */ | 186 | */ |
| 192 | orion_pcie_setup_wins(base, dram); | 187 | orion_pcie_setup_wins(base, dram); |
diff --git a/arch/arm/plat-pxa/include/plat/sdhci.h b/arch/arm/plat-pxa/include/plat/sdhci.h index e49c5b6fc4e2..1ab332e37d7d 100644 --- a/arch/arm/plat-pxa/include/plat/sdhci.h +++ b/arch/arm/plat-pxa/include/plat/sdhci.h | |||
| @@ -17,6 +17,9 @@ | |||
| 17 | /* Require clock free running */ | 17 | /* Require clock free running */ |
| 18 | #define PXA_FLAG_DISABLE_CLOCK_GATING (1<<0) | 18 | #define PXA_FLAG_DISABLE_CLOCK_GATING (1<<0) |
| 19 | 19 | ||
| 20 | /* Board design supports 8-bit data on SD/SDIO BUS */ | ||
| 21 | #define PXA_FLAG_SD_8_BIT_CAPABLE_SLOT (1<<2) | ||
| 22 | |||
| 20 | /* | 23 | /* |
| 21 | * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI | 24 | * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI |
| 22 | * @max_speed: the maximum speed supported | 25 | * @max_speed: the maximum speed supported |
diff --git a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c index 9793544a6ace..704175b0573f 100644 --- a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c +++ b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c | |||
| @@ -29,8 +29,8 @@ void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi, | |||
| 29 | } else { | 29 | } else { |
| 30 | s3c_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT); | 30 | s3c_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT); |
| 31 | s3c_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT); | 31 | s3c_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT); |
| 32 | s3c_gpio_cfgpull(S3C2410_GPE(11), S3C_GPIO_PULL_NONE); | 32 | s3c_gpio_setpull(S3C2410_GPE(11), S3C_GPIO_PULL_NONE); |
| 33 | s3c_gpio_cfgpull(S3C2410_GPE(12), S3C_GPIO_PULL_NONE); | 33 | s3c_gpio_setpull(S3C2410_GPE(12), S3C_GPIO_PULL_NONE); |
| 34 | s3c_gpio_cfgpull(S3C2410_GPE(13), S3C_GPIO_PULL_NONE); | 34 | s3c_gpio_setpull(S3C2410_GPE(13), S3C_GPIO_PULL_NONE); |
| 35 | } | 35 | } |
| 36 | } | 36 | } |
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c index db9e9e477ec1..72457afd6255 100644 --- a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c +++ b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c | |||
| @@ -31,8 +31,8 @@ void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi, | |||
| 31 | } else { | 31 | } else { |
| 32 | s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); | 32 | s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); |
| 33 | s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); | 33 | s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); |
| 34 | s3c_gpio_cfgpull(S3C2410_GPD(10), S3C_GPIO_PULL_NONE); | 34 | s3c_gpio_setpull(S3C2410_GPD(10), S3C_GPIO_PULL_NONE); |
| 35 | s3c_gpio_cfgpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE); | 35 | s3c_gpio_setpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE); |
| 36 | s3c_gpio_cfgpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE); | 36 | s3c_gpio_setpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE); |
| 37 | } | 37 | } |
| 38 | } | 38 | } |
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c index 8ea663a438bb..c3972b645d13 100644 --- a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c +++ b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c | |||
| @@ -29,8 +29,8 @@ void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi, | |||
| 29 | } else { | 29 | } else { |
| 30 | s3c_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT); | 30 | s3c_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT); |
| 31 | s3c_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT); | 31 | s3c_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT); |
| 32 | s3c_gpio_cfgpull(S3C2410_GPG(5), S3C_GPIO_PULL_NONE); | 32 | s3c_gpio_setpull(S3C2410_GPG(5), S3C_GPIO_PULL_NONE); |
| 33 | s3c_gpio_cfgpull(S3C2410_GPG(6), S3C_GPIO_PULL_NONE); | 33 | s3c_gpio_setpull(S3C2410_GPG(6), S3C_GPIO_PULL_NONE); |
| 34 | s3c_gpio_cfgpull(S3C2410_GPG(7), S3C_GPIO_PULL_NONE); | 34 | s3c_gpio_setpull(S3C2410_GPG(7), S3C_GPIO_PULL_NONE); |
| 35 | } | 35 | } |
| 36 | } | 36 | } |
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 8063a322c790..0797cb528b46 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
| @@ -10,9 +10,12 @@ | |||
| 10 | */ | 10 | */ |
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/cpu.h> | ||
| 13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/notifier.h> | ||
| 14 | #include <linux/signal.h> | 16 | #include <linux/signal.h> |
| 15 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
| 18 | #include <linux/smp.h> | ||
| 16 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 17 | 20 | ||
| 18 | #include <asm/cputype.h> | 21 | #include <asm/cputype.h> |
| @@ -484,7 +487,24 @@ void vfp_flush_hwstate(struct thread_info *thread) | |||
| 484 | put_cpu(); | 487 | put_cpu(); |
| 485 | } | 488 | } |
| 486 | 489 | ||
| 487 | #include <linux/smp.h> | 490 | /* |
| 491 | * VFP hardware can lose all context when a CPU goes offline. | ||
| 492 | * Safely clear our held state when a CPU has been killed, and | ||
| 493 | * re-enable access to VFP when the CPU comes back online. | ||
| 494 | * | ||
| 495 | * Both CPU_DYING and CPU_STARTING are called on the CPU which | ||
| 496 | * is being offlined/onlined. | ||
| 497 | */ | ||
| 498 | static int vfp_hotplug(struct notifier_block *b, unsigned long action, | ||
| 499 | void *hcpu) | ||
| 500 | { | ||
| 501 | if (action == CPU_DYING || action == CPU_DYING_FROZEN) { | ||
| 502 | unsigned int cpu = (long)hcpu; | ||
| 503 | last_VFP_context[cpu] = NULL; | ||
| 504 | } else if (action == CPU_STARTING || action == CPU_STARTING_FROZEN) | ||
| 505 | vfp_enable(NULL); | ||
| 506 | return NOTIFY_OK; | ||
| 507 | } | ||
| 488 | 508 | ||
| 489 | /* | 509 | /* |
| 490 | * VFP support code initialisation. | 510 | * VFP support code initialisation. |
| @@ -514,6 +534,8 @@ static int __init vfp_init(void) | |||
| 514 | else if (vfpsid & FPSID_NODOUBLE) { | 534 | else if (vfpsid & FPSID_NODOUBLE) { |
| 515 | printk("no double precision support\n"); | 535 | printk("no double precision support\n"); |
| 516 | } else { | 536 | } else { |
| 537 | hotcpu_notifier(vfp_hotplug, 0); | ||
| 538 | |||
| 517 | smp_call_function(vfp_enable, NULL, 1); | 539 | smp_call_function(vfp_enable, NULL, 1); |
| 518 | 540 | ||
| 519 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ | 541 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ |
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index cd0c090ebc54..b407bc8ad918 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | #include <linux/smp_lock.h> | ||
| 11 | #include <linux/unistd.h> | 10 | #include <linux/unistd.h> |
| 12 | #include <linux/user.h> | 11 | #include <linux/user.h> |
| 13 | #include <linux/uaccess.h> | 12 | #include <linux/uaccess.h> |
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index 2b63b0191f52..efad12071c2e 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/stddef.h> | 19 | #include <linux/stddef.h> |
| 21 | #include <linux/unistd.h> | 20 | #include <linux/unistd.h> |
| 22 | #include <linux/ptrace.h> | 21 | #include <linux/ptrace.h> |
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index 97478138e361..933bd388efb2 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 29 | #include <linux/mm.h> | 29 | #include <linux/mm.h> |
| 30 | #include <linux/smp.h> | 30 | #include <linux/smp.h> |
| 31 | #include <linux/smp_lock.h> | ||
| 32 | #include <linux/stddef.h> | 31 | #include <linux/stddef.h> |
| 33 | #include <linux/unistd.h> | 32 | #include <linux/unistd.h> |
| 34 | #include <linux/ptrace.h> | 33 | #include <linux/ptrace.h> |
diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c index 3a078ad3aa44..331de723c676 100644 --- a/arch/ia64/hp/sim/simscsi.c +++ b/arch/ia64/hp/sim/simscsi.c | |||
| @@ -202,7 +202,7 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode) | |||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | static int | 204 | static int |
| 205 | simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) | 205 | simscsi_queuecommand_lck (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) |
| 206 | { | 206 | { |
| 207 | unsigned int target_id = sc->device->id; | 207 | unsigned int target_id = sc->device->id; |
| 208 | char fname[MAX_ROOT_LEN+16]; | 208 | char fname[MAX_ROOT_LEN+16]; |
| @@ -326,6 +326,8 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) | |||
| 326 | return 0; | 326 | return 0; |
| 327 | } | 327 | } |
| 328 | 328 | ||
| 329 | static DEF_SCSI_QCMD(simscsi_queuecommand) | ||
| 330 | |||
| 329 | static int | 331 | static int |
| 330 | simscsi_host_reset (struct scsi_cmnd *sc) | 332 | simscsi_host_reset (struct scsi_cmnd *sc) |
| 331 | { | 333 | { |
diff --git a/arch/m68k/include/asm/irqflags.h b/arch/m68k/include/asm/irqflags.h index 4a5b284a1550..7ef4115b8c4a 100644 --- a/arch/m68k/include/asm/irqflags.h +++ b/arch/m68k/include/asm/irqflags.h | |||
| @@ -2,7 +2,9 @@ | |||
| 2 | #define _M68K_IRQFLAGS_H | 2 | #define _M68K_IRQFLAGS_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #ifdef CONFIG_MMU | ||
| 5 | #include <linux/hardirq.h> | 6 | #include <linux/hardirq.h> |
| 7 | #endif | ||
| 6 | #include <linux/preempt.h> | 8 | #include <linux/preempt.h> |
| 7 | #include <asm/thread_info.h> | 9 | #include <asm/thread_info.h> |
| 8 | #include <asm/entry.h> | 10 | #include <asm/entry.h> |
diff --git a/arch/m68k/include/asm/machdep.h b/arch/m68k/include/asm/machdep.h index 789f3b2de0e9..415d5484916c 100644 --- a/arch/m68k/include/asm/machdep.h +++ b/arch/m68k/include/asm/machdep.h | |||
| @@ -40,5 +40,6 @@ extern unsigned long hw_timer_offset(void); | |||
| 40 | extern irqreturn_t arch_timer_interrupt(int irq, void *dummy); | 40 | extern irqreturn_t arch_timer_interrupt(int irq, void *dummy); |
| 41 | 41 | ||
| 42 | extern void config_BSP(char *command, int len); | 42 | extern void config_BSP(char *command, int len); |
| 43 | extern void do_IRQ(int irq, struct pt_regs *fp); | ||
| 43 | 44 | ||
| 44 | #endif /* _M68K_MACHDEP_H */ | 45 | #endif /* _M68K_MACHDEP_H */ |
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 18732ab23292..c2a1fc23dd75 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
| 19 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
| 20 | #include <linux/smp.h> | 20 | #include <linux/smp.h> |
| 21 | #include <linux/smp_lock.h> | ||
| 22 | #include <linux/stddef.h> | 21 | #include <linux/stddef.h> |
| 23 | #include <linux/unistd.h> | 22 | #include <linux/unistd.h> |
| 24 | #include <linux/ptrace.h> | 23 | #include <linux/ptrace.h> |
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c index 6d3390590e5b..e2a63af5d517 100644 --- a/arch/m68knommu/kernel/process.c +++ b/arch/m68knommu/kernel/process.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 20 | #include <linux/mm.h> | 20 | #include <linux/mm.h> |
| 21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 22 | #include <linux/smp_lock.h> | ||
| 23 | #include <linux/stddef.h> | 22 | #include <linux/stddef.h> |
| 24 | #include <linux/unistd.h> | 23 | #include <linux/unistd.h> |
| 25 | #include <linux/ptrace.h> | 24 | #include <linux/ptrace.h> |
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c index 0d0f8049a17b..e1b14a6ed544 100644 --- a/arch/mn10300/kernel/process.c +++ b/arch/mn10300/kernel/process.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
| 16 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
| 17 | #include <linux/smp_lock.h> | ||
| 18 | #include <linux/stddef.h> | 17 | #include <linux/stddef.h> |
| 19 | #include <linux/unistd.h> | 18 | #include <linux/unistd.h> |
| 20 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index ba430a03bc7a..30394081d9b6 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/namei.h> | 28 | #include <linux/namei.h> |
| 29 | #include <linux/sched.h> | 29 | #include <linux/sched.h> |
| 30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
| 31 | #include <linux/smp_lock.h> | ||
| 32 | #include <linux/syscalls.h> | 31 | #include <linux/syscalls.h> |
| 33 | #include <linux/utsname.h> | 32 | #include <linux/utsname.h> |
| 34 | #include <linux/vfs.h> | 33 | #include <linux/vfs.h> |
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index 9779ece2b070..88a0ad14a9c9 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/times.h> | 20 | #include <linux/times.h> |
| 21 | #include <linux/time.h> | 21 | #include <linux/time.h> |
| 22 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
| 23 | #include <linux/smp_lock.h> | ||
| 24 | #include <linux/sem.h> | 23 | #include <linux/sem.h> |
| 25 | #include <linux/msg.h> | 24 | #include <linux/msg.h> |
| 26 | #include <linux/shm.h> | 25 | #include <linux/shm.h> |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index b6447190e1a2..e625e9e034ae 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
| @@ -4,6 +4,10 @@ config PPC32 | |||
| 4 | bool | 4 | bool |
| 5 | default y if !PPC64 | 5 | default y if !PPC64 |
| 6 | 6 | ||
| 7 | config 32BIT | ||
| 8 | bool | ||
| 9 | default y if PPC32 | ||
| 10 | |||
| 7 | config 64BIT | 11 | config 64BIT |
| 8 | bool | 12 | bool |
| 9 | default y if PPC64 | 13 | default y if PPC64 |
diff --git a/arch/powerpc/boot/div64.S b/arch/powerpc/boot/div64.S index 722f360a32a9..d271ab542673 100644 --- a/arch/powerpc/boot/div64.S +++ b/arch/powerpc/boot/div64.S | |||
| @@ -33,9 +33,10 @@ __div64_32: | |||
| 33 | cntlzw r0,r5 # we are shifting the dividend right | 33 | cntlzw r0,r5 # we are shifting the dividend right |
| 34 | li r10,-1 # to make it < 2^32, and shifting | 34 | li r10,-1 # to make it < 2^32, and shifting |
| 35 | srw r10,r10,r0 # the divisor right the same amount, | 35 | srw r10,r10,r0 # the divisor right the same amount, |
| 36 | add r9,r4,r10 # rounding up (so the estimate cannot | 36 | addc r9,r4,r10 # rounding up (so the estimate cannot |
| 37 | andc r11,r6,r10 # ever be too large, only too small) | 37 | andc r11,r6,r10 # ever be too large, only too small) |
| 38 | andc r9,r9,r10 | 38 | andc r9,r9,r10 |
| 39 | addze r9,r9 | ||
| 39 | or r11,r5,r11 | 40 | or r11,r5,r11 |
| 40 | rotlw r9,r9,r0 | 41 | rotlw r9,r9,r0 |
| 41 | rotlw r11,r11,r0 | 42 | rotlw r11,r11,r0 |
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64f3f04..42850ee00ada 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c | |||
| @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) | |||
| 337 | /* FP registers 32 -> 63 */ | 337 | /* FP registers 32 -> 63 */ |
| 338 | #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE) | 338 | #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE) |
| 339 | if (current) | 339 | if (current) |
| 340 | memcpy(mem, current->thread.evr[regno-32], | 340 | memcpy(mem, ¤t->thread.evr[regno-32], |
| 341 | dbg_reg_def[regno].size); | 341 | dbg_reg_def[regno].size); |
| 342 | #else | 342 | #else |
| 343 | /* fp registers not used by kernel, leave zero */ | 343 | /* fp registers not used by kernel, leave zero */ |
| @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) | |||
| 362 | if (regno >= 32 && regno < 64) { | 362 | if (regno >= 32 && regno < 64) { |
| 363 | /* FP registers 32 -> 63 */ | 363 | /* FP registers 32 -> 63 */ |
| 364 | #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE) | 364 | #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE) |
| 365 | memcpy(current->thread.evr[regno-32], mem, | 365 | memcpy(¤t->thread.evr[regno-32], mem, |
| 366 | dbg_reg_def[regno].size); | 366 | dbg_reg_def[regno].size); |
| 367 | #else | 367 | #else |
| 368 | /* fp registers not used by kernel, leave zero */ | 368 | /* fp registers not used by kernel, leave zero */ |
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c index 428d0e538aec..b06bdae04064 100644 --- a/arch/powerpc/kernel/kvm.c +++ b/arch/powerpc/kernel/kvm.c | |||
| @@ -127,7 +127,7 @@ static void kvm_patch_ins_nop(u32 *inst) | |||
| 127 | 127 | ||
| 128 | static void kvm_patch_ins_b(u32 *inst, int addr) | 128 | static void kvm_patch_ins_b(u32 *inst, int addr) |
| 129 | { | 129 | { |
| 130 | #ifdef CONFIG_RELOCATABLE | 130 | #if defined(CONFIG_RELOCATABLE) && defined(CONFIG_PPC_BOOK3S) |
| 131 | /* On relocatable kernels interrupts handlers and our code | 131 | /* On relocatable kernels interrupts handlers and our code |
| 132 | can be in different regions, so we don't patch them */ | 132 | can be in different regions, so we don't patch them */ |
| 133 | 133 | ||
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 2a178b0ebcdf..ce6f61c6f871 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
| @@ -497,9 +497,8 @@ static void __init emergency_stack_init(void) | |||
| 497 | } | 497 | } |
| 498 | 498 | ||
| 499 | /* | 499 | /* |
| 500 | * Called into from start_kernel, after lock_kernel has been called. | 500 | * Called into from start_kernel this initializes bootmem, which is used |
| 501 | * Initializes bootmem, which is unsed to manage page allocation until | 501 | * to manage page allocation until mem_init is called. |
| 502 | * mem_init is called. | ||
| 503 | */ | 502 | */ |
| 504 | void __init setup_arch(char **cmdline_p) | 503 | void __init setup_arch(char **cmdline_p) |
| 505 | { | 504 | { |
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index b1b6043a56c4..4e5bf1edc0f2 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #include <linux/resource.h> | 23 | #include <linux/resource.h> |
| 24 | #include <linux/times.h> | 24 | #include <linux/times.h> |
| 25 | #include <linux/smp.h> | 25 | #include <linux/smp.h> |
| 26 | #include <linux/smp_lock.h> | ||
| 27 | #include <linux/sem.h> | 26 | #include <linux/sem.h> |
| 28 | #include <linux/msg.h> | 27 | #include <linux/msg.h> |
| 29 | #include <linux/shm.h> | 28 | #include <linux/shm.h> |
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S index 049846911ce4..1cc471faac2d 100644 --- a/arch/powerpc/kvm/booke_interrupts.S +++ b/arch/powerpc/kvm/booke_interrupts.S | |||
| @@ -416,7 +416,7 @@ lightweight_exit: | |||
| 416 | lwz r3, VCPU_PC(r4) | 416 | lwz r3, VCPU_PC(r4) |
| 417 | mtsrr0 r3 | 417 | mtsrr0 r3 |
| 418 | lwz r3, VCPU_SHARED(r4) | 418 | lwz r3, VCPU_SHARED(r4) |
| 419 | lwz r3, VCPU_SHARED_MSR(r3) | 419 | lwz r3, (VCPU_SHARED_MSR + 4)(r3) |
| 420 | oris r3, r3, KVMPPC_MSR_MASK@h | 420 | oris r3, r3, KVMPPC_MSR_MASK@h |
| 421 | ori r3, r3, KVMPPC_MSR_MASK@l | 421 | ori r3, r3, KVMPPC_MSR_MASK@l |
| 422 | mtsrr1 r3 | 422 | mtsrr1 r3 |
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c index 71750f2dd5d3..e3768ee9b595 100644 --- a/arch/powerpc/kvm/e500.c +++ b/arch/powerpc/kvm/e500.c | |||
| @@ -138,8 +138,8 @@ void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu) | |||
| 138 | struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu); | 138 | struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu); |
| 139 | 139 | ||
| 140 | free_page((unsigned long)vcpu->arch.shared); | 140 | free_page((unsigned long)vcpu->arch.shared); |
| 141 | kvmppc_e500_tlb_uninit(vcpu_e500); | ||
| 142 | kvm_vcpu_uninit(vcpu); | 141 | kvm_vcpu_uninit(vcpu); |
| 142 | kvmppc_e500_tlb_uninit(vcpu_e500); | ||
| 143 | kmem_cache_free(kvm_vcpu_cache, vcpu_e500); | 143 | kmem_cache_free(kvm_vcpu_cache, vcpu_e500); |
| 144 | } | 144 | } |
| 145 | 145 | ||
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 2f87a1627f6c..38f756f25053 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
| @@ -617,6 +617,7 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
| 617 | switch (ioctl) { | 617 | switch (ioctl) { |
| 618 | case KVM_PPC_GET_PVINFO: { | 618 | case KVM_PPC_GET_PVINFO: { |
| 619 | struct kvm_ppc_pvinfo pvinfo; | 619 | struct kvm_ppc_pvinfo pvinfo; |
| 620 | memset(&pvinfo, 0, sizeof(pvinfo)); | ||
| 620 | r = kvm_vm_ioctl_get_pvinfo(&pvinfo); | 621 | r = kvm_vm_ioctl_get_pvinfo(&pvinfo); |
| 621 | if (copy_to_user(argp, &pvinfo, sizeof(pvinfo))) { | 622 | if (copy_to_user(argp, &pvinfo, sizeof(pvinfo))) { |
| 622 | r = -EFAULT; | 623 | r = -EFAULT; |
diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c index 46fa04f12a9b..a021f5827a33 100644 --- a/arch/powerpc/kvm/timing.c +++ b/arch/powerpc/kvm/timing.c | |||
| @@ -35,7 +35,6 @@ void kvmppc_init_timing_stats(struct kvm_vcpu *vcpu) | |||
| 35 | int i; | 35 | int i; |
| 36 | 36 | ||
| 37 | /* pause guest execution to avoid concurrent updates */ | 37 | /* pause guest execution to avoid concurrent updates */ |
| 38 | local_irq_disable(); | ||
| 39 | mutex_lock(&vcpu->mutex); | 38 | mutex_lock(&vcpu->mutex); |
| 40 | 39 | ||
| 41 | vcpu->arch.last_exit_type = 0xDEAD; | 40 | vcpu->arch.last_exit_type = 0xDEAD; |
| @@ -51,7 +50,6 @@ void kvmppc_init_timing_stats(struct kvm_vcpu *vcpu) | |||
| 51 | vcpu->arch.timing_last_enter.tv64 = 0; | 50 | vcpu->arch.timing_last_enter.tv64 = 0; |
| 52 | 51 | ||
| 53 | mutex_unlock(&vcpu->mutex); | 52 | mutex_unlock(&vcpu->mutex); |
| 54 | local_irq_enable(); | ||
| 55 | } | 53 | } |
| 56 | 54 | ||
| 57 | static void add_exit_timing(struct kvm_vcpu *vcpu, u64 duration, int type) | 55 | static void add_exit_timing(struct kvm_vcpu *vcpu, u64 duration, int type) |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 83f534d862db..5e9584405c45 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
| @@ -1123,7 +1123,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, | |||
| 1123 | else | 1123 | else |
| 1124 | #endif /* CONFIG_PPC_HAS_HASH_64K */ | 1124 | #endif /* CONFIG_PPC_HAS_HASH_64K */ |
| 1125 | rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, | 1125 | rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, |
| 1126 | subpage_protection(pgdir, ea)); | 1126 | subpage_protection(mm, ea)); |
| 1127 | 1127 | ||
| 1128 | /* Dump some info in case of hash insertion failure, they should | 1128 | /* Dump some info in case of hash insertion failure, they should |
| 1129 | * never happen so it is really useful to know if/when they do | 1129 | * never happen so it is really useful to know if/when they do |
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index 2c7e801ab20b..6a3997f98dfb 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c | |||
| @@ -92,7 +92,7 @@ static void pte_free_rcu_callback(struct rcu_head *head) | |||
| 92 | 92 | ||
| 93 | static void pte_free_submit(struct pte_freelist_batch *batch) | 93 | static void pte_free_submit(struct pte_freelist_batch *batch) |
| 94 | { | 94 | { |
| 95 | call_rcu(&batch->rcu, pte_free_rcu_callback); | 95 | call_rcu_sched(&batch->rcu, pte_free_rcu_callback); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | void pgtable_free_tlb(struct mmu_gather *tlb, void *table, unsigned shift) | 98 | void pgtable_free_tlb(struct mmu_gather *tlb, void *table, unsigned shift) |
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S index 8b04c54e596f..8526bd9d2aa3 100644 --- a/arch/powerpc/mm/tlb_low_64e.S +++ b/arch/powerpc/mm/tlb_low_64e.S | |||
| @@ -138,8 +138,11 @@ | |||
| 138 | cmpldi cr0,r15,0 /* Check for user region */ | 138 | cmpldi cr0,r15,0 /* Check for user region */ |
| 139 | std r14,EX_TLB_ESR(r12) /* write crazy -1 to frame */ | 139 | std r14,EX_TLB_ESR(r12) /* write crazy -1 to frame */ |
| 140 | beq normal_tlb_miss | 140 | beq normal_tlb_miss |
| 141 | |||
| 142 | li r11,_PAGE_PRESENT|_PAGE_BAP_SX /* Base perm */ | ||
| 143 | oris r11,r11,_PAGE_ACCESSED@h | ||
| 141 | /* XXX replace the RMW cycles with immediate loads + writes */ | 144 | /* XXX replace the RMW cycles with immediate loads + writes */ |
| 142 | 1: mfspr r10,SPRN_MAS1 | 145 | mfspr r10,SPRN_MAS1 |
| 143 | cmpldi cr0,r15,8 /* Check for vmalloc region */ | 146 | cmpldi cr0,r15,8 /* Check for vmalloc region */ |
| 144 | rlwinm r10,r10,0,16,1 /* Clear TID */ | 147 | rlwinm r10,r10,0,16,1 /* Clear TID */ |
| 145 | mtspr SPRN_MAS1,r10 | 148 | mtspr SPRN_MAS1,r10 |
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c index 36c0c449a899..2a030d89bbc6 100644 --- a/arch/powerpc/mm/tlb_nohash.c +++ b/arch/powerpc/mm/tlb_nohash.c | |||
| @@ -585,6 +585,6 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base, | |||
| 585 | ppc64_rma_size = min_t(u64, first_memblock_size, 0x40000000); | 585 | ppc64_rma_size = min_t(u64, first_memblock_size, 0x40000000); |
| 586 | 586 | ||
| 587 | /* Finally limit subsequent allocations */ | 587 | /* Finally limit subsequent allocations */ |
| 588 | memblock_set_current_limit(ppc64_memblock_base + ppc64_rma_size); | 588 | memblock_set_current_limit(first_memblock_base + ppc64_rma_size); |
| 589 | } | 589 | } |
| 590 | #endif /* CONFIG_PPC64 */ | 590 | #endif /* CONFIG_PPC64 */ |
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index c667f0f02c34..3139814f6439 100644 --- a/arch/powerpc/platforms/pseries/Kconfig +++ b/arch/powerpc/platforms/pseries/Kconfig | |||
| @@ -47,6 +47,12 @@ config LPARCFG | |||
| 47 | config PPC_PSERIES_DEBUG | 47 | config PPC_PSERIES_DEBUG |
| 48 | depends on PPC_PSERIES && PPC_EARLY_DEBUG | 48 | depends on PPC_PSERIES && PPC_EARLY_DEBUG |
| 49 | bool "Enable extra debug logging in platforms/pseries" | 49 | bool "Enable extra debug logging in platforms/pseries" |
| 50 | help | ||
| 51 | Say Y here if you want the pseries core to produce a bunch of | ||
| 52 | debug messages to the system log. Select this if you are having a | ||
| 53 | problem with the pseries core and want to see more of what is | ||
| 54 | going on. This does not enable debugging in lpar.c, which must | ||
| 55 | be manually done due to its verbosity. | ||
| 50 | default y | 56 | default y |
| 51 | 57 | ||
| 52 | config PPC_SMLPAR | 58 | config PPC_SMLPAR |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 34b7dc12e731..17a11c82e6f8 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | * Please address comments and feedback to Linas Vepstas <linas@austin.ibm.com> | 21 | * Please address comments and feedback to Linas Vepstas <linas@austin.ibm.com> |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #undef DEBUG | ||
| 25 | |||
| 26 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
| 27 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 28 | #include <linux/list.h> | 26 | #include <linux/list.h> |
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index 4b7a062dee15..5fcc92a12d3e 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c | |||
| @@ -25,8 +25,6 @@ | |||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #undef DEBUG | ||
| 29 | |||
| 30 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
| 31 | #include <asm/pci-bridge.h> | 29 | #include <asm/pci-bridge.h> |
| 32 | #include <asm/ppc-pci.h> | 30 | #include <asm/ppc-pci.h> |
diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug index 45e0c6199f36..05221b13ffb1 100644 --- a/arch/s390/Kconfig.debug +++ b/arch/s390/Kconfig.debug | |||
| @@ -6,6 +6,18 @@ config TRACE_IRQFLAGS_SUPPORT | |||
| 6 | 6 | ||
| 7 | source "lib/Kconfig.debug" | 7 | source "lib/Kconfig.debug" |
| 8 | 8 | ||
| 9 | config STRICT_DEVMEM | ||
| 10 | def_bool y | ||
| 11 | prompt "Filter access to /dev/mem" | ||
| 12 | ---help--- | ||
| 13 | This option restricts access to /dev/mem. If this option is | ||
| 14 | disabled, you allow userspace access to all memory, including | ||
| 15 | kernel and userspace memory. Accidental memory access is likely | ||
| 16 | to be disastrous. | ||
| 17 | Memory access is required for experts who want to debug the kernel. | ||
| 18 | |||
| 19 | If you are unsure, say Y. | ||
| 20 | |||
| 9 | config DEBUG_STRICT_USER_COPY_CHECKS | 21 | config DEBUG_STRICT_USER_COPY_CHECKS |
| 10 | bool "Strict user copy size checks" | 22 | bool "Strict user copy size checks" |
| 11 | ---help--- | 23 | ---help--- |
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index a8729ea7e9ac..3c987e9ec8d6 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h | |||
| @@ -130,6 +130,11 @@ struct page; | |||
| 130 | void arch_free_page(struct page *page, int order); | 130 | void arch_free_page(struct page *page, int order); |
| 131 | void arch_alloc_page(struct page *page, int order); | 131 | void arch_alloc_page(struct page *page, int order); |
| 132 | 132 | ||
| 133 | static inline int devmem_is_allowed(unsigned long pfn) | ||
| 134 | { | ||
| 135 | return 0; | ||
| 136 | } | ||
| 137 | |||
| 133 | #define HAVE_ARCH_FREE_PAGE | 138 | #define HAVE_ARCH_FREE_PAGE |
| 134 | #define HAVE_ARCH_ALLOC_PAGE | 139 | #define HAVE_ARCH_ALLOC_PAGE |
| 135 | 140 | ||
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 1e6449c79ab6..53acaa86dd94 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <linux/resource.h> | 25 | #include <linux/resource.h> |
| 26 | #include <linux/times.h> | 26 | #include <linux/times.h> |
| 27 | #include <linux/smp.h> | 27 | #include <linux/smp.h> |
| 28 | #include <linux/smp_lock.h> | ||
| 29 | #include <linux/sem.h> | 28 | #include <linux/sem.h> |
| 30 | #include <linux/msg.h> | 29 | #include <linux/msg.h> |
| 31 | #include <linux/shm.h> | 30 | #include <linux/shm.h> |
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index d60fc4398516..2564793ec2b6 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <asm/sections.h> | 30 | #include <asm/sections.h> |
| 31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
| 32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
| 33 | #include <linux/hardirq.h> | ||
| 33 | 34 | ||
| 34 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; | 35 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; |
| 35 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 36 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
| @@ -212,7 +213,7 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | |||
| 212 | /* Set the PER control regs, turns on single step for this address */ | 213 | /* Set the PER control regs, turns on single step for this address */ |
| 213 | __ctl_load(kprobe_per_regs, 9, 11); | 214 | __ctl_load(kprobe_per_regs, 9, 11); |
| 214 | regs->psw.mask |= PSW_MASK_PER; | 215 | regs->psw.mask |= PSW_MASK_PER; |
| 215 | regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK); | 216 | regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT); |
| 216 | } | 217 | } |
| 217 | 218 | ||
| 218 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) | 219 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) |
| @@ -239,7 +240,7 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, | |||
| 239 | __get_cpu_var(current_kprobe) = p; | 240 | __get_cpu_var(current_kprobe) = p; |
| 240 | /* Save the interrupt and per flags */ | 241 | /* Save the interrupt and per flags */ |
| 241 | kcb->kprobe_saved_imask = regs->psw.mask & | 242 | kcb->kprobe_saved_imask = regs->psw.mask & |
| 242 | (PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK); | 243 | (PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT); |
| 243 | /* Save the control regs that govern PER */ | 244 | /* Save the control regs that govern PER */ |
| 244 | __ctl_store(kcb->kprobe_saved_ctl, 9, 11); | 245 | __ctl_store(kcb->kprobe_saved_ctl, 9, 11); |
| 245 | } | 246 | } |
| @@ -316,8 +317,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) | |||
| 316 | return 1; | 317 | return 1; |
| 317 | 318 | ||
| 318 | ss_probe: | 319 | ss_probe: |
| 319 | if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) | ||
| 320 | local_irq_disable(); | ||
| 321 | prepare_singlestep(p, regs); | 320 | prepare_singlestep(p, regs); |
| 322 | kcb->kprobe_status = KPROBE_HIT_SS; | 321 | kcb->kprobe_status = KPROBE_HIT_SS; |
| 323 | return 1; | 322 | return 1; |
| @@ -350,6 +349,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, | |||
| 350 | struct hlist_node *node, *tmp; | 349 | struct hlist_node *node, *tmp; |
| 351 | unsigned long flags, orig_ret_address = 0; | 350 | unsigned long flags, orig_ret_address = 0; |
| 352 | unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; | 351 | unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; |
| 352 | kprobe_opcode_t *correct_ret_addr = NULL; | ||
| 353 | 353 | ||
| 354 | INIT_HLIST_HEAD(&empty_rp); | 354 | INIT_HLIST_HEAD(&empty_rp); |
| 355 | kretprobe_hash_lock(current, &head, &flags); | 355 | kretprobe_hash_lock(current, &head, &flags); |
| @@ -372,10 +372,32 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, | |||
| 372 | /* another task is sharing our hash bucket */ | 372 | /* another task is sharing our hash bucket */ |
| 373 | continue; | 373 | continue; |
| 374 | 374 | ||
| 375 | if (ri->rp && ri->rp->handler) | 375 | orig_ret_address = (unsigned long)ri->ret_addr; |
| 376 | ri->rp->handler(ri, regs); | 376 | |
| 377 | if (orig_ret_address != trampoline_address) | ||
| 378 | /* | ||
| 379 | * This is the real return address. Any other | ||
| 380 | * instances associated with this task are for | ||
| 381 | * other calls deeper on the call stack | ||
| 382 | */ | ||
| 383 | break; | ||
| 384 | } | ||
| 385 | |||
| 386 | kretprobe_assert(ri, orig_ret_address, trampoline_address); | ||
| 387 | |||
| 388 | correct_ret_addr = ri->ret_addr; | ||
| 389 | hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { | ||
| 390 | if (ri->task != current) | ||
| 391 | /* another task is sharing our hash bucket */ | ||
| 392 | continue; | ||
| 377 | 393 | ||
| 378 | orig_ret_address = (unsigned long)ri->ret_addr; | 394 | orig_ret_address = (unsigned long)ri->ret_addr; |
| 395 | |||
| 396 | if (ri->rp && ri->rp->handler) { | ||
| 397 | ri->ret_addr = correct_ret_addr; | ||
| 398 | ri->rp->handler(ri, regs); | ||
| 399 | } | ||
| 400 | |||
| 379 | recycle_rp_inst(ri, &empty_rp); | 401 | recycle_rp_inst(ri, &empty_rp); |
| 380 | 402 | ||
| 381 | if (orig_ret_address != trampoline_address) { | 403 | if (orig_ret_address != trampoline_address) { |
| @@ -387,7 +409,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, | |||
| 387 | break; | 409 | break; |
| 388 | } | 410 | } |
| 389 | } | 411 | } |
| 390 | kretprobe_assert(ri, orig_ret_address, trampoline_address); | 412 | |
| 391 | regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE; | 413 | regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE; |
| 392 | 414 | ||
| 393 | reset_current_kprobe(); | 415 | reset_current_kprobe(); |
| @@ -465,8 +487,6 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs) | |||
| 465 | goto out; | 487 | goto out; |
| 466 | } | 488 | } |
| 467 | reset_current_kprobe(); | 489 | reset_current_kprobe(); |
| 468 | if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) | ||
| 469 | local_irq_enable(); | ||
| 470 | out: | 490 | out: |
| 471 | preempt_enable_no_resched(); | 491 | preempt_enable_no_resched(); |
| 472 | 492 | ||
| @@ -482,7 +502,7 @@ out: | |||
| 482 | return 1; | 502 | return 1; |
| 483 | } | 503 | } |
| 484 | 504 | ||
| 485 | int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | 505 | static int __kprobes kprobe_trap_handler(struct pt_regs *regs, int trapnr) |
| 486 | { | 506 | { |
| 487 | struct kprobe *cur = kprobe_running(); | 507 | struct kprobe *cur = kprobe_running(); |
| 488 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 508 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
| @@ -508,8 +528,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | |||
| 508 | restore_previous_kprobe(kcb); | 528 | restore_previous_kprobe(kcb); |
| 509 | else { | 529 | else { |
| 510 | reset_current_kprobe(); | 530 | reset_current_kprobe(); |
| 511 | if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) | ||
| 512 | local_irq_enable(); | ||
| 513 | } | 531 | } |
| 514 | preempt_enable_no_resched(); | 532 | preempt_enable_no_resched(); |
| 515 | break; | 533 | break; |
| @@ -553,6 +571,18 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | |||
| 553 | return 0; | 571 | return 0; |
| 554 | } | 572 | } |
| 555 | 573 | ||
| 574 | int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | ||
| 575 | { | ||
| 576 | int ret; | ||
| 577 | |||
| 578 | if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) | ||
| 579 | local_irq_disable(); | ||
| 580 | ret = kprobe_trap_handler(regs, trapnr); | ||
| 581 | if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) | ||
| 582 | local_irq_restore(regs->psw.mask & ~PSW_MASK_PER); | ||
| 583 | return ret; | ||
| 584 | } | ||
| 585 | |||
| 556 | /* | 586 | /* |
| 557 | * Wrapper routine to for handling exceptions. | 587 | * Wrapper routine to for handling exceptions. |
| 558 | */ | 588 | */ |
| @@ -560,8 +590,12 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
| 560 | unsigned long val, void *data) | 590 | unsigned long val, void *data) |
| 561 | { | 591 | { |
| 562 | struct die_args *args = (struct die_args *)data; | 592 | struct die_args *args = (struct die_args *)data; |
| 593 | struct pt_regs *regs = args->regs; | ||
| 563 | int ret = NOTIFY_DONE; | 594 | int ret = NOTIFY_DONE; |
| 564 | 595 | ||
| 596 | if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) | ||
| 597 | local_irq_disable(); | ||
| 598 | |||
| 565 | switch (val) { | 599 | switch (val) { |
| 566 | case DIE_BPT: | 600 | case DIE_BPT: |
| 567 | if (kprobe_handler(args->regs)) | 601 | if (kprobe_handler(args->regs)) |
| @@ -572,16 +606,17 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
| 572 | ret = NOTIFY_STOP; | 606 | ret = NOTIFY_STOP; |
| 573 | break; | 607 | break; |
| 574 | case DIE_TRAP: | 608 | case DIE_TRAP: |
| 575 | /* kprobe_running() needs smp_processor_id() */ | 609 | if (!preemptible() && kprobe_running() && |
| 576 | preempt_disable(); | 610 | kprobe_trap_handler(args->regs, args->trapnr)) |
| 577 | if (kprobe_running() && | ||
| 578 | kprobe_fault_handler(args->regs, args->trapnr)) | ||
| 579 | ret = NOTIFY_STOP; | 611 | ret = NOTIFY_STOP; |
| 580 | preempt_enable(); | ||
| 581 | break; | 612 | break; |
| 582 | default: | 613 | default: |
| 583 | break; | 614 | break; |
| 584 | } | 615 | } |
| 616 | |||
| 617 | if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) | ||
| 618 | local_irq_restore(regs->psw.mask & ~PSW_MASK_PER); | ||
| 619 | |||
| 585 | return ret; | 620 | return ret; |
| 586 | } | 621 | } |
| 587 | 622 | ||
| @@ -595,6 +630,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | |||
| 595 | 630 | ||
| 596 | /* setup return addr to the jprobe handler routine */ | 631 | /* setup return addr to the jprobe handler routine */ |
| 597 | regs->psw.addr = (unsigned long)(jp->entry) | PSW_ADDR_AMODE; | 632 | regs->psw.addr = (unsigned long)(jp->entry) | PSW_ADDR_AMODE; |
| 633 | regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT); | ||
| 598 | 634 | ||
| 599 | /* r14 is the function return address */ | 635 | /* r14 is the function return address */ |
| 600 | kcb->jprobe_saved_r14 = (unsigned long)regs->gprs[14]; | 636 | kcb->jprobe_saved_r14 = (unsigned long)regs->gprs[14]; |
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c index ac151399ef34..1995c1712fc8 100644 --- a/arch/s390/kernel/nmi.c +++ b/arch/s390/kernel/nmi.c | |||
| @@ -95,7 +95,6 @@ EXPORT_SYMBOL_GPL(s390_handle_mcck); | |||
| 95 | static int notrace s390_revalidate_registers(struct mci *mci) | 95 | static int notrace s390_revalidate_registers(struct mci *mci) |
| 96 | { | 96 | { |
| 97 | int kill_task; | 97 | int kill_task; |
| 98 | u64 tmpclock; | ||
| 99 | u64 zero; | 98 | u64 zero; |
| 100 | void *fpt_save_area, *fpt_creg_save_area; | 99 | void *fpt_save_area, *fpt_creg_save_area; |
| 101 | 100 | ||
| @@ -214,11 +213,10 @@ static int notrace s390_revalidate_registers(struct mci *mci) | |||
| 214 | : "0", "cc"); | 213 | : "0", "cc"); |
| 215 | #endif | 214 | #endif |
| 216 | /* Revalidate clock comparator register */ | 215 | /* Revalidate clock comparator register */ |
| 217 | asm volatile( | 216 | if (S390_lowcore.clock_comparator == -1) |
| 218 | " stck 0(%1)\n" | 217 | set_clock_comparator(S390_lowcore.mcck_clock); |
| 219 | " sckc 0(%1)" | 218 | else |
| 220 | : "=m" (tmpclock) : "a" (&(tmpclock)) : "cc", "memory"); | 219 | set_clock_comparator(S390_lowcore.clock_comparator); |
| 221 | |||
| 222 | /* Check if old PSW is valid */ | 220 | /* Check if old PSW is valid */ |
| 223 | if (!mci->wp) | 221 | if (!mci->wp) |
| 224 | /* | 222 | /* |
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c index 752b362bf651..7c37ec359ec2 100644 --- a/arch/s390/lib/delay.c +++ b/arch/s390/lib/delay.c | |||
| @@ -29,17 +29,21 @@ static void __udelay_disabled(unsigned long long usecs) | |||
| 29 | { | 29 | { |
| 30 | unsigned long mask, cr0, cr0_saved; | 30 | unsigned long mask, cr0, cr0_saved; |
| 31 | u64 clock_saved; | 31 | u64 clock_saved; |
| 32 | u64 end; | ||
| 32 | 33 | ||
| 34 | mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT; | ||
| 35 | end = get_clock() + (usecs << 12); | ||
| 33 | clock_saved = local_tick_disable(); | 36 | clock_saved = local_tick_disable(); |
| 34 | set_clock_comparator(get_clock() + (usecs << 12)); | ||
| 35 | __ctl_store(cr0_saved, 0, 0); | 37 | __ctl_store(cr0_saved, 0, 0); |
| 36 | cr0 = (cr0_saved & 0xffff00e0) | 0x00000800; | 38 | cr0 = (cr0_saved & 0xffff00e0) | 0x00000800; |
| 37 | __ctl_load(cr0 , 0, 0); | 39 | __ctl_load(cr0 , 0, 0); |
| 38 | mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT; | ||
| 39 | lockdep_off(); | 40 | lockdep_off(); |
| 40 | trace_hardirqs_on(); | 41 | do { |
| 41 | __load_psw_mask(mask); | 42 | set_clock_comparator(end); |
| 42 | local_irq_disable(); | 43 | trace_hardirqs_on(); |
| 44 | __load_psw_mask(mask); | ||
| 45 | local_irq_disable(); | ||
| 46 | } while (get_clock() < end); | ||
| 43 | lockdep_on(); | 47 | lockdep_on(); |
| 44 | __ctl_load(cr0_saved, 0, 0); | 48 | __ctl_load(cr0_saved, 0, 0); |
| 45 | local_tick_enable(clock_saved); | 49 | local_tick_enable(clock_saved); |
diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c index 38e641cdd977..45b405ca2567 100644 --- a/arch/s390/mm/gup.c +++ b/arch/s390/mm/gup.c | |||
| @@ -20,18 +20,17 @@ | |||
| 20 | static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, | 20 | static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, |
| 21 | unsigned long end, int write, struct page **pages, int *nr) | 21 | unsigned long end, int write, struct page **pages, int *nr) |
| 22 | { | 22 | { |
| 23 | unsigned long mask, result; | 23 | unsigned long mask; |
| 24 | pte_t *ptep, pte; | 24 | pte_t *ptep, pte; |
| 25 | struct page *page; | 25 | struct page *page; |
| 26 | 26 | ||
| 27 | result = write ? 0 : _PAGE_RO; | 27 | mask = (write ? _PAGE_RO : 0) | _PAGE_INVALID | _PAGE_SPECIAL; |
| 28 | mask = result | _PAGE_INVALID | _PAGE_SPECIAL; | ||
| 29 | 28 | ||
| 30 | ptep = ((pte_t *) pmd_deref(pmd)) + pte_index(addr); | 29 | ptep = ((pte_t *) pmd_deref(pmd)) + pte_index(addr); |
| 31 | do { | 30 | do { |
| 32 | pte = *ptep; | 31 | pte = *ptep; |
| 33 | barrier(); | 32 | barrier(); |
| 34 | if ((pte_val(pte) & mask) != result) | 33 | if ((pte_val(pte) & mask) != 0) |
| 35 | return 0; | 34 | return 0; |
| 36 | VM_BUG_ON(!pfn_valid(pte_pfn(pte))); | 35 | VM_BUG_ON(!pfn_valid(pte_pfn(pte))); |
| 37 | page = pte_page(pte); | 36 | page = pte_page(pte); |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index cfc510608039..b31b097e9bc6 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
| @@ -193,6 +193,7 @@ config CPU_SH2 | |||
| 193 | config CPU_SH2A | 193 | config CPU_SH2A |
| 194 | bool | 194 | bool |
| 195 | select CPU_SH2 | 195 | select CPU_SH2 |
| 196 | select UNCACHED_MAPPING | ||
| 196 | 197 | ||
| 197 | config CPU_SH3 | 198 | config CPU_SH3 |
| 198 | bool | 199 | bool |
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 307b3a4a790b..9c8c6e1a2a15 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
| @@ -133,10 +133,7 @@ machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se | |||
| 133 | machdir-$(CONFIG_SH_HP6XX) += mach-hp6xx | 133 | machdir-$(CONFIG_SH_HP6XX) += mach-hp6xx |
| 134 | machdir-$(CONFIG_SH_DREAMCAST) += mach-dreamcast | 134 | machdir-$(CONFIG_SH_DREAMCAST) += mach-dreamcast |
| 135 | machdir-$(CONFIG_SH_SH03) += mach-sh03 | 135 | machdir-$(CONFIG_SH_SH03) += mach-sh03 |
| 136 | machdir-$(CONFIG_SH_SECUREEDGE5410) += mach-snapgear | ||
| 137 | machdir-$(CONFIG_SH_RTS7751R2D) += mach-r2d | 136 | machdir-$(CONFIG_SH_RTS7751R2D) += mach-r2d |
| 138 | machdir-$(CONFIG_SH_7751_SYSTEMH) += mach-systemh | ||
| 139 | machdir-$(CONFIG_SH_EDOSK7705) += mach-edosk7705 | ||
| 140 | machdir-$(CONFIG_SH_HIGHLANDER) += mach-highlander | 137 | machdir-$(CONFIG_SH_HIGHLANDER) += mach-highlander |
| 141 | machdir-$(CONFIG_SH_MIGOR) += mach-migor | 138 | machdir-$(CONFIG_SH_MIGOR) += mach-migor |
| 142 | machdir-$(CONFIG_SH_AP325RXA) += mach-ap325rxa | 139 | machdir-$(CONFIG_SH_AP325RXA) += mach-ap325rxa |
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig index 9c94711aa6ca..2018c7ea4c93 100644 --- a/arch/sh/boards/Kconfig +++ b/arch/sh/boards/Kconfig | |||
| @@ -81,13 +81,6 @@ config SH_7343_SOLUTION_ENGINE | |||
| 81 | Select 7343 SolutionEngine if configuring for a Hitachi | 81 | Select 7343 SolutionEngine if configuring for a Hitachi |
| 82 | SH7343 (SH-Mobile 3AS) evaluation board. | 82 | SH7343 (SH-Mobile 3AS) evaluation board. |
| 83 | 83 | ||
| 84 | config SH_7751_SYSTEMH | ||
| 85 | bool "SystemH7751R" | ||
| 86 | depends on CPU_SUBTYPE_SH7751R | ||
| 87 | help | ||
| 88 | Select SystemH if you are configuring for a Renesas SystemH | ||
| 89 | 7751R evaluation board. | ||
| 90 | |||
| 91 | config SH_HP6XX | 84 | config SH_HP6XX |
| 92 | bool "HP6XX" | 85 | bool "HP6XX" |
| 93 | select SYS_SUPPORTS_APM_EMULATION | 86 | select SYS_SUPPORTS_APM_EMULATION |
diff --git a/arch/sh/boards/Makefile b/arch/sh/boards/Makefile index 38ef655cc0f0..be7d11d04b26 100644 --- a/arch/sh/boards/Makefile +++ b/arch/sh/boards/Makefile | |||
| @@ -2,10 +2,12 @@ | |||
| 2 | # Specific board support, not covered by a mach group. | 2 | # Specific board support, not covered by a mach group. |
| 3 | # | 3 | # |
| 4 | obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o | 4 | obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o |
| 5 | obj-$(CONFIG_SH_SECUREEDGE5410) += board-secureedge5410.o | ||
| 5 | obj-$(CONFIG_SH_SH2007) += board-sh2007.o | 6 | obj-$(CONFIG_SH_SH2007) += board-sh2007.o |
| 6 | obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o | 7 | obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o |
| 7 | obj-$(CONFIG_SH_URQUELL) += board-urquell.o | 8 | obj-$(CONFIG_SH_URQUELL) += board-urquell.o |
| 8 | obj-$(CONFIG_SH_SHMIN) += board-shmin.o | 9 | obj-$(CONFIG_SH_SHMIN) += board-shmin.o |
| 10 | obj-$(CONFIG_SH_EDOSK7705) += board-edosk7705.o | ||
| 9 | obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o | 11 | obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o |
| 10 | obj-$(CONFIG_SH_ESPT) += board-espt.o | 12 | obj-$(CONFIG_SH_ESPT) += board-espt.o |
| 11 | obj-$(CONFIG_SH_POLARIS) += board-polaris.o | 13 | obj-$(CONFIG_SH_POLARIS) += board-polaris.o |
diff --git a/arch/sh/boards/board-edosk7705.c b/arch/sh/boards/board-edosk7705.c new file mode 100644 index 000000000000..4cb3bb74c36f --- /dev/null +++ b/arch/sh/boards/board-edosk7705.c | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | /* | ||
| 2 | * arch/sh/boards/renesas/edosk7705/setup.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2000 Kazumoto Kojima | ||
| 5 | * | ||
| 6 | * Hitachi SolutionEngine Support. | ||
| 7 | * | ||
| 8 | * Modified for edosk7705 development | ||
| 9 | * board by S. Dunn, 2003. | ||
| 10 | */ | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/irq.h> | ||
| 13 | #include <linux/platform_device.h> | ||
| 14 | #include <linux/interrupt.h> | ||
| 15 | #include <linux/smc91x.h> | ||
| 16 | #include <asm/machvec.h> | ||
| 17 | #include <asm/sizes.h> | ||
| 18 | |||
| 19 | #define SMC_IOBASE 0xA2000000 | ||
| 20 | #define SMC_IO_OFFSET 0x300 | ||
| 21 | #define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) | ||
| 22 | |||
| 23 | #define ETHERNET_IRQ 0x09 | ||
| 24 | |||
| 25 | static void __init sh_edosk7705_init_irq(void) | ||
| 26 | { | ||
| 27 | make_imask_irq(ETHERNET_IRQ); | ||
| 28 | } | ||
| 29 | |||
| 30 | /* eth initialization functions */ | ||
| 31 | static struct smc91x_platdata smc91x_info = { | ||
| 32 | .flags = SMC91X_USE_16BIT | SMC91X_IO_SHIFT_1 | IORESOURCE_IRQ_LOWLEVEL, | ||
| 33 | }; | ||
| 34 | |||
| 35 | static struct resource smc91x_res[] = { | ||
| 36 | [0] = { | ||
| 37 | .start = SMC_IOADDR, | ||
| 38 | .end = SMC_IOADDR + SZ_32 - 1, | ||
| 39 | .flags = IORESOURCE_MEM, | ||
| 40 | }, | ||
| 41 | [1] = { | ||
| 42 | .start = ETHERNET_IRQ, | ||
| 43 | .end = ETHERNET_IRQ, | ||
| 44 | .flags = IORESOURCE_IRQ , | ||
| 45 | } | ||
| 46 | }; | ||
| 47 | |||
| 48 | static struct platform_device smc91x_dev = { | ||
| 49 | .name = "smc91x", | ||
| 50 | .id = -1, | ||
| 51 | .num_resources = ARRAY_SIZE(smc91x_res), | ||
| 52 | .resource = smc91x_res, | ||
| 53 | |||
| 54 | .dev = { | ||
| 55 | .platform_data = &smc91x_info, | ||
| 56 | }, | ||
| 57 | }; | ||
| 58 | |||
| 59 | /* platform init code */ | ||
| 60 | static struct platform_device *edosk7705_devices[] __initdata = { | ||
| 61 | &smc91x_dev, | ||
| 62 | }; | ||
| 63 | |||
| 64 | static int __init init_edosk7705_devices(void) | ||
| 65 | { | ||
| 66 | return platform_add_devices(edosk7705_devices, | ||
| 67 | ARRAY_SIZE(edosk7705_devices)); | ||
| 68 | } | ||
| 69 | __initcall(init_edosk7705_devices); | ||
| 70 | |||
| 71 | /* | ||
| 72 | * The Machine Vector | ||
| 73 | */ | ||
| 74 | static struct sh_machine_vector mv_edosk7705 __initmv = { | ||
| 75 | .mv_name = "EDOSK7705", | ||
| 76 | .mv_nr_irqs = 80, | ||
| 77 | .mv_init_irq = sh_edosk7705_init_irq, | ||
| 78 | }; | ||
diff --git a/arch/sh/boards/mach-snapgear/setup.c b/arch/sh/boards/board-secureedge5410.c index 331745dee379..32f875e8493d 100644 --- a/arch/sh/boards/mach-snapgear/setup.c +++ b/arch/sh/boards/board-secureedge5410.c | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/sh/boards/snapgear/setup.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 David McCullough <davidm@snapgear.com> | 2 | * Copyright (C) 2002 David McCullough <davidm@snapgear.com> |
| 5 | * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> | 3 | * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> |
| 6 | * | 4 | * |
| @@ -19,18 +17,19 @@ | |||
| 19 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 20 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
| 21 | #include <asm/machvec.h> | 19 | #include <asm/machvec.h> |
| 22 | #include <mach/snapgear.h> | 20 | #include <mach/secureedge5410.h> |
| 23 | #include <asm/irq.h> | 21 | #include <asm/irq.h> |
| 24 | #include <asm/io.h> | 22 | #include <asm/io.h> |
| 25 | #include <cpu/timer.h> | 23 | #include <cpu/timer.h> |
| 26 | 24 | ||
| 25 | unsigned short secureedge5410_ioport; | ||
| 26 | |||
| 27 | /* | 27 | /* |
| 28 | * EraseConfig handling functions | 28 | * EraseConfig handling functions |
| 29 | */ | 29 | */ |
| 30 | |||
| 31 | static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) | 30 | static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) |
| 32 | { | 31 | { |
| 33 | (void)__raw_readb(0xb8000000); /* dummy read */ | 32 | ctrl_delay(); /* dummy read */ |
| 34 | 33 | ||
| 35 | printk("SnapGear: erase switch interrupt!\n"); | 34 | printk("SnapGear: erase switch interrupt!\n"); |
| 36 | 35 | ||
| @@ -39,21 +38,22 @@ static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) | |||
| 39 | 38 | ||
| 40 | static int __init eraseconfig_init(void) | 39 | static int __init eraseconfig_init(void) |
| 41 | { | 40 | { |
| 41 | unsigned int irq = evt2irq(0x240); | ||
| 42 | |||
| 42 | printk("SnapGear: EraseConfig init\n"); | 43 | printk("SnapGear: EraseConfig init\n"); |
| 44 | |||
| 43 | /* Setup "EraseConfig" switch on external IRQ 0 */ | 45 | /* Setup "EraseConfig" switch on external IRQ 0 */ |
| 44 | if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED, | 46 | if (request_irq(irq, eraseconfig_interrupt, IRQF_DISABLED, |
| 45 | "Erase Config", NULL)) | 47 | "Erase Config", NULL)) |
| 46 | printk("SnapGear: failed to register IRQ%d for Reset witch\n", | 48 | printk("SnapGear: failed to register IRQ%d for Reset witch\n", |
| 47 | IRL0_IRQ); | 49 | irq); |
| 48 | else | 50 | else |
| 49 | printk("SnapGear: registered EraseConfig switch on IRQ%d\n", | 51 | printk("SnapGear: registered EraseConfig switch on IRQ%d\n", |
| 50 | IRL0_IRQ); | 52 | irq); |
| 51 | return(0); | 53 | return 0; |
| 52 | } | 54 | } |
| 53 | |||
| 54 | module_init(eraseconfig_init); | 55 | module_init(eraseconfig_init); |
| 55 | 56 | ||
| 56 | /****************************************************************************/ | ||
| 57 | /* | 57 | /* |
| 58 | * Initialize IRQ setting | 58 | * Initialize IRQ setting |
| 59 | * | 59 | * |
| @@ -62,7 +62,6 @@ module_init(eraseconfig_init); | |||
| 62 | * IRL2 = eth1 | 62 | * IRL2 = eth1 |
| 63 | * IRL3 = crypto | 63 | * IRL3 = crypto |
| 64 | */ | 64 | */ |
| 65 | |||
| 66 | static void __init init_snapgear_IRQ(void) | 65 | static void __init init_snapgear_IRQ(void) |
| 67 | { | 66 | { |
| 68 | printk("Setup SnapGear IRQ/IPR ...\n"); | 67 | printk("Setup SnapGear IRQ/IPR ...\n"); |
| @@ -76,20 +75,5 @@ static void __init init_snapgear_IRQ(void) | |||
| 76 | static struct sh_machine_vector mv_snapgear __initmv = { | 75 | static struct sh_machine_vector mv_snapgear __initmv = { |
| 77 | .mv_name = "SnapGear SecureEdge5410", | 76 | .mv_name = "SnapGear SecureEdge5410", |
| 78 | .mv_nr_irqs = 72, | 77 | .mv_nr_irqs = 72, |
| 79 | |||
| 80 | .mv_inb = snapgear_inb, | ||
| 81 | .mv_inw = snapgear_inw, | ||
| 82 | .mv_inl = snapgear_inl, | ||
| 83 | .mv_outb = snapgear_outb, | ||
| 84 | .mv_outw = snapgear_outw, | ||
| 85 | .mv_outl = snapgear_outl, | ||
| 86 | |||
| 87 | .mv_inb_p = snapgear_inb_p, | ||
| 88 | .mv_inw_p = snapgear_inw, | ||
| 89 | .mv_inl_p = snapgear_inl, | ||
| 90 | .mv_outb_p = snapgear_outb_p, | ||
| 91 | .mv_outw_p = snapgear_outw, | ||
| 92 | .mv_outl_p = snapgear_outl, | ||
| 93 | |||
| 94 | .mv_init_irq = init_snapgear_IRQ, | 78 | .mv_init_irq = init_snapgear_IRQ, |
| 95 | }; | 79 | }; |
diff --git a/arch/sh/boards/mach-edosk7705/Makefile b/arch/sh/boards/mach-edosk7705/Makefile deleted file mode 100644 index cd54acb51499..000000000000 --- a/arch/sh/boards/mach-edosk7705/Makefile +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Makefile for the EDOSK7705 specific parts of the kernel | ||
| 3 | # | ||
| 4 | |||
| 5 | obj-y := setup.o io.o | ||
diff --git a/arch/sh/boards/mach-edosk7705/io.c b/arch/sh/boards/mach-edosk7705/io.c deleted file mode 100644 index 5b9c57c43241..000000000000 --- a/arch/sh/boards/mach-edosk7705/io.c +++ /dev/null | |||
| @@ -1,71 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/sh/boards/renesas/edosk7705/io.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel | ||
| 5 | * Based largely on io_se.c. | ||
| 6 | * | ||
| 7 | * I/O routines for Hitachi EDOSK7705 board. | ||
| 8 | * | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <linux/kernel.h> | ||
| 12 | #include <linux/types.h> | ||
| 13 | #include <linux/io.h> | ||
| 14 | #include <mach/edosk7705.h> | ||
| 15 | #include <asm/addrspace.h> | ||
| 16 | |||
| 17 | #define SMC_IOADDR 0xA2000000 | ||
| 18 | |||
| 19 | /* Map the Ethernet addresses as if it is at 0x300 - 0x320 */ | ||
| 20 | static unsigned long sh_edosk7705_isa_port2addr(unsigned long port) | ||
| 21 | { | ||
| 22 | /* | ||
| 23 | * SMC91C96 registers are 4 byte aligned rather than the | ||
| 24 | * usual 2 byte! | ||
| 25 | */ | ||
| 26 | if (port >= 0x300 && port < 0x320) | ||
| 27 | return SMC_IOADDR + ((port - 0x300) * 2); | ||
| 28 | |||
| 29 | maybebadio(port); | ||
| 30 | return port; | ||
| 31 | } | ||
| 32 | |||
| 33 | /* Trying to read / write bytes on odd-byte boundaries to the Ethernet | ||
| 34 | * registers causes problems. So we bit-shift the value and read / write | ||
| 35 | * in 2 byte chunks. Setting the low byte to 0 does not cause problems | ||
| 36 | * now as odd byte writes are only made on the bit mask / interrupt | ||
| 37 | * register. This may not be the case in future Mar-2003 SJD | ||
| 38 | */ | ||
| 39 | unsigned char sh_edosk7705_inb(unsigned long port) | ||
| 40 | { | ||
| 41 | if (port >= 0x300 && port < 0x320 && port & 0x01) | ||
| 42 | return __raw_readw(port - 1) >> 8; | ||
| 43 | |||
| 44 | return __raw_readb(sh_edosk7705_isa_port2addr(port)); | ||
| 45 | } | ||
| 46 | |||
| 47 | void sh_edosk7705_outb(unsigned char value, unsigned long port) | ||
| 48 | { | ||
| 49 | if (port >= 0x300 && port < 0x320 && port & 0x01) { | ||
| 50 | __raw_writew(((unsigned short)value << 8), port - 1); | ||
| 51 | return; | ||
| 52 | } | ||
| 53 | |||
| 54 | __raw_writeb(value, sh_edosk7705_isa_port2addr(port)); | ||
| 55 | } | ||
| 56 | |||
| 57 | void sh_edosk7705_insb(unsigned long port, void *addr, unsigned long count) | ||
| 58 | { | ||
| 59 | unsigned char *p = addr; | ||
| 60 | |||
| 61 | while (count--) | ||
| 62 | *p++ = sh_edosk7705_inb(port); | ||
| 63 | } | ||
| 64 | |||
| 65 | void sh_edosk7705_outsb(unsigned long port, const void *addr, unsigned long count) | ||
| 66 | { | ||
| 67 | unsigned char *p = (unsigned char *)addr; | ||
| 68 | |||
| 69 | while (count--) | ||
| 70 | sh_edosk7705_outb(*p++, port); | ||
| 71 | } | ||
diff --git a/arch/sh/boards/mach-edosk7705/setup.c b/arch/sh/boards/mach-edosk7705/setup.c deleted file mode 100644 index d59225e26fb9..000000000000 --- a/arch/sh/boards/mach-edosk7705/setup.c +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/sh/boards/renesas/edosk7705/setup.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2000 Kazumoto Kojima | ||
| 5 | * | ||
| 6 | * Hitachi SolutionEngine Support. | ||
| 7 | * | ||
| 8 | * Modified for edosk7705 development | ||
| 9 | * board by S. Dunn, 2003. | ||
| 10 | */ | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/irq.h> | ||
| 13 | #include <asm/machvec.h> | ||
| 14 | #include <mach/edosk7705.h> | ||
| 15 | |||
| 16 | static void __init sh_edosk7705_init_irq(void) | ||
| 17 | { | ||
| 18 | /* This is the Ethernet interrupt */ | ||
| 19 | make_imask_irq(0x09); | ||
| 20 | } | ||
| 21 | |||
| 22 | /* | ||
| 23 | * The Machine Vector | ||
| 24 | */ | ||
| 25 | static struct sh_machine_vector mv_edosk7705 __initmv = { | ||
| 26 | .mv_name = "EDOSK7705", | ||
| 27 | .mv_nr_irqs = 80, | ||
| 28 | |||
| 29 | .mv_inb = sh_edosk7705_inb, | ||
| 30 | .mv_outb = sh_edosk7705_outb, | ||
| 31 | |||
| 32 | .mv_insb = sh_edosk7705_insb, | ||
| 33 | .mv_outsb = sh_edosk7705_outsb, | ||
| 34 | |||
| 35 | .mv_init_irq = sh_edosk7705_init_irq, | ||
| 36 | }; | ||
diff --git a/arch/sh/boards/mach-microdev/io.c b/arch/sh/boards/mach-microdev/io.c index 2960c659020e..acdafb0c6404 100644 --- a/arch/sh/boards/mach-microdev/io.c +++ b/arch/sh/boards/mach-microdev/io.c | |||
| @@ -54,7 +54,7 @@ | |||
| 54 | /* | 54 | /* |
| 55 | * map I/O ports to memory-mapped addresses | 55 | * map I/O ports to memory-mapped addresses |
| 56 | */ | 56 | */ |
| 57 | static unsigned long microdev_isa_port2addr(unsigned long offset) | 57 | void __iomem *microdev_ioport_map(unsigned long offset, unsigned int len) |
| 58 | { | 58 | { |
| 59 | unsigned long result; | 59 | unsigned long result; |
| 60 | 60 | ||
| @@ -72,16 +72,6 @@ static unsigned long microdev_isa_port2addr(unsigned long offset) | |||
| 72 | * Configuration Registers | 72 | * Configuration Registers |
| 73 | */ | 73 | */ |
| 74 | result = IO_SUPERIO_PHYS + (offset << 1); | 74 | result = IO_SUPERIO_PHYS + (offset << 1); |
| 75 | #if 0 | ||
| 76 | } else if (offset == KBD_DATA_REG || offset == KBD_CNTL_REG || | ||
| 77 | offset == KBD_STATUS_REG) { | ||
| 78 | /* | ||
| 79 | * SMSC FDC37C93xAPM SuperIO chip | ||
| 80 | * | ||
| 81 | * PS/2 Keyboard + Mouse (ports 0x60 and 0x64). | ||
| 82 | */ | ||
| 83 | result = IO_SUPERIO_PHYS + (offset << 1); | ||
| 84 | #endif | ||
| 85 | } else if (((offset >= IO_IDE1_BASE) && | 75 | } else if (((offset >= IO_IDE1_BASE) && |
| 86 | (offset < IO_IDE1_BASE + IO_IDE_EXTENT)) || | 76 | (offset < IO_IDE1_BASE + IO_IDE_EXTENT)) || |
| 87 | (offset == IO_IDE1_MISC)) { | 77 | (offset == IO_IDE1_MISC)) { |
| @@ -131,237 +121,5 @@ static unsigned long microdev_isa_port2addr(unsigned long offset) | |||
| 131 | result = PVR; | 121 | result = PVR; |
| 132 | } | 122 | } |
| 133 | 123 | ||
| 134 | return result; | 124 | return (void __iomem *)result; |
| 135 | } | ||
| 136 | |||
| 137 | #define PORT2ADDR(x) (microdev_isa_port2addr(x)) | ||
| 138 | |||
| 139 | static inline void delay(void) | ||
| 140 | { | ||
| 141 | #if defined(CONFIG_PCI) | ||
| 142 | /* System board present, just make a dummy SRAM access. (CS0 will be | ||
| 143 | mapped to PCI memory, probably good to avoid it.) */ | ||
| 144 | __raw_readw(0xa6800000); | ||
| 145 | #else | ||
| 146 | /* CS0 will be mapped to flash, ROM etc so safe to access it. */ | ||
| 147 | __raw_readw(0xa0000000); | ||
| 148 | #endif | ||
| 149 | } | ||
| 150 | |||
| 151 | unsigned char microdev_inb(unsigned long port) | ||
| 152 | { | ||
| 153 | #ifdef CONFIG_PCI | ||
| 154 | if (port >= PCIBIOS_MIN_IO) | ||
| 155 | return microdev_pci_inb(port); | ||
| 156 | #endif | ||
| 157 | return *(volatile unsigned char*)PORT2ADDR(port); | ||
| 158 | } | ||
| 159 | |||
| 160 | unsigned short microdev_inw(unsigned long port) | ||
| 161 | { | ||
| 162 | #ifdef CONFIG_PCI | ||
| 163 | if (port >= PCIBIOS_MIN_IO) | ||
| 164 | return microdev_pci_inw(port); | ||
| 165 | #endif | ||
| 166 | return *(volatile unsigned short*)PORT2ADDR(port); | ||
| 167 | } | ||
| 168 | |||
| 169 | unsigned int microdev_inl(unsigned long port) | ||
| 170 | { | ||
| 171 | #ifdef CONFIG_PCI | ||
| 172 | if (port >= PCIBIOS_MIN_IO) | ||
| 173 | return microdev_pci_inl(port); | ||
| 174 | #endif | ||
| 175 | return *(volatile unsigned int*)PORT2ADDR(port); | ||
| 176 | } | ||
| 177 | |||
| 178 | void microdev_outw(unsigned short b, unsigned long port) | ||
| 179 | { | ||
| 180 | #ifdef CONFIG_PCI | ||
| 181 | if (port >= PCIBIOS_MIN_IO) { | ||
| 182 | microdev_pci_outw(b, port); | ||
| 183 | return; | ||
| 184 | } | ||
| 185 | #endif | ||
| 186 | *(volatile unsigned short*)PORT2ADDR(port) = b; | ||
| 187 | } | ||
| 188 | |||
| 189 | void microdev_outb(unsigned char b, unsigned long port) | ||
| 190 | { | ||
| 191 | #ifdef CONFIG_PCI | ||
| 192 | if (port >= PCIBIOS_MIN_IO) { | ||
| 193 | microdev_pci_outb(b, port); | ||
| 194 | return; | ||
| 195 | } | ||
| 196 | #endif | ||
| 197 | |||
| 198 | /* | ||
| 199 | * There is a board feature with the current SH4-202 MicroDev in | ||
| 200 | * that the 2 byte enables (nBE0 and nBE1) are tied together (and | ||
| 201 | * to the Chip Select Line (Ethernet_CS)). Due to this connectivity, | ||
| 202 | * it is not possible to safely perform 8-bit writes to the | ||
| 203 | * Ethernet registers, as 16-bits will be consumed from the Data | ||
| 204 | * lines (corrupting the other byte). Hence, this function is | ||
| 205 | * written to implement 16-bit read/modify/write for all byte-wide | ||
| 206 | * accesses. | ||
| 207 | * | ||
| 208 | * Note: there is no problem with byte READS (even or odd). | ||
| 209 | * | ||
| 210 | * Sean McGoogan - 16th June 2003. | ||
| 211 | */ | ||
| 212 | if ((port >= IO_LAN91C111_BASE) && | ||
| 213 | (port < IO_LAN91C111_BASE + IO_LAN91C111_EXTENT)) { | ||
| 214 | /* | ||
| 215 | * Then are trying to perform a byte-write to the | ||
| 216 | * LAN91C111. This needs special care. | ||
| 217 | */ | ||
| 218 | if (port % 2 == 1) { /* is the port odd ? */ | ||
| 219 | /* unset bit-0, i.e. make even */ | ||
| 220 | const unsigned long evenPort = port-1; | ||
| 221 | unsigned short word; | ||
| 222 | |||
| 223 | /* | ||
| 224 | * do a 16-bit read/write to write to 'port', | ||
| 225 | * preserving even byte. | ||
| 226 | * | ||
| 227 | * Even addresses are bits 0-7 | ||
| 228 | * Odd addresses are bits 8-15 | ||
| 229 | */ | ||
| 230 | word = microdev_inw(evenPort); | ||
| 231 | word = (word & 0xffu) | (b << 8); | ||
| 232 | microdev_outw(word, evenPort); | ||
| 233 | } else { | ||
| 234 | /* else, we are trying to do an even byte write */ | ||
| 235 | unsigned short word; | ||
| 236 | |||
| 237 | /* | ||
| 238 | * do a 16-bit read/write to write to 'port', | ||
| 239 | * preserving odd byte. | ||
| 240 | * | ||
| 241 | * Even addresses are bits 0-7 | ||
| 242 | * Odd addresses are bits 8-15 | ||
| 243 | */ | ||
| 244 | word = microdev_inw(port); | ||
| 245 | word = (word & 0xff00u) | (b); | ||
| 246 | microdev_outw(word, port); | ||
| 247 | } | ||
| 248 | } else { | ||
| 249 | *(volatile unsigned char*)PORT2ADDR(port) = b; | ||
| 250 | } | ||
| 251 | } | ||
| 252 | |||
| 253 | void microdev_outl(unsigned int b, unsigned long port) | ||
| 254 | { | ||
| 255 | #ifdef CONFIG_PCI | ||
| 256 | if (port >= PCIBIOS_MIN_IO) { | ||
| 257 | microdev_pci_outl(b, port); | ||
| 258 | return; | ||
| 259 | } | ||
| 260 | #endif | ||
| 261 | *(volatile unsigned int*)PORT2ADDR(port) = b; | ||
| 262 | } | ||
| 263 | |||
| 264 | unsigned char microdev_inb_p(unsigned long port) | ||
| 265 | { | ||
| 266 | unsigned char v = microdev_inb(port); | ||
| 267 | delay(); | ||
| 268 | return v; | ||
| 269 | } | ||
| 270 | |||
| 271 | unsigned short microdev_inw_p(unsigned long port) | ||
| 272 | { | ||
| 273 | unsigned short v = microdev_inw(port); | ||
| 274 | delay(); | ||
| 275 | return v; | ||
| 276 | } | ||
| 277 | |||
| 278 | unsigned int microdev_inl_p(unsigned long port) | ||
| 279 | { | ||
| 280 | unsigned int v = microdev_inl(port); | ||
| 281 | delay(); | ||
| 282 | return v; | ||
| 283 | } | ||
| 284 | |||
| 285 | void microdev_outb_p(unsigned char b, unsigned long port) | ||
| 286 | { | ||
| 287 | microdev_outb(b, port); | ||
| 288 | delay(); | ||
| 289 | } | ||
| 290 | |||
| 291 | void microdev_outw_p(unsigned short b, unsigned long port) | ||
| 292 | { | ||
| 293 | microdev_outw(b, port); | ||
| 294 | delay(); | ||
| 295 | } | ||
| 296 | |||
| 297 | void microdev_outl_p(unsigned int b, unsigned long port) | ||
| 298 | { | ||
| 299 | microdev_outl(b, port); | ||
| 300 | delay(); | ||
| 301 | } | ||
| 302 | |||
| 303 | void microdev_insb(unsigned long port, void *buffer, unsigned long count) | ||
| 304 | { | ||
| 305 | volatile unsigned char *port_addr; | ||
| 306 | unsigned char *buf = buffer; | ||
| 307 | |||
| 308 | port_addr = (volatile unsigned char *)PORT2ADDR(port); | ||
| 309 | |||
| 310 | while (count--) | ||
| 311 | *buf++ = *port_addr; | ||
| 312 | } | ||
| 313 | |||
| 314 | void microdev_insw(unsigned long port, void *buffer, unsigned long count) | ||
| 315 | { | ||
| 316 | volatile unsigned short *port_addr; | ||
| 317 | unsigned short *buf = buffer; | ||
| 318 | |||
| 319 | port_addr = (volatile unsigned short *)PORT2ADDR(port); | ||
| 320 | |||
| 321 | while (count--) | ||
| 322 | *buf++ = *port_addr; | ||
| 323 | } | ||
| 324 | |||
| 325 | void microdev_insl(unsigned long port, void *buffer, unsigned long count) | ||
| 326 | { | ||
| 327 | volatile unsigned long *port_addr; | ||
| 328 | unsigned int *buf = buffer; | ||
| 329 | |||
| 330 | port_addr = (volatile unsigned long *)PORT2ADDR(port); | ||
| 331 | |||
| 332 | while (count--) | ||
| 333 | *buf++ = *port_addr; | ||
| 334 | } | ||
| 335 | |||
| 336 | void microdev_outsb(unsigned long port, const void *buffer, unsigned long count) | ||
| 337 | { | ||
| 338 | volatile unsigned char *port_addr; | ||
| 339 | const unsigned char *buf = buffer; | ||
| 340 | |||
| 341 | port_addr = (volatile unsigned char *)PORT2ADDR(port); | ||
| 342 | |||
| 343 | while (count--) | ||
| 344 | *port_addr = *buf++; | ||
| 345 | } | ||
| 346 | |||
| 347 | void microdev_outsw(unsigned long port, const void *buffer, unsigned long count) | ||
| 348 | { | ||
| 349 | volatile unsigned short *port_addr; | ||
| 350 | const unsigned short *buf = buffer; | ||
| 351 | |||
| 352 | port_addr = (volatile unsigned short *)PORT2ADDR(port); | ||
| 353 | |||
| 354 | while (count--) | ||
| 355 | *port_addr = *buf++; | ||
| 356 | } | ||
| 357 | |||
| 358 | void microdev_outsl(unsigned long port, const void *buffer, unsigned long count) | ||
| 359 | { | ||
| 360 | volatile unsigned long *port_addr; | ||
| 361 | const unsigned int *buf = buffer; | ||
| 362 | |||
| 363 | port_addr = (volatile unsigned long *)PORT2ADDR(port); | ||
| 364 | |||
| 365 | while (count--) | ||
| 366 | *port_addr = *buf++; | ||
| 367 | } | 125 | } |
diff --git a/arch/sh/boards/mach-microdev/setup.c b/arch/sh/boards/mach-microdev/setup.c index d1df2a4fb9b8..d8a747291e03 100644 --- a/arch/sh/boards/mach-microdev/setup.c +++ b/arch/sh/boards/mach-microdev/setup.c | |||
| @@ -195,27 +195,6 @@ device_initcall(microdev_devices_setup); | |||
| 195 | static struct sh_machine_vector mv_sh4202_microdev __initmv = { | 195 | static struct sh_machine_vector mv_sh4202_microdev __initmv = { |
| 196 | .mv_name = "SH4-202 MicroDev", | 196 | .mv_name = "SH4-202 MicroDev", |
| 197 | .mv_nr_irqs = 72, | 197 | .mv_nr_irqs = 72, |
| 198 | 198 | .mv_ioport_map = microdev_ioport_map, | |
| 199 | .mv_inb = microdev_inb, | ||
| 200 | .mv_inw = microdev_inw, | ||
| 201 | .mv_inl = microdev_inl, | ||
| 202 | .mv_outb = microdev_outb, | ||
| 203 | .mv_outw = microdev_outw, | ||
| 204 | .mv_outl = microdev_outl, | ||
| 205 | |||
| 206 | .mv_inb_p = microdev_inb_p, | ||
| 207 | .mv_inw_p = microdev_inw_p, | ||
| 208 | .mv_inl_p = microdev_inl_p, | ||
| 209 | .mv_outb_p = microdev_outb_p, | ||
| 210 | .mv_outw_p = microdev_outw_p, | ||
| 211 | .mv_outl_p = microdev_outl_p, | ||
| 212 | |||
| 213 | .mv_insb = microdev_insb, | ||
| 214 | .mv_insw = microdev_insw, | ||
| 215 | .mv_insl = microdev_insl, | ||
| 216 | .mv_outsb = microdev_outsb, | ||
| 217 | .mv_outsw = microdev_outsw, | ||
| 218 | .mv_outsl = microdev_outsl, | ||
| 219 | |||
| 220 | .mv_init_irq = init_microdev_irq, | 199 | .mv_init_irq = init_microdev_irq, |
| 221 | }; | 200 | }; |
diff --git a/arch/sh/boards/mach-se/7206/Makefile b/arch/sh/boards/mach-se/7206/Makefile index 63e7ed699f39..5c9eaa0535b9 100644 --- a/arch/sh/boards/mach-se/7206/Makefile +++ b/arch/sh/boards/mach-se/7206/Makefile | |||
| @@ -2,4 +2,4 @@ | |||
| 2 | # Makefile for the 7206 SolutionEngine specific parts of the kernel | 2 | # Makefile for the 7206 SolutionEngine specific parts of the kernel |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := setup.o io.o irq.o | 5 | obj-y := setup.o irq.o |
diff --git a/arch/sh/boards/mach-se/7206/io.c b/arch/sh/boards/mach-se/7206/io.c deleted file mode 100644 index adadc77532ee..000000000000 --- a/arch/sh/boards/mach-se/7206/io.c +++ /dev/null | |||
| @@ -1,104 +0,0 @@ | |||
| 1 | /* $Id: io.c,v 1.5 2004/02/22 23:08:43 kkojima Exp $ | ||
| 2 | * | ||
| 3 | * linux/arch/sh/boards/se/7206/io.c | ||
| 4 | * | ||
| 5 | * Copyright (C) 2006 Yoshinori Sato | ||
| 6 | * | ||
| 7 | * I/O routine for Hitachi 7206 SolutionEngine. | ||
| 8 | * | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <linux/kernel.h> | ||
| 12 | #include <linux/types.h> | ||
| 13 | #include <asm/io.h> | ||
| 14 | #include <mach-se/mach/se7206.h> | ||
| 15 | |||
| 16 | |||
| 17 | static inline void delay(void) | ||
| 18 | { | ||
| 19 | __raw_readw(0x20000000); /* P2 ROM Area */ | ||
| 20 | } | ||
| 21 | |||
| 22 | /* MS7750 requires special versions of in*, out* routines, since | ||
| 23 | PC-like io ports are located at upper half byte of 16-bit word which | ||
| 24 | can be accessed only with 16-bit wide. */ | ||
| 25 | |||
| 26 | static inline volatile __u16 * | ||
| 27 | port2adr(unsigned int port) | ||
| 28 | { | ||
| 29 | if (port >= 0x2000 && port < 0x2020) | ||
| 30 | return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); | ||
| 31 | else if (port >= 0x300 && port < 0x310) | ||
| 32 | return (volatile __u16 *) (PA_SMSC + (port - 0x300)); | ||
| 33 | |||
| 34 | return (volatile __u16 *)port; | ||
| 35 | } | ||
| 36 | |||
| 37 | unsigned char se7206_inb(unsigned long port) | ||
| 38 | { | ||
| 39 | return (*port2adr(port)) & 0xff; | ||
| 40 | } | ||
| 41 | |||
| 42 | unsigned char se7206_inb_p(unsigned long port) | ||
| 43 | { | ||
| 44 | unsigned long v; | ||
| 45 | |||
| 46 | v = (*port2adr(port)) & 0xff; | ||
| 47 | delay(); | ||
| 48 | return v; | ||
| 49 | } | ||
| 50 | |||
| 51 | unsigned short se7206_inw(unsigned long port) | ||
| 52 | { | ||
| 53 | return *port2adr(port); | ||
| 54 | } | ||
| 55 | |||
| 56 | void se7206_outb(unsigned char value, unsigned long port) | ||
| 57 | { | ||
| 58 | *(port2adr(port)) = value; | ||
| 59 | } | ||
| 60 | |||
| 61 | void se7206_outb_p(unsigned char value, unsigned long port) | ||
| 62 | { | ||
| 63 | *(port2adr(port)) = value; | ||
| 64 | delay(); | ||
| 65 | } | ||
| 66 | |||
| 67 | void se7206_outw(unsigned short value, unsigned long port) | ||
| 68 | { | ||
| 69 | *port2adr(port) = value; | ||
| 70 | } | ||
| 71 | |||
| 72 | void se7206_insb(unsigned long port, void *addr, unsigned long count) | ||
| 73 | { | ||
| 74 | volatile __u16 *p = port2adr(port); | ||
| 75 | __u8 *ap = addr; | ||
| 76 | |||
| 77 | while (count--) | ||
| 78 | *ap++ = *p; | ||
| 79 | } | ||
| 80 | |||
| 81 | void se7206_insw(unsigned long port, void *addr, unsigned long count) | ||
| 82 | { | ||
| 83 | volatile __u16 *p = port2adr(port); | ||
| 84 | __u16 *ap = addr; | ||
| 85 | while (count--) | ||
| 86 | *ap++ = *p; | ||
| 87 | } | ||
| 88 | |||
| 89 | void se7206_outsb(unsigned long port, const void *addr, unsigned long count) | ||
| 90 | { | ||
| 91 | volatile __u16 *p = port2adr(port); | ||
| 92 | const __u8 *ap = addr; | ||
| 93 | |||
| 94 | while (count--) | ||
| 95 | *p = *ap++; | ||
| 96 | } | ||
| 97 | |||
| 98 | void se7206_outsw(unsigned long port, const void *addr, unsigned long count) | ||
| 99 | { | ||
| 100 | volatile __u16 *p = port2adr(port); | ||
| 101 | const __u16 *ap = addr; | ||
| 102 | while (count--) | ||
| 103 | *p = *ap++; | ||
| 104 | } | ||
diff --git a/arch/sh/boards/mach-se/7206/irq.c b/arch/sh/boards/mach-se/7206/irq.c index 883b21eacaa6..d961949600fd 100644 --- a/arch/sh/boards/mach-se/7206/irq.c +++ b/arch/sh/boards/mach-se/7206/irq.c | |||
| @@ -139,11 +139,13 @@ void __init init_se7206_IRQ(void) | |||
| 139 | make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */ | 139 | make_se7206_irq(IRQ0_IRQ); /* SMC91C111 */ |
| 140 | make_se7206_irq(IRQ1_IRQ); /* ATA */ | 140 | make_se7206_irq(IRQ1_IRQ); /* ATA */ |
| 141 | make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */ | 141 | make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */ |
| 142 | __raw_writew(inw(INTC_ICR1) | 0x000b ,INTC_ICR1 ) ; /* ICR1 */ | 142 | |
| 143 | __raw_writew(__raw_readw(INTC_ICR1) | 0x000b, INTC_ICR); /* ICR1 */ | ||
| 143 | 144 | ||
| 144 | /* FPGA System register setup*/ | 145 | /* FPGA System register setup*/ |
| 145 | __raw_writew(0x0000,INTSTS0); /* Clear INTSTS0 */ | 146 | __raw_writew(0x0000,INTSTS0); /* Clear INTSTS0 */ |
| 146 | __raw_writew(0x0000,INTSTS1); /* Clear INTSTS1 */ | 147 | __raw_writew(0x0000,INTSTS1); /* Clear INTSTS1 */ |
| 148 | |||
| 147 | /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */ | 149 | /* IRQ0=LAN, IRQ1=ATA, IRQ3=SLT,PCM */ |
| 148 | __raw_writew(0x0001,INTSEL); | 150 | __raw_writew(0x0001,INTSEL); |
| 149 | } | 151 | } |
diff --git a/arch/sh/boards/mach-se/7206/setup.c b/arch/sh/boards/mach-se/7206/setup.c index 8f5c65d43d1d..7f4871c71a01 100644 --- a/arch/sh/boards/mach-se/7206/setup.c +++ b/arch/sh/boards/mach-se/7206/setup.c | |||
| @@ -86,20 +86,5 @@ __initcall(se7206_devices_setup); | |||
| 86 | static struct sh_machine_vector mv_se __initmv = { | 86 | static struct sh_machine_vector mv_se __initmv = { |
| 87 | .mv_name = "SolutionEngine", | 87 | .mv_name = "SolutionEngine", |
| 88 | .mv_nr_irqs = 256, | 88 | .mv_nr_irqs = 256, |
| 89 | .mv_inb = se7206_inb, | ||
| 90 | .mv_inw = se7206_inw, | ||
| 91 | .mv_outb = se7206_outb, | ||
| 92 | .mv_outw = se7206_outw, | ||
| 93 | |||
| 94 | .mv_inb_p = se7206_inb_p, | ||
| 95 | .mv_inw_p = se7206_inw, | ||
| 96 | .mv_outb_p = se7206_outb_p, | ||
| 97 | .mv_outw_p = se7206_outw, | ||
| 98 | |||
| 99 | .mv_insb = se7206_insb, | ||
| 100 | .mv_insw = se7206_insw, | ||
| 101 | .mv_outsb = se7206_outsb, | ||
| 102 | .mv_outsw = se7206_outsw, | ||
| 103 | |||
| 104 | .mv_init_irq = init_se7206_IRQ, | 89 | .mv_init_irq = init_se7206_IRQ, |
| 105 | }; | 90 | }; |
diff --git a/arch/sh/boards/mach-se/770x/Makefile b/arch/sh/boards/mach-se/770x/Makefile index 8e624b06d5ea..43ea14feef51 100644 --- a/arch/sh/boards/mach-se/770x/Makefile +++ b/arch/sh/boards/mach-se/770x/Makefile | |||
| @@ -2,4 +2,4 @@ | |||
| 2 | # Makefile for the 770x SolutionEngine specific parts of the kernel | 2 | # Makefile for the 770x SolutionEngine specific parts of the kernel |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := setup.o io.o irq.o | 5 | obj-y := setup.o irq.o |
diff --git a/arch/sh/boards/mach-se/770x/io.c b/arch/sh/boards/mach-se/770x/io.c deleted file mode 100644 index 28833c8786ea..000000000000 --- a/arch/sh/boards/mach-se/770x/io.c +++ /dev/null | |||
| @@ -1,156 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2000 Kazumoto Kojima | ||
| 3 | * | ||
| 4 | * I/O routine for Hitachi SolutionEngine. | ||
| 5 | */ | ||
| 6 | #include <linux/kernel.h> | ||
| 7 | #include <linux/types.h> | ||
| 8 | #include <asm/io.h> | ||
| 9 | #include <mach-se/mach/se.h> | ||
| 10 | |||
| 11 | /* MS7750 requires special versions of in*, out* routines, since | ||
| 12 | PC-like io ports are located at upper half byte of 16-bit word which | ||
| 13 | can be accessed only with 16-bit wide. */ | ||
| 14 | |||
| 15 | static inline volatile __u16 * | ||
| 16 | port2adr(unsigned int port) | ||
| 17 | { | ||
| 18 | if (port & 0xff000000) | ||
| 19 | return ( volatile __u16 *) port; | ||
| 20 | if (port >= 0x2000) | ||
| 21 | return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); | ||
| 22 | else if (port >= 0x1000) | ||
| 23 | return (volatile __u16 *) (PA_83902 + (port << 1)); | ||
| 24 | else | ||
| 25 | return (volatile __u16 *) (PA_SUPERIO + (port << 1)); | ||
| 26 | } | ||
| 27 | |||
| 28 | static inline int | ||
| 29 | shifted_port(unsigned long port) | ||
| 30 | { | ||
| 31 | /* For IDE registers, value is not shifted */ | ||
| 32 | if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6) | ||
| 33 | return 0; | ||
| 34 | else | ||
| 35 | return 1; | ||
| 36 | } | ||
| 37 | |||
| 38 | unsigned char se_inb(unsigned long port) | ||
| 39 | { | ||
| 40 | if (shifted_port(port)) | ||
| 41 | return (*port2adr(port) >> 8); | ||
| 42 | else | ||
| 43 | return (*port2adr(port))&0xff; | ||
| 44 | } | ||
| 45 | |||
| 46 | unsigned char se_inb_p(unsigned long port) | ||
| 47 | { | ||
| 48 | unsigned long v; | ||
| 49 | |||
| 50 | if (shifted_port(port)) | ||
| 51 | v = (*port2adr(port) >> 8); | ||
| 52 | else | ||
| 53 | v = (*port2adr(port))&0xff; | ||
| 54 | ctrl_delay(); | ||
| 55 | return v; | ||
| 56 | } | ||
| 57 | |||
| 58 | unsigned short se_inw(unsigned long port) | ||
| 59 | { | ||
| 60 | if (port >= 0x2000) | ||
| 61 | return *port2adr(port); | ||
| 62 | else | ||
| 63 | maybebadio(port); | ||
| 64 | return 0; | ||
| 65 | } | ||
| 66 | |||
| 67 | unsigned int se_inl(unsigned long port) | ||
| 68 | { | ||
| 69 | maybebadio(port); | ||
| 70 | return 0; | ||
| 71 | } | ||
| 72 | |||
| 73 | void se_outb(unsigned char value, unsigned long port) | ||
| 74 | { | ||
| 75 | if (shifted_port(port)) | ||
| 76 | *(port2adr(port)) = value << 8; | ||
| 77 | else | ||
| 78 | *(port2adr(port)) = value; | ||
| 79 | } | ||
| 80 | |||
| 81 | void se_outb_p(unsigned char value, unsigned long port) | ||
| 82 | { | ||
| 83 | if (shifted_port(port)) | ||
| 84 | *(port2adr(port)) = value << 8; | ||
| 85 | else | ||
| 86 | *(port2adr(port)) = value; | ||
| 87 | ctrl_delay(); | ||
| 88 | } | ||
| 89 | |||
| 90 | void se_outw(unsigned short value, unsigned long port) | ||
| 91 | { | ||
| 92 | if (port >= 0x2000) | ||
| 93 | *port2adr(port) = value; | ||
| 94 | else | ||
| 95 | maybebadio(port); | ||
| 96 | } | ||
| 97 | |||
| 98 | void se_outl(unsigned int value, unsigned long port) | ||
| 99 | { | ||
| 100 | maybebadio(port); | ||
| 101 | } | ||
| 102 | |||
| 103 | void se_insb(unsigned long port, void *addr, unsigned long count) | ||
| 104 | { | ||
| 105 | volatile __u16 *p = port2adr(port); | ||
| 106 | __u8 *ap = addr; | ||
| 107 | |||
| 108 | if (shifted_port(port)) { | ||
| 109 | while (count--) | ||
| 110 | *ap++ = *p >> 8; | ||
| 111 | } else { | ||
| 112 | while (count--) | ||
| 113 | *ap++ = *p; | ||
| 114 | } | ||
| 115 | } | ||
| 116 | |||
| 117 | void se_insw(unsigned long port, void *addr, unsigned long count) | ||
| 118 | { | ||
| 119 | volatile __u16 *p = port2adr(port); | ||
| 120 | __u16 *ap = addr; | ||
| 121 | while (count--) | ||
| 122 | *ap++ = *p; | ||
| 123 | } | ||
| 124 | |||
| 125 | void se_insl(unsigned long port, void *addr, unsigned long count) | ||
| 126 | { | ||
| 127 | maybebadio(port); | ||
| 128 | } | ||
| 129 | |||
| 130 | void se_outsb(unsigned long port, const void *addr, unsigned long count) | ||
| 131 | { | ||
| 132 | volatile __u16 *p = port2adr(port); | ||
| 133 | const __u8 *ap = addr; | ||
| 134 | |||
| 135 | if (shifted_port(port)) { | ||
| 136 | while (count--) | ||
| 137 | *p = *ap++ << 8; | ||
| 138 | } else { | ||
| 139 | while (count--) | ||
| 140 | *p = *ap++; | ||
| 141 | } | ||
| 142 | } | ||
| 143 | |||
| 144 | void se_outsw(unsigned long port, const void *addr, unsigned long count) | ||
| 145 | { | ||
| 146 | volatile __u16 *p = port2adr(port); | ||
| 147 | const __u16 *ap = addr; | ||
| 148 | |||
| 149 | while (count--) | ||
| 150 | *p = *ap++; | ||
| 151 | } | ||
| 152 | |||
| 153 | void se_outsl(unsigned long port, const void *addr, unsigned long count) | ||
| 154 | { | ||
| 155 | maybebadio(port); | ||
| 156 | } | ||
diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/770x/setup.c index 66d39d1b0901..31330c65c0ce 100644 --- a/arch/sh/boards/mach-se/770x/setup.c +++ b/arch/sh/boards/mach-se/770x/setup.c | |||
| @@ -195,27 +195,5 @@ static struct sh_machine_vector mv_se __initmv = { | |||
| 195 | #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) | 195 | #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) |
| 196 | .mv_nr_irqs = 104, | 196 | .mv_nr_irqs = 104, |
| 197 | #endif | 197 | #endif |
| 198 | |||
| 199 | .mv_inb = se_inb, | ||
| 200 | .mv_inw = se_inw, | ||
| 201 | .mv_inl = se_inl, | ||
| 202 | .mv_outb = se_outb, | ||
| 203 | .mv_outw = se_outw, | ||
| 204 | .mv_outl = se_outl, | ||
| 205 | |||
| 206 | .mv_inb_p = se_inb_p, | ||
| 207 | .mv_inw_p = se_inw, | ||
| 208 | .mv_inl_p = se_inl, | ||
| 209 | .mv_outb_p = se_outb_p, | ||
| 210 | .mv_outw_p = se_outw, | ||
| 211 | .mv_outl_p = se_outl, | ||
| 212 | |||
| 213 | .mv_insb = se_insb, | ||
| 214 | .mv_insw = se_insw, | ||
| 215 | .mv_insl = se_insl, | ||
| 216 | .mv_outsb = se_outsb, | ||
| 217 | .mv_outsw = se_outsw, | ||
| 218 | .mv_outsl = se_outsl, | ||
| 219 | |||
| 220 | .mv_init_irq = init_se_IRQ, | 198 | .mv_init_irq = init_se_IRQ, |
| 221 | }; | 199 | }; |
diff --git a/arch/sh/boards/mach-se/7751/Makefile b/arch/sh/boards/mach-se/7751/Makefile index e6f4341bfe6e..a338fd9d5039 100644 --- a/arch/sh/boards/mach-se/7751/Makefile +++ b/arch/sh/boards/mach-se/7751/Makefile | |||
| @@ -2,4 +2,4 @@ | |||
| 2 | # Makefile for the 7751 SolutionEngine specific parts of the kernel | 2 | # Makefile for the 7751 SolutionEngine specific parts of the kernel |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := setup.o io.o irq.o | 5 | obj-y := setup.o irq.o |
diff --git a/arch/sh/boards/mach-se/7751/io.c b/arch/sh/boards/mach-se/7751/io.c deleted file mode 100644 index 6e75bd4459e5..000000000000 --- a/arch/sh/boards/mach-se/7751/io.c +++ /dev/null | |||
| @@ -1,119 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel | ||
| 3 | * Based largely on io_se.c. | ||
| 4 | * | ||
| 5 | * I/O routine for Hitachi 7751 SolutionEngine. | ||
| 6 | * | ||
| 7 | * Initial version only to support LAN access; some | ||
| 8 | * placeholder code from io_se.c left in with the | ||
| 9 | * expectation of later SuperIO and PCMCIA access. | ||
| 10 | */ | ||
| 11 | #include <linux/kernel.h> | ||
| 12 | #include <linux/types.h> | ||
| 13 | #include <linux/pci.h> | ||
| 14 | #include <asm/io.h> | ||
| 15 | #include <mach-se/mach/se7751.h> | ||
| 16 | #include <asm/addrspace.h> | ||
| 17 | |||
| 18 | static inline volatile u16 *port2adr(unsigned int port) | ||
| 19 | { | ||
| 20 | if (port >= 0x2000) | ||
| 21 | return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); | ||
| 22 | maybebadio((unsigned long)port); | ||
| 23 | return (volatile __u16*)port; | ||
| 24 | } | ||
| 25 | |||
| 26 | /* | ||
| 27 | * General outline: remap really low stuff [eventually] to SuperIO, | ||
| 28 | * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) | ||
| 29 | * is mapped through the PCI IO window. Stuff with high bits (PXSEG) | ||
| 30 | * should be way beyond the window, and is used w/o translation for | ||
| 31 | * compatibility. | ||
| 32 | */ | ||
| 33 | unsigned char sh7751se_inb(unsigned long port) | ||
| 34 | { | ||
| 35 | if (PXSEG(port)) | ||
| 36 | return *(volatile unsigned char *)port; | ||
| 37 | else | ||
| 38 | return (*port2adr(port)) & 0xff; | ||
| 39 | } | ||
| 40 | |||
| 41 | unsigned char sh7751se_inb_p(unsigned long port) | ||
| 42 | { | ||
| 43 | unsigned char v; | ||
| 44 | |||
| 45 | if (PXSEG(port)) | ||
| 46 | v = *(volatile unsigned char *)port; | ||
| 47 | else | ||
| 48 | v = (*port2adr(port)) & 0xff; | ||
| 49 | ctrl_delay(); | ||
| 50 | return v; | ||
| 51 | } | ||
| 52 | |||
| 53 | unsigned short sh7751se_inw(unsigned long port) | ||
| 54 | { | ||
| 55 | if (PXSEG(port)) | ||
| 56 | return *(volatile unsigned short *)port; | ||
| 57 | else if (port >= 0x2000) | ||
| 58 | return *port2adr(port); | ||
| 59 | else | ||
| 60 | maybebadio(port); | ||
| 61 | return 0; | ||
| 62 | } | ||
| 63 | |||
| 64 | unsigned int sh7751se_inl(unsigned long port) | ||
| 65 | { | ||
| 66 | if (PXSEG(port)) | ||
| 67 | return *(volatile unsigned long *)port; | ||
| 68 | else if (port >= 0x2000) | ||
| 69 | return *port2adr(port); | ||
| 70 | else | ||
| 71 | maybebadio(port); | ||
| 72 | return 0; | ||
| 73 | } | ||
| 74 | |||
| 75 | void sh7751se_outb(unsigned char value, unsigned long port) | ||
| 76 | { | ||
| 77 | |||
| 78 | if (PXSEG(port)) | ||
| 79 | *(volatile unsigned char *)port = value; | ||
| 80 | else | ||
| 81 | *(port2adr(port)) = value; | ||
| 82 | } | ||
| 83 | |||
| 84 | void sh7751se_outb_p(unsigned char value, unsigned long port) | ||
| 85 | { | ||
| 86 | if (PXSEG(port)) | ||
| 87 | *(volatile unsigned char *)port = value; | ||
| 88 | else | ||
| 89 | *(port2adr(port)) = value; | ||
| 90 | ctrl_delay(); | ||
| 91 | } | ||
| 92 | |||
| 93 | void sh7751se_outw(unsigned short value, unsigned long port) | ||
| 94 | { | ||
| 95 | if (PXSEG(port)) | ||
| 96 | *(volatile unsigned short *)port = value; | ||
| 97 | else if (port >= 0x2000) | ||
| 98 | *port2adr(port) = value; | ||
| 99 | else | ||
| 100 | maybebadio(port); | ||
| 101 | } | ||
| 102 | |||
| 103 | void sh7751se_outl(unsigned int value, unsigned long port) | ||
| 104 | { | ||
| 105 | if (PXSEG(port)) | ||
| 106 | *(volatile unsigned long *)port = value; | ||
| 107 | else | ||
| 108 | maybebadio(port); | ||
| 109 | } | ||
| 110 | |||
| 111 | void sh7751se_insl(unsigned long port, void *addr, unsigned long count) | ||
| 112 | { | ||
| 113 | maybebadio(port); | ||
| 114 | } | ||
| 115 | |||
| 116 | void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count) | ||
| 117 | { | ||
| 118 | maybebadio(port); | ||
| 119 | } | ||
diff --git a/arch/sh/boards/mach-se/7751/setup.c b/arch/sh/boards/mach-se/7751/setup.c index 50572512e3e8..9fbc51beb181 100644 --- a/arch/sh/boards/mach-se/7751/setup.c +++ b/arch/sh/boards/mach-se/7751/setup.c | |||
| @@ -56,23 +56,5 @@ __initcall(se7751_devices_setup); | |||
| 56 | static struct sh_machine_vector mv_7751se __initmv = { | 56 | static struct sh_machine_vector mv_7751se __initmv = { |
| 57 | .mv_name = "7751 SolutionEngine", | 57 | .mv_name = "7751 SolutionEngine", |
| 58 | .mv_nr_irqs = 72, | 58 | .mv_nr_irqs = 72, |
| 59 | |||
| 60 | .mv_inb = sh7751se_inb, | ||
| 61 | .mv_inw = sh7751se_inw, | ||
| 62 | .mv_inl = sh7751se_inl, | ||
| 63 | .mv_outb = sh7751se_outb, | ||
| 64 | .mv_outw = sh7751se_outw, | ||
| 65 | .mv_outl = sh7751se_outl, | ||
| 66 | |||
| 67 | .mv_inb_p = sh7751se_inb_p, | ||
| 68 | .mv_inw_p = sh7751se_inw, | ||
| 69 | .mv_inl_p = sh7751se_inl, | ||
| 70 | .mv_outb_p = sh7751se_outb_p, | ||
| 71 | .mv_outw_p = sh7751se_outw, | ||
| 72 | .mv_outl_p = sh7751se_outl, | ||
| 73 | |||
| 74 | .mv_insl = sh7751se_insl, | ||
| 75 | .mv_outsl = sh7751se_outsl, | ||
| 76 | |||
| 77 | .mv_init_irq = init_7751se_IRQ, | 59 | .mv_init_irq = init_7751se_IRQ, |
| 78 | }; | 60 | }; |
diff --git a/arch/sh/boards/mach-snapgear/Makefile b/arch/sh/boards/mach-snapgear/Makefile deleted file mode 100644 index d2d2f4b6a502..000000000000 --- a/arch/sh/boards/mach-snapgear/Makefile +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Makefile for the SnapGear specific parts of the kernel | ||
| 3 | # | ||
| 4 | |||
| 5 | obj-y := setup.o io.o | ||
diff --git a/arch/sh/boards/mach-snapgear/io.c b/arch/sh/boards/mach-snapgear/io.c deleted file mode 100644 index 476650e42dbc..000000000000 --- a/arch/sh/boards/mach-snapgear/io.c +++ /dev/null | |||
| @@ -1,121 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2002 David McCullough <davidm@snapgear.com> | ||
| 3 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel | ||
| 4 | * Based largely on io_se.c. | ||
| 5 | * | ||
| 6 | * I/O routine for Hitachi 7751 SolutionEngine. | ||
| 7 | * | ||
| 8 | * Initial version only to support LAN access; some | ||
| 9 | * placeholder code from io_se.c left in with the | ||
| 10 | * expectation of later SuperIO and PCMCIA access. | ||
| 11 | */ | ||
| 12 | #include <linux/kernel.h> | ||
| 13 | #include <linux/types.h> | ||
| 14 | #include <linux/pci.h> | ||
| 15 | #include <asm/io.h> | ||
| 16 | #include <asm/addrspace.h> | ||
| 17 | |||
| 18 | #ifdef CONFIG_SH_SECUREEDGE5410 | ||
| 19 | unsigned short secureedge5410_ioport; | ||
| 20 | #endif | ||
| 21 | |||
| 22 | static inline volatile __u16 *port2adr(unsigned int port) | ||
| 23 | { | ||
| 24 | maybebadio((unsigned long)port); | ||
| 25 | return (volatile __u16*)port; | ||
| 26 | } | ||
| 27 | |||
| 28 | /* | ||
| 29 | * General outline: remap really low stuff [eventually] to SuperIO, | ||
| 30 | * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) | ||
| 31 | * is mapped through the PCI IO window. Stuff with high bits (PXSEG) | ||
| 32 | * should be way beyond the window, and is used w/o translation for | ||
| 33 | * compatibility. | ||
| 34 | */ | ||
| 35 | unsigned char snapgear_inb(unsigned long port) | ||
| 36 | { | ||
| 37 | if (PXSEG(port)) | ||
| 38 | return *(volatile unsigned char *)port; | ||
| 39 | else | ||
| 40 | return (*port2adr(port)) & 0xff; | ||
| 41 | } | ||
| 42 | |||
| 43 | unsigned char snapgear_inb_p(unsigned long port) | ||
| 44 | { | ||
| 45 | unsigned char v; | ||
| 46 | |||
| 47 | if (PXSEG(port)) | ||
| 48 | v = *(volatile unsigned char *)port; | ||
| 49 | else | ||
| 50 | v = (*port2adr(port))&0xff; | ||
| 51 | ctrl_delay(); | ||
| 52 | return v; | ||
| 53 | } | ||
| 54 | |||
| 55 | unsigned short snapgear_inw(unsigned long port) | ||
| 56 | { | ||
| 57 | if (PXSEG(port)) | ||
| 58 | return *(volatile unsigned short *)port; | ||
| 59 | else if (port >= 0x2000) | ||
| 60 | return *port2adr(port); | ||
| 61 | else | ||
| 62 | maybebadio(port); | ||
| 63 | return 0; | ||
| 64 | } | ||
| 65 | |||
| 66 | unsigned int snapgear_inl(unsigned long port) | ||
| 67 | { | ||
| 68 | if (PXSEG(port)) | ||
| 69 | return *(volatile unsigned long *)port; | ||
| 70 | else if (port >= 0x2000) | ||
| 71 | return *port2adr(port); | ||
| 72 | else | ||
| 73 | maybebadio(port); | ||
| 74 | return 0; | ||
| 75 | } | ||
| 76 | |||
| 77 | void snapgear_outb(unsigned char value, unsigned long port) | ||
| 78 | { | ||
| 79 | |||
| 80 | if (PXSEG(port)) | ||
| 81 | *(volatile unsigned char *)port = value; | ||
| 82 | else | ||
| 83 | *(port2adr(port)) = value; | ||
| 84 | } | ||
| 85 | |||
| 86 | void snapgear_outb_p(unsigned char value, unsigned long port) | ||
| 87 | { | ||
| 88 | if (PXSEG(port)) | ||
| 89 | *(volatile unsigned char *)port = value; | ||
| 90 | else | ||
| 91 | *(port2adr(port)) = value; | ||
| 92 | ctrl_delay(); | ||
| 93 | } | ||
| 94 | |||
| 95 | void snapgear_outw(unsigned short value, unsigned long port) | ||
| 96 | { | ||
| 97 | if (PXSEG(port)) | ||
| 98 | *(volatile unsigned short *)port = value; | ||
| 99 | else if (port >= 0x2000) | ||
| 100 | *port2adr(port) = value; | ||
| 101 | else | ||
| 102 | maybebadio(port); | ||
| 103 | } | ||
| 104 | |||
| 105 | void snapgear_outl(unsigned int value, unsigned long port) | ||
| 106 | { | ||
| 107 | if (PXSEG(port)) | ||
| 108 | *(volatile unsigned long *)port = value; | ||
| 109 | else | ||
| 110 | maybebadio(port); | ||
| 111 | } | ||
| 112 | |||
| 113 | void snapgear_insl(unsigned long port, void *addr, unsigned long count) | ||
| 114 | { | ||
| 115 | maybebadio(port); | ||
| 116 | } | ||
| 117 | |||
| 118 | void snapgear_outsl(unsigned long port, const void *addr, unsigned long count) | ||
| 119 | { | ||
| 120 | maybebadio(port); | ||
| 121 | } | ||
diff --git a/arch/sh/boards/mach-systemh/Makefile b/arch/sh/boards/mach-systemh/Makefile deleted file mode 100644 index 2cc6a23d9d39..000000000000 --- a/arch/sh/boards/mach-systemh/Makefile +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Makefile for the SystemH specific parts of the kernel | ||
| 3 | # | ||
| 4 | |||
| 5 | obj-y := setup.o irq.o io.o | ||
| 6 | |||
| 7 | # XXX: This wants to be consolidated in arch/sh/drivers/pci, and more | ||
| 8 | # importantly, with the generic sh7751_pcic_init() code. For now, we'll | ||
| 9 | # just abuse the hell out of kbuild, because we can.. | ||
| 10 | |||
| 11 | obj-$(CONFIG_PCI) += pci.o | ||
| 12 | pci-y := ../../se/7751/pci.o | ||
| 13 | |||
diff --git a/arch/sh/boards/mach-systemh/io.c b/arch/sh/boards/mach-systemh/io.c deleted file mode 100644 index 15577ff1f715..000000000000 --- a/arch/sh/boards/mach-systemh/io.c +++ /dev/null | |||
| @@ -1,158 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/sh/boards/renesas/systemh/io.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel | ||
| 5 | * Based largely on io_se.c. | ||
| 6 | * | ||
| 7 | * I/O routine for Hitachi 7751 Systemh. | ||
| 8 | */ | ||
| 9 | #include <linux/kernel.h> | ||
| 10 | #include <linux/types.h> | ||
| 11 | #include <linux/pci.h> | ||
| 12 | #include <mach/systemh7751.h> | ||
| 13 | #include <asm/addrspace.h> | ||
| 14 | #include <asm/io.h> | ||
| 15 | |||
| 16 | #define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area | ||
| 17 | of smc lan chip*/ | ||
| 18 | static inline volatile __u16 * | ||
| 19 | port2adr(unsigned int port) | ||
| 20 | { | ||
| 21 | if (port >= 0x2000) | ||
| 22 | return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); | ||
| 23 | maybebadio((unsigned long)port); | ||
| 24 | return (volatile __u16*)port; | ||
| 25 | } | ||
| 26 | |||
| 27 | /* | ||
| 28 | * General outline: remap really low stuff [eventually] to SuperIO, | ||
| 29 | * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) | ||
| 30 | * is mapped through the PCI IO window. Stuff with high bits (PXSEG) | ||
| 31 | * should be way beyond the window, and is used w/o translation for | ||
| 32 | * compatibility. | ||
| 33 | */ | ||
| 34 | unsigned char sh7751systemh_inb(unsigned long port) | ||
| 35 | { | ||
| 36 | if (PXSEG(port)) | ||
| 37 | return *(volatile unsigned char *)port; | ||
| 38 | else if (port <= 0x3F1) | ||
| 39 | return *(volatile unsigned char *)ETHER_IOMAP(port); | ||
| 40 | else | ||
| 41 | return (*port2adr(port))&0xff; | ||
| 42 | } | ||
| 43 | |||
| 44 | unsigned char sh7751systemh_inb_p(unsigned long port) | ||
| 45 | { | ||
| 46 | unsigned char v; | ||
| 47 | |||
| 48 | if (PXSEG(port)) | ||
| 49 | v = *(volatile unsigned char *)port; | ||
| 50 | else if (port <= 0x3F1) | ||
| 51 | v = *(volatile unsigned char *)ETHER_IOMAP(port); | ||
| 52 | else | ||
| 53 | v = (*port2adr(port))&0xff; | ||
| 54 | ctrl_delay(); | ||
| 55 | return v; | ||
| 56 | } | ||
| 57 | |||
| 58 | unsigned short sh7751systemh_inw(unsigned long port) | ||
| 59 | { | ||
| 60 | if (PXSEG(port)) | ||
| 61 | return *(volatile unsigned short *)port; | ||
| 62 | else if (port >= 0x2000) | ||
| 63 | return *port2adr(port); | ||
| 64 | else if (port <= 0x3F1) | ||
| 65 | return *(volatile unsigned int *)ETHER_IOMAP(port); | ||
| 66 | else | ||
| 67 | maybebadio(port); | ||
| 68 | return 0; | ||
| 69 | } | ||
| 70 | |||
| 71 | unsigned int sh7751systemh_inl(unsigned long port) | ||
| 72 | { | ||
| 73 | if (PXSEG(port)) | ||
| 74 | return *(volatile unsigned long *)port; | ||
| 75 | else if (port >= 0x2000) | ||
| 76 | return *port2adr(port); | ||
| 77 | else if (port <= 0x3F1) | ||
| 78 | return *(volatile unsigned int *)ETHER_IOMAP(port); | ||
| 79 | else | ||
| 80 | maybebadio(port); | ||
| 81 | return 0; | ||
| 82 | } | ||
| 83 | |||
| 84 | void sh7751systemh_outb(unsigned char value, unsigned long port) | ||
| 85 | { | ||
| 86 | |||
| 87 | if (PXSEG(port)) | ||
| 88 | *(volatile unsigned char *)port = value; | ||
| 89 | else if (port <= 0x3F1) | ||
| 90 | *(volatile unsigned char *)ETHER_IOMAP(port) = value; | ||
| 91 | else | ||
| 92 | *(port2adr(port)) = value; | ||
| 93 | } | ||
| 94 | |||
| 95 | void sh7751systemh_outb_p(unsigned char value, unsigned long port) | ||
| 96 | { | ||
| 97 | if (PXSEG(port)) | ||
| 98 | *(volatile unsigned char *)port = value; | ||
| 99 | else if (port <= 0x3F1) | ||
| 100 | *(volatile unsigned char *)ETHER_IOMAP(port) = value; | ||
| 101 | else | ||
| 102 | *(port2adr(port)) = value; | ||
| 103 | ctrl_delay(); | ||
| 104 | } | ||
| 105 | |||
| 106 | void sh7751systemh_outw(unsigned short value, unsigned long port) | ||
| 107 | { | ||
| 108 | if (PXSEG(port)) | ||
| 109 | *(volatile unsigned short *)port = value; | ||
| 110 | else if (port >= 0x2000) | ||
| 111 | *port2adr(port) = value; | ||
| 112 | else if (port <= 0x3F1) | ||
| 113 | *(volatile unsigned short *)ETHER_IOMAP(port) = value; | ||
| 114 | else | ||
| 115 | maybebadio(port); | ||
| 116 | } | ||
| 117 | |||
| 118 | void sh7751systemh_outl(unsigned int value, unsigned long port) | ||
| 119 | { | ||
| 120 | if (PXSEG(port)) | ||
| 121 | *(volatile unsigned long *)port = value; | ||
| 122 | else | ||
| 123 | maybebadio(port); | ||
| 124 | } | ||
| 125 | |||
| 126 | void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count) | ||
| 127 | { | ||
| 128 | unsigned char *p = addr; | ||
| 129 | while (count--) *p++ = sh7751systemh_inb(port); | ||
| 130 | } | ||
| 131 | |||
| 132 | void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count) | ||
| 133 | { | ||
| 134 | unsigned short *p = addr; | ||
| 135 | while (count--) *p++ = sh7751systemh_inw(port); | ||
| 136 | } | ||
| 137 | |||
| 138 | void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count) | ||
| 139 | { | ||
| 140 | maybebadio(port); | ||
| 141 | } | ||
| 142 | |||
| 143 | void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count) | ||
| 144 | { | ||
| 145 | unsigned char *p = (unsigned char*)addr; | ||
| 146 | while (count--) sh7751systemh_outb(*p++, port); | ||
| 147 | } | ||
| 148 | |||
| 149 | void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count) | ||
| 150 | { | ||
| 151 | unsigned short *p = (unsigned short*)addr; | ||
| 152 | while (count--) sh7751systemh_outw(*p++, port); | ||
| 153 | } | ||
| 154 | |||
| 155 | void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count) | ||
| 156 | { | ||
| 157 | maybebadio(port); | ||
| 158 | } | ||
diff --git a/arch/sh/boards/mach-systemh/irq.c b/arch/sh/boards/mach-systemh/irq.c deleted file mode 100644 index e5ee13adeff4..000000000000 --- a/arch/sh/boards/mach-systemh/irq.c +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/sh/boards/renesas/systemh/irq.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2000 Kazumoto Kojima | ||
| 5 | * | ||
| 6 | * Hitachi SystemH Support. | ||
| 7 | * | ||
| 8 | * Modified for 7751 SystemH by | ||
| 9 | * Jonathan Short. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/init.h> | ||
| 13 | #include <linux/irq.h> | ||
| 14 | #include <linux/interrupt.h> | ||
| 15 | #include <linux/io.h> | ||
| 16 | |||
| 17 | #include <mach/systemh7751.h> | ||
| 18 | #include <asm/smc37c93x.h> | ||
| 19 | |||
| 20 | /* address of external interrupt mask register | ||
| 21 | * address must be set prior to use these (maybe in init_XXX_irq()) | ||
| 22 | * XXX : is it better to use .config than specifying it in code? */ | ||
| 23 | static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; | ||
| 24 | static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; | ||
| 25 | |||
| 26 | static void disable_systemh_irq(struct irq_data *data) | ||
| 27 | { | ||
| 28 | unsigned long val, mask = 0x01 << 1; | ||
| 29 | |||
| 30 | /* Clear the "irq"th bit in the mask and set it in the request */ | ||
| 31 | val = __raw_readl((unsigned long)systemh_irq_mask_register); | ||
| 32 | val &= ~mask; | ||
| 33 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); | ||
| 34 | |||
| 35 | val = __raw_readl((unsigned long)systemh_irq_request_register); | ||
| 36 | val |= mask; | ||
| 37 | __raw_writel(val, (unsigned long)systemh_irq_request_register); | ||
| 38 | } | ||
| 39 | |||
| 40 | static void enable_systemh_irq(struct irq_data *data) | ||
| 41 | { | ||
| 42 | unsigned long val, mask = 0x01 << 1; | ||
| 43 | |||
| 44 | /* Set "irq"th bit in the mask register */ | ||
| 45 | val = __raw_readl((unsigned long)systemh_irq_mask_register); | ||
| 46 | val |= mask; | ||
| 47 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); | ||
| 48 | } | ||
| 49 | |||
| 50 | static struct irq_chip systemh_irq_type = { | ||
| 51 | .name = "SystemH Register", | ||
| 52 | .irq_unmask = enable_systemh_irq, | ||
| 53 | .irq_mask = disable_systemh_irq, | ||
| 54 | }; | ||
| 55 | |||
| 56 | void make_systemh_irq(unsigned int irq) | ||
| 57 | { | ||
| 58 | disable_irq_nosync(irq); | ||
| 59 | set_irq_chip_and_handler(irq, &systemh_irq_type, handle_level_irq); | ||
| 60 | disable_systemh_irq(irq_get_irq_data(irq)); | ||
| 61 | } | ||
diff --git a/arch/sh/boards/mach-systemh/setup.c b/arch/sh/boards/mach-systemh/setup.c deleted file mode 100644 index 219fd800a43f..000000000000 --- a/arch/sh/boards/mach-systemh/setup.c +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/sh/boards/renesas/systemh/setup.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2000 Kazumoto Kojima | ||
| 5 | * Copyright (C) 2003 Paul Mundt | ||
| 6 | * | ||
| 7 | * Hitachi SystemH Support. | ||
| 8 | * | ||
| 9 | * Modified for 7751 SystemH by Jonathan Short. | ||
| 10 | * | ||
| 11 | * Rewritten for 2.6 by Paul Mundt. | ||
| 12 | * | ||
| 13 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 14 | * License. See the file "COPYING" in the main directory of this archive | ||
| 15 | * for more details. | ||
| 16 | */ | ||
| 17 | #include <linux/init.h> | ||
| 18 | #include <asm/machvec.h> | ||
| 19 | #include <mach/systemh7751.h> | ||
| 20 | |||
| 21 | extern void make_systemh_irq(unsigned int irq); | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Initialize IRQ setting | ||
| 25 | */ | ||
| 26 | static void __init sh7751systemh_init_irq(void) | ||
| 27 | { | ||
| 28 | make_systemh_irq(0xb); /* Ethernet interrupt */ | ||
| 29 | } | ||
| 30 | |||
| 31 | static struct sh_machine_vector mv_7751systemh __initmv = { | ||
| 32 | .mv_name = "7751 SystemH", | ||
| 33 | .mv_nr_irqs = 72, | ||
| 34 | |||
| 35 | .mv_inb = sh7751systemh_inb, | ||
| 36 | .mv_inw = sh7751systemh_inw, | ||
| 37 | .mv_inl = sh7751systemh_inl, | ||
| 38 | .mv_outb = sh7751systemh_outb, | ||
| 39 | .mv_outw = sh7751systemh_outw, | ||
| 40 | .mv_outl = sh7751systemh_outl, | ||
| 41 | |||
| 42 | .mv_inb_p = sh7751systemh_inb_p, | ||
| 43 | .mv_inw_p = sh7751systemh_inw, | ||
| 44 | .mv_inl_p = sh7751systemh_inl, | ||
| 45 | .mv_outb_p = sh7751systemh_outb_p, | ||
| 46 | .mv_outw_p = sh7751systemh_outw, | ||
| 47 | .mv_outl_p = sh7751systemh_outl, | ||
| 48 | |||
| 49 | .mv_insb = sh7751systemh_insb, | ||
| 50 | .mv_insw = sh7751systemh_insw, | ||
| 51 | .mv_insl = sh7751systemh_insl, | ||
| 52 | .mv_outsb = sh7751systemh_outsb, | ||
| 53 | .mv_outsw = sh7751systemh_outsw, | ||
| 54 | .mv_outsl = sh7751systemh_outsl, | ||
| 55 | |||
| 56 | .mv_init_irq = sh7751systemh_init_irq, | ||
| 57 | }; | ||
diff --git a/arch/sh/configs/snapgear_defconfig b/arch/sh/configs/secureedge5410_defconfig index 7eae4e59d7f0..7eae4e59d7f0 100644 --- a/arch/sh/configs/snapgear_defconfig +++ b/arch/sh/configs/secureedge5410_defconfig | |||
diff --git a/arch/sh/configs/systemh_defconfig b/arch/sh/configs/systemh_defconfig deleted file mode 100644 index b58dfc505efe..000000000000 --- a/arch/sh/configs/systemh_defconfig +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 3 | CONFIG_BLK_DEV_INITRD=y | ||
| 4 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
| 5 | # CONFIG_SYSCTL_SYSCALL is not set | ||
| 6 | # CONFIG_HOTPLUG is not set | ||
| 7 | CONFIG_SLAB=y | ||
| 8 | CONFIG_MODULES=y | ||
| 9 | CONFIG_MODULE_UNLOAD=y | ||
| 10 | # CONFIG_BLK_DEV_BSG is not set | ||
| 11 | CONFIG_CPU_SUBTYPE_SH7751R=y | ||
| 12 | CONFIG_MEMORY_START=0x0c000000 | ||
| 13 | CONFIG_MEMORY_SIZE=0x00400000 | ||
| 14 | CONFIG_FLATMEM_MANUAL=y | ||
| 15 | CONFIG_SH_7751_SYSTEMH=y | ||
| 16 | CONFIG_PREEMPT=y | ||
| 17 | # CONFIG_STANDALONE is not set | ||
| 18 | CONFIG_BLK_DEV_RAM=y | ||
| 19 | CONFIG_BLK_DEV_RAM_SIZE=1024 | ||
| 20 | # CONFIG_INPUT is not set | ||
| 21 | # CONFIG_SERIO_SERPORT is not set | ||
| 22 | # CONFIG_VT is not set | ||
| 23 | CONFIG_HW_RANDOM=y | ||
| 24 | CONFIG_PROC_KCORE=y | ||
| 25 | CONFIG_TMPFS=y | ||
| 26 | CONFIG_CRAMFS=y | ||
| 27 | CONFIG_ROMFS_FS=y | ||
| 28 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
diff --git a/arch/sh/include/asm/addrspace.h b/arch/sh/include/asm/addrspace.h index 446b3831c214..3d1ae2bfaa6f 100644 --- a/arch/sh/include/asm/addrspace.h +++ b/arch/sh/include/asm/addrspace.h | |||
| @@ -44,10 +44,10 @@ | |||
| 44 | /* | 44 | /* |
| 45 | * These will never work in 32-bit, don't even bother. | 45 | * These will never work in 32-bit, don't even bother. |
| 46 | */ | 46 | */ |
| 47 | #define P1SEGADDR(a) __futile_remapping_attempt | 47 | #define P1SEGADDR(a) ({ (void)(a); BUG(); NULL; }) |
| 48 | #define P2SEGADDR(a) __futile_remapping_attempt | 48 | #define P2SEGADDR(a) ({ (void)(a); BUG(); NULL; }) |
| 49 | #define P3SEGADDR(a) __futile_remapping_attempt | 49 | #define P3SEGADDR(a) ({ (void)(a); BUG(); NULL; }) |
| 50 | #define P4SEGADDR(a) __futile_remapping_attempt | 50 | #define P4SEGADDR(a) ({ (void)(a); BUG(); NULL; }) |
| 51 | #endif | 51 | #endif |
| 52 | #endif /* P1SEG */ | 52 | #endif /* P1SEG */ |
| 53 | 53 | ||
diff --git a/arch/sh/include/asm/pgtable.h b/arch/sh/include/asm/pgtable.h index a15f1058bbf4..083ea068e819 100644 --- a/arch/sh/include/asm/pgtable.h +++ b/arch/sh/include/asm/pgtable.h | |||
| @@ -66,7 +66,6 @@ static inline unsigned long long neff_sign_extend(unsigned long val) | |||
| 66 | #define PHYS_ADDR_MASK29 0x1fffffff | 66 | #define PHYS_ADDR_MASK29 0x1fffffff |
| 67 | #define PHYS_ADDR_MASK32 0xffffffff | 67 | #define PHYS_ADDR_MASK32 0xffffffff |
| 68 | 68 | ||
| 69 | #ifdef CONFIG_PMB | ||
| 70 | static inline unsigned long phys_addr_mask(void) | 69 | static inline unsigned long phys_addr_mask(void) |
| 71 | { | 70 | { |
| 72 | /* Is the MMU in 29bit mode? */ | 71 | /* Is the MMU in 29bit mode? */ |
| @@ -75,17 +74,6 @@ static inline unsigned long phys_addr_mask(void) | |||
| 75 | 74 | ||
| 76 | return PHYS_ADDR_MASK32; | 75 | return PHYS_ADDR_MASK32; |
| 77 | } | 76 | } |
| 78 | #elif defined(CONFIG_32BIT) | ||
| 79 | static inline unsigned long phys_addr_mask(void) | ||
| 80 | { | ||
| 81 | return PHYS_ADDR_MASK32; | ||
| 82 | } | ||
| 83 | #else | ||
| 84 | static inline unsigned long phys_addr_mask(void) | ||
| 85 | { | ||
| 86 | return PHYS_ADDR_MASK29; | ||
| 87 | } | ||
| 88 | #endif | ||
| 89 | 77 | ||
| 90 | #define PTE_PHYS_MASK (phys_addr_mask() & PAGE_MASK) | 78 | #define PTE_PHYS_MASK (phys_addr_mask() & PAGE_MASK) |
| 91 | #define PTE_FLAGS_MASK (~(PTE_PHYS_MASK) << PAGE_SHIFT) | 79 | #define PTE_FLAGS_MASK (~(PTE_PHYS_MASK) << PAGE_SHIFT) |
diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h index 46d5179c9f49..e3c73cdd8c90 100644 --- a/arch/sh/include/asm/processor_32.h +++ b/arch/sh/include/asm/processor_32.h | |||
| @@ -199,10 +199,13 @@ extern unsigned long get_wchan(struct task_struct *p); | |||
| 199 | #define ARCH_HAS_PREFETCHW | 199 | #define ARCH_HAS_PREFETCHW |
| 200 | static inline void prefetch(void *x) | 200 | static inline void prefetch(void *x) |
| 201 | { | 201 | { |
| 202 | __asm__ __volatile__ ("pref @%0\n\t" : : "r" (x) : "memory"); | 202 | __builtin_prefetch(x, 0, 3); |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | #define prefetchw(x) prefetch(x) | 205 | static inline void prefetchw(void *x) |
| 206 | { | ||
| 207 | __builtin_prefetch(x, 1, 3); | ||
| 208 | } | ||
| 206 | #endif | 209 | #endif |
| 207 | 210 | ||
| 208 | #endif /* __KERNEL__ */ | 211 | #endif /* __KERNEL__ */ |
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h index 1f1af5afff03..10c8b1823a18 100644 --- a/arch/sh/include/asm/system.h +++ b/arch/sh/include/asm/system.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
| 11 | #include <linux/linkage.h> | 11 | #include <linux/linkage.h> |
| 12 | #include <asm/types.h> | 12 | #include <asm/types.h> |
| 13 | #include <asm/uncached.h> | ||
| 13 | 14 | ||
| 14 | #define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */ | 15 | #define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */ |
| 15 | 16 | ||
| @@ -137,9 +138,6 @@ extern unsigned int instruction_size(unsigned int insn); | |||
| 137 | #define instruction_size(insn) (4) | 138 | #define instruction_size(insn) (4) |
| 138 | #endif | 139 | #endif |
| 139 | 140 | ||
| 140 | extern unsigned long cached_to_uncached; | ||
| 141 | extern unsigned long uncached_size; | ||
| 142 | |||
| 143 | void per_cpu_trap_init(void); | 141 | void per_cpu_trap_init(void); |
| 144 | void default_idle(void); | 142 | void default_idle(void); |
| 145 | void cpu_idle_wait(void); | 143 | void cpu_idle_wait(void); |
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/system_32.h index c941b2739405..a4ad1cd9bc4d 100644 --- a/arch/sh/include/asm/system_32.h +++ b/arch/sh/include/asm/system_32.h | |||
| @@ -145,42 +145,6 @@ do { \ | |||
| 145 | __restore_dsp(prev); \ | 145 | __restore_dsp(prev); \ |
| 146 | } while (0) | 146 | } while (0) |
| 147 | 147 | ||
| 148 | /* | ||
| 149 | * Jump to uncached area. | ||
| 150 | * When handling TLB or caches, we need to do it from an uncached area. | ||
| 151 | */ | ||
| 152 | #define jump_to_uncached() \ | ||
| 153 | do { \ | ||
| 154 | unsigned long __dummy; \ | ||
| 155 | \ | ||
| 156 | __asm__ __volatile__( \ | ||
| 157 | "mova 1f, %0\n\t" \ | ||
| 158 | "add %1, %0\n\t" \ | ||
| 159 | "jmp @%0\n\t" \ | ||
| 160 | " nop\n\t" \ | ||
| 161 | ".balign 4\n" \ | ||
| 162 | "1:" \ | ||
| 163 | : "=&z" (__dummy) \ | ||
| 164 | : "r" (cached_to_uncached)); \ | ||
| 165 | } while (0) | ||
| 166 | |||
| 167 | /* | ||
| 168 | * Back to cached area. | ||
| 169 | */ | ||
| 170 | #define back_to_cached() \ | ||
| 171 | do { \ | ||
| 172 | unsigned long __dummy; \ | ||
| 173 | ctrl_barrier(); \ | ||
| 174 | __asm__ __volatile__( \ | ||
| 175 | "mov.l 1f, %0\n\t" \ | ||
| 176 | "jmp @%0\n\t" \ | ||
| 177 | " nop\n\t" \ | ||
| 178 | ".balign 4\n" \ | ||
| 179 | "1: .long 2f\n" \ | ||
| 180 | "2:" \ | ||
| 181 | : "=&r" (__dummy)); \ | ||
| 182 | } while (0) | ||
| 183 | |||
| 184 | #ifdef CONFIG_CPU_HAS_SR_RB | 148 | #ifdef CONFIG_CPU_HAS_SR_RB |
| 185 | #define lookup_exception_vector() \ | 149 | #define lookup_exception_vector() \ |
| 186 | ({ \ | 150 | ({ \ |
diff --git a/arch/sh/include/asm/system_64.h b/arch/sh/include/asm/system_64.h index 36338646dfc8..8593bc8d1a4e 100644 --- a/arch/sh/include/asm/system_64.h +++ b/arch/sh/include/asm/system_64.h | |||
| @@ -34,9 +34,6 @@ do { \ | |||
| 34 | &next->thread); \ | 34 | &next->thread); \ |
| 35 | } while (0) | 35 | } while (0) |
| 36 | 36 | ||
| 37 | #define jump_to_uncached() do { } while (0) | ||
| 38 | #define back_to_cached() do { } while (0) | ||
| 39 | |||
| 40 | #define __icbi(addr) __asm__ __volatile__ ( "icbi %0, 0\n\t" : : "r" (addr)) | 37 | #define __icbi(addr) __asm__ __volatile__ ( "icbi %0, 0\n\t" : : "r" (addr)) |
| 41 | #define __ocbp(addr) __asm__ __volatile__ ( "ocbp %0, 0\n\t" : : "r" (addr)) | 38 | #define __ocbp(addr) __asm__ __volatile__ ( "ocbp %0, 0\n\t" : : "r" (addr)) |
| 42 | #define __ocbi(addr) __asm__ __volatile__ ( "ocbi %0, 0\n\t" : : "r" (addr)) | 39 | #define __ocbi(addr) __asm__ __volatile__ ( "ocbi %0, 0\n\t" : : "r" (addr)) |
diff --git a/arch/sh/include/asm/uncached.h b/arch/sh/include/asm/uncached.h index e3419f96626a..6f8816b79cf1 100644 --- a/arch/sh/include/asm/uncached.h +++ b/arch/sh/include/asm/uncached.h | |||
| @@ -4,15 +4,55 @@ | |||
| 4 | #include <linux/bug.h> | 4 | #include <linux/bug.h> |
| 5 | 5 | ||
| 6 | #ifdef CONFIG_UNCACHED_MAPPING | 6 | #ifdef CONFIG_UNCACHED_MAPPING |
| 7 | extern unsigned long cached_to_uncached; | ||
| 8 | extern unsigned long uncached_size; | ||
| 7 | extern unsigned long uncached_start, uncached_end; | 9 | extern unsigned long uncached_start, uncached_end; |
| 8 | 10 | ||
| 9 | extern int virt_addr_uncached(unsigned long kaddr); | 11 | extern int virt_addr_uncached(unsigned long kaddr); |
| 10 | extern void uncached_init(void); | 12 | extern void uncached_init(void); |
| 11 | extern void uncached_resize(unsigned long size); | 13 | extern void uncached_resize(unsigned long size); |
| 14 | |||
| 15 | /* | ||
| 16 | * Jump to uncached area. | ||
| 17 | * When handling TLB or caches, we need to do it from an uncached area. | ||
| 18 | */ | ||
| 19 | #define jump_to_uncached() \ | ||
| 20 | do { \ | ||
| 21 | unsigned long __dummy; \ | ||
| 22 | \ | ||
| 23 | __asm__ __volatile__( \ | ||
| 24 | "mova 1f, %0\n\t" \ | ||
| 25 | "add %1, %0\n\t" \ | ||
| 26 | "jmp @%0\n\t" \ | ||
| 27 | " nop\n\t" \ | ||
| 28 | ".balign 4\n" \ | ||
| 29 | "1:" \ | ||
| 30 | : "=&z" (__dummy) \ | ||
| 31 | : "r" (cached_to_uncached)); \ | ||
| 32 | } while (0) | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Back to cached area. | ||
| 36 | */ | ||
| 37 | #define back_to_cached() \ | ||
| 38 | do { \ | ||
| 39 | unsigned long __dummy; \ | ||
| 40 | ctrl_barrier(); \ | ||
| 41 | __asm__ __volatile__( \ | ||
| 42 | "mov.l 1f, %0\n\t" \ | ||
| 43 | "jmp @%0\n\t" \ | ||
| 44 | " nop\n\t" \ | ||
| 45 | ".balign 4\n" \ | ||
| 46 | "1: .long 2f\n" \ | ||
| 47 | "2:" \ | ||
| 48 | : "=&r" (__dummy)); \ | ||
| 49 | } while (0) | ||
| 12 | #else | 50 | #else |
| 13 | #define virt_addr_uncached(kaddr) (0) | 51 | #define virt_addr_uncached(kaddr) (0) |
| 14 | #define uncached_init() do { } while (0) | 52 | #define uncached_init() do { } while (0) |
| 15 | #define uncached_resize(size) BUG() | 53 | #define uncached_resize(size) BUG() |
| 54 | #define jump_to_uncached() do { } while (0) | ||
| 55 | #define back_to_cached() do { } while (0) | ||
| 16 | #endif | 56 | #endif |
| 17 | 57 | ||
| 18 | #endif /* __ASM_SH_UNCACHED_H */ | 58 | #endif /* __ASM_SH_UNCACHED_H */ |
diff --git a/arch/sh/include/mach-common/mach/edosk7705.h b/arch/sh/include/mach-common/mach/edosk7705.h deleted file mode 100644 index efc43b323466..000000000000 --- a/arch/sh/include/mach-common/mach/edosk7705.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef __ASM_SH_EDOSK7705_H | ||
| 2 | #define __ASM_SH_EDOSK7705_H | ||
| 3 | |||
| 4 | #define __IO_PREFIX sh_edosk7705 | ||
| 5 | #include <asm/io_generic.h> | ||
| 6 | |||
| 7 | #endif /* __ASM_SH_EDOSK7705_H */ | ||
diff --git a/arch/sh/include/mach-common/mach/microdev.h b/arch/sh/include/mach-common/mach/microdev.h index 1aed15856e11..dcb05fa8c164 100644 --- a/arch/sh/include/mach-common/mach/microdev.h +++ b/arch/sh/include/mach-common/mach/microdev.h | |||
| @@ -68,13 +68,4 @@ extern void microdev_print_fpga_intc_status(void); | |||
| 68 | #define __IO_PREFIX microdev | 68 | #define __IO_PREFIX microdev |
| 69 | #include <asm/io_generic.h> | 69 | #include <asm/io_generic.h> |
| 70 | 70 | ||
| 71 | #if defined(CONFIG_PCI) | ||
| 72 | unsigned char microdev_pci_inb(unsigned long port); | ||
| 73 | unsigned short microdev_pci_inw(unsigned long port); | ||
| 74 | unsigned long microdev_pci_inl(unsigned long port); | ||
| 75 | void microdev_pci_outb(unsigned char data, unsigned long port); | ||
| 76 | void microdev_pci_outw(unsigned short data, unsigned long port); | ||
| 77 | void microdev_pci_outl(unsigned long data, unsigned long port); | ||
| 78 | #endif | ||
| 79 | |||
| 80 | #endif /* __ASM_SH_MICRODEV_H */ | 71 | #endif /* __ASM_SH_MICRODEV_H */ |
diff --git a/arch/sh/include/mach-common/mach/snapgear.h b/arch/sh/include/mach-common/mach/secureedge5410.h index 042d95f51c4d..3653b9a4bacc 100644 --- a/arch/sh/include/mach-common/mach/snapgear.h +++ b/arch/sh/include/mach-common/mach/secureedge5410.h | |||
| @@ -12,30 +12,9 @@ | |||
| 12 | #ifndef _ASM_SH_IO_SNAPGEAR_H | 12 | #ifndef _ASM_SH_IO_SNAPGEAR_H |
| 13 | #define _ASM_SH_IO_SNAPGEAR_H | 13 | #define _ASM_SH_IO_SNAPGEAR_H |
| 14 | 14 | ||
| 15 | #if defined(CONFIG_CPU_SH4) | ||
| 16 | /* | ||
| 17 | * The external interrupt lines, these take up ints 0 - 15 inclusive | ||
| 18 | * depending on the priority for the interrupt. In fact the priority | ||
| 19 | * is the interrupt :-) | ||
| 20 | */ | ||
| 21 | |||
| 22 | #define IRL0_IRQ 2 | ||
| 23 | #define IRL0_PRIORITY 13 | ||
| 24 | |||
| 25 | #define IRL1_IRQ 5 | ||
| 26 | #define IRL1_PRIORITY 10 | ||
| 27 | |||
| 28 | #define IRL2_IRQ 8 | ||
| 29 | #define IRL2_PRIORITY 7 | ||
| 30 | |||
| 31 | #define IRL3_IRQ 11 | ||
| 32 | #define IRL3_PRIORITY 4 | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #define __IO_PREFIX snapgear | 15 | #define __IO_PREFIX snapgear |
| 36 | #include <asm/io_generic.h> | 16 | #include <asm/io_generic.h> |
| 37 | 17 | ||
| 38 | #ifdef CONFIG_SH_SECUREEDGE5410 | ||
| 39 | /* | 18 | /* |
| 40 | * We need to remember what was written to the ioport as some bits | 19 | * We need to remember what was written to the ioport as some bits |
| 41 | * are shared with other functions and you cannot read back what was | 20 | * are shared with other functions and you cannot read back what was |
| @@ -66,6 +45,5 @@ extern unsigned short secureedge5410_ioport; | |||
| 66 | ((secureedge5410_ioport & ~(mask)) | ((val) & (mask))))) | 45 | ((secureedge5410_ioport & ~(mask)) | ((val) & (mask))))) |
| 67 | #define SECUREEDGE_READ_IOPORT() \ | 46 | #define SECUREEDGE_READ_IOPORT() \ |
| 68 | ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817)) | 47 | ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817)) |
| 69 | #endif | ||
| 70 | 48 | ||
| 71 | #endif /* _ASM_SH_IO_SNAPGEAR_H */ | 49 | #endif /* _ASM_SH_IO_SNAPGEAR_H */ |
diff --git a/arch/sh/include/mach-common/mach/systemh7751.h b/arch/sh/include/mach-common/mach/systemh7751.h deleted file mode 100644 index 4161122c84ef..000000000000 --- a/arch/sh/include/mach-common/mach/systemh7751.h +++ /dev/null | |||
| @@ -1,71 +0,0 @@ | |||
| 1 | #ifndef __ASM_SH_SYSTEMH_7751SYSTEMH_H | ||
| 2 | #define __ASM_SH_SYSTEMH_7751SYSTEMH_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * linux/include/asm-sh/systemh/7751systemh.h | ||
| 6 | * | ||
| 7 | * Copyright (C) 2000 Kazumoto Kojima | ||
| 8 | * | ||
| 9 | * Hitachi SystemH support | ||
| 10 | |||
| 11 | * Modified for 7751 SystemH by | ||
| 12 | * Jonathan Short, 2002. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /* Box specific addresses. */ | ||
| 16 | |||
| 17 | #define PA_ROM 0x00000000 /* EPROM */ | ||
| 18 | #define PA_ROM_SIZE 0x00400000 /* EPROM size 4M byte */ | ||
| 19 | #define PA_FROM 0x01000000 /* EPROM */ | ||
| 20 | #define PA_FROM_SIZE 0x00400000 /* EPROM size 4M byte */ | ||
| 21 | #define PA_EXT1 0x04000000 | ||
| 22 | #define PA_EXT1_SIZE 0x04000000 | ||
| 23 | #define PA_EXT2 0x08000000 | ||
| 24 | #define PA_EXT2_SIZE 0x04000000 | ||
| 25 | #define PA_SDRAM 0x0c000000 | ||
| 26 | #define PA_SDRAM_SIZE 0x04000000 | ||
| 27 | |||
| 28 | #define PA_EXT4 0x12000000 | ||
| 29 | #define PA_EXT4_SIZE 0x02000000 | ||
| 30 | #define PA_EXT5 0x14000000 | ||
| 31 | #define PA_EXT5_SIZE 0x04000000 | ||
| 32 | #define PA_PCIC 0x18000000 /* MR-SHPC-01 PCMCIA */ | ||
| 33 | |||
| 34 | #define PA_DIPSW0 0xb9000000 /* Dip switch 5,6 */ | ||
| 35 | #define PA_DIPSW1 0xb9000002 /* Dip switch 7,8 */ | ||
| 36 | #define PA_LED 0xba000000 /* LED */ | ||
| 37 | #define PA_BCR 0xbb000000 /* FPGA on the MS7751SE01 */ | ||
| 38 | |||
| 39 | #define PA_MRSHPC 0xb83fffe0 /* MR-SHPC-01 PCMCIA controller */ | ||
| 40 | #define PA_MRSHPC_MW1 0xb8400000 /* MR-SHPC-01 memory window base */ | ||
| 41 | #define PA_MRSHPC_MW2 0xb8500000 /* MR-SHPC-01 attribute window base */ | ||
| 42 | #define PA_MRSHPC_IO 0xb8600000 /* MR-SHPC-01 I/O window base */ | ||
| 43 | #define MRSHPC_MODE (PA_MRSHPC + 4) | ||
| 44 | #define MRSHPC_OPTION (PA_MRSHPC + 6) | ||
| 45 | #define MRSHPC_CSR (PA_MRSHPC + 8) | ||
| 46 | #define MRSHPC_ISR (PA_MRSHPC + 10) | ||
| 47 | #define MRSHPC_ICR (PA_MRSHPC + 12) | ||
| 48 | #define MRSHPC_CPWCR (PA_MRSHPC + 14) | ||
| 49 | #define MRSHPC_MW0CR1 (PA_MRSHPC + 16) | ||
| 50 | #define MRSHPC_MW1CR1 (PA_MRSHPC + 18) | ||
| 51 | #define MRSHPC_IOWCR1 (PA_MRSHPC + 20) | ||
| 52 | #define MRSHPC_MW0CR2 (PA_MRSHPC + 22) | ||
| 53 | #define MRSHPC_MW1CR2 (PA_MRSHPC + 24) | ||
| 54 | #define MRSHPC_IOWCR2 (PA_MRSHPC + 26) | ||
| 55 | #define MRSHPC_CDCR (PA_MRSHPC + 28) | ||
| 56 | #define MRSHPC_PCIC_INFO (PA_MRSHPC + 30) | ||
| 57 | |||
| 58 | #define BCR_ILCRA (PA_BCR + 0) | ||
| 59 | #define BCR_ILCRB (PA_BCR + 2) | ||
| 60 | #define BCR_ILCRC (PA_BCR + 4) | ||
| 61 | #define BCR_ILCRD (PA_BCR + 6) | ||
| 62 | #define BCR_ILCRE (PA_BCR + 8) | ||
| 63 | #define BCR_ILCRF (PA_BCR + 10) | ||
| 64 | #define BCR_ILCRG (PA_BCR + 12) | ||
| 65 | |||
| 66 | #define IRQ_79C973 13 | ||
| 67 | |||
| 68 | #define __IO_PREFIX sh7751systemh | ||
| 69 | #include <asm/io_generic.h> | ||
| 70 | |||
| 71 | #endif /* __ASM_SH_SYSTEMH_7751SYSTEMH_H */ | ||
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c index 6c1492b8431a..fbb66571b7a7 100644 --- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c +++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c | |||
| @@ -110,7 +110,7 @@ static int shoc_clk_verify_rate(struct clk *clk, unsigned long rate) | |||
| 110 | return 0; | 110 | return 0; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | static int shoc_clk_set_rate(struct clk *clk, unsigned long rate, int algo_id) | 113 | static int shoc_clk_set_rate(struct clk *clk, unsigned long rate) |
| 114 | { | 114 | { |
| 115 | unsigned long frqcr3; | 115 | unsigned long frqcr3; |
| 116 | unsigned int tmp; | 116 | unsigned int tmp; |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c index 527936bb3ce0..3e34ac0fc0f9 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c | |||
| @@ -48,7 +48,7 @@ static struct clk r_clk = { | |||
| 48 | * Default rate for the root input clock, reset this with clk_set_rate() | 48 | * Default rate for the root input clock, reset this with clk_set_rate() |
| 49 | * from the platform code. | 49 | * from the platform code. |
| 50 | */ | 50 | */ |
| 51 | struct clk extal_clk = { | 51 | static struct clk extal_clk = { |
| 52 | .rate = 33333333, | 52 | .rate = 33333333, |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| @@ -111,7 +111,7 @@ static struct clk div3_clk = { | |||
| 111 | .parent = &pll_clk, | 111 | .parent = &pll_clk, |
| 112 | }; | 112 | }; |
| 113 | 113 | ||
| 114 | struct clk *main_clks[] = { | 114 | static struct clk *main_clks[] = { |
| 115 | &r_clk, | 115 | &r_clk, |
| 116 | &extal_clk, | 116 | &extal_clk, |
| 117 | &fll_clk, | 117 | &fll_clk, |
| @@ -156,7 +156,7 @@ struct clk div4_clks[DIV4_NR] = { | |||
| 156 | 156 | ||
| 157 | enum { DIV6_V, DIV6_FA, DIV6_FB, DIV6_I, DIV6_S, DIV6_NR }; | 157 | enum { DIV6_V, DIV6_FA, DIV6_FB, DIV6_I, DIV6_S, DIV6_NR }; |
| 158 | 158 | ||
| 159 | struct clk div6_clks[DIV6_NR] = { | 159 | static struct clk div6_clks[DIV6_NR] = { |
| 160 | [DIV6_V] = SH_CLK_DIV6(&div3_clk, VCLKCR, 0), | 160 | [DIV6_V] = SH_CLK_DIV6(&div3_clk, VCLKCR, 0), |
| 161 | [DIV6_FA] = SH_CLK_DIV6(&div3_clk, FCLKACR, 0), | 161 | [DIV6_FA] = SH_CLK_DIV6(&div3_clk, FCLKACR, 0), |
| 162 | [DIV6_FB] = SH_CLK_DIV6(&div3_clk, FCLKBCR, 0), | 162 | [DIV6_FB] = SH_CLK_DIV6(&div3_clk, FCLKBCR, 0), |
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c index 81f58371613d..8c6a350df751 100644 --- a/arch/sh/kernel/sys_sh.c +++ b/arch/sh/kernel/sys_sh.c | |||
| @@ -88,7 +88,7 @@ asmlinkage int sys_cacheflush(unsigned long addr, unsigned long len, int op) | |||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | if (op & CACHEFLUSH_I) | 90 | if (op & CACHEFLUSH_I) |
| 91 | flush_cache_all(); | 91 | flush_icache_range(addr, addr+len); |
| 92 | 92 | ||
| 93 | up_read(¤t->mm->mmap_sem); | 93 | up_read(¤t->mm->mmap_sem); |
| 94 | return 0; | 94 | return 0; |
diff --git a/arch/sh/kernel/vsyscall/vsyscall-trapa.S b/arch/sh/kernel/vsyscall/vsyscall-trapa.S index 3b6eb34c43fa..3e70f851cdc6 100644 --- a/arch/sh/kernel/vsyscall/vsyscall-trapa.S +++ b/arch/sh/kernel/vsyscall/vsyscall-trapa.S | |||
| @@ -8,9 +8,9 @@ __kernel_vsyscall: | |||
| 8 | * fill out .eh_frame -- PFM. */ | 8 | * fill out .eh_frame -- PFM. */ |
| 9 | .LEND_vsyscall: | 9 | .LEND_vsyscall: |
| 10 | .size __kernel_vsyscall,.-.LSTART_vsyscall | 10 | .size __kernel_vsyscall,.-.LSTART_vsyscall |
| 11 | .previous | ||
| 12 | 11 | ||
| 13 | .section .eh_frame,"a",@progbits | 12 | .section .eh_frame,"a",@progbits |
| 13 | .previous | ||
| 14 | .LCIE: | 14 | .LCIE: |
| 15 | .ualong .LCIE_end - .LCIE_start | 15 | .ualong .LCIE_end - .LCIE_start |
| 16 | .LCIE_start: | 16 | .LCIE_start: |
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 09370392aff1..c3e61b366493 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig | |||
| @@ -79,7 +79,7 @@ config 29BIT | |||
| 79 | 79 | ||
| 80 | config 32BIT | 80 | config 32BIT |
| 81 | bool | 81 | bool |
| 82 | default y if CPU_SH5 | 82 | default y if CPU_SH5 || !MMU |
| 83 | 83 | ||
| 84 | config PMB | 84 | config PMB |
| 85 | bool "Support 32-bit physical addressing through PMB" | 85 | bool "Support 32-bit physical addressing through PMB" |
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index 038793286990..40733a952402 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c | |||
| @@ -79,21 +79,20 @@ void dma_generic_free_coherent(struct device *dev, size_t size, | |||
| 79 | void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 79 | void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
| 80 | enum dma_data_direction direction) | 80 | enum dma_data_direction direction) |
| 81 | { | 81 | { |
| 82 | #if defined(CONFIG_CPU_SH5) || defined(CONFIG_PMB) | 82 | void *addr; |
| 83 | void *p1addr = vaddr; | 83 | |
| 84 | #else | 84 | addr = __in_29bit_mode() ? |
| 85 | void *p1addr = (void*) P1SEGADDR((unsigned long)vaddr); | 85 | (void *)P1SEGADDR((unsigned long)vaddr) : vaddr; |
| 86 | #endif | ||
| 87 | 86 | ||
| 88 | switch (direction) { | 87 | switch (direction) { |
| 89 | case DMA_FROM_DEVICE: /* invalidate only */ | 88 | case DMA_FROM_DEVICE: /* invalidate only */ |
| 90 | __flush_invalidate_region(p1addr, size); | 89 | __flush_invalidate_region(addr, size); |
| 91 | break; | 90 | break; |
| 92 | case DMA_TO_DEVICE: /* writeback only */ | 91 | case DMA_TO_DEVICE: /* writeback only */ |
| 93 | __flush_wback_region(p1addr, size); | 92 | __flush_wback_region(addr, size); |
| 94 | break; | 93 | break; |
| 95 | case DMA_BIDIRECTIONAL: /* writeback and invalidate */ | 94 | case DMA_BIDIRECTIONAL: /* writeback and invalidate */ |
| 96 | __flush_purge_region(p1addr, size); | 95 | __flush_purge_region(addr, size); |
| 97 | break; | 96 | break; |
| 98 | default: | 97 | default: |
| 99 | BUG(); | 98 | BUG(); |
diff --git a/arch/sh/mm/uncached.c b/arch/sh/mm/uncached.c index 8a4eca551fc0..a7767da815e9 100644 --- a/arch/sh/mm/uncached.c +++ b/arch/sh/mm/uncached.c | |||
| @@ -28,7 +28,7 @@ EXPORT_SYMBOL(virt_addr_uncached); | |||
| 28 | 28 | ||
| 29 | void __init uncached_init(void) | 29 | void __init uncached_init(void) |
| 30 | { | 30 | { |
| 31 | #ifdef CONFIG_29BIT | 31 | #if defined(CONFIG_29BIT) || !defined(CONFIG_MMU) |
| 32 | uncached_start = P2SEG; | 32 | uncached_start = P2SEG; |
| 33 | #else | 33 | #else |
| 34 | uncached_start = memory_end; | 34 | uncached_start = memory_end; |
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types index 9f56eb978024..0e68465e7b50 100644 --- a/arch/sh/tools/mach-types +++ b/arch/sh/tools/mach-types | |||
| @@ -26,7 +26,6 @@ HD64461 HD64461 | |||
| 26 | 7724SE SH_7724_SOLUTION_ENGINE | 26 | 7724SE SH_7724_SOLUTION_ENGINE |
| 27 | 7751SE SH_7751_SOLUTION_ENGINE | 27 | 7751SE SH_7751_SOLUTION_ENGINE |
| 28 | 7780SE SH_7780_SOLUTION_ENGINE | 28 | 7780SE SH_7780_SOLUTION_ENGINE |
| 29 | 7751SYSTEMH SH_7751_SYSTEMH | ||
| 30 | HP6XX SH_HP6XX | 29 | HP6XX SH_HP6XX |
| 31 | DREAMCAST SH_DREAMCAST | 30 | DREAMCAST SH_DREAMCAST |
| 32 | SNAPGEAR SH_SECUREEDGE5410 | 31 | SNAPGEAR SH_SECUREEDGE5410 |
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index 7524689b03d2..16582d85368a 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 13 | #include <linux/threads.h> | 13 | #include <linux/threads.h> |
| 14 | #include <linux/smp.h> | 14 | #include <linux/smp.h> |
| 15 | #include <linux/smp_lock.h> | ||
| 16 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
| 17 | #include <linux/kernel_stat.h> | 16 | #include <linux/kernel_stat.h> |
| 18 | #include <linux/init.h> | 17 | #include <linux/init.h> |
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index e6375a750d9a..6db18c6927fb 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/resource.h> | 17 | #include <linux/resource.h> |
| 18 | #include <linux/times.h> | 18 | #include <linux/times.h> |
| 19 | #include <linux/smp.h> | 19 | #include <linux/smp.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 21 | #include <linux/sem.h> | 20 | #include <linux/sem.h> |
| 22 | #include <linux/msg.h> | 21 | #include <linux/msg.h> |
| 23 | #include <linux/shm.h> | 22 | #include <linux/shm.h> |
diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c index 675c9e11ada5..42b282fa6112 100644 --- a/arch/sparc/kernel/sys_sparc_32.c +++ b/arch/sparc/kernel/sys_sparc_32.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/mman.h> | 19 | #include <linux/mman.h> |
| 20 | #include <linux/utsname.h> | 20 | #include <linux/utsname.h> |
| 21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 22 | #include <linux/smp_lock.h> | ||
| 23 | #include <linux/ipc.h> | 22 | #include <linux/ipc.h> |
| 24 | 23 | ||
| 25 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c index 12b9f352595f..4491f4cb2695 100644 --- a/arch/sparc/kernel/unaligned_32.c +++ b/arch/sparc/kernel/unaligned_32.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <asm/system.h> | 16 | #include <asm/system.h> |
| 17 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/perf_event.h> | 19 | #include <linux/perf_event.h> |
| 21 | 20 | ||
| 22 | enum direction { | 21 | enum direction { |
diff --git a/arch/sparc/kernel/windows.c b/arch/sparc/kernel/windows.c index b351770cbdd6..3107381e576d 100644 --- a/arch/sparc/kernel/windows.c +++ b/arch/sparc/kernel/windows.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
| 10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
| 11 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
| 12 | #include <linux/smp_lock.h> | ||
| 13 | 12 | ||
| 14 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
| 15 | 14 | ||
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 07ec8a865c1d..e11b5fcb70eb 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig | |||
| @@ -329,6 +329,18 @@ endmenu # Tilera-specific configuration | |||
| 329 | 329 | ||
| 330 | menu "Bus options" | 330 | menu "Bus options" |
| 331 | 331 | ||
| 332 | config PCI | ||
| 333 | bool "PCI support" | ||
| 334 | default y | ||
| 335 | select PCI_DOMAINS | ||
| 336 | ---help--- | ||
| 337 | Enable PCI root complex support, so PCIe endpoint devices can | ||
| 338 | be attached to the Tile chip. Many, but not all, PCI devices | ||
| 339 | are supported under Tilera's root complex driver. | ||
| 340 | |||
| 341 | config PCI_DOMAINS | ||
| 342 | bool | ||
| 343 | |||
| 332 | config NO_IOMEM | 344 | config NO_IOMEM |
| 333 | def_bool !PCI | 345 | def_bool !PCI |
| 334 | 346 | ||
diff --git a/arch/tile/include/asm/cacheflush.h b/arch/tile/include/asm/cacheflush.h index c5741da4eeac..14a3f8556ace 100644 --- a/arch/tile/include/asm/cacheflush.h +++ b/arch/tile/include/asm/cacheflush.h | |||
| @@ -137,4 +137,56 @@ static inline void finv_buffer(void *buffer, size_t size) | |||
| 137 | mb_incoherent(); | 137 | mb_incoherent(); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | /* | ||
| 141 | * Flush & invalidate a VA range that is homed remotely on a single core, | ||
| 142 | * waiting until the memory controller holds the flushed values. | ||
| 143 | */ | ||
| 144 | static inline void finv_buffer_remote(void *buffer, size_t size) | ||
| 145 | { | ||
| 146 | char *p; | ||
| 147 | int i; | ||
| 148 | |||
| 149 | /* | ||
| 150 | * Flush and invalidate the buffer out of the local L1/L2 | ||
| 151 | * and request the home cache to flush and invalidate as well. | ||
| 152 | */ | ||
| 153 | __finv_buffer(buffer, size); | ||
| 154 | |||
| 155 | /* | ||
| 156 | * Wait for the home cache to acknowledge that it has processed | ||
| 157 | * all the flush-and-invalidate requests. This does not mean | ||
| 158 | * that the flushed data has reached the memory controller yet, | ||
| 159 | * but it does mean the home cache is processing the flushes. | ||
| 160 | */ | ||
| 161 | __insn_mf(); | ||
| 162 | |||
| 163 | /* | ||
| 164 | * Issue a load to the last cache line, which can't complete | ||
| 165 | * until all the previously-issued flushes to the same memory | ||
| 166 | * controller have also completed. If we weren't striping | ||
| 167 | * memory, that one load would be sufficient, but since we may | ||
| 168 | * be, we also need to back up to the last load issued to | ||
| 169 | * another memory controller, which would be the point where | ||
| 170 | * we crossed an 8KB boundary (the granularity of striping | ||
| 171 | * across memory controllers). Keep backing up and doing this | ||
| 172 | * until we are before the beginning of the buffer, or have | ||
| 173 | * hit all the controllers. | ||
| 174 | */ | ||
| 175 | for (i = 0, p = (char *)buffer + size - 1; | ||
| 176 | i < (1 << CHIP_LOG_NUM_MSHIMS()) && p >= (char *)buffer; | ||
| 177 | ++i) { | ||
| 178 | const unsigned long STRIPE_WIDTH = 8192; | ||
| 179 | |||
| 180 | /* Force a load instruction to issue. */ | ||
| 181 | *(volatile char *)p; | ||
| 182 | |||
| 183 | /* Jump to end of previous stripe. */ | ||
| 184 | p -= STRIPE_WIDTH; | ||
| 185 | p = (char *)((unsigned long)p | (STRIPE_WIDTH - 1)); | ||
| 186 | } | ||
| 187 | |||
| 188 | /* Wait for the loads (and thus flushes) to have completed. */ | ||
| 189 | __insn_mf(); | ||
| 190 | } | ||
| 191 | |||
| 140 | #endif /* _ASM_TILE_CACHEFLUSH_H */ | 192 | #endif /* _ASM_TILE_CACHEFLUSH_H */ |
diff --git a/arch/tile/include/asm/highmem.h b/arch/tile/include/asm/highmem.h index e0f7ee186721..b2a6c5de79ab 100644 --- a/arch/tile/include/asm/highmem.h +++ b/arch/tile/include/asm/highmem.h | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
| 25 | #include <linux/threads.h> | 25 | #include <linux/threads.h> |
| 26 | #include <asm/kmap_types.h> | ||
| 27 | #include <asm/tlbflush.h> | 26 | #include <asm/tlbflush.h> |
| 28 | #include <asm/homecache.h> | 27 | #include <asm/homecache.h> |
| 29 | 28 | ||
diff --git a/arch/tile/include/asm/io.h b/arch/tile/include/asm/io.h index ee43328713ab..d3cbb9b14cbe 100644 --- a/arch/tile/include/asm/io.h +++ b/arch/tile/include/asm/io.h | |||
| @@ -55,9 +55,6 @@ extern void iounmap(volatile void __iomem *addr); | |||
| 55 | #define ioremap_writethrough(physaddr, size) ioremap(physaddr, size) | 55 | #define ioremap_writethrough(physaddr, size) ioremap(physaddr, size) |
| 56 | #define ioremap_fullcache(physaddr, size) ioremap(physaddr, size) | 56 | #define ioremap_fullcache(physaddr, size) ioremap(physaddr, size) |
| 57 | 57 | ||
| 58 | void __iomem *ioport_map(unsigned long port, unsigned int len); | ||
| 59 | extern inline void ioport_unmap(void __iomem *addr) {} | ||
| 60 | |||
| 61 | #define mmiowb() | 58 | #define mmiowb() |
| 62 | 59 | ||
| 63 | /* Conversion between virtual and physical mappings. */ | 60 | /* Conversion between virtual and physical mappings. */ |
| @@ -189,12 +186,22 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, | |||
| 189 | * we never run, uses them unconditionally. | 186 | * we never run, uses them unconditionally. |
| 190 | */ | 187 | */ |
| 191 | 188 | ||
| 192 | static inline int ioport_panic(void) | 189 | static inline long ioport_panic(void) |
| 193 | { | 190 | { |
| 194 | panic("inb/outb and friends do not exist on tile"); | 191 | panic("inb/outb and friends do not exist on tile"); |
| 195 | return 0; | 192 | return 0; |
| 196 | } | 193 | } |
| 197 | 194 | ||
| 195 | static inline void __iomem *ioport_map(unsigned long port, unsigned int len) | ||
| 196 | { | ||
| 197 | return (void __iomem *) ioport_panic(); | ||
| 198 | } | ||
| 199 | |||
| 200 | static inline void ioport_unmap(void __iomem *addr) | ||
| 201 | { | ||
| 202 | ioport_panic(); | ||
| 203 | } | ||
| 204 | |||
| 198 | static inline u8 inb(unsigned long addr) | 205 | static inline u8 inb(unsigned long addr) |
| 199 | { | 206 | { |
| 200 | return ioport_panic(); | 207 | return ioport_panic(); |
diff --git a/arch/tile/include/asm/kmap_types.h b/arch/tile/include/asm/kmap_types.h index 1480106d1c05..3d0f20246260 100644 --- a/arch/tile/include/asm/kmap_types.h +++ b/arch/tile/include/asm/kmap_types.h | |||
| @@ -16,28 +16,42 @@ | |||
| 16 | #define _ASM_TILE_KMAP_TYPES_H | 16 | #define _ASM_TILE_KMAP_TYPES_H |
| 17 | 17 | ||
| 18 | /* | 18 | /* |
| 19 | * In TILE Linux each set of four of these uses another 16MB chunk of | 19 | * In 32-bit TILE Linux we have to balance the desire to have a lot of |
| 20 | * address space, given 64 tiles and 64KB pages, so we only enable | 20 | * nested atomic mappings with the fact that large page sizes and many |
| 21 | * ones that are required by the kernel configuration. | 21 | * processors chew up address space quickly. In a typical |
| 22 | * 64-processor, 64KB-page layout build, making KM_TYPE_NR one larger | ||
| 23 | * adds 4MB of required address-space. For now we leave KM_TYPE_NR | ||
| 24 | * set to depth 8. | ||
| 22 | */ | 25 | */ |
| 23 | enum km_type { | 26 | enum km_type { |
| 27 | KM_TYPE_NR = 8 | ||
| 28 | }; | ||
| 29 | |||
| 30 | /* | ||
| 31 | * We provide dummy definitions of all the stray values that used to be | ||
| 32 | * required for kmap_atomic() and no longer are. | ||
| 33 | */ | ||
| 34 | enum { | ||
| 24 | KM_BOUNCE_READ, | 35 | KM_BOUNCE_READ, |
| 25 | KM_SKB_SUNRPC_DATA, | 36 | KM_SKB_SUNRPC_DATA, |
| 26 | KM_SKB_DATA_SOFTIRQ, | 37 | KM_SKB_DATA_SOFTIRQ, |
| 27 | KM_USER0, | 38 | KM_USER0, |
| 28 | KM_USER1, | 39 | KM_USER1, |
| 29 | KM_BIO_SRC_IRQ, | 40 | KM_BIO_SRC_IRQ, |
| 41 | KM_BIO_DST_IRQ, | ||
| 42 | KM_PTE0, | ||
| 43 | KM_PTE1, | ||
| 30 | KM_IRQ0, | 44 | KM_IRQ0, |
| 31 | KM_IRQ1, | 45 | KM_IRQ1, |
| 32 | KM_SOFTIRQ0, | 46 | KM_SOFTIRQ0, |
| 33 | KM_SOFTIRQ1, | 47 | KM_SOFTIRQ1, |
| 34 | KM_MEMCPY0, | 48 | KM_SYNC_ICACHE, |
| 35 | KM_MEMCPY1, | 49 | KM_SYNC_DCACHE, |
| 36 | #if defined(CONFIG_HIGHPTE) | 50 | KM_UML_USERCOPY, |
| 37 | KM_PTE0, | 51 | KM_IRQ_PTE, |
| 38 | KM_PTE1, | 52 | KM_NMI, |
| 39 | #endif | 53 | KM_NMI_PTE, |
| 40 | KM_TYPE_NR | 54 | KM_KDB |
| 41 | }; | 55 | }; |
| 42 | 56 | ||
| 43 | #endif /* _ASM_TILE_KMAP_TYPES_H */ | 57 | #endif /* _ASM_TILE_KMAP_TYPES_H */ |
diff --git a/arch/tile/include/asm/pci-bridge.h b/arch/tile/include/asm/pci-bridge.h deleted file mode 100644 index e853b0e2793b..000000000000 --- a/arch/tile/include/asm/pci-bridge.h +++ /dev/null | |||
| @@ -1,117 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU General Public License | ||
| 6 | * as published by the Free Software Foundation, version 2. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
| 11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _ASM_TILE_PCI_BRIDGE_H | ||
| 16 | #define _ASM_TILE_PCI_BRIDGE_H | ||
| 17 | |||
| 18 | #include <linux/ioport.h> | ||
| 19 | #include <linux/pci.h> | ||
| 20 | |||
| 21 | struct device_node; | ||
| 22 | struct pci_controller; | ||
| 23 | |||
| 24 | /* | ||
| 25 | * pci_io_base returns the memory address at which you can access | ||
| 26 | * the I/O space for PCI bus number `bus' (or NULL on error). | ||
| 27 | */ | ||
| 28 | extern void __iomem *pci_bus_io_base(unsigned int bus); | ||
| 29 | extern unsigned long pci_bus_io_base_phys(unsigned int bus); | ||
| 30 | extern unsigned long pci_bus_mem_base_phys(unsigned int bus); | ||
| 31 | |||
| 32 | /* Allocate a new PCI host bridge structure */ | ||
| 33 | extern struct pci_controller *pcibios_alloc_controller(void); | ||
| 34 | |||
| 35 | /* Helper function for setting up resources */ | ||
| 36 | extern void pci_init_resource(struct resource *res, unsigned long start, | ||
| 37 | unsigned long end, int flags, char *name); | ||
| 38 | |||
| 39 | /* Get the PCI host controller for a bus */ | ||
| 40 | extern struct pci_controller *pci_bus_to_hose(int bus); | ||
| 41 | |||
| 42 | /* | ||
| 43 | * Structure of a PCI controller (host bridge) | ||
| 44 | */ | ||
| 45 | struct pci_controller { | ||
| 46 | int index; /* PCI domain number */ | ||
| 47 | struct pci_bus *root_bus; | ||
| 48 | |||
| 49 | int first_busno; | ||
| 50 | int last_busno; | ||
| 51 | |||
| 52 | int hv_cfg_fd[2]; /* config{0,1} fds for this PCIe controller */ | ||
| 53 | int hv_mem_fd; /* fd to Hypervisor for MMIO operations */ | ||
| 54 | |||
| 55 | struct pci_ops *ops; | ||
| 56 | |||
| 57 | int irq_base; /* Base IRQ from the Hypervisor */ | ||
| 58 | int plx_gen1; /* flag for PLX Gen 1 configuration */ | ||
| 59 | |||
| 60 | /* Address ranges that are routed to this controller/bridge. */ | ||
| 61 | struct resource mem_resources[3]; | ||
| 62 | }; | ||
| 63 | |||
| 64 | static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) | ||
| 65 | { | ||
| 66 | return bus->sysdata; | ||
| 67 | } | ||
| 68 | |||
| 69 | extern void setup_indirect_pci_nomap(struct pci_controller *hose, | ||
| 70 | void __iomem *cfg_addr, void __iomem *cfg_data); | ||
| 71 | extern void setup_indirect_pci(struct pci_controller *hose, | ||
| 72 | u32 cfg_addr, u32 cfg_data); | ||
| 73 | extern void setup_grackle(struct pci_controller *hose); | ||
| 74 | |||
| 75 | extern unsigned char common_swizzle(struct pci_dev *, unsigned char *); | ||
| 76 | |||
| 77 | /* | ||
| 78 | * The following code swizzles for exactly one bridge. The routine | ||
| 79 | * common_swizzle below handles multiple bridges. But there are a | ||
| 80 | * some boards that don't follow the PCI spec's suggestion so we | ||
| 81 | * break this piece out separately. | ||
| 82 | */ | ||
| 83 | static inline unsigned char bridge_swizzle(unsigned char pin, | ||
| 84 | unsigned char idsel) | ||
| 85 | { | ||
| 86 | return (((pin-1) + idsel) % 4) + 1; | ||
| 87 | } | ||
| 88 | |||
| 89 | /* | ||
| 90 | * The following macro is used to lookup irqs in a standard table | ||
| 91 | * format for those PPC systems that do not already have PCI | ||
| 92 | * interrupts properly routed. | ||
| 93 | */ | ||
| 94 | /* FIXME - double check this */ | ||
| 95 | #define PCI_IRQ_TABLE_LOOKUP ({ \ | ||
| 96 | long _ctl_ = -1; \ | ||
| 97 | if (idsel >= min_idsel && idsel <= max_idsel && pin <= irqs_per_slot) \ | ||
| 98 | _ctl_ = pci_irq_table[idsel - min_idsel][pin-1]; \ | ||
| 99 | _ctl_; \ | ||
| 100 | }) | ||
| 101 | |||
| 102 | /* | ||
| 103 | * Scan the buses below a given PCI host bridge and assign suitable | ||
| 104 | * resources to all devices found. | ||
| 105 | */ | ||
| 106 | extern int pciauto_bus_scan(struct pci_controller *, int); | ||
| 107 | |||
| 108 | #ifdef CONFIG_PCI | ||
| 109 | extern unsigned long pci_address_to_pio(phys_addr_t address); | ||
| 110 | #else | ||
| 111 | static inline unsigned long pci_address_to_pio(phys_addr_t address) | ||
| 112 | { | ||
| 113 | return (unsigned long)-1; | ||
| 114 | } | ||
| 115 | #endif | ||
| 116 | |||
| 117 | #endif /* _ASM_TILE_PCI_BRIDGE_H */ | ||
diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h index b0c15da2d5d5..c3fc458a0d32 100644 --- a/arch/tile/include/asm/pci.h +++ b/arch/tile/include/asm/pci.h | |||
| @@ -15,7 +15,29 @@ | |||
| 15 | #ifndef _ASM_TILE_PCI_H | 15 | #ifndef _ASM_TILE_PCI_H |
| 16 | #define _ASM_TILE_PCI_H | 16 | #define _ASM_TILE_PCI_H |
| 17 | 17 | ||
| 18 | #include <asm/pci-bridge.h> | 18 | #include <linux/pci.h> |
| 19 | |||
| 20 | /* | ||
| 21 | * Structure of a PCI controller (host bridge) | ||
| 22 | */ | ||
| 23 | struct pci_controller { | ||
| 24 | int index; /* PCI domain number */ | ||
| 25 | struct pci_bus *root_bus; | ||
| 26 | |||
| 27 | int first_busno; | ||
| 28 | int last_busno; | ||
| 29 | |||
| 30 | int hv_cfg_fd[2]; /* config{0,1} fds for this PCIe controller */ | ||
| 31 | int hv_mem_fd; /* fd to Hypervisor for MMIO operations */ | ||
| 32 | |||
| 33 | struct pci_ops *ops; | ||
| 34 | |||
| 35 | int irq_base; /* Base IRQ from the Hypervisor */ | ||
| 36 | int plx_gen1; /* flag for PLX Gen 1 configuration */ | ||
| 37 | |||
| 38 | /* Address ranges that are routed to this controller/bridge. */ | ||
| 39 | struct resource mem_resources[3]; | ||
| 40 | }; | ||
| 19 | 41 | ||
| 20 | /* | 42 | /* |
| 21 | * The hypervisor maps the entirety of CPA-space as bus addresses, so | 43 | * The hypervisor maps the entirety of CPA-space as bus addresses, so |
| @@ -24,56 +46,12 @@ | |||
| 24 | */ | 46 | */ |
| 25 | #define PCI_DMA_BUS_IS_PHYS 1 | 47 | #define PCI_DMA_BUS_IS_PHYS 1 |
| 26 | 48 | ||
| 27 | struct pci_controller *pci_bus_to_hose(int bus); | ||
| 28 | unsigned char __init common_swizzle(struct pci_dev *dev, unsigned char *pinp); | ||
| 29 | int __init tile_pci_init(void); | 49 | int __init tile_pci_init(void); |
| 30 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr); | ||
| 31 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
| 32 | void __devinit pcibios_fixup_bus(struct pci_bus *bus); | ||
| 33 | 50 | ||
| 34 | int __devinit _tile_cfg_read(struct pci_controller *hose, | 51 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); |
| 35 | int bus, | 52 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {} |
| 36 | int slot, | ||
| 37 | int function, | ||
| 38 | int offset, | ||
| 39 | int size, | ||
| 40 | u32 *val); | ||
| 41 | int __devinit _tile_cfg_write(struct pci_controller *hose, | ||
| 42 | int bus, | ||
| 43 | int slot, | ||
| 44 | int function, | ||
| 45 | int offset, | ||
| 46 | int size, | ||
| 47 | u32 val); | ||
| 48 | 53 | ||
| 49 | /* | 54 | void __devinit pcibios_fixup_bus(struct pci_bus *bus); |
| 50 | * These are used to to config reads and writes in the early stages of | ||
| 51 | * setup before the driver infrastructure has been set up enough to be | ||
| 52 | * able to do config reads and writes. | ||
| 53 | */ | ||
| 54 | #define early_cfg_read(where, size, value) \ | ||
| 55 | _tile_cfg_read(controller, \ | ||
| 56 | current_bus, \ | ||
| 57 | pci_slot, \ | ||
| 58 | pci_fn, \ | ||
| 59 | where, \ | ||
| 60 | size, \ | ||
| 61 | value) | ||
| 62 | |||
| 63 | #define early_cfg_write(where, size, value) \ | ||
| 64 | _tile_cfg_write(controller, \ | ||
| 65 | current_bus, \ | ||
| 66 | pci_slot, \ | ||
| 67 | pci_fn, \ | ||
| 68 | where, \ | ||
| 69 | size, \ | ||
| 70 | value) | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | #define PCICFG_BYTE 1 | ||
| 75 | #define PCICFG_WORD 2 | ||
| 76 | #define PCICFG_DWORD 4 | ||
| 77 | 55 | ||
| 78 | #define TILE_NUM_PCIE 2 | 56 | #define TILE_NUM_PCIE 2 |
| 79 | 57 | ||
| @@ -88,33 +66,33 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
| 88 | } | 66 | } |
| 89 | 67 | ||
| 90 | /* | 68 | /* |
| 91 | * I/O space is currently not supported. | 69 | * pcibios_assign_all_busses() tells whether or not the bus numbers |
| 70 | * should be reassigned, in case the BIOS didn't do it correctly, or | ||
| 71 | * in case we don't have a BIOS and we want to let Linux do it. | ||
| 92 | */ | 72 | */ |
| 73 | static inline int pcibios_assign_all_busses(void) | ||
| 74 | { | ||
| 75 | return 1; | ||
| 76 | } | ||
| 93 | 77 | ||
| 94 | #define TILE_PCIE_LOWER_IO 0x0 | 78 | /* |
| 95 | #define TILE_PCIE_UPPER_IO 0x10000 | 79 | * No special bus mastering setup handling. |
| 96 | #define TILE_PCIE_PCIE_IO_SIZE 0x0000FFFF | 80 | */ |
| 97 | |||
| 98 | #define _PAGE_NO_CACHE 0 | ||
| 99 | #define _PAGE_GUARDED 0 | ||
| 100 | |||
| 101 | |||
| 102 | #define pcibios_assign_all_busses() pci_assign_all_buses | ||
| 103 | extern int pci_assign_all_buses; | ||
| 104 | |||
| 105 | static inline void pcibios_set_master(struct pci_dev *dev) | 81 | static inline void pcibios_set_master(struct pci_dev *dev) |
| 106 | { | 82 | { |
| 107 | /* No special bus mastering setup handling */ | ||
| 108 | } | 83 | } |
| 109 | 84 | ||
| 110 | #define PCIBIOS_MIN_MEM 0 | 85 | #define PCIBIOS_MIN_MEM 0 |
| 111 | #define PCIBIOS_MIN_IO TILE_PCIE_LOWER_IO | 86 | #define PCIBIOS_MIN_IO 0 |
| 112 | 87 | ||
| 113 | /* | 88 | /* |
| 114 | * This flag tells if the platform is TILEmpower that needs | 89 | * This flag tells if the platform is TILEmpower that needs |
| 115 | * special configuration for the PLX switch chip. | 90 | * special configuration for the PLX switch chip. |
| 116 | */ | 91 | */ |
| 117 | extern int blade_pci; | 92 | extern int tile_plx_gen1; |
| 93 | |||
| 94 | /* Use any cpu for PCI. */ | ||
| 95 | #define cpumask_of_pcibus(bus) cpu_online_mask | ||
| 118 | 96 | ||
| 119 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ | 97 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ |
| 120 | #include <asm-generic/pci-dma-compat.h> | 98 | #include <asm-generic/pci-dma-compat.h> |
| @@ -122,7 +100,4 @@ extern int blade_pci; | |||
| 122 | /* generic pci stuff */ | 100 | /* generic pci stuff */ |
| 123 | #include <asm-generic/pci.h> | 101 | #include <asm-generic/pci.h> |
| 124 | 102 | ||
| 125 | /* Use any cpu for PCI. */ | ||
| 126 | #define cpumask_of_pcibus(bus) cpu_online_mask | ||
| 127 | |||
| 128 | #endif /* _ASM_TILE_PCI_H */ | 103 | #endif /* _ASM_TILE_PCI_H */ |
diff --git a/arch/tile/include/asm/pgtable.h b/arch/tile/include/asm/pgtable.h index dc4ccdd855bc..a6604e9485da 100644 --- a/arch/tile/include/asm/pgtable.h +++ b/arch/tile/include/asm/pgtable.h | |||
| @@ -344,10 +344,8 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
| 344 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) | 344 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) |
| 345 | 345 | ||
| 346 | #if defined(CONFIG_HIGHPTE) | 346 | #if defined(CONFIG_HIGHPTE) |
| 347 | extern pte_t *_pte_offset_map(pmd_t *, unsigned long address, enum km_type); | 347 | extern pte_t *pte_offset_map(pmd_t *, unsigned long address); |
| 348 | #define pte_offset_map(dir, address) \ | 348 | #define pte_unmap(pte) kunmap_atomic(pte) |
| 349 | _pte_offset_map(dir, address, KM_PTE0) | ||
| 350 | #define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0) | ||
| 351 | #else | 349 | #else |
| 352 | #define pte_offset_map(dir, address) pte_offset_kernel(dir, address) | 350 | #define pte_offset_map(dir, address) pte_offset_kernel(dir, address) |
| 353 | #define pte_unmap(pte) do { } while (0) | 351 | #define pte_unmap(pte) do { } while (0) |
diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h index 1747ff3946b2..a9e7c8760334 100644 --- a/arch/tile/include/asm/processor.h +++ b/arch/tile/include/asm/processor.h | |||
| @@ -292,8 +292,18 @@ extern int kstack_hash; | |||
| 292 | /* Are we using huge pages in the TLB for kernel data? */ | 292 | /* Are we using huge pages in the TLB for kernel data? */ |
| 293 | extern int kdata_huge; | 293 | extern int kdata_huge; |
| 294 | 294 | ||
| 295 | /* Support standard Linux prefetching. */ | ||
| 296 | #define ARCH_HAS_PREFETCH | ||
| 297 | #define prefetch(x) __builtin_prefetch(x) | ||
| 295 | #define PREFETCH_STRIDE CHIP_L2_LINE_SIZE() | 298 | #define PREFETCH_STRIDE CHIP_L2_LINE_SIZE() |
| 296 | 299 | ||
| 300 | /* Bring a value into the L1D, faulting the TLB if necessary. */ | ||
| 301 | #ifdef __tilegx__ | ||
| 302 | #define prefetch_L1(x) __insn_prefetch_l1_fault((void *)(x)) | ||
| 303 | #else | ||
| 304 | #define prefetch_L1(x) __insn_prefetch_L1((void *)(x)) | ||
| 305 | #endif | ||
| 306 | |||
| 297 | #else /* __ASSEMBLY__ */ | 307 | #else /* __ASSEMBLY__ */ |
| 298 | 308 | ||
| 299 | /* Do some slow action (e.g. read a slow SPR). */ | 309 | /* Do some slow action (e.g. read a slow SPR). */ |
diff --git a/arch/tile/include/asm/stat.h b/arch/tile/include/asm/stat.h index 3dc90fa92c70..b16e5db8f0e7 100644 --- a/arch/tile/include/asm/stat.h +++ b/arch/tile/include/asm/stat.h | |||
| @@ -1 +1,4 @@ | |||
| 1 | #ifdef CONFIG_COMPAT | ||
| 2 | #define __ARCH_WANT_STAT64 /* Used for compat_sys_stat64() etc. */ | ||
| 3 | #endif | ||
| 1 | #include <asm-generic/stat.h> | 4 | #include <asm-generic/stat.h> |
diff --git a/arch/tile/include/asm/unistd.h b/arch/tile/include/asm/unistd.h index f2e3ff485333..b35c2db71199 100644 --- a/arch/tile/include/asm/unistd.h +++ b/arch/tile/include/asm/unistd.h | |||
| @@ -41,6 +41,7 @@ __SYSCALL(__NR_cmpxchg_badaddr, sys_cmpxchg_badaddr) | |||
| 41 | #ifdef CONFIG_COMPAT | 41 | #ifdef CONFIG_COMPAT |
| 42 | #define __ARCH_WANT_SYS_LLSEEK | 42 | #define __ARCH_WANT_SYS_LLSEEK |
| 43 | #endif | 43 | #endif |
| 44 | #define __ARCH_WANT_SYS_NEWFSTATAT | ||
| 44 | #endif | 45 | #endif |
| 45 | 46 | ||
| 46 | #endif /* _ASM_TILE_UNISTD_H */ | 47 | #endif /* _ASM_TILE_UNISTD_H */ |
diff --git a/arch/tile/include/hv/drv_xgbe_impl.h b/arch/tile/include/hv/drv_xgbe_impl.h new file mode 100644 index 000000000000..3a73b2b44913 --- /dev/null +++ b/arch/tile/include/hv/drv_xgbe_impl.h | |||
| @@ -0,0 +1,300 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU General Public License | ||
| 6 | * as published by the Free Software Foundation, version 2. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
| 11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /** | ||
| 16 | * @file drivers/xgbe/impl.h | ||
| 17 | * Implementation details for the NetIO library. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __DRV_XGBE_IMPL_H__ | ||
| 21 | #define __DRV_XGBE_IMPL_H__ | ||
| 22 | |||
| 23 | #include <hv/netio_errors.h> | ||
| 24 | #include <hv/netio_intf.h> | ||
| 25 | #include <hv/drv_xgbe_intf.h> | ||
| 26 | |||
| 27 | |||
| 28 | /** How many groups we have (log2). */ | ||
| 29 | #define LOG2_NUM_GROUPS (12) | ||
| 30 | /** How many groups we have. */ | ||
| 31 | #define NUM_GROUPS (1 << LOG2_NUM_GROUPS) | ||
| 32 | |||
| 33 | /** Number of output requests we'll buffer per tile. */ | ||
| 34 | #define EPP_REQS_PER_TILE (32) | ||
| 35 | |||
| 36 | /** Words used in an eDMA command without checksum acceleration. */ | ||
| 37 | #define EDMA_WDS_NO_CSUM 8 | ||
| 38 | /** Words used in an eDMA command with checksum acceleration. */ | ||
| 39 | #define EDMA_WDS_CSUM 10 | ||
| 40 | /** Total available words in the eDMA command FIFO. */ | ||
| 41 | #define EDMA_WDS_TOTAL 128 | ||
| 42 | |||
| 43 | |||
| 44 | /* | ||
| 45 | * FIXME: These definitions are internal and should have underscores! | ||
| 46 | * NOTE: The actual numeric values here are intentional and allow us to | ||
| 47 | * optimize the concept "if small ... else if large ... else ...", by | ||
| 48 | * checking for the low bit being set, and then for non-zero. | ||
| 49 | * These are used as array indices, so they must have the values (0, 1, 2) | ||
| 50 | * in some order. | ||
| 51 | */ | ||
| 52 | #define SIZE_SMALL (1) /**< Small packet queue. */ | ||
| 53 | #define SIZE_LARGE (2) /**< Large packet queue. */ | ||
| 54 | #define SIZE_JUMBO (0) /**< Jumbo packet queue. */ | ||
| 55 | |||
| 56 | /** The number of "SIZE_xxx" values. */ | ||
| 57 | #define NETIO_NUM_SIZES 3 | ||
| 58 | |||
| 59 | |||
| 60 | /* | ||
| 61 | * Default numbers of packets for IPP drivers. These values are chosen | ||
| 62 | * such that CIPP1 will not overflow its L2 cache. | ||
| 63 | */ | ||
| 64 | |||
| 65 | /** The default number of small packets. */ | ||
| 66 | #define NETIO_DEFAULT_SMALL_PACKETS 2750 | ||
| 67 | /** The default number of large packets. */ | ||
| 68 | #define NETIO_DEFAULT_LARGE_PACKETS 2500 | ||
| 69 | /** The default number of jumbo packets. */ | ||
| 70 | #define NETIO_DEFAULT_JUMBO_PACKETS 250 | ||
| 71 | |||
| 72 | |||
| 73 | /** Log2 of the size of a memory arena. */ | ||
| 74 | #define NETIO_ARENA_SHIFT 24 /* 16 MB */ | ||
| 75 | /** Size of a memory arena. */ | ||
| 76 | #define NETIO_ARENA_SIZE (1 << NETIO_ARENA_SHIFT) | ||
| 77 | |||
| 78 | |||
| 79 | /** A queue of packets. | ||
| 80 | * | ||
| 81 | * This structure partially defines a queue of packets waiting to be | ||
| 82 | * processed. The queue as a whole is written to by an interrupt handler and | ||
| 83 | * read by non-interrupt code; this data structure is what's touched by the | ||
| 84 | * interrupt handler. The other part of the queue state, the read offset, is | ||
| 85 | * kept in user space, not in hypervisor space, so it is in a separate data | ||
| 86 | * structure. | ||
| 87 | * | ||
| 88 | * The read offset (__packet_receive_read in the user part of the queue | ||
| 89 | * structure) points to the next packet to be read. When the read offset is | ||
| 90 | * equal to the write offset, the queue is empty; therefore the queue must | ||
| 91 | * contain one more slot than the required maximum queue size. | ||
| 92 | * | ||
| 93 | * Here's an example of all 3 state variables and what they mean. All | ||
| 94 | * pointers move left to right. | ||
| 95 | * | ||
| 96 | * @code | ||
| 97 | * I I V V V V I I I I | ||
| 98 | * 0 1 2 3 4 5 6 7 8 9 10 | ||
| 99 | * ^ ^ ^ ^ | ||
| 100 | * | | | | ||
| 101 | * | | __last_packet_plus_one | ||
| 102 | * | __buffer_write | ||
| 103 | * __packet_receive_read | ||
| 104 | * @endcode | ||
| 105 | * | ||
| 106 | * This queue has 10 slots, and thus can hold 9 packets (_last_packet_plus_one | ||
| 107 | * = 10). The read pointer is at 2, and the write pointer is at 6; thus, | ||
| 108 | * there are valid, unread packets in slots 2, 3, 4, and 5. The remaining | ||
| 109 | * slots are invalid (do not contain a packet). | ||
| 110 | */ | ||
| 111 | typedef struct { | ||
| 112 | /** Byte offset of the next notify packet to be written: zero for the first | ||
| 113 | * packet on the queue, sizeof (netio_pkt_t) for the second packet on the | ||
| 114 | * queue, etc. */ | ||
| 115 | volatile uint32_t __packet_write; | ||
| 116 | |||
| 117 | /** Offset of the packet after the last valid packet (i.e., when any | ||
| 118 | * pointer is incremented to this value, it wraps back to zero). */ | ||
| 119 | uint32_t __last_packet_plus_one; | ||
| 120 | } | ||
| 121 | __netio_packet_queue_t; | ||
| 122 | |||
| 123 | |||
| 124 | /** A queue of buffers. | ||
| 125 | * | ||
| 126 | * This structure partially defines a queue of empty buffers which have been | ||
| 127 | * obtained via requests to the IPP. (The elements of the queue are packet | ||
| 128 | * handles, which are transformed into a full netio_pkt_t when the buffer is | ||
| 129 | * retrieved.) The queue as a whole is written to by an interrupt handler and | ||
| 130 | * read by non-interrupt code; this data structure is what's touched by the | ||
| 131 | * interrupt handler. The other parts of the queue state, the read offset and | ||
| 132 | * requested write offset, are kept in user space, not in hypervisor space, so | ||
| 133 | * they are in a separate data structure. | ||
| 134 | * | ||
| 135 | * The read offset (__buffer_read in the user part of the queue structure) | ||
| 136 | * points to the next buffer to be read. When the read offset is equal to the | ||
| 137 | * write offset, the queue is empty; therefore the queue must contain one more | ||
| 138 | * slot than the required maximum queue size. | ||
| 139 | * | ||
| 140 | * The requested write offset (__buffer_requested_write in the user part of | ||
| 141 | * the queue structure) points to the slot which will hold the next buffer we | ||
| 142 | * request from the IPP, once we get around to sending such a request. When | ||
| 143 | * the requested write offset is equal to the write offset, no requests for | ||
| 144 | * new buffers are outstanding; when the requested write offset is one greater | ||
| 145 | * than the read offset, no more requests may be sent. | ||
| 146 | * | ||
| 147 | * Note that, unlike the packet_queue, the buffer_queue places incoming | ||
| 148 | * buffers at decreasing addresses. This makes the check for "is it time to | ||
| 149 | * wrap the buffer pointer" cheaper in the assembly code which receives new | ||
| 150 | * buffers, and means that the value which defines the queue size, | ||
| 151 | * __last_buffer, is different than in the packet queue. Also, the offset | ||
| 152 | * used in the packet_queue is already scaled by the size of a packet; here we | ||
| 153 | * use unscaled slot indices for the offsets. (These differences are | ||
| 154 | * historical, and in the future it's possible that the packet_queue will look | ||
| 155 | * more like this queue.) | ||
| 156 | * | ||
| 157 | * @code | ||
| 158 | * Here's an example of all 4 state variables and what they mean. Remember: | ||
| 159 | * all pointers move right to left. | ||
| 160 | * | ||
| 161 | * V V V I I R R V V V | ||
| 162 | * 0 1 2 3 4 5 6 7 8 9 | ||
| 163 | * ^ ^ ^ ^ | ||
| 164 | * | | | | | ||
| 165 | * | | | __last_buffer | ||
| 166 | * | | __buffer_write | ||
| 167 | * | __buffer_requested_write | ||
| 168 | * __buffer_read | ||
| 169 | * @endcode | ||
| 170 | * | ||
| 171 | * This queue has 10 slots, and thus can hold 9 buffers (_last_buffer = 9). | ||
| 172 | * The read pointer is at 2, and the write pointer is at 6; thus, there are | ||
| 173 | * valid, unread buffers in slots 2, 1, 0, 9, 8, and 7. The requested write | ||
| 174 | * pointer is at 4; thus, requests have been made to the IPP for buffers which | ||
| 175 | * will be placed in slots 6 and 5 when they arrive. Finally, the remaining | ||
| 176 | * slots are invalid (do not contain a buffer). | ||
| 177 | */ | ||
| 178 | typedef struct | ||
| 179 | { | ||
| 180 | /** Ordinal number of the next buffer to be written: 0 for the first slot in | ||
| 181 | * the queue, 1 for the second slot in the queue, etc. */ | ||
| 182 | volatile uint32_t __buffer_write; | ||
| 183 | |||
| 184 | /** Ordinal number of the last buffer (i.e., when any pointer is decremented | ||
| 185 | * below zero, it is reloaded with this value). */ | ||
| 186 | uint32_t __last_buffer; | ||
| 187 | } | ||
| 188 | __netio_buffer_queue_t; | ||
| 189 | |||
| 190 | |||
| 191 | /** | ||
| 192 | * An object for providing Ethernet packets to a process. | ||
| 193 | */ | ||
| 194 | typedef struct __netio_queue_impl_t | ||
| 195 | { | ||
| 196 | /** The queue of packets waiting to be received. */ | ||
| 197 | __netio_packet_queue_t __packet_receive_queue; | ||
| 198 | /** The intr bit mask that IDs this device. */ | ||
| 199 | unsigned int __intr_id; | ||
| 200 | /** Offset to queues of empty buffers, one per size. */ | ||
| 201 | uint32_t __buffer_queue[NETIO_NUM_SIZES]; | ||
| 202 | /** The address of the first EPP tile, or -1 if no EPP. */ | ||
| 203 | /* ISSUE: Actually this is always "0" or "~0". */ | ||
| 204 | uint32_t __epp_location; | ||
| 205 | /** The queue ID that this queue represents. */ | ||
| 206 | unsigned int __queue_id; | ||
| 207 | /** Number of acknowledgements received. */ | ||
| 208 | volatile uint32_t __acks_received; | ||
| 209 | /** Last completion number received for packet_sendv. */ | ||
| 210 | volatile uint32_t __last_completion_rcv; | ||
| 211 | /** Number of packets allowed to be outstanding. */ | ||
| 212 | uint32_t __max_outstanding; | ||
| 213 | /** First VA available for packets. */ | ||
| 214 | void* __va_0; | ||
| 215 | /** First VA in second range available for packets. */ | ||
| 216 | void* __va_1; | ||
| 217 | /** Padding to align the "__packets" field to the size of a netio_pkt_t. */ | ||
| 218 | uint32_t __padding[3]; | ||
| 219 | /** The packets themselves. */ | ||
| 220 | netio_pkt_t __packets[0]; | ||
| 221 | } | ||
| 222 | netio_queue_impl_t; | ||
| 223 | |||
| 224 | |||
| 225 | /** | ||
| 226 | * An object for managing the user end of a NetIO queue. | ||
| 227 | */ | ||
| 228 | typedef struct __netio_queue_user_impl_t | ||
| 229 | { | ||
| 230 | /** The next incoming packet to be read. */ | ||
| 231 | uint32_t __packet_receive_read; | ||
| 232 | /** The next empty buffers to be read, one index per size. */ | ||
| 233 | uint8_t __buffer_read[NETIO_NUM_SIZES]; | ||
| 234 | /** Where the empty buffer we next request from the IPP will go, one index | ||
| 235 | * per size. */ | ||
| 236 | uint8_t __buffer_requested_write[NETIO_NUM_SIZES]; | ||
| 237 | /** PCIe interface flag. */ | ||
| 238 | uint8_t __pcie; | ||
| 239 | /** Number of packets left to be received before we send a credit update. */ | ||
| 240 | uint32_t __receive_credit_remaining; | ||
| 241 | /** Value placed in __receive_credit_remaining when it reaches zero. */ | ||
| 242 | uint32_t __receive_credit_interval; | ||
| 243 | /** First fast I/O routine index. */ | ||
| 244 | uint32_t __fastio_index; | ||
| 245 | /** Number of acknowledgements expected. */ | ||
| 246 | uint32_t __acks_outstanding; | ||
| 247 | /** Last completion number requested. */ | ||
| 248 | uint32_t __last_completion_req; | ||
| 249 | /** File descriptor for driver. */ | ||
| 250 | int __fd; | ||
| 251 | } | ||
| 252 | netio_queue_user_impl_t; | ||
| 253 | |||
| 254 | |||
| 255 | #define NETIO_GROUP_CHUNK_SIZE 64 /**< Max # groups in one IPP request */ | ||
| 256 | #define NETIO_BUCKET_CHUNK_SIZE 64 /**< Max # buckets in one IPP request */ | ||
| 257 | |||
| 258 | |||
| 259 | /** Internal structure used to convey packet send information to the | ||
| 260 | * hypervisor. FIXME: Actually, it's not used for that anymore, but | ||
| 261 | * netio_packet_send() still uses it internally. | ||
| 262 | */ | ||
| 263 | typedef struct | ||
| 264 | { | ||
| 265 | uint16_t flags; /**< Packet flags (__NETIO_SEND_FLG_xxx) */ | ||
| 266 | uint16_t transfer_size; /**< Size of packet */ | ||
| 267 | uint32_t va; /**< VA of start of packet */ | ||
| 268 | __netio_pkt_handle_t handle; /**< Packet handle */ | ||
| 269 | uint32_t csum0; /**< First checksum word */ | ||
| 270 | uint32_t csum1; /**< Second checksum word */ | ||
| 271 | } | ||
| 272 | __netio_send_cmd_t; | ||
| 273 | |||
| 274 | |||
| 275 | /** Flags used in two contexts: | ||
| 276 | * - As the "flags" member in the __netio_send_cmd_t, above; used only | ||
| 277 | * for netio_pkt_send_{prepare,commit}. | ||
| 278 | * - As part of the flags passed to the various send packet fast I/O calls. | ||
| 279 | */ | ||
| 280 | |||
| 281 | /** Need acknowledgement on this packet. Note that some code in the | ||
| 282 | * normal send_pkt fast I/O handler assumes that this is equal to 1. */ | ||
| 283 | #define __NETIO_SEND_FLG_ACK 0x1 | ||
| 284 | |||
| 285 | /** Do checksum on this packet. (Only used with the __netio_send_cmd_t; | ||
| 286 | * normal packet sends use a special fast I/O index to denote checksumming, | ||
| 287 | * and multi-segment sends test the checksum descriptor.) */ | ||
| 288 | #define __NETIO_SEND_FLG_CSUM 0x2 | ||
| 289 | |||
| 290 | /** Get a completion on this packet. Only used with multi-segment sends. */ | ||
| 291 | #define __NETIO_SEND_FLG_COMPLETION 0x4 | ||
| 292 | |||
| 293 | /** Position of the number-of-extra-segments value in the flags word. | ||
| 294 | Only used with multi-segment sends. */ | ||
| 295 | #define __NETIO_SEND_FLG_XSEG_SHIFT 3 | ||
| 296 | |||
| 297 | /** Width of the number-of-extra-segments value in the flags word. */ | ||
| 298 | #define __NETIO_SEND_FLG_XSEG_WIDTH 2 | ||
| 299 | |||
| 300 | #endif /* __DRV_XGBE_IMPL_H__ */ | ||
diff --git a/arch/tile/include/hv/drv_xgbe_intf.h b/arch/tile/include/hv/drv_xgbe_intf.h new file mode 100644 index 000000000000..146e47d5334b --- /dev/null +++ b/arch/tile/include/hv/drv_xgbe_intf.h | |||
| @@ -0,0 +1,615 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU General Public License | ||
| 6 | * as published by the Free Software Foundation, version 2. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
| 11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /** | ||
| 16 | * @file drv_xgbe_intf.h | ||
| 17 | * Interface to the hypervisor XGBE driver. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __DRV_XGBE_INTF_H__ | ||
| 21 | #define __DRV_XGBE_INTF_H__ | ||
| 22 | |||
| 23 | /** | ||
| 24 | * An object for forwarding VAs and PAs to the hypervisor. | ||
| 25 | * @ingroup types | ||
| 26 | * | ||
| 27 | * This allows the supervisor to specify a number of areas of memory to | ||
| 28 | * store packet buffers. | ||
| 29 | */ | ||
| 30 | typedef struct | ||
| 31 | { | ||
| 32 | /** The physical address of the memory. */ | ||
| 33 | HV_PhysAddr pa; | ||
| 34 | /** Page table entry for the memory. This is only used to derive the | ||
| 35 | * memory's caching mode; the PA bits are ignored. */ | ||
| 36 | HV_PTE pte; | ||
| 37 | /** The virtual address of the memory. */ | ||
| 38 | HV_VirtAddr va; | ||
| 39 | /** Size (in bytes) of the memory area. */ | ||
| 40 | int size; | ||
| 41 | |||
| 42 | } | ||
| 43 | netio_ipp_address_t; | ||
| 44 | |||
| 45 | /** The various pread/pwrite offsets into the hypervisor-level driver. | ||
| 46 | * @ingroup types | ||
| 47 | */ | ||
| 48 | typedef enum | ||
| 49 | { | ||
| 50 | /** Inform the Linux driver of the address of the NetIO arena memory. | ||
| 51 | * This offset is actually only used to convey information from netio | ||
| 52 | * to the Linux driver; it never makes it from there to the hypervisor. | ||
| 53 | * Write-only; takes a uint32_t specifying the VA address. */ | ||
| 54 | NETIO_FIXED_ADDR = 0x5000000000000000ULL, | ||
| 55 | |||
| 56 | /** Inform the Linux driver of the size of the NetIO arena memory. | ||
| 57 | * This offset is actually only used to convey information from netio | ||
| 58 | * to the Linux driver; it never makes it from there to the hypervisor. | ||
| 59 | * Write-only; takes a uint32_t specifying the VA size. */ | ||
| 60 | NETIO_FIXED_SIZE = 0x5100000000000000ULL, | ||
| 61 | |||
| 62 | /** Register current tile with IPP. Write then read: write, takes a | ||
| 63 | * netio_input_config_t, read returns a pointer to a netio_queue_impl_t. */ | ||
| 64 | NETIO_IPP_INPUT_REGISTER_OFF = 0x6000000000000000ULL, | ||
| 65 | |||
| 66 | /** Unregister current tile from IPP. Write-only, takes a dummy argument. */ | ||
| 67 | NETIO_IPP_INPUT_UNREGISTER_OFF = 0x6100000000000000ULL, | ||
| 68 | |||
| 69 | /** Start packets flowing. Write-only, takes a dummy argument. */ | ||
| 70 | NETIO_IPP_INPUT_INIT_OFF = 0x6200000000000000ULL, | ||
| 71 | |||
| 72 | /** Stop packets flowing. Write-only, takes a dummy argument. */ | ||
| 73 | NETIO_IPP_INPUT_UNINIT_OFF = 0x6300000000000000ULL, | ||
| 74 | |||
| 75 | /** Configure group (typically we group on VLAN). Write-only: takes an | ||
| 76 | * array of netio_group_t's, low 24 bits of the offset is the base group | ||
| 77 | * number times the size of a netio_group_t. */ | ||
| 78 | NETIO_IPP_INPUT_GROUP_CFG_OFF = 0x6400000000000000ULL, | ||
| 79 | |||
| 80 | /** Configure bucket. Write-only: takes an array of netio_bucket_t's, low | ||
| 81 | * 24 bits of the offset is the base bucket number times the size of a | ||
| 82 | * netio_bucket_t. */ | ||
| 83 | NETIO_IPP_INPUT_BUCKET_CFG_OFF = 0x6500000000000000ULL, | ||
| 84 | |||
| 85 | /** Get/set a parameter. Read or write: read or write data is the parameter | ||
| 86 | * value, low 32 bits of the offset is a __netio_getset_offset_t. */ | ||
| 87 | NETIO_IPP_PARAM_OFF = 0x6600000000000000ULL, | ||
| 88 | |||
| 89 | /** Get fast I/O index. Read-only; returns a 4-byte base index value. */ | ||
| 90 | NETIO_IPP_GET_FASTIO_OFF = 0x6700000000000000ULL, | ||
| 91 | |||
| 92 | /** Configure hijack IP address. Packets with this IPv4 dest address | ||
| 93 | * go to bucket NETIO_NUM_BUCKETS - 1. Write-only: takes an IP address | ||
| 94 | * in some standard form. FIXME: Define the form! */ | ||
| 95 | NETIO_IPP_INPUT_HIJACK_CFG_OFF = 0x6800000000000000ULL, | ||
| 96 | |||
| 97 | /** | ||
| 98 | * Offsets beyond this point are reserved for the supervisor (although that | ||
| 99 | * enforcement must be done by the supervisor driver itself). | ||
| 100 | */ | ||
| 101 | NETIO_IPP_USER_MAX_OFF = 0x6FFFFFFFFFFFFFFFULL, | ||
| 102 | |||
| 103 | /** Register I/O memory. Write-only, takes a netio_ipp_address_t. */ | ||
| 104 | NETIO_IPP_IOMEM_REGISTER_OFF = 0x7000000000000000ULL, | ||
| 105 | |||
| 106 | /** Unregister I/O memory. Write-only, takes a netio_ipp_address_t. */ | ||
| 107 | NETIO_IPP_IOMEM_UNREGISTER_OFF = 0x7100000000000000ULL, | ||
| 108 | |||
| 109 | /* Offsets greater than 0x7FFFFFFF can't be used directly from Linux | ||
| 110 | * userspace code due to limitations in the pread/pwrite syscalls. */ | ||
| 111 | |||
| 112 | /** Drain LIPP buffers. */ | ||
| 113 | NETIO_IPP_DRAIN_OFF = 0xFA00000000000000ULL, | ||
| 114 | |||
| 115 | /** Supply a netio_ipp_address_t to be used as shared memory for the | ||
| 116 | * LEPP command queue. */ | ||
| 117 | NETIO_EPP_SHM_OFF = 0xFB00000000000000ULL, | ||
| 118 | |||
| 119 | /* 0xFC... is currently unused. */ | ||
| 120 | |||
| 121 | /** Stop IPP/EPP tiles. Write-only, takes a dummy argument. */ | ||
| 122 | NETIO_IPP_STOP_SHIM_OFF = 0xFD00000000000000ULL, | ||
| 123 | |||
| 124 | /** Start IPP/EPP tiles. Write-only, takes a dummy argument. */ | ||
| 125 | NETIO_IPP_START_SHIM_OFF = 0xFE00000000000000ULL, | ||
| 126 | |||
| 127 | /** Supply packet arena. Write-only, takes an array of | ||
| 128 | * netio_ipp_address_t values. */ | ||
| 129 | NETIO_IPP_ADDRESS_OFF = 0xFF00000000000000ULL, | ||
| 130 | } netio_hv_offset_t; | ||
| 131 | |||
| 132 | /** Extract the base offset from an offset */ | ||
| 133 | #define NETIO_BASE_OFFSET(off) ((off) & 0xFF00000000000000ULL) | ||
| 134 | /** Extract the local offset from an offset */ | ||
| 135 | #define NETIO_LOCAL_OFFSET(off) ((off) & 0x00FFFFFFFFFFFFFFULL) | ||
| 136 | |||
| 137 | |||
| 138 | /** | ||
| 139 | * Get/set offset. | ||
| 140 | */ | ||
| 141 | typedef union | ||
| 142 | { | ||
| 143 | struct | ||
| 144 | { | ||
| 145 | uint64_t addr:48; /**< Class-specific address */ | ||
| 146 | unsigned int class:8; /**< Class (e.g., NETIO_PARAM) */ | ||
| 147 | unsigned int opcode:8; /**< High 8 bits of NETIO_IPP_PARAM_OFF */ | ||
| 148 | } | ||
| 149 | bits; /**< Bitfields */ | ||
| 150 | uint64_t word; /**< Aggregated value to use as the offset */ | ||
| 151 | } | ||
| 152 | __netio_getset_offset_t; | ||
| 153 | |||
| 154 | /** | ||
| 155 | * Fast I/O index offsets (must be contiguous). | ||
| 156 | */ | ||
| 157 | typedef enum | ||
| 158 | { | ||
| 159 | NETIO_FASTIO_ALLOCATE = 0, /**< Get empty packet buffer */ | ||
| 160 | NETIO_FASTIO_FREE_BUFFER = 1, /**< Give buffer back to IPP */ | ||
| 161 | NETIO_FASTIO_RETURN_CREDITS = 2, /**< Give credits to IPP */ | ||
| 162 | NETIO_FASTIO_SEND_PKT_NOCK = 3, /**< Send a packet, no checksum */ | ||
| 163 | NETIO_FASTIO_SEND_PKT_CK = 4, /**< Send a packet, with checksum */ | ||
| 164 | NETIO_FASTIO_SEND_PKT_VEC = 5, /**< Send a vector of packets */ | ||
| 165 | NETIO_FASTIO_SENDV_PKT = 6, /**< Sendv one packet */ | ||
| 166 | NETIO_FASTIO_NUM_INDEX = 7, /**< Total number of fast I/O indices */ | ||
| 167 | } netio_fastio_index_t; | ||
| 168 | |||
| 169 | /** 3-word return type for Fast I/O call. */ | ||
| 170 | typedef struct | ||
| 171 | { | ||
| 172 | int err; /**< Error code. */ | ||
| 173 | uint32_t val0; /**< Value. Meaning depends upon the specific call. */ | ||
| 174 | uint32_t val1; /**< Value. Meaning depends upon the specific call. */ | ||
| 175 | } netio_fastio_rv3_t; | ||
| 176 | |||
| 177 | /** 0-argument fast I/O call */ | ||
| 178 | int __netio_fastio0(uint32_t fastio_index); | ||
| 179 | /** 1-argument fast I/O call */ | ||
| 180 | int __netio_fastio1(uint32_t fastio_index, uint32_t arg0); | ||
| 181 | /** 3-argument fast I/O call, 2-word return value */ | ||
| 182 | netio_fastio_rv3_t __netio_fastio3_rv3(uint32_t fastio_index, uint32_t arg0, | ||
| 183 | uint32_t arg1, uint32_t arg2); | ||
| 184 | /** 4-argument fast I/O call */ | ||
| 185 | int __netio_fastio4(uint32_t fastio_index, uint32_t arg0, uint32_t arg1, | ||
| 186 | uint32_t arg2, uint32_t arg3); | ||
| 187 | /** 6-argument fast I/O call */ | ||
| 188 | int __netio_fastio6(uint32_t fastio_index, uint32_t arg0, uint32_t arg1, | ||
| 189 | uint32_t arg2, uint32_t arg3, uint32_t arg4, uint32_t arg5); | ||
| 190 | /** 9-argument fast I/O call */ | ||
| 191 | int __netio_fastio9(uint32_t fastio_index, uint32_t arg0, uint32_t arg1, | ||
| 192 | uint32_t arg2, uint32_t arg3, uint32_t arg4, uint32_t arg5, | ||
| 193 | uint32_t arg6, uint32_t arg7, uint32_t arg8); | ||
| 194 | |||
| 195 | /** Allocate an empty packet. | ||
| 196 | * @param fastio_index Fast I/O index. | ||
| 197 | * @param size Size of the packet to allocate. | ||
| 198 | */ | ||
| 199 | #define __netio_fastio_allocate(fastio_index, size) \ | ||
| 200 | __netio_fastio1((fastio_index) + NETIO_FASTIO_ALLOCATE, size) | ||
| 201 | |||
| 202 | /** Free a buffer. | ||
| 203 | * @param fastio_index Fast I/O index. | ||
| 204 | * @param handle Handle for the packet to free. | ||
| 205 | */ | ||
| 206 | #define __netio_fastio_free_buffer(fastio_index, handle) \ | ||
| 207 | __netio_fastio1((fastio_index) + NETIO_FASTIO_FREE_BUFFER, handle) | ||
| 208 | |||
| 209 | /** Increment our receive credits. | ||
| 210 | * @param fastio_index Fast I/O index. | ||
| 211 | * @param credits Number of credits to add. | ||
| 212 | */ | ||
| 213 | #define __netio_fastio_return_credits(fastio_index, credits) \ | ||
| 214 | __netio_fastio1((fastio_index) + NETIO_FASTIO_RETURN_CREDITS, credits) | ||
| 215 | |||
| 216 | /** Send packet, no checksum. | ||
| 217 | * @param fastio_index Fast I/O index. | ||
| 218 | * @param ackflag Nonzero if we want an ack. | ||
| 219 | * @param size Size of the packet. | ||
| 220 | * @param va Virtual address of start of packet. | ||
| 221 | * @param handle Packet handle. | ||
| 222 | */ | ||
| 223 | #define __netio_fastio_send_pkt_nock(fastio_index, ackflag, size, va, handle) \ | ||
| 224 | __netio_fastio4((fastio_index) + NETIO_FASTIO_SEND_PKT_NOCK, ackflag, \ | ||
| 225 | size, va, handle) | ||
| 226 | |||
| 227 | /** Send packet, calculate checksum. | ||
| 228 | * @param fastio_index Fast I/O index. | ||
| 229 | * @param ackflag Nonzero if we want an ack. | ||
| 230 | * @param size Size of the packet. | ||
| 231 | * @param va Virtual address of start of packet. | ||
| 232 | * @param handle Packet handle. | ||
| 233 | * @param csum0 Shim checksum header. | ||
| 234 | * @param csum1 Checksum seed. | ||
| 235 | */ | ||
| 236 | #define __netio_fastio_send_pkt_ck(fastio_index, ackflag, size, va, handle, \ | ||
| 237 | csum0, csum1) \ | ||
| 238 | __netio_fastio6((fastio_index) + NETIO_FASTIO_SEND_PKT_CK, ackflag, \ | ||
| 239 | size, va, handle, csum0, csum1) | ||
| 240 | |||
| 241 | |||
| 242 | /** Format for the "csum0" argument to the __netio_fastio_send routines | ||
| 243 | * and LEPP. Note that this is currently exactly identical to the | ||
| 244 | * ShimProtocolOffloadHeader. | ||
| 245 | */ | ||
| 246 | typedef union | ||
| 247 | { | ||
| 248 | struct | ||
| 249 | { | ||
| 250 | unsigned int start_byte:7; /**< The first byte to be checksummed */ | ||
| 251 | unsigned int count:14; /**< Number of bytes to be checksummed. */ | ||
| 252 | unsigned int destination_byte:7; /**< The byte to write the checksum to. */ | ||
| 253 | unsigned int reserved:4; /**< Reserved. */ | ||
| 254 | } bits; /**< Decomposed method of access. */ | ||
| 255 | unsigned int word; /**< To send out the IDN. */ | ||
| 256 | } __netio_checksum_header_t; | ||
| 257 | |||
| 258 | |||
| 259 | /** Sendv packet with 1 or 2 segments. | ||
| 260 | * @param fastio_index Fast I/O index. | ||
| 261 | * @param flags Ack/csum/notify flags in low 3 bits; number of segments minus | ||
| 262 | * 1 in next 2 bits; expected checksum in high 16 bits. | ||
| 263 | * @param confno Confirmation number to request, if notify flag set. | ||
| 264 | * @param csum0 Checksum descriptor; if zero, no checksum. | ||
| 265 | * @param va_F Virtual address of first segment. | ||
| 266 | * @param va_L Virtual address of last segment, if 2 segments. | ||
| 267 | * @param len_F_L Length of first segment in low 16 bits; length of last | ||
| 268 | * segment, if 2 segments, in high 16 bits. | ||
| 269 | */ | ||
| 270 | #define __netio_fastio_sendv_pkt_1_2(fastio_index, flags, confno, csum0, \ | ||
| 271 | va_F, va_L, len_F_L) \ | ||
| 272 | __netio_fastio6((fastio_index) + NETIO_FASTIO_SENDV_PKT, flags, confno, \ | ||
| 273 | csum0, va_F, va_L, len_F_L) | ||
| 274 | |||
| 275 | /** Send packet on PCIe interface. | ||
| 276 | * @param fastio_index Fast I/O index. | ||
| 277 | * @param flags Ack/csum/notify flags in low 3 bits. | ||
| 278 | * @param confno Confirmation number to request, if notify flag set. | ||
| 279 | * @param csum0 Checksum descriptor; Hard wired 0, not needed for PCIe. | ||
| 280 | * @param va_F Virtual address of the packet buffer. | ||
| 281 | * @param va_L Virtual address of last segment, if 2 segments. Hard wired 0. | ||
| 282 | * @param len_F_L Length of the packet buffer in low 16 bits. | ||
| 283 | */ | ||
| 284 | #define __netio_fastio_send_pcie_pkt(fastio_index, flags, confno, csum0, \ | ||
| 285 | va_F, va_L, len_F_L) \ | ||
| 286 | __netio_fastio6((fastio_index) + PCIE_FASTIO_SENDV_PKT, flags, confno, \ | ||
| 287 | csum0, va_F, va_L, len_F_L) | ||
| 288 | |||
| 289 | /** Sendv packet with 3 or 4 segments. | ||
| 290 | * @param fastio_index Fast I/O index. | ||
| 291 | * @param flags Ack/csum/notify flags in low 3 bits; number of segments minus | ||
| 292 | * 1 in next 2 bits; expected checksum in high 16 bits. | ||
| 293 | * @param confno Confirmation number to request, if notify flag set. | ||
| 294 | * @param csum0 Checksum descriptor; if zero, no checksum. | ||
| 295 | * @param va_F Virtual address of first segment. | ||
| 296 | * @param va_L Virtual address of last segment (third segment if 3 segments, | ||
| 297 | * fourth segment if 4 segments). | ||
| 298 | * @param len_F_L Length of first segment in low 16 bits; length of last | ||
| 299 | * segment in high 16 bits. | ||
| 300 | * @param va_M0 Virtual address of "middle 0" segment; this segment is sent | ||
| 301 | * second when there are three segments, and third if there are four. | ||
| 302 | * @param va_M1 Virtual address of "middle 1" segment; this segment is sent | ||
| 303 | * second when there are four segments. | ||
| 304 | * @param len_M0_M1 Length of middle 0 segment in low 16 bits; length of middle | ||
| 305 | * 1 segment, if 4 segments, in high 16 bits. | ||
| 306 | */ | ||
| 307 | #define __netio_fastio_sendv_pkt_3_4(fastio_index, flags, confno, csum0, va_F, \ | ||
| 308 | va_L, len_F_L, va_M0, va_M1, len_M0_M1) \ | ||
| 309 | __netio_fastio9((fastio_index) + NETIO_FASTIO_SENDV_PKT, flags, confno, \ | ||
| 310 | csum0, va_F, va_L, len_F_L, va_M0, va_M1, len_M0_M1) | ||
| 311 | |||
| 312 | /** Send vector of packets. | ||
| 313 | * @param fastio_index Fast I/O index. | ||
| 314 | * @param seqno Number of packets transmitted so far on this interface; | ||
| 315 | * used to decide which packets should be acknowledged. | ||
| 316 | * @param nentries Number of entries in vector. | ||
| 317 | * @param va Virtual address of start of vector entry array. | ||
| 318 | * @return 3-word netio_fastio_rv3_t structure. The structure's err member | ||
| 319 | * is an error code, or zero if no error. The val0 member is the | ||
| 320 | * updated value of seqno; it has been incremented by 1 for each | ||
| 321 | * packet sent. That increment may be less than nentries if an | ||
| 322 | * error occured, or if some of the entries in the vector contain | ||
| 323 | * handles equal to NETIO_PKT_HANDLE_NONE. The val1 member is the | ||
| 324 | * updated value of nentries; it has been decremented by 1 for each | ||
| 325 | * vector entry processed. Again, that decrement may be less than | ||
| 326 | * nentries (leaving the returned value positive) if an error | ||
| 327 | * occurred. | ||
| 328 | */ | ||
| 329 | #define __netio_fastio_send_pkt_vec(fastio_index, seqno, nentries, va) \ | ||
| 330 | __netio_fastio3_rv3((fastio_index) + NETIO_FASTIO_SEND_PKT_VEC, seqno, \ | ||
| 331 | nentries, va) | ||
| 332 | |||
| 333 | |||
| 334 | /** An egress DMA command for LEPP. */ | ||
| 335 | typedef struct | ||
| 336 | { | ||
| 337 | /** Is this a TSO transfer? | ||
| 338 | * | ||
| 339 | * NOTE: This field is always 0, to distinguish it from | ||
| 340 | * lepp_tso_cmd_t. It must come first! | ||
| 341 | */ | ||
| 342 | uint8_t tso : 1; | ||
| 343 | |||
| 344 | /** Unused padding bits. */ | ||
| 345 | uint8_t _unused : 3; | ||
| 346 | |||
| 347 | /** Should this packet be sent directly from caches instead of DRAM, | ||
| 348 | * using hash-for-home to locate the packet data? | ||
| 349 | */ | ||
| 350 | uint8_t hash_for_home : 1; | ||
| 351 | |||
| 352 | /** Should we compute a checksum? */ | ||
| 353 | uint8_t compute_checksum : 1; | ||
| 354 | |||
| 355 | /** Is this the final buffer for this packet? | ||
| 356 | * | ||
| 357 | * A single packet can be split over several input buffers (a "gather" | ||
| 358 | * operation). This flag indicates that this is the last buffer | ||
| 359 | * in a packet. | ||
| 360 | */ | ||
| 361 | uint8_t end_of_packet : 1; | ||
| 362 | |||
| 363 | /** Should LEPP advance 'comp_busy' when this DMA is fully finished? */ | ||
| 364 | uint8_t send_completion : 1; | ||
| 365 | |||
| 366 | /** High bits of Client Physical Address of the start of the buffer | ||
| 367 | * to be egressed. | ||
| 368 | * | ||
| 369 | * NOTE: Only 6 bits are actually needed here, as CPAs are | ||
| 370 | * currently 38 bits. So two bits could be scavenged from this. | ||
| 371 | */ | ||
| 372 | uint8_t cpa_hi; | ||
| 373 | |||
| 374 | /** The number of bytes to be egressed. */ | ||
| 375 | uint16_t length; | ||
| 376 | |||
| 377 | /** Low 32 bits of Client Physical Address of the start of the buffer | ||
| 378 | * to be egressed. | ||
| 379 | */ | ||
| 380 | uint32_t cpa_lo; | ||
| 381 | |||
| 382 | /** Checksum information (only used if 'compute_checksum'). */ | ||
| 383 | __netio_checksum_header_t checksum_data; | ||
| 384 | |||
| 385 | } lepp_cmd_t; | ||
| 386 | |||
| 387 | |||
| 388 | /** A chunk of physical memory for a TSO egress. */ | ||
| 389 | typedef struct | ||
| 390 | { | ||
| 391 | /** The low bits of the CPA. */ | ||
| 392 | uint32_t cpa_lo; | ||
| 393 | /** The high bits of the CPA. */ | ||
| 394 | uint16_t cpa_hi : 15; | ||
| 395 | /** Should this packet be sent directly from caches instead of DRAM, | ||
| 396 | * using hash-for-home to locate the packet data? | ||
| 397 | */ | ||
| 398 | uint16_t hash_for_home : 1; | ||
| 399 | /** The length in bytes. */ | ||
| 400 | uint16_t length; | ||
| 401 | } lepp_frag_t; | ||
| 402 | |||
| 403 | |||
| 404 | /** An LEPP command that handles TSO. */ | ||
| 405 | typedef struct | ||
| 406 | { | ||
| 407 | /** Is this a TSO transfer? | ||
| 408 | * | ||
| 409 | * NOTE: This field is always 1, to distinguish it from | ||
| 410 | * lepp_cmd_t. It must come first! | ||
| 411 | */ | ||
| 412 | uint8_t tso : 1; | ||
| 413 | |||
| 414 | /** Unused padding bits. */ | ||
| 415 | uint8_t _unused : 7; | ||
| 416 | |||
| 417 | /** Size of the header[] array in bytes. It must be in the range | ||
| 418 | * [40, 127], which are the smallest header for a TCP packet over | ||
| 419 | * Ethernet and the maximum possible prepend size supported by | ||
| 420 | * hardware, respectively. Note that the array storage must be | ||
| 421 | * padded out to a multiple of four bytes so that the following | ||
| 422 | * LEPP command is aligned properly. | ||
| 423 | */ | ||
| 424 | uint8_t header_size; | ||
| 425 | |||
| 426 | /** Byte offset of the IP header in header[]. */ | ||
| 427 | uint8_t ip_offset; | ||
| 428 | |||
| 429 | /** Byte offset of the TCP header in header[]. */ | ||
| 430 | uint8_t tcp_offset; | ||
| 431 | |||
| 432 | /** The number of bytes to use for the payload of each packet, | ||
| 433 | * except of course the last one, which may not have enough bytes. | ||
| 434 | * This means that each Ethernet packet except the last will have a | ||
| 435 | * size of header_size + payload_size. | ||
| 436 | */ | ||
| 437 | uint16_t payload_size; | ||
| 438 | |||
| 439 | /** The length of the 'frags' array that follows this struct. */ | ||
| 440 | uint16_t num_frags; | ||
| 441 | |||
| 442 | /** The actual frags. */ | ||
| 443 | lepp_frag_t frags[0 /* Variable-sized; num_frags entries. */]; | ||
| 444 | |||
| 445 | /* | ||
| 446 | * The packet header template logically follows frags[], | ||
| 447 | * but you can't declare that in C. | ||
| 448 | * | ||
| 449 | * uint32_t header[header_size_in_words_rounded_up]; | ||
| 450 | */ | ||
| 451 | |||
| 452 | } lepp_tso_cmd_t; | ||
| 453 | |||
| 454 | |||
| 455 | /** An LEPP completion ring entry. */ | ||
| 456 | typedef void* lepp_comp_t; | ||
| 457 | |||
| 458 | |||
| 459 | /** Maximum number of frags for one TSO command. This is adapted from | ||
| 460 | * linux's "MAX_SKB_FRAGS", and presumably over-estimates by one, for | ||
| 461 | * our page size of exactly 65536. We add one for a "body" fragment. | ||
| 462 | */ | ||
| 463 | #define LEPP_MAX_FRAGS (65536 / HV_PAGE_SIZE_SMALL + 2 + 1) | ||
| 464 | |||
| 465 | /** Total number of bytes needed for an lepp_tso_cmd_t. */ | ||
| 466 | #define LEPP_TSO_CMD_SIZE(num_frags, header_size) \ | ||
| 467 | (sizeof(lepp_tso_cmd_t) + \ | ||
| 468 | (num_frags) * sizeof(lepp_frag_t) + \ | ||
| 469 | (((header_size) + 3) & -4)) | ||
| 470 | |||
| 471 | /** The size of the lepp "cmd" queue. */ | ||
| 472 | #define LEPP_CMD_QUEUE_BYTES \ | ||
| 473 | (((CHIP_L2_CACHE_SIZE() - 2 * CHIP_L2_LINE_SIZE()) / \ | ||
| 474 | (sizeof(lepp_cmd_t) + sizeof(lepp_comp_t))) * sizeof(lepp_cmd_t)) | ||
| 475 | |||
| 476 | /** The largest possible command that can go in lepp_queue_t::cmds[]. */ | ||
| 477 | #define LEPP_MAX_CMD_SIZE LEPP_TSO_CMD_SIZE(LEPP_MAX_FRAGS, 128) | ||
| 478 | |||
| 479 | /** The largest possible value of lepp_queue_t::cmd_{head, tail} (inclusive). | ||
| 480 | */ | ||
| 481 | #define LEPP_CMD_LIMIT \ | ||
| 482 | (LEPP_CMD_QUEUE_BYTES - LEPP_MAX_CMD_SIZE) | ||
| 483 | |||
| 484 | /** The maximum number of completions in an LEPP queue. */ | ||
| 485 | #define LEPP_COMP_QUEUE_SIZE \ | ||
| 486 | ((LEPP_CMD_LIMIT + sizeof(lepp_cmd_t) - 1) / sizeof(lepp_cmd_t)) | ||
| 487 | |||
| 488 | /** Increment an index modulo the queue size. */ | ||
| 489 | #define LEPP_QINC(var) \ | ||
| 490 | (var = __insn_mnz(var - (LEPP_COMP_QUEUE_SIZE - 1), var + 1)) | ||
| 491 | |||
| 492 | /** A queue used to convey egress commands from the client to LEPP. */ | ||
| 493 | typedef struct | ||
| 494 | { | ||
| 495 | /** Index of first completion not yet processed by user code. | ||
| 496 | * If this is equal to comp_busy, there are no such completions. | ||
| 497 | * | ||
| 498 | * NOTE: This is only read/written by the user. | ||
| 499 | */ | ||
| 500 | unsigned int comp_head; | ||
| 501 | |||
| 502 | /** Index of first completion record not yet completed. | ||
| 503 | * If this is equal to comp_tail, there are no such completions. | ||
| 504 | * This index gets advanced (modulo LEPP_QUEUE_SIZE) whenever | ||
| 505 | * a command with the 'completion' bit set is finished. | ||
| 506 | * | ||
| 507 | * NOTE: This is only written by LEPP, only read by the user. | ||
| 508 | */ | ||
| 509 | volatile unsigned int comp_busy; | ||
| 510 | |||
| 511 | /** Index of the first empty slot in the completion ring. | ||
| 512 | * Entries from this up to but not including comp_head (in ring order) | ||
| 513 | * can be filled in with completion data. | ||
| 514 | * | ||
| 515 | * NOTE: This is only read/written by the user. | ||
| 516 | */ | ||
| 517 | unsigned int comp_tail; | ||
| 518 | |||
| 519 | /** Byte index of first command enqueued for LEPP but not yet processed. | ||
| 520 | * | ||
| 521 | * This is always divisible by sizeof(void*) and always <= LEPP_CMD_LIMIT. | ||
| 522 | * | ||
| 523 | * NOTE: LEPP advances this counter as soon as it no longer needs | ||
| 524 | * the cmds[] storage for this entry, but the transfer is not actually | ||
| 525 | * complete (i.e. the buffer pointed to by the command is no longer | ||
| 526 | * needed) until comp_busy advances. | ||
| 527 | * | ||
| 528 | * If this is equal to cmd_tail, the ring is empty. | ||
| 529 | * | ||
| 530 | * NOTE: This is only written by LEPP, only read by the user. | ||
| 531 | */ | ||
| 532 | volatile unsigned int cmd_head; | ||
| 533 | |||
| 534 | /** Byte index of first empty slot in the command ring. This field can | ||
| 535 | * be incremented up to but not equal to cmd_head (because that would | ||
| 536 | * mean the ring is empty). | ||
| 537 | * | ||
| 538 | * This is always divisible by sizeof(void*) and always <= LEPP_CMD_LIMIT. | ||
| 539 | * | ||
| 540 | * NOTE: This is read/written by the user, only read by LEPP. | ||
| 541 | */ | ||
| 542 | volatile unsigned int cmd_tail; | ||
| 543 | |||
| 544 | /** A ring of variable-sized egress DMA commands. | ||
| 545 | * | ||
| 546 | * NOTE: Only written by the user, only read by LEPP. | ||
| 547 | */ | ||
| 548 | char cmds[LEPP_CMD_QUEUE_BYTES] | ||
| 549 | __attribute__((aligned(CHIP_L2_LINE_SIZE()))); | ||
| 550 | |||
| 551 | /** A ring of user completion data. | ||
| 552 | * NOTE: Only read/written by the user. | ||
| 553 | */ | ||
| 554 | lepp_comp_t comps[LEPP_COMP_QUEUE_SIZE] | ||
| 555 | __attribute__((aligned(CHIP_L2_LINE_SIZE()))); | ||
| 556 | } lepp_queue_t; | ||
| 557 | |||
| 558 | |||
| 559 | /** An internal helper function for determining the number of entries | ||
| 560 | * available in a ring buffer, given that there is one sentinel. | ||
| 561 | */ | ||
| 562 | static inline unsigned int | ||
| 563 | _lepp_num_free_slots(unsigned int head, unsigned int tail) | ||
| 564 | { | ||
| 565 | /* | ||
| 566 | * One entry is reserved for use as a sentinel, to distinguish | ||
| 567 | * "empty" from "full". So we compute | ||
| 568 | * (head - tail - 1) % LEPP_QUEUE_SIZE, but without using a slow % operation. | ||
| 569 | */ | ||
| 570 | return (head - tail - 1) + ((head <= tail) ? LEPP_COMP_QUEUE_SIZE : 0); | ||
| 571 | } | ||
| 572 | |||
| 573 | |||
| 574 | /** Returns how many new comp entries can be enqueued. */ | ||
| 575 | static inline unsigned int | ||
| 576 | lepp_num_free_comp_slots(const lepp_queue_t* q) | ||
| 577 | { | ||
| 578 | return _lepp_num_free_slots(q->comp_head, q->comp_tail); | ||
| 579 | } | ||
| 580 | |||
| 581 | static inline int | ||
| 582 | lepp_qsub(int v1, int v2) | ||
| 583 | { | ||
| 584 | int delta = v1 - v2; | ||
| 585 | return delta + ((delta >> 31) & LEPP_COMP_QUEUE_SIZE); | ||
| 586 | } | ||
| 587 | |||
| 588 | |||
| 589 | /** FIXME: Check this from linux, via a new "pwrite()" call. */ | ||
| 590 | #define LIPP_VERSION 1 | ||
| 591 | |||
| 592 | |||
| 593 | /** We use exactly two bytes of alignment padding. */ | ||
| 594 | #define LIPP_PACKET_PADDING 2 | ||
| 595 | |||
| 596 | /** The minimum size of a "small" buffer (including the padding). */ | ||
| 597 | #define LIPP_SMALL_PACKET_SIZE 128 | ||
| 598 | |||
| 599 | /* | ||
| 600 | * NOTE: The following two values should total to less than around | ||
| 601 | * 13582, to keep the total size used for "lipp_state_t" below 64K. | ||
| 602 | */ | ||
| 603 | |||
| 604 | /** The maximum number of "small" buffers. | ||
| 605 | * This is enough for 53 network cpus with 128 credits. Note that | ||
| 606 | * if these are exhausted, we will fall back to using large buffers. | ||
| 607 | */ | ||
| 608 | #define LIPP_SMALL_BUFFERS 6785 | ||
| 609 | |||
| 610 | /** The maximum number of "large" buffers. | ||
| 611 | * This is enough for 53 network cpus with 128 credits. | ||
| 612 | */ | ||
| 613 | #define LIPP_LARGE_BUFFERS 6785 | ||
| 614 | |||
| 615 | #endif /* __DRV_XGBE_INTF_H__ */ | ||
diff --git a/arch/tile/include/hv/netio_errors.h b/arch/tile/include/hv/netio_errors.h new file mode 100644 index 000000000000..e1591bff61b5 --- /dev/null +++ b/arch/tile/include/hv/netio_errors.h | |||
| @@ -0,0 +1,122 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU General Public License | ||
| 6 | * as published by the Free Software Foundation, version 2. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
| 11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /** | ||
| 16 | * Error codes returned from NetIO routines. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __NETIO_ERRORS_H__ | ||
| 20 | #define __NETIO_ERRORS_H__ | ||
| 21 | |||
| 22 | /** | ||
| 23 | * @addtogroup error | ||
| 24 | * | ||
| 25 | * @brief The error codes returned by NetIO functions. | ||
| 26 | * | ||
| 27 | * NetIO functions return 0 (defined as ::NETIO_NO_ERROR) on success, and | ||
| 28 | * a negative value if an error occurs. | ||
| 29 | * | ||
| 30 | * In cases where a NetIO function failed due to a error reported by | ||
| 31 | * system libraries, the error code will be the negation of the | ||
| 32 | * system errno at the time of failure. The @ref netio_strerror() | ||
| 33 | * function will deliver error strings for both NetIO and system error | ||
| 34 | * codes. | ||
| 35 | * | ||
| 36 | * @{ | ||
| 37 | */ | ||
| 38 | |||
| 39 | /** The set of all NetIO errors. */ | ||
| 40 | typedef enum | ||
| 41 | { | ||
| 42 | /** Operation successfully completed. */ | ||
| 43 | NETIO_NO_ERROR = 0, | ||
| 44 | |||
| 45 | /** A packet was successfully retrieved from an input queue. */ | ||
| 46 | NETIO_PKT = 0, | ||
| 47 | |||
| 48 | /** Largest NetIO error number. */ | ||
| 49 | NETIO_ERR_MAX = -701, | ||
| 50 | |||
| 51 | /** The tile is not registered with the IPP. */ | ||
| 52 | NETIO_NOT_REGISTERED = -701, | ||
| 53 | |||
| 54 | /** No packet was available to retrieve from the input queue. */ | ||
| 55 | NETIO_NOPKT = -702, | ||
| 56 | |||
| 57 | /** The requested function is not implemented. */ | ||
| 58 | NETIO_NOT_IMPLEMENTED = -703, | ||
| 59 | |||
| 60 | /** On a registration operation, the target queue already has the maximum | ||
| 61 | * number of tiles registered for it, and no more may be added. On a | ||
| 62 | * packet send operation, the output queue is full and nothing more can | ||
| 63 | * be queued until some of the queued packets are actually transmitted. */ | ||
| 64 | NETIO_QUEUE_FULL = -704, | ||
| 65 | |||
| 66 | /** The calling process or thread is not bound to exactly one CPU. */ | ||
| 67 | NETIO_BAD_AFFINITY = -705, | ||
| 68 | |||
| 69 | /** Cannot allocate memory on requested controllers. */ | ||
| 70 | NETIO_CANNOT_HOME = -706, | ||
| 71 | |||
| 72 | /** On a registration operation, the IPP specified is not configured | ||
| 73 | * to support the options requested; for instance, the application | ||
| 74 | * wants a specific type of tagged headers which the configured IPP | ||
| 75 | * doesn't support. Or, the supplied configuration information is | ||
| 76 | * not self-consistent, or is out of range; for instance, specifying | ||
| 77 | * both NETIO_RECV and NETIO_NO_RECV, or asking for more than | ||
| 78 | * NETIO_MAX_SEND_BUFFERS to be preallocated. On a VLAN or bucket | ||
| 79 | * configure operation, the number of items, or the base item, was | ||
| 80 | * out of range. | ||
| 81 | */ | ||
| 82 | NETIO_BAD_CONFIG = -707, | ||
| 83 | |||
| 84 | /** Too many tiles have registered to transmit packets. */ | ||
| 85 | NETIO_TOOMANY_XMIT = -708, | ||
| 86 | |||
| 87 | /** Packet transmission was attempted on a queue which was registered | ||
| 88 | with transmit disabled. */ | ||
| 89 | NETIO_UNREG_XMIT = -709, | ||
| 90 | |||
| 91 | /** This tile is already registered with the IPP. */ | ||
| 92 | NETIO_ALREADY_REGISTERED = -710, | ||
| 93 | |||
| 94 | /** The Ethernet link is down. The application should try again later. */ | ||
| 95 | NETIO_LINK_DOWN = -711, | ||
| 96 | |||
| 97 | /** An invalid memory buffer has been specified. This may be an unmapped | ||
| 98 | * virtual address, or one which does not meet alignment requirements. | ||
| 99 | * For netio_input_register(), this error may be returned when multiple | ||
| 100 | * processes specify different memory regions to be used for NetIO | ||
| 101 | * buffers. That can happen if these processes specify explicit memory | ||
| 102 | * regions with the ::NETIO_FIXED_BUFFER_VA flag, or if tmc_cmem_init() | ||
| 103 | * has not been called by a common ancestor of the processes. | ||
| 104 | */ | ||
| 105 | NETIO_FAULT = -712, | ||
| 106 | |||
| 107 | /** Cannot combine user-managed shared memory and cache coherence. */ | ||
| 108 | NETIO_BAD_CACHE_CONFIG = -713, | ||
| 109 | |||
| 110 | /** Smallest NetIO error number. */ | ||
| 111 | NETIO_ERR_MIN = -713, | ||
| 112 | |||
| 113 | #ifndef __DOXYGEN__ | ||
| 114 | /** Used internally to mean that no response is needed; never returned to | ||
| 115 | * an application. */ | ||
| 116 | NETIO_NO_RESPONSE = 1 | ||
| 117 | #endif | ||
| 118 | } netio_error_t; | ||
| 119 | |||
| 120 | /** @} */ | ||
| 121 | |||
| 122 | #endif /* __NETIO_ERRORS_H__ */ | ||
diff --git a/arch/tile/include/hv/netio_intf.h b/arch/tile/include/hv/netio_intf.h new file mode 100644 index 000000000000..8d20972aba2c --- /dev/null +++ b/arch/tile/include/hv/netio_intf.h | |||
| @@ -0,0 +1,2975 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU General Public License | ||
| 6 | * as published by the Free Software Foundation, version 2. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
| 11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /** | ||
| 16 | * NetIO interface structures and macros. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __NETIO_INTF_H__ | ||
| 20 | #define __NETIO_INTF_H__ | ||
| 21 | |||
| 22 | #include <hv/netio_errors.h> | ||
| 23 | |||
| 24 | #ifdef __KERNEL__ | ||
| 25 | #include <linux/types.h> | ||
| 26 | #else | ||
| 27 | #include <stdint.h> | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #if !defined(__HV__) && !defined(__BOGUX__) && !defined(__KERNEL__) | ||
| 31 | #include <assert.h> | ||
| 32 | #define netio_assert assert /**< Enable assertions from macros */ | ||
| 33 | #else | ||
| 34 | #define netio_assert(...) ((void)(0)) /**< Disable assertions from macros */ | ||
| 35 | #endif | ||
| 36 | |||
| 37 | /* | ||
| 38 | * If none of these symbols are defined, we're building libnetio in an | ||
| 39 | * environment where we have pthreads, so we'll enable locking. | ||
| 40 | */ | ||
| 41 | #if !defined(__HV__) && !defined(__BOGUX__) && !defined(__KERNEL__) && \ | ||
| 42 | !defined(__NEWLIB__) | ||
| 43 | #define _NETIO_PTHREAD /**< Include a mutex in netio_queue_t below */ | ||
| 44 | |||
| 45 | /* | ||
| 46 | * If NETIO_UNLOCKED is defined, we don't do use per-cpu locks on | ||
| 47 | * per-packet NetIO operations. We still do pthread locking on things | ||
| 48 | * like netio_input_register, though. This is used for building | ||
| 49 | * libnetio_unlocked. | ||
| 50 | */ | ||
| 51 | #ifndef NETIO_UNLOCKED | ||
| 52 | |||
| 53 | /* Avoid PLT overhead by using our own inlined per-cpu lock. */ | ||
| 54 | #include <sched.h> | ||
| 55 | typedef int _netio_percpu_mutex_t; | ||
| 56 | |||
| 57 | static __inline int | ||
| 58 | _netio_percpu_mutex_init(_netio_percpu_mutex_t* lock) | ||
| 59 | { | ||
| 60 | *lock = 0; | ||
| 61 | return 0; | ||
| 62 | } | ||
| 63 | |||
| 64 | static __inline int | ||
| 65 | _netio_percpu_mutex_lock(_netio_percpu_mutex_t* lock) | ||
| 66 | { | ||
| 67 | while (__builtin_expect(__insn_tns(lock), 0)) | ||
| 68 | sched_yield(); | ||
| 69 | return 0; | ||
| 70 | } | ||
| 71 | |||
| 72 | static __inline int | ||
| 73 | _netio_percpu_mutex_unlock(_netio_percpu_mutex_t* lock) | ||
| 74 | { | ||
| 75 | *lock = 0; | ||
| 76 | return 0; | ||
| 77 | } | ||
| 78 | |||
| 79 | #else /* NETIO_UNLOCKED */ | ||
| 80 | |||
| 81 | /* Don't do any locking for per-packet NetIO operations. */ | ||
| 82 | typedef int _netio_percpu_mutex_t; | ||
| 83 | #define _netio_percpu_mutex_init(L) | ||
| 84 | #define _netio_percpu_mutex_lock(L) | ||
| 85 | #define _netio_percpu_mutex_unlock(L) | ||
| 86 | |||
| 87 | #endif /* NETIO_UNLOCKED */ | ||
| 88 | #endif /* !__HV__, !__BOGUX, !__KERNEL__, !__NEWLIB__ */ | ||
| 89 | |||
| 90 | /** How many tiles can register for a given queue. | ||
| 91 | * @ingroup setup */ | ||
| 92 | #define NETIO_MAX_TILES_PER_QUEUE 64 | ||
| 93 | |||
| 94 | |||
| 95 | /** Largest permissible queue identifier. | ||
| 96 | * @ingroup setup */ | ||
| 97 | #define NETIO_MAX_QUEUE_ID 255 | ||
| 98 | |||
| 99 | |||
| 100 | #ifndef __DOXYGEN__ | ||
| 101 | |||
| 102 | /* Metadata packet checksum/ethertype flags. */ | ||
| 103 | |||
| 104 | /** The L4 checksum has not been calculated. */ | ||
| 105 | #define _NETIO_PKT_NO_L4_CSUM_SHIFT 0 | ||
| 106 | #define _NETIO_PKT_NO_L4_CSUM_RMASK 1 | ||
| 107 | #define _NETIO_PKT_NO_L4_CSUM_MASK \ | ||
| 108 | (_NETIO_PKT_NO_L4_CSUM_RMASK << _NETIO_PKT_NO_L4_CSUM_SHIFT) | ||
| 109 | |||
| 110 | /** The L3 checksum has not been calculated. */ | ||
| 111 | #define _NETIO_PKT_NO_L3_CSUM_SHIFT 1 | ||
| 112 | #define _NETIO_PKT_NO_L3_CSUM_RMASK 1 | ||
| 113 | #define _NETIO_PKT_NO_L3_CSUM_MASK \ | ||
| 114 | (_NETIO_PKT_NO_L3_CSUM_RMASK << _NETIO_PKT_NO_L3_CSUM_SHIFT) | ||
| 115 | |||
| 116 | /** The L3 checksum is incorrect (or perhaps has not been calculated). */ | ||
| 117 | #define _NETIO_PKT_BAD_L3_CSUM_SHIFT 2 | ||
| 118 | #define _NETIO_PKT_BAD_L3_CSUM_RMASK 1 | ||
| 119 | #define _NETIO_PKT_BAD_L3_CSUM_MASK \ | ||
| 120 | (_NETIO_PKT_BAD_L3_CSUM_RMASK << _NETIO_PKT_BAD_L3_CSUM_SHIFT) | ||
| 121 | |||
| 122 | /** The Ethernet packet type is unrecognized. */ | ||
| 123 | #define _NETIO_PKT_TYPE_UNRECOGNIZED_SHIFT 3 | ||
| 124 | #define _NETIO_PKT_TYPE_UNRECOGNIZED_RMASK 1 | ||
| 125 | #define _NETIO_PKT_TYPE_UNRECOGNIZED_MASK \ | ||
| 126 | (_NETIO_PKT_TYPE_UNRECOGNIZED_RMASK << \ | ||
| 127 | _NETIO_PKT_TYPE_UNRECOGNIZED_SHIFT) | ||
| 128 | |||
| 129 | /* Metadata packet type flags. */ | ||
| 130 | |||
| 131 | /** Where the packet type bits are; this field is the index into | ||
| 132 | * _netio_pkt_info. */ | ||
| 133 | #define _NETIO_PKT_TYPE_SHIFT 4 | ||
| 134 | #define _NETIO_PKT_TYPE_RMASK 0x3F | ||
| 135 | |||
| 136 | /** How many VLAN tags the packet has, and, if we have two, which one we | ||
| 137 | * actually grouped on. A VLAN within a proprietary (Marvell or Broadcom) | ||
| 138 | * tag is counted here. */ | ||
| 139 | #define _NETIO_PKT_VLAN_SHIFT 4 | ||
| 140 | #define _NETIO_PKT_VLAN_RMASK 0x3 | ||
| 141 | #define _NETIO_PKT_VLAN_MASK \ | ||
| 142 | (_NETIO_PKT_VLAN_RMASK << _NETIO_PKT_VLAN_SHIFT) | ||
| 143 | #define _NETIO_PKT_VLAN_NONE 0 /* No VLAN tag. */ | ||
| 144 | #define _NETIO_PKT_VLAN_ONE 1 /* One VLAN tag. */ | ||
| 145 | #define _NETIO_PKT_VLAN_TWO_OUTER 2 /* Two VLAN tags, outer one used. */ | ||
| 146 | #define _NETIO_PKT_VLAN_TWO_INNER 3 /* Two VLAN tags, inner one used. */ | ||
| 147 | |||
| 148 | /** Which proprietary tags the packet has. */ | ||
| 149 | #define _NETIO_PKT_TAG_SHIFT 6 | ||
| 150 | #define _NETIO_PKT_TAG_RMASK 0x3 | ||
| 151 | #define _NETIO_PKT_TAG_MASK \ | ||
| 152 | (_NETIO_PKT_TAG_RMASK << _NETIO_PKT_TAG_SHIFT) | ||
| 153 | #define _NETIO_PKT_TAG_NONE 0 /* No proprietary tags. */ | ||
| 154 | #define _NETIO_PKT_TAG_MRVL 1 /* Marvell HyperG.Stack tags. */ | ||
| 155 | #define _NETIO_PKT_TAG_MRVL_EXT 2 /* HyperG.Stack extended tags. */ | ||
| 156 | #define _NETIO_PKT_TAG_BRCM 3 /* Broadcom HiGig tags. */ | ||
| 157 | |||
| 158 | /** Whether a packet has an LLC + SNAP header. */ | ||
| 159 | #define _NETIO_PKT_SNAP_SHIFT 8 | ||
| 160 | #define _NETIO_PKT_SNAP_RMASK 0x1 | ||
| 161 | #define _NETIO_PKT_SNAP_MASK \ | ||
| 162 | (_NETIO_PKT_SNAP_RMASK << _NETIO_PKT_SNAP_SHIFT) | ||
| 163 | |||
| 164 | /* NOTE: Bits 9 and 10 are unused. */ | ||
| 165 | |||
| 166 | /** Length of any custom data before the L2 header, in words. */ | ||
| 167 | #define _NETIO_PKT_CUSTOM_LEN_SHIFT 11 | ||
| 168 | #define _NETIO_PKT_CUSTOM_LEN_RMASK 0x1F | ||
| 169 | #define _NETIO_PKT_CUSTOM_LEN_MASK \ | ||
| 170 | (_NETIO_PKT_CUSTOM_LEN_RMASK << _NETIO_PKT_CUSTOM_LEN_SHIFT) | ||
| 171 | |||
| 172 | /** The L4 checksum is incorrect (or perhaps has not been calculated). */ | ||
| 173 | #define _NETIO_PKT_BAD_L4_CSUM_SHIFT 16 | ||
| 174 | #define _NETIO_PKT_BAD_L4_CSUM_RMASK 0x1 | ||
| 175 | #define _NETIO_PKT_BAD_L4_CSUM_MASK \ | ||
| 176 | (_NETIO_PKT_BAD_L4_CSUM_RMASK << _NETIO_PKT_BAD_L4_CSUM_SHIFT) | ||
| 177 | |||
| 178 | /** Length of the L2 header, in words. */ | ||
| 179 | #define _NETIO_PKT_L2_LEN_SHIFT 17 | ||
| 180 | #define _NETIO_PKT_L2_LEN_RMASK 0x1F | ||
| 181 | #define _NETIO_PKT_L2_LEN_MASK \ | ||
| 182 | (_NETIO_PKT_L2_LEN_RMASK << _NETIO_PKT_L2_LEN_SHIFT) | ||
| 183 | |||
| 184 | |||
| 185 | /* Flags in minimal packet metadata. */ | ||
| 186 | |||
| 187 | /** We need an eDMA checksum on this packet. */ | ||
| 188 | #define _NETIO_PKT_NEED_EDMA_CSUM_SHIFT 0 | ||
| 189 | #define _NETIO_PKT_NEED_EDMA_CSUM_RMASK 1 | ||
| 190 | #define _NETIO_PKT_NEED_EDMA_CSUM_MASK \ | ||
| 191 | (_NETIO_PKT_NEED_EDMA_CSUM_RMASK << _NETIO_PKT_NEED_EDMA_CSUM_SHIFT) | ||
| 192 | |||
| 193 | /* Data within the packet information table. */ | ||
| 194 | |||
| 195 | /* Note that, for efficiency, code which uses these fields assumes that none | ||
| 196 | * of the shift values below are zero. See uses below for an explanation. */ | ||
| 197 | |||
| 198 | /** Offset within the L2 header of the innermost ethertype (in halfwords). */ | ||
| 199 | #define _NETIO_PKT_INFO_ETYPE_SHIFT 6 | ||
| 200 | #define _NETIO_PKT_INFO_ETYPE_RMASK 0x1F | ||
| 201 | |||
| 202 | /** Offset within the L2 header of the VLAN tag (in halfwords). */ | ||
| 203 | #define _NETIO_PKT_INFO_VLAN_SHIFT 11 | ||
| 204 | #define _NETIO_PKT_INFO_VLAN_RMASK 0x1F | ||
| 205 | |||
| 206 | #endif | ||
| 207 | |||
| 208 | |||
| 209 | /** The size of a memory buffer representing a small packet. | ||
| 210 | * @ingroup egress */ | ||
| 211 | #define SMALL_PACKET_SIZE 256 | ||
| 212 | |||
| 213 | /** The size of a memory buffer representing a large packet. | ||
| 214 | * @ingroup egress */ | ||
| 215 | #define LARGE_PACKET_SIZE 2048 | ||
| 216 | |||
| 217 | /** The size of a memory buffer representing a jumbo packet. | ||
| 218 | * @ingroup egress */ | ||
| 219 | #define JUMBO_PACKET_SIZE (12 * 1024) | ||
| 220 | |||
| 221 | |||
| 222 | /* Common ethertypes. | ||
| 223 | * @ingroup ingress */ | ||
| 224 | /** @{ */ | ||
| 225 | /** The ethertype of IPv4. */ | ||
| 226 | #define ETHERTYPE_IPv4 (0x0800) | ||
| 227 | /** The ethertype of ARP. */ | ||
| 228 | #define ETHERTYPE_ARP (0x0806) | ||
| 229 | /** The ethertype of VLANs. */ | ||
| 230 | #define ETHERTYPE_VLAN (0x8100) | ||
| 231 | /** The ethertype of a Q-in-Q header. */ | ||
| 232 | #define ETHERTYPE_Q_IN_Q (0x9100) | ||
| 233 | /** The ethertype of IPv6. */ | ||
| 234 | #define ETHERTYPE_IPv6 (0x86DD) | ||
| 235 | /** The ethertype of MPLS. */ | ||
| 236 | #define ETHERTYPE_MPLS (0x8847) | ||
| 237 | /** @} */ | ||
| 238 | |||
| 239 | |||
| 240 | /** The possible return values of NETIO_PKT_STATUS. | ||
| 241 | * @ingroup ingress | ||
| 242 | */ | ||
| 243 | typedef enum | ||
| 244 | { | ||
| 245 | /** No problems were detected with this packet. */ | ||
| 246 | NETIO_PKT_STATUS_OK, | ||
| 247 | /** The packet is undersized; this is expected behavior if the packet's | ||
| 248 | * ethertype is unrecognized, but otherwise the packet is likely corrupt. */ | ||
| 249 | NETIO_PKT_STATUS_UNDERSIZE, | ||
| 250 | /** The packet is oversized and some trailing bytes have been discarded. | ||
| 251 | This is expected behavior for short packets, since it's impossible to | ||
| 252 | precisely determine the amount of padding which may have been added to | ||
| 253 | them to make them meet the minimum Ethernet packet size. */ | ||
| 254 | NETIO_PKT_STATUS_OVERSIZE, | ||
| 255 | /** The packet was judged to be corrupt by hardware (for instance, it had | ||
| 256 | a bad CRC, or part of it was discarded due to lack of buffer space in | ||
| 257 | the I/O shim) and should be discarded. */ | ||
| 258 | NETIO_PKT_STATUS_BAD | ||
| 259 | } netio_pkt_status_t; | ||
| 260 | |||
| 261 | |||
| 262 | /** Log2 of how many buckets we have. */ | ||
| 263 | #define NETIO_LOG2_NUM_BUCKETS (10) | ||
| 264 | |||
| 265 | /** How many buckets we have. | ||
| 266 | * @ingroup ingress */ | ||
| 267 | #define NETIO_NUM_BUCKETS (1 << NETIO_LOG2_NUM_BUCKETS) | ||
| 268 | |||
| 269 | |||
| 270 | /** | ||
| 271 | * @brief A group-to-bucket identifier. | ||
| 272 | * | ||
| 273 | * @ingroup setup | ||
| 274 | * | ||
| 275 | * This tells us what to do with a given group. | ||
| 276 | */ | ||
| 277 | typedef union { | ||
| 278 | /** The header broken down into bits. */ | ||
| 279 | struct { | ||
| 280 | /** Whether we should balance on L4, if available */ | ||
| 281 | unsigned int __balance_on_l4:1; | ||
| 282 | /** Whether we should balance on L3, if available */ | ||
| 283 | unsigned int __balance_on_l3:1; | ||
| 284 | /** Whether we should balance on L2, if available */ | ||
| 285 | unsigned int __balance_on_l2:1; | ||
| 286 | /** Reserved for future use */ | ||
| 287 | unsigned int __reserved:1; | ||
| 288 | /** The base bucket to use to send traffic */ | ||
| 289 | unsigned int __bucket_base:NETIO_LOG2_NUM_BUCKETS; | ||
| 290 | /** The mask to apply to the balancing value. This must be one less | ||
| 291 | * than a power of two, e.g. 0x3 or 0xFF. | ||
| 292 | */ | ||
| 293 | unsigned int __bucket_mask:NETIO_LOG2_NUM_BUCKETS; | ||
| 294 | /** Pad to 32 bits */ | ||
| 295 | unsigned int __padding:(32 - 4 - 2 * NETIO_LOG2_NUM_BUCKETS); | ||
| 296 | } bits; | ||
| 297 | /** To send out the IDN. */ | ||
| 298 | unsigned int word; | ||
| 299 | } | ||
| 300 | netio_group_t; | ||
| 301 | |||
| 302 | |||
| 303 | /** | ||
| 304 | * @brief A VLAN-to-bucket identifier. | ||
| 305 | * | ||
| 306 | * @ingroup setup | ||
| 307 | * | ||
| 308 | * This tells us what to do with a given VLAN. | ||
| 309 | */ | ||
| 310 | typedef netio_group_t netio_vlan_t; | ||
| 311 | |||
| 312 | |||
| 313 | /** | ||
| 314 | * A bucket-to-queue mapping. | ||
| 315 | * @ingroup setup | ||
| 316 | */ | ||
| 317 | typedef unsigned char netio_bucket_t; | ||
| 318 | |||
| 319 | |||
| 320 | /** | ||
| 321 | * A packet size can always fit in a netio_size_t. | ||
| 322 | * @ingroup setup | ||
| 323 | */ | ||
| 324 | typedef unsigned int netio_size_t; | ||
| 325 | |||
| 326 | |||
| 327 | /** | ||
| 328 | * @brief Ethernet standard (ingress) packet metadata. | ||
| 329 | * | ||
| 330 | * @ingroup ingress | ||
| 331 | * | ||
| 332 | * This is additional data associated with each packet. | ||
| 333 | * This structure is opaque and accessed through the @ref ingress. | ||
| 334 | * | ||
| 335 | * Also, the buffer population operation currently assumes that standard | ||
| 336 | * metadata is at least as large as minimal metadata, and will need to be | ||
| 337 | * modified if that is no longer the case. | ||
| 338 | */ | ||
| 339 | typedef struct | ||
| 340 | { | ||
| 341 | #ifdef __DOXYGEN__ | ||
| 342 | /** This structure is opaque. */ | ||
| 343 | unsigned char opaque[24]; | ||
| 344 | #else | ||
| 345 | /** The overall ordinal of the packet */ | ||
| 346 | unsigned int __packet_ordinal; | ||
| 347 | /** The ordinal of the packet within the group */ | ||
| 348 | unsigned int __group_ordinal; | ||
| 349 | /** The best flow hash IPP could compute. */ | ||
| 350 | unsigned int __flow_hash; | ||
| 351 | /** Flags pertaining to checksum calculation, packet type, etc. */ | ||
| 352 | unsigned int __flags; | ||
| 353 | /** The first word of "user data". */ | ||
| 354 | unsigned int __user_data_0; | ||
| 355 | /** The second word of "user data". */ | ||
| 356 | unsigned int __user_data_1; | ||
| 357 | #endif | ||
| 358 | } | ||
| 359 | netio_pkt_metadata_t; | ||
| 360 | |||
| 361 | |||
| 362 | /** To ensure that the L3 header is aligned mod 4, the L2 header should be | ||
| 363 | * aligned mod 4 plus 2, since every supported L2 header is 4n + 2 bytes | ||
| 364 | * long. The standard way to do this is to simply add 2 bytes of padding | ||
| 365 | * before the L2 header. | ||
| 366 | */ | ||
| 367 | #define NETIO_PACKET_PADDING 2 | ||
| 368 | |||
| 369 | |||
| 370 | |||
| 371 | /** | ||
| 372 | * @brief Ethernet minimal (egress) packet metadata. | ||
| 373 | * | ||
| 374 | * @ingroup egress | ||
| 375 | * | ||
| 376 | * This structure represents information about packets which have | ||
| 377 | * been processed by @ref netio_populate_buffer() or | ||
| 378 | * @ref netio_populate_prepend_buffer(). This structure is opaque | ||
| 379 | * and accessed through the @ref egress. | ||
| 380 | * | ||
| 381 | * @internal This structure is actually copied into the memory used by | ||
| 382 | * standard metadata, which is assumed to be large enough. | ||
| 383 | */ | ||
| 384 | typedef struct | ||
| 385 | { | ||
| 386 | #ifdef __DOXYGEN__ | ||
| 387 | /** This structure is opaque. */ | ||
| 388 | unsigned char opaque[14]; | ||
| 389 | #else | ||
| 390 | /** The offset of the L2 header from the start of the packet data. */ | ||
| 391 | unsigned short l2_offset; | ||
| 392 | /** The offset of the L3 header from the start of the packet data. */ | ||
| 393 | unsigned short l3_offset; | ||
| 394 | /** Where to write the checksum. */ | ||
| 395 | unsigned char csum_location; | ||
| 396 | /** Where to start checksumming from. */ | ||
| 397 | unsigned char csum_start; | ||
| 398 | /** Flags pertaining to checksum calculation etc. */ | ||
| 399 | unsigned short flags; | ||
| 400 | /** The L2 length of the packet. */ | ||
| 401 | unsigned short l2_length; | ||
| 402 | /** The checksum with which to seed the checksum generator. */ | ||
| 403 | unsigned short csum_seed; | ||
| 404 | /** How much to checksum. */ | ||
| 405 | unsigned short csum_length; | ||
| 406 | #endif | ||
| 407 | } | ||
| 408 | netio_pkt_minimal_metadata_t; | ||
| 409 | |||
| 410 | |||
| 411 | #ifndef __DOXYGEN__ | ||
| 412 | |||
| 413 | /** | ||
| 414 | * @brief An I/O notification header. | ||
| 415 | * | ||
| 416 | * This is the first word of data received from an I/O shim in a notification | ||
| 417 | * packet. It contains framing and status information. | ||
| 418 | */ | ||
| 419 | typedef union | ||
| 420 | { | ||
| 421 | unsigned int word; /**< The whole word. */ | ||
| 422 | /** The various fields. */ | ||
| 423 | struct | ||
| 424 | { | ||
| 425 | unsigned int __channel:7; /**< Resource channel. */ | ||
| 426 | unsigned int __type:4; /**< Type. */ | ||
| 427 | unsigned int __ack:1; /**< Whether an acknowledgement is needed. */ | ||
| 428 | unsigned int __reserved:1; /**< Reserved. */ | ||
| 429 | unsigned int __protocol:1; /**< A protocol-specific word is added. */ | ||
| 430 | unsigned int __status:2; /**< Status of the transfer. */ | ||
| 431 | unsigned int __framing:2; /**< Framing of the transfer. */ | ||
| 432 | unsigned int __transfer_size:14; /**< Transfer size in bytes (total). */ | ||
| 433 | } bits; | ||
| 434 | } | ||
| 435 | __netio_pkt_notif_t; | ||
| 436 | |||
| 437 | |||
| 438 | /** | ||
| 439 | * Returns the base address of the packet. | ||
| 440 | */ | ||
| 441 | #define _NETIO_PKT_HANDLE_BASE(p) \ | ||
| 442 | ((unsigned char*)((p).word & 0xFFFFFFC0)) | ||
| 443 | |||
| 444 | /** | ||
| 445 | * Returns the base address of the packet. | ||
| 446 | */ | ||
| 447 | #define _NETIO_PKT_BASE(p) \ | ||
| 448 | _NETIO_PKT_HANDLE_BASE(p->__packet) | ||
| 449 | |||
| 450 | /** | ||
| 451 | * @brief An I/O notification packet (second word) | ||
| 452 | * | ||
| 453 | * This is the second word of data received from an I/O shim in a notification | ||
| 454 | * packet. This is the virtual address of the packet buffer, plus some flag | ||
| 455 | * bits. (The virtual address of the packet is always 256-byte aligned so we | ||
| 456 | * have room for 8 bits' worth of flags in the low 8 bits.) | ||
| 457 | * | ||
| 458 | * @internal | ||
| 459 | * NOTE: The low two bits must contain "__queue", so the "packet size" | ||
| 460 | * (SIZE_SMALL, SIZE_LARGE, or SIZE_JUMBO) can be determined quickly. | ||
| 461 | * | ||
| 462 | * If __addr or __offset are moved, _NETIO_PKT_BASE | ||
| 463 | * (defined right below this) must be changed. | ||
| 464 | */ | ||
| 465 | typedef union | ||
| 466 | { | ||
| 467 | unsigned int word; /**< The whole word. */ | ||
| 468 | /** The various fields. */ | ||
| 469 | struct | ||
| 470 | { | ||
| 471 | /** Which queue the packet will be returned to once it is sent back to | ||
| 472 | the IPP. This is one of the SIZE_xxx values. */ | ||
| 473 | unsigned int __queue:2; | ||
| 474 | |||
| 475 | /** The IPP handle of the sending IPP. */ | ||
| 476 | unsigned int __ipp_handle:2; | ||
| 477 | |||
| 478 | /** Reserved for future use. */ | ||
| 479 | unsigned int __reserved:1; | ||
| 480 | |||
| 481 | /** If 1, this packet has minimal (egress) metadata; otherwise, it | ||
| 482 | has standard (ingress) metadata. */ | ||
| 483 | unsigned int __minimal:1; | ||
| 484 | |||
| 485 | /** Offset of the metadata within the packet. This value is multiplied | ||
| 486 | * by 64 and added to the base packet address to get the metadata | ||
| 487 | * address. Note that this field is aligned within the word such that | ||
| 488 | * you can easily extract the metadata address with a 26-bit mask. */ | ||
| 489 | unsigned int __offset:2; | ||
| 490 | |||
| 491 | /** The top 24 bits of the packet's virtual address. */ | ||
| 492 | unsigned int __addr:24; | ||
| 493 | } bits; | ||
| 494 | } | ||
| 495 | __netio_pkt_handle_t; | ||
| 496 | |||
| 497 | #endif /* !__DOXYGEN__ */ | ||
| 498 | |||
| 499 | |||
| 500 | /** | ||
| 501 | * @brief A handle for an I/O packet's storage. | ||
| 502 | * @ingroup ingress | ||
| 503 | * | ||
| 504 | * netio_pkt_handle_t encodes the concept of a ::netio_pkt_t with its | ||
| 505 | * packet metadata removed. It is a much smaller type that exists to | ||
| 506 | * facilitate applications where the full ::netio_pkt_t type is too | ||
| 507 | * large, such as those that cache enormous numbers of packets or wish | ||
| 508 | * to transmit packet descriptors over the UDN. | ||
| 509 | * | ||
| 510 | * Because there is no metadata, most ::netio_pkt_t operations cannot be | ||
| 511 | * performed on a netio_pkt_handle_t. It supports only | ||
| 512 | * netio_free_handle() (to free the buffer) and | ||
| 513 | * NETIO_PKT_CUSTOM_DATA_H() (to access a pointer to its contents). | ||
| 514 | * The application must acquire any additional metadata it wants from the | ||
| 515 | * original ::netio_pkt_t and record it separately. | ||
| 516 | * | ||
| 517 | * A netio_pkt_handle_t can be extracted from a ::netio_pkt_t by calling | ||
| 518 | * NETIO_PKT_HANDLE(). An invalid handle (analogous to NULL) can be | ||
| 519 | * created by assigning the value ::NETIO_PKT_HANDLE_NONE. A handle can | ||
| 520 | * be tested for validity with NETIO_PKT_HANDLE_IS_VALID(). | ||
| 521 | */ | ||
| 522 | typedef struct | ||
| 523 | { | ||
| 524 | unsigned int word; /**< Opaque bits. */ | ||
| 525 | } netio_pkt_handle_t; | ||
| 526 | |||
| 527 | /** | ||
| 528 | * @brief A packet descriptor. | ||
| 529 | * | ||
| 530 | * @ingroup ingress | ||
| 531 | * @ingroup egress | ||
| 532 | * | ||
| 533 | * This data structure represents a packet. The structure is manipulated | ||
| 534 | * through the @ref ingress and the @ref egress. | ||
| 535 | * | ||
| 536 | * While the contents of a netio_pkt_t are opaque, the structure itself is | ||
| 537 | * portable. This means that it may be shared between all tiles which have | ||
| 538 | * done a netio_input_register() call for the interface on which the pkt_t | ||
| 539 | * was initially received (via netio_get_packet()) or retrieved (via | ||
| 540 | * netio_get_buffer()). The contents of a netio_pkt_t can be transmitted to | ||
| 541 | * another tile via shared memory, or via a UDN message, or by other means. | ||
| 542 | * The destination tile may then use the pkt_t as if it had originally been | ||
| 543 | * received locally; it may read or write the packet's data, read its | ||
| 544 | * metadata, free the packet, send the packet, transfer the netio_pkt_t to | ||
| 545 | * yet another tile, and so forth. | ||
| 546 | * | ||
| 547 | * Once a netio_pkt_t has been transferred to a second tile, the first tile | ||
| 548 | * should not reference the original copy; in particular, if more than one | ||
| 549 | * tile frees or sends the same netio_pkt_t, the IPP's packet free lists will | ||
| 550 | * become corrupted. Note also that each tile which reads or modifies | ||
| 551 | * packet data must obey the memory coherency rules outlined in @ref input. | ||
| 552 | */ | ||
| 553 | typedef struct | ||
| 554 | { | ||
| 555 | #ifdef __DOXYGEN__ | ||
| 556 | /** This structure is opaque. */ | ||
| 557 | unsigned char opaque[32]; | ||
| 558 | #else | ||
| 559 | /** For an ingress packet (one with standard metadata), this is the | ||
| 560 | * notification header we got from the I/O shim. For an egress packet | ||
| 561 | * (one with minimal metadata), this word is zero if the packet has not | ||
| 562 | * been populated, and nonzero if it has. */ | ||
| 563 | __netio_pkt_notif_t __notif_header; | ||
| 564 | |||
| 565 | /** Virtual address of the packet buffer, plus state flags. */ | ||
| 566 | __netio_pkt_handle_t __packet; | ||
| 567 | |||
| 568 | /** Metadata associated with the packet. */ | ||
| 569 | netio_pkt_metadata_t __metadata; | ||
| 570 | #endif | ||
| 571 | } | ||
| 572 | netio_pkt_t; | ||
| 573 | |||
| 574 | |||
| 575 | #ifndef __DOXYGEN__ | ||
| 576 | |||
| 577 | #define __NETIO_PKT_NOTIF_HEADER(pkt) ((pkt)->__notif_header) | ||
| 578 | #define __NETIO_PKT_IPP_HANDLE(pkt) ((pkt)->__packet.bits.__ipp_handle) | ||
| 579 | #define __NETIO_PKT_QUEUE(pkt) ((pkt)->__packet.bits.__queue) | ||
| 580 | #define __NETIO_PKT_NOTIF_HEADER_M(mda, pkt) ((pkt)->__notif_header) | ||
| 581 | #define __NETIO_PKT_IPP_HANDLE_M(mda, pkt) ((pkt)->__packet.bits.__ipp_handle) | ||
| 582 | #define __NETIO_PKT_MINIMAL(pkt) ((pkt)->__packet.bits.__minimal) | ||
| 583 | #define __NETIO_PKT_QUEUE_M(mda, pkt) ((pkt)->__packet.bits.__queue) | ||
| 584 | #define __NETIO_PKT_FLAGS_M(mda, pkt) ((mda)->__flags) | ||
| 585 | |||
| 586 | /* Packet information table, used by the attribute access functions below. */ | ||
| 587 | extern const uint16_t _netio_pkt_info[]; | ||
| 588 | |||
| 589 | #endif /* __DOXYGEN__ */ | ||
| 590 | |||
| 591 | |||
| 592 | #ifndef __DOXYGEN__ | ||
| 593 | /* These macros are deprecated and will disappear in a future MDE release. */ | ||
| 594 | #define NETIO_PKT_GOOD_CHECKSUM(pkt) \ | ||
| 595 | NETIO_PKT_L4_CSUM_CORRECT(pkt) | ||
| 596 | #define NETIO_PKT_GOOD_CHECKSUM_M(mda, pkt) \ | ||
| 597 | NETIO_PKT_L4_CSUM_CORRECT_M(mda, pkt) | ||
| 598 | #endif /* __DOXYGEN__ */ | ||
| 599 | |||
| 600 | |||
| 601 | /* Packet attribute access functions. */ | ||
| 602 | |||
| 603 | /** Return a pointer to the metadata for a packet. | ||
| 604 | * @ingroup ingress | ||
| 605 | * | ||
| 606 | * Calling this function once and passing the result to other retrieval | ||
| 607 | * functions with a "_M" suffix usually improves performance. This | ||
| 608 | * function must be called on an 'ingress' packet (i.e. one retrieved | ||
| 609 | * by @ref netio_get_packet(), on which @ref netio_populate_buffer() or | ||
| 610 | * @ref netio_populate_prepend_buffer have not been called). Use of this | ||
| 611 | * function on an 'egress' packet will cause an assertion failure. | ||
| 612 | * | ||
| 613 | * @param[in] pkt Packet on which to operate. | ||
| 614 | * @return A pointer to the packet's standard metadata. | ||
| 615 | */ | ||
| 616 | static __inline netio_pkt_metadata_t* | ||
| 617 | NETIO_PKT_METADATA(netio_pkt_t* pkt) | ||
| 618 | { | ||
| 619 | netio_assert(!pkt->__packet.bits.__minimal); | ||
| 620 | return &pkt->__metadata; | ||
| 621 | } | ||
| 622 | |||
| 623 | |||
| 624 | /** Return a pointer to the minimal metadata for a packet. | ||
| 625 | * @ingroup egress | ||
| 626 | * | ||
| 627 | * Calling this function once and passing the result to other retrieval | ||
| 628 | * functions with a "_MM" suffix usually improves performance. This | ||
| 629 | * function must be called on an 'egress' packet (i.e. one on which | ||
| 630 | * @ref netio_populate_buffer() or @ref netio_populate_prepend_buffer() | ||
| 631 | * have been called, or one retrieved by @ref netio_get_buffer()). Use of | ||
| 632 | * this function on an 'ingress' packet will cause an assertion failure. | ||
| 633 | * | ||
| 634 | * @param[in] pkt Packet on which to operate. | ||
| 635 | * @return A pointer to the packet's standard metadata. | ||
| 636 | */ | ||
| 637 | static __inline netio_pkt_minimal_metadata_t* | ||
| 638 | NETIO_PKT_MINIMAL_METADATA(netio_pkt_t* pkt) | ||
| 639 | { | ||
| 640 | netio_assert(pkt->__packet.bits.__minimal); | ||
| 641 | return (netio_pkt_minimal_metadata_t*) &pkt->__metadata; | ||
| 642 | } | ||
| 643 | |||
| 644 | |||
| 645 | /** Determine whether a packet has 'minimal' metadata. | ||
| 646 | * @ingroup pktfuncs | ||
| 647 | * | ||
| 648 | * This function will return nonzero if the packet is an 'egress' | ||
| 649 | * packet (i.e. one on which @ref netio_populate_buffer() or | ||
| 650 | * @ref netio_populate_prepend_buffer() have been called, or one | ||
| 651 | * retrieved by @ref netio_get_buffer()), and zero if the packet | ||
| 652 | * is an 'ingress' packet (i.e. one retrieved by @ref netio_get_packet(), | ||
| 653 | * which has not been converted into an 'egress' packet). | ||
| 654 | * | ||
| 655 | * @param[in] pkt Packet on which to operate. | ||
| 656 | * @return Nonzero if the packet has minimal metadata. | ||
| 657 | */ | ||
| 658 | static __inline unsigned int | ||
| 659 | NETIO_PKT_IS_MINIMAL(netio_pkt_t* pkt) | ||
| 660 | { | ||
| 661 | return pkt->__packet.bits.__minimal; | ||
| 662 | } | ||
| 663 | |||
| 664 | |||
| 665 | /** Return a handle for a packet's storage. | ||
| 666 | * @ingroup pktfuncs | ||
| 667 | * | ||
| 668 | * @param[in] pkt Packet on which to operate. | ||
| 669 | * @return A handle for the packet's storage. | ||
| 670 | */ | ||
| 671 | static __inline netio_pkt_handle_t | ||
| 672 | NETIO_PKT_HANDLE(netio_pkt_t* pkt) | ||
| 673 | { | ||
| 674 | netio_pkt_handle_t h; | ||
| 675 | h.word = pkt->__packet.word; | ||
| 676 | return h; | ||
| 677 | } | ||
| 678 | |||
| 679 | |||
| 680 | /** A special reserved value indicating the absence of a packet handle. | ||
| 681 | * | ||
| 682 | * @ingroup pktfuncs | ||
| 683 | */ | ||
| 684 | #define NETIO_PKT_HANDLE_NONE ((netio_pkt_handle_t) { 0 }) | ||
| 685 | |||
| 686 | |||
| 687 | /** Test whether a packet handle is valid. | ||
| 688 | * | ||
| 689 | * Applications may wish to use the reserved value NETIO_PKT_HANDLE_NONE | ||
| 690 | * to indicate no packet at all. This function tests to see if a packet | ||
| 691 | * handle is a real handle, not this special reserved value. | ||
| 692 | * | ||
| 693 | * @ingroup pktfuncs | ||
| 694 | * | ||
| 695 | * @param[in] handle Handle on which to operate. | ||
| 696 | * @return One if the packet handle is valid, else zero. | ||
| 697 | */ | ||
| 698 | static __inline unsigned int | ||
| 699 | NETIO_PKT_HANDLE_IS_VALID(netio_pkt_handle_t handle) | ||
| 700 | { | ||
| 701 | return handle.word != 0; | ||
| 702 | } | ||
| 703 | |||
| 704 | |||
| 705 | |||
| 706 | /** Return a pointer to the start of the packet's custom header. | ||
| 707 | * A custom header may or may not be present, depending upon the IPP; its | ||
| 708 | * contents and alignment are also IPP-dependent. Currently, none of the | ||
| 709 | * standard IPPs supplied by Tilera produce a custom header. If present, | ||
| 710 | * the custom header precedes the L2 header in the packet buffer. | ||
| 711 | * @ingroup ingress | ||
| 712 | * | ||
| 713 | * @param[in] handle Handle on which to operate. | ||
| 714 | * @return A pointer to start of the packet. | ||
| 715 | */ | ||
| 716 | static __inline unsigned char* | ||
| 717 | NETIO_PKT_CUSTOM_DATA_H(netio_pkt_handle_t handle) | ||
| 718 | { | ||
| 719 | return _NETIO_PKT_HANDLE_BASE(handle) + NETIO_PACKET_PADDING; | ||
| 720 | } | ||
| 721 | |||
| 722 | |||
| 723 | /** Return the length of the packet's custom header. | ||
| 724 | * A custom header may or may not be present, depending upon the IPP; its | ||
| 725 | * contents and alignment are also IPP-dependent. Currently, none of the | ||
| 726 | * standard IPPs supplied by Tilera produce a custom header. If present, | ||
| 727 | * the custom header precedes the L2 header in the packet buffer. | ||
| 728 | * | ||
| 729 | * @ingroup ingress | ||
| 730 | * | ||
| 731 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 732 | * @param[in] pkt Packet on which to operate. | ||
| 733 | * @return The length of the packet's custom header, in bytes. | ||
| 734 | */ | ||
| 735 | static __inline netio_size_t | ||
| 736 | NETIO_PKT_CUSTOM_HEADER_LENGTH_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 737 | { | ||
| 738 | /* | ||
| 739 | * Note that we effectively need to extract a quantity from the flags word | ||
| 740 | * which is measured in words, and then turn it into bytes by shifting | ||
| 741 | * it left by 2. We do this all at once by just shifting right two less | ||
| 742 | * bits, and shifting the mask up two bits. | ||
| 743 | */ | ||
| 744 | return ((mda->__flags >> (_NETIO_PKT_CUSTOM_LEN_SHIFT - 2)) & | ||
| 745 | (_NETIO_PKT_CUSTOM_LEN_RMASK << 2)); | ||
| 746 | } | ||
| 747 | |||
| 748 | |||
| 749 | /** Return the length of the packet, starting with the custom header. | ||
| 750 | * A custom header may or may not be present, depending upon the IPP; its | ||
| 751 | * contents and alignment are also IPP-dependent. Currently, none of the | ||
| 752 | * standard IPPs supplied by Tilera produce a custom header. If present, | ||
| 753 | * the custom header precedes the L2 header in the packet buffer. | ||
| 754 | * @ingroup ingress | ||
| 755 | * | ||
| 756 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 757 | * @param[in] pkt Packet on which to operate. | ||
| 758 | * @return The length of the packet, in bytes. | ||
| 759 | */ | ||
| 760 | static __inline netio_size_t | ||
| 761 | NETIO_PKT_CUSTOM_LENGTH_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 762 | { | ||
| 763 | return (__NETIO_PKT_NOTIF_HEADER(pkt).bits.__transfer_size - | ||
| 764 | NETIO_PACKET_PADDING); | ||
| 765 | } | ||
| 766 | |||
| 767 | |||
| 768 | /** Return a pointer to the start of the packet's custom header. | ||
| 769 | * A custom header may or may not be present, depending upon the IPP; its | ||
| 770 | * contents and alignment are also IPP-dependent. Currently, none of the | ||
| 771 | * standard IPPs supplied by Tilera produce a custom header. If present, | ||
| 772 | * the custom header precedes the L2 header in the packet buffer. | ||
| 773 | * @ingroup ingress | ||
| 774 | * | ||
| 775 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 776 | * @param[in] pkt Packet on which to operate. | ||
| 777 | * @return A pointer to start of the packet. | ||
| 778 | */ | ||
| 779 | static __inline unsigned char* | ||
| 780 | NETIO_PKT_CUSTOM_DATA_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 781 | { | ||
| 782 | return NETIO_PKT_CUSTOM_DATA_H(NETIO_PKT_HANDLE(pkt)); | ||
| 783 | } | ||
| 784 | |||
| 785 | |||
| 786 | /** Return the length of the packet's L2 (Ethernet plus VLAN or SNAP) header. | ||
| 787 | * @ingroup ingress | ||
| 788 | * | ||
| 789 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 790 | * @param[in] pkt Packet on which to operate. | ||
| 791 | * @return The length of the packet's L2 header, in bytes. | ||
| 792 | */ | ||
| 793 | static __inline netio_size_t | ||
| 794 | NETIO_PKT_L2_HEADER_LENGTH_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 795 | { | ||
| 796 | /* | ||
| 797 | * Note that we effectively need to extract a quantity from the flags word | ||
| 798 | * which is measured in words, and then turn it into bytes by shifting | ||
| 799 | * it left by 2. We do this all at once by just shifting right two less | ||
| 800 | * bits, and shifting the mask up two bits. We then add two bytes. | ||
| 801 | */ | ||
| 802 | return ((mda->__flags >> (_NETIO_PKT_L2_LEN_SHIFT - 2)) & | ||
| 803 | (_NETIO_PKT_L2_LEN_RMASK << 2)) + 2; | ||
| 804 | } | ||
| 805 | |||
| 806 | |||
| 807 | /** Return the length of the packet, starting with the L2 (Ethernet) header. | ||
| 808 | * @ingroup ingress | ||
| 809 | * | ||
| 810 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 811 | * @param[in] pkt Packet on which to operate. | ||
| 812 | * @return The length of the packet, in bytes. | ||
| 813 | */ | ||
| 814 | static __inline netio_size_t | ||
| 815 | NETIO_PKT_L2_LENGTH_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 816 | { | ||
| 817 | return (NETIO_PKT_CUSTOM_LENGTH_M(mda, pkt) - | ||
| 818 | NETIO_PKT_CUSTOM_HEADER_LENGTH_M(mda,pkt)); | ||
| 819 | } | ||
| 820 | |||
| 821 | |||
| 822 | /** Return a pointer to the start of the packet's L2 (Ethernet) header. | ||
| 823 | * @ingroup ingress | ||
| 824 | * | ||
| 825 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 826 | * @param[in] pkt Packet on which to operate. | ||
| 827 | * @return A pointer to start of the packet. | ||
| 828 | */ | ||
| 829 | static __inline unsigned char* | ||
| 830 | NETIO_PKT_L2_DATA_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 831 | { | ||
| 832 | return (NETIO_PKT_CUSTOM_DATA_M(mda, pkt) + | ||
| 833 | NETIO_PKT_CUSTOM_HEADER_LENGTH_M(mda, pkt)); | ||
| 834 | } | ||
| 835 | |||
| 836 | |||
| 837 | /** Retrieve the length of the packet, starting with the L3 (generally, | ||
| 838 | * the IP) header. | ||
| 839 | * @ingroup ingress | ||
| 840 | * | ||
| 841 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 842 | * @param[in] pkt Packet on which to operate. | ||
| 843 | * @return Length of the packet's L3 header and data, in bytes. | ||
| 844 | */ | ||
| 845 | static __inline netio_size_t | ||
| 846 | NETIO_PKT_L3_LENGTH_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 847 | { | ||
| 848 | return (NETIO_PKT_L2_LENGTH_M(mda, pkt) - | ||
| 849 | NETIO_PKT_L2_HEADER_LENGTH_M(mda,pkt)); | ||
| 850 | } | ||
| 851 | |||
| 852 | |||
| 853 | /** Return a pointer to the packet's L3 (generally, the IP) header. | ||
| 854 | * @ingroup ingress | ||
| 855 | * | ||
| 856 | * Note that we guarantee word alignment of the L3 header. | ||
| 857 | * | ||
| 858 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 859 | * @param[in] pkt Packet on which to operate. | ||
| 860 | * @return A pointer to the packet's L3 header. | ||
| 861 | */ | ||
| 862 | static __inline unsigned char* | ||
| 863 | NETIO_PKT_L3_DATA_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 864 | { | ||
| 865 | return (NETIO_PKT_L2_DATA_M(mda, pkt) + | ||
| 866 | NETIO_PKT_L2_HEADER_LENGTH_M(mda, pkt)); | ||
| 867 | } | ||
| 868 | |||
| 869 | |||
| 870 | /** Return the ordinal of the packet. | ||
| 871 | * @ingroup ingress | ||
| 872 | * | ||
| 873 | * Each packet is given an ordinal number when it is delivered by the IPP. | ||
| 874 | * In the medium term, the ordinal is unique and monotonically increasing, | ||
| 875 | * being incremented by 1 for each packet; the ordinal of the first packet | ||
| 876 | * delivered after the IPP starts is zero. (Since the ordinal is of finite | ||
| 877 | * size, given enough input packets, it will eventually wrap around to zero; | ||
| 878 | * in the long term, therefore, ordinals are not unique.) The ordinals | ||
| 879 | * handed out by different IPPs are not disjoint, so two packets from | ||
| 880 | * different IPPs may have identical ordinals. Packets dropped by the | ||
| 881 | * IPP or by the I/O shim are not assigned ordinals. | ||
| 882 | * | ||
| 883 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 884 | * @param[in] pkt Packet on which to operate. | ||
| 885 | * @return The packet's per-IPP packet ordinal. | ||
| 886 | */ | ||
| 887 | static __inline unsigned int | ||
| 888 | NETIO_PKT_ORDINAL_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 889 | { | ||
| 890 | return mda->__packet_ordinal; | ||
| 891 | } | ||
| 892 | |||
| 893 | |||
| 894 | /** Return the per-group ordinal of the packet. | ||
| 895 | * @ingroup ingress | ||
| 896 | * | ||
| 897 | * Each packet is given a per-group ordinal number when it is | ||
| 898 | * delivered by the IPP. By default, the group is the packet's VLAN, | ||
| 899 | * although IPP can be recompiled to use different values. In | ||
| 900 | * the medium term, the ordinal is unique and monotonically | ||
| 901 | * increasing, being incremented by 1 for each packet; the ordinal of | ||
| 902 | * the first packet distributed to a particular group is zero. | ||
| 903 | * (Since the ordinal is of finite size, given enough input packets, | ||
| 904 | * it will eventually wrap around to zero; in the long term, | ||
| 905 | * therefore, ordinals are not unique.) The ordinals handed out by | ||
| 906 | * different IPPs are not disjoint, so two packets from different IPPs | ||
| 907 | * may have identical ordinals; similarly, packets distributed to | ||
| 908 | * different groups may have identical ordinals. Packets dropped by | ||
| 909 | * the IPP or by the I/O shim are not assigned ordinals. | ||
| 910 | * | ||
| 911 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 912 | * @param[in] pkt Packet on which to operate. | ||
| 913 | * @return The packet's per-IPP, per-group ordinal. | ||
| 914 | */ | ||
| 915 | static __inline unsigned int | ||
| 916 | NETIO_PKT_GROUP_ORDINAL_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 917 | { | ||
| 918 | return mda->__group_ordinal; | ||
| 919 | } | ||
| 920 | |||
| 921 | |||
| 922 | /** Return the VLAN ID assigned to the packet. | ||
| 923 | * @ingroup ingress | ||
| 924 | * | ||
| 925 | * This value is usually contained within the packet header. | ||
| 926 | * | ||
| 927 | * This value will be zero if the packet does not have a VLAN tag, or if | ||
| 928 | * this value was not extracted from the packet. | ||
| 929 | * | ||
| 930 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 931 | * @param[in] pkt Packet on which to operate. | ||
| 932 | * @return The packet's VLAN ID. | ||
| 933 | */ | ||
| 934 | static __inline unsigned short | ||
| 935 | NETIO_PKT_VLAN_ID_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 936 | { | ||
| 937 | int vl = (mda->__flags >> _NETIO_PKT_VLAN_SHIFT) & _NETIO_PKT_VLAN_RMASK; | ||
| 938 | unsigned short* pkt_p; | ||
| 939 | int index; | ||
| 940 | unsigned short val; | ||
| 941 | |||
| 942 | if (vl == _NETIO_PKT_VLAN_NONE) | ||
| 943 | return 0; | ||
| 944 | |||
| 945 | pkt_p = (unsigned short*) NETIO_PKT_L2_DATA_M(mda, pkt); | ||
| 946 | index = (mda->__flags >> _NETIO_PKT_TYPE_SHIFT) & _NETIO_PKT_TYPE_RMASK; | ||
| 947 | |||
| 948 | val = pkt_p[(_netio_pkt_info[index] >> _NETIO_PKT_INFO_VLAN_SHIFT) & | ||
| 949 | _NETIO_PKT_INFO_VLAN_RMASK]; | ||
| 950 | |||
| 951 | #ifdef __TILECC__ | ||
| 952 | return (__insn_bytex(val) >> 16) & 0xFFF; | ||
| 953 | #else | ||
| 954 | return (__builtin_bswap32(val) >> 16) & 0xFFF; | ||
| 955 | #endif | ||
| 956 | } | ||
| 957 | |||
| 958 | |||
| 959 | /** Return the ethertype of the packet. | ||
| 960 | * @ingroup ingress | ||
| 961 | * | ||
| 962 | * This value is usually contained within the packet header. | ||
| 963 | * | ||
| 964 | * This value is reliable if @ref NETIO_PKT_ETHERTYPE_RECOGNIZED_M() | ||
| 965 | * returns true, and otherwise, may not be well defined. | ||
| 966 | * | ||
| 967 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 968 | * @param[in] pkt Packet on which to operate. | ||
| 969 | * @return The packet's ethertype. | ||
| 970 | */ | ||
| 971 | static __inline unsigned short | ||
| 972 | NETIO_PKT_ETHERTYPE_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 973 | { | ||
| 974 | unsigned short* pkt_p = (unsigned short*) NETIO_PKT_L2_DATA_M(mda, pkt); | ||
| 975 | int index = (mda->__flags >> _NETIO_PKT_TYPE_SHIFT) & _NETIO_PKT_TYPE_RMASK; | ||
| 976 | |||
| 977 | unsigned short val = | ||
| 978 | pkt_p[(_netio_pkt_info[index] >> _NETIO_PKT_INFO_ETYPE_SHIFT) & | ||
| 979 | _NETIO_PKT_INFO_ETYPE_RMASK]; | ||
| 980 | |||
| 981 | return __builtin_bswap32(val) >> 16; | ||
| 982 | } | ||
| 983 | |||
| 984 | |||
| 985 | /** Return the flow hash computed on the packet. | ||
| 986 | * @ingroup ingress | ||
| 987 | * | ||
| 988 | * For TCP and UDP packets, this hash is calculated by hashing together | ||
| 989 | * the "5-tuple" values, specifically the source IP address, destination | ||
| 990 | * IP address, protocol type, source port and destination port. | ||
| 991 | * The hash value is intended to be helpful for millions of distinct | ||
| 992 | * flows. | ||
| 993 | * | ||
| 994 | * For IPv4 or IPv6 packets which are neither TCP nor UDP, the flow hash is | ||
| 995 | * derived by hashing together the source and destination IP addresses. | ||
| 996 | * | ||
| 997 | * For MPLS-encapsulated packets, the flow hash is derived by hashing | ||
| 998 | * the first MPLS label. | ||
| 999 | * | ||
| 1000 | * For all other packets the flow hash is computed from the source | ||
| 1001 | * and destination Ethernet addresses. | ||
| 1002 | * | ||
| 1003 | * The hash is symmetric, meaning it produces the same value if the | ||
| 1004 | * source and destination are swapped. The only exceptions are | ||
| 1005 | * tunneling protocols 0x04 (IP in IP Encapsulation), 0x29 (Simple | ||
| 1006 | * Internet Protocol), 0x2F (General Routing Encapsulation) and 0x32 | ||
| 1007 | * (Encap Security Payload), which use only the destination address | ||
| 1008 | * since the source address is not meaningful. | ||
| 1009 | * | ||
| 1010 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1011 | * @param[in] pkt Packet on which to operate. | ||
| 1012 | * @return The packet's 32-bit flow hash. | ||
| 1013 | */ | ||
| 1014 | static __inline unsigned int | ||
| 1015 | NETIO_PKT_FLOW_HASH_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1016 | { | ||
| 1017 | return mda->__flow_hash; | ||
| 1018 | } | ||
| 1019 | |||
| 1020 | |||
| 1021 | /** Return the first word of "user data" for the packet. | ||
| 1022 | * | ||
| 1023 | * The contents of the user data words depend on the IPP. | ||
| 1024 | * | ||
| 1025 | * When using the standard ipp1, ipp2, or ipp4 sub-drivers, the first | ||
| 1026 | * word of user data contains the least significant bits of the 64-bit | ||
| 1027 | * arrival cycle count (see @c get_cycle_count_low()). | ||
| 1028 | * | ||
| 1029 | * See the <em>System Programmer's Guide</em> for details. | ||
| 1030 | * | ||
| 1031 | * @ingroup ingress | ||
| 1032 | * | ||
| 1033 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1034 | * @param[in] pkt Packet on which to operate. | ||
| 1035 | * @return The packet's first word of "user data". | ||
| 1036 | */ | ||
| 1037 | static __inline unsigned int | ||
| 1038 | NETIO_PKT_USER_DATA_0_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1039 | { | ||
| 1040 | return mda->__user_data_0; | ||
| 1041 | } | ||
| 1042 | |||
| 1043 | |||
| 1044 | /** Return the second word of "user data" for the packet. | ||
| 1045 | * | ||
| 1046 | * The contents of the user data words depend on the IPP. | ||
| 1047 | * | ||
| 1048 | * When using the standard ipp1, ipp2, or ipp4 sub-drivers, the second | ||
| 1049 | * word of user data contains the most significant bits of the 64-bit | ||
| 1050 | * arrival cycle count (see @c get_cycle_count_high()). | ||
| 1051 | * | ||
| 1052 | * See the <em>System Programmer's Guide</em> for details. | ||
| 1053 | * | ||
| 1054 | * @ingroup ingress | ||
| 1055 | * | ||
| 1056 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1057 | * @param[in] pkt Packet on which to operate. | ||
| 1058 | * @return The packet's second word of "user data". | ||
| 1059 | */ | ||
| 1060 | static __inline unsigned int | ||
| 1061 | NETIO_PKT_USER_DATA_1_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1062 | { | ||
| 1063 | return mda->__user_data_1; | ||
| 1064 | } | ||
| 1065 | |||
| 1066 | |||
| 1067 | /** Determine whether the L4 (TCP/UDP) checksum was calculated. | ||
| 1068 | * @ingroup ingress | ||
| 1069 | * | ||
| 1070 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1071 | * @param[in] pkt Packet on which to operate. | ||
| 1072 | * @return Nonzero if the L4 checksum was calculated. | ||
| 1073 | */ | ||
| 1074 | static __inline unsigned int | ||
| 1075 | NETIO_PKT_L4_CSUM_CALCULATED_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1076 | { | ||
| 1077 | return !(mda->__flags & _NETIO_PKT_NO_L4_CSUM_MASK); | ||
| 1078 | } | ||
| 1079 | |||
| 1080 | |||
| 1081 | /** Determine whether the L4 (TCP/UDP) checksum was calculated and found to | ||
| 1082 | * be correct. | ||
| 1083 | * @ingroup ingress | ||
| 1084 | * | ||
| 1085 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1086 | * @param[in] pkt Packet on which to operate. | ||
| 1087 | * @return Nonzero if the checksum was calculated and is correct. | ||
| 1088 | */ | ||
| 1089 | static __inline unsigned int | ||
| 1090 | NETIO_PKT_L4_CSUM_CORRECT_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1091 | { | ||
| 1092 | return !(mda->__flags & | ||
| 1093 | (_NETIO_PKT_BAD_L4_CSUM_MASK | _NETIO_PKT_NO_L4_CSUM_MASK)); | ||
| 1094 | } | ||
| 1095 | |||
| 1096 | |||
| 1097 | /** Determine whether the L3 (IP) checksum was calculated. | ||
| 1098 | * @ingroup ingress | ||
| 1099 | * | ||
| 1100 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1101 | * @param[in] pkt Packet on which to operate. | ||
| 1102 | * @return Nonzero if the L3 (IP) checksum was calculated. | ||
| 1103 | */ | ||
| 1104 | static __inline unsigned int | ||
| 1105 | NETIO_PKT_L3_CSUM_CALCULATED_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1106 | { | ||
| 1107 | return !(mda->__flags & _NETIO_PKT_NO_L3_CSUM_MASK); | ||
| 1108 | } | ||
| 1109 | |||
| 1110 | |||
| 1111 | /** Determine whether the L3 (IP) checksum was calculated and found to be | ||
| 1112 | * correct. | ||
| 1113 | * @ingroup ingress | ||
| 1114 | * | ||
| 1115 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1116 | * @param[in] pkt Packet on which to operate. | ||
| 1117 | * @return Nonzero if the checksum was calculated and is correct. | ||
| 1118 | */ | ||
| 1119 | static __inline unsigned int | ||
| 1120 | NETIO_PKT_L3_CSUM_CORRECT_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1121 | { | ||
| 1122 | return !(mda->__flags & | ||
| 1123 | (_NETIO_PKT_BAD_L3_CSUM_MASK | _NETIO_PKT_NO_L3_CSUM_MASK)); | ||
| 1124 | } | ||
| 1125 | |||
| 1126 | |||
| 1127 | /** Determine whether the ethertype was recognized and L3 packet data was | ||
| 1128 | * processed. | ||
| 1129 | * @ingroup ingress | ||
| 1130 | * | ||
| 1131 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1132 | * @param[in] pkt Packet on which to operate. | ||
| 1133 | * @return Nonzero if the ethertype was recognized and L3 packet data was | ||
| 1134 | * processed. | ||
| 1135 | */ | ||
| 1136 | static __inline unsigned int | ||
| 1137 | NETIO_PKT_ETHERTYPE_RECOGNIZED_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1138 | { | ||
| 1139 | return !(mda->__flags & _NETIO_PKT_TYPE_UNRECOGNIZED_MASK); | ||
| 1140 | } | ||
| 1141 | |||
| 1142 | |||
| 1143 | /** Retrieve the status of a packet and any errors that may have occurred | ||
| 1144 | * during ingress processing (length mismatches, CRC errors, etc.). | ||
| 1145 | * @ingroup ingress | ||
| 1146 | * | ||
| 1147 | * Note that packets for which @ref NETIO_PKT_ETHERTYPE_RECOGNIZED() | ||
| 1148 | * returns zero are always reported as underlength, as there is no a priori | ||
| 1149 | * means to determine their length. Normally, applications should use | ||
| 1150 | * @ref NETIO_PKT_BAD_M() instead of explicitly checking status with this | ||
| 1151 | * function. | ||
| 1152 | * | ||
| 1153 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1154 | * @param[in] pkt Packet on which to operate. | ||
| 1155 | * @return The packet's status. | ||
| 1156 | */ | ||
| 1157 | static __inline netio_pkt_status_t | ||
| 1158 | NETIO_PKT_STATUS_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1159 | { | ||
| 1160 | return (netio_pkt_status_t) __NETIO_PKT_NOTIF_HEADER(pkt).bits.__status; | ||
| 1161 | } | ||
| 1162 | |||
| 1163 | |||
| 1164 | /** Report whether a packet is bad (i.e., was shorter than expected based on | ||
| 1165 | * its headers, or had a bad CRC). | ||
| 1166 | * @ingroup ingress | ||
| 1167 | * | ||
| 1168 | * Note that this function does not verify L3 or L4 checksums. | ||
| 1169 | * | ||
| 1170 | * @param[in] mda Pointer to packet's standard metadata. | ||
| 1171 | * @param[in] pkt Packet on which to operate. | ||
| 1172 | * @return Nonzero if the packet is bad and should be discarded. | ||
| 1173 | */ | ||
| 1174 | static __inline unsigned int | ||
| 1175 | NETIO_PKT_BAD_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1176 | { | ||
| 1177 | return ((NETIO_PKT_STATUS_M(mda, pkt) & 1) && | ||
| 1178 | (NETIO_PKT_ETHERTYPE_RECOGNIZED_M(mda, pkt) || | ||
| 1179 | NETIO_PKT_STATUS_M(mda, pkt) == NETIO_PKT_STATUS_BAD)); | ||
| 1180 | } | ||
| 1181 | |||
| 1182 | |||
| 1183 | /** Return the length of the packet, starting with the L2 (Ethernet) header. | ||
| 1184 | * @ingroup egress | ||
| 1185 | * | ||
| 1186 | * @param[in] mmd Pointer to packet's minimal metadata. | ||
| 1187 | * @param[in] pkt Packet on which to operate. | ||
| 1188 | * @return The length of the packet, in bytes. | ||
| 1189 | */ | ||
| 1190 | static __inline netio_size_t | ||
| 1191 | NETIO_PKT_L2_LENGTH_MM(netio_pkt_minimal_metadata_t* mmd, netio_pkt_t* pkt) | ||
| 1192 | { | ||
| 1193 | return mmd->l2_length; | ||
| 1194 | } | ||
| 1195 | |||
| 1196 | |||
| 1197 | /** Return the length of the L2 (Ethernet) header. | ||
| 1198 | * @ingroup egress | ||
| 1199 | * | ||
| 1200 | * @param[in] mmd Pointer to packet's minimal metadata. | ||
| 1201 | * @param[in] pkt Packet on which to operate. | ||
| 1202 | * @return The length of the packet's L2 header, in bytes. | ||
| 1203 | */ | ||
| 1204 | static __inline netio_size_t | ||
| 1205 | NETIO_PKT_L2_HEADER_LENGTH_MM(netio_pkt_minimal_metadata_t* mmd, | ||
| 1206 | netio_pkt_t* pkt) | ||
| 1207 | { | ||
| 1208 | return mmd->l3_offset - mmd->l2_offset; | ||
| 1209 | } | ||
| 1210 | |||
| 1211 | |||
| 1212 | /** Return the length of the packet, starting with the L3 (IP) header. | ||
| 1213 | * @ingroup egress | ||
| 1214 | * | ||
| 1215 | * @param[in] mmd Pointer to packet's minimal metadata. | ||
| 1216 | * @param[in] pkt Packet on which to operate. | ||
| 1217 | * @return Length of the packet's L3 header and data, in bytes. | ||
| 1218 | */ | ||
| 1219 | static __inline netio_size_t | ||
| 1220 | NETIO_PKT_L3_LENGTH_MM(netio_pkt_minimal_metadata_t* mmd, netio_pkt_t* pkt) | ||
| 1221 | { | ||
| 1222 | return (NETIO_PKT_L2_LENGTH_MM(mmd, pkt) - | ||
| 1223 | NETIO_PKT_L2_HEADER_LENGTH_MM(mmd, pkt)); | ||
| 1224 | } | ||
| 1225 | |||
| 1226 | |||
| 1227 | /** Return a pointer to the packet's L3 (generally, the IP) header. | ||
| 1228 | * @ingroup egress | ||
| 1229 | * | ||
| 1230 | * Note that we guarantee word alignment of the L3 header. | ||
| 1231 | * | ||
| 1232 | * @param[in] mmd Pointer to packet's minimal metadata. | ||
| 1233 | * @param[in] pkt Packet on which to operate. | ||
| 1234 | * @return A pointer to the packet's L3 header. | ||
| 1235 | */ | ||
| 1236 | static __inline unsigned char* | ||
| 1237 | NETIO_PKT_L3_DATA_MM(netio_pkt_minimal_metadata_t* mmd, netio_pkt_t* pkt) | ||
| 1238 | { | ||
| 1239 | return _NETIO_PKT_BASE(pkt) + mmd->l3_offset; | ||
| 1240 | } | ||
| 1241 | |||
| 1242 | |||
| 1243 | /** Return a pointer to the packet's L2 (Ethernet) header. | ||
| 1244 | * @ingroup egress | ||
| 1245 | * | ||
| 1246 | * @param[in] mmd Pointer to packet's minimal metadata. | ||
| 1247 | * @param[in] pkt Packet on which to operate. | ||
| 1248 | * @return A pointer to start of the packet. | ||
| 1249 | */ | ||
| 1250 | static __inline unsigned char* | ||
| 1251 | NETIO_PKT_L2_DATA_MM(netio_pkt_minimal_metadata_t* mmd, netio_pkt_t* pkt) | ||
| 1252 | { | ||
| 1253 | return _NETIO_PKT_BASE(pkt) + mmd->l2_offset; | ||
| 1254 | } | ||
| 1255 | |||
| 1256 | |||
| 1257 | /** Retrieve the status of a packet and any errors that may have occurred | ||
| 1258 | * during ingress processing (length mismatches, CRC errors, etc.). | ||
| 1259 | * @ingroup ingress | ||
| 1260 | * | ||
| 1261 | * Note that packets for which @ref NETIO_PKT_ETHERTYPE_RECOGNIZED() | ||
| 1262 | * returns zero are always reported as underlength, as there is no a priori | ||
| 1263 | * means to determine their length. Normally, applications should use | ||
| 1264 | * @ref NETIO_PKT_BAD() instead of explicitly checking status with this | ||
| 1265 | * function. | ||
| 1266 | * | ||
| 1267 | * @param[in] pkt Packet on which to operate. | ||
| 1268 | * @return The packet's status. | ||
| 1269 | */ | ||
| 1270 | static __inline netio_pkt_status_t | ||
| 1271 | NETIO_PKT_STATUS(netio_pkt_t* pkt) | ||
| 1272 | { | ||
| 1273 | netio_assert(!pkt->__packet.bits.__minimal); | ||
| 1274 | |||
| 1275 | return (netio_pkt_status_t) __NETIO_PKT_NOTIF_HEADER(pkt).bits.__status; | ||
| 1276 | } | ||
| 1277 | |||
| 1278 | |||
| 1279 | /** Report whether a packet is bad (i.e., was shorter than expected based on | ||
| 1280 | * its headers, or had a bad CRC). | ||
| 1281 | * @ingroup ingress | ||
| 1282 | * | ||
| 1283 | * Note that this function does not verify L3 or L4 checksums. | ||
| 1284 | * | ||
| 1285 | * @param[in] pkt Packet on which to operate. | ||
| 1286 | * @return Nonzero if the packet is bad and should be discarded. | ||
| 1287 | */ | ||
| 1288 | static __inline unsigned int | ||
| 1289 | NETIO_PKT_BAD(netio_pkt_t* pkt) | ||
| 1290 | { | ||
| 1291 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1292 | |||
| 1293 | return NETIO_PKT_BAD_M(mda, pkt); | ||
| 1294 | } | ||
| 1295 | |||
| 1296 | |||
| 1297 | /** Return the length of the packet's custom header. | ||
| 1298 | * A custom header may or may not be present, depending upon the IPP; its | ||
| 1299 | * contents and alignment are also IPP-dependent. Currently, none of the | ||
| 1300 | * standard IPPs supplied by Tilera produce a custom header. If present, | ||
| 1301 | * the custom header precedes the L2 header in the packet buffer. | ||
| 1302 | * @ingroup pktfuncs | ||
| 1303 | * | ||
| 1304 | * @param[in] pkt Packet on which to operate. | ||
| 1305 | * @return The length of the packet's custom header, in bytes. | ||
| 1306 | */ | ||
| 1307 | static __inline netio_size_t | ||
| 1308 | NETIO_PKT_CUSTOM_HEADER_LENGTH(netio_pkt_t* pkt) | ||
| 1309 | { | ||
| 1310 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1311 | |||
| 1312 | return NETIO_PKT_CUSTOM_HEADER_LENGTH_M(mda, pkt); | ||
| 1313 | } | ||
| 1314 | |||
| 1315 | |||
| 1316 | /** Return the length of the packet, starting with the custom header. | ||
| 1317 | * A custom header may or may not be present, depending upon the IPP; its | ||
| 1318 | * contents and alignment are also IPP-dependent. Currently, none of the | ||
| 1319 | * standard IPPs supplied by Tilera produce a custom header. If present, | ||
| 1320 | * the custom header precedes the L2 header in the packet buffer. | ||
| 1321 | * @ingroup pktfuncs | ||
| 1322 | * | ||
| 1323 | * @param[in] pkt Packet on which to operate. | ||
| 1324 | * @return The length of the packet, in bytes. | ||
| 1325 | */ | ||
| 1326 | static __inline netio_size_t | ||
| 1327 | NETIO_PKT_CUSTOM_LENGTH(netio_pkt_t* pkt) | ||
| 1328 | { | ||
| 1329 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1330 | |||
| 1331 | return NETIO_PKT_CUSTOM_LENGTH_M(mda, pkt); | ||
| 1332 | } | ||
| 1333 | |||
| 1334 | |||
| 1335 | /** Return a pointer to the packet's custom header. | ||
| 1336 | * A custom header may or may not be present, depending upon the IPP; its | ||
| 1337 | * contents and alignment are also IPP-dependent. Currently, none of the | ||
| 1338 | * standard IPPs supplied by Tilera produce a custom header. If present, | ||
| 1339 | * the custom header precedes the L2 header in the packet buffer. | ||
| 1340 | * @ingroup pktfuncs | ||
| 1341 | * | ||
| 1342 | * @param[in] pkt Packet on which to operate. | ||
| 1343 | * @return A pointer to start of the packet. | ||
| 1344 | */ | ||
| 1345 | static __inline unsigned char* | ||
| 1346 | NETIO_PKT_CUSTOM_DATA(netio_pkt_t* pkt) | ||
| 1347 | { | ||
| 1348 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1349 | |||
| 1350 | return NETIO_PKT_CUSTOM_DATA_M(mda, pkt); | ||
| 1351 | } | ||
| 1352 | |||
| 1353 | |||
| 1354 | /** Return the length of the packet's L2 (Ethernet plus VLAN or SNAP) header. | ||
| 1355 | * @ingroup pktfuncs | ||
| 1356 | * | ||
| 1357 | * @param[in] pkt Packet on which to operate. | ||
| 1358 | * @return The length of the packet's L2 header, in bytes. | ||
| 1359 | */ | ||
| 1360 | static __inline netio_size_t | ||
| 1361 | NETIO_PKT_L2_HEADER_LENGTH(netio_pkt_t* pkt) | ||
| 1362 | { | ||
| 1363 | if (NETIO_PKT_IS_MINIMAL(pkt)) | ||
| 1364 | { | ||
| 1365 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1366 | |||
| 1367 | return NETIO_PKT_L2_HEADER_LENGTH_MM(mmd, pkt); | ||
| 1368 | } | ||
| 1369 | else | ||
| 1370 | { | ||
| 1371 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1372 | |||
| 1373 | return NETIO_PKT_L2_HEADER_LENGTH_M(mda, pkt); | ||
| 1374 | } | ||
| 1375 | } | ||
| 1376 | |||
| 1377 | |||
| 1378 | /** Return the length of the packet, starting with the L2 (Ethernet) header. | ||
| 1379 | * @ingroup pktfuncs | ||
| 1380 | * | ||
| 1381 | * @param[in] pkt Packet on which to operate. | ||
| 1382 | * @return The length of the packet, in bytes. | ||
| 1383 | */ | ||
| 1384 | static __inline netio_size_t | ||
| 1385 | NETIO_PKT_L2_LENGTH(netio_pkt_t* pkt) | ||
| 1386 | { | ||
| 1387 | if (NETIO_PKT_IS_MINIMAL(pkt)) | ||
| 1388 | { | ||
| 1389 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1390 | |||
| 1391 | return NETIO_PKT_L2_LENGTH_MM(mmd, pkt); | ||
| 1392 | } | ||
| 1393 | else | ||
| 1394 | { | ||
| 1395 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1396 | |||
| 1397 | return NETIO_PKT_L2_LENGTH_M(mda, pkt); | ||
| 1398 | } | ||
| 1399 | } | ||
| 1400 | |||
| 1401 | |||
| 1402 | /** Return a pointer to the packet's L2 (Ethernet) header. | ||
| 1403 | * @ingroup pktfuncs | ||
| 1404 | * | ||
| 1405 | * @param[in] pkt Packet on which to operate. | ||
| 1406 | * @return A pointer to start of the packet. | ||
| 1407 | */ | ||
| 1408 | static __inline unsigned char* | ||
| 1409 | NETIO_PKT_L2_DATA(netio_pkt_t* pkt) | ||
| 1410 | { | ||
| 1411 | if (NETIO_PKT_IS_MINIMAL(pkt)) | ||
| 1412 | { | ||
| 1413 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1414 | |||
| 1415 | return NETIO_PKT_L2_DATA_MM(mmd, pkt); | ||
| 1416 | } | ||
| 1417 | else | ||
| 1418 | { | ||
| 1419 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1420 | |||
| 1421 | return NETIO_PKT_L2_DATA_M(mda, pkt); | ||
| 1422 | } | ||
| 1423 | } | ||
| 1424 | |||
| 1425 | |||
| 1426 | /** Retrieve the length of the packet, starting with the L3 (generally, the IP) | ||
| 1427 | * header. | ||
| 1428 | * @ingroup pktfuncs | ||
| 1429 | * | ||
| 1430 | * @param[in] pkt Packet on which to operate. | ||
| 1431 | * @return Length of the packet's L3 header and data, in bytes. | ||
| 1432 | */ | ||
| 1433 | static __inline netio_size_t | ||
| 1434 | NETIO_PKT_L3_LENGTH(netio_pkt_t* pkt) | ||
| 1435 | { | ||
| 1436 | if (NETIO_PKT_IS_MINIMAL(pkt)) | ||
| 1437 | { | ||
| 1438 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1439 | |||
| 1440 | return NETIO_PKT_L3_LENGTH_MM(mmd, pkt); | ||
| 1441 | } | ||
| 1442 | else | ||
| 1443 | { | ||
| 1444 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1445 | |||
| 1446 | return NETIO_PKT_L3_LENGTH_M(mda, pkt); | ||
| 1447 | } | ||
| 1448 | } | ||
| 1449 | |||
| 1450 | |||
| 1451 | /** Return a pointer to the packet's L3 (generally, the IP) header. | ||
| 1452 | * @ingroup pktfuncs | ||
| 1453 | * | ||
| 1454 | * Note that we guarantee word alignment of the L3 header. | ||
| 1455 | * | ||
| 1456 | * @param[in] pkt Packet on which to operate. | ||
| 1457 | * @return A pointer to the packet's L3 header. | ||
| 1458 | */ | ||
| 1459 | static __inline unsigned char* | ||
| 1460 | NETIO_PKT_L3_DATA(netio_pkt_t* pkt) | ||
| 1461 | { | ||
| 1462 | if (NETIO_PKT_IS_MINIMAL(pkt)) | ||
| 1463 | { | ||
| 1464 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1465 | |||
| 1466 | return NETIO_PKT_L3_DATA_MM(mmd, pkt); | ||
| 1467 | } | ||
| 1468 | else | ||
| 1469 | { | ||
| 1470 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1471 | |||
| 1472 | return NETIO_PKT_L3_DATA_M(mda, pkt); | ||
| 1473 | } | ||
| 1474 | } | ||
| 1475 | |||
| 1476 | |||
| 1477 | /** Return the ordinal of the packet. | ||
| 1478 | * @ingroup ingress | ||
| 1479 | * | ||
| 1480 | * Each packet is given an ordinal number when it is delivered by the IPP. | ||
| 1481 | * In the medium term, the ordinal is unique and monotonically increasing, | ||
| 1482 | * being incremented by 1 for each packet; the ordinal of the first packet | ||
| 1483 | * delivered after the IPP starts is zero. (Since the ordinal is of finite | ||
| 1484 | * size, given enough input packets, it will eventually wrap around to zero; | ||
| 1485 | * in the long term, therefore, ordinals are not unique.) The ordinals | ||
| 1486 | * handed out by different IPPs are not disjoint, so two packets from | ||
| 1487 | * different IPPs may have identical ordinals. Packets dropped by the | ||
| 1488 | * IPP or by the I/O shim are not assigned ordinals. | ||
| 1489 | * | ||
| 1490 | * | ||
| 1491 | * @param[in] pkt Packet on which to operate. | ||
| 1492 | * @return The packet's per-IPP packet ordinal. | ||
| 1493 | */ | ||
| 1494 | static __inline unsigned int | ||
| 1495 | NETIO_PKT_ORDINAL(netio_pkt_t* pkt) | ||
| 1496 | { | ||
| 1497 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1498 | |||
| 1499 | return NETIO_PKT_ORDINAL_M(mda, pkt); | ||
| 1500 | } | ||
| 1501 | |||
| 1502 | |||
| 1503 | /** Return the per-group ordinal of the packet. | ||
| 1504 | * @ingroup ingress | ||
| 1505 | * | ||
| 1506 | * Each packet is given a per-group ordinal number when it is | ||
| 1507 | * delivered by the IPP. By default, the group is the packet's VLAN, | ||
| 1508 | * although IPP can be recompiled to use different values. In | ||
| 1509 | * the medium term, the ordinal is unique and monotonically | ||
| 1510 | * increasing, being incremented by 1 for each packet; the ordinal of | ||
| 1511 | * the first packet distributed to a particular group is zero. | ||
| 1512 | * (Since the ordinal is of finite size, given enough input packets, | ||
| 1513 | * it will eventually wrap around to zero; in the long term, | ||
| 1514 | * therefore, ordinals are not unique.) The ordinals handed out by | ||
| 1515 | * different IPPs are not disjoint, so two packets from different IPPs | ||
| 1516 | * may have identical ordinals; similarly, packets distributed to | ||
| 1517 | * different groups may have identical ordinals. Packets dropped by | ||
| 1518 | * the IPP or by the I/O shim are not assigned ordinals. | ||
| 1519 | * | ||
| 1520 | * @param[in] pkt Packet on which to operate. | ||
| 1521 | * @return The packet's per-IPP, per-group ordinal. | ||
| 1522 | */ | ||
| 1523 | static __inline unsigned int | ||
| 1524 | NETIO_PKT_GROUP_ORDINAL(netio_pkt_t* pkt) | ||
| 1525 | { | ||
| 1526 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1527 | |||
| 1528 | return NETIO_PKT_GROUP_ORDINAL_M(mda, pkt); | ||
| 1529 | } | ||
| 1530 | |||
| 1531 | |||
| 1532 | /** Return the VLAN ID assigned to the packet. | ||
| 1533 | * @ingroup ingress | ||
| 1534 | * | ||
| 1535 | * This is usually also contained within the packet header. If the packet | ||
| 1536 | * does not have a VLAN tag, the VLAN ID returned by this function is zero. | ||
| 1537 | * | ||
| 1538 | * @param[in] pkt Packet on which to operate. | ||
| 1539 | * @return The packet's VLAN ID. | ||
| 1540 | */ | ||
| 1541 | static __inline unsigned short | ||
| 1542 | NETIO_PKT_VLAN_ID(netio_pkt_t* pkt) | ||
| 1543 | { | ||
| 1544 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1545 | |||
| 1546 | return NETIO_PKT_VLAN_ID_M(mda, pkt); | ||
| 1547 | } | ||
| 1548 | |||
| 1549 | |||
| 1550 | /** Return the ethertype of the packet. | ||
| 1551 | * @ingroup ingress | ||
| 1552 | * | ||
| 1553 | * This value is reliable if @ref NETIO_PKT_ETHERTYPE_RECOGNIZED() | ||
| 1554 | * returns true, and otherwise, may not be well defined. | ||
| 1555 | * | ||
| 1556 | * @param[in] pkt Packet on which to operate. | ||
| 1557 | * @return The packet's ethertype. | ||
| 1558 | */ | ||
| 1559 | static __inline unsigned short | ||
| 1560 | NETIO_PKT_ETHERTYPE(netio_pkt_t* pkt) | ||
| 1561 | { | ||
| 1562 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1563 | |||
| 1564 | return NETIO_PKT_ETHERTYPE_M(mda, pkt); | ||
| 1565 | } | ||
| 1566 | |||
| 1567 | |||
| 1568 | /** Return the flow hash computed on the packet. | ||
| 1569 | * @ingroup ingress | ||
| 1570 | * | ||
| 1571 | * For TCP and UDP packets, this hash is calculated by hashing together | ||
| 1572 | * the "5-tuple" values, specifically the source IP address, destination | ||
| 1573 | * IP address, protocol type, source port and destination port. | ||
| 1574 | * The hash value is intended to be helpful for millions of distinct | ||
| 1575 | * flows. | ||
| 1576 | * | ||
| 1577 | * For IPv4 or IPv6 packets which are neither TCP nor UDP, the flow hash is | ||
| 1578 | * derived by hashing together the source and destination IP addresses. | ||
| 1579 | * | ||
| 1580 | * For MPLS-encapsulated packets, the flow hash is derived by hashing | ||
| 1581 | * the first MPLS label. | ||
| 1582 | * | ||
| 1583 | * For all other packets the flow hash is computed from the source | ||
| 1584 | * and destination Ethernet addresses. | ||
| 1585 | * | ||
| 1586 | * The hash is symmetric, meaning it produces the same value if the | ||
| 1587 | * source and destination are swapped. The only exceptions are | ||
| 1588 | * tunneling protocols 0x04 (IP in IP Encapsulation), 0x29 (Simple | ||
| 1589 | * Internet Protocol), 0x2F (General Routing Encapsulation) and 0x32 | ||
| 1590 | * (Encap Security Payload), which use only the destination address | ||
| 1591 | * since the source address is not meaningful. | ||
| 1592 | * | ||
| 1593 | * @param[in] pkt Packet on which to operate. | ||
| 1594 | * @return The packet's 32-bit flow hash. | ||
| 1595 | */ | ||
| 1596 | static __inline unsigned int | ||
| 1597 | NETIO_PKT_FLOW_HASH(netio_pkt_t* pkt) | ||
| 1598 | { | ||
| 1599 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1600 | |||
| 1601 | return NETIO_PKT_FLOW_HASH_M(mda, pkt); | ||
| 1602 | } | ||
| 1603 | |||
| 1604 | |||
| 1605 | /** Return the first word of "user data" for the packet. | ||
| 1606 | * | ||
| 1607 | * The contents of the user data words depend on the IPP. | ||
| 1608 | * | ||
| 1609 | * When using the standard ipp1, ipp2, or ipp4 sub-drivers, the first | ||
| 1610 | * word of user data contains the least significant bits of the 64-bit | ||
| 1611 | * arrival cycle count (see @c get_cycle_count_low()). | ||
| 1612 | * | ||
| 1613 | * See the <em>System Programmer's Guide</em> for details. | ||
| 1614 | * | ||
| 1615 | * @ingroup ingress | ||
| 1616 | * | ||
| 1617 | * @param[in] pkt Packet on which to operate. | ||
| 1618 | * @return The packet's first word of "user data". | ||
| 1619 | */ | ||
| 1620 | static __inline unsigned int | ||
| 1621 | NETIO_PKT_USER_DATA_0(netio_pkt_t* pkt) | ||
| 1622 | { | ||
| 1623 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1624 | |||
| 1625 | return NETIO_PKT_USER_DATA_0_M(mda, pkt); | ||
| 1626 | } | ||
| 1627 | |||
| 1628 | |||
| 1629 | /** Return the second word of "user data" for the packet. | ||
| 1630 | * | ||
| 1631 | * The contents of the user data words depend on the IPP. | ||
| 1632 | * | ||
| 1633 | * When using the standard ipp1, ipp2, or ipp4 sub-drivers, the second | ||
| 1634 | * word of user data contains the most significant bits of the 64-bit | ||
| 1635 | * arrival cycle count (see @c get_cycle_count_high()). | ||
| 1636 | * | ||
| 1637 | * See the <em>System Programmer's Guide</em> for details. | ||
| 1638 | * | ||
| 1639 | * @ingroup ingress | ||
| 1640 | * | ||
| 1641 | * @param[in] pkt Packet on which to operate. | ||
| 1642 | * @return The packet's second word of "user data". | ||
| 1643 | */ | ||
| 1644 | static __inline unsigned int | ||
| 1645 | NETIO_PKT_USER_DATA_1(netio_pkt_t* pkt) | ||
| 1646 | { | ||
| 1647 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1648 | |||
| 1649 | return NETIO_PKT_USER_DATA_1_M(mda, pkt); | ||
| 1650 | } | ||
| 1651 | |||
| 1652 | |||
| 1653 | /** Determine whether the L4 (TCP/UDP) checksum was calculated. | ||
| 1654 | * @ingroup ingress | ||
| 1655 | * | ||
| 1656 | * @param[in] pkt Packet on which to operate. | ||
| 1657 | * @return Nonzero if the L4 checksum was calculated. | ||
| 1658 | */ | ||
| 1659 | static __inline unsigned int | ||
| 1660 | NETIO_PKT_L4_CSUM_CALCULATED(netio_pkt_t* pkt) | ||
| 1661 | { | ||
| 1662 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1663 | |||
| 1664 | return NETIO_PKT_L4_CSUM_CALCULATED_M(mda, pkt); | ||
| 1665 | } | ||
| 1666 | |||
| 1667 | |||
| 1668 | /** Determine whether the L4 (TCP/UDP) checksum was calculated and found to | ||
| 1669 | * be correct. | ||
| 1670 | * @ingroup ingress | ||
| 1671 | * | ||
| 1672 | * @param[in] pkt Packet on which to operate. | ||
| 1673 | * @return Nonzero if the checksum was calculated and is correct. | ||
| 1674 | */ | ||
| 1675 | static __inline unsigned int | ||
| 1676 | NETIO_PKT_L4_CSUM_CORRECT(netio_pkt_t* pkt) | ||
| 1677 | { | ||
| 1678 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1679 | |||
| 1680 | return NETIO_PKT_L4_CSUM_CORRECT_M(mda, pkt); | ||
| 1681 | } | ||
| 1682 | |||
| 1683 | |||
| 1684 | /** Determine whether the L3 (IP) checksum was calculated. | ||
| 1685 | * @ingroup ingress | ||
| 1686 | * | ||
| 1687 | * @param[in] pkt Packet on which to operate. | ||
| 1688 | * @return Nonzero if the L3 (IP) checksum was calculated. | ||
| 1689 | */ | ||
| 1690 | static __inline unsigned int | ||
| 1691 | NETIO_PKT_L3_CSUM_CALCULATED(netio_pkt_t* pkt) | ||
| 1692 | { | ||
| 1693 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1694 | |||
| 1695 | return NETIO_PKT_L3_CSUM_CALCULATED_M(mda, pkt); | ||
| 1696 | } | ||
| 1697 | |||
| 1698 | |||
| 1699 | /** Determine whether the L3 (IP) checksum was calculated and found to be | ||
| 1700 | * correct. | ||
| 1701 | * @ingroup ingress | ||
| 1702 | * | ||
| 1703 | * @param[in] pkt Packet on which to operate. | ||
| 1704 | * @return Nonzero if the checksum was calculated and is correct. | ||
| 1705 | */ | ||
| 1706 | static __inline unsigned int | ||
| 1707 | NETIO_PKT_L3_CSUM_CORRECT(netio_pkt_t* pkt) | ||
| 1708 | { | ||
| 1709 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1710 | |||
| 1711 | return NETIO_PKT_L3_CSUM_CORRECT_M(mda, pkt); | ||
| 1712 | } | ||
| 1713 | |||
| 1714 | |||
| 1715 | /** Determine whether the Ethertype was recognized and L3 packet data was | ||
| 1716 | * processed. | ||
| 1717 | * @ingroup ingress | ||
| 1718 | * | ||
| 1719 | * @param[in] pkt Packet on which to operate. | ||
| 1720 | * @return Nonzero if the Ethertype was recognized and L3 packet data was | ||
| 1721 | * processed. | ||
| 1722 | */ | ||
| 1723 | static __inline unsigned int | ||
| 1724 | NETIO_PKT_ETHERTYPE_RECOGNIZED(netio_pkt_t* pkt) | ||
| 1725 | { | ||
| 1726 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1727 | |||
| 1728 | return NETIO_PKT_ETHERTYPE_RECOGNIZED_M(mda, pkt); | ||
| 1729 | } | ||
| 1730 | |||
| 1731 | |||
| 1732 | /** Set an egress packet's L2 length, using a metadata pointer to speed the | ||
| 1733 | * computation. | ||
| 1734 | * @ingroup egress | ||
| 1735 | * | ||
| 1736 | * @param[in,out] mmd Pointer to packet's minimal metadata. | ||
| 1737 | * @param[in] pkt Packet on which to operate. | ||
| 1738 | * @param[in] len Packet L2 length, in bytes. | ||
| 1739 | */ | ||
| 1740 | static __inline void | ||
| 1741 | NETIO_PKT_SET_L2_LENGTH_MM(netio_pkt_minimal_metadata_t* mmd, netio_pkt_t* pkt, | ||
| 1742 | int len) | ||
| 1743 | { | ||
| 1744 | mmd->l2_length = len; | ||
| 1745 | } | ||
| 1746 | |||
| 1747 | |||
| 1748 | /** Set an egress packet's L2 length. | ||
| 1749 | * @ingroup egress | ||
| 1750 | * | ||
| 1751 | * @param[in,out] pkt Packet on which to operate. | ||
| 1752 | * @param[in] len Packet L2 length, in bytes. | ||
| 1753 | */ | ||
| 1754 | static __inline void | ||
| 1755 | NETIO_PKT_SET_L2_LENGTH(netio_pkt_t* pkt, int len) | ||
| 1756 | { | ||
| 1757 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1758 | |||
| 1759 | NETIO_PKT_SET_L2_LENGTH_MM(mmd, pkt, len); | ||
| 1760 | } | ||
| 1761 | |||
| 1762 | |||
| 1763 | /** Set an egress packet's L2 header length, using a metadata pointer to | ||
| 1764 | * speed the computation. | ||
| 1765 | * @ingroup egress | ||
| 1766 | * | ||
| 1767 | * It is not normally necessary to call this routine; only the L2 length, | ||
| 1768 | * not the header length, is needed to transmit a packet. It may be useful if | ||
| 1769 | * the egress packet will later be processed by code which expects to use | ||
| 1770 | * functions like @ref NETIO_PKT_L3_DATA() to get a pointer to the L3 payload. | ||
| 1771 | * | ||
| 1772 | * @param[in,out] mmd Pointer to packet's minimal metadata. | ||
| 1773 | * @param[in] pkt Packet on which to operate. | ||
| 1774 | * @param[in] len Packet L2 header length, in bytes. | ||
| 1775 | */ | ||
| 1776 | static __inline void | ||
| 1777 | NETIO_PKT_SET_L2_HEADER_LENGTH_MM(netio_pkt_minimal_metadata_t* mmd, | ||
| 1778 | netio_pkt_t* pkt, int len) | ||
| 1779 | { | ||
| 1780 | mmd->l3_offset = mmd->l2_offset + len; | ||
| 1781 | } | ||
| 1782 | |||
| 1783 | |||
| 1784 | /** Set an egress packet's L2 header length. | ||
| 1785 | * @ingroup egress | ||
| 1786 | * | ||
| 1787 | * It is not normally necessary to call this routine; only the L2 length, | ||
| 1788 | * not the header length, is needed to transmit a packet. It may be useful if | ||
| 1789 | * the egress packet will later be processed by code which expects to use | ||
| 1790 | * functions like @ref NETIO_PKT_L3_DATA() to get a pointer to the L3 payload. | ||
| 1791 | * | ||
| 1792 | * @param[in,out] pkt Packet on which to operate. | ||
| 1793 | * @param[in] len Packet L2 header length, in bytes. | ||
| 1794 | */ | ||
| 1795 | static __inline void | ||
| 1796 | NETIO_PKT_SET_L2_HEADER_LENGTH(netio_pkt_t* pkt, int len) | ||
| 1797 | { | ||
| 1798 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1799 | |||
| 1800 | NETIO_PKT_SET_L2_HEADER_LENGTH_MM(mmd, pkt, len); | ||
| 1801 | } | ||
| 1802 | |||
| 1803 | |||
| 1804 | /** Set up an egress packet for hardware checksum computation, using a | ||
| 1805 | * metadata pointer to speed the operation. | ||
| 1806 | * @ingroup egress | ||
| 1807 | * | ||
| 1808 | * NetIO provides the ability to automatically calculate a standard | ||
| 1809 | * 16-bit Internet checksum on transmitted packets. The application | ||
| 1810 | * may specify the point in the packet where the checksum starts, the | ||
| 1811 | * number of bytes to be checksummed, and the two bytes in the packet | ||
| 1812 | * which will be replaced with the completed checksum. (If the range | ||
| 1813 | * of bytes to be checksummed includes the bytes to be replaced, the | ||
| 1814 | * initial values of those bytes will be included in the checksum.) | ||
| 1815 | * | ||
| 1816 | * For some protocols, the packet checksum covers data which is not present | ||
| 1817 | * in the packet, or is at least not contiguous to the main data payload. | ||
| 1818 | * For instance, the TCP checksum includes a "pseudo-header" which includes | ||
| 1819 | * the source and destination IP addresses of the packet. To accommodate | ||
| 1820 | * this, the checksum engine may be "seeded" with an initial value, which | ||
| 1821 | * the application would need to compute based on the specific protocol's | ||
| 1822 | * requirements. Note that the seed is given in host byte order (little- | ||
| 1823 | * endian), not network byte order (big-endian); code written to compute a | ||
| 1824 | * pseudo-header checksum in network byte order will need to byte-swap it | ||
| 1825 | * before use as the seed. | ||
| 1826 | * | ||
| 1827 | * Note that the checksum is computed as part of the transmission process, | ||
| 1828 | * so it will not be present in the packet upon completion of this routine. | ||
| 1829 | * | ||
| 1830 | * @param[in,out] mmd Pointer to packet's minimal metadata. | ||
| 1831 | * @param[in] pkt Packet on which to operate. | ||
| 1832 | * @param[in] start Offset within L2 packet of the first byte to include in | ||
| 1833 | * the checksum. | ||
| 1834 | * @param[in] length Number of bytes to include in the checksum. | ||
| 1835 | * the checksum. | ||
| 1836 | * @param[in] location Offset within L2 packet of the first of the two bytes | ||
| 1837 | * to be replaced with the calculated checksum. | ||
| 1838 | * @param[in] seed Initial value of the running checksum before any of the | ||
| 1839 | * packet data is added. | ||
| 1840 | */ | ||
| 1841 | static __inline void | ||
| 1842 | NETIO_PKT_DO_EGRESS_CSUM_MM(netio_pkt_minimal_metadata_t* mmd, | ||
| 1843 | netio_pkt_t* pkt, int start, int length, | ||
| 1844 | int location, uint16_t seed) | ||
| 1845 | { | ||
| 1846 | mmd->csum_start = start; | ||
| 1847 | mmd->csum_length = length; | ||
| 1848 | mmd->csum_location = location; | ||
| 1849 | mmd->csum_seed = seed; | ||
| 1850 | mmd->flags |= _NETIO_PKT_NEED_EDMA_CSUM_MASK; | ||
| 1851 | } | ||
| 1852 | |||
| 1853 | |||
| 1854 | /** Set up an egress packet for hardware checksum computation. | ||
| 1855 | * @ingroup egress | ||
| 1856 | * | ||
| 1857 | * NetIO provides the ability to automatically calculate a standard | ||
| 1858 | * 16-bit Internet checksum on transmitted packets. The application | ||
| 1859 | * may specify the point in the packet where the checksum starts, the | ||
| 1860 | * number of bytes to be checksummed, and the two bytes in the packet | ||
| 1861 | * which will be replaced with the completed checksum. (If the range | ||
| 1862 | * of bytes to be checksummed includes the bytes to be replaced, the | ||
| 1863 | * initial values of those bytes will be included in the checksum.) | ||
| 1864 | * | ||
| 1865 | * For some protocols, the packet checksum covers data which is not present | ||
| 1866 | * in the packet, or is at least not contiguous to the main data payload. | ||
| 1867 | * For instance, the TCP checksum includes a "pseudo-header" which includes | ||
| 1868 | * the source and destination IP addresses of the packet. To accommodate | ||
| 1869 | * this, the checksum engine may be "seeded" with an initial value, which | ||
| 1870 | * the application would need to compute based on the specific protocol's | ||
| 1871 | * requirements. Note that the seed is given in host byte order (little- | ||
| 1872 | * endian), not network byte order (big-endian); code written to compute a | ||
| 1873 | * pseudo-header checksum in network byte order will need to byte-swap it | ||
| 1874 | * before use as the seed. | ||
| 1875 | * | ||
| 1876 | * Note that the checksum is computed as part of the transmission process, | ||
| 1877 | * so it will not be present in the packet upon completion of this routine. | ||
| 1878 | * | ||
| 1879 | * @param[in,out] pkt Packet on which to operate. | ||
| 1880 | * @param[in] start Offset within L2 packet of the first byte to include in | ||
| 1881 | * the checksum. | ||
| 1882 | * @param[in] length Number of bytes to include in the checksum. | ||
| 1883 | * the checksum. | ||
| 1884 | * @param[in] location Offset within L2 packet of the first of the two bytes | ||
| 1885 | * to be replaced with the calculated checksum. | ||
| 1886 | * @param[in] seed Initial value of the running checksum before any of the | ||
| 1887 | * packet data is added. | ||
| 1888 | */ | ||
| 1889 | static __inline void | ||
| 1890 | NETIO_PKT_DO_EGRESS_CSUM(netio_pkt_t* pkt, int start, int length, | ||
| 1891 | int location, uint16_t seed) | ||
| 1892 | { | ||
| 1893 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1894 | |||
| 1895 | NETIO_PKT_DO_EGRESS_CSUM_MM(mmd, pkt, start, length, location, seed); | ||
| 1896 | } | ||
| 1897 | |||
| 1898 | |||
| 1899 | /** Return the number of bytes which could be prepended to a packet, using a | ||
| 1900 | * metadata pointer to speed the operation. | ||
| 1901 | * See @ref netio_populate_prepend_buffer() to get a full description of | ||
| 1902 | * prepending. | ||
| 1903 | * | ||
| 1904 | * @param[in,out] mda Pointer to packet's standard metadata. | ||
| 1905 | * @param[in] pkt Packet on which to operate. | ||
| 1906 | */ | ||
| 1907 | static __inline int | ||
| 1908 | NETIO_PKT_PREPEND_AVAIL_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 1909 | { | ||
| 1910 | return (pkt->__packet.bits.__offset << 6) + | ||
| 1911 | NETIO_PKT_CUSTOM_HEADER_LENGTH_M(mda, pkt); | ||
| 1912 | } | ||
| 1913 | |||
| 1914 | |||
| 1915 | /** Return the number of bytes which could be prepended to a packet, using a | ||
| 1916 | * metadata pointer to speed the operation. | ||
| 1917 | * See @ref netio_populate_prepend_buffer() to get a full description of | ||
| 1918 | * prepending. | ||
| 1919 | * @ingroup egress | ||
| 1920 | * | ||
| 1921 | * @param[in,out] mmd Pointer to packet's minimal metadata. | ||
| 1922 | * @param[in] pkt Packet on which to operate. | ||
| 1923 | */ | ||
| 1924 | static __inline int | ||
| 1925 | NETIO_PKT_PREPEND_AVAIL_MM(netio_pkt_minimal_metadata_t* mmd, netio_pkt_t* pkt) | ||
| 1926 | { | ||
| 1927 | return (pkt->__packet.bits.__offset << 6) + mmd->l2_offset; | ||
| 1928 | } | ||
| 1929 | |||
| 1930 | |||
| 1931 | /** Return the number of bytes which could be prepended to a packet. | ||
| 1932 | * See @ref netio_populate_prepend_buffer() to get a full description of | ||
| 1933 | * prepending. | ||
| 1934 | * @ingroup egress | ||
| 1935 | * | ||
| 1936 | * @param[in] pkt Packet on which to operate. | ||
| 1937 | */ | ||
| 1938 | static __inline int | ||
| 1939 | NETIO_PKT_PREPEND_AVAIL(netio_pkt_t* pkt) | ||
| 1940 | { | ||
| 1941 | if (NETIO_PKT_IS_MINIMAL(pkt)) | ||
| 1942 | { | ||
| 1943 | netio_pkt_minimal_metadata_t* mmd = NETIO_PKT_MINIMAL_METADATA(pkt); | ||
| 1944 | |||
| 1945 | return NETIO_PKT_PREPEND_AVAIL_MM(mmd, pkt); | ||
| 1946 | } | ||
| 1947 | else | ||
| 1948 | { | ||
| 1949 | netio_pkt_metadata_t* mda = NETIO_PKT_METADATA(pkt); | ||
| 1950 | |||
| 1951 | return NETIO_PKT_PREPEND_AVAIL_M(mda, pkt); | ||
| 1952 | } | ||
| 1953 | } | ||
| 1954 | |||
| 1955 | |||
| 1956 | /** Flush a packet's minimal metadata from the cache, using a metadata pointer | ||
| 1957 | * to speed the operation. | ||
| 1958 | * @ingroup egress | ||
| 1959 | * | ||
| 1960 | * @param[in] mmd Pointer to packet's minimal metadata. | ||
| 1961 | * @param[in] pkt Packet on which to operate. | ||
| 1962 | */ | ||
| 1963 | static __inline void | ||
| 1964 | NETIO_PKT_FLUSH_MINIMAL_METADATA_MM(netio_pkt_minimal_metadata_t* mmd, | ||
| 1965 | netio_pkt_t* pkt) | ||
| 1966 | { | ||
| 1967 | } | ||
| 1968 | |||
| 1969 | |||
| 1970 | /** Invalidate a packet's minimal metadata from the cache, using a metadata | ||
| 1971 | * pointer to speed the operation. | ||
| 1972 | * @ingroup egress | ||
| 1973 | * | ||
| 1974 | * @param[in] mmd Pointer to packet's minimal metadata. | ||
| 1975 | * @param[in] pkt Packet on which to operate. | ||
| 1976 | */ | ||
| 1977 | static __inline void | ||
| 1978 | NETIO_PKT_INV_MINIMAL_METADATA_MM(netio_pkt_minimal_metadata_t* mmd, | ||
| 1979 | netio_pkt_t* pkt) | ||
| 1980 | { | ||
| 1981 | } | ||
| 1982 | |||
| 1983 | |||
| 1984 | /** Flush and then invalidate a packet's minimal metadata from the cache, | ||
| 1985 | * using a metadata pointer to speed the operation. | ||
| 1986 | * @ingroup egress | ||
| 1987 | * | ||
| 1988 | * @param[in] mmd Pointer to packet's minimal metadata. | ||
| 1989 | * @param[in] pkt Packet on which to operate. | ||
| 1990 | */ | ||
| 1991 | static __inline void | ||
| 1992 | NETIO_PKT_FLUSH_INV_MINIMAL_METADATA_MM(netio_pkt_minimal_metadata_t* mmd, | ||
| 1993 | netio_pkt_t* pkt) | ||
| 1994 | { | ||
| 1995 | } | ||
| 1996 | |||
| 1997 | |||
| 1998 | /** Flush a packet's metadata from the cache, using a metadata pointer | ||
| 1999 | * to speed the operation. | ||
| 2000 | * @ingroup ingress | ||
| 2001 | * | ||
| 2002 | * @param[in] mda Pointer to packet's minimal metadata. | ||
| 2003 | * @param[in] pkt Packet on which to operate. | ||
| 2004 | */ | ||
| 2005 | static __inline void | ||
| 2006 | NETIO_PKT_FLUSH_METADATA_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 2007 | { | ||
| 2008 | } | ||
| 2009 | |||
| 2010 | |||
| 2011 | /** Invalidate a packet's metadata from the cache, using a metadata | ||
| 2012 | * pointer to speed the operation. | ||
| 2013 | * @ingroup ingress | ||
| 2014 | * | ||
| 2015 | * @param[in] mda Pointer to packet's metadata. | ||
| 2016 | * @param[in] pkt Packet on which to operate. | ||
| 2017 | */ | ||
| 2018 | static __inline void | ||
| 2019 | NETIO_PKT_INV_METADATA_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 2020 | { | ||
| 2021 | } | ||
| 2022 | |||
| 2023 | |||
| 2024 | /** Flush and then invalidate a packet's metadata from the cache, | ||
| 2025 | * using a metadata pointer to speed the operation. | ||
| 2026 | * @ingroup ingress | ||
| 2027 | * | ||
| 2028 | * @param[in] mda Pointer to packet's metadata. | ||
| 2029 | * @param[in] pkt Packet on which to operate. | ||
| 2030 | */ | ||
| 2031 | static __inline void | ||
| 2032 | NETIO_PKT_FLUSH_INV_METADATA_M(netio_pkt_metadata_t* mda, netio_pkt_t* pkt) | ||
| 2033 | { | ||
| 2034 | } | ||
| 2035 | |||
| 2036 | |||
| 2037 | /** Flush a packet's minimal metadata from the cache. | ||
| 2038 | * @ingroup egress | ||
| 2039 | * | ||
| 2040 | * @param[in] pkt Packet on which to operate. | ||
| 2041 | */ | ||
| 2042 | static __inline void | ||
| 2043 | NETIO_PKT_FLUSH_MINIMAL_METADATA(netio_pkt_t* pkt) | ||
| 2044 | { | ||
| 2045 | } | ||
| 2046 | |||
| 2047 | |||
| 2048 | /** Invalidate a packet's minimal metadata from the cache. | ||
| 2049 | * @ingroup egress | ||
| 2050 | * | ||
| 2051 | * @param[in] pkt Packet on which to operate. | ||
| 2052 | */ | ||
| 2053 | static __inline void | ||
| 2054 | NETIO_PKT_INV_MINIMAL_METADATA(netio_pkt_t* pkt) | ||
| 2055 | { | ||
| 2056 | } | ||
| 2057 | |||
| 2058 | |||
| 2059 | /** Flush and then invalidate a packet's minimal metadata from the cache. | ||
| 2060 | * @ingroup egress | ||
| 2061 | * | ||
| 2062 | * @param[in] pkt Packet on which to operate. | ||
| 2063 | */ | ||
| 2064 | static __inline void | ||
| 2065 | NETIO_PKT_FLUSH_INV_MINIMAL_METADATA(netio_pkt_t* pkt) | ||
| 2066 | { | ||
| 2067 | } | ||
| 2068 | |||
| 2069 | |||
| 2070 | /** Flush a packet's metadata from the cache. | ||
| 2071 | * @ingroup ingress | ||
| 2072 | * | ||
| 2073 | * @param[in] pkt Packet on which to operate. | ||
| 2074 | */ | ||
| 2075 | static __inline void | ||
| 2076 | NETIO_PKT_FLUSH_METADATA(netio_pkt_t* pkt) | ||
| 2077 | { | ||
| 2078 | } | ||
| 2079 | |||
| 2080 | |||
| 2081 | /** Invalidate a packet's metadata from the cache. | ||
| 2082 | * @ingroup ingress | ||
| 2083 | * | ||
| 2084 | * @param[in] pkt Packet on which to operate. | ||
| 2085 | */ | ||
| 2086 | static __inline void | ||
| 2087 | NETIO_PKT_INV_METADATA(netio_pkt_t* pkt) | ||
| 2088 | { | ||
| 2089 | } | ||
| 2090 | |||
| 2091 | |||
| 2092 | /** Flush and then invalidate a packet's metadata from the cache. | ||
| 2093 | * @ingroup ingress | ||
| 2094 | * | ||
| 2095 | * @param[in] pkt Packet on which to operate. | ||
| 2096 | */ | ||
| 2097 | static __inline void | ||
| 2098 | NETIO_PKT_FLUSH_INV_METADATA(netio_pkt_t* pkt) | ||
| 2099 | { | ||
| 2100 | } | ||
| 2101 | |||
| 2102 | /** Number of NUMA nodes we can distribute buffers to. | ||
| 2103 | * @ingroup setup */ | ||
| 2104 | #define NETIO_NUM_NODE_WEIGHTS 16 | ||
| 2105 | |||
| 2106 | /** | ||
| 2107 | * @brief An object for specifying the characteristics of NetIO communication | ||
| 2108 | * endpoint. | ||
| 2109 | * | ||
| 2110 | * @ingroup setup | ||
| 2111 | * | ||
| 2112 | * The @ref netio_input_register() function uses this structure to define | ||
| 2113 | * how an application tile will communicate with an IPP. | ||
| 2114 | * | ||
| 2115 | * | ||
| 2116 | * Future updates to NetIO may add new members to this structure, | ||
| 2117 | * which can affect the success of the registration operation. Thus, | ||
| 2118 | * if dynamically initializing the structure, applications are urged to | ||
| 2119 | * zero it out first, for example: | ||
| 2120 | * | ||
| 2121 | * @code | ||
| 2122 | * netio_input_config_t config; | ||
| 2123 | * memset(&config, 0, sizeof (config)); | ||
| 2124 | * config.flags = NETIO_RECV | NETIO_XMIT_CSUM | NETIO_TAG_NONE; | ||
| 2125 | * config.num_receive_packets = NETIO_MAX_RECEIVE_PKTS; | ||
| 2126 | * config.queue_id = 0; | ||
| 2127 | * . | ||
| 2128 | * . | ||
| 2129 | * . | ||
| 2130 | * @endcode | ||
| 2131 | * | ||
| 2132 | * since that guarantees that any unused structure members, including | ||
| 2133 | * members which did not exist when the application was first developed, | ||
| 2134 | * will not have unexpected values. | ||
| 2135 | * | ||
| 2136 | * If statically initializing the structure, we strongly recommend use of | ||
| 2137 | * C99-style named initializers, for example: | ||
| 2138 | * | ||
| 2139 | * @code | ||
| 2140 | * netio_input_config_t config = { | ||
| 2141 | * .flags = NETIO_RECV | NETIO_XMIT_CSUM | NETIO_TAG_NONE, | ||
| 2142 | * .num_receive_packets = NETIO_MAX_RECEIVE_PKTS, | ||
| 2143 | * .queue_id = 0, | ||
| 2144 | * }, | ||
| 2145 | * @endcode | ||
| 2146 | * | ||
| 2147 | * instead of the old-style structure initialization: | ||
| 2148 | * | ||
| 2149 | * @code | ||
| 2150 | * // Bad example! Currently equivalent to the above, but don't do this. | ||
| 2151 | * netio_input_config_t config = { | ||
| 2152 | * NETIO_RECV | NETIO_XMIT_CSUM | NETIO_TAG_NONE, NETIO_MAX_RECEIVE_PKTS, 0 | ||
| 2153 | * }, | ||
| 2154 | * @endcode | ||
| 2155 | * | ||
| 2156 | * since the C99 style requires no changes to the code if elements of the | ||
| 2157 | * config structure are rearranged. (It also makes the initialization much | ||
| 2158 | * easier to understand.) | ||
| 2159 | * | ||
| 2160 | * Except for items which address a particular tile's transmit or receive | ||
| 2161 | * characteristics, such as the ::NETIO_RECV flag, applications are advised | ||
| 2162 | * to specify the same set of configuration data on all registrations. | ||
| 2163 | * This prevents differing results if multiple tiles happen to do their | ||
| 2164 | * registration operations in a different order on different invocations of | ||
| 2165 | * the application. This is particularly important for things like link | ||
| 2166 | * management flags, and buffer size and homing specifications. | ||
| 2167 | * | ||
| 2168 | * Unless the ::NETIO_FIXED_BUFFER_VA flag is specified in flags, the NetIO | ||
| 2169 | * buffer pool is automatically created and mapped into the application's | ||
| 2170 | * virtual address space at an address chosen by the operating system, | ||
| 2171 | * using the common memory (cmem) facility in the Tilera Multicore | ||
| 2172 | * Components library. The cmem facility allows multiple processes to gain | ||
| 2173 | * access to shared memory which is mapped into each process at an | ||
| 2174 | * identical virtual address. In order for this to work, the processes | ||
| 2175 | * must have a common ancestor, which must create the common memory using | ||
| 2176 | * tmc_cmem_init(). | ||
| 2177 | * | ||
| 2178 | * In programs using the iLib process creation API, or in programs which use | ||
| 2179 | * only one process (which include programs using the pthreads library), | ||
| 2180 | * tmc_cmem_init() is called automatically. All other applications | ||
| 2181 | * must call it explicitly, before any child processes which might call | ||
| 2182 | * netio_input_register() are created. | ||
| 2183 | */ | ||
| 2184 | typedef struct | ||
| 2185 | { | ||
| 2186 | /** Registration characteristics. | ||
| 2187 | |||
| 2188 | This value determines several characteristics of the registration; | ||
| 2189 | flags for different types of behavior are ORed together to make the | ||
| 2190 | final flag value. Generally applications should specify exactly | ||
| 2191 | one flag from each of the following categories: | ||
| 2192 | |||
| 2193 | - Whether the application will be receiving packets on this queue | ||
| 2194 | (::NETIO_RECV or ::NETIO_NO_RECV). | ||
| 2195 | |||
| 2196 | - Whether the application will be transmitting packets on this queue, | ||
| 2197 | and if so, whether it will request egress checksum calculation | ||
| 2198 | (::NETIO_XMIT, ::NETIO_XMIT_CSUM, or ::NETIO_NO_XMIT). It is | ||
| 2199 | legal to call netio_get_buffer() without one of the XMIT flags, | ||
| 2200 | as long as ::NETIO_RECV is specified; in this case, the retrieved | ||
| 2201 | buffers must be passed to another tile for transmission. | ||
| 2202 | |||
| 2203 | - Whether the application expects any vendor-specific tags in | ||
| 2204 | its packets' L2 headers (::NETIO_TAG_NONE, ::NETIO_TAG_BRCM, | ||
| 2205 | or ::NETIO_TAG_MRVL). This must match the configuration of the | ||
| 2206 | target IPP. | ||
| 2207 | |||
| 2208 | To accommodate applications written to previous versions of the NetIO | ||
| 2209 | interface, none of the flags above are currently required; if omitted, | ||
| 2210 | NetIO behaves more or less as if ::NETIO_RECV | ::NETIO_XMIT_CSUM | | ||
| 2211 | ::NETIO_TAG_NONE were used. However, explicit specification of | ||
| 2212 | the relevant flags allows NetIO to do a better job of resource | ||
| 2213 | allocation, allows earlier detection of certain configuration errors, | ||
| 2214 | and may enable advanced features or higher performance in the future, | ||
| 2215 | so their use is strongly recommended. | ||
| 2216 | |||
| 2217 | Note that specifying ::NETIO_NO_RECV along with ::NETIO_NO_XMIT | ||
| 2218 | is a special case, intended primarily for use by programs which | ||
| 2219 | retrieve network statistics or do link management operations. | ||
| 2220 | When these flags are both specified, the resulting queue may not | ||
| 2221 | be used with NetIO routines other than netio_get(), netio_set(), | ||
| 2222 | and netio_input_unregister(). See @ref link for more information | ||
| 2223 | on link management. | ||
| 2224 | |||
| 2225 | Other flags are optional; their use is described below. | ||
| 2226 | */ | ||
| 2227 | int flags; | ||
| 2228 | |||
| 2229 | /** Interface name. This is a string which identifies the specific | ||
| 2230 | Ethernet controller hardware to be used. The format of the string | ||
| 2231 | is a device type and a device index, separated by a slash; so, | ||
| 2232 | the first 10 Gigabit Ethernet controller is named "xgbe/0", while | ||
| 2233 | the second 10/100/1000 Megabit Ethernet controller is named "gbe/1". | ||
| 2234 | */ | ||
| 2235 | const char* interface; | ||
| 2236 | |||
| 2237 | /** Receive packet queue size. This specifies the maximum number | ||
| 2238 | of ingress packets that can be received on this queue without | ||
| 2239 | being retrieved by @ref netio_get_packet(). If the IPP's distribution | ||
| 2240 | algorithm calls for a packet to be sent to this queue, and this | ||
| 2241 | number of packets are already pending there, the new packet | ||
| 2242 | will either be discarded, or sent to another tile registered | ||
| 2243 | for the same queue_id (see @ref drops). This value must | ||
| 2244 | be at least ::NETIO_MIN_RECEIVE_PKTS, can always be at least | ||
| 2245 | ::NETIO_MAX_RECEIVE_PKTS, and may be larger than that on certain | ||
| 2246 | interfaces. | ||
| 2247 | */ | ||
| 2248 | int num_receive_packets; | ||
| 2249 | |||
| 2250 | /** The queue ID being requested. Legal values for this range from 0 | ||
| 2251 | to ::NETIO_MAX_QUEUE_ID, inclusive. ::NETIO_MAX_QUEUE_ID is always | ||
| 2252 | greater than or equal to the number of tiles; this allows one queue | ||
| 2253 | for each tile, plus at least one additional queue. Some applications | ||
| 2254 | may wish to use the additional queue as a destination for unwanted | ||
| 2255 | packets, since packets delivered to queues for which no tiles have | ||
| 2256 | registered are discarded. | ||
| 2257 | */ | ||
| 2258 | unsigned int queue_id; | ||
| 2259 | |||
| 2260 | /** Maximum number of small send buffers to be held in the local empty | ||
| 2261 | buffer cache. This specifies the size of the area which holds | ||
| 2262 | empty small egress buffers requested from the IPP but not yet | ||
| 2263 | retrieved via @ref netio_get_buffer(). This value must be greater | ||
| 2264 | than zero if the application will ever use @ref netio_get_buffer() | ||
| 2265 | to allocate empty small egress buffers; it may be no larger than | ||
| 2266 | ::NETIO_MAX_SEND_BUFFERS. See @ref epp for more details on empty | ||
| 2267 | buffer caching. | ||
| 2268 | */ | ||
| 2269 | int num_send_buffers_small_total; | ||
| 2270 | |||
| 2271 | /** Number of small send buffers to be preallocated at registration. | ||
| 2272 | If this value is nonzero, the specified number of empty small egress | ||
| 2273 | buffers will be requested from the IPP during the netio_input_register | ||
| 2274 | operation; this may speed the execution of @ref netio_get_buffer(). | ||
| 2275 | This may be no larger than @ref num_send_buffers_small_total. See @ref | ||
| 2276 | epp for more details on empty buffer caching. | ||
| 2277 | */ | ||
| 2278 | int num_send_buffers_small_prealloc; | ||
| 2279 | |||
| 2280 | /** Maximum number of large send buffers to be held in the local empty | ||
| 2281 | buffer cache. This specifies the size of the area which holds empty | ||
| 2282 | large egress buffers requested from the IPP but not yet retrieved via | ||
| 2283 | @ref netio_get_buffer(). This value must be greater than zero if the | ||
| 2284 | application will ever use @ref netio_get_buffer() to allocate empty | ||
| 2285 | large egress buffers; it may be no larger than ::NETIO_MAX_SEND_BUFFERS. | ||
| 2286 | See @ref epp for more details on empty buffer caching. | ||
| 2287 | */ | ||
| 2288 | int num_send_buffers_large_total; | ||
| 2289 | |||
| 2290 | /** Number of large send buffers to be preallocated at registration. | ||
| 2291 | If this value is nonzero, the specified number of empty large egress | ||
| 2292 | buffers will be requested from the IPP during the netio_input_register | ||
| 2293 | operation; this may speed the execution of @ref netio_get_buffer(). | ||
| 2294 | This may be no larger than @ref num_send_buffers_large_total. See @ref | ||
| 2295 | epp for more details on empty buffer caching. | ||
| 2296 | */ | ||
| 2297 | int num_send_buffers_large_prealloc; | ||
| 2298 | |||
| 2299 | /** Maximum number of jumbo send buffers to be held in the local empty | ||
| 2300 | buffer cache. This specifies the size of the area which holds empty | ||
| 2301 | jumbo egress buffers requested from the IPP but not yet retrieved via | ||
| 2302 | @ref netio_get_buffer(). This value must be greater than zero if the | ||
| 2303 | application will ever use @ref netio_get_buffer() to allocate empty | ||
| 2304 | jumbo egress buffers; it may be no larger than ::NETIO_MAX_SEND_BUFFERS. | ||
| 2305 | See @ref epp for more details on empty buffer caching. | ||
| 2306 | */ | ||
| 2307 | int num_send_buffers_jumbo_total; | ||
| 2308 | |||
| 2309 | /** Number of jumbo send buffers to be preallocated at registration. | ||
| 2310 | If this value is nonzero, the specified number of empty jumbo egress | ||
| 2311 | buffers will be requested from the IPP during the netio_input_register | ||
| 2312 | operation; this may speed the execution of @ref netio_get_buffer(). | ||
| 2313 | This may be no larger than @ref num_send_buffers_jumbo_total. See @ref | ||
| 2314 | epp for more details on empty buffer caching. | ||
| 2315 | */ | ||
| 2316 | int num_send_buffers_jumbo_prealloc; | ||
| 2317 | |||
| 2318 | /** Total packet buffer size. This determines the total size, in bytes, | ||
| 2319 | of the NetIO buffer pool. Note that the maximum number of available | ||
| 2320 | buffers of each size is determined during hypervisor configuration | ||
| 2321 | (see the <em>System Programmer's Guide</em> for details); this just | ||
| 2322 | influences how much host memory is allocated for those buffers. | ||
| 2323 | |||
| 2324 | The buffer pool is allocated from common memory, which will be | ||
| 2325 | automatically initialized if needed. If your buffer pool is larger | ||
| 2326 | than 240 MB, you might need to explicitly call @c tmc_cmem_init(), | ||
| 2327 | as described in the Application Libraries Reference Manual (UG227). | ||
| 2328 | |||
| 2329 | Packet buffers are currently allocated in chunks of 16 MB; this | ||
| 2330 | value will be rounded up to the next larger multiple of 16 MB. | ||
| 2331 | If this value is zero, a default of 32 MB will be used; this was | ||
| 2332 | the value used by previous versions of NetIO. Note that taking this | ||
| 2333 | default also affects the placement of buffers on Linux NUMA nodes. | ||
| 2334 | See @ref buffer_node_weights for an explanation of buffer placement. | ||
| 2335 | |||
| 2336 | In order to successfully allocate packet buffers, Linux must have | ||
| 2337 | available huge pages on the relevant Linux NUMA nodes. See the | ||
| 2338 | <em>System Programmer's Guide</em> for information on configuring | ||
| 2339 | huge page support in Linux. | ||
| 2340 | */ | ||
| 2341 | uint64_t total_buffer_size; | ||
| 2342 | |||
| 2343 | /** Buffer placement weighting factors. | ||
| 2344 | |||
| 2345 | This array specifies the relative amount of buffering to place | ||
| 2346 | on each of the available Linux NUMA nodes. This array is | ||
| 2347 | indexed by the NUMA node, and the values in the array are | ||
| 2348 | proportional to the amount of buffer space to allocate on that | ||
| 2349 | node. | ||
| 2350 | |||
| 2351 | If memory striping is enabled in the Hypervisor, then there is | ||
| 2352 | only one logical NUMA node (node 0). In that case, NetIO will by | ||
| 2353 | default ignore the suggested buffer node weights, and buffers | ||
| 2354 | will be striped across the physical memory controllers. See | ||
| 2355 | UG209 System Programmer's Guide for a description of the | ||
| 2356 | hypervisor option that controls memory striping. | ||
| 2357 | |||
| 2358 | If memory striping is disabled, then there are up to four NUMA | ||
| 2359 | nodes, corresponding to the four DDRAM controllers in the TILE | ||
| 2360 | processor architecture. See UG100 Tile Processor Architecture | ||
| 2361 | Overview for a diagram showing the location of each of the DDRAM | ||
| 2362 | controllers relative to the tile array. | ||
| 2363 | |||
| 2364 | For instance, if memory striping is disabled, the following | ||
| 2365 | configuration strucure: | ||
| 2366 | |||
| 2367 | @code | ||
| 2368 | netio_input_config_t config = { | ||
| 2369 | . | ||
| 2370 | . | ||
| 2371 | . | ||
| 2372 | .total_buffer_size = 4 * 16 * 1024 * 1024; | ||
| 2373 | .buffer_node_weights = { 1, 0, 1, 0 }, | ||
| 2374 | }, | ||
| 2375 | @endcode | ||
| 2376 | |||
| 2377 | would result in 32 MB of buffers being placed on controller 0, and | ||
| 2378 | 32 MB on controller 2. (Since buffers are allocated in units of | ||
| 2379 | 16 MB, some sets of weights will not be able to be matched exactly.) | ||
| 2380 | |||
| 2381 | For the weights to be effective, @ref total_buffer_size must be | ||
| 2382 | nonzero. If @ref total_buffer_size is zero, causing the default | ||
| 2383 | 32 MB of buffer space to be used, then any specified weights will | ||
| 2384 | be ignored, and buffers will positioned as they were in previous | ||
| 2385 | versions of NetIO: | ||
| 2386 | |||
| 2387 | - For xgbe/0 and gbe/0, 16 MB of buffers will be placed on controller 1, | ||
| 2388 | and the other 16 MB will be placed on controller 2. | ||
| 2389 | |||
| 2390 | - For xgbe/1 and gbe/1, 16 MB of buffers will be placed on controller 2, | ||
| 2391 | and the other 16 MB will be placed on controller 3. | ||
| 2392 | |||
| 2393 | If @ref total_buffer_size is nonzero, but all weights are zero, | ||
| 2394 | then all buffer space will be allocated on Linux NUMA node zero. | ||
| 2395 | |||
| 2396 | By default, the specified buffer placement is treated as a hint; | ||
| 2397 | if sufficient free memory is not available on the specified | ||
| 2398 | controllers, the buffers will be allocated elsewhere. However, | ||
| 2399 | if the ::NETIO_STRICT_HOMING flag is specified in @ref flags, then a | ||
| 2400 | failure to allocate buffer space exactly as requested will cause the | ||
| 2401 | registration operation to fail with an error of ::NETIO_CANNOT_HOME. | ||
| 2402 | |||
| 2403 | Note that maximal network performance cannot be achieved with | ||
| 2404 | only one memory controller. | ||
| 2405 | */ | ||
| 2406 | uint8_t buffer_node_weights[NETIO_NUM_NODE_WEIGHTS]; | ||
| 2407 | |||
| 2408 | /** Fixed virtual address for packet buffers. Only valid when | ||
| 2409 | ::NETIO_FIXED_BUFFER_VA is specified in @ref flags; see the | ||
| 2410 | description of that flag for details. | ||
| 2411 | */ | ||
| 2412 | void* fixed_buffer_va; | ||
| 2413 | |||
| 2414 | /** | ||
| 2415 | Maximum number of outstanding send packet requests. This value is | ||
| 2416 | only relevant when an EPP is in use; it determines the number of | ||
| 2417 | slots in the EPP's outgoing packet queue which this tile is allowed | ||
| 2418 | to consume, and thus the number of packets which may be sent before | ||
| 2419 | the sending tile must wait for an acknowledgment from the EPP. | ||
| 2420 | Modifying this value is generally only helpful when using @ref | ||
| 2421 | netio_send_packet_vector(), where it can help improve performance by | ||
| 2422 | allowing a single vector send operation to process more packets. | ||
| 2423 | Typically it is not specified, and the default, which divides the | ||
| 2424 | outgoing packet slots evenly between all tiles on the chip, is used. | ||
| 2425 | |||
| 2426 | If a registration asks for more outgoing packet queue slots than are | ||
| 2427 | available, ::NETIO_TOOMANY_XMIT will be returned. The total number | ||
| 2428 | of packet queue slots which are available for all tiles for each EPP | ||
| 2429 | is subject to change, but is currently ::NETIO_TOTAL_SENDS_OUTSTANDING. | ||
| 2430 | |||
| 2431 | |||
| 2432 | This value is ignored if ::NETIO_XMIT is not specified in flags. | ||
| 2433 | If you want to specify a large value here for a specific tile, you are | ||
| 2434 | advised to specify NETIO_NO_XMIT on other, non-transmitting tiles so | ||
| 2435 | that they do not consume a default number of packet slots. Any tile | ||
| 2436 | transmitting is required to have at least ::NETIO_MIN_SENDS_OUTSTANDING | ||
| 2437 | slots allocated to it; values less than that will be silently | ||
| 2438 | increased by the NetIO library. | ||
| 2439 | */ | ||
| 2440 | int num_sends_outstanding; | ||
| 2441 | } | ||
| 2442 | netio_input_config_t; | ||
| 2443 | |||
| 2444 | |||
| 2445 | /** Registration flags; used in the @ref netio_input_config_t structure. | ||
| 2446 | * @addtogroup setup | ||
| 2447 | */ | ||
| 2448 | /** @{ */ | ||
| 2449 | |||
| 2450 | /** Fail a registration request if we can't put packet buffers | ||
| 2451 | on the specified memory controllers. */ | ||
| 2452 | #define NETIO_STRICT_HOMING 0x00000002 | ||
| 2453 | |||
| 2454 | /** This application expects no tags on its L2 headers. */ | ||
| 2455 | #define NETIO_TAG_NONE 0x00000004 | ||
| 2456 | |||
| 2457 | /** This application expects Marvell extended tags on its L2 headers. */ | ||
| 2458 | #define NETIO_TAG_MRVL 0x00000008 | ||
| 2459 | |||
| 2460 | /** This application expects Broadcom tags on its L2 headers. */ | ||
| 2461 | #define NETIO_TAG_BRCM 0x00000010 | ||
| 2462 | |||
| 2463 | /** This registration may call routines which receive packets. */ | ||
| 2464 | #define NETIO_RECV 0x00000020 | ||
| 2465 | |||
| 2466 | /** This registration may not call routines which receive packets. */ | ||
| 2467 | #define NETIO_NO_RECV 0x00000040 | ||
| 2468 | |||
| 2469 | /** This registration may call routines which transmit packets. */ | ||
| 2470 | #define NETIO_XMIT 0x00000080 | ||
| 2471 | |||
| 2472 | /** This registration may call routines which transmit packets with | ||
| 2473 | checksum acceleration. */ | ||
| 2474 | #define NETIO_XMIT_CSUM 0x00000100 | ||
| 2475 | |||
| 2476 | /** This registration may not call routines which transmit packets. */ | ||
| 2477 | #define NETIO_NO_XMIT 0x00000200 | ||
| 2478 | |||
| 2479 | /** This registration wants NetIO buffers mapped at an application-specified | ||
| 2480 | virtual address. | ||
| 2481 | |||
| 2482 | NetIO buffers are by default created by the TMC common memory facility, | ||
| 2483 | which must be configured by a common ancestor of all processes sharing | ||
| 2484 | a network interface. When this flag is specified, NetIO buffers are | ||
| 2485 | instead mapped at an address chosen by the application (and specified | ||
| 2486 | in @ref netio_input_config_t::fixed_buffer_va). This allows multiple | ||
| 2487 | unrelated but cooperating processes to share a NetIO interface. | ||
| 2488 | All processes sharing the same interface must specify this flag, | ||
| 2489 | and all must specify the same fixed virtual address. | ||
| 2490 | |||
| 2491 | @ref netio_input_config_t::fixed_buffer_va must be a | ||
| 2492 | multiple of 16 MB, and the packet buffers will occupy @ref | ||
| 2493 | netio_input_config_t::total_buffer_size bytes of virtual address | ||
| 2494 | space, beginning at that address. If any of those virtual addresses | ||
| 2495 | are currently occupied by other memory objects, like application or | ||
| 2496 | shared library code or data, @ref netio_input_register() will return | ||
| 2497 | ::NETIO_FAULT. While it is impossible to provide a fixed_buffer_va | ||
| 2498 | which will work for all applications, a good first guess might be to | ||
| 2499 | use 0xb0000000 minus @ref netio_input_config_t::total_buffer_size. | ||
| 2500 | If that fails, it might be helpful to consult the running application's | ||
| 2501 | virtual address description file (/proc/<em>pid</em>/maps) to see | ||
| 2502 | which regions of virtual address space are available. | ||
| 2503 | */ | ||
| 2504 | #define NETIO_FIXED_BUFFER_VA 0x00000400 | ||
| 2505 | |||
| 2506 | /** This registration call will not complete unless the network link | ||
| 2507 | is up. The process will wait several seconds for this to happen (the | ||
| 2508 | precise interval is link-dependent), but if the link does not come up, | ||
| 2509 | ::NETIO_LINK_DOWN will be returned. This flag is the default if | ||
| 2510 | ::NETIO_NOREQUIRE_LINK_UP is not specified. Note that this flag by | ||
| 2511 | itself does not request that the link be brought up; that can be done | ||
| 2512 | with the ::NETIO_AUTO_LINK_UPDN or ::NETIO_AUTO_LINK_UP flags (the | ||
| 2513 | latter is the default if no NETIO_AUTO_LINK_xxx flags are specified), | ||
| 2514 | or by explicitly setting the link's desired state via netio_set(). | ||
| 2515 | If the link is not brought up by one of those methods, and this flag | ||
| 2516 | is specified, the registration operation will return ::NETIO_LINK_DOWN. | ||
| 2517 | This flag is ignored if it is specified along with ::NETIO_NO_XMIT and | ||
| 2518 | ::NETIO_NO_RECV. See @ref link for more information on link | ||
| 2519 | management. | ||
| 2520 | */ | ||
| 2521 | #define NETIO_REQUIRE_LINK_UP 0x00000800 | ||
| 2522 | |||
| 2523 | /** This registration call will complete even if the network link is not up. | ||
| 2524 | Whenever the link is not up, packets will not be sent or received: | ||
| 2525 | netio_get_packet() will return ::NETIO_NOPKT once all queued packets | ||
| 2526 | have been drained, and netio_send_packet() and similar routines will | ||
| 2527 | return NETIO_QUEUE_FULL once the outgoing packet queue in the EPP | ||
| 2528 | or the I/O shim is full. See @ref link for more information on link | ||
| 2529 | management. | ||
| 2530 | */ | ||
| 2531 | #define NETIO_NOREQUIRE_LINK_UP 0x00001000 | ||
| 2532 | |||
| 2533 | #ifndef __DOXYGEN__ | ||
| 2534 | /* | ||
| 2535 | * These are part of the implementation of the NETIO_AUTO_LINK_xxx flags, | ||
| 2536 | * but should not be used directly by applications, and are thus not | ||
| 2537 | * documented. | ||
| 2538 | */ | ||
| 2539 | #define _NETIO_AUTO_UP 0x00002000 | ||
| 2540 | #define _NETIO_AUTO_DN 0x00004000 | ||
| 2541 | #define _NETIO_AUTO_PRESENT 0x00008000 | ||
| 2542 | #endif | ||
| 2543 | |||
| 2544 | /** Set the desired state of the link to up, allowing any speeds which are | ||
| 2545 | supported by the link hardware, as part of this registration operation. | ||
| 2546 | Do not take down the link automatically. This is the default if | ||
| 2547 | no other NETIO_AUTO_LINK_xxx flags are specified. This flag is ignored | ||
| 2548 | if it is specified along with ::NETIO_NO_XMIT and ::NETIO_NO_RECV. | ||
| 2549 | See @ref link for more information on link management. | ||
| 2550 | */ | ||
| 2551 | #define NETIO_AUTO_LINK_UP (_NETIO_AUTO_PRESENT | _NETIO_AUTO_UP) | ||
| 2552 | |||
| 2553 | /** Set the desired state of the link to up, allowing any speeds which are | ||
| 2554 | supported by the link hardware, as part of this registration operation. | ||
| 2555 | Set the desired state of the link to down the next time no tiles are | ||
| 2556 | registered for packet reception or transmission. This flag is ignored | ||
| 2557 | if it is specified along with ::NETIO_NO_XMIT and ::NETIO_NO_RECV. | ||
| 2558 | See @ref link for more information on link management. | ||
| 2559 | */ | ||
| 2560 | #define NETIO_AUTO_LINK_UPDN (_NETIO_AUTO_PRESENT | _NETIO_AUTO_UP | \ | ||
| 2561 | _NETIO_AUTO_DN) | ||
| 2562 | |||
| 2563 | /** Set the desired state of the link to down the next time no tiles are | ||
| 2564 | registered for packet reception or transmission. This flag is ignored | ||
| 2565 | if it is specified along with ::NETIO_NO_XMIT and ::NETIO_NO_RECV. | ||
| 2566 | See @ref link for more information on link management. | ||
| 2567 | */ | ||
| 2568 | #define NETIO_AUTO_LINK_DN (_NETIO_AUTO_PRESENT | _NETIO_AUTO_DN) | ||
| 2569 | |||
| 2570 | /** Do not bring up the link automatically as part of this registration | ||
| 2571 | operation. Do not take down the link automatically. This flag | ||
| 2572 | is ignored if it is specified along with ::NETIO_NO_XMIT and | ||
| 2573 | ::NETIO_NO_RECV. See @ref link for more information on link management. | ||
| 2574 | */ | ||
| 2575 | #define NETIO_AUTO_LINK_NONE _NETIO_AUTO_PRESENT | ||
| 2576 | |||
| 2577 | |||
| 2578 | /** Minimum number of receive packets. */ | ||
| 2579 | #define NETIO_MIN_RECEIVE_PKTS 16 | ||
| 2580 | |||
| 2581 | /** Lower bound on the maximum number of receive packets; may be higher | ||
| 2582 | than this on some interfaces. */ | ||
| 2583 | #define NETIO_MAX_RECEIVE_PKTS 128 | ||
| 2584 | |||
| 2585 | /** Maximum number of send buffers, per packet size. */ | ||
| 2586 | #define NETIO_MAX_SEND_BUFFERS 16 | ||
| 2587 | |||
| 2588 | /** Number of EPP queue slots, and thus outstanding sends, per EPP. */ | ||
| 2589 | #define NETIO_TOTAL_SENDS_OUTSTANDING 2015 | ||
| 2590 | |||
| 2591 | /** Minimum number of EPP queue slots, and thus outstanding sends, per | ||
| 2592 | * transmitting tile. */ | ||
| 2593 | #define NETIO_MIN_SENDS_OUTSTANDING 16 | ||
| 2594 | |||
| 2595 | |||
| 2596 | /**@}*/ | ||
| 2597 | |||
| 2598 | #ifndef __DOXYGEN__ | ||
| 2599 | |||
| 2600 | /** | ||
| 2601 | * An object for providing Ethernet packets to a process. | ||
| 2602 | */ | ||
| 2603 | struct __netio_queue_impl_t; | ||
| 2604 | |||
| 2605 | /** | ||
| 2606 | * An object for managing the user end of a NetIO queue. | ||
| 2607 | */ | ||
| 2608 | struct __netio_queue_user_impl_t; | ||
| 2609 | |||
| 2610 | #endif /* !__DOXYGEN__ */ | ||
| 2611 | |||
| 2612 | |||
| 2613 | /** A netio_queue_t describes a NetIO communications endpoint. | ||
| 2614 | * @ingroup setup | ||
| 2615 | */ | ||
| 2616 | typedef struct | ||
| 2617 | { | ||
| 2618 | #ifdef __DOXYGEN__ | ||
| 2619 | uint8_t opaque[8]; /**< This is an opaque structure. */ | ||
| 2620 | #else | ||
| 2621 | struct __netio_queue_impl_t* __system_part; /**< The system part. */ | ||
| 2622 | struct __netio_queue_user_impl_t* __user_part; /**< The user part. */ | ||
| 2623 | #ifdef _NETIO_PTHREAD | ||
| 2624 | _netio_percpu_mutex_t lock; /**< Queue lock. */ | ||
| 2625 | #endif | ||
| 2626 | #endif | ||
| 2627 | } | ||
| 2628 | netio_queue_t; | ||
| 2629 | |||
| 2630 | |||
| 2631 | /** | ||
| 2632 | * @brief Packet send context. | ||
| 2633 | * | ||
| 2634 | * @ingroup egress | ||
| 2635 | * | ||
| 2636 | * Packet send context for use with netio_send_packet_prepare and _commit. | ||
| 2637 | */ | ||
| 2638 | typedef struct | ||
| 2639 | { | ||
| 2640 | #ifdef __DOXYGEN__ | ||
| 2641 | uint8_t opaque[44]; /**< This is an opaque structure. */ | ||
| 2642 | #else | ||
| 2643 | uint8_t flags; /**< Defined below */ | ||
| 2644 | uint8_t datalen; /**< Number of valid words pointed to by data. */ | ||
| 2645 | uint32_t request[9]; /**< Request to be sent to the EPP or shim. Note | ||
| 2646 | that this is smaller than the 11-word maximum | ||
| 2647 | request size, since some constant values are | ||
| 2648 | not saved in the context. */ | ||
| 2649 | uint32_t *data; /**< Data to be sent to the EPP or shim via IDN. */ | ||
| 2650 | #endif | ||
| 2651 | } | ||
| 2652 | netio_send_pkt_context_t; | ||
| 2653 | |||
| 2654 | |||
| 2655 | #ifndef __DOXYGEN__ | ||
| 2656 | #define SEND_PKT_CTX_USE_EPP 1 /**< We're sending to an EPP. */ | ||
| 2657 | #define SEND_PKT_CTX_SEND_CSUM 2 /**< Request includes a checksum. */ | ||
| 2658 | #endif | ||
| 2659 | |||
| 2660 | /** | ||
| 2661 | * @brief Packet vector entry. | ||
| 2662 | * | ||
| 2663 | * @ingroup egress | ||
| 2664 | * | ||
| 2665 | * This data structure is used with netio_send_packet_vector() to send multiple | ||
| 2666 | * packets with one NetIO call. The structure should be initialized by | ||
| 2667 | * calling netio_pkt_vector_set(), rather than by setting the fields | ||
| 2668 | * directly. | ||
| 2669 | * | ||
| 2670 | * This structure is guaranteed to be a power of two in size, no | ||
| 2671 | * bigger than one L2 cache line, and to be aligned modulo its size. | ||
| 2672 | */ | ||
| 2673 | typedef struct | ||
| 2674 | #ifndef __DOXYGEN__ | ||
| 2675 | __attribute__((aligned(8))) | ||
| 2676 | #endif | ||
| 2677 | { | ||
| 2678 | /** Reserved for use by the user application. When initialized with | ||
| 2679 | * the netio_set_pkt_vector_entry() function, this field is guaranteed | ||
| 2680 | * to be visible to readers only after all other fields are already | ||
| 2681 | * visible. This way it can be used as a valid flag or generation | ||
| 2682 | * counter. */ | ||
| 2683 | uint8_t user_data; | ||
| 2684 | |||
| 2685 | /* Structure members below this point should not be accessed directly by | ||
| 2686 | * applications, as they may change in the future. */ | ||
| 2687 | |||
| 2688 | /** Low 8 bits of the packet address to send. The high bits are | ||
| 2689 | * acquired from the 'handle' field. */ | ||
| 2690 | uint8_t buffer_address_low; | ||
| 2691 | |||
| 2692 | /** Number of bytes to transmit. */ | ||
| 2693 | uint16_t size; | ||
| 2694 | |||
| 2695 | /** The raw handle from a netio_pkt_t. If this is NETIO_PKT_HANDLE_NONE, | ||
| 2696 | * this vector entry will be skipped and no packet will be transmitted. */ | ||
| 2697 | netio_pkt_handle_t handle; | ||
| 2698 | } | ||
| 2699 | netio_pkt_vector_entry_t; | ||
| 2700 | |||
| 2701 | |||
| 2702 | /** | ||
| 2703 | * @brief Initialize fields in a packet vector entry. | ||
| 2704 | * | ||
| 2705 | * @ingroup egress | ||
| 2706 | * | ||
| 2707 | * @param[out] v Pointer to the vector entry to be initialized. | ||
| 2708 | * @param[in] pkt Packet to be transmitted when the vector entry is passed to | ||
| 2709 | * netio_send_packet_vector(). Note that the packet's attributes | ||
| 2710 | * (e.g., its L2 offset and length) are captured at the time this | ||
| 2711 | * routine is called; subsequent changes in those attributes will not | ||
| 2712 | * be reflected in the packet which is actually transmitted. | ||
| 2713 | * Changes in the packet's contents, however, will be so reflected. | ||
| 2714 | * If this is NULL, no packet will be transmitted. | ||
| 2715 | * @param[in] user_data User data to be set in the vector entry. | ||
| 2716 | * This function guarantees that the "user_data" field will become | ||
| 2717 | * visible to a reader only after all other fields have become visible. | ||
| 2718 | * This allows a structure in a ring buffer to be written and read | ||
| 2719 | * by a polling reader without any locks or other synchronization. | ||
| 2720 | */ | ||
| 2721 | static __inline void | ||
| 2722 | netio_pkt_vector_set(volatile netio_pkt_vector_entry_t* v, netio_pkt_t* pkt, | ||
| 2723 | uint8_t user_data) | ||
| 2724 | { | ||
| 2725 | if (pkt) | ||
| 2726 | { | ||
| 2727 | if (NETIO_PKT_IS_MINIMAL(pkt)) | ||
| 2728 | { | ||
| 2729 | netio_pkt_minimal_metadata_t* mmd = | ||
| 2730 | (netio_pkt_minimal_metadata_t*) &pkt->__metadata; | ||
| 2731 | v->buffer_address_low = (uintptr_t) NETIO_PKT_L2_DATA_MM(mmd, pkt) & 0xFF; | ||
| 2732 | v->size = NETIO_PKT_L2_LENGTH_MM(mmd, pkt); | ||
| 2733 | } | ||
| 2734 | else | ||
| 2735 | { | ||
| 2736 | netio_pkt_metadata_t* mda = &pkt->__metadata; | ||
| 2737 | v->buffer_address_low = (uintptr_t) NETIO_PKT_L2_DATA_M(mda, pkt) & 0xFF; | ||
| 2738 | v->size = NETIO_PKT_L2_LENGTH_M(mda, pkt); | ||
| 2739 | } | ||
| 2740 | v->handle.word = pkt->__packet.word; | ||
| 2741 | } | ||
| 2742 | else | ||
| 2743 | { | ||
| 2744 | v->handle.word = 0; /* Set handle to NETIO_PKT_HANDLE_NONE. */ | ||
| 2745 | } | ||
| 2746 | |||
| 2747 | __asm__("" : : : "memory"); | ||
| 2748 | |||
| 2749 | v->user_data = user_data; | ||
| 2750 | } | ||
| 2751 | |||
| 2752 | |||
| 2753 | /** | ||
| 2754 | * Flags and structures for @ref netio_get() and @ref netio_set(). | ||
| 2755 | * @ingroup config | ||
| 2756 | */ | ||
| 2757 | |||
| 2758 | /** @{ */ | ||
| 2759 | /** Parameter class; addr is a NETIO_PARAM_xxx value. */ | ||
| 2760 | #define NETIO_PARAM 0 | ||
| 2761 | /** Interface MAC address. This address is only valid with @ref netio_get(). | ||
| 2762 | * The value is a 6-byte MAC address. Depending upon the overall system | ||
| 2763 | * design, a MAC address may or may not be available for each interface. */ | ||
| 2764 | #define NETIO_PARAM_MAC 0 | ||
| 2765 | |||
| 2766 | /** Determine whether to suspend output on the receipt of pause frames. | ||
| 2767 | * If the value is nonzero, the I/O shim will suspend output when a pause | ||
| 2768 | * frame is received. If the value is zero, pause frames will be ignored. */ | ||
| 2769 | #define NETIO_PARAM_PAUSE_IN 1 | ||
| 2770 | |||
| 2771 | /** Determine whether to send pause frames if the I/O shim packet FIFOs are | ||
| 2772 | * nearly full. If the value is zero, pause frames are not sent. If | ||
| 2773 | * the value is nonzero, it is the delay value which will be sent in any | ||
| 2774 | * pause frames which are output, in units of 512 bit times. */ | ||
| 2775 | #define NETIO_PARAM_PAUSE_OUT 2 | ||
| 2776 | |||
| 2777 | /** Jumbo frame support. The value is a 4-byte integer. If the value is | ||
| 2778 | * nonzero, the MAC will accept frames of up to 10240 bytes. If the value | ||
| 2779 | * is zero, the MAC will only accept frames of up to 1544 bytes. */ | ||
| 2780 | #define NETIO_PARAM_JUMBO 3 | ||
| 2781 | |||
| 2782 | /** I/O shim's overflow statistics register. The value is two 16-bit integers. | ||
| 2783 | * The first 16-bit value (or the low 16 bits, if the value is treated as a | ||
| 2784 | * 32-bit number) is the count of packets which were completely dropped and | ||
| 2785 | * not delivered by the shim. The second 16-bit value (or the high 16 bits, | ||
| 2786 | * if the value is treated as a 32-bit number) is the count of packets | ||
| 2787 | * which were truncated and thus only partially delivered by the shim. This | ||
| 2788 | * register is automatically reset to zero after it has been read. | ||
| 2789 | */ | ||
| 2790 | #define NETIO_PARAM_OVERFLOW 4 | ||
| 2791 | |||
| 2792 | /** IPP statistics. This address is only valid with @ref netio_get(). The | ||
| 2793 | * value is a netio_stat_t structure. Unlike the I/O shim statistics, the | ||
| 2794 | * IPP statistics are not all reset to zero on read; see the description | ||
| 2795 | * of the netio_stat_t for details. */ | ||
| 2796 | #define NETIO_PARAM_STAT 5 | ||
| 2797 | |||
| 2798 | /** Possible link state. The value is a combination of "NETIO_LINK_xxx" | ||
| 2799 | * flags. With @ref netio_get(), this will indicate which flags are | ||
| 2800 | * actually supported by the hardware. | ||
| 2801 | * | ||
| 2802 | * For historical reasons, specifying this value to netio_set() will have | ||
| 2803 | * the same behavior as using ::NETIO_PARAM_LINK_CONFIG, but this usage is | ||
| 2804 | * discouraged. | ||
| 2805 | */ | ||
| 2806 | #define NETIO_PARAM_LINK_POSSIBLE_STATE 6 | ||
| 2807 | |||
| 2808 | /** Link configuration. The value is a combination of "NETIO_LINK_xxx" flags. | ||
| 2809 | * With @ref netio_set(), this will attempt to immediately bring up the | ||
| 2810 | * link using whichever of the requested flags are supported by the | ||
| 2811 | * hardware, or take down the link if the flags are zero; if this is | ||
| 2812 | * not possible, an error will be returned. Many programs will want | ||
| 2813 | * to use ::NETIO_PARAM_LINK_DESIRED_STATE instead. | ||
| 2814 | * | ||
| 2815 | * For historical reasons, specifying this value to netio_get() will | ||
| 2816 | * have the same behavior as using ::NETIO_PARAM_LINK_POSSIBLE_STATE, | ||
| 2817 | * but this usage is discouraged. | ||
| 2818 | */ | ||
| 2819 | #define NETIO_PARAM_LINK_CONFIG NETIO_PARAM_LINK_POSSIBLE_STATE | ||
| 2820 | |||
| 2821 | /** Current link state. This address is only valid with @ref netio_get(). | ||
| 2822 | * The value is zero or more of the "NETIO_LINK_xxx" flags, ORed together. | ||
| 2823 | * If the link is down, the value ANDed with NETIO_LINK_SPEED will be | ||
| 2824 | * zero; if the link is up, the value ANDed with NETIO_LINK_SPEED will | ||
| 2825 | * result in exactly one of the NETIO_LINK_xxx values, indicating the | ||
| 2826 | * current speed. */ | ||
| 2827 | #define NETIO_PARAM_LINK_CURRENT_STATE 7 | ||
| 2828 | |||
| 2829 | /** Variant symbol for current state, retained for compatibility with | ||
| 2830 | * pre-MDE-2.1 programs. */ | ||
| 2831 | #define NETIO_PARAM_LINK_STATUS NETIO_PARAM_LINK_CURRENT_STATE | ||
| 2832 | |||
| 2833 | /** Packet Coherence protocol. This address is only valid with @ref netio_get(). | ||
| 2834 | * The value is nonzero if the interface is configured for cache-coherent DMA. | ||
| 2835 | */ | ||
| 2836 | #define NETIO_PARAM_COHERENT 8 | ||
| 2837 | |||
| 2838 | /** Desired link state. The value is a conbination of "NETIO_LINK_xxx" | ||
| 2839 | * flags, which specify the desired state for the link. With @ref | ||
| 2840 | * netio_set(), this will, in the background, attempt to bring up the link | ||
| 2841 | * using whichever of the requested flags are reasonable, or take down the | ||
| 2842 | * link if the flags are zero. The actual link up or down operation may | ||
| 2843 | * happen after this call completes. If the link state changes in the | ||
| 2844 | * future, the system will continue to try to get back to the desired link | ||
| 2845 | * state; for instance, if the link is brought up successfully, and then | ||
| 2846 | * the network cable is disconnected, the link will go down. However, the | ||
| 2847 | * desired state of the link is still up, so if the cable is reconnected, | ||
| 2848 | * the link will be brought up again. | ||
| 2849 | * | ||
| 2850 | * With @ref netio_get(), this will indicate the desired state for the | ||
| 2851 | * link, as set with a previous netio_set() call, or implicitly by a | ||
| 2852 | * netio_input_register() or netio_input_unregister() operation. This may | ||
| 2853 | * not reflect the current state of the link; to get that, use | ||
| 2854 | * ::NETIO_PARAM_LINK_CURRENT_STATE. */ | ||
| 2855 | #define NETIO_PARAM_LINK_DESIRED_STATE 9 | ||
| 2856 | |||
| 2857 | /** NetIO statistics structure. Retrieved using the ::NETIO_PARAM_STAT | ||
| 2858 | * address passed to @ref netio_get(). */ | ||
| 2859 | typedef struct | ||
| 2860 | { | ||
| 2861 | /** Number of packets which have been received by the IPP and forwarded | ||
| 2862 | * to a tile's receive queue for processing. This value wraps at its | ||
| 2863 | * maximum, and is not cleared upon read. */ | ||
| 2864 | uint32_t packets_received; | ||
| 2865 | |||
| 2866 | /** Number of packets which have been dropped by the IPP, because they could | ||
| 2867 | * not be received, or could not be forwarded to a tile. The former happens | ||
| 2868 | * when the IPP does not have a free packet buffer of suitable size for an | ||
| 2869 | * incoming frame. The latter happens when all potential destination tiles | ||
| 2870 | * for a packet, as defined by the group, bucket, and queue configuration, | ||
| 2871 | * have full receive queues. This value wraps at its maximum, and is not | ||
| 2872 | * cleared upon read. */ | ||
| 2873 | uint32_t packets_dropped; | ||
| 2874 | |||
| 2875 | /* | ||
| 2876 | * Note: the #defines after each of the following four one-byte values | ||
| 2877 | * denote their location within the third word of the netio_stat_t. They | ||
| 2878 | * are intended for use only by the IPP implementation and are thus omitted | ||
| 2879 | * from the Doxygen output. | ||
| 2880 | */ | ||
| 2881 | |||
| 2882 | /** Number of packets dropped because no worker was able to accept a new | ||
| 2883 | * packet. This value saturates at its maximum, and is cleared upon | ||
| 2884 | * read. */ | ||
| 2885 | uint8_t drops_no_worker; | ||
| 2886 | #ifndef __DOXYGEN__ | ||
| 2887 | #define NETIO_STAT_DROPS_NO_WORKER 0 | ||
| 2888 | #endif | ||
| 2889 | |||
| 2890 | /** Number of packets dropped because no small buffers were available. | ||
| 2891 | * This value saturates at its maximum, and is cleared upon read. */ | ||
| 2892 | uint8_t drops_no_smallbuf; | ||
| 2893 | #ifndef __DOXYGEN__ | ||
| 2894 | #define NETIO_STAT_DROPS_NO_SMALLBUF 1 | ||
| 2895 | #endif | ||
| 2896 | |||
| 2897 | /** Number of packets dropped because no large buffers were available. | ||
| 2898 | * This value saturates at its maximum, and is cleared upon read. */ | ||
| 2899 | uint8_t drops_no_largebuf; | ||
| 2900 | #ifndef __DOXYGEN__ | ||
| 2901 | #define NETIO_STAT_DROPS_NO_LARGEBUF 2 | ||
| 2902 | #endif | ||
| 2903 | |||
| 2904 | /** Number of packets dropped because no jumbo buffers were available. | ||
| 2905 | * This value saturates at its maximum, and is cleared upon read. */ | ||
| 2906 | uint8_t drops_no_jumbobuf; | ||
| 2907 | #ifndef __DOXYGEN__ | ||
| 2908 | #define NETIO_STAT_DROPS_NO_JUMBOBUF 3 | ||
| 2909 | #endif | ||
| 2910 | } | ||
| 2911 | netio_stat_t; | ||
| 2912 | |||
| 2913 | |||
| 2914 | /** Link can run, should run, or is running at 10 Mbps. */ | ||
| 2915 | #define NETIO_LINK_10M 0x01 | ||
| 2916 | |||
| 2917 | /** Link can run, should run, or is running at 100 Mbps. */ | ||
| 2918 | #define NETIO_LINK_100M 0x02 | ||
| 2919 | |||
| 2920 | /** Link can run, should run, or is running at 1 Gbps. */ | ||
| 2921 | #define NETIO_LINK_1G 0x04 | ||
| 2922 | |||
| 2923 | /** Link can run, should run, or is running at 10 Gbps. */ | ||
| 2924 | #define NETIO_LINK_10G 0x08 | ||
| 2925 | |||
| 2926 | /** Link should run at the highest speed supported by the link and by | ||
| 2927 | * the device connected to the link. Only usable as a value for | ||
| 2928 | * the link's desired state; never returned as a value for the current | ||
| 2929 | * or possible states. */ | ||
| 2930 | #define NETIO_LINK_ANYSPEED 0x10 | ||
| 2931 | |||
| 2932 | /** All legal link speeds. */ | ||
| 2933 | #define NETIO_LINK_SPEED (NETIO_LINK_10M | \ | ||
| 2934 | NETIO_LINK_100M | \ | ||
| 2935 | NETIO_LINK_1G | \ | ||
| 2936 | NETIO_LINK_10G | \ | ||
| 2937 | NETIO_LINK_ANYSPEED) | ||
| 2938 | |||
| 2939 | |||
| 2940 | /** MAC register class. Addr is a register offset within the MAC. | ||
| 2941 | * Registers within the XGbE and GbE MACs are documented in the Tile | ||
| 2942 | * Processor I/O Device Guide (UG104). MAC registers start at address | ||
| 2943 | * 0x4000, and do not include the MAC_INTERFACE registers. */ | ||
| 2944 | #define NETIO_MAC 1 | ||
| 2945 | |||
| 2946 | /** MDIO register class (IEEE 802.3 clause 22 format). Addr is the "addr" | ||
| 2947 | * member of a netio_mdio_addr_t structure. */ | ||
| 2948 | #define NETIO_MDIO 2 | ||
| 2949 | |||
| 2950 | /** MDIO register class (IEEE 802.3 clause 45 format). Addr is the "addr" | ||
| 2951 | * member of a netio_mdio_addr_t structure. */ | ||
| 2952 | #define NETIO_MDIO_CLAUSE45 3 | ||
| 2953 | |||
| 2954 | /** NetIO MDIO address type. Retrieved or provided using the ::NETIO_MDIO | ||
| 2955 | * address passed to @ref netio_get() or @ref netio_set(). */ | ||
| 2956 | typedef union | ||
| 2957 | { | ||
| 2958 | struct | ||
| 2959 | { | ||
| 2960 | unsigned int reg:16; /**< MDIO register offset. For clause 22 access, | ||
| 2961 | must be less than 32. */ | ||
| 2962 | unsigned int phy:5; /**< Which MDIO PHY to access. */ | ||
| 2963 | unsigned int dev:5; /**< Which MDIO device to access within that PHY. | ||
| 2964 | Applicable for clause 45 access only; ignored | ||
| 2965 | for clause 22 access. */ | ||
| 2966 | } | ||
| 2967 | bits; /**< Container for bitfields. */ | ||
| 2968 | uint64_t addr; /**< Value to pass to @ref netio_get() or | ||
| 2969 | * @ref netio_set(). */ | ||
| 2970 | } | ||
| 2971 | netio_mdio_addr_t; | ||
| 2972 | |||
| 2973 | /** @} */ | ||
| 2974 | |||
| 2975 | #endif /* __NETIO_INTF_H__ */ | ||
diff --git a/arch/tile/kernel/Makefile b/arch/tile/kernel/Makefile index 112b1e248f05..b4c8e8ec45dc 100644 --- a/arch/tile/kernel/Makefile +++ b/arch/tile/kernel/Makefile | |||
| @@ -15,3 +15,4 @@ obj-$(CONFIG_SMP) += smpboot.o smp.o tlb.o | |||
| 15 | obj-$(CONFIG_MODULES) += module.o | 15 | obj-$(CONFIG_MODULES) += module.o |
| 16 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 16 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
| 17 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | 17 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o |
| 18 | obj-$(CONFIG_PCI) += pci.o | ||
diff --git a/arch/tile/kernel/compat.c b/arch/tile/kernel/compat.c index 77739cdd9462..dbc213adf5e1 100644 --- a/arch/tile/kernel/compat.c +++ b/arch/tile/kernel/compat.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/kdev_t.h> | 21 | #include <linux/kdev_t.h> |
| 22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
| 23 | #include <linux/fcntl.h> | 23 | #include <linux/fcntl.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/uaccess.h> | 24 | #include <linux/uaccess.h> |
| 26 | #include <linux/signal.h> | 25 | #include <linux/signal.h> |
| 27 | #include <asm/syscalls.h> | 26 | #include <asm/syscalls.h> |
| @@ -148,11 +147,11 @@ long tile_compat_sys_msgrcv(int msqid, | |||
| 148 | #define compat_sys_readahead sys32_readahead | 147 | #define compat_sys_readahead sys32_readahead |
| 149 | #define compat_sys_sync_file_range compat_sys_sync_file_range2 | 148 | #define compat_sys_sync_file_range compat_sys_sync_file_range2 |
| 150 | 149 | ||
| 151 | /* The native 64-bit "struct stat" matches the 32-bit "struct stat64". */ | 150 | /* We leverage the "struct stat64" type for 32-bit time_t/nsec. */ |
| 152 | #define compat_sys_stat64 sys_newstat | 151 | #define compat_sys_stat64 sys_stat64 |
| 153 | #define compat_sys_lstat64 sys_newlstat | 152 | #define compat_sys_lstat64 sys_lstat64 |
| 154 | #define compat_sys_fstat64 sys_newfstat | 153 | #define compat_sys_fstat64 sys_fstat64 |
| 155 | #define compat_sys_fstatat64 sys_newfstatat | 154 | #define compat_sys_fstatat64 sys_fstatat64 |
| 156 | 155 | ||
| 157 | /* The native sys_ptrace dynamically handles compat binaries. */ | 156 | /* The native sys_ptrace dynamically handles compat binaries. */ |
| 158 | #define compat_sys_ptrace sys_ptrace | 157 | #define compat_sys_ptrace sys_ptrace |
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index fb64b99959d4..543d6a33aa26 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
| 16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
| 17 | #include <linux/smp.h> | 17 | #include <linux/smp.h> |
| 18 | #include <linux/smp_lock.h> | ||
| 19 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 20 | #include <linux/signal.h> | 19 | #include <linux/signal.h> |
| 21 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
diff --git a/arch/tile/kernel/early_printk.c b/arch/tile/kernel/early_printk.c index 2c54fd43a8a0..493a0e66d916 100644 --- a/arch/tile/kernel/early_printk.c +++ b/arch/tile/kernel/early_printk.c | |||
| @@ -54,7 +54,7 @@ void early_printk(const char *fmt, ...) | |||
| 54 | void early_panic(const char *fmt, ...) | 54 | void early_panic(const char *fmt, ...) |
| 55 | { | 55 | { |
| 56 | va_list ap; | 56 | va_list ap; |
| 57 | raw_local_irq_disable_all(); | 57 | arch_local_irq_disable_all(); |
| 58 | va_start(ap, fmt); | 58 | va_start(ap, fmt); |
| 59 | early_printk("Kernel panic - not syncing: "); | 59 | early_printk("Kernel panic - not syncing: "); |
| 60 | early_vprintk(fmt, ap); | 60 | early_vprintk(fmt, ap); |
diff --git a/arch/tile/kernel/hardwall.c b/arch/tile/kernel/hardwall.c index 1e54a7843410..e910530436e6 100644 --- a/arch/tile/kernel/hardwall.c +++ b/arch/tile/kernel/hardwall.c | |||
| @@ -151,12 +151,12 @@ enum direction_protect { | |||
| 151 | 151 | ||
| 152 | static void enable_firewall_interrupts(void) | 152 | static void enable_firewall_interrupts(void) |
| 153 | { | 153 | { |
| 154 | raw_local_irq_unmask_now(INT_UDN_FIREWALL); | 154 | arch_local_irq_unmask_now(INT_UDN_FIREWALL); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | static void disable_firewall_interrupts(void) | 157 | static void disable_firewall_interrupts(void) |
| 158 | { | 158 | { |
| 159 | raw_local_irq_mask_now(INT_UDN_FIREWALL); | 159 | arch_local_irq_mask_now(INT_UDN_FIREWALL); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | /* Set up hardwall on this cpu based on the passed hardwall_info. */ | 162 | /* Set up hardwall on this cpu based on the passed hardwall_info. */ |
| @@ -768,13 +768,13 @@ static int hardwall_release(struct inode *inode, struct file *file) | |||
| 768 | } | 768 | } |
| 769 | 769 | ||
| 770 | static const struct file_operations dev_hardwall_fops = { | 770 | static const struct file_operations dev_hardwall_fops = { |
| 771 | .open = nonseekable_open, | ||
| 771 | .unlocked_ioctl = hardwall_ioctl, | 772 | .unlocked_ioctl = hardwall_ioctl, |
| 772 | #ifdef CONFIG_COMPAT | 773 | #ifdef CONFIG_COMPAT |
| 773 | .compat_ioctl = hardwall_compat_ioctl, | 774 | .compat_ioctl = hardwall_compat_ioctl, |
| 774 | #endif | 775 | #endif |
| 775 | .flush = hardwall_flush, | 776 | .flush = hardwall_flush, |
| 776 | .release = hardwall_release, | 777 | .release = hardwall_release, |
| 777 | .llseek = noop_llseek, | ||
| 778 | }; | 778 | }; |
| 779 | 779 | ||
| 780 | static struct cdev hardwall_dev; | 780 | static struct cdev hardwall_dev; |
diff --git a/arch/tile/kernel/irq.c b/arch/tile/kernel/irq.c index e63917687e99..128805ef8f2c 100644 --- a/arch/tile/kernel/irq.c +++ b/arch/tile/kernel/irq.c | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | #define IS_HW_CLEARED 1 | 26 | #define IS_HW_CLEARED 1 |
| 27 | 27 | ||
| 28 | /* | 28 | /* |
| 29 | * The set of interrupts we enable for raw_local_irq_enable(). | 29 | * The set of interrupts we enable for arch_local_irq_enable(). |
| 30 | * This is initialized to have just a single interrupt that the kernel | 30 | * This is initialized to have just a single interrupt that the kernel |
| 31 | * doesn't actually use as a sentinel. During kernel init, | 31 | * doesn't actually use as a sentinel. During kernel init, |
| 32 | * interrupts are added as the kernel gets prepared to support them. | 32 | * interrupts are added as the kernel gets prepared to support them. |
| @@ -225,7 +225,7 @@ void __cpuinit setup_irq_regs(void) | |||
| 225 | /* Enable interrupt delivery. */ | 225 | /* Enable interrupt delivery. */ |
| 226 | unmask_irqs(~0UL); | 226 | unmask_irqs(~0UL); |
| 227 | #if CHIP_HAS_IPI() | 227 | #if CHIP_HAS_IPI() |
| 228 | raw_local_irq_unmask(INT_IPI_K); | 228 | arch_local_irq_unmask(INT_IPI_K); |
| 229 | #endif | 229 | #endif |
| 230 | } | 230 | } |
| 231 | 231 | ||
diff --git a/arch/tile/kernel/machine_kexec.c b/arch/tile/kernel/machine_kexec.c index ba7a265d6179..0d8b9e933487 100644 --- a/arch/tile/kernel/machine_kexec.c +++ b/arch/tile/kernel/machine_kexec.c | |||
| @@ -182,13 +182,13 @@ static void kexec_find_and_set_command_line(struct kimage *image) | |||
| 182 | 182 | ||
| 183 | if ((entry & IND_SOURCE)) { | 183 | if ((entry & IND_SOURCE)) { |
| 184 | void *va = | 184 | void *va = |
| 185 | kmap_atomic_pfn(entry >> PAGE_SHIFT, KM_USER0); | 185 | kmap_atomic_pfn(entry >> PAGE_SHIFT); |
| 186 | r = kexec_bn2cl(va); | 186 | r = kexec_bn2cl(va); |
| 187 | if (r) { | 187 | if (r) { |
| 188 | command_line = r; | 188 | command_line = r; |
| 189 | break; | 189 | break; |
| 190 | } | 190 | } |
| 191 | kunmap_atomic(va, KM_USER0); | 191 | kunmap_atomic(va); |
| 192 | } | 192 | } |
| 193 | } | 193 | } |
| 194 | 194 | ||
| @@ -198,7 +198,7 @@ static void kexec_find_and_set_command_line(struct kimage *image) | |||
| 198 | 198 | ||
| 199 | hverr = hv_set_command_line( | 199 | hverr = hv_set_command_line( |
| 200 | (HV_VirtAddr) command_line, strlen(command_line)); | 200 | (HV_VirtAddr) command_line, strlen(command_line)); |
| 201 | kunmap_atomic(command_line, KM_USER0); | 201 | kunmap_atomic(command_line); |
| 202 | } else { | 202 | } else { |
| 203 | pr_info("%s: no command line found; making empty\n", | 203 | pr_info("%s: no command line found; making empty\n", |
| 204 | __func__); | 204 | __func__); |
diff --git a/arch/tile/kernel/messaging.c b/arch/tile/kernel/messaging.c index 997e3933f726..0858ee6b520f 100644 --- a/arch/tile/kernel/messaging.c +++ b/arch/tile/kernel/messaging.c | |||
| @@ -34,7 +34,7 @@ void __cpuinit init_messaging(void) | |||
| 34 | panic("hv_register_message_state: error %d", rc); | 34 | panic("hv_register_message_state: error %d", rc); |
| 35 | 35 | ||
| 36 | /* Make sure downcall interrupts will be enabled. */ | 36 | /* Make sure downcall interrupts will be enabled. */ |
| 37 | raw_local_irq_unmask(INT_INTCTRL_K); | 37 | arch_local_irq_unmask(INT_INTCTRL_K); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void hv_message_intr(struct pt_regs *regs, int intnum) | 40 | void hv_message_intr(struct pt_regs *regs, int intnum) |
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c new file mode 100644 index 000000000000..a1ee25be9ad9 --- /dev/null +++ b/arch/tile/kernel/pci.c | |||
| @@ -0,0 +1,621 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or | ||
| 5 | * modify it under the terms of the GNU General Public License | ||
| 6 | * as published by the Free Software Foundation, version 2. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
| 11 | * NON INFRINGEMENT. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #include <linux/kernel.h> | ||
| 16 | #include <linux/pci.h> | ||
| 17 | #include <linux/delay.h> | ||
| 18 | #include <linux/string.h> | ||
| 19 | #include <linux/init.h> | ||
| 20 | #include <linux/capability.h> | ||
| 21 | #include <linux/sched.h> | ||
| 22 | #include <linux/errno.h> | ||
| 23 | #include <linux/bootmem.h> | ||
| 24 | #include <linux/irq.h> | ||
| 25 | #include <linux/io.h> | ||
| 26 | #include <linux/uaccess.h> | ||
| 27 | |||
| 28 | #include <asm/processor.h> | ||
| 29 | #include <asm/sections.h> | ||
| 30 | #include <asm/byteorder.h> | ||
| 31 | #include <asm/hv_driver.h> | ||
| 32 | #include <hv/drv_pcie_rc_intf.h> | ||
| 33 | |||
| 34 | |||
| 35 | /* | ||
| 36 | * Initialization flow and process | ||
| 37 | * ------------------------------- | ||
| 38 | * | ||
| 39 | * This files containes the routines to search for PCI buses, | ||
| 40 | * enumerate the buses, and configure any attached devices. | ||
| 41 | * | ||
| 42 | * There are two entry points here: | ||
| 43 | * 1) tile_pci_init | ||
| 44 | * This sets up the pci_controller structs, and opens the | ||
| 45 | * FDs to the hypervisor. This is called from setup_arch() early | ||
| 46 | * in the boot process. | ||
| 47 | * 2) pcibios_init | ||
| 48 | * This probes the PCI bus(es) for any attached hardware. It's | ||
| 49 | * called by subsys_initcall. All of the real work is done by the | ||
| 50 | * generic Linux PCI layer. | ||
| 51 | * | ||
| 52 | */ | ||
| 53 | |||
| 54 | /* | ||
| 55 | * This flag tells if the platform is TILEmpower that needs | ||
| 56 | * special configuration for the PLX switch chip. | ||
| 57 | */ | ||
| 58 | int __write_once tile_plx_gen1; | ||
| 59 | |||
| 60 | static struct pci_controller controllers[TILE_NUM_PCIE]; | ||
| 61 | static int num_controllers; | ||
| 62 | |||
| 63 | static struct pci_ops tile_cfg_ops; | ||
| 64 | |||
| 65 | |||
| 66 | /* | ||
| 67 | * We don't need to worry about the alignment of resources. | ||
| 68 | */ | ||
| 69 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
| 70 | resource_size_t size, resource_size_t align) | ||
| 71 | { | ||
| 72 | return res->start; | ||
| 73 | } | ||
| 74 | EXPORT_SYMBOL(pcibios_align_resource); | ||
| 75 | |||
| 76 | /* | ||
| 77 | * Open a FD to the hypervisor PCI device. | ||
| 78 | * | ||
| 79 | * controller_id is the controller number, config type is 0 or 1 for | ||
| 80 | * config0 or config1 operations. | ||
| 81 | */ | ||
| 82 | static int __init tile_pcie_open(int controller_id, int config_type) | ||
| 83 | { | ||
| 84 | char filename[32]; | ||
| 85 | int fd; | ||
| 86 | |||
| 87 | sprintf(filename, "pcie/%d/config%d", controller_id, config_type); | ||
| 88 | |||
| 89 | fd = hv_dev_open((HV_VirtAddr)filename, 0); | ||
| 90 | |||
| 91 | return fd; | ||
| 92 | } | ||
| 93 | |||
| 94 | |||
| 95 | /* | ||
| 96 | * Get the IRQ numbers from the HV and set up the handlers for them. | ||
| 97 | */ | ||
| 98 | static int __init tile_init_irqs(int controller_id, | ||
| 99 | struct pci_controller *controller) | ||
| 100 | { | ||
| 101 | char filename[32]; | ||
| 102 | int fd; | ||
| 103 | int ret; | ||
| 104 | int x; | ||
| 105 | struct pcie_rc_config rc_config; | ||
| 106 | |||
| 107 | sprintf(filename, "pcie/%d/ctl", controller_id); | ||
| 108 | fd = hv_dev_open((HV_VirtAddr)filename, 0); | ||
| 109 | if (fd < 0) { | ||
| 110 | pr_err("PCI: hv_dev_open(%s) failed\n", filename); | ||
| 111 | return -1; | ||
| 112 | } | ||
| 113 | ret = hv_dev_pread(fd, 0, (HV_VirtAddr)(&rc_config), | ||
| 114 | sizeof(rc_config), PCIE_RC_CONFIG_MASK_OFF); | ||
| 115 | hv_dev_close(fd); | ||
| 116 | if (ret != sizeof(rc_config)) { | ||
| 117 | pr_err("PCI: wanted %zd bytes, got %d\n", | ||
| 118 | sizeof(rc_config), ret); | ||
| 119 | return -1; | ||
| 120 | } | ||
| 121 | /* Record irq_base so that we can map INTx to IRQ # later. */ | ||
| 122 | controller->irq_base = rc_config.intr; | ||
| 123 | |||
| 124 | for (x = 0; x < 4; x++) | ||
| 125 | tile_irq_activate(rc_config.intr + x, | ||
| 126 | TILE_IRQ_HW_CLEAR); | ||
| 127 | |||
| 128 | if (rc_config.plx_gen1) | ||
| 129 | controller->plx_gen1 = 1; | ||
| 130 | |||
| 131 | return 0; | ||
| 132 | } | ||
| 133 | |||
| 134 | /* | ||
| 135 | * First initialization entry point, called from setup_arch(). | ||
| 136 | * | ||
| 137 | * Find valid controllers and fill in pci_controller structs for each | ||
| 138 | * of them. | ||
| 139 | * | ||
| 140 | * Returns the number of controllers discovered. | ||
| 141 | */ | ||
| 142 | int __init tile_pci_init(void) | ||
| 143 | { | ||
| 144 | int i; | ||
| 145 | |||
| 146 | pr_info("PCI: Searching for controllers...\n"); | ||
| 147 | |||
| 148 | /* Do any configuration we need before using the PCIe */ | ||
| 149 | |||
| 150 | for (i = 0; i < TILE_NUM_PCIE; i++) { | ||
| 151 | int hv_cfg_fd0 = -1; | ||
| 152 | int hv_cfg_fd1 = -1; | ||
| 153 | int hv_mem_fd = -1; | ||
| 154 | char name[32]; | ||
| 155 | struct pci_controller *controller; | ||
| 156 | |||
| 157 | /* | ||
| 158 | * Open the fd to the HV. If it fails then this | ||
| 159 | * device doesn't exist. | ||
| 160 | */ | ||
| 161 | hv_cfg_fd0 = tile_pcie_open(i, 0); | ||
| 162 | if (hv_cfg_fd0 < 0) | ||
| 163 | continue; | ||
| 164 | hv_cfg_fd1 = tile_pcie_open(i, 1); | ||
| 165 | if (hv_cfg_fd1 < 0) { | ||
| 166 | pr_err("PCI: Couldn't open config fd to HV " | ||
| 167 | "for controller %d\n", i); | ||
| 168 | goto err_cont; | ||
| 169 | } | ||
| 170 | |||
| 171 | sprintf(name, "pcie/%d/mem", i); | ||
| 172 | hv_mem_fd = hv_dev_open((HV_VirtAddr)name, 0); | ||
| 173 | if (hv_mem_fd < 0) { | ||
| 174 | pr_err("PCI: Could not open mem fd to HV!\n"); | ||
| 175 | goto err_cont; | ||
| 176 | } | ||
| 177 | |||
| 178 | pr_info("PCI: Found PCI controller #%d\n", i); | ||
| 179 | |||
| 180 | controller = &controllers[num_controllers]; | ||
| 181 | |||
| 182 | if (tile_init_irqs(i, controller)) { | ||
| 183 | pr_err("PCI: Could not initialize " | ||
| 184 | "IRQs, aborting.\n"); | ||
| 185 | goto err_cont; | ||
| 186 | } | ||
| 187 | |||
| 188 | controller->index = num_controllers; | ||
| 189 | controller->hv_cfg_fd[0] = hv_cfg_fd0; | ||
| 190 | controller->hv_cfg_fd[1] = hv_cfg_fd1; | ||
| 191 | controller->hv_mem_fd = hv_mem_fd; | ||
| 192 | controller->first_busno = 0; | ||
| 193 | controller->last_busno = 0xff; | ||
| 194 | controller->ops = &tile_cfg_ops; | ||
| 195 | |||
| 196 | num_controllers++; | ||
| 197 | continue; | ||
| 198 | |||
| 199 | err_cont: | ||
| 200 | if (hv_cfg_fd0 >= 0) | ||
| 201 | hv_dev_close(hv_cfg_fd0); | ||
| 202 | if (hv_cfg_fd1 >= 0) | ||
| 203 | hv_dev_close(hv_cfg_fd1); | ||
| 204 | if (hv_mem_fd >= 0) | ||
| 205 | hv_dev_close(hv_mem_fd); | ||
| 206 | continue; | ||
| 207 | } | ||
| 208 | |||
| 209 | /* | ||
| 210 | * Before using the PCIe, see if we need to do any platform-specific | ||
| 211 | * configuration, such as the PLX switch Gen 1 issue on TILEmpower. | ||
| 212 | */ | ||
| 213 | for (i = 0; i < num_controllers; i++) { | ||
| 214 | struct pci_controller *controller = &controllers[i]; | ||
| 215 | |||
| 216 | if (controller->plx_gen1) | ||
| 217 | tile_plx_gen1 = 1; | ||
| 218 | } | ||
| 219 | |||
| 220 | return num_controllers; | ||
| 221 | } | ||
| 222 | |||
| 223 | /* | ||
| 224 | * (pin - 1) converts from the PCI standard's [1:4] convention to | ||
| 225 | * a normal [0:3] range. | ||
| 226 | */ | ||
| 227 | static int tile_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | ||
| 228 | { | ||
| 229 | struct pci_controller *controller = | ||
| 230 | (struct pci_controller *)dev->sysdata; | ||
| 231 | return (pin - 1) + controller->irq_base; | ||
| 232 | } | ||
| 233 | |||
| 234 | |||
| 235 | static void __init fixup_read_and_payload_sizes(void) | ||
| 236 | { | ||
| 237 | struct pci_dev *dev = NULL; | ||
| 238 | int smallest_max_payload = 0x1; /* Tile maxes out at 256 bytes. */ | ||
| 239 | int max_read_size = 0x2; /* Limit to 512 byte reads. */ | ||
| 240 | u16 new_values; | ||
| 241 | |||
| 242 | /* Scan for the smallest maximum payload size. */ | ||
| 243 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | ||
| 244 | int pcie_caps_offset; | ||
| 245 | u32 devcap; | ||
| 246 | int max_payload; | ||
| 247 | |||
| 248 | pcie_caps_offset = pci_find_capability(dev, PCI_CAP_ID_EXP); | ||
| 249 | if (pcie_caps_offset == 0) | ||
| 250 | continue; | ||
| 251 | |||
| 252 | pci_read_config_dword(dev, pcie_caps_offset + PCI_EXP_DEVCAP, | ||
| 253 | &devcap); | ||
| 254 | max_payload = devcap & PCI_EXP_DEVCAP_PAYLOAD; | ||
| 255 | if (max_payload < smallest_max_payload) | ||
| 256 | smallest_max_payload = max_payload; | ||
| 257 | } | ||
| 258 | |||
| 259 | /* Now, set the max_payload_size for all devices to that value. */ | ||
| 260 | new_values = (max_read_size << 12) | (smallest_max_payload << 5); | ||
| 261 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | ||
| 262 | int pcie_caps_offset; | ||
| 263 | u16 devctl; | ||
| 264 | |||
| 265 | pcie_caps_offset = pci_find_capability(dev, PCI_CAP_ID_EXP); | ||
| 266 | if (pcie_caps_offset == 0) | ||
| 267 | continue; | ||
| 268 | |||
| 269 | pci_read_config_word(dev, pcie_caps_offset + PCI_EXP_DEVCTL, | ||
| 270 | &devctl); | ||
| 271 | devctl &= ~(PCI_EXP_DEVCTL_PAYLOAD | PCI_EXP_DEVCTL_READRQ); | ||
| 272 | devctl |= new_values; | ||
| 273 | pci_write_config_word(dev, pcie_caps_offset + PCI_EXP_DEVCTL, | ||
| 274 | devctl); | ||
| 275 | } | ||
| 276 | } | ||
| 277 | |||
| 278 | |||
| 279 | /* | ||
| 280 | * Second PCI initialization entry point, called by subsys_initcall. | ||
| 281 | * | ||
| 282 | * The controllers have been set up by the time we get here, by a call to | ||
| 283 | * tile_pci_init. | ||
| 284 | */ | ||
| 285 | static int __init pcibios_init(void) | ||
| 286 | { | ||
| 287 | int i; | ||
| 288 | |||
| 289 | pr_info("PCI: Probing PCI hardware\n"); | ||
| 290 | |||
| 291 | /* | ||
| 292 | * Delay a bit in case devices aren't ready. Some devices are | ||
| 293 | * known to require at least 20ms here, but we use a more | ||
| 294 | * conservative value. | ||
| 295 | */ | ||
| 296 | mdelay(250); | ||
| 297 | |||
| 298 | /* Scan all of the recorded PCI controllers. */ | ||
| 299 | for (i = 0; i < num_controllers; i++) { | ||
| 300 | struct pci_controller *controller = &controllers[i]; | ||
| 301 | struct pci_bus *bus; | ||
| 302 | |||
| 303 | pr_info("PCI: initializing controller #%d\n", i); | ||
| 304 | |||
| 305 | /* | ||
| 306 | * This comes from the generic Linux PCI driver. | ||
| 307 | * | ||
| 308 | * It reads the PCI tree for this bus into the Linux | ||
| 309 | * data structures. | ||
| 310 | * | ||
| 311 | * This is inlined in linux/pci.h and calls into | ||
| 312 | * pci_scan_bus_parented() in probe.c. | ||
| 313 | */ | ||
| 314 | bus = pci_scan_bus(0, controller->ops, controller); | ||
| 315 | controller->root_bus = bus; | ||
| 316 | controller->last_busno = bus->subordinate; | ||
| 317 | |||
| 318 | } | ||
| 319 | |||
| 320 | /* Do machine dependent PCI interrupt routing */ | ||
| 321 | pci_fixup_irqs(pci_common_swizzle, tile_map_irq); | ||
| 322 | |||
| 323 | /* | ||
| 324 | * This comes from the generic Linux PCI driver. | ||
| 325 | * | ||
| 326 | * It allocates all of the resources (I/O memory, etc) | ||
| 327 | * associated with the devices read in above. | ||
| 328 | */ | ||
| 329 | |||
| 330 | pci_assign_unassigned_resources(); | ||
| 331 | |||
| 332 | /* Configure the max_read_size and max_payload_size values. */ | ||
| 333 | fixup_read_and_payload_sizes(); | ||
| 334 | |||
| 335 | /* Record the I/O resources in the PCI controller structure. */ | ||
| 336 | for (i = 0; i < num_controllers; i++) { | ||
| 337 | struct pci_bus *root_bus = controllers[i].root_bus; | ||
| 338 | struct pci_bus *next_bus; | ||
| 339 | struct pci_dev *dev; | ||
| 340 | |||
| 341 | list_for_each_entry(dev, &root_bus->devices, bus_list) { | ||
| 342 | /* Find the PCI host controller, ie. the 1st bridge. */ | ||
| 343 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && | ||
| 344 | (PCI_SLOT(dev->devfn) == 0)) { | ||
| 345 | next_bus = dev->subordinate; | ||
| 346 | controllers[i].mem_resources[0] = | ||
| 347 | *next_bus->resource[0]; | ||
| 348 | controllers[i].mem_resources[1] = | ||
| 349 | *next_bus->resource[1]; | ||
| 350 | controllers[i].mem_resources[2] = | ||
| 351 | *next_bus->resource[2]; | ||
| 352 | |||
| 353 | break; | ||
| 354 | } | ||
| 355 | } | ||
| 356 | |||
| 357 | } | ||
| 358 | |||
| 359 | return 0; | ||
| 360 | } | ||
| 361 | subsys_initcall(pcibios_init); | ||
| 362 | |||
| 363 | /* | ||
| 364 | * No bus fixups needed. | ||
| 365 | */ | ||
| 366 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | ||
| 367 | { | ||
| 368 | /* Nothing needs to be done. */ | ||
| 369 | } | ||
| 370 | |||
| 371 | /* | ||
| 372 | * This can be called from the generic PCI layer, but doesn't need to | ||
| 373 | * do anything. | ||
| 374 | */ | ||
| 375 | char __devinit *pcibios_setup(char *str) | ||
| 376 | { | ||
| 377 | /* Nothing needs to be done. */ | ||
| 378 | return str; | ||
| 379 | } | ||
| 380 | |||
| 381 | /* | ||
| 382 | * This is called from the generic Linux layer. | ||
| 383 | */ | ||
| 384 | void __init pcibios_update_irq(struct pci_dev *dev, int irq) | ||
| 385 | { | ||
| 386 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
| 387 | } | ||
| 388 | |||
| 389 | /* | ||
| 390 | * Enable memory and/or address decoding, as appropriate, for the | ||
| 391 | * device described by the 'dev' struct. | ||
| 392 | * | ||
| 393 | * This is called from the generic PCI layer, and can be called | ||
| 394 | * for bridges or endpoints. | ||
| 395 | */ | ||
| 396 | int pcibios_enable_device(struct pci_dev *dev, int mask) | ||
| 397 | { | ||
| 398 | u16 cmd, old_cmd; | ||
| 399 | u8 header_type; | ||
| 400 | int i; | ||
| 401 | struct resource *r; | ||
| 402 | |||
| 403 | pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); | ||
| 404 | |||
| 405 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
| 406 | old_cmd = cmd; | ||
| 407 | if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { | ||
| 408 | /* | ||
| 409 | * For bridges, we enable both memory and I/O decoding | ||
| 410 | * in call cases. | ||
| 411 | */ | ||
| 412 | cmd |= PCI_COMMAND_IO; | ||
| 413 | cmd |= PCI_COMMAND_MEMORY; | ||
| 414 | } else { | ||
| 415 | /* | ||
| 416 | * For endpoints, we enable memory and/or I/O decoding | ||
| 417 | * only if they have a memory resource of that type. | ||
| 418 | */ | ||
| 419 | for (i = 0; i < 6; i++) { | ||
| 420 | r = &dev->resource[i]; | ||
| 421 | if (r->flags & IORESOURCE_UNSET) { | ||
| 422 | pr_err("PCI: Device %s not available " | ||
| 423 | "because of resource collisions\n", | ||
| 424 | pci_name(dev)); | ||
| 425 | return -EINVAL; | ||
| 426 | } | ||
| 427 | if (r->flags & IORESOURCE_IO) | ||
| 428 | cmd |= PCI_COMMAND_IO; | ||
| 429 | if (r->flags & IORESOURCE_MEM) | ||
| 430 | cmd |= PCI_COMMAND_MEMORY; | ||
| 431 | } | ||
| 432 | } | ||
| 433 | |||
| 434 | /* | ||
| 435 | * We only write the command if it changed. | ||
| 436 | */ | ||
| 437 | if (cmd != old_cmd) | ||
| 438 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
| 439 | return 0; | ||
| 440 | } | ||
| 441 | |||
| 442 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) | ||
| 443 | { | ||
| 444 | unsigned long start = pci_resource_start(dev, bar); | ||
| 445 | unsigned long len = pci_resource_len(dev, bar); | ||
| 446 | unsigned long flags = pci_resource_flags(dev, bar); | ||
| 447 | |||
| 448 | if (!len) | ||
| 449 | return NULL; | ||
| 450 | if (max && len > max) | ||
| 451 | len = max; | ||
| 452 | |||
| 453 | if (!(flags & IORESOURCE_MEM)) { | ||
| 454 | pr_info("PCI: Trying to map invalid resource %#lx\n", flags); | ||
| 455 | start = 0; | ||
| 456 | } | ||
| 457 | |||
| 458 | return (void __iomem *)start; | ||
| 459 | } | ||
| 460 | EXPORT_SYMBOL(pci_iomap); | ||
| 461 | |||
| 462 | |||
| 463 | /**************************************************************** | ||
| 464 | * | ||
| 465 | * Tile PCI config space read/write routines | ||
| 466 | * | ||
| 467 | ****************************************************************/ | ||
| 468 | |||
| 469 | /* | ||
| 470 | * These are the normal read and write ops | ||
| 471 | * These are expanded with macros from pci_bus_read_config_byte() etc. | ||
| 472 | * | ||
| 473 | * devfn is the combined PCI slot & function. | ||
| 474 | * | ||
| 475 | * offset is in bytes, from the start of config space for the | ||
| 476 | * specified bus & slot. | ||
| 477 | */ | ||
| 478 | |||
| 479 | static int __devinit tile_cfg_read(struct pci_bus *bus, | ||
| 480 | unsigned int devfn, | ||
| 481 | int offset, | ||
| 482 | int size, | ||
| 483 | u32 *val) | ||
| 484 | { | ||
| 485 | struct pci_controller *controller = bus->sysdata; | ||
| 486 | int busnum = bus->number & 0xff; | ||
| 487 | int slot = (devfn >> 3) & 0x1f; | ||
| 488 | int function = devfn & 0x7; | ||
| 489 | u32 addr; | ||
| 490 | int config_mode = 1; | ||
| 491 | |||
| 492 | /* | ||
| 493 | * There is no bridge between the Tile and bus 0, so we | ||
| 494 | * use config0 to talk to bus 0. | ||
| 495 | * | ||
| 496 | * If we're talking to a bus other than zero then we | ||
| 497 | * must have found a bridge. | ||
| 498 | */ | ||
| 499 | if (busnum == 0) { | ||
| 500 | /* | ||
| 501 | * We fake an empty slot for (busnum == 0) && (slot > 0), | ||
| 502 | * since there is only one slot on bus 0. | ||
| 503 | */ | ||
| 504 | if (slot) { | ||
| 505 | *val = 0xFFFFFFFF; | ||
| 506 | return 0; | ||
| 507 | } | ||
| 508 | config_mode = 0; | ||
| 509 | } | ||
| 510 | |||
| 511 | addr = busnum << 20; /* Bus in 27:20 */ | ||
| 512 | addr |= slot << 15; /* Slot (device) in 19:15 */ | ||
| 513 | addr |= function << 12; /* Function is in 14:12 */ | ||
| 514 | addr |= (offset & 0xFFF); /* byte address in 0:11 */ | ||
| 515 | |||
| 516 | return hv_dev_pread(controller->hv_cfg_fd[config_mode], 0, | ||
| 517 | (HV_VirtAddr)(val), size, addr); | ||
| 518 | } | ||
| 519 | |||
| 520 | |||
| 521 | /* | ||
| 522 | * See tile_cfg_read() for relevent comments. | ||
| 523 | * Note that "val" is the value to write, not a pointer to that value. | ||
| 524 | */ | ||
| 525 | static int __devinit tile_cfg_write(struct pci_bus *bus, | ||
| 526 | unsigned int devfn, | ||
| 527 | int offset, | ||
| 528 | int size, | ||
| 529 | u32 val) | ||
| 530 | { | ||
| 531 | struct pci_controller *controller = bus->sysdata; | ||
| 532 | int busnum = bus->number & 0xff; | ||
| 533 | int slot = (devfn >> 3) & 0x1f; | ||
| 534 | int function = devfn & 0x7; | ||
| 535 | u32 addr; | ||
| 536 | int config_mode = 1; | ||
| 537 | HV_VirtAddr valp = (HV_VirtAddr)&val; | ||
| 538 | |||
| 539 | /* | ||
| 540 | * For bus 0 slot 0 we use config 0 accesses. | ||
| 541 | */ | ||
| 542 | if (busnum == 0) { | ||
| 543 | /* | ||
| 544 | * We fake an empty slot for (busnum == 0) && (slot > 0), | ||
| 545 | * since there is only one slot on bus 0. | ||
| 546 | */ | ||
| 547 | if (slot) | ||
| 548 | return 0; | ||
| 549 | config_mode = 0; | ||
| 550 | } | ||
| 551 | |||
| 552 | addr = busnum << 20; /* Bus in 27:20 */ | ||
| 553 | addr |= slot << 15; /* Slot (device) in 19:15 */ | ||
| 554 | addr |= function << 12; /* Function is in 14:12 */ | ||
| 555 | addr |= (offset & 0xFFF); /* byte address in 0:11 */ | ||
| 556 | |||
| 557 | #ifdef __BIG_ENDIAN | ||
| 558 | /* Point to the correct part of the 32-bit "val". */ | ||
| 559 | valp += 4 - size; | ||
| 560 | #endif | ||
| 561 | |||
| 562 | return hv_dev_pwrite(controller->hv_cfg_fd[config_mode], 0, | ||
| 563 | valp, size, addr); | ||
| 564 | } | ||
| 565 | |||
| 566 | |||
| 567 | static struct pci_ops tile_cfg_ops = { | ||
| 568 | .read = tile_cfg_read, | ||
| 569 | .write = tile_cfg_write, | ||
| 570 | }; | ||
| 571 | |||
| 572 | |||
| 573 | /* | ||
| 574 | * In the following, each PCI controller's mem_resources[1] | ||
| 575 | * represents its (non-prefetchable) PCI memory resource. | ||
| 576 | * mem_resources[0] and mem_resources[2] refer to its PCI I/O and | ||
| 577 | * prefetchable PCI memory resources, respectively. | ||
| 578 | * For more details, see pci_setup_bridge() in setup-bus.c. | ||
| 579 | * By comparing the target PCI memory address against the | ||
| 580 | * end address of controller 0, we can determine the controller | ||
| 581 | * that should accept the PCI memory access. | ||
| 582 | */ | ||
| 583 | #define TILE_READ(size, type) \ | ||
| 584 | type _tile_read##size(unsigned long addr) \ | ||
| 585 | { \ | ||
| 586 | type val; \ | ||
| 587 | int idx = 0; \ | ||
| 588 | if (addr > controllers[0].mem_resources[1].end && \ | ||
| 589 | addr > controllers[0].mem_resources[2].end) \ | ||
| 590 | idx = 1; \ | ||
| 591 | if (hv_dev_pread(controllers[idx].hv_mem_fd, 0, \ | ||
| 592 | (HV_VirtAddr)(&val), sizeof(type), addr)) \ | ||
| 593 | pr_err("PCI: read %zd bytes at 0x%lX failed\n", \ | ||
| 594 | sizeof(type), addr); \ | ||
| 595 | return val; \ | ||
| 596 | } \ | ||
| 597 | EXPORT_SYMBOL(_tile_read##size) | ||
| 598 | |||
| 599 | TILE_READ(b, u8); | ||
| 600 | TILE_READ(w, u16); | ||
| 601 | TILE_READ(l, u32); | ||
| 602 | TILE_READ(q, u64); | ||
| 603 | |||
| 604 | #define TILE_WRITE(size, type) \ | ||
| 605 | void _tile_write##size(type val, unsigned long addr) \ | ||
| 606 | { \ | ||
| 607 | int idx = 0; \ | ||
| 608 | if (addr > controllers[0].mem_resources[1].end && \ | ||
| 609 | addr > controllers[0].mem_resources[2].end) \ | ||
| 610 | idx = 1; \ | ||
| 611 | if (hv_dev_pwrite(controllers[idx].hv_mem_fd, 0, \ | ||
| 612 | (HV_VirtAddr)(&val), sizeof(type), addr)) \ | ||
| 613 | pr_err("PCI: write %zd bytes at 0x%lX failed\n", \ | ||
| 614 | sizeof(type), addr); \ | ||
| 615 | } \ | ||
| 616 | EXPORT_SYMBOL(_tile_write##size) | ||
| 617 | |||
| 618 | TILE_WRITE(b, u8); | ||
| 619 | TILE_WRITE(w, u16); | ||
| 620 | TILE_WRITE(l, u32); | ||
| 621 | TILE_WRITE(q, u64); | ||
diff --git a/arch/tile/kernel/ptrace.c b/arch/tile/kernel/ptrace.c index 9cd29884c09f..e92e40527d6d 100644 --- a/arch/tile/kernel/ptrace.c +++ b/arch/tile/kernel/ptrace.c | |||
| @@ -50,10 +50,10 @@ long arch_ptrace(struct task_struct *child, long request, | |||
| 50 | { | 50 | { |
| 51 | unsigned long __user *datap = (long __user __force *)data; | 51 | unsigned long __user *datap = (long __user __force *)data; |
| 52 | unsigned long tmp; | 52 | unsigned long tmp; |
| 53 | int i; | ||
| 54 | long ret = -EIO; | 53 | long ret = -EIO; |
| 55 | unsigned long *childregs; | ||
| 56 | char *childreg; | 54 | char *childreg; |
| 55 | struct pt_regs copyregs; | ||
| 56 | int ex1_offset; | ||
| 57 | 57 | ||
| 58 | switch (request) { | 58 | switch (request) { |
| 59 | 59 | ||
| @@ -80,6 +80,16 @@ long arch_ptrace(struct task_struct *child, long request, | |||
| 80 | if (addr >= PTREGS_SIZE) | 80 | if (addr >= PTREGS_SIZE) |
| 81 | break; | 81 | break; |
| 82 | childreg = (char *)task_pt_regs(child) + addr; | 82 | childreg = (char *)task_pt_regs(child) + addr; |
| 83 | |||
| 84 | /* Guard against overwrites of the privilege level. */ | ||
| 85 | ex1_offset = PTREGS_OFFSET_EX1; | ||
| 86 | #if defined(CONFIG_COMPAT) && defined(__BIG_ENDIAN) | ||
| 87 | if (is_compat_task()) /* point at low word */ | ||
| 88 | ex1_offset += sizeof(compat_long_t); | ||
| 89 | #endif | ||
| 90 | if (addr == ex1_offset) | ||
| 91 | data = PL_ICS_EX1(USER_PL, EX1_ICS(data)); | ||
| 92 | |||
| 83 | #ifdef CONFIG_COMPAT | 93 | #ifdef CONFIG_COMPAT |
| 84 | if (is_compat_task()) { | 94 | if (is_compat_task()) { |
| 85 | if (addr & (sizeof(compat_long_t)-1)) | 95 | if (addr & (sizeof(compat_long_t)-1)) |
| @@ -96,26 +106,19 @@ long arch_ptrace(struct task_struct *child, long request, | |||
| 96 | break; | 106 | break; |
| 97 | 107 | ||
| 98 | case PTRACE_GETREGS: /* Get all registers from the child. */ | 108 | case PTRACE_GETREGS: /* Get all registers from the child. */ |
| 99 | if (!access_ok(VERIFY_WRITE, datap, PTREGS_SIZE)) | 109 | if (copy_to_user(datap, task_pt_regs(child), |
| 100 | break; | 110 | sizeof(struct pt_regs)) == 0) { |
| 101 | childregs = (long *)task_pt_regs(child); | 111 | ret = 0; |
| 102 | for (i = 0; i < sizeof(struct pt_regs)/sizeof(unsigned long); | ||
| 103 | ++i) { | ||
| 104 | ret = __put_user(childregs[i], &datap[i]); | ||
| 105 | if (ret != 0) | ||
| 106 | break; | ||
| 107 | } | 112 | } |
| 108 | break; | 113 | break; |
| 109 | 114 | ||
| 110 | case PTRACE_SETREGS: /* Set all registers in the child. */ | 115 | case PTRACE_SETREGS: /* Set all registers in the child. */ |
| 111 | if (!access_ok(VERIFY_READ, datap, PTREGS_SIZE)) | 116 | if (copy_from_user(©regs, datap, |
| 112 | break; | 117 | sizeof(struct pt_regs)) == 0) { |
| 113 | childregs = (long *)task_pt_regs(child); | 118 | copyregs.ex1 = |
| 114 | for (i = 0; i < sizeof(struct pt_regs)/sizeof(unsigned long); | 119 | PL_ICS_EX1(USER_PL, EX1_ICS(copyregs.ex1)); |
| 115 | ++i) { | 120 | *task_pt_regs(child) = copyregs; |
| 116 | ret = __get_user(childregs[i], &datap[i]); | 121 | ret = 0; |
| 117 | if (ret != 0) | ||
| 118 | break; | ||
| 119 | } | 122 | } |
| 120 | break; | 123 | break; |
| 121 | 124 | ||
diff --git a/arch/tile/kernel/reboot.c b/arch/tile/kernel/reboot.c index acd86d20beba..baa3d905fee2 100644 --- a/arch/tile/kernel/reboot.c +++ b/arch/tile/kernel/reboot.c | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | void machine_halt(void) | 27 | void machine_halt(void) |
| 28 | { | 28 | { |
| 29 | warn_early_printk(); | 29 | warn_early_printk(); |
| 30 | raw_local_irq_disable_all(); | 30 | arch_local_irq_disable_all(); |
| 31 | smp_send_stop(); | 31 | smp_send_stop(); |
| 32 | hv_halt(); | 32 | hv_halt(); |
| 33 | } | 33 | } |
| @@ -35,14 +35,14 @@ void machine_halt(void) | |||
| 35 | void machine_power_off(void) | 35 | void machine_power_off(void) |
| 36 | { | 36 | { |
| 37 | warn_early_printk(); | 37 | warn_early_printk(); |
| 38 | raw_local_irq_disable_all(); | 38 | arch_local_irq_disable_all(); |
| 39 | smp_send_stop(); | 39 | smp_send_stop(); |
| 40 | hv_power_off(); | 40 | hv_power_off(); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | void machine_restart(char *cmd) | 43 | void machine_restart(char *cmd) |
| 44 | { | 44 | { |
| 45 | raw_local_irq_disable_all(); | 45 | arch_local_irq_disable_all(); |
| 46 | smp_send_stop(); | 46 | smp_send_stop(); |
| 47 | hv_restart((HV_VirtAddr) "vmlinux", (HV_VirtAddr) cmd); | 47 | hv_restart((HV_VirtAddr) "vmlinux", (HV_VirtAddr) cmd); |
| 48 | } | 48 | } |
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c index ae51cad12da0..f18573643ed1 100644 --- a/arch/tile/kernel/setup.c +++ b/arch/tile/kernel/setup.c | |||
| @@ -840,7 +840,7 @@ static int __init topology_init(void) | |||
| 840 | for_each_online_node(i) | 840 | for_each_online_node(i) |
| 841 | register_one_node(i); | 841 | register_one_node(i); |
| 842 | 842 | ||
| 843 | for_each_present_cpu(i) | 843 | for (i = 0; i < smp_height * smp_width; ++i) |
| 844 | register_cpu(&cpu_devices[i], i); | 844 | register_cpu(&cpu_devices[i], i); |
| 845 | 845 | ||
| 846 | return 0; | 846 | return 0; |
| @@ -868,14 +868,14 @@ void __cpuinit setup_cpu(int boot) | |||
| 868 | 868 | ||
| 869 | /* Allow asynchronous TLB interrupts. */ | 869 | /* Allow asynchronous TLB interrupts. */ |
| 870 | #if CHIP_HAS_TILE_DMA() | 870 | #if CHIP_HAS_TILE_DMA() |
| 871 | raw_local_irq_unmask(INT_DMATLB_MISS); | 871 | arch_local_irq_unmask(INT_DMATLB_MISS); |
| 872 | raw_local_irq_unmask(INT_DMATLB_ACCESS); | 872 | arch_local_irq_unmask(INT_DMATLB_ACCESS); |
| 873 | #endif | 873 | #endif |
| 874 | #if CHIP_HAS_SN_PROC() | 874 | #if CHIP_HAS_SN_PROC() |
| 875 | raw_local_irq_unmask(INT_SNITLB_MISS); | 875 | arch_local_irq_unmask(INT_SNITLB_MISS); |
| 876 | #endif | 876 | #endif |
| 877 | #ifdef __tilegx__ | 877 | #ifdef __tilegx__ |
| 878 | raw_local_irq_unmask(INT_SINGLE_STEP_K); | 878 | arch_local_irq_unmask(INT_SINGLE_STEP_K); |
| 879 | #endif | 879 | #endif |
| 880 | 880 | ||
| 881 | /* | 881 | /* |
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c index fb28e85ae3ae..757407e36696 100644 --- a/arch/tile/kernel/signal.c +++ b/arch/tile/kernel/signal.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 21 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
| 22 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
| @@ -71,6 +70,9 @@ int restore_sigcontext(struct pt_regs *regs, | |||
| 71 | for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) | 70 | for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) |
| 72 | err |= __get_user(regs->regs[i], &sc->gregs[i]); | 71 | err |= __get_user(regs->regs[i], &sc->gregs[i]); |
| 73 | 72 | ||
| 73 | /* Ensure that the PL is always set to USER_PL. */ | ||
| 74 | regs->ex1 = PL_ICS_EX1(USER_PL, EX1_ICS(regs->ex1)); | ||
| 75 | |||
| 74 | regs->faultnum = INT_SWINT_1_SIGRETURN; | 76 | regs->faultnum = INT_SWINT_1_SIGRETURN; |
| 75 | 77 | ||
| 76 | err |= __get_user(*pr0, &sc->gregs[0]); | 78 | err |= __get_user(*pr0, &sc->gregs[0]); |
| @@ -330,7 +332,7 @@ void do_signal(struct pt_regs *regs) | |||
| 330 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | 332 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
| 331 | } | 333 | } |
| 332 | 334 | ||
| 333 | return; | 335 | goto done; |
| 334 | } | 336 | } |
| 335 | 337 | ||
| 336 | /* Did we come from a system call? */ | 338 | /* Did we come from a system call? */ |
| @@ -358,4 +360,8 @@ void do_signal(struct pt_regs *regs) | |||
| 358 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | 360 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
| 359 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 361 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
| 360 | } | 362 | } |
| 363 | |||
| 364 | done: | ||
| 365 | /* Avoid double syscall restart if there are nested signals. */ | ||
| 366 | regs->faultnum = INT_SWINT_1_SIGRETURN; | ||
| 361 | } | 367 | } |
diff --git a/arch/tile/kernel/smp.c b/arch/tile/kernel/smp.c index 75255d90aff3..9575b37a8b75 100644 --- a/arch/tile/kernel/smp.c +++ b/arch/tile/kernel/smp.c | |||
| @@ -115,7 +115,7 @@ static void smp_start_cpu_interrupt(void) | |||
| 115 | static void smp_stop_cpu_interrupt(void) | 115 | static void smp_stop_cpu_interrupt(void) |
| 116 | { | 116 | { |
| 117 | set_cpu_online(smp_processor_id(), 0); | 117 | set_cpu_online(smp_processor_id(), 0); |
| 118 | raw_local_irq_disable_all(); | 118 | arch_local_irq_disable_all(); |
| 119 | for (;;) | 119 | for (;;) |
| 120 | asm("nap"); | 120 | asm("nap"); |
| 121 | } | 121 | } |
diff --git a/arch/tile/kernel/smpboot.c b/arch/tile/kernel/smpboot.c index 74d62d098edf..b949edcec200 100644 --- a/arch/tile/kernel/smpboot.c +++ b/arch/tile/kernel/smpboot.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
| 19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
| 20 | #include <linux/kernel_stat.h> | 20 | #include <linux/kernel_stat.h> |
| 21 | #include <linux/smp_lock.h> | ||
| 22 | #include <linux/bootmem.h> | 21 | #include <linux/bootmem.h> |
| 23 | #include <linux/notifier.h> | 22 | #include <linux/notifier.h> |
| 24 | #include <linux/cpu.h> | 23 | #include <linux/cpu.h> |
diff --git a/arch/tile/kernel/sys.c b/arch/tile/kernel/sys.c index 7e764669a022..e2187d24a9b4 100644 --- a/arch/tile/kernel/sys.c +++ b/arch/tile/kernel/sys.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
| 21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
| 22 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
| 23 | #include <linux/smp_lock.h> | ||
| 24 | #include <linux/syscalls.h> | 23 | #include <linux/syscalls.h> |
| 25 | #include <linux/mman.h> | 24 | #include <linux/mman.h> |
| 26 | #include <linux/file.h> | 25 | #include <linux/file.h> |
diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c index 6bed820e1421..f2e156e44692 100644 --- a/arch/tile/kernel/time.c +++ b/arch/tile/kernel/time.c | |||
| @@ -132,7 +132,7 @@ static int tile_timer_set_next_event(unsigned long ticks, | |||
| 132 | { | 132 | { |
| 133 | BUG_ON(ticks > MAX_TICK); | 133 | BUG_ON(ticks > MAX_TICK); |
| 134 | __insn_mtspr(SPR_TILE_TIMER_CONTROL, ticks); | 134 | __insn_mtspr(SPR_TILE_TIMER_CONTROL, ticks); |
| 135 | raw_local_irq_unmask_now(INT_TILE_TIMER); | 135 | arch_local_irq_unmask_now(INT_TILE_TIMER); |
| 136 | return 0; | 136 | return 0; |
| 137 | } | 137 | } |
| 138 | 138 | ||
| @@ -143,7 +143,7 @@ static int tile_timer_set_next_event(unsigned long ticks, | |||
| 143 | static void tile_timer_set_mode(enum clock_event_mode mode, | 143 | static void tile_timer_set_mode(enum clock_event_mode mode, |
| 144 | struct clock_event_device *evt) | 144 | struct clock_event_device *evt) |
| 145 | { | 145 | { |
| 146 | raw_local_irq_mask_now(INT_TILE_TIMER); | 146 | arch_local_irq_mask_now(INT_TILE_TIMER); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | /* | 149 | /* |
| @@ -172,7 +172,7 @@ void __cpuinit setup_tile_timer(void) | |||
| 172 | evt->cpumask = cpumask_of(smp_processor_id()); | 172 | evt->cpumask = cpumask_of(smp_processor_id()); |
| 173 | 173 | ||
| 174 | /* Start out with timer not firing. */ | 174 | /* Start out with timer not firing. */ |
| 175 | raw_local_irq_mask_now(INT_TILE_TIMER); | 175 | arch_local_irq_mask_now(INT_TILE_TIMER); |
| 176 | 176 | ||
| 177 | /* Register tile timer. */ | 177 | /* Register tile timer. */ |
| 178 | clockevents_register_device(evt); | 178 | clockevents_register_device(evt); |
| @@ -188,7 +188,7 @@ void do_timer_interrupt(struct pt_regs *regs, int fault_num) | |||
| 188 | * Mask the timer interrupt here, since we are a oneshot timer | 188 | * Mask the timer interrupt here, since we are a oneshot timer |
| 189 | * and there are now by definition no events pending. | 189 | * and there are now by definition no events pending. |
| 190 | */ | 190 | */ |
| 191 | raw_local_irq_mask(INT_TILE_TIMER); | 191 | arch_local_irq_mask(INT_TILE_TIMER); |
| 192 | 192 | ||
| 193 | /* Track time spent here in an interrupt context */ | 193 | /* Track time spent here in an interrupt context */ |
| 194 | irq_enter(); | 194 | irq_enter(); |
diff --git a/arch/tile/lib/memchr_32.c b/arch/tile/lib/memchr_32.c index 6235283b4859..cc3d9badf030 100644 --- a/arch/tile/lib/memchr_32.c +++ b/arch/tile/lib/memchr_32.c | |||
| @@ -18,12 +18,24 @@ | |||
| 18 | 18 | ||
| 19 | void *memchr(const void *s, int c, size_t n) | 19 | void *memchr(const void *s, int c, size_t n) |
| 20 | { | 20 | { |
| 21 | const uint32_t *last_word_ptr; | ||
| 22 | const uint32_t *p; | ||
| 23 | const char *last_byte_ptr; | ||
| 24 | uintptr_t s_int; | ||
| 25 | uint32_t goal, before_mask, v, bits; | ||
| 26 | char *ret; | ||
| 27 | |||
| 28 | if (__builtin_expect(n == 0, 0)) { | ||
| 29 | /* Don't dereference any memory if the array is empty. */ | ||
| 30 | return NULL; | ||
| 31 | } | ||
| 32 | |||
| 21 | /* Get an aligned pointer. */ | 33 | /* Get an aligned pointer. */ |
| 22 | const uintptr_t s_int = (uintptr_t) s; | 34 | s_int = (uintptr_t) s; |
| 23 | const uint32_t *p = (const uint32_t *)(s_int & -4); | 35 | p = (const uint32_t *)(s_int & -4); |
| 24 | 36 | ||
| 25 | /* Create four copies of the byte for which we are looking. */ | 37 | /* Create four copies of the byte for which we are looking. */ |
| 26 | const uint32_t goal = 0x01010101 * (uint8_t) c; | 38 | goal = 0x01010101 * (uint8_t) c; |
| 27 | 39 | ||
| 28 | /* Read the first word, but munge it so that bytes before the array | 40 | /* Read the first word, but munge it so that bytes before the array |
| 29 | * will not match goal. | 41 | * will not match goal. |
| @@ -31,23 +43,14 @@ void *memchr(const void *s, int c, size_t n) | |||
| 31 | * Note that this shift count expression works because we know | 43 | * Note that this shift count expression works because we know |
| 32 | * shift counts are taken mod 32. | 44 | * shift counts are taken mod 32. |
| 33 | */ | 45 | */ |
| 34 | const uint32_t before_mask = (1 << (s_int << 3)) - 1; | 46 | before_mask = (1 << (s_int << 3)) - 1; |
| 35 | uint32_t v = (*p | before_mask) ^ (goal & before_mask); | 47 | v = (*p | before_mask) ^ (goal & before_mask); |
| 36 | 48 | ||
| 37 | /* Compute the address of the last byte. */ | 49 | /* Compute the address of the last byte. */ |
| 38 | const char *const last_byte_ptr = (const char *)s + n - 1; | 50 | last_byte_ptr = (const char *)s + n - 1; |
| 39 | 51 | ||
| 40 | /* Compute the address of the word containing the last byte. */ | 52 | /* Compute the address of the word containing the last byte. */ |
| 41 | const uint32_t *const last_word_ptr = | 53 | last_word_ptr = (const uint32_t *)((uintptr_t) last_byte_ptr & -4); |
| 42 | (const uint32_t *)((uintptr_t) last_byte_ptr & -4); | ||
| 43 | |||
| 44 | uint32_t bits; | ||
| 45 | char *ret; | ||
| 46 | |||
| 47 | if (__builtin_expect(n == 0, 0)) { | ||
| 48 | /* Don't dereference any memory if the array is empty. */ | ||
| 49 | return NULL; | ||
| 50 | } | ||
| 51 | 54 | ||
| 52 | while ((bits = __insn_seqb(v, goal)) == 0) { | 55 | while ((bits = __insn_seqb(v, goal)) == 0) { |
| 53 | if (__builtin_expect(p == last_word_ptr, 0)) { | 56 | if (__builtin_expect(p == last_word_ptr, 0)) { |
diff --git a/arch/tile/lib/memcpy_tile64.c b/arch/tile/lib/memcpy_tile64.c index dfedea7b266b..f7d4a6ad61e8 100644 --- a/arch/tile/lib/memcpy_tile64.c +++ b/arch/tile/lib/memcpy_tile64.c | |||
| @@ -54,7 +54,7 @@ typedef unsigned long (*memcpy_t)(void *, const void *, unsigned long); | |||
| 54 | * we must run with interrupts disabled to avoid the risk of some | 54 | * we must run with interrupts disabled to avoid the risk of some |
| 55 | * other code seeing the incoherent data in our cache. (Recall that | 55 | * other code seeing the incoherent data in our cache. (Recall that |
| 56 | * our cache is indexed by PA, so even if the other code doesn't use | 56 | * our cache is indexed by PA, so even if the other code doesn't use |
| 57 | * our KM_MEMCPY virtual addresses, they'll still hit in cache using | 57 | * our kmap_atomic virtual addresses, they'll still hit in cache using |
| 58 | * the normal VAs that aren't supposed to hit in cache.) | 58 | * the normal VAs that aren't supposed to hit in cache.) |
| 59 | */ | 59 | */ |
| 60 | static void memcpy_multicache(void *dest, const void *source, | 60 | static void memcpy_multicache(void *dest, const void *source, |
| @@ -64,6 +64,7 @@ static void memcpy_multicache(void *dest, const void *source, | |||
| 64 | unsigned long flags, newsrc, newdst; | 64 | unsigned long flags, newsrc, newdst; |
| 65 | pmd_t *pmdp; | 65 | pmd_t *pmdp; |
| 66 | pte_t *ptep; | 66 | pte_t *ptep; |
| 67 | int type0, type1; | ||
| 67 | int cpu = get_cpu(); | 68 | int cpu = get_cpu(); |
| 68 | 69 | ||
| 69 | /* | 70 | /* |
| @@ -77,7 +78,8 @@ static void memcpy_multicache(void *dest, const void *source, | |||
| 77 | sim_allow_multiple_caching(1); | 78 | sim_allow_multiple_caching(1); |
| 78 | 79 | ||
| 79 | /* Set up the new dest mapping */ | 80 | /* Set up the new dest mapping */ |
| 80 | idx = FIX_KMAP_BEGIN + (KM_TYPE_NR * cpu) + KM_MEMCPY0; | 81 | type0 = kmap_atomic_idx_push(); |
| 82 | idx = FIX_KMAP_BEGIN + (KM_TYPE_NR * cpu) + type0; | ||
| 81 | newdst = __fix_to_virt(idx) + ((unsigned long)dest & (PAGE_SIZE-1)); | 83 | newdst = __fix_to_virt(idx) + ((unsigned long)dest & (PAGE_SIZE-1)); |
| 82 | pmdp = pmd_offset(pud_offset(pgd_offset_k(newdst), newdst), newdst); | 84 | pmdp = pmd_offset(pud_offset(pgd_offset_k(newdst), newdst), newdst); |
| 83 | ptep = pte_offset_kernel(pmdp, newdst); | 85 | ptep = pte_offset_kernel(pmdp, newdst); |
| @@ -87,7 +89,8 @@ static void memcpy_multicache(void *dest, const void *source, | |||
| 87 | } | 89 | } |
| 88 | 90 | ||
| 89 | /* Set up the new source mapping */ | 91 | /* Set up the new source mapping */ |
| 90 | idx += (KM_MEMCPY0 - KM_MEMCPY1); | 92 | type1 = kmap_atomic_idx_push(); |
| 93 | idx += (type0 - type1); | ||
| 91 | src_pte = hv_pte_set_nc(src_pte); | 94 | src_pte = hv_pte_set_nc(src_pte); |
| 92 | src_pte = hv_pte_clear_writable(src_pte); /* be paranoid */ | 95 | src_pte = hv_pte_clear_writable(src_pte); /* be paranoid */ |
| 93 | newsrc = __fix_to_virt(idx) + ((unsigned long)source & (PAGE_SIZE-1)); | 96 | newsrc = __fix_to_virt(idx) + ((unsigned long)source & (PAGE_SIZE-1)); |
| @@ -119,6 +122,8 @@ static void memcpy_multicache(void *dest, const void *source, | |||
| 119 | * We're done: notify the simulator that all is back to normal, | 122 | * We're done: notify the simulator that all is back to normal, |
| 120 | * and re-enable interrupts and pre-emption. | 123 | * and re-enable interrupts and pre-emption. |
| 121 | */ | 124 | */ |
| 125 | kmap_atomic_idx_pop(); | ||
| 126 | kmap_atomic_idx_pop(); | ||
| 122 | sim_allow_multiple_caching(0); | 127 | sim_allow_multiple_caching(0); |
| 123 | local_irq_restore(flags); | 128 | local_irq_restore(flags); |
| 124 | put_cpu(); | 129 | put_cpu(); |
diff --git a/arch/tile/lib/spinlock_32.c b/arch/tile/lib/spinlock_32.c index 485e24d62c6b..5cd1c4004eca 100644 --- a/arch/tile/lib/spinlock_32.c +++ b/arch/tile/lib/spinlock_32.c | |||
| @@ -167,23 +167,30 @@ void arch_write_lock_slow(arch_rwlock_t *rwlock, u32 val) | |||
| 167 | * when we compare them. | 167 | * when we compare them. |
| 168 | */ | 168 | */ |
| 169 | u32 my_ticket_; | 169 | u32 my_ticket_; |
| 170 | u32 iterations = 0; | ||
| 170 | 171 | ||
| 171 | /* Take out the next ticket; this will also stop would-be readers. */ | 172 | /* |
| 172 | if (val & 1) | 173 | * Wait until there are no readers, then bump up the next |
| 173 | val = get_rwlock(rwlock); | 174 | * field and capture the ticket value. |
| 174 | rwlock->lock = __insn_addb(val, 1 << WR_NEXT_SHIFT); | 175 | */ |
| 176 | for (;;) { | ||
| 177 | if (!(val & 1)) { | ||
| 178 | if ((val >> RD_COUNT_SHIFT) == 0) | ||
| 179 | break; | ||
| 180 | rwlock->lock = val; | ||
| 181 | } | ||
| 182 | delay_backoff(iterations++); | ||
| 183 | val = __insn_tns((int *)&rwlock->lock); | ||
| 184 | } | ||
| 175 | 185 | ||
| 176 | /* Extract my ticket value from the original word. */ | 186 | /* Take out the next ticket and extract my ticket value. */ |
| 187 | rwlock->lock = __insn_addb(val, 1 << WR_NEXT_SHIFT); | ||
| 177 | my_ticket_ = val >> WR_NEXT_SHIFT; | 188 | my_ticket_ = val >> WR_NEXT_SHIFT; |
| 178 | 189 | ||
| 179 | /* | 190 | /* Wait until the "current" field matches our ticket. */ |
| 180 | * Wait until the "current" field matches our ticket, and | ||
| 181 | * there are no remaining readers. | ||
| 182 | */ | ||
| 183 | for (;;) { | 191 | for (;;) { |
| 184 | u32 curr_ = val >> WR_CURR_SHIFT; | 192 | u32 curr_ = val >> WR_CURR_SHIFT; |
| 185 | u32 readers = val >> RD_COUNT_SHIFT; | 193 | u32 delta = ((my_ticket_ - curr_) & WR_MASK); |
| 186 | u32 delta = ((my_ticket_ - curr_) & WR_MASK) + !!readers; | ||
| 187 | if (likely(delta == 0)) | 194 | if (likely(delta == 0)) |
| 188 | break; | 195 | break; |
| 189 | 196 | ||
diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c index f295b4ac941d..dcebfc831cd6 100644 --- a/arch/tile/mm/fault.c +++ b/arch/tile/mm/fault.c | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #include <linux/mman.h> | 24 | #include <linux/mman.h> |
| 25 | #include <linux/mm.h> | 25 | #include <linux/mm.h> |
| 26 | #include <linux/smp.h> | 26 | #include <linux/smp.h> |
| 27 | #include <linux/smp_lock.h> | ||
| 28 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
| 29 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 30 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
diff --git a/arch/tile/mm/highmem.c b/arch/tile/mm/highmem.c index abb57331cf6e..31dbbd9afe47 100644 --- a/arch/tile/mm/highmem.c +++ b/arch/tile/mm/highmem.c | |||
| @@ -227,7 +227,7 @@ EXPORT_SYMBOL(kmap_atomic_prot); | |||
| 227 | void *__kmap_atomic(struct page *page) | 227 | void *__kmap_atomic(struct page *page) |
| 228 | { | 228 | { |
| 229 | /* PAGE_NONE is a magic value that tells us to check immutability. */ | 229 | /* PAGE_NONE is a magic value that tells us to check immutability. */ |
| 230 | return kmap_atomic_prot(page, type, PAGE_NONE); | 230 | return kmap_atomic_prot(page, PAGE_NONE); |
| 231 | } | 231 | } |
| 232 | EXPORT_SYMBOL(__kmap_atomic); | 232 | EXPORT_SYMBOL(__kmap_atomic); |
| 233 | 233 | ||
diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c index 24688b697a8d..201a582c4137 100644 --- a/arch/tile/mm/hugetlbpage.c +++ b/arch/tile/mm/hugetlbpage.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
| 22 | #include <linux/hugetlb.h> | 22 | #include <linux/hugetlb.h> |
| 23 | #include <linux/pagemap.h> | 23 | #include <linux/pagemap.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
| 26 | #include <linux/err.h> | 25 | #include <linux/err.h> |
| 27 | #include <linux/sysctl.h> | 26 | #include <linux/sysctl.h> |
diff --git a/arch/tile/mm/init.c b/arch/tile/mm/init.c index 78e1982cb6c9..0b9ce69b0ee5 100644 --- a/arch/tile/mm/init.c +++ b/arch/tile/mm/init.c | |||
| @@ -988,8 +988,12 @@ static long __write_once initfree = 1; | |||
| 988 | /* Select whether to free (1) or mark unusable (0) the __init pages. */ | 988 | /* Select whether to free (1) or mark unusable (0) the __init pages. */ |
| 989 | static int __init set_initfree(char *str) | 989 | static int __init set_initfree(char *str) |
| 990 | { | 990 | { |
| 991 | strict_strtol(str, 0, &initfree); | 991 | long val; |
| 992 | pr_info("initfree: %s free init pages\n", initfree ? "will" : "won't"); | 992 | if (strict_strtol(str, 0, &val)) { |
| 993 | initfree = val; | ||
| 994 | pr_info("initfree: %s free init pages\n", | ||
| 995 | initfree ? "will" : "won't"); | ||
| 996 | } | ||
| 993 | return 1; | 997 | return 1; |
| 994 | } | 998 | } |
| 995 | __setup("initfree=", set_initfree); | 999 | __setup("initfree=", set_initfree); |
diff --git a/arch/tile/mm/pgtable.c b/arch/tile/mm/pgtable.c index 335c24621c41..1f5430c53d0d 100644 --- a/arch/tile/mm/pgtable.c +++ b/arch/tile/mm/pgtable.c | |||
| @@ -134,9 +134,9 @@ void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t flags) | |||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | #if defined(CONFIG_HIGHPTE) | 136 | #if defined(CONFIG_HIGHPTE) |
| 137 | pte_t *_pte_offset_map(pmd_t *dir, unsigned long address, enum km_type type) | 137 | pte_t *_pte_offset_map(pmd_t *dir, unsigned long address) |
| 138 | { | 138 | { |
| 139 | pte_t *pte = kmap_atomic(pmd_page(*dir), type) + | 139 | pte_t *pte = kmap_atomic(pmd_page(*dir)) + |
| 140 | (pmd_ptfn(*dir) << HV_LOG2_PAGE_TABLE_ALIGN) & ~PAGE_MASK; | 140 | (pmd_ptfn(*dir) << HV_LOG2_PAGE_TABLE_ALIGN) & ~PAGE_MASK; |
| 141 | return &pte[pte_index(address)]; | 141 | return &pte[pte_index(address)]; |
| 142 | } | 142 | } |
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 7f7338c90784..1664cce7b0ac 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
| @@ -727,6 +727,9 @@ struct winch { | |||
| 727 | 727 | ||
| 728 | static void free_winch(struct winch *winch, int free_irq_ok) | 728 | static void free_winch(struct winch *winch, int free_irq_ok) |
| 729 | { | 729 | { |
| 730 | if (free_irq_ok) | ||
| 731 | free_irq(WINCH_IRQ, winch); | ||
| 732 | |||
| 730 | list_del(&winch->list); | 733 | list_del(&winch->list); |
| 731 | 734 | ||
| 732 | if (winch->pid != -1) | 735 | if (winch->pid != -1) |
| @@ -735,8 +738,6 @@ static void free_winch(struct winch *winch, int free_irq_ok) | |||
| 735 | os_close_file(winch->fd); | 738 | os_close_file(winch->fd); |
| 736 | if (winch->stack != 0) | 739 | if (winch->stack != 0) |
| 737 | free_stack(winch->stack, 0); | 740 | free_stack(winch->stack, 0); |
| 738 | if (free_irq_ok) | ||
| 739 | free_irq(WINCH_IRQ, winch); | ||
| 740 | kfree(winch); | 741 | kfree(winch); |
| 741 | } | 742 | } |
| 742 | 743 | ||
diff --git a/arch/um/include/asm/ptrace-generic.h b/arch/um/include/asm/ptrace-generic.h index 2cd899f75a3c..b7c5bab9bd77 100644 --- a/arch/um/include/asm/ptrace-generic.h +++ b/arch/um/include/asm/ptrace-generic.h | |||
| @@ -38,8 +38,8 @@ struct pt_regs { | |||
| 38 | 38 | ||
| 39 | struct task_struct; | 39 | struct task_struct; |
| 40 | 40 | ||
| 41 | extern long subarch_ptrace(struct task_struct *child, long request, long addr, | 41 | extern long subarch_ptrace(struct task_struct *child, long request, |
| 42 | long data); | 42 | unsigned long addr, unsigned long data); |
| 43 | extern unsigned long getreg(struct task_struct *child, int regno); | 43 | extern unsigned long getreg(struct task_struct *child, int regno); |
| 44 | extern int putreg(struct task_struct *child, int regno, unsigned long value); | 44 | extern int putreg(struct task_struct *child, int regno, unsigned long value); |
| 45 | extern int get_fpregs(struct user_i387_struct __user *buf, | 45 | extern int get_fpregs(struct user_i387_struct __user *buf, |
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 340268be00b5..09bd7b585726 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | #include "linux/stddef.h" | 6 | #include "linux/stddef.h" |
| 7 | #include "linux/fs.h" | 7 | #include "linux/fs.h" |
| 8 | #include "linux/smp_lock.h" | ||
| 9 | #include "linux/ptrace.h" | 8 | #include "linux/ptrace.h" |
| 10 | #include "linux/sched.h" | 9 | #include "linux/sched.h" |
| 11 | #include "linux/slab.h" | 10 | #include "linux/slab.h" |
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index a5e33f29bbeb..701b672c1122 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c | |||
| @@ -122,7 +122,7 @@ long arch_ptrace(struct task_struct *child, long request, | |||
| 122 | break; | 122 | break; |
| 123 | 123 | ||
| 124 | case PTRACE_SET_THREAD_AREA: | 124 | case PTRACE_SET_THREAD_AREA: |
| 125 | ret = ptrace_set_thread_area(child, addr, datavp); | 125 | ret = ptrace_set_thread_area(child, addr, vp); |
| 126 | break; | 126 | break; |
| 127 | 127 | ||
| 128 | case PTRACE_FAULTINFO: { | 128 | case PTRACE_FAULTINFO: { |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e8327686d3c5..e330da21b84f 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -21,7 +21,7 @@ config X86 | |||
| 21 | select HAVE_UNSTABLE_SCHED_CLOCK | 21 | select HAVE_UNSTABLE_SCHED_CLOCK |
| 22 | select HAVE_IDE | 22 | select HAVE_IDE |
| 23 | select HAVE_OPROFILE | 23 | select HAVE_OPROFILE |
| 24 | select HAVE_PERF_EVENTS if (!M386 && !M486) | 24 | select HAVE_PERF_EVENTS |
| 25 | select HAVE_IRQ_WORK | 25 | select HAVE_IRQ_WORK |
| 26 | select HAVE_IOREMAP_PROT | 26 | select HAVE_IOREMAP_PROT |
| 27 | select HAVE_KPROBES | 27 | select HAVE_KPROBES |
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index 849813f398e7..5852519b2d0f 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/syscalls.h> | 28 | #include <linux/syscalls.h> |
| 29 | #include <linux/times.h> | 29 | #include <linux/times.h> |
| 30 | #include <linux/utsname.h> | 30 | #include <linux/utsname.h> |
| 31 | #include <linux/smp_lock.h> | ||
| 32 | #include <linux/mm.h> | 31 | #include <linux/mm.h> |
| 33 | #include <linux/uio.h> | 32 | #include <linux/uio.h> |
| 34 | #include <linux/poll.h> | 33 | #include <linux/poll.h> |
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 286de34b0ed6..f6ce0bda3b98 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
| @@ -141,13 +141,13 @@ static inline void native_apic_msr_write(u32 reg, u32 v) | |||
| 141 | 141 | ||
| 142 | static inline u32 native_apic_msr_read(u32 reg) | 142 | static inline u32 native_apic_msr_read(u32 reg) |
| 143 | { | 143 | { |
| 144 | u32 low, high; | 144 | u64 msr; |
| 145 | 145 | ||
| 146 | if (reg == APIC_DFR) | 146 | if (reg == APIC_DFR) |
| 147 | return -1; | 147 | return -1; |
| 148 | 148 | ||
| 149 | rdmsr(APIC_BASE_MSR + (reg >> 4), low, high); | 149 | rdmsrl(APIC_BASE_MSR + (reg >> 4), msr); |
| 150 | return low; | 150 | return (u32)msr; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | static inline void native_x2apic_wait_icr_idle(void) | 153 | static inline void native_x2apic_wait_icr_idle(void) |
| @@ -181,12 +181,12 @@ extern void enable_x2apic(void); | |||
| 181 | extern void x2apic_icr_write(u32 low, u32 id); | 181 | extern void x2apic_icr_write(u32 low, u32 id); |
| 182 | static inline int x2apic_enabled(void) | 182 | static inline int x2apic_enabled(void) |
| 183 | { | 183 | { |
| 184 | int msr, msr2; | 184 | u64 msr; |
| 185 | 185 | ||
| 186 | if (!cpu_has_x2apic) | 186 | if (!cpu_has_x2apic) |
| 187 | return 0; | 187 | return 0; |
| 188 | 188 | ||
| 189 | rdmsr(MSR_IA32_APICBASE, msr, msr2); | 189 | rdmsrl(MSR_IA32_APICBASE, msr); |
| 190 | if (msr & X2APIC_ENABLE) | 190 | if (msr & X2APIC_ENABLE) |
| 191 | return 1; | 191 | return 1; |
| 192 | return 0; | 192 | return 0; |
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index 4d293dced62f..9479a037419f 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h | |||
| @@ -216,8 +216,8 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr) | |||
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | /* Return an pointer with offset calculated */ | 218 | /* Return an pointer with offset calculated */ |
| 219 | static inline unsigned long __set_fixmap_offset(enum fixed_addresses idx, | 219 | static __always_inline unsigned long |
| 220 | phys_addr_t phys, pgprot_t flags) | 220 | __set_fixmap_offset(enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags) |
| 221 | { | 221 | { |
| 222 | __set_fixmap(idx, phys, flags); | 222 | __set_fixmap(idx, phys, flags); |
| 223 | return fix_to_virt(idx) + (phys & (PAGE_SIZE - 1)); | 223 | return fix_to_virt(idx) + (phys & (PAGE_SIZE - 1)); |
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 3ea3dc487047..6b89f5e86021 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h | |||
| @@ -128,7 +128,7 @@ | |||
| 128 | #define FAM10H_MMIO_CONF_ENABLE (1<<0) | 128 | #define FAM10H_MMIO_CONF_ENABLE (1<<0) |
| 129 | #define FAM10H_MMIO_CONF_BUSRANGE_MASK 0xf | 129 | #define FAM10H_MMIO_CONF_BUSRANGE_MASK 0xf |
| 130 | #define FAM10H_MMIO_CONF_BUSRANGE_SHIFT 2 | 130 | #define FAM10H_MMIO_CONF_BUSRANGE_SHIFT 2 |
| 131 | #define FAM10H_MMIO_CONF_BASE_MASK 0xfffffff | 131 | #define FAM10H_MMIO_CONF_BASE_MASK 0xfffffffULL |
| 132 | #define FAM10H_MMIO_CONF_BASE_SHIFT 20 | 132 | #define FAM10H_MMIO_CONF_BASE_SHIFT 20 |
| 133 | #define MSR_FAM10H_NODE_ID 0xc001100c | 133 | #define MSR_FAM10H_NODE_ID 0xc001100c |
| 134 | 134 | ||
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 18e3b8a8709f..ef9975812c77 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
| @@ -824,27 +824,27 @@ static __always_inline void arch_spin_unlock(struct arch_spinlock *lock) | |||
| 824 | #define __PV_IS_CALLEE_SAVE(func) \ | 824 | #define __PV_IS_CALLEE_SAVE(func) \ |
| 825 | ((struct paravirt_callee_save) { func }) | 825 | ((struct paravirt_callee_save) { func }) |
| 826 | 826 | ||
| 827 | static inline unsigned long arch_local_save_flags(void) | 827 | static inline notrace unsigned long arch_local_save_flags(void) |
| 828 | { | 828 | { |
| 829 | return PVOP_CALLEE0(unsigned long, pv_irq_ops.save_fl); | 829 | return PVOP_CALLEE0(unsigned long, pv_irq_ops.save_fl); |
| 830 | } | 830 | } |
| 831 | 831 | ||
| 832 | static inline void arch_local_irq_restore(unsigned long f) | 832 | static inline notrace void arch_local_irq_restore(unsigned long f) |
| 833 | { | 833 | { |
| 834 | PVOP_VCALLEE1(pv_irq_ops.restore_fl, f); | 834 | PVOP_VCALLEE1(pv_irq_ops.restore_fl, f); |
| 835 | } | 835 | } |
| 836 | 836 | ||
| 837 | static inline void arch_local_irq_disable(void) | 837 | static inline notrace void arch_local_irq_disable(void) |
| 838 | { | 838 | { |
| 839 | PVOP_VCALLEE0(pv_irq_ops.irq_disable); | 839 | PVOP_VCALLEE0(pv_irq_ops.irq_disable); |
| 840 | } | 840 | } |
| 841 | 841 | ||
| 842 | static inline void arch_local_irq_enable(void) | 842 | static inline notrace void arch_local_irq_enable(void) |
| 843 | { | 843 | { |
| 844 | PVOP_VCALLEE0(pv_irq_ops.irq_enable); | 844 | PVOP_VCALLEE0(pv_irq_ops.irq_enable); |
| 845 | } | 845 | } |
| 846 | 846 | ||
| 847 | static inline unsigned long arch_local_irq_save(void) | 847 | static inline notrace unsigned long arch_local_irq_save(void) |
| 848 | { | 848 | { |
| 849 | unsigned long f; | 849 | unsigned long f; |
| 850 | 850 | ||
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index e969f691cbfd..a501741c2335 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
| @@ -199,6 +199,8 @@ union uvh_apicid { | |||
| 199 | #define UVH_APICID 0x002D0E00L | 199 | #define UVH_APICID 0x002D0E00L |
| 200 | #define UV_APIC_PNODE_SHIFT 6 | 200 | #define UV_APIC_PNODE_SHIFT 6 |
| 201 | 201 | ||
| 202 | #define UV_APICID_HIBIT_MASK 0xffff0000 | ||
| 203 | |||
| 202 | /* Local Bus from cpu's perspective */ | 204 | /* Local Bus from cpu's perspective */ |
| 203 | #define LOCAL_BUS_BASE 0x1c00000 | 205 | #define LOCAL_BUS_BASE 0x1c00000 |
| 204 | #define LOCAL_BUS_SIZE (4 * 1024 * 1024) | 206 | #define LOCAL_BUS_SIZE (4 * 1024 * 1024) |
| @@ -491,8 +493,10 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value) | |||
| 491 | } | 493 | } |
| 492 | } | 494 | } |
| 493 | 495 | ||
| 496 | extern unsigned int uv_apicid_hibits; | ||
| 494 | static unsigned long uv_hub_ipi_value(int apicid, int vector, int mode) | 497 | static unsigned long uv_hub_ipi_value(int apicid, int vector, int mode) |
| 495 | { | 498 | { |
| 499 | apicid |= uv_apicid_hibits; | ||
| 496 | return (1UL << UVH_IPI_INT_SEND_SHFT) | | 500 | return (1UL << UVH_IPI_INT_SEND_SHFT) | |
| 497 | ((apicid) << UVH_IPI_INT_APIC_ID_SHFT) | | 501 | ((apicid) << UVH_IPI_INT_APIC_ID_SHFT) | |
| 498 | (mode << UVH_IPI_INT_DELIVERY_MODE_SHFT) | | 502 | (mode << UVH_IPI_INT_DELIVERY_MODE_SHFT) | |
diff --git a/arch/x86/include/asm/uv/uv_mmrs.h b/arch/x86/include/asm/uv/uv_mmrs.h index b2f2d2e05cec..20cafeac7455 100644 --- a/arch/x86/include/asm/uv/uv_mmrs.h +++ b/arch/x86/include/asm/uv/uv_mmrs.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * | 5 | * |
| 6 | * SGI UV MMR definitions | 6 | * SGI UV MMR definitions |
| 7 | * | 7 | * |
| 8 | * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. | 8 | * Copyright (C) 2007-2010 Silicon Graphics, Inc. All rights reserved. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #ifndef _ASM_X86_UV_UV_MMRS_H | 11 | #ifndef _ASM_X86_UV_UV_MMRS_H |
| @@ -754,6 +754,23 @@ union uvh_lb_bau_sb_descriptor_base_u { | |||
| 754 | }; | 754 | }; |
| 755 | 755 | ||
| 756 | /* ========================================================================= */ | 756 | /* ========================================================================= */ |
| 757 | /* UVH_LB_TARGET_PHYSICAL_APIC_ID_MASK */ | ||
| 758 | /* ========================================================================= */ | ||
| 759 | #define UVH_LB_TARGET_PHYSICAL_APIC_ID_MASK 0x320130UL | ||
| 760 | #define UVH_LB_TARGET_PHYSICAL_APIC_ID_MASK_32 0x009f0 | ||
| 761 | |||
| 762 | #define UVH_LB_TARGET_PHYSICAL_APIC_ID_MASK_BIT_ENABLES_SHFT 0 | ||
| 763 | #define UVH_LB_TARGET_PHYSICAL_APIC_ID_MASK_BIT_ENABLES_MASK 0x00000000ffffffffUL | ||
| 764 | |||
| 765 | union uvh_lb_target_physical_apic_id_mask_u { | ||
| 766 | unsigned long v; | ||
| 767 | struct uvh_lb_target_physical_apic_id_mask_s { | ||
| 768 | unsigned long bit_enables : 32; /* RW */ | ||
| 769 | unsigned long rsvd_32_63 : 32; /* */ | ||
| 770 | } s; | ||
| 771 | }; | ||
| 772 | |||
| 773 | /* ========================================================================= */ | ||
| 757 | /* UVH_NODE_ID */ | 774 | /* UVH_NODE_ID */ |
| 758 | /* ========================================================================= */ | 775 | /* ========================================================================= */ |
| 759 | #define UVH_NODE_ID 0x0UL | 776 | #define UVH_NODE_ID 0x0UL |
| @@ -806,6 +823,78 @@ union uvh_node_present_table_u { | |||
| 806 | }; | 823 | }; |
| 807 | 824 | ||
| 808 | /* ========================================================================= */ | 825 | /* ========================================================================= */ |
| 826 | /* UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR */ | ||
| 827 | /* ========================================================================= */ | ||
| 828 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR 0x16000c8UL | ||
| 829 | |||
| 830 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR_BASE_SHFT 24 | ||
| 831 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR_BASE_MASK 0x00000000ff000000UL | ||
| 832 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR_M_ALIAS_SHFT 48 | ||
| 833 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR_M_ALIAS_MASK 0x001f000000000000UL | ||
| 834 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR_ENABLE_SHFT 63 | ||
| 835 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR_ENABLE_MASK 0x8000000000000000UL | ||
| 836 | |||
| 837 | union uvh_rh_gam_alias210_overlay_config_0_mmr_u { | ||
| 838 | unsigned long v; | ||
| 839 | struct uvh_rh_gam_alias210_overlay_config_0_mmr_s { | ||
| 840 | unsigned long rsvd_0_23: 24; /* */ | ||
| 841 | unsigned long base : 8; /* RW */ | ||
| 842 | unsigned long rsvd_32_47: 16; /* */ | ||
| 843 | unsigned long m_alias : 5; /* RW */ | ||
| 844 | unsigned long rsvd_53_62: 10; /* */ | ||
| 845 | unsigned long enable : 1; /* RW */ | ||
| 846 | } s; | ||
| 847 | }; | ||
| 848 | |||
| 849 | /* ========================================================================= */ | ||
| 850 | /* UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR */ | ||
| 851 | /* ========================================================================= */ | ||
| 852 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR 0x16000d8UL | ||
| 853 | |||
| 854 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR_BASE_SHFT 24 | ||
| 855 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR_BASE_MASK 0x00000000ff000000UL | ||
| 856 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR_M_ALIAS_SHFT 48 | ||
| 857 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR_M_ALIAS_MASK 0x001f000000000000UL | ||
| 858 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR_ENABLE_SHFT 63 | ||
| 859 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR_ENABLE_MASK 0x8000000000000000UL | ||
| 860 | |||
| 861 | union uvh_rh_gam_alias210_overlay_config_1_mmr_u { | ||
| 862 | unsigned long v; | ||
| 863 | struct uvh_rh_gam_alias210_overlay_config_1_mmr_s { | ||
| 864 | unsigned long rsvd_0_23: 24; /* */ | ||
| 865 | unsigned long base : 8; /* RW */ | ||
| 866 | unsigned long rsvd_32_47: 16; /* */ | ||
| 867 | unsigned long m_alias : 5; /* RW */ | ||
| 868 | unsigned long rsvd_53_62: 10; /* */ | ||
| 869 | unsigned long enable : 1; /* RW */ | ||
| 870 | } s; | ||
| 871 | }; | ||
| 872 | |||
| 873 | /* ========================================================================= */ | ||
| 874 | /* UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR */ | ||
| 875 | /* ========================================================================= */ | ||
| 876 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR 0x16000e8UL | ||
| 877 | |||
| 878 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR_BASE_SHFT 24 | ||
| 879 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR_BASE_MASK 0x00000000ff000000UL | ||
| 880 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR_M_ALIAS_SHFT 48 | ||
| 881 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR_M_ALIAS_MASK 0x001f000000000000UL | ||
| 882 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR_ENABLE_SHFT 63 | ||
| 883 | #define UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR_ENABLE_MASK 0x8000000000000000UL | ||
| 884 | |||
| 885 | union uvh_rh_gam_alias210_overlay_config_2_mmr_u { | ||
| 886 | unsigned long v; | ||
| 887 | struct uvh_rh_gam_alias210_overlay_config_2_mmr_s { | ||
| 888 | unsigned long rsvd_0_23: 24; /* */ | ||
| 889 | unsigned long base : 8; /* RW */ | ||
| 890 | unsigned long rsvd_32_47: 16; /* */ | ||
| 891 | unsigned long m_alias : 5; /* RW */ | ||
| 892 | unsigned long rsvd_53_62: 10; /* */ | ||
| 893 | unsigned long enable : 1; /* RW */ | ||
| 894 | } s; | ||
| 895 | }; | ||
| 896 | |||
| 897 | /* ========================================================================= */ | ||
| 809 | /* UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR */ | 898 | /* UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR */ |
| 810 | /* ========================================================================= */ | 899 | /* ========================================================================= */ |
| 811 | #define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR 0x16000d0UL | 900 | #define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR 0x16000d0UL |
| @@ -857,6 +946,29 @@ union uvh_rh_gam_alias210_redirect_config_2_mmr_u { | |||
| 857 | }; | 946 | }; |
| 858 | 947 | ||
| 859 | /* ========================================================================= */ | 948 | /* ========================================================================= */ |
| 949 | /* UVH_RH_GAM_CONFIG_MMR */ | ||
| 950 | /* ========================================================================= */ | ||
| 951 | #define UVH_RH_GAM_CONFIG_MMR 0x1600000UL | ||
| 952 | |||
| 953 | #define UVH_RH_GAM_CONFIG_MMR_M_SKT_SHFT 0 | ||
| 954 | #define UVH_RH_GAM_CONFIG_MMR_M_SKT_MASK 0x000000000000003fUL | ||
| 955 | #define UVH_RH_GAM_CONFIG_MMR_N_SKT_SHFT 6 | ||
| 956 | #define UVH_RH_GAM_CONFIG_MMR_N_SKT_MASK 0x00000000000003c0UL | ||
| 957 | #define UVH_RH_GAM_CONFIG_MMR_MMIOL_CFG_SHFT 12 | ||
| 958 | #define UVH_RH_GAM_CONFIG_MMR_MMIOL_CFG_MASK 0x0000000000001000UL | ||
| 959 | |||
| 960 | union uvh_rh_gam_config_mmr_u { | ||
| 961 | unsigned long v; | ||
| 962 | struct uvh_rh_gam_config_mmr_s { | ||
| 963 | unsigned long m_skt : 6; /* RW */ | ||
| 964 | unsigned long n_skt : 4; /* RW */ | ||
| 965 | unsigned long rsvd_10_11: 2; /* */ | ||
| 966 | unsigned long mmiol_cfg : 1; /* RW */ | ||
| 967 | unsigned long rsvd_13_63: 51; /* */ | ||
| 968 | } s; | ||
| 969 | }; | ||
| 970 | |||
| 971 | /* ========================================================================= */ | ||
| 860 | /* UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR */ | 972 | /* UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR */ |
| 861 | /* ========================================================================= */ | 973 | /* ========================================================================= */ |
| 862 | #define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR 0x1600010UL | 974 | #define UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR 0x1600010UL |
| @@ -987,97 +1099,5 @@ union uvh_rtc1_int_config_u { | |||
| 987 | } s; | 1099 | } s; |
| 988 | }; | 1100 | }; |
| 989 | 1101 | ||
| 990 | /* ========================================================================= */ | ||
| 991 | /* UVH_SI_ADDR_MAP_CONFIG */ | ||
| 992 | /* ========================================================================= */ | ||
| 993 | #define UVH_SI_ADDR_MAP_CONFIG 0xc80000UL | ||
| 994 | |||
| 995 | #define UVH_SI_ADDR_MAP_CONFIG_M_SKT_SHFT 0 | ||
| 996 | #define UVH_SI_ADDR_MAP_CONFIG_M_SKT_MASK 0x000000000000003fUL | ||
| 997 | #define UVH_SI_ADDR_MAP_CONFIG_N_SKT_SHFT 8 | ||
| 998 | #define UVH_SI_ADDR_MAP_CONFIG_N_SKT_MASK 0x0000000000000f00UL | ||
| 999 | |||
| 1000 | union uvh_si_addr_map_config_u { | ||
| 1001 | unsigned long v; | ||
| 1002 | struct uvh_si_addr_map_config_s { | ||
| 1003 | unsigned long m_skt : 6; /* RW */ | ||
| 1004 | unsigned long rsvd_6_7: 2; /* */ | ||
| 1005 | unsigned long n_skt : 4; /* RW */ | ||
| 1006 | unsigned long rsvd_12_63: 52; /* */ | ||
| 1007 | } s; | ||
| 1008 | }; | ||
| 1009 | |||
| 1010 | /* ========================================================================= */ | ||
| 1011 | /* UVH_SI_ALIAS0_OVERLAY_CONFIG */ | ||
| 1012 | /* ========================================================================= */ | ||
| 1013 | #define UVH_SI_ALIAS0_OVERLAY_CONFIG 0xc80008UL | ||
| 1014 | |||
| 1015 | #define UVH_SI_ALIAS0_OVERLAY_CONFIG_BASE_SHFT 24 | ||
| 1016 | #define UVH_SI_ALIAS0_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL | ||
| 1017 | #define UVH_SI_ALIAS0_OVERLAY_CONFIG_M_ALIAS_SHFT 48 | ||
| 1018 | #define UVH_SI_ALIAS0_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL | ||
| 1019 | #define UVH_SI_ALIAS0_OVERLAY_CONFIG_ENABLE_SHFT 63 | ||
| 1020 | #define UVH_SI_ALIAS0_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL | ||
| 1021 | |||
| 1022 | union uvh_si_alias0_overlay_config_u { | ||
| 1023 | unsigned long v; | ||
| 1024 | struct uvh_si_alias0_overlay_config_s { | ||
| 1025 | unsigned long rsvd_0_23: 24; /* */ | ||
| 1026 | unsigned long base : 8; /* RW */ | ||
| 1027 | unsigned long rsvd_32_47: 16; /* */ | ||
| 1028 | unsigned long m_alias : 5; /* RW */ | ||
| 1029 | unsigned long rsvd_53_62: 10; /* */ | ||
| 1030 | unsigned long enable : 1; /* RW */ | ||
| 1031 | } s; | ||
| 1032 | }; | ||
| 1033 | |||
| 1034 | /* ========================================================================= */ | ||
| 1035 | /* UVH_SI_ALIAS1_OVERLAY_CONFIG */ | ||
| 1036 | /* ========================================================================= */ | ||
| 1037 | #define UVH_SI_ALIAS1_OVERLAY_CONFIG 0xc80010UL | ||
| 1038 | |||
| 1039 | #define UVH_SI_ALIAS1_OVERLAY_CONFIG_BASE_SHFT 24 | ||
| 1040 | #define UVH_SI_ALIAS1_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL | ||
| 1041 | #define UVH_SI_ALIAS1_OVERLAY_CONFIG_M_ALIAS_SHFT 48 | ||
| 1042 | #define UVH_SI_ALIAS1_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL | ||
| 1043 | #define UVH_SI_ALIAS1_OVERLAY_CONFIG_ENABLE_SHFT 63 | ||
| 1044 | #define UVH_SI_ALIAS1_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL | ||
| 1045 | |||
| 1046 | union uvh_si_alias1_overlay_config_u { | ||
| 1047 | unsigned long v; | ||
| 1048 | struct uvh_si_alias1_overlay_config_s { | ||
| 1049 | unsigned long rsvd_0_23: 24; /* */ | ||
| 1050 | unsigned long base : 8; /* RW */ | ||
| 1051 | unsigned long rsvd_32_47: 16; /* */ | ||
| 1052 | unsigned long m_alias : 5; /* RW */ | ||
| 1053 | unsigned long rsvd_53_62: 10; /* */ | ||
| 1054 | unsigned long enable : 1; /* RW */ | ||
| 1055 | } s; | ||
| 1056 | }; | ||
| 1057 | |||
| 1058 | /* ========================================================================= */ | ||
| 1059 | /* UVH_SI_ALIAS2_OVERLAY_CONFIG */ | ||
| 1060 | /* ========================================================================= */ | ||
| 1061 | #define UVH_SI_ALIAS2_OVERLAY_CONFIG 0xc80018UL | ||
| 1062 | |||
| 1063 | #define UVH_SI_ALIAS2_OVERLAY_CONFIG_BASE_SHFT 24 | ||
| 1064 | #define UVH_SI_ALIAS2_OVERLAY_CONFIG_BASE_MASK 0x00000000ff000000UL | ||
| 1065 | #define UVH_SI_ALIAS2_OVERLAY_CONFIG_M_ALIAS_SHFT 48 | ||
| 1066 | #define UVH_SI_ALIAS2_OVERLAY_CONFIG_M_ALIAS_MASK 0x001f000000000000UL | ||
| 1067 | #define UVH_SI_ALIAS2_OVERLAY_CONFIG_ENABLE_SHFT 63 | ||
| 1068 | #define UVH_SI_ALIAS2_OVERLAY_CONFIG_ENABLE_MASK 0x8000000000000000UL | ||
| 1069 | |||
| 1070 | union uvh_si_alias2_overlay_config_u { | ||
| 1071 | unsigned long v; | ||
| 1072 | struct uvh_si_alias2_overlay_config_s { | ||
| 1073 | unsigned long rsvd_0_23: 24; /* */ | ||
| 1074 | unsigned long base : 8; /* RW */ | ||
| 1075 | unsigned long rsvd_32_47: 16; /* */ | ||
| 1076 | unsigned long m_alias : 5; /* RW */ | ||
| 1077 | unsigned long rsvd_53_62: 10; /* */ | ||
| 1078 | unsigned long enable : 1; /* RW */ | ||
| 1079 | } s; | ||
| 1080 | }; | ||
| 1081 | |||
| 1082 | 1102 | ||
| 1083 | #endif /* _ASM_X86_UV_UV_MMRS_H */ | 1103 | #endif /* __ASM_UV_MMRS_X86_H__ */ |
diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h index e8506c1f0c55..1c10c88ee4e1 100644 --- a/arch/x86/include/asm/xen/interface.h +++ b/arch/x86/include/asm/xen/interface.h | |||
| @@ -61,9 +61,9 @@ DEFINE_GUEST_HANDLE(void); | |||
| 61 | #define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) | 61 | #define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) |
| 62 | #endif | 62 | #endif |
| 63 | 63 | ||
| 64 | #ifndef machine_to_phys_mapping | 64 | #define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START) |
| 65 | #define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START) | 65 | #define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END) |
| 66 | #endif | 66 | #define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>__MACH2PHYS_SHIFT) |
| 67 | 67 | ||
| 68 | /* Maximum number of virtual CPUs in multi-processor guests. */ | 68 | /* Maximum number of virtual CPUs in multi-processor guests. */ |
| 69 | #define MAX_VIRT_CPUS 32 | 69 | #define MAX_VIRT_CPUS 32 |
diff --git a/arch/x86/include/asm/xen/interface_32.h b/arch/x86/include/asm/xen/interface_32.h index 42a7e004ae5c..8413688b2571 100644 --- a/arch/x86/include/asm/xen/interface_32.h +++ b/arch/x86/include/asm/xen/interface_32.h | |||
| @@ -32,6 +32,11 @@ | |||
| 32 | /* And the trap vector is... */ | 32 | /* And the trap vector is... */ |
| 33 | #define TRAP_INSTR "int $0x82" | 33 | #define TRAP_INSTR "int $0x82" |
| 34 | 34 | ||
| 35 | #define __MACH2PHYS_VIRT_START 0xF5800000 | ||
| 36 | #define __MACH2PHYS_VIRT_END 0xF6800000 | ||
| 37 | |||
| 38 | #define __MACH2PHYS_SHIFT 2 | ||
| 39 | |||
| 35 | /* | 40 | /* |
| 36 | * Virtual addresses beyond this are not modifiable by guest OSes. The | 41 | * Virtual addresses beyond this are not modifiable by guest OSes. The |
| 37 | * machine->physical mapping table starts at this address, read-only. | 42 | * machine->physical mapping table starts at this address, read-only. |
diff --git a/arch/x86/include/asm/xen/interface_64.h b/arch/x86/include/asm/xen/interface_64.h index 100d2662b97c..839a4811cf98 100644 --- a/arch/x86/include/asm/xen/interface_64.h +++ b/arch/x86/include/asm/xen/interface_64.h | |||
| @@ -39,18 +39,7 @@ | |||
| 39 | #define __HYPERVISOR_VIRT_END 0xFFFF880000000000 | 39 | #define __HYPERVISOR_VIRT_END 0xFFFF880000000000 |
| 40 | #define __MACH2PHYS_VIRT_START 0xFFFF800000000000 | 40 | #define __MACH2PHYS_VIRT_START 0xFFFF800000000000 |
| 41 | #define __MACH2PHYS_VIRT_END 0xFFFF804000000000 | 41 | #define __MACH2PHYS_VIRT_END 0xFFFF804000000000 |
| 42 | 42 | #define __MACH2PHYS_SHIFT 3 | |
| 43 | #ifndef HYPERVISOR_VIRT_START | ||
| 44 | #define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) | ||
| 45 | #define HYPERVISOR_VIRT_END mk_unsigned_long(__HYPERVISOR_VIRT_END) | ||
| 46 | #endif | ||
| 47 | |||
| 48 | #define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START) | ||
| 49 | #define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END) | ||
| 50 | #define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>3) | ||
| 51 | #ifndef machine_to_phys_mapping | ||
| 52 | #define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START) | ||
| 53 | #endif | ||
| 54 | 43 | ||
| 55 | /* | 44 | /* |
| 56 | * int HYPERVISOR_set_segment_base(unsigned int which, unsigned long base) | 45 | * int HYPERVISOR_set_segment_base(unsigned int which, unsigned long base) |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index dd8c1414b3d5..8760cc60a21c 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
| 7 | #include <linux/pfn.h> | 7 | #include <linux/pfn.h> |
| 8 | #include <linux/mm.h> | ||
| 8 | 9 | ||
| 9 | #include <asm/uaccess.h> | 10 | #include <asm/uaccess.h> |
| 10 | #include <asm/page.h> | 11 | #include <asm/page.h> |
| @@ -35,6 +36,8 @@ typedef struct xpaddr { | |||
| 35 | #define MAX_DOMAIN_PAGES \ | 36 | #define MAX_DOMAIN_PAGES \ |
| 36 | ((unsigned long)((u64)CONFIG_XEN_MAX_DOMAIN_MEMORY * 1024 * 1024 * 1024 / PAGE_SIZE)) | 37 | ((unsigned long)((u64)CONFIG_XEN_MAX_DOMAIN_MEMORY * 1024 * 1024 * 1024 / PAGE_SIZE)) |
| 37 | 38 | ||
| 39 | extern unsigned long *machine_to_phys_mapping; | ||
| 40 | extern unsigned int machine_to_phys_order; | ||
| 38 | 41 | ||
| 39 | extern unsigned long get_phys_to_machine(unsigned long pfn); | 42 | extern unsigned long get_phys_to_machine(unsigned long pfn); |
| 40 | extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn); | 43 | extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn); |
| @@ -69,10 +72,8 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn) | |||
| 69 | if (xen_feature(XENFEAT_auto_translated_physmap)) | 72 | if (xen_feature(XENFEAT_auto_translated_physmap)) |
| 70 | return mfn; | 73 | return mfn; |
| 71 | 74 | ||
| 72 | #if 0 | ||
| 73 | if (unlikely((mfn >> machine_to_phys_order) != 0)) | 75 | if (unlikely((mfn >> machine_to_phys_order) != 0)) |
| 74 | return max_mapnr; | 76 | return ~0; |
| 75 | #endif | ||
| 76 | 77 | ||
| 77 | pfn = 0; | 78 | pfn = 0; |
| 78 | /* | 79 | /* |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 850657d1b0ed..3f838d537392 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
| @@ -52,7 +52,6 @@ | |||
| 52 | #include <asm/mce.h> | 52 | #include <asm/mce.h> |
| 53 | #include <asm/kvm_para.h> | 53 | #include <asm/kvm_para.h> |
| 54 | #include <asm/tsc.h> | 54 | #include <asm/tsc.h> |
| 55 | #include <asm/atomic.h> | ||
| 56 | 55 | ||
| 57 | unsigned int num_processors; | 56 | unsigned int num_processors; |
| 58 | 57 | ||
diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c index cefd6942f0e9..62f6e1e55b90 100644 --- a/arch/x86/kernel/apic/hw_nmi.c +++ b/arch/x86/kernel/apic/hw_nmi.c | |||
| @@ -17,15 +17,16 @@ | |||
| 17 | #include <linux/nmi.h> | 17 | #include <linux/nmi.h> |
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | 19 | ||
| 20 | /* For reliability, we're prepared to waste bits here. */ | ||
| 21 | static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly; | ||
| 22 | |||
| 23 | u64 hw_nmi_get_sample_period(void) | 20 | u64 hw_nmi_get_sample_period(void) |
| 24 | { | 21 | { |
| 25 | return (u64)(cpu_khz) * 1000 * 60; | 22 | return (u64)(cpu_khz) * 1000 * 60; |
| 26 | } | 23 | } |
| 27 | 24 | ||
| 28 | #ifdef ARCH_HAS_NMI_WATCHDOG | 25 | #ifdef ARCH_HAS_NMI_WATCHDOG |
| 26 | |||
| 27 | /* For reliability, we're prepared to waste bits here. */ | ||
| 28 | static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly; | ||
| 29 | |||
| 29 | void arch_trigger_all_cpu_backtrace(void) | 30 | void arch_trigger_all_cpu_backtrace(void) |
| 30 | { | 31 | { |
| 31 | int i; | 32 | int i; |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index ed4118de249e..c1c52c341f40 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
| @@ -44,6 +44,8 @@ static u64 gru_start_paddr, gru_end_paddr; | |||
| 44 | static union uvh_apicid uvh_apicid; | 44 | static union uvh_apicid uvh_apicid; |
| 45 | int uv_min_hub_revision_id; | 45 | int uv_min_hub_revision_id; |
| 46 | EXPORT_SYMBOL_GPL(uv_min_hub_revision_id); | 46 | EXPORT_SYMBOL_GPL(uv_min_hub_revision_id); |
| 47 | unsigned int uv_apicid_hibits; | ||
| 48 | EXPORT_SYMBOL_GPL(uv_apicid_hibits); | ||
| 47 | static DEFINE_SPINLOCK(uv_nmi_lock); | 49 | static DEFINE_SPINLOCK(uv_nmi_lock); |
| 48 | 50 | ||
| 49 | static inline bool is_GRU_range(u64 start, u64 end) | 51 | static inline bool is_GRU_range(u64 start, u64 end) |
| @@ -85,6 +87,23 @@ static void __init early_get_apic_pnode_shift(void) | |||
| 85 | uvh_apicid.s.pnode_shift = UV_APIC_PNODE_SHIFT; | 87 | uvh_apicid.s.pnode_shift = UV_APIC_PNODE_SHIFT; |
| 86 | } | 88 | } |
| 87 | 89 | ||
| 90 | /* | ||
| 91 | * Add an extra bit as dictated by bios to the destination apicid of | ||
| 92 | * interrupts potentially passing through the UV HUB. This prevents | ||
| 93 | * a deadlock between interrupts and IO port operations. | ||
| 94 | */ | ||
| 95 | static void __init uv_set_apicid_hibit(void) | ||
| 96 | { | ||
| 97 | union uvh_lb_target_physical_apic_id_mask_u apicid_mask; | ||
| 98 | unsigned long *mmr; | ||
| 99 | |||
| 100 | mmr = early_ioremap(UV_LOCAL_MMR_BASE | | ||
| 101 | UVH_LB_TARGET_PHYSICAL_APIC_ID_MASK, sizeof(*mmr)); | ||
| 102 | apicid_mask.v = *mmr; | ||
| 103 | early_iounmap(mmr, sizeof(*mmr)); | ||
| 104 | uv_apicid_hibits = apicid_mask.s.bit_enables & UV_APICID_HIBIT_MASK; | ||
| 105 | } | ||
| 106 | |||
| 88 | static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 107 | static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
| 89 | { | 108 | { |
| 90 | int nodeid; | 109 | int nodeid; |
| @@ -102,6 +121,7 @@ static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
| 102 | __get_cpu_var(x2apic_extra_bits) = | 121 | __get_cpu_var(x2apic_extra_bits) = |
| 103 | nodeid << (uvh_apicid.s.pnode_shift - 1); | 122 | nodeid << (uvh_apicid.s.pnode_shift - 1); |
| 104 | uv_system_type = UV_NON_UNIQUE_APIC; | 123 | uv_system_type = UV_NON_UNIQUE_APIC; |
| 124 | uv_set_apicid_hibit(); | ||
| 105 | return 1; | 125 | return 1; |
| 106 | } | 126 | } |
| 107 | } | 127 | } |
| @@ -155,6 +175,7 @@ static int __cpuinit uv_wakeup_secondary(int phys_apicid, unsigned long start_ri | |||
| 155 | int pnode; | 175 | int pnode; |
| 156 | 176 | ||
| 157 | pnode = uv_apicid_to_pnode(phys_apicid); | 177 | pnode = uv_apicid_to_pnode(phys_apicid); |
| 178 | phys_apicid |= uv_apicid_hibits; | ||
| 158 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | 179 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
| 159 | (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | | 180 | (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | |
| 160 | ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | | 181 | ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | |
| @@ -236,7 +257,7 @@ static unsigned int uv_cpu_mask_to_apicid(const struct cpumask *cpumask) | |||
| 236 | int cpu = cpumask_first(cpumask); | 257 | int cpu = cpumask_first(cpumask); |
| 237 | 258 | ||
| 238 | if ((unsigned)cpu < nr_cpu_ids) | 259 | if ((unsigned)cpu < nr_cpu_ids) |
| 239 | return per_cpu(x86_cpu_to_apicid, cpu); | 260 | return per_cpu(x86_cpu_to_apicid, cpu) | uv_apicid_hibits; |
| 240 | else | 261 | else |
| 241 | return BAD_APICID; | 262 | return BAD_APICID; |
| 242 | } | 263 | } |
| @@ -255,7 +276,7 @@ uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | |||
| 255 | if (cpumask_test_cpu(cpu, cpu_online_mask)) | 276 | if (cpumask_test_cpu(cpu, cpu_online_mask)) |
| 256 | break; | 277 | break; |
| 257 | } | 278 | } |
| 258 | return per_cpu(x86_cpu_to_apicid, cpu); | 279 | return per_cpu(x86_cpu_to_apicid, cpu) | uv_apicid_hibits; |
| 259 | } | 280 | } |
| 260 | 281 | ||
| 261 | static unsigned int x2apic_get_apic_id(unsigned long x) | 282 | static unsigned int x2apic_get_apic_id(unsigned long x) |
| @@ -379,14 +400,14 @@ struct redir_addr { | |||
| 379 | #define DEST_SHIFT UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR_DEST_BASE_SHFT | 400 | #define DEST_SHIFT UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR_DEST_BASE_SHFT |
| 380 | 401 | ||
| 381 | static __initdata struct redir_addr redir_addrs[] = { | 402 | static __initdata struct redir_addr redir_addrs[] = { |
| 382 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR, UVH_SI_ALIAS0_OVERLAY_CONFIG}, | 403 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR, UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_0_MMR}, |
| 383 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR, UVH_SI_ALIAS1_OVERLAY_CONFIG}, | 404 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_1_MMR, UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_1_MMR}, |
| 384 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR, UVH_SI_ALIAS2_OVERLAY_CONFIG}, | 405 | {UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_2_MMR, UVH_RH_GAM_ALIAS210_OVERLAY_CONFIG_2_MMR}, |
| 385 | }; | 406 | }; |
| 386 | 407 | ||
| 387 | static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) | 408 | static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) |
| 388 | { | 409 | { |
| 389 | union uvh_si_alias0_overlay_config_u alias; | 410 | union uvh_rh_gam_alias210_overlay_config_2_mmr_u alias; |
| 390 | union uvh_rh_gam_alias210_redirect_config_2_mmr_u redirect; | 411 | union uvh_rh_gam_alias210_redirect_config_2_mmr_u redirect; |
| 391 | int i; | 412 | int i; |
| 392 | 413 | ||
| @@ -660,7 +681,7 @@ void uv_nmi_init(void) | |||
| 660 | 681 | ||
| 661 | void __init uv_system_init(void) | 682 | void __init uv_system_init(void) |
| 662 | { | 683 | { |
| 663 | union uvh_si_addr_map_config_u m_n_config; | 684 | union uvh_rh_gam_config_mmr_u m_n_config; |
| 664 | union uvh_node_id_u node_id; | 685 | union uvh_node_id_u node_id; |
| 665 | unsigned long gnode_upper, lowmem_redir_base, lowmem_redir_size; | 686 | unsigned long gnode_upper, lowmem_redir_base, lowmem_redir_size; |
| 666 | int bytes, nid, cpu, lcpu, pnode, blade, i, j, m_val, n_val; | 687 | int bytes, nid, cpu, lcpu, pnode, blade, i, j, m_val, n_val; |
| @@ -670,7 +691,7 @@ void __init uv_system_init(void) | |||
| 670 | 691 | ||
| 671 | map_low_mmrs(); | 692 | map_low_mmrs(); |
| 672 | 693 | ||
| 673 | m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG); | 694 | m_n_config.v = uv_read_local_mmr(UVH_RH_GAM_CONFIG_MMR ); |
| 674 | m_val = m_n_config.s.m_skt; | 695 | m_val = m_n_config.s.m_skt; |
| 675 | n_val = m_n_config.s.n_skt; | 696 | n_val = m_n_config.s.n_skt; |
| 676 | mmr_base = | 697 | mmr_base = |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index ed6310183efb..6d75b9145b13 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -381,6 +381,20 @@ static void release_pmc_hardware(void) {} | |||
| 381 | 381 | ||
| 382 | #endif | 382 | #endif |
| 383 | 383 | ||
| 384 | static bool check_hw_exists(void) | ||
| 385 | { | ||
| 386 | u64 val, val_new = 0; | ||
| 387 | int ret = 0; | ||
| 388 | |||
| 389 | val = 0xabcdUL; | ||
| 390 | ret |= checking_wrmsrl(x86_pmu.perfctr, val); | ||
| 391 | ret |= rdmsrl_safe(x86_pmu.perfctr, &val_new); | ||
| 392 | if (ret || val != val_new) | ||
| 393 | return false; | ||
| 394 | |||
| 395 | return true; | ||
| 396 | } | ||
| 397 | |||
| 384 | static void reserve_ds_buffers(void); | 398 | static void reserve_ds_buffers(void); |
| 385 | static void release_ds_buffers(void); | 399 | static void release_ds_buffers(void); |
| 386 | 400 | ||
| @@ -1372,6 +1386,12 @@ void __init init_hw_perf_events(void) | |||
| 1372 | 1386 | ||
| 1373 | pmu_check_apic(); | 1387 | pmu_check_apic(); |
| 1374 | 1388 | ||
| 1389 | /* sanity check that the hardware exists or is emulated */ | ||
| 1390 | if (!check_hw_exists()) { | ||
| 1391 | pr_cont("Broken PMU hardware detected, software events only.\n"); | ||
| 1392 | return; | ||
| 1393 | } | ||
| 1394 | |||
| 1375 | pr_cont("%s PMU driver.\n", x86_pmu.name); | 1395 | pr_cont("%s PMU driver.\n", x86_pmu.name); |
| 1376 | 1396 | ||
| 1377 | if (x86_pmu.quirks) | 1397 | if (x86_pmu.quirks) |
diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c index 46d58448c3af..e421b8cd6944 100644 --- a/arch/x86/kernel/cpu/perf_event_amd.c +++ b/arch/x86/kernel/cpu/perf_event_amd.c | |||
| @@ -280,11 +280,11 @@ static struct amd_nb *amd_alloc_nb(int cpu, int nb_id) | |||
| 280 | struct amd_nb *nb; | 280 | struct amd_nb *nb; |
| 281 | int i; | 281 | int i; |
| 282 | 282 | ||
| 283 | nb = kmalloc(sizeof(struct amd_nb), GFP_KERNEL); | 283 | nb = kmalloc_node(sizeof(struct amd_nb), GFP_KERNEL | __GFP_ZERO, |
| 284 | cpu_to_node(cpu)); | ||
| 284 | if (!nb) | 285 | if (!nb) |
| 285 | return NULL; | 286 | return NULL; |
| 286 | 287 | ||
| 287 | memset(nb, 0, sizeof(*nb)); | ||
| 288 | nb->nb_id = nb_id; | 288 | nb->nb_id = nb_id; |
| 289 | 289 | ||
| 290 | /* | 290 | /* |
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index 1b7b31ab7d86..212a6a42527c 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 34 | #include <linux/poll.h> | 34 | #include <linux/poll.h> |
| 35 | #include <linux/smp.h> | 35 | #include <linux/smp.h> |
| 36 | #include <linux/smp_lock.h> | ||
| 37 | #include <linux/major.h> | 36 | #include <linux/major.h> |
| 38 | #include <linux/fs.h> | 37 | #include <linux/fs.h> |
| 39 | #include <linux/device.h> | 38 | #include <linux/device.h> |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 59e175e89599..591e60104278 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
| @@ -395,7 +395,7 @@ sysenter_past_esp: | |||
| 395 | * A tiny bit of offset fixup is necessary - 4*4 means the 4 words | 395 | * A tiny bit of offset fixup is necessary - 4*4 means the 4 words |
| 396 | * pushed above; +8 corresponds to copy_thread's esp0 setting. | 396 | * pushed above; +8 corresponds to copy_thread's esp0 setting. |
| 397 | */ | 397 | */ |
| 398 | pushl_cfi (TI_sysenter_return-THREAD_SIZE_asm+8+4*4)(%esp) | 398 | pushl_cfi ((TI_sysenter_return)-THREAD_SIZE_asm+8+4*4)(%esp) |
| 399 | CFI_REL_OFFSET eip, 0 | 399 | CFI_REL_OFFSET eip, 0 |
| 400 | 400 | ||
| 401 | pushl_cfi %eax | 401 | pushl_cfi %eax |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index fe2690d71c0c..e3ba417e8697 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
| @@ -295,6 +295,7 @@ ENDPROC(native_usergs_sysret64) | |||
| 295 | .endm | 295 | .endm |
| 296 | 296 | ||
| 297 | /* save partial stack frame */ | 297 | /* save partial stack frame */ |
| 298 | .pushsection .kprobes.text, "ax" | ||
| 298 | ENTRY(save_args) | 299 | ENTRY(save_args) |
| 299 | XCPT_FRAME | 300 | XCPT_FRAME |
| 300 | cld | 301 | cld |
| @@ -334,6 +335,7 @@ ENTRY(save_args) | |||
| 334 | ret | 335 | ret |
| 335 | CFI_ENDPROC | 336 | CFI_ENDPROC |
| 336 | END(save_args) | 337 | END(save_args) |
| 338 | .popsection | ||
| 337 | 339 | ||
| 338 | ENTRY(save_rest) | 340 | ENTRY(save_rest) |
| 339 | PARTIAL_FRAME 1 REST_SKIP+8 | 341 | PARTIAL_FRAME 1 REST_SKIP+8 |
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index ff15c9dcc25d..42c594254507 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c | |||
| @@ -433,6 +433,10 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args) | |||
| 433 | dr6_p = (unsigned long *)ERR_PTR(args->err); | 433 | dr6_p = (unsigned long *)ERR_PTR(args->err); |
| 434 | dr6 = *dr6_p; | 434 | dr6 = *dr6_p; |
| 435 | 435 | ||
| 436 | /* If it's a single step, TRAP bits are random */ | ||
| 437 | if (dr6 & DR_STEP) | ||
| 438 | return NOTIFY_DONE; | ||
| 439 | |||
| 436 | /* Do an early return if no trap bits are set in DR6 */ | 440 | /* Do an early return if no trap bits are set in DR6 */ |
| 437 | if ((dr6 & DR_TRAP_BITS) == 0) | 441 | if ((dr6 & DR_TRAP_BITS) == 0) |
| 438 | return NOTIFY_DONE; | 442 | return NOTIFY_DONE; |
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index ec592caac4b4..cd21b654dec6 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c | |||
| @@ -315,14 +315,18 @@ static void kgdb_remove_all_hw_break(void) | |||
| 315 | if (!breakinfo[i].enabled) | 315 | if (!breakinfo[i].enabled) |
| 316 | continue; | 316 | continue; |
| 317 | bp = *per_cpu_ptr(breakinfo[i].pev, cpu); | 317 | bp = *per_cpu_ptr(breakinfo[i].pev, cpu); |
| 318 | if (bp->attr.disabled == 1) | 318 | if (!bp->attr.disabled) { |
| 319 | arch_uninstall_hw_breakpoint(bp); | ||
| 320 | bp->attr.disabled = 1; | ||
| 319 | continue; | 321 | continue; |
| 322 | } | ||
| 320 | if (dbg_is_early) | 323 | if (dbg_is_early) |
| 321 | early_dr7 &= ~encode_dr7(i, breakinfo[i].len, | 324 | early_dr7 &= ~encode_dr7(i, breakinfo[i].len, |
| 322 | breakinfo[i].type); | 325 | breakinfo[i].type); |
| 323 | else | 326 | else if (hw_break_release_slot(i)) |
| 324 | arch_uninstall_hw_breakpoint(bp); | 327 | printk(KERN_ERR "KGDB: hw bpt remove failed %lx\n", |
| 325 | bp->attr.disabled = 1; | 328 | breakinfo[i].addr); |
| 329 | breakinfo[i].enabled = 0; | ||
| 326 | } | 330 | } |
| 327 | } | 331 | } |
| 328 | 332 | ||
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index e1af7c055c7d..ce0cb4721c9a 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
| @@ -212,7 +212,7 @@ static int install_equiv_cpu_table(const u8 *buf) | |||
| 212 | return 0; | 212 | return 0; |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size); | 215 | equiv_cpu_table = vmalloc(size); |
| 216 | if (!equiv_cpu_table) { | 216 | if (!equiv_cpu_table) { |
| 217 | pr_err("failed to allocate equivalent CPU table\n"); | 217 | pr_err("failed to allocate equivalent CPU table\n"); |
| 218 | return 0; | 218 | return 0; |
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c index 71825806cd44..ac861b8348e2 100644 --- a/arch/x86/kernel/mmconf-fam10h_64.c +++ b/arch/x86/kernel/mmconf-fam10h_64.c | |||
| @@ -25,7 +25,6 @@ struct pci_hostbridge_probe { | |||
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | static u64 __cpuinitdata fam10h_pci_mmconf_base; | 27 | static u64 __cpuinitdata fam10h_pci_mmconf_base; |
| 28 | static int __cpuinitdata fam10h_pci_mmconf_base_status; | ||
| 29 | 28 | ||
| 30 | static struct pci_hostbridge_probe pci_probes[] __cpuinitdata = { | 29 | static struct pci_hostbridge_probe pci_probes[] __cpuinitdata = { |
| 31 | { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1200 }, | 30 | { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1200 }, |
| @@ -44,10 +43,12 @@ static int __cpuinit cmp_range(const void *x1, const void *x2) | |||
| 44 | return start1 - start2; | 43 | return start1 - start2; |
| 45 | } | 44 | } |
| 46 | 45 | ||
| 47 | /*[47:0] */ | 46 | #define MMCONF_UNIT (1ULL << FAM10H_MMIO_CONF_BASE_SHIFT) |
| 48 | /* need to avoid (0xfd<<32) and (0xfe<<32), ht used space */ | 47 | #define MMCONF_MASK (~(MMCONF_UNIT - 1)) |
| 48 | #define MMCONF_SIZE (MMCONF_UNIT << 8) | ||
| 49 | /* need to avoid (0xfd<<32), (0xfe<<32), and (0xff<<32), ht used space */ | ||
| 49 | #define FAM10H_PCI_MMCONF_BASE (0xfcULL<<32) | 50 | #define FAM10H_PCI_MMCONF_BASE (0xfcULL<<32) |
| 50 | #define BASE_VALID(b) ((b != (0xfdULL << 32)) && (b != (0xfeULL << 32))) | 51 | #define BASE_VALID(b) ((b) + MMCONF_SIZE <= (0xfdULL<<32) || (b) >= (1ULL<<40)) |
| 51 | static void __cpuinit get_fam10h_pci_mmconf_base(void) | 52 | static void __cpuinit get_fam10h_pci_mmconf_base(void) |
| 52 | { | 53 | { |
| 53 | int i; | 54 | int i; |
| @@ -64,12 +65,11 @@ static void __cpuinit get_fam10h_pci_mmconf_base(void) | |||
| 64 | struct range range[8]; | 65 | struct range range[8]; |
| 65 | 66 | ||
| 66 | /* only try to get setting from BSP */ | 67 | /* only try to get setting from BSP */ |
| 67 | /* -1 or 1 */ | 68 | if (fam10h_pci_mmconf_base) |
| 68 | if (fam10h_pci_mmconf_base_status) | ||
| 69 | return; | 69 | return; |
| 70 | 70 | ||
| 71 | if (!early_pci_allowed()) | 71 | if (!early_pci_allowed()) |
| 72 | goto fail; | 72 | return; |
| 73 | 73 | ||
| 74 | found = 0; | 74 | found = 0; |
| 75 | for (i = 0; i < ARRAY_SIZE(pci_probes); i++) { | 75 | for (i = 0; i < ARRAY_SIZE(pci_probes); i++) { |
| @@ -91,7 +91,7 @@ static void __cpuinit get_fam10h_pci_mmconf_base(void) | |||
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | if (!found) | 93 | if (!found) |
| 94 | goto fail; | 94 | return; |
| 95 | 95 | ||
| 96 | /* SYS_CFG */ | 96 | /* SYS_CFG */ |
| 97 | address = MSR_K8_SYSCFG; | 97 | address = MSR_K8_SYSCFG; |
| @@ -99,16 +99,16 @@ static void __cpuinit get_fam10h_pci_mmconf_base(void) | |||
| 99 | 99 | ||
| 100 | /* TOP_MEM2 is not enabled? */ | 100 | /* TOP_MEM2 is not enabled? */ |
| 101 | if (!(val & (1<<21))) { | 101 | if (!(val & (1<<21))) { |
| 102 | tom2 = 0; | 102 | tom2 = 1ULL << 32; |
| 103 | } else { | 103 | } else { |
| 104 | /* TOP_MEM2 */ | 104 | /* TOP_MEM2 */ |
| 105 | address = MSR_K8_TOP_MEM2; | 105 | address = MSR_K8_TOP_MEM2; |
| 106 | rdmsrl(address, val); | 106 | rdmsrl(address, val); |
| 107 | tom2 = val & (0xffffULL<<32); | 107 | tom2 = max(val & 0xffffff800000ULL, 1ULL << 32); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | if (base <= tom2) | 110 | if (base <= tom2) |
| 111 | base = tom2 + (1ULL<<32); | 111 | base = (tom2 + 2 * MMCONF_UNIT - 1) & MMCONF_MASK; |
| 112 | 112 | ||
| 113 | /* | 113 | /* |
| 114 | * need to check if the range is in the high mmio range that is | 114 | * need to check if the range is in the high mmio range that is |
| @@ -123,11 +123,11 @@ static void __cpuinit get_fam10h_pci_mmconf_base(void) | |||
| 123 | if (!(reg & 3)) | 123 | if (!(reg & 3)) |
| 124 | continue; | 124 | continue; |
| 125 | 125 | ||
| 126 | start = (((u64)reg) << 8) & (0xffULL << 32); /* 39:16 on 31:8*/ | 126 | start = (u64)(reg & 0xffffff00) << 8; /* 39:16 on 31:8*/ |
| 127 | reg = read_pci_config(bus, slot, 1, 0x84 + (i << 3)); | 127 | reg = read_pci_config(bus, slot, 1, 0x84 + (i << 3)); |
| 128 | end = (((u64)reg) << 8) & (0xffULL << 32); /* 39:16 on 31:8*/ | 128 | end = ((u64)(reg & 0xffffff00) << 8) | 0xffff; /* 39:16 on 31:8*/ |
| 129 | 129 | ||
| 130 | if (!end) | 130 | if (end < tom2) |
| 131 | continue; | 131 | continue; |
| 132 | 132 | ||
| 133 | range[hi_mmio_num].start = start; | 133 | range[hi_mmio_num].start = start; |
| @@ -143,32 +143,27 @@ static void __cpuinit get_fam10h_pci_mmconf_base(void) | |||
| 143 | 143 | ||
| 144 | if (range[hi_mmio_num - 1].end < base) | 144 | if (range[hi_mmio_num - 1].end < base) |
| 145 | goto out; | 145 | goto out; |
| 146 | if (range[0].start > base) | 146 | if (range[0].start > base + MMCONF_SIZE) |
| 147 | goto out; | 147 | goto out; |
| 148 | 148 | ||
| 149 | /* need to find one window */ | 149 | /* need to find one window */ |
| 150 | base = range[0].start - (1ULL << 32); | 150 | base = (range[0].start & MMCONF_MASK) - MMCONF_UNIT; |
| 151 | if ((base > tom2) && BASE_VALID(base)) | 151 | if ((base > tom2) && BASE_VALID(base)) |
| 152 | goto out; | 152 | goto out; |
| 153 | base = range[hi_mmio_num - 1].end + (1ULL << 32); | 153 | base = (range[hi_mmio_num - 1].end + MMCONF_UNIT) & MMCONF_MASK; |
| 154 | if ((base > tom2) && BASE_VALID(base)) | 154 | if (BASE_VALID(base)) |
| 155 | goto out; | 155 | goto out; |
| 156 | /* need to find window between ranges */ | 156 | /* need to find window between ranges */ |
| 157 | if (hi_mmio_num > 1) | 157 | for (i = 1; i < hi_mmio_num; i++) { |
| 158 | for (i = 0; i < hi_mmio_num - 1; i++) { | 158 | base = (range[i - 1].end + MMCONF_UNIT) & MMCONF_MASK; |
| 159 | if (range[i + 1].start > (range[i].end + (1ULL << 32))) { | 159 | val = range[i].start & MMCONF_MASK; |
| 160 | base = range[i].end + (1ULL << 32); | 160 | if (val >= base + MMCONF_SIZE && BASE_VALID(base)) |
| 161 | if ((base > tom2) && BASE_VALID(base)) | 161 | goto out; |
| 162 | goto out; | ||
| 163 | } | ||
| 164 | } | 162 | } |
| 165 | |||
| 166 | fail: | ||
| 167 | fam10h_pci_mmconf_base_status = -1; | ||
| 168 | return; | 163 | return; |
| 164 | |||
| 169 | out: | 165 | out: |
| 170 | fam10h_pci_mmconf_base = base; | 166 | fam10h_pci_mmconf_base = base; |
| 171 | fam10h_pci_mmconf_base_status = 1; | ||
| 172 | } | 167 | } |
| 173 | 168 | ||
| 174 | void __cpuinit fam10h_check_enable_mmcfg(void) | 169 | void __cpuinit fam10h_check_enable_mmcfg(void) |
| @@ -190,11 +185,10 @@ void __cpuinit fam10h_check_enable_mmcfg(void) | |||
| 190 | 185 | ||
| 191 | /* only trust the one handle 256 buses, if acpi=off */ | 186 | /* only trust the one handle 256 buses, if acpi=off */ |
| 192 | if (!acpi_pci_disabled || busnbits >= 8) { | 187 | if (!acpi_pci_disabled || busnbits >= 8) { |
| 193 | u64 base; | 188 | u64 base = val & MMCONF_MASK; |
| 194 | base = val & (0xffffULL << 32); | 189 | |
| 195 | if (fam10h_pci_mmconf_base_status <= 0) { | 190 | if (!fam10h_pci_mmconf_base) { |
| 196 | fam10h_pci_mmconf_base = base; | 191 | fam10h_pci_mmconf_base = base; |
| 197 | fam10h_pci_mmconf_base_status = 1; | ||
| 198 | return; | 192 | return; |
| 199 | } else if (fam10h_pci_mmconf_base == base) | 193 | } else if (fam10h_pci_mmconf_base == base) |
| 200 | return; | 194 | return; |
| @@ -206,8 +200,10 @@ void __cpuinit fam10h_check_enable_mmcfg(void) | |||
| 206 | * with 256 buses | 200 | * with 256 buses |
| 207 | */ | 201 | */ |
| 208 | get_fam10h_pci_mmconf_base(); | 202 | get_fam10h_pci_mmconf_base(); |
| 209 | if (fam10h_pci_mmconf_base_status <= 0) | 203 | if (!fam10h_pci_mmconf_base) { |
| 204 | pci_probe &= ~PCI_CHECK_ENABLE_AMD_MMCONF; | ||
| 210 | return; | 205 | return; |
| 206 | } | ||
| 211 | 207 | ||
| 212 | printk(KERN_INFO "Enable MMCONFIG on AMD Family 10h\n"); | 208 | printk(KERN_INFO "Enable MMCONFIG on AMD Family 10h\n"); |
| 213 | val &= ~((FAM10H_MMIO_CONF_BASE_MASK<<FAM10H_MMIO_CONF_BASE_SHIFT) | | 209 | val &= ~((FAM10H_MMIO_CONF_BASE_MASK<<FAM10H_MMIO_CONF_BASE_SHIFT) | |
| @@ -217,13 +213,13 @@ void __cpuinit fam10h_check_enable_mmcfg(void) | |||
| 217 | wrmsrl(address, val); | 213 | wrmsrl(address, val); |
| 218 | } | 214 | } |
| 219 | 215 | ||
| 220 | static int __devinit set_check_enable_amd_mmconf(const struct dmi_system_id *d) | 216 | static int __init set_check_enable_amd_mmconf(const struct dmi_system_id *d) |
| 221 | { | 217 | { |
| 222 | pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF; | 218 | pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF; |
| 223 | return 0; | 219 | return 0; |
| 224 | } | 220 | } |
| 225 | 221 | ||
| 226 | static const struct dmi_system_id __cpuinitconst mmconf_dmi_table[] = { | 222 | static const struct dmi_system_id __initconst mmconf_dmi_table[] = { |
| 227 | { | 223 | { |
| 228 | .callback = set_check_enable_amd_mmconf, | 224 | .callback = set_check_enable_amd_mmconf, |
| 229 | .ident = "Sun Microsystems Machine", | 225 | .ident = "Sun Microsystems Machine", |
| @@ -234,7 +230,8 @@ static const struct dmi_system_id __cpuinitconst mmconf_dmi_table[] = { | |||
| 234 | {} | 230 | {} |
| 235 | }; | 231 | }; |
| 236 | 232 | ||
| 237 | void __cpuinit check_enable_amd_mmconf_dmi(void) | 233 | /* Called from a __cpuinit function, but only on the BSP. */ |
| 234 | void __ref check_enable_amd_mmconf_dmi(void) | ||
| 238 | { | 235 | { |
| 239 | dmi_check_system(mmconf_dmi_table); | 236 | dmi_check_system(mmconf_dmi_table); |
| 240 | } | 237 | } |
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index 7bf2dc4c8f70..12fcbe2c143e 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
| 31 | #include <linux/poll.h> | 31 | #include <linux/poll.h> |
| 32 | #include <linux/smp.h> | 32 | #include <linux/smp.h> |
| 33 | #include <linux/smp_lock.h> | ||
| 34 | #include <linux/major.h> | 33 | #include <linux/major.h> |
| 35 | #include <linux/fs.h> | 34 | #include <linux/fs.h> |
| 36 | #include <linux/device.h> | 35 | #include <linux/device.h> |
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index bab3b9e6f66d..008b91eefa18 100644 --- a/arch/x86/kernel/pvclock.c +++ b/arch/x86/kernel/pvclock.c | |||
| @@ -41,44 +41,6 @@ void pvclock_set_flags(u8 flags) | |||
| 41 | valid_flags = flags; | 41 | valid_flags = flags; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | /* | ||
| 45 | * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction, | ||
| 46 | * yielding a 64-bit result. | ||
| 47 | */ | ||
| 48 | static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift) | ||
| 49 | { | ||
| 50 | u64 product; | ||
| 51 | #ifdef __i386__ | ||
| 52 | u32 tmp1, tmp2; | ||
| 53 | #endif | ||
| 54 | |||
| 55 | if (shift < 0) | ||
| 56 | delta >>= -shift; | ||
| 57 | else | ||
| 58 | delta <<= shift; | ||
| 59 | |||
| 60 | #ifdef __i386__ | ||
| 61 | __asm__ ( | ||
| 62 | "mul %5 ; " | ||
| 63 | "mov %4,%%eax ; " | ||
| 64 | "mov %%edx,%4 ; " | ||
| 65 | "mul %5 ; " | ||
| 66 | "xor %5,%5 ; " | ||
| 67 | "add %4,%%eax ; " | ||
| 68 | "adc %5,%%edx ; " | ||
| 69 | : "=A" (product), "=r" (tmp1), "=r" (tmp2) | ||
| 70 | : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); | ||
| 71 | #elif defined(__x86_64__) | ||
| 72 | __asm__ ( | ||
| 73 | "mul %%rdx ; shrd $32,%%rdx,%%rax" | ||
| 74 | : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) ); | ||
| 75 | #else | ||
| 76 | #error implement me! | ||
| 77 | #endif | ||
| 78 | |||
| 79 | return product; | ||
| 80 | } | ||
| 81 | |||
| 82 | static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time *shadow) | 44 | static u64 pvclock_get_nsec_offset(struct pvclock_shadow_time *shadow) |
| 83 | { | 45 | { |
| 84 | u64 delta = native_read_tsc() - shadow->tsc_timestamp; | 46 | u64 delta = native_read_tsc() - shadow->tsc_timestamp; |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 908ea5464a51..fb8b376bf28c 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
| @@ -720,7 +720,7 @@ static void rmap_remove(struct kvm *kvm, u64 *spte) | |||
| 720 | } | 720 | } |
| 721 | } | 721 | } |
| 722 | 722 | ||
| 723 | static void set_spte_track_bits(u64 *sptep, u64 new_spte) | 723 | static int set_spte_track_bits(u64 *sptep, u64 new_spte) |
| 724 | { | 724 | { |
| 725 | pfn_t pfn; | 725 | pfn_t pfn; |
| 726 | u64 old_spte = *sptep; | 726 | u64 old_spte = *sptep; |
| @@ -731,19 +731,20 @@ static void set_spte_track_bits(u64 *sptep, u64 new_spte) | |||
| 731 | old_spte = __xchg_spte(sptep, new_spte); | 731 | old_spte = __xchg_spte(sptep, new_spte); |
| 732 | 732 | ||
| 733 | if (!is_rmap_spte(old_spte)) | 733 | if (!is_rmap_spte(old_spte)) |
| 734 | return; | 734 | return 0; |
| 735 | 735 | ||
| 736 | pfn = spte_to_pfn(old_spte); | 736 | pfn = spte_to_pfn(old_spte); |
| 737 | if (!shadow_accessed_mask || old_spte & shadow_accessed_mask) | 737 | if (!shadow_accessed_mask || old_spte & shadow_accessed_mask) |
| 738 | kvm_set_pfn_accessed(pfn); | 738 | kvm_set_pfn_accessed(pfn); |
| 739 | if (!shadow_dirty_mask || (old_spte & shadow_dirty_mask)) | 739 | if (!shadow_dirty_mask || (old_spte & shadow_dirty_mask)) |
| 740 | kvm_set_pfn_dirty(pfn); | 740 | kvm_set_pfn_dirty(pfn); |
| 741 | return 1; | ||
| 741 | } | 742 | } |
| 742 | 743 | ||
| 743 | static void drop_spte(struct kvm *kvm, u64 *sptep, u64 new_spte) | 744 | static void drop_spte(struct kvm *kvm, u64 *sptep, u64 new_spte) |
| 744 | { | 745 | { |
| 745 | set_spte_track_bits(sptep, new_spte); | 746 | if (set_spte_track_bits(sptep, new_spte)) |
| 746 | rmap_remove(kvm, sptep); | 747 | rmap_remove(kvm, sptep); |
| 747 | } | 748 | } |
| 748 | 749 | ||
| 749 | static u64 *rmap_next(struct kvm *kvm, unsigned long *rmapp, u64 *spte) | 750 | static u64 *rmap_next(struct kvm *kvm, unsigned long *rmapp, u64 *spte) |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 82e144a4e514..1ca12298ffc7 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
| @@ -3395,6 +3395,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
| 3395 | vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; | 3395 | vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; |
| 3396 | 3396 | ||
| 3397 | load_host_msrs(vcpu); | 3397 | load_host_msrs(vcpu); |
| 3398 | kvm_load_ldt(ldt_selector); | ||
| 3398 | loadsegment(fs, fs_selector); | 3399 | loadsegment(fs, fs_selector); |
| 3399 | #ifdef CONFIG_X86_64 | 3400 | #ifdef CONFIG_X86_64 |
| 3400 | load_gs_index(gs_selector); | 3401 | load_gs_index(gs_selector); |
| @@ -3402,7 +3403,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
| 3402 | #else | 3403 | #else |
| 3403 | loadsegment(gs, gs_selector); | 3404 | loadsegment(gs, gs_selector); |
| 3404 | #endif | 3405 | #endif |
| 3405 | kvm_load_ldt(ldt_selector); | ||
| 3406 | 3406 | ||
| 3407 | reload_tss(vcpu); | 3407 | reload_tss(vcpu); |
| 3408 | 3408 | ||
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 8da0e45ff7c9..ff21fdda0c53 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -821,10 +821,9 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) | |||
| 821 | #endif | 821 | #endif |
| 822 | 822 | ||
| 823 | #ifdef CONFIG_X86_64 | 823 | #ifdef CONFIG_X86_64 |
| 824 | if (is_long_mode(&vmx->vcpu)) { | 824 | rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); |
| 825 | rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); | 825 | if (is_long_mode(&vmx->vcpu)) |
| 826 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); | 826 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); |
| 827 | } | ||
| 828 | #endif | 827 | #endif |
| 829 | for (i = 0; i < vmx->save_nmsrs; ++i) | 828 | for (i = 0; i < vmx->save_nmsrs; ++i) |
| 830 | kvm_set_shared_msr(vmx->guest_msrs[i].index, | 829 | kvm_set_shared_msr(vmx->guest_msrs[i].index, |
| @@ -839,23 +838,23 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) | |||
| 839 | 838 | ||
| 840 | ++vmx->vcpu.stat.host_state_reload; | 839 | ++vmx->vcpu.stat.host_state_reload; |
| 841 | vmx->host_state.loaded = 0; | 840 | vmx->host_state.loaded = 0; |
| 842 | if (vmx->host_state.fs_reload_needed) | 841 | #ifdef CONFIG_X86_64 |
| 843 | loadsegment(fs, vmx->host_state.fs_sel); | 842 | if (is_long_mode(&vmx->vcpu)) |
| 843 | rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); | ||
| 844 | #endif | ||
| 844 | if (vmx->host_state.gs_ldt_reload_needed) { | 845 | if (vmx->host_state.gs_ldt_reload_needed) { |
| 845 | kvm_load_ldt(vmx->host_state.ldt_sel); | 846 | kvm_load_ldt(vmx->host_state.ldt_sel); |
| 846 | #ifdef CONFIG_X86_64 | 847 | #ifdef CONFIG_X86_64 |
| 847 | load_gs_index(vmx->host_state.gs_sel); | 848 | load_gs_index(vmx->host_state.gs_sel); |
| 848 | wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs); | ||
| 849 | #else | 849 | #else |
| 850 | loadsegment(gs, vmx->host_state.gs_sel); | 850 | loadsegment(gs, vmx->host_state.gs_sel); |
| 851 | #endif | 851 | #endif |
| 852 | } | 852 | } |
| 853 | if (vmx->host_state.fs_reload_needed) | ||
| 854 | loadsegment(fs, vmx->host_state.fs_sel); | ||
| 853 | reload_tss(); | 855 | reload_tss(); |
| 854 | #ifdef CONFIG_X86_64 | 856 | #ifdef CONFIG_X86_64 |
| 855 | if (is_long_mode(&vmx->vcpu)) { | 857 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); |
| 856 | rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); | ||
| 857 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); | ||
| 858 | } | ||
| 859 | #endif | 858 | #endif |
| 860 | if (current_thread_info()->status & TS_USEDFPU) | 859 | if (current_thread_info()->status & TS_USEDFPU) |
| 861 | clts(); | 860 | clts(); |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2288ad829b32..cdac9e592aa5 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
| @@ -2560,6 +2560,7 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu, | |||
| 2560 | !kvm_exception_is_soft(vcpu->arch.exception.nr); | 2560 | !kvm_exception_is_soft(vcpu->arch.exception.nr); |
| 2561 | events->exception.nr = vcpu->arch.exception.nr; | 2561 | events->exception.nr = vcpu->arch.exception.nr; |
| 2562 | events->exception.has_error_code = vcpu->arch.exception.has_error_code; | 2562 | events->exception.has_error_code = vcpu->arch.exception.has_error_code; |
| 2563 | events->exception.pad = 0; | ||
| 2563 | events->exception.error_code = vcpu->arch.exception.error_code; | 2564 | events->exception.error_code = vcpu->arch.exception.error_code; |
| 2564 | 2565 | ||
| 2565 | events->interrupt.injected = | 2566 | events->interrupt.injected = |
| @@ -2573,12 +2574,14 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu, | |||
| 2573 | events->nmi.injected = vcpu->arch.nmi_injected; | 2574 | events->nmi.injected = vcpu->arch.nmi_injected; |
| 2574 | events->nmi.pending = vcpu->arch.nmi_pending; | 2575 | events->nmi.pending = vcpu->arch.nmi_pending; |
| 2575 | events->nmi.masked = kvm_x86_ops->get_nmi_mask(vcpu); | 2576 | events->nmi.masked = kvm_x86_ops->get_nmi_mask(vcpu); |
| 2577 | events->nmi.pad = 0; | ||
| 2576 | 2578 | ||
| 2577 | events->sipi_vector = vcpu->arch.sipi_vector; | 2579 | events->sipi_vector = vcpu->arch.sipi_vector; |
| 2578 | 2580 | ||
| 2579 | events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING | 2581 | events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING |
| 2580 | | KVM_VCPUEVENT_VALID_SIPI_VECTOR | 2582 | | KVM_VCPUEVENT_VALID_SIPI_VECTOR |
| 2581 | | KVM_VCPUEVENT_VALID_SHADOW); | 2583 | | KVM_VCPUEVENT_VALID_SHADOW); |
| 2584 | memset(&events->reserved, 0, sizeof(events->reserved)); | ||
| 2582 | } | 2585 | } |
| 2583 | 2586 | ||
| 2584 | static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, | 2587 | static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, |
| @@ -2623,6 +2626,7 @@ static void kvm_vcpu_ioctl_x86_get_debugregs(struct kvm_vcpu *vcpu, | |||
| 2623 | dbgregs->dr6 = vcpu->arch.dr6; | 2626 | dbgregs->dr6 = vcpu->arch.dr6; |
| 2624 | dbgregs->dr7 = vcpu->arch.dr7; | 2627 | dbgregs->dr7 = vcpu->arch.dr7; |
| 2625 | dbgregs->flags = 0; | 2628 | dbgregs->flags = 0; |
| 2629 | memset(&dbgregs->reserved, 0, sizeof(dbgregs->reserved)); | ||
| 2626 | } | 2630 | } |
| 2627 | 2631 | ||
| 2628 | static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu, | 2632 | static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu, |
| @@ -3106,6 +3110,7 @@ static int kvm_vm_ioctl_get_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps) | |||
| 3106 | sizeof(ps->channels)); | 3110 | sizeof(ps->channels)); |
| 3107 | ps->flags = kvm->arch.vpit->pit_state.flags; | 3111 | ps->flags = kvm->arch.vpit->pit_state.flags; |
| 3108 | mutex_unlock(&kvm->arch.vpit->pit_state.lock); | 3112 | mutex_unlock(&kvm->arch.vpit->pit_state.lock); |
| 3113 | memset(&ps->reserved, 0, sizeof(ps->reserved)); | ||
| 3109 | return r; | 3114 | return r; |
| 3110 | } | 3115 | } |
| 3111 | 3116 | ||
| @@ -3169,10 +3174,6 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | |||
| 3169 | struct kvm_memslots *slots, *old_slots; | 3174 | struct kvm_memslots *slots, *old_slots; |
| 3170 | unsigned long *dirty_bitmap; | 3175 | unsigned long *dirty_bitmap; |
| 3171 | 3176 | ||
| 3172 | spin_lock(&kvm->mmu_lock); | ||
| 3173 | kvm_mmu_slot_remove_write_access(kvm, log->slot); | ||
| 3174 | spin_unlock(&kvm->mmu_lock); | ||
| 3175 | |||
| 3176 | r = -ENOMEM; | 3177 | r = -ENOMEM; |
| 3177 | dirty_bitmap = vmalloc(n); | 3178 | dirty_bitmap = vmalloc(n); |
| 3178 | if (!dirty_bitmap) | 3179 | if (!dirty_bitmap) |
| @@ -3194,6 +3195,10 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | |||
| 3194 | dirty_bitmap = old_slots->memslots[log->slot].dirty_bitmap; | 3195 | dirty_bitmap = old_slots->memslots[log->slot].dirty_bitmap; |
| 3195 | kfree(old_slots); | 3196 | kfree(old_slots); |
| 3196 | 3197 | ||
| 3198 | spin_lock(&kvm->mmu_lock); | ||
| 3199 | kvm_mmu_slot_remove_write_access(kvm, log->slot); | ||
| 3200 | spin_unlock(&kvm->mmu_lock); | ||
| 3201 | |||
| 3197 | r = -EFAULT; | 3202 | r = -EFAULT; |
| 3198 | if (copy_to_user(log->dirty_bitmap, dirty_bitmap, n)) { | 3203 | if (copy_to_user(log->dirty_bitmap, dirty_bitmap, n)) { |
| 3199 | vfree(dirty_bitmap); | 3204 | vfree(dirty_bitmap); |
| @@ -3486,6 +3491,7 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
| 3486 | user_ns.clock = kvm->arch.kvmclock_offset + now_ns; | 3491 | user_ns.clock = kvm->arch.kvmclock_offset + now_ns; |
| 3487 | local_irq_enable(); | 3492 | local_irq_enable(); |
| 3488 | user_ns.flags = 0; | 3493 | user_ns.flags = 0; |
| 3494 | memset(&user_ns.pad, 0, sizeof(user_ns.pad)); | ||
| 3489 | 3495 | ||
| 3490 | r = -EFAULT; | 3496 | r = -EFAULT; |
| 3491 | if (copy_to_user(argp, &user_ns, sizeof(user_ns))) | 3497 | if (copy_to_user(argp, &user_ns, sizeof(user_ns))) |
| @@ -3972,8 +3978,10 @@ int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu) | |||
| 3972 | return X86EMUL_CONTINUE; | 3978 | return X86EMUL_CONTINUE; |
| 3973 | 3979 | ||
| 3974 | if (kvm_x86_ops->has_wbinvd_exit()) { | 3980 | if (kvm_x86_ops->has_wbinvd_exit()) { |
| 3981 | preempt_disable(); | ||
| 3975 | smp_call_function_many(vcpu->arch.wbinvd_dirty_mask, | 3982 | smp_call_function_many(vcpu->arch.wbinvd_dirty_mask, |
| 3976 | wbinvd_ipi, NULL, 1); | 3983 | wbinvd_ipi, NULL, 1); |
| 3984 | preempt_enable(); | ||
| 3977 | cpumask_clear(vcpu->arch.wbinvd_dirty_mask); | 3985 | cpumask_clear(vcpu->arch.wbinvd_dirty_mask); |
| 3978 | } | 3986 | } |
| 3979 | wbinvd(); | 3987 | wbinvd(); |
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 49358481c733..6acc724d5d8f 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c | |||
| @@ -223,7 +223,7 @@ void native_flush_tlb_others(const struct cpumask *cpumask, | |||
| 223 | 223 | ||
| 224 | static void __cpuinit calculate_tlb_offset(void) | 224 | static void __cpuinit calculate_tlb_offset(void) |
| 225 | { | 225 | { |
| 226 | int cpu, node, nr_node_vecs; | 226 | int cpu, node, nr_node_vecs, idx = 0; |
| 227 | /* | 227 | /* |
| 228 | * we are changing tlb_vector_offset for each CPU in runtime, but this | 228 | * we are changing tlb_vector_offset for each CPU in runtime, but this |
| 229 | * will not cause inconsistency, as the write is atomic under X86. we | 229 | * will not cause inconsistency, as the write is atomic under X86. we |
| @@ -239,7 +239,7 @@ static void __cpuinit calculate_tlb_offset(void) | |||
| 239 | nr_node_vecs = NUM_INVALIDATE_TLB_VECTORS/nr_online_nodes; | 239 | nr_node_vecs = NUM_INVALIDATE_TLB_VECTORS/nr_online_nodes; |
| 240 | 240 | ||
| 241 | for_each_online_node(node) { | 241 | for_each_online_node(node) { |
| 242 | int node_offset = (node % NUM_INVALIDATE_TLB_VECTORS) * | 242 | int node_offset = (idx % NUM_INVALIDATE_TLB_VECTORS) * |
| 243 | nr_node_vecs; | 243 | nr_node_vecs; |
| 244 | int cpu_offset = 0; | 244 | int cpu_offset = 0; |
| 245 | for_each_cpu(cpu, cpumask_of_node(node)) { | 245 | for_each_cpu(cpu, cpumask_of_node(node)) { |
| @@ -248,10 +248,11 @@ static void __cpuinit calculate_tlb_offset(void) | |||
| 248 | cpu_offset++; | 248 | cpu_offset++; |
| 249 | cpu_offset = cpu_offset % nr_node_vecs; | 249 | cpu_offset = cpu_offset % nr_node_vecs; |
| 250 | } | 250 | } |
| 251 | idx++; | ||
| 251 | } | 252 | } |
| 252 | } | 253 | } |
| 253 | 254 | ||
| 254 | static int tlb_cpuhp_notify(struct notifier_block *n, | 255 | static int __cpuinit tlb_cpuhp_notify(struct notifier_block *n, |
| 255 | unsigned long action, void *hcpu) | 256 | unsigned long action, void *hcpu) |
| 256 | { | 257 | { |
| 257 | switch (action & 0xf) { | 258 | switch (action & 0xf) { |
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 15466c096ba5..0972315c3860 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
| @@ -138,7 +138,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 138 | struct acpi_resource_address64 addr; | 138 | struct acpi_resource_address64 addr; |
| 139 | acpi_status status; | 139 | acpi_status status; |
| 140 | unsigned long flags; | 140 | unsigned long flags; |
| 141 | struct resource *root, *conflict; | ||
| 142 | u64 start, end; | 141 | u64 start, end; |
| 143 | 142 | ||
| 144 | status = resource_to_addr(acpi_res, &addr); | 143 | status = resource_to_addr(acpi_res, &addr); |
| @@ -146,12 +145,10 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 146 | return AE_OK; | 145 | return AE_OK; |
| 147 | 146 | ||
| 148 | if (addr.resource_type == ACPI_MEMORY_RANGE) { | 147 | if (addr.resource_type == ACPI_MEMORY_RANGE) { |
| 149 | root = &iomem_resource; | ||
| 150 | flags = IORESOURCE_MEM; | 148 | flags = IORESOURCE_MEM; |
| 151 | if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY) | 149 | if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY) |
| 152 | flags |= IORESOURCE_PREFETCH; | 150 | flags |= IORESOURCE_PREFETCH; |
| 153 | } else if (addr.resource_type == ACPI_IO_RANGE) { | 151 | } else if (addr.resource_type == ACPI_IO_RANGE) { |
| 154 | root = &ioport_resource; | ||
| 155 | flags = IORESOURCE_IO; | 152 | flags = IORESOURCE_IO; |
| 156 | } else | 153 | } else |
| 157 | return AE_OK; | 154 | return AE_OK; |
| @@ -172,25 +169,90 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 172 | return AE_OK; | 169 | return AE_OK; |
| 173 | } | 170 | } |
| 174 | 171 | ||
| 175 | conflict = insert_resource_conflict(root, res); | 172 | info->res_num++; |
| 176 | if (conflict) { | 173 | if (addr.translation_offset) |
| 177 | dev_err(&info->bridge->dev, | 174 | dev_info(&info->bridge->dev, "host bridge window %pR " |
| 178 | "address space collision: host bridge window %pR " | 175 | "(PCI address [%#llx-%#llx])\n", |
| 179 | "conflicts with %s %pR\n", | 176 | res, res->start - addr.translation_offset, |
| 180 | res, conflict->name, conflict); | 177 | res->end - addr.translation_offset); |
| 181 | } else { | 178 | else |
| 182 | pci_bus_add_resource(info->bus, res, 0); | 179 | dev_info(&info->bridge->dev, "host bridge window %pR\n", res); |
| 183 | info->res_num++; | 180 | |
| 184 | if (addr.translation_offset) | 181 | return AE_OK; |
| 185 | dev_info(&info->bridge->dev, "host bridge window %pR " | 182 | } |
| 186 | "(PCI address [%#llx-%#llx])\n", | 183 | |
| 187 | res, res->start - addr.translation_offset, | 184 | static bool resource_contains(struct resource *res, resource_size_t point) |
| 188 | res->end - addr.translation_offset); | 185 | { |
| 186 | if (res->start <= point && point <= res->end) | ||
| 187 | return true; | ||
| 188 | return false; | ||
| 189 | } | ||
| 190 | |||
| 191 | static void coalesce_windows(struct pci_root_info *info, int type) | ||
| 192 | { | ||
| 193 | int i, j; | ||
| 194 | struct resource *res1, *res2; | ||
| 195 | |||
| 196 | for (i = 0; i < info->res_num; i++) { | ||
| 197 | res1 = &info->res[i]; | ||
| 198 | if (!(res1->flags & type)) | ||
| 199 | continue; | ||
| 200 | |||
| 201 | for (j = i + 1; j < info->res_num; j++) { | ||
| 202 | res2 = &info->res[j]; | ||
| 203 | if (!(res2->flags & type)) | ||
| 204 | continue; | ||
| 205 | |||
| 206 | /* | ||
| 207 | * I don't like throwing away windows because then | ||
| 208 | * our resources no longer match the ACPI _CRS, but | ||
| 209 | * the kernel resource tree doesn't allow overlaps. | ||
| 210 | */ | ||
| 211 | if (resource_contains(res1, res2->start) || | ||
| 212 | resource_contains(res1, res2->end) || | ||
| 213 | resource_contains(res2, res1->start) || | ||
| 214 | resource_contains(res2, res1->end)) { | ||
| 215 | res1->start = min(res1->start, res2->start); | ||
| 216 | res1->end = max(res1->end, res2->end); | ||
| 217 | dev_info(&info->bridge->dev, | ||
| 218 | "host bridge window expanded to %pR; %pR ignored\n", | ||
| 219 | res1, res2); | ||
| 220 | res2->flags = 0; | ||
| 221 | } | ||
| 222 | } | ||
| 223 | } | ||
| 224 | } | ||
| 225 | |||
| 226 | static void add_resources(struct pci_root_info *info) | ||
| 227 | { | ||
| 228 | int i; | ||
| 229 | struct resource *res, *root, *conflict; | ||
| 230 | |||
| 231 | if (!pci_use_crs) | ||
| 232 | return; | ||
| 233 | |||
| 234 | coalesce_windows(info, IORESOURCE_MEM); | ||
| 235 | coalesce_windows(info, IORESOURCE_IO); | ||
| 236 | |||
| 237 | for (i = 0; i < info->res_num; i++) { | ||
| 238 | res = &info->res[i]; | ||
| 239 | |||
| 240 | if (res->flags & IORESOURCE_MEM) | ||
| 241 | root = &iomem_resource; | ||
| 242 | else if (res->flags & IORESOURCE_IO) | ||
| 243 | root = &ioport_resource; | ||
| 189 | else | 244 | else |
| 190 | dev_info(&info->bridge->dev, | 245 | continue; |
| 191 | "host bridge window %pR\n", res); | 246 | |
| 247 | conflict = insert_resource_conflict(root, res); | ||
| 248 | if (conflict) | ||
| 249 | dev_err(&info->bridge->dev, | ||
| 250 | "address space collision: host bridge window %pR " | ||
| 251 | "conflicts with %s %pR\n", | ||
| 252 | res, conflict->name, conflict); | ||
| 253 | else | ||
| 254 | pci_bus_add_resource(info->bus, res, 0); | ||
| 192 | } | 255 | } |
| 193 | return AE_OK; | ||
| 194 | } | 256 | } |
| 195 | 257 | ||
| 196 | static void | 258 | static void |
| @@ -224,6 +286,7 @@ get_current_resources(struct acpi_device *device, int busnum, | |||
| 224 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, | 286 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, |
| 225 | &info); | 287 | &info); |
| 226 | 288 | ||
| 289 | add_resources(&info); | ||
| 227 | return; | 290 | return; |
| 228 | 291 | ||
| 229 | name_alloc_fail: | 292 | name_alloc_fail: |
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 117f5b8daf75..d7b5109f7a9c 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c | |||
| @@ -147,8 +147,10 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
| 147 | irq = xen_allocate_pirq(v[i], 0, /* not sharable */ | 147 | irq = xen_allocate_pirq(v[i], 0, /* not sharable */ |
| 148 | (type == PCI_CAP_ID_MSIX) ? | 148 | (type == PCI_CAP_ID_MSIX) ? |
| 149 | "pcifront-msi-x" : "pcifront-msi"); | 149 | "pcifront-msi-x" : "pcifront-msi"); |
| 150 | if (irq < 0) | 150 | if (irq < 0) { |
| 151 | return -1; | 151 | ret = -1; |
| 152 | goto free; | ||
| 153 | } | ||
| 152 | 154 | ||
| 153 | ret = set_irq_msi(irq, msidesc); | 155 | ret = set_irq_msi(irq, msidesc); |
| 154 | if (ret) | 156 | if (ret) |
| @@ -164,7 +166,7 @@ error: | |||
| 164 | if (ret == -ENODEV) | 166 | if (ret == -ENODEV) |
| 165 | dev_err(&dev->dev, "Xen PCI frontend has not registered" \ | 167 | dev_err(&dev->dev, "Xen PCI frontend has not registered" \ |
| 166 | " MSI/MSI-X support!\n"); | 168 | " MSI/MSI-X support!\n"); |
| 167 | 169 | free: | |
| 168 | kfree(v); | 170 | kfree(v); |
| 169 | return ret; | 171 | return ret; |
| 170 | } | 172 | } |
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index 20ea20a39e2a..ba9caa808a9c 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c | |||
| @@ -1343,8 +1343,8 @@ uv_activation_descriptor_init(int node, int pnode) | |||
| 1343 | * each bau_desc is 64 bytes; there are 8 (UV_ITEMS_PER_DESCRIPTOR) | 1343 | * each bau_desc is 64 bytes; there are 8 (UV_ITEMS_PER_DESCRIPTOR) |
| 1344 | * per cpu; and up to 32 (UV_ADP_SIZE) cpu's per uvhub | 1344 | * per cpu; and up to 32 (UV_ADP_SIZE) cpu's per uvhub |
| 1345 | */ | 1345 | */ |
| 1346 | bau_desc = (struct bau_desc *)kmalloc_node(sizeof(struct bau_desc)* | 1346 | bau_desc = kmalloc_node(sizeof(struct bau_desc) * UV_ADP_SIZE |
| 1347 | UV_ADP_SIZE*UV_ITEMS_PER_DESCRIPTOR, GFP_KERNEL, node); | 1347 | * UV_ITEMS_PER_DESCRIPTOR, GFP_KERNEL, node); |
| 1348 | BUG_ON(!bau_desc); | 1348 | BUG_ON(!bau_desc); |
| 1349 | 1349 | ||
| 1350 | pa = uv_gpa(bau_desc); /* need the real nasid*/ | 1350 | pa = uv_gpa(bau_desc); /* need the real nasid*/ |
| @@ -1402,9 +1402,9 @@ uv_payload_queue_init(int node, int pnode) | |||
| 1402 | struct bau_payload_queue_entry *pqp_malloc; | 1402 | struct bau_payload_queue_entry *pqp_malloc; |
| 1403 | struct bau_control *bcp; | 1403 | struct bau_control *bcp; |
| 1404 | 1404 | ||
| 1405 | pqp = (struct bau_payload_queue_entry *) kmalloc_node( | 1405 | pqp = kmalloc_node((DEST_Q_SIZE + 1) |
| 1406 | (DEST_Q_SIZE + 1) * sizeof(struct bau_payload_queue_entry), | 1406 | * sizeof(struct bau_payload_queue_entry), |
| 1407 | GFP_KERNEL, node); | 1407 | GFP_KERNEL, node); |
| 1408 | BUG_ON(!pqp); | 1408 | BUG_ON(!pqp); |
| 1409 | pqp_malloc = pqp; | 1409 | pqp_malloc = pqp; |
| 1410 | 1410 | ||
| @@ -1455,7 +1455,7 @@ static void __init uv_init_uvhub(int uvhub, int vector) | |||
| 1455 | * the below initialization can't be in firmware because the | 1455 | * the below initialization can't be in firmware because the |
| 1456 | * messaging IRQ will be determined by the OS | 1456 | * messaging IRQ will be determined by the OS |
| 1457 | */ | 1457 | */ |
| 1458 | apicid = uvhub_to_first_apicid(uvhub); | 1458 | apicid = uvhub_to_first_apicid(uvhub) | uv_apicid_hibits; |
| 1459 | uv_write_global_mmr64(pnode, UVH_BAU_DATA_CONFIG, | 1459 | uv_write_global_mmr64(pnode, UVH_BAU_DATA_CONFIG, |
| 1460 | ((apicid << 32) | vector)); | 1460 | ((apicid << 32) | vector)); |
| 1461 | } | 1461 | } |
| @@ -1520,8 +1520,7 @@ static void __init uv_init_per_cpu(int nuvhubs) | |||
| 1520 | 1520 | ||
| 1521 | timeout_us = calculate_destination_timeout(); | 1521 | timeout_us = calculate_destination_timeout(); |
| 1522 | 1522 | ||
| 1523 | uvhub_descs = (struct uvhub_desc *) | 1523 | uvhub_descs = kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL); |
| 1524 | kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL); | ||
| 1525 | memset(uvhub_descs, 0, nuvhubs * sizeof(struct uvhub_desc)); | 1524 | memset(uvhub_descs, 0, nuvhubs * sizeof(struct uvhub_desc)); |
| 1526 | uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL); | 1525 | uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL); |
| 1527 | for_each_present_cpu(cpu) { | 1526 | for_each_present_cpu(cpu) { |
diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c index 56e421bc379b..9daf5d1af9f1 100644 --- a/arch/x86/platform/uv/uv_time.c +++ b/arch/x86/platform/uv/uv_time.c | |||
| @@ -89,6 +89,7 @@ static void uv_rtc_send_IPI(int cpu) | |||
| 89 | 89 | ||
| 90 | apicid = cpu_physical_id(cpu); | 90 | apicid = cpu_physical_id(cpu); |
| 91 | pnode = uv_apicid_to_pnode(apicid); | 91 | pnode = uv_apicid_to_pnode(apicid); |
| 92 | apicid |= uv_apicid_hibits; | ||
| 92 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | 93 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
| 93 | (apicid << UVH_IPI_INT_APIC_ID_SHFT) | | 94 | (apicid << UVH_IPI_INT_APIC_ID_SHFT) | |
| 94 | (X86_PLATFORM_IPI_VECTOR << UVH_IPI_INT_VECTOR_SHFT); | 95 | (X86_PLATFORM_IPI_VECTOR << UVH_IPI_INT_VECTOR_SHFT); |
| @@ -107,6 +108,7 @@ static int uv_intr_pending(int pnode) | |||
| 107 | static int uv_setup_intr(int cpu, u64 expires) | 108 | static int uv_setup_intr(int cpu, u64 expires) |
| 108 | { | 109 | { |
| 109 | u64 val; | 110 | u64 val; |
| 111 | unsigned long apicid = cpu_physical_id(cpu) | uv_apicid_hibits; | ||
| 110 | int pnode = uv_cpu_to_pnode(cpu); | 112 | int pnode = uv_cpu_to_pnode(cpu); |
| 111 | 113 | ||
| 112 | uv_write_global_mmr64(pnode, UVH_RTC1_INT_CONFIG, | 114 | uv_write_global_mmr64(pnode, UVH_RTC1_INT_CONFIG, |
| @@ -117,7 +119,7 @@ static int uv_setup_intr(int cpu, u64 expires) | |||
| 117 | UVH_EVENT_OCCURRED0_RTC1_MASK); | 119 | UVH_EVENT_OCCURRED0_RTC1_MASK); |
| 118 | 120 | ||
| 119 | val = (X86_PLATFORM_IPI_VECTOR << UVH_RTC1_INT_CONFIG_VECTOR_SHFT) | | 121 | val = (X86_PLATFORM_IPI_VECTOR << UVH_RTC1_INT_CONFIG_VECTOR_SHFT) | |
| 120 | ((u64)cpu_physical_id(cpu) << UVH_RTC1_INT_CONFIG_APIC_ID_SHFT); | 122 | ((u64)apicid << UVH_RTC1_INT_CONFIG_APIC_ID_SHFT); |
| 121 | 123 | ||
| 122 | /* Set configuration */ | 124 | /* Set configuration */ |
| 123 | uv_write_global_mmr64(pnode, UVH_RTC1_INT_CONFIG, val); | 125 | uv_write_global_mmr64(pnode, UVH_RTC1_INT_CONFIG, val); |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 235c0f4d3861..02c710bebf7a 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
| @@ -75,6 +75,11 @@ DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info); | |||
| 75 | enum xen_domain_type xen_domain_type = XEN_NATIVE; | 75 | enum xen_domain_type xen_domain_type = XEN_NATIVE; |
| 76 | EXPORT_SYMBOL_GPL(xen_domain_type); | 76 | EXPORT_SYMBOL_GPL(xen_domain_type); |
| 77 | 77 | ||
| 78 | unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START; | ||
| 79 | EXPORT_SYMBOL(machine_to_phys_mapping); | ||
| 80 | unsigned int machine_to_phys_order; | ||
| 81 | EXPORT_SYMBOL(machine_to_phys_order); | ||
| 82 | |||
| 78 | struct start_info *xen_start_info; | 83 | struct start_info *xen_start_info; |
| 79 | EXPORT_SYMBOL_GPL(xen_start_info); | 84 | EXPORT_SYMBOL_GPL(xen_start_info); |
| 80 | 85 | ||
| @@ -1090,6 +1095,8 @@ static void __init xen_setup_stackprotector(void) | |||
| 1090 | /* First C function to be called on Xen boot */ | 1095 | /* First C function to be called on Xen boot */ |
| 1091 | asmlinkage void __init xen_start_kernel(void) | 1096 | asmlinkage void __init xen_start_kernel(void) |
| 1092 | { | 1097 | { |
| 1098 | struct physdev_set_iopl set_iopl; | ||
| 1099 | int rc; | ||
| 1093 | pgd_t *pgd; | 1100 | pgd_t *pgd; |
| 1094 | 1101 | ||
| 1095 | if (!xen_start_info) | 1102 | if (!xen_start_info) |
| @@ -1097,6 +1104,8 @@ asmlinkage void __init xen_start_kernel(void) | |||
| 1097 | 1104 | ||
| 1098 | xen_domain_type = XEN_PV_DOMAIN; | 1105 | xen_domain_type = XEN_PV_DOMAIN; |
| 1099 | 1106 | ||
| 1107 | xen_setup_machphys_mapping(); | ||
| 1108 | |||
| 1100 | /* Install Xen paravirt ops */ | 1109 | /* Install Xen paravirt ops */ |
| 1101 | pv_info = xen_info; | 1110 | pv_info = xen_info; |
| 1102 | pv_init_ops = xen_init_ops; | 1111 | pv_init_ops = xen_init_ops; |
| @@ -1191,8 +1200,6 @@ asmlinkage void __init xen_start_kernel(void) | |||
| 1191 | /* Allocate and initialize top and mid mfn levels for p2m structure */ | 1200 | /* Allocate and initialize top and mid mfn levels for p2m structure */ |
| 1192 | xen_build_mfn_list_list(); | 1201 | xen_build_mfn_list_list(); |
| 1193 | 1202 | ||
| 1194 | init_mm.pgd = pgd; | ||
| 1195 | |||
| 1196 | /* keep using Xen gdt for now; no urgent need to change it */ | 1203 | /* keep using Xen gdt for now; no urgent need to change it */ |
| 1197 | 1204 | ||
| 1198 | #ifdef CONFIG_X86_32 | 1205 | #ifdef CONFIG_X86_32 |
| @@ -1202,10 +1209,18 @@ asmlinkage void __init xen_start_kernel(void) | |||
| 1202 | #else | 1209 | #else |
| 1203 | pv_info.kernel_rpl = 0; | 1210 | pv_info.kernel_rpl = 0; |
| 1204 | #endif | 1211 | #endif |
| 1205 | |||
| 1206 | /* set the limit of our address space */ | 1212 | /* set the limit of our address space */ |
| 1207 | xen_reserve_top(); | 1213 | xen_reserve_top(); |
| 1208 | 1214 | ||
| 1215 | /* We used to do this in xen_arch_setup, but that is too late on AMD | ||
| 1216 | * were early_cpu_init (run before ->arch_setup()) calls early_amd_init | ||
| 1217 | * which pokes 0xcf8 port. | ||
| 1218 | */ | ||
| 1219 | set_iopl.iopl = 1; | ||
| 1220 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl); | ||
| 1221 | if (rc != 0) | ||
| 1222 | xen_raw_printk("physdev_op failed %d\n", rc); | ||
| 1223 | |||
| 1209 | #ifdef CONFIG_X86_32 | 1224 | #ifdef CONFIG_X86_32 |
| 1210 | /* set up basic CPUID stuff */ | 1225 | /* set up basic CPUID stuff */ |
| 1211 | cpu_detect(&new_cpu_data); | 1226 | cpu_detect(&new_cpu_data); |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index c237b810b03f..a1feff9e59b6 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
| @@ -2034,6 +2034,20 @@ static __init void xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn) | |||
| 2034 | set_page_prot(pmd, PAGE_KERNEL_RO); | 2034 | set_page_prot(pmd, PAGE_KERNEL_RO); |
| 2035 | } | 2035 | } |
| 2036 | 2036 | ||
| 2037 | void __init xen_setup_machphys_mapping(void) | ||
| 2038 | { | ||
| 2039 | struct xen_machphys_mapping mapping; | ||
| 2040 | unsigned long machine_to_phys_nr_ents; | ||
| 2041 | |||
| 2042 | if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) { | ||
| 2043 | machine_to_phys_mapping = (unsigned long *)mapping.v_start; | ||
| 2044 | machine_to_phys_nr_ents = mapping.max_mfn + 1; | ||
| 2045 | } else { | ||
| 2046 | machine_to_phys_nr_ents = MACH2PHYS_NR_ENTRIES; | ||
| 2047 | } | ||
| 2048 | machine_to_phys_order = fls(machine_to_phys_nr_ents - 1); | ||
| 2049 | } | ||
| 2050 | |||
| 2037 | #ifdef CONFIG_X86_64 | 2051 | #ifdef CONFIG_X86_64 |
| 2038 | static void convert_pfn_mfn(void *v) | 2052 | static void convert_pfn_mfn(void *v) |
| 2039 | { | 2053 | { |
| @@ -2119,44 +2133,83 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, | |||
| 2119 | return pgd; | 2133 | return pgd; |
| 2120 | } | 2134 | } |
| 2121 | #else /* !CONFIG_X86_64 */ | 2135 | #else /* !CONFIG_X86_64 */ |
| 2122 | static RESERVE_BRK_ARRAY(pmd_t, level2_kernel_pgt, PTRS_PER_PMD); | 2136 | static RESERVE_BRK_ARRAY(pmd_t, initial_kernel_pmd, PTRS_PER_PMD); |
| 2137 | static RESERVE_BRK_ARRAY(pmd_t, swapper_kernel_pmd, PTRS_PER_PMD); | ||
| 2138 | |||
| 2139 | static __init void xen_write_cr3_init(unsigned long cr3) | ||
| 2140 | { | ||
| 2141 | unsigned long pfn = PFN_DOWN(__pa(swapper_pg_dir)); | ||
| 2142 | |||
| 2143 | BUG_ON(read_cr3() != __pa(initial_page_table)); | ||
| 2144 | BUG_ON(cr3 != __pa(swapper_pg_dir)); | ||
| 2145 | |||
| 2146 | /* | ||
| 2147 | * We are switching to swapper_pg_dir for the first time (from | ||
| 2148 | * initial_page_table) and therefore need to mark that page | ||
| 2149 | * read-only and then pin it. | ||
| 2150 | * | ||
| 2151 | * Xen disallows sharing of kernel PMDs for PAE | ||
| 2152 | * guests. Therefore we must copy the kernel PMD from | ||
| 2153 | * initial_page_table into a new kernel PMD to be used in | ||
| 2154 | * swapper_pg_dir. | ||
| 2155 | */ | ||
| 2156 | swapper_kernel_pmd = | ||
| 2157 | extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE); | ||
| 2158 | memcpy(swapper_kernel_pmd, initial_kernel_pmd, | ||
| 2159 | sizeof(pmd_t) * PTRS_PER_PMD); | ||
| 2160 | swapper_pg_dir[KERNEL_PGD_BOUNDARY] = | ||
| 2161 | __pgd(__pa(swapper_kernel_pmd) | _PAGE_PRESENT); | ||
| 2162 | set_page_prot(swapper_kernel_pmd, PAGE_KERNEL_RO); | ||
| 2163 | |||
| 2164 | set_page_prot(swapper_pg_dir, PAGE_KERNEL_RO); | ||
| 2165 | xen_write_cr3(cr3); | ||
| 2166 | pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, pfn); | ||
| 2167 | |||
| 2168 | pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, | ||
| 2169 | PFN_DOWN(__pa(initial_page_table))); | ||
| 2170 | set_page_prot(initial_page_table, PAGE_KERNEL); | ||
| 2171 | set_page_prot(initial_kernel_pmd, PAGE_KERNEL); | ||
| 2172 | |||
| 2173 | pv_mmu_ops.write_cr3 = &xen_write_cr3; | ||
| 2174 | } | ||
| 2123 | 2175 | ||
| 2124 | __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, | 2176 | __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, |
| 2125 | unsigned long max_pfn) | 2177 | unsigned long max_pfn) |
| 2126 | { | 2178 | { |
| 2127 | pmd_t *kernel_pmd; | 2179 | pmd_t *kernel_pmd; |
| 2128 | 2180 | ||
| 2129 | level2_kernel_pgt = extend_brk(sizeof(pmd_t *) * PTRS_PER_PMD, PAGE_SIZE); | 2181 | initial_kernel_pmd = |
| 2182 | extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE); | ||
| 2130 | 2183 | ||
| 2131 | max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) + | 2184 | max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) + |
| 2132 | xen_start_info->nr_pt_frames * PAGE_SIZE + | 2185 | xen_start_info->nr_pt_frames * PAGE_SIZE + |
| 2133 | 512*1024); | 2186 | 512*1024); |
| 2134 | 2187 | ||
| 2135 | kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd); | 2188 | kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd); |
| 2136 | memcpy(level2_kernel_pgt, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD); | 2189 | memcpy(initial_kernel_pmd, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD); |
| 2137 | 2190 | ||
| 2138 | xen_map_identity_early(level2_kernel_pgt, max_pfn); | 2191 | xen_map_identity_early(initial_kernel_pmd, max_pfn); |
| 2139 | 2192 | ||
| 2140 | memcpy(swapper_pg_dir, pgd, sizeof(pgd_t) * PTRS_PER_PGD); | 2193 | memcpy(initial_page_table, pgd, sizeof(pgd_t) * PTRS_PER_PGD); |
| 2141 | set_pgd(&swapper_pg_dir[KERNEL_PGD_BOUNDARY], | 2194 | initial_page_table[KERNEL_PGD_BOUNDARY] = |
| 2142 | __pgd(__pa(level2_kernel_pgt) | _PAGE_PRESENT)); | 2195 | __pgd(__pa(initial_kernel_pmd) | _PAGE_PRESENT); |
| 2143 | 2196 | ||
| 2144 | set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO); | 2197 | set_page_prot(initial_kernel_pmd, PAGE_KERNEL_RO); |
| 2145 | set_page_prot(swapper_pg_dir, PAGE_KERNEL_RO); | 2198 | set_page_prot(initial_page_table, PAGE_KERNEL_RO); |
| 2146 | set_page_prot(empty_zero_page, PAGE_KERNEL_RO); | 2199 | set_page_prot(empty_zero_page, PAGE_KERNEL_RO); |
| 2147 | 2200 | ||
| 2148 | pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd))); | 2201 | pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd))); |
| 2149 | 2202 | ||
| 2150 | xen_write_cr3(__pa(swapper_pg_dir)); | 2203 | pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, |
| 2151 | 2204 | PFN_DOWN(__pa(initial_page_table))); | |
| 2152 | pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir))); | 2205 | xen_write_cr3(__pa(initial_page_table)); |
| 2153 | 2206 | ||
| 2154 | memblock_x86_reserve_range(__pa(xen_start_info->pt_base), | 2207 | memblock_x86_reserve_range(__pa(xen_start_info->pt_base), |
| 2155 | __pa(xen_start_info->pt_base + | 2208 | __pa(xen_start_info->pt_base + |
| 2156 | xen_start_info->nr_pt_frames * PAGE_SIZE), | 2209 | xen_start_info->nr_pt_frames * PAGE_SIZE), |
| 2157 | "XEN PAGETABLES"); | 2210 | "XEN PAGETABLES"); |
| 2158 | 2211 | ||
| 2159 | return swapper_pg_dir; | 2212 | return initial_page_table; |
| 2160 | } | 2213 | } |
| 2161 | #endif /* CONFIG_X86_64 */ | 2214 | #endif /* CONFIG_X86_64 */ |
| 2162 | 2215 | ||
| @@ -2290,7 +2343,11 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = { | |||
| 2290 | .write_cr2 = xen_write_cr2, | 2343 | .write_cr2 = xen_write_cr2, |
| 2291 | 2344 | ||
| 2292 | .read_cr3 = xen_read_cr3, | 2345 | .read_cr3 = xen_read_cr3, |
| 2346 | #ifdef CONFIG_X86_32 | ||
| 2347 | .write_cr3 = xen_write_cr3_init, | ||
| 2348 | #else | ||
| 2293 | .write_cr3 = xen_write_cr3, | 2349 | .write_cr3 = xen_write_cr3, |
| 2350 | #endif | ||
| 2294 | 2351 | ||
| 2295 | .flush_tlb_user = xen_flush_tlb, | 2352 | .flush_tlb_user = xen_flush_tlb, |
| 2296 | .flush_tlb_kernel = xen_flush_tlb, | 2353 | .flush_tlb_kernel = xen_flush_tlb, |
| @@ -2627,7 +2684,8 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | |||
| 2627 | 2684 | ||
| 2628 | prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP); | 2685 | prot = __pgprot(pgprot_val(prot) | _PAGE_IOMAP); |
| 2629 | 2686 | ||
| 2630 | vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; | 2687 | BUG_ON(!((vma->vm_flags & (VM_PFNMAP | VM_RESERVED | VM_IO)) == |
| 2688 | (VM_PFNMAP | VM_RESERVED | VM_IO))); | ||
| 2631 | 2689 | ||
| 2632 | rmd.mfn = mfn; | 2690 | rmd.mfn = mfn; |
| 2633 | rmd.prot = prot; | 2691 | rmd.prot = prot; |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index b1dbdaa23ecc..01afd8a94607 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #include <xen/interface/callback.h> | 23 | #include <xen/interface/callback.h> |
| 24 | #include <xen/interface/memory.h> | 24 | #include <xen/interface/memory.h> |
| 25 | #include <xen/interface/physdev.h> | 25 | #include <xen/interface/physdev.h> |
| 26 | #include <xen/interface/memory.h> | ||
| 27 | #include <xen/features.h> | 26 | #include <xen/features.h> |
| 28 | 27 | ||
| 29 | #include "xen-ops.h" | 28 | #include "xen-ops.h" |
| @@ -118,16 +117,18 @@ static unsigned long __init xen_return_unused_memory(unsigned long max_pfn, | |||
| 118 | const struct e820map *e820) | 117 | const struct e820map *e820) |
| 119 | { | 118 | { |
| 120 | phys_addr_t max_addr = PFN_PHYS(max_pfn); | 119 | phys_addr_t max_addr = PFN_PHYS(max_pfn); |
| 121 | phys_addr_t last_end = 0; | 120 | phys_addr_t last_end = ISA_END_ADDRESS; |
| 122 | unsigned long released = 0; | 121 | unsigned long released = 0; |
| 123 | int i; | 122 | int i; |
| 124 | 123 | ||
| 124 | /* Free any unused memory above the low 1Mbyte. */ | ||
| 125 | for (i = 0; i < e820->nr_map && last_end < max_addr; i++) { | 125 | for (i = 0; i < e820->nr_map && last_end < max_addr; i++) { |
| 126 | phys_addr_t end = e820->map[i].addr; | 126 | phys_addr_t end = e820->map[i].addr; |
| 127 | end = min(max_addr, end); | 127 | end = min(max_addr, end); |
| 128 | 128 | ||
| 129 | released += xen_release_chunk(last_end, end); | 129 | if (last_end < end) |
| 130 | last_end = e820->map[i].addr + e820->map[i].size; | 130 | released += xen_release_chunk(last_end, end); |
| 131 | last_end = max(last_end, e820->map[i].addr + e820->map[i].size); | ||
| 131 | } | 132 | } |
| 132 | 133 | ||
| 133 | if (last_end < max_addr) | 134 | if (last_end < max_addr) |
| @@ -164,6 +165,7 @@ char * __init xen_memory_setup(void) | |||
| 164 | XENMEM_memory_map; | 165 | XENMEM_memory_map; |
| 165 | rc = HYPERVISOR_memory_op(op, &memmap); | 166 | rc = HYPERVISOR_memory_op(op, &memmap); |
| 166 | if (rc == -ENOSYS) { | 167 | if (rc == -ENOSYS) { |
| 168 | BUG_ON(xen_initial_domain()); | ||
| 167 | memmap.nr_entries = 1; | 169 | memmap.nr_entries = 1; |
| 168 | map[0].addr = 0ULL; | 170 | map[0].addr = 0ULL; |
| 169 | map[0].size = mem_end; | 171 | map[0].size = mem_end; |
| @@ -201,12 +203,13 @@ char * __init xen_memory_setup(void) | |||
| 201 | } | 203 | } |
| 202 | 204 | ||
| 203 | /* | 205 | /* |
| 204 | * Even though this is normal, usable memory under Xen, reserve | 206 | * In domU, the ISA region is normal, usable memory, but we |
| 205 | * ISA memory anyway because too many things think they can poke | 207 | * reserve ISA memory anyway because too many things poke |
| 206 | * about in there. | 208 | * about in there. |
| 207 | * | 209 | * |
| 208 | * In a dom0 kernel, this region is identity mapped with the | 210 | * In Dom0, the host E820 information can leave gaps in the |
| 209 | * hardware ISA area, so it really is out of bounds. | 211 | * ISA range, which would cause us to release those pages. To |
| 212 | * avoid this, we unconditionally reserve them here. | ||
| 210 | */ | 213 | */ |
| 211 | e820_add_region(ISA_START_ADDRESS, ISA_END_ADDRESS - ISA_START_ADDRESS, | 214 | e820_add_region(ISA_START_ADDRESS, ISA_END_ADDRESS - ISA_START_ADDRESS, |
| 212 | E820_RESERVED); | 215 | E820_RESERVED); |
| @@ -244,8 +247,7 @@ char * __init xen_memory_setup(void) | |||
| 244 | else | 247 | else |
| 245 | extra_pages = 0; | 248 | extra_pages = 0; |
| 246 | 249 | ||
| 247 | if (!xen_initial_domain()) | 250 | xen_add_extra_mem(extra_pages); |
| 248 | xen_add_extra_mem(extra_pages); | ||
| 249 | 251 | ||
| 250 | return "Xen"; | 252 | return "Xen"; |
| 251 | } | 253 | } |
| @@ -333,9 +335,6 @@ void __cpuinit xen_enable_syscall(void) | |||
| 333 | 335 | ||
| 334 | void __init xen_arch_setup(void) | 336 | void __init xen_arch_setup(void) |
| 335 | { | 337 | { |
| 336 | struct physdev_set_iopl set_iopl; | ||
| 337 | int rc; | ||
| 338 | |||
| 339 | xen_panic_handler_init(); | 338 | xen_panic_handler_init(); |
| 340 | 339 | ||
| 341 | HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments); | 340 | HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments); |
| @@ -352,11 +351,6 @@ void __init xen_arch_setup(void) | |||
| 352 | xen_enable_sysenter(); | 351 | xen_enable_sysenter(); |
| 353 | xen_enable_syscall(); | 352 | xen_enable_syscall(); |
| 354 | 353 | ||
| 355 | set_iopl.iopl = 1; | ||
| 356 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl); | ||
| 357 | if (rc != 0) | ||
| 358 | printk(KERN_INFO "physdev_op failed %d\n", rc); | ||
| 359 | |||
| 360 | #ifdef CONFIG_ACPI | 354 | #ifdef CONFIG_ACPI |
| 361 | if (!(xen_start_info->flags & SIF_INITDOMAIN)) { | 355 | if (!(xen_start_info->flags & SIF_INITDOMAIN)) { |
| 362 | printk(KERN_INFO "ACPI in unprivileged domain disabled\n"); | 356 | printk(KERN_INFO "ACPI in unprivileged domain disabled\n"); |
