diff options
211 files changed, 9618 insertions, 2101 deletions
diff --git a/.gitignore b/.gitignore index a2939fc10b22..8faa6c02b39e 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -28,6 +28,7 @@ modules.builtin | |||
28 | *.gz | 28 | *.gz |
29 | *.bz2 | 29 | *.bz2 |
30 | *.lzma | 30 | *.lzma |
31 | *.lzo | ||
31 | *.patch | 32 | *.patch |
32 | *.gcno | 33 | *.gcno |
33 | 34 | ||
diff --git a/Documentation/.gitignore b/Documentation/.gitignore new file mode 100644 index 000000000000..bcd907b4141f --- /dev/null +++ b/Documentation/.gitignore | |||
@@ -0,0 +1,7 @@ | |||
1 | filesystems/dnotify_test | ||
2 | laptops/dslm | ||
3 | timers/hpet_example | ||
4 | vm/hugepage-mmap | ||
5 | vm/hugepage-shm | ||
6 | vm/map_hugetlb | ||
7 | |||
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index 6f8c1cabbc5d..634c625da8ce 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt | |||
@@ -65,7 +65,7 @@ CROSS_COMPILE | |||
65 | Specify an optional fixed part of the binutils filename. | 65 | Specify an optional fixed part of the binutils filename. |
66 | CROSS_COMPILE can be a part of the filename or the full path. | 66 | CROSS_COMPILE can be a part of the filename or the full path. |
67 | 67 | ||
68 | CROSS_COMPILE is also used for ccache is some setups. | 68 | CROSS_COMPILE is also used for ccache in some setups. |
69 | 69 | ||
70 | CF | 70 | CF |
71 | -------------------------------------------------- | 71 | -------------------------------------------------- |
@@ -162,3 +162,7 @@ For tags/TAGS/cscope targets, you can specify more than one arch | |||
162 | to be included in the databases, separated by blank space. E.g.: | 162 | to be included in the databases, separated by blank space. E.g.: |
163 | 163 | ||
164 | $ make ALLSOURCE_ARCHS="x86 mips arm" tags | 164 | $ make ALLSOURCE_ARCHS="x86 mips arm" tags |
165 | |||
166 | To get all available archs you can also specify all. E.g.: | ||
167 | |||
168 | $ make ALLSOURCE_ARCHS=all tags | ||
diff --git a/Documentation/mutex-design.txt b/Documentation/mutex-design.txt index aa60d1f627e5..c91ccc0720fa 100644 --- a/Documentation/mutex-design.txt +++ b/Documentation/mutex-design.txt | |||
@@ -66,14 +66,14 @@ of advantages of mutexes: | |||
66 | 66 | ||
67 | c0377ccb <mutex_lock>: | 67 | c0377ccb <mutex_lock>: |
68 | c0377ccb: f0 ff 08 lock decl (%eax) | 68 | c0377ccb: f0 ff 08 lock decl (%eax) |
69 | c0377cce: 78 0e js c0377cde <.text.lock.mutex> | 69 | c0377cce: 78 0e js c0377cde <.text..lock.mutex> |
70 | c0377cd0: c3 ret | 70 | c0377cd0: c3 ret |
71 | 71 | ||
72 | the unlocking fastpath is equally tight: | 72 | the unlocking fastpath is equally tight: |
73 | 73 | ||
74 | c0377cd1 <mutex_unlock>: | 74 | c0377cd1 <mutex_unlock>: |
75 | c0377cd1: f0 ff 00 lock incl (%eax) | 75 | c0377cd1: f0 ff 00 lock incl (%eax) |
76 | c0377cd4: 7e 0f jle c0377ce5 <.text.lock.mutex+0x7> | 76 | c0377cd4: 7e 0f jle c0377ce5 <.text..lock.mutex+0x7> |
77 | c0377cd6: c3 ret | 77 | c0377cd6: c3 ret |
78 | 78 | ||
79 | - 'struct mutex' semantics are well-defined and are enforced if | 79 | - 'struct mutex' semantics are well-defined and are enforced if |
diff --git a/Documentation/timers/Makefile b/Documentation/timers/Makefile index c85625f4ab25..73f75f8a87dc 100644 --- a/Documentation/timers/Makefile +++ b/Documentation/timers/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | obj- := dummy.o | 2 | obj- := dummy.o |
3 | 3 | ||
4 | # List of programs to build | 4 | # List of programs to build |
5 | hostprogs-y := hpet_example | 5 | hostprogs-$(CONFIG_X86) := hpet_example |
6 | 6 | ||
7 | # Tell kbuild to always build the programs | 7 | # Tell kbuild to always build the programs |
8 | always := $(hostprogs-y) | 8 | always := $(hostprogs-y) |
diff --git a/MAINTAINERS b/MAINTAINERS index 13608bd2e791..2652ebc5ab40 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -3242,7 +3242,7 @@ L: autofs@linux.kernel.org | |||
3242 | S: Maintained | 3242 | S: Maintained |
3243 | F: fs/autofs4/ | 3243 | F: fs/autofs4/ |
3244 | 3244 | ||
3245 | KERNEL BUILD | 3245 | KERNEL BUILD + files below scripts/ (unless maintained elsewhere) |
3246 | M: Michal Marek <mmarek@suse.cz> | 3246 | M: Michal Marek <mmarek@suse.cz> |
3247 | T: git git://repo.or.cz/linux-kbuild.git for-next | 3247 | T: git git://repo.or.cz/linux-kbuild.git for-next |
3248 | T: git git://repo.or.cz/linux-kbuild.git for-linus | 3248 | T: git git://repo.or.cz/linux-kbuild.git for-linus |
@@ -3251,6 +3251,9 @@ S: Maintained | |||
3251 | F: Documentation/kbuild/ | 3251 | F: Documentation/kbuild/ |
3252 | F: Makefile | 3252 | F: Makefile |
3253 | F: scripts/Makefile.* | 3253 | F: scripts/Makefile.* |
3254 | F: scripts/basic/ | ||
3255 | F: scripts/mk* | ||
3256 | F: scripts/package/ | ||
3254 | 3257 | ||
3255 | KERNEL JANITORS | 3258 | KERNEL JANITORS |
3256 | L: kernel-janitors@vger.kernel.org | 3259 | L: kernel-janitors@vger.kernel.org |
@@ -183,11 +183,14 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ | |||
183 | # CROSS_COMPILE can be set on the command line | 183 | # CROSS_COMPILE can be set on the command line |
184 | # make CROSS_COMPILE=ia64-linux- | 184 | # make CROSS_COMPILE=ia64-linux- |
185 | # Alternatively CROSS_COMPILE can be set in the environment. | 185 | # Alternatively CROSS_COMPILE can be set in the environment. |
186 | # A third alternative is to store a setting in .config so that plain | ||
187 | # "make" in the configured kernel build directory always uses that. | ||
186 | # Default value for CROSS_COMPILE is not to prefix executables | 188 | # Default value for CROSS_COMPILE is not to prefix executables |
187 | # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile | 189 | # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile |
188 | export KBUILD_BUILDHOST := $(SUBARCH) | 190 | export KBUILD_BUILDHOST := $(SUBARCH) |
189 | ARCH ?= $(SUBARCH) | 191 | ARCH ?= $(SUBARCH) |
190 | CROSS_COMPILE ?= | 192 | CROSS_COMPILE ?= |
193 | CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) | ||
191 | 194 | ||
192 | # Architecture as present in compile.h | 195 | # Architecture as present in compile.h |
193 | UTS_MACHINE := $(ARCH) | 196 | UTS_MACHINE := $(ARCH) |
@@ -576,9 +579,6 @@ KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) | |||
576 | # disable invalid "can't wrap" optimizations for signed / pointers | 579 | # disable invalid "can't wrap" optimizations for signed / pointers |
577 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | 580 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) |
578 | 581 | ||
579 | # revert to pre-gcc-4.4 behaviour of .eh_frame | ||
580 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) | ||
581 | |||
582 | # conserve stack if available | 582 | # conserve stack if available |
583 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) | 583 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) |
584 | 584 | ||
@@ -882,9 +882,6 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; | |||
882 | PHONY += $(vmlinux-dirs) | 882 | PHONY += $(vmlinux-dirs) |
883 | $(vmlinux-dirs): prepare scripts | 883 | $(vmlinux-dirs): prepare scripts |
884 | $(Q)$(MAKE) $(build)=$@ | 884 | $(Q)$(MAKE) $(build)=$@ |
885 | ifdef CONFIG_MODULES | ||
886 | $(Q)$(MAKE) $(modbuiltin)=$@ | ||
887 | endif | ||
888 | 885 | ||
889 | # Build the kernel release string | 886 | # Build the kernel release string |
890 | # | 887 | # |
@@ -907,14 +904,19 @@ endif | |||
907 | # $(localver) | 904 | # $(localver) |
908 | # localversion* (files without backups, containing '~') | 905 | # localversion* (files without backups, containing '~') |
909 | # $(CONFIG_LOCALVERSION) (from kernel config setting) | 906 | # $(CONFIG_LOCALVERSION) (from kernel config setting) |
910 | # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) | 907 | # $(LOCALVERSION) (from make command line, if provided) |
911 | # ./scripts/setlocalversion (SCM tag, if one exists) | 908 | # $(localver-extra) |
912 | # $(LOCALVERSION) (from make command line if provided) | 909 | # $(scm-identifier) (unique SCM tag, if one exists) |
910 | # ./scripts/setlocalversion (only with CONFIG_LOCALVERSION_AUTO) | ||
911 | # .scmversion (only with CONFIG_LOCALVERSION_AUTO) | ||
912 | # + (only without CONFIG_LOCALVERSION_AUTO | ||
913 | # and without LOCALVERSION= and | ||
914 | # repository is at non-tagged commit) | ||
913 | # | 915 | # |
914 | # Note how the final $(localver-auto) string is included *only* if the | 916 | # For kernels without CONFIG_LOCALVERSION_AUTO compiled from an SCM that has |
915 | # kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the | 917 | # been revised beyond a tagged commit, `+' is appended to the version string |
916 | # moment, only git is supported but other SCMs can edit the script | 918 | # when not overridden by using "make LOCALVERSION=". This indicates that the |
917 | # scripts/setlocalversion and add the appropriate checks as needed. | 919 | # kernel is not a vanilla release version and has been modified. |
918 | 920 | ||
919 | pattern = ".*/localversion[^~]*" | 921 | pattern = ".*/localversion[^~]*" |
920 | string = $(shell cat /dev/null \ | 922 | string = $(shell cat /dev/null \ |
@@ -923,26 +925,32 @@ string = $(shell cat /dev/null \ | |||
923 | localver = $(subst $(space),, $(string) \ | 925 | localver = $(subst $(space),, $(string) \ |
924 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) | 926 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) |
925 | 927 | ||
926 | # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called | 928 | # scripts/setlocalversion is called to create a unique identifier if the source |
927 | # and if the SCM is know a tag from the SCM is appended. | 929 | # is managed by a known SCM and the repository has been revised since the last |
928 | # The appended tag is determined by the SCM used. | 930 | # tagged (release) commit. The format of the identifier is determined by the |
931 | # SCM's implementation. | ||
929 | # | 932 | # |
930 | # .scmversion is used when generating rpm packages so we do not loose | 933 | # .scmversion is used when generating rpm packages so we do not loose |
931 | # the version information from the SCM when we do the build of the kernel | 934 | # the version information from the SCM when we do the build of the kernel |
932 | # from the copied source | 935 | # from the copied source |
933 | ifdef CONFIG_LOCALVERSION_AUTO | ||
934 | |||
935 | ifeq ($(wildcard .scmversion),) | 936 | ifeq ($(wildcard .scmversion),) |
936 | _localver-auto = $(shell $(CONFIG_SHELL) \ | 937 | scm-identifier = $(shell $(CONFIG_SHELL) \ |
937 | $(srctree)/scripts/setlocalversion $(srctree)) | 938 | $(srctree)/scripts/setlocalversion $(srctree)) |
938 | else | 939 | else |
939 | _localver-auto = $(shell cat .scmversion 2> /dev/null) | 940 | scm-identifier = $(shell cat .scmversion 2> /dev/null) |
940 | endif | 941 | endif |
941 | 942 | ||
942 | localver-auto = $(LOCALVERSION)$(_localver-auto) | 943 | ifdef CONFIG_LOCALVERSION_AUTO |
944 | localver-extra = $(scm-identifier) | ||
945 | else | ||
946 | ifneq ($(scm-identifier),) | ||
947 | ifeq ($(LOCALVERSION),) | ||
948 | localver-extra = + | ||
949 | endif | ||
950 | endif | ||
943 | endif | 951 | endif |
944 | 952 | ||
945 | localver-full = $(localver)$(localver-auto) | 953 | localver-full = $(localver)$(LOCALVERSION)$(localver-extra) |
946 | 954 | ||
947 | # Store (new) KERNELRELASE string in include/config/kernel.release | 955 | # Store (new) KERNELRELASE string in include/config/kernel.release |
948 | kernelrelease = $(KERNELVERSION)$(localver-full) | 956 | kernelrelease = $(KERNELVERSION)$(localver-full) |
@@ -1089,11 +1097,16 @@ all: modules | |||
1089 | PHONY += modules | 1097 | PHONY += modules |
1090 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1098 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) |
1091 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order | 1099 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order |
1092 | $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin | ||
1093 | @$(kecho) ' Building modules, stage 2.'; | 1100 | @$(kecho) ' Building modules, stage 2.'; |
1094 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1101 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
1095 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild | 1102 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild |
1096 | 1103 | ||
1104 | modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) | ||
1105 | $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin | ||
1106 | |||
1107 | %/modules.builtin: include/config/auto.conf | ||
1108 | $(Q)$(MAKE) $(modbuiltin)=$* | ||
1109 | |||
1097 | 1110 | ||
1098 | # Target to prepare building external modules | 1111 | # Target to prepare building external modules |
1099 | PHONY += modules_prepare | 1112 | PHONY += modules_prepare |
@@ -1104,7 +1117,7 @@ PHONY += modules_install | |||
1104 | modules_install: _modinst_ _modinst_post | 1117 | modules_install: _modinst_ _modinst_post |
1105 | 1118 | ||
1106 | PHONY += _modinst_ | 1119 | PHONY += _modinst_ |
1107 | _modinst_: | 1120 | _modinst_: modules.builtin |
1108 | @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ | 1121 | @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ |
1109 | echo "Warning: you may need to install module-init-tools"; \ | 1122 | echo "Warning: you may need to install module-init-tools"; \ |
1110 | echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ | 1123 | echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ |
@@ -1247,7 +1260,9 @@ help: | |||
1247 | @echo ' firmware_install- Install all firmware to INSTALL_FW_PATH' | 1260 | @echo ' firmware_install- Install all firmware to INSTALL_FW_PATH' |
1248 | @echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)' | 1261 | @echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)' |
1249 | @echo ' dir/ - Build all files in dir and below' | 1262 | @echo ' dir/ - Build all files in dir and below' |
1250 | @echo ' dir/file.[ois] - Build specified target only' | 1263 | @echo ' dir/file.[oisS] - Build specified target only' |
1264 | @echo ' dir/file.lst - Build specified mixed source/assembly target only' | ||
1265 | @echo ' (requires a recent binutils and recent build (System.map))' | ||
1251 | @echo ' dir/file.ko - Build module including final link' | 1266 | @echo ' dir/file.ko - Build module including final link' |
1252 | @echo ' modules_prepare - Set up for building external modules' | 1267 | @echo ' modules_prepare - Set up for building external modules' |
1253 | @echo ' tags/TAGS - Generate tags file for editors' | 1268 | @echo ' tags/TAGS - Generate tags file for editors' |
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c index 77630df94343..884275629ef7 100644 --- a/arch/cris/arch-v10/drivers/ds1302.c +++ b/arch/cris/arch-v10/drivers/ds1302.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/miscdevice.h> | 20 | #include <linux/miscdevice.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/smp_lock.h> | ||
22 | #include <linux/bcd.h> | 23 | #include <linux/bcd.h> |
23 | #include <linux/capability.h> | 24 | #include <linux/capability.h> |
24 | 25 | ||
@@ -238,9 +239,7 @@ static unsigned char days_in_mo[] = | |||
238 | 239 | ||
239 | /* ioctl that supports RTC_RD_TIME and RTC_SET_TIME (read and set time/date). */ | 240 | /* ioctl that supports RTC_RD_TIME and RTC_SET_TIME (read and set time/date). */ |
240 | 241 | ||
241 | static int | 242 | static int rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
242 | rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | ||
243 | unsigned long arg) | ||
244 | { | 243 | { |
245 | unsigned long flags; | 244 | unsigned long flags; |
246 | 245 | ||
@@ -354,6 +353,17 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
354 | } | 353 | } |
355 | } | 354 | } |
356 | 355 | ||
356 | static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
357 | { | ||
358 | int ret; | ||
359 | |||
360 | lock_kernel(); | ||
361 | ret = rtc_ioctl(file, cmd, arg); | ||
362 | unlock_kernel(); | ||
363 | |||
364 | return ret; | ||
365 | } | ||
366 | |||
357 | static void | 367 | static void |
358 | print_rtc_status(void) | 368 | print_rtc_status(void) |
359 | { | 369 | { |
@@ -375,8 +385,8 @@ print_rtc_status(void) | |||
375 | /* The various file operations we support. */ | 385 | /* The various file operations we support. */ |
376 | 386 | ||
377 | static const struct file_operations rtc_fops = { | 387 | static const struct file_operations rtc_fops = { |
378 | .owner = THIS_MODULE, | 388 | .owner = THIS_MODULE, |
379 | .ioctl = rtc_ioctl, | 389 | .unlocked_ioctl = rtc_unlocked_ioctl, |
380 | }; | 390 | }; |
381 | 391 | ||
382 | /* Probe for the chip by writing something to its RAM and try reading it back. */ | 392 | /* Probe for the chip by writing something to its RAM and try reading it back. */ |
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c index 1e90c1a9c849..7dcb1f85f42b 100644 --- a/arch/cris/arch-v10/drivers/pcf8563.c +++ b/arch/cris/arch-v10/drivers/pcf8563.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/bcd.h> | 28 | #include <linux/bcd.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/smp_lock.h> | ||
30 | 31 | ||
31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
32 | #include <asm/system.h> | 33 | #include <asm/system.h> |
@@ -53,7 +54,7 @@ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ | |||
53 | static const unsigned char days_in_month[] = | 54 | static const unsigned char days_in_month[] = |
54 | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; | 55 | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; |
55 | 56 | ||
56 | int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 57 | static long pcf8563_unlocked_ioctl(struct file *, unsigned int, unsigned long); |
57 | 58 | ||
58 | /* Cache VL bit value read at driver init since writing the RTC_SECOND | 59 | /* Cache VL bit value read at driver init since writing the RTC_SECOND |
59 | * register clears the VL status. | 60 | * register clears the VL status. |
@@ -62,7 +63,7 @@ static int voltage_low; | |||
62 | 63 | ||
63 | static const struct file_operations pcf8563_fops = { | 64 | static const struct file_operations pcf8563_fops = { |
64 | .owner = THIS_MODULE, | 65 | .owner = THIS_MODULE, |
65 | .ioctl = pcf8563_ioctl, | 66 | .unlocked_ioctl = pcf8563_unlocked_ioctl, |
66 | }; | 67 | }; |
67 | 68 | ||
68 | unsigned char | 69 | unsigned char |
@@ -212,8 +213,7 @@ pcf8563_exit(void) | |||
212 | * ioctl calls for this driver. Why return -ENOTTY upon error? Because | 213 | * ioctl calls for this driver. Why return -ENOTTY upon error? Because |
213 | * POSIX says so! | 214 | * POSIX says so! |
214 | */ | 215 | */ |
215 | int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 216 | static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
216 | unsigned long arg) | ||
217 | { | 217 | { |
218 | /* Some sanity checks. */ | 218 | /* Some sanity checks. */ |
219 | if (_IOC_TYPE(cmd) != RTC_MAGIC) | 219 | if (_IOC_TYPE(cmd) != RTC_MAGIC) |
@@ -339,6 +339,17 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
339 | return 0; | 339 | return 0; |
340 | } | 340 | } |
341 | 341 | ||
342 | static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ||
343 | { | ||
344 | int ret; | ||
345 | |||
346 | lock_kernel(); | ||
347 | return pcf8563_ioctl(filp, cmd, arg); | ||
348 | unlock_kernel(); | ||
349 | |||
350 | return ret; | ||
351 | } | ||
352 | |||
342 | static int __init pcf8563_register(void) | 353 | static int __init pcf8563_register(void) |
343 | { | 354 | { |
344 | if (pcf8563_init() < 0) { | 355 | if (pcf8563_init() < 0) { |
diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c index 1a61efc13982..a0c0df8be9c8 100644 --- a/arch/cris/arch-v10/kernel/irq.c +++ b/arch/cris/arch-v10/kernel/irq.c | |||
@@ -17,8 +17,8 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | 19 | ||
20 | #define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr)); | 20 | #define crisv10_mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr)); |
21 | #define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr)); | 21 | #define crisv10_unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr)); |
22 | 22 | ||
23 | /* don't use set_int_vector, it bypasses the linux interrupt handlers. it is | 23 | /* don't use set_int_vector, it bypasses the linux interrupt handlers. it is |
24 | * global just so that the kernel gdb can use it. | 24 | * global just so that the kernel gdb can use it. |
@@ -116,12 +116,12 @@ static unsigned int startup_crisv10_irq(unsigned int irq) | |||
116 | 116 | ||
117 | static void enable_crisv10_irq(unsigned int irq) | 117 | static void enable_crisv10_irq(unsigned int irq) |
118 | { | 118 | { |
119 | unmask_irq(irq); | 119 | crisv10_unmask_irq(irq); |
120 | } | 120 | } |
121 | 121 | ||
122 | static void disable_crisv10_irq(unsigned int irq) | 122 | static void disable_crisv10_irq(unsigned int irq) |
123 | { | 123 | { |
124 | mask_irq(irq); | 124 | crisv10_mask_irq(irq); |
125 | } | 125 | } |
126 | 126 | ||
127 | static void ack_crisv10_irq(unsigned int irq) | 127 | static void ack_crisv10_irq(unsigned int irq) |
diff --git a/arch/cris/arch-v10/lib/dmacopy.c b/arch/cris/arch-v10/lib/dmacopy.c index e5fb44f505c5..49f5b8ca5b47 100644 --- a/arch/cris/arch-v10/lib/dmacopy.c +++ b/arch/cris/arch-v10/lib/dmacopy.c | |||
@@ -1,5 +1,4 @@ | |||
1 | /* $Id: dmacopy.c,v 1.1 2001/12/17 13:59:27 bjornw Exp $ | 1 | /* |
2 | * | ||
3 | * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax | 2 | * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax |
4 | */ | 3 | */ |
5 | 4 | ||
@@ -13,11 +12,11 @@ void *dma_memcpy(void *pdst, | |||
13 | unsigned int pn) | 12 | unsigned int pn) |
14 | { | 13 | { |
15 | static etrax_dma_descr indma, outdma; | 14 | static etrax_dma_descr indma, outdma; |
16 | 15 | ||
17 | D(printk("dma_memcpy %d bytes... ", pn)); | 16 | D(printk(KERN_DEBUG "dma_memcpy %d bytes... ", pn)); |
18 | 17 | ||
19 | #if 0 | 18 | #if 0 |
20 | *R_GEN_CONFIG = genconfig_shadow = | 19 | *R_GEN_CONFIG = genconfig_shadow = |
21 | (genconfig_shadow & ~0x3c0000) | | 20 | (genconfig_shadow & ~0x3c0000) | |
22 | IO_STATE(R_GEN_CONFIG, dma6, intdma7) | | 21 | IO_STATE(R_GEN_CONFIG, dma6, intdma7) | |
23 | IO_STATE(R_GEN_CONFIG, dma7, intdma6); | 22 | IO_STATE(R_GEN_CONFIG, dma7, intdma6); |
@@ -32,11 +31,11 @@ void *dma_memcpy(void *pdst, | |||
32 | *R_DMA_CH7_FIRST = &outdma; | 31 | *R_DMA_CH7_FIRST = &outdma; |
33 | *R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start); | 32 | *R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start); |
34 | *R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start); | 33 | *R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start); |
35 | |||
36 | while(*R_DMA_CH7_CMD == 1) /* wait for completion */ ; | ||
37 | 34 | ||
38 | D(printk("done\n")); | 35 | while (*R_DMA_CH7_CMD == 1) |
36 | /* wait for completion */; | ||
39 | 37 | ||
38 | D(printk(KERN_DEBUG "done\n")); | ||
40 | } | 39 | } |
41 | 40 | ||
42 | 41 | ||
diff --git a/arch/cris/arch-v10/lib/hw_settings.S b/arch/cris/arch-v10/lib/hw_settings.S index 56905aaa7b6e..c09f19f478a5 100644 --- a/arch/cris/arch-v10/lib/hw_settings.S +++ b/arch/cris/arch-v10/lib/hw_settings.S | |||
@@ -1,13 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: hw_settings.S,v 1.1 2001/12/17 13:59:27 bjornw Exp $ | ||
3 | * | ||
4 | * This table is used by some tools to extract hardware parameters. | 2 | * This table is used by some tools to extract hardware parameters. |
5 | * The table should be included in the kernel and the decompressor. | 3 | * The table should be included in the kernel and the decompressor. |
6 | * Don't forget to update the tools if you change this table. | 4 | * Don't forget to update the tools if you change this table. |
7 | * | 5 | * |
8 | * Copyright (C) 2001 Axis Communications AB | 6 | * Copyright (C) 2001 Axis Communications AB |
9 | * | 7 | * |
10 | * Authors: Mikael Starvik (starvik@axis.com) | 8 | * Authors: Mikael Starvik (starvik@axis.com) |
11 | */ | 9 | */ |
12 | 10 | ||
13 | #define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \ | 11 | #define PA_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PA_DIR << 8) | \ |
@@ -15,13 +13,13 @@ | |||
15 | #define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \ | 13 | #define PB_SET_VALUE ((CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG << 16) | \ |
16 | (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \ | 14 | (CONFIG_ETRAX_DEF_R_PORT_PB_DIR << 8) | \ |
17 | (CONFIG_ETRAX_DEF_R_PORT_PB_DATA)) | 15 | (CONFIG_ETRAX_DEF_R_PORT_PB_DATA)) |
18 | 16 | ||
19 | .ascii "HW_PARAM_MAGIC" ; Magic number | 17 | .ascii "HW_PARAM_MAGIC" ; Magic number |
20 | .dword 0xc0004000 ; Kernel start address | 18 | .dword 0xc0004000 ; Kernel start address |
21 | 19 | ||
22 | ; Debug port | 20 | ; Debug port |
23 | #ifdef CONFIG_ETRAX_DEBUG_PORT0 | 21 | #ifdef CONFIG_ETRAX_DEBUG_PORT0 |
24 | .dword 0 | 22 | .dword 0 |
25 | #elif defined(CONFIG_ETRAX_DEBUG_PORT1) | 23 | #elif defined(CONFIG_ETRAX_DEBUG_PORT1) |
26 | .dword 1 | 24 | .dword 1 |
27 | #elif defined(CONFIG_ETRAX_DEBUG_PORT2) | 25 | #elif defined(CONFIG_ETRAX_DEBUG_PORT2) |
@@ -30,7 +28,7 @@ | |||
30 | .dword 3 | 28 | .dword 3 |
31 | #else | 29 | #else |
32 | .dword 4 ; No debug | 30 | .dword 4 ; No debug |
33 | #endif | 31 | #endif |
34 | 32 | ||
35 | ; SDRAM or EDO DRAM? | 33 | ; SDRAM or EDO DRAM? |
36 | #ifdef CONFIG_ETRAX_SDRAM | 34 | #ifdef CONFIG_ETRAX_SDRAM |
@@ -39,7 +37,7 @@ | |||
39 | .dword 0 | 37 | .dword 0 |
40 | #endif | 38 | #endif |
41 | 39 | ||
42 | ; Register values | 40 | ; Register values |
43 | .dword R_WAITSTATES | 41 | .dword R_WAITSTATES |
44 | .dword CONFIG_ETRAX_DEF_R_WAITSTATES | 42 | .dword CONFIG_ETRAX_DEF_R_WAITSTATES |
45 | .dword R_BUS_CONFIG | 43 | .dword R_BUS_CONFIG |
@@ -56,7 +54,7 @@ | |||
56 | .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING | 54 | .dword CONFIG_ETRAX_DEF_R_DRAM_TIMING |
57 | #endif | 55 | #endif |
58 | .dword R_PORT_PA_SET | 56 | .dword R_PORT_PA_SET |
59 | .dword PA_SET_VALUE | 57 | .dword PA_SET_VALUE |
60 | .dword R_PORT_PB_SET | 58 | .dword R_PORT_PB_SET |
61 | .dword PB_SET_VALUE | 59 | .dword PB_SET_VALUE |
62 | .dword 0 ; No more register values | 60 | .dword 0 ; No more register values |
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig index b9e328e688be..a2dd740c5907 100644 --- a/arch/cris/arch-v32/drivers/Kconfig +++ b/arch/cris/arch-v32/drivers/Kconfig | |||
@@ -360,24 +360,10 @@ config ETRAX_SER4_DSR_BIT | |||
360 | string "Ser 4 DSR bit (empty = not used)" | 360 | string "Ser 4 DSR bit (empty = not used)" |
361 | depends on ETRAX_SERIAL_PORT4 | 361 | depends on ETRAX_SERIAL_PORT4 |
362 | 362 | ||
363 | config ETRAX_SER3_CD_BIT | 363 | config ETRAX_SER4_CD_BIT |
364 | string "Ser 4 CD bit (empty = not used)" | 364 | string "Ser 4 CD bit (empty = not used)" |
365 | depends on ETRAX_SERIAL_PORT4 | 365 | depends on ETRAX_SERIAL_PORT4 |
366 | 366 | ||
367 | config ETRAX_RS485 | ||
368 | bool "RS-485 support" | ||
369 | depends on ETRAXFS_SERIAL | ||
370 | help | ||
371 | Enables support for RS-485 serial communication. For a primer on | ||
372 | RS-485, see <http://www.hw.cz/english/docs/rs485/rs485.html>. | ||
373 | |||
374 | config ETRAX_RS485_DISABLE_RECEIVER | ||
375 | bool "Disable serial receiver" | ||
376 | depends on ETRAX_RS485 | ||
377 | help | ||
378 | It is necessary to disable the serial receiver to avoid serial | ||
379 | loopback. Not all products are able to do this in software only. | ||
380 | |||
381 | config ETRAX_SYNCHRONOUS_SERIAL | 367 | config ETRAX_SYNCHRONOUS_SERIAL |
382 | bool "Synchronous serial-port support" | 368 | bool "Synchronous serial-port support" |
383 | depends on ETRAX_ARCH_V32 | 369 | depends on ETRAX_ARCH_V32 |
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index 506826399ae7..2fd6a740d895 100644 --- a/arch/cris/arch-v32/drivers/i2c.c +++ b/arch/cris/arch-v32/drivers/i2c.c | |||
@@ -649,10 +649,10 @@ i2c_release(struct inode *inode, struct file *filp) | |||
649 | /* Main device API. ioctl's to write or read to/from i2c registers. | 649 | /* Main device API. ioctl's to write or read to/from i2c registers. |
650 | */ | 650 | */ |
651 | 651 | ||
652 | static int | 652 | static long |
653 | i2c_ioctl(struct inode *inode, struct file *file, | 653 | i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
654 | unsigned int cmd, unsigned long arg) | ||
655 | { | 654 | { |
655 | int ret; | ||
656 | if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) { | 656 | if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) { |
657 | return -ENOTTY; | 657 | return -ENOTTY; |
658 | } | 658 | } |
@@ -665,9 +665,13 @@ i2c_ioctl(struct inode *inode, struct file *file, | |||
665 | I2C_ARGREG(arg), | 665 | I2C_ARGREG(arg), |
666 | I2C_ARGVALUE(arg))); | 666 | I2C_ARGVALUE(arg))); |
667 | 667 | ||
668 | return i2c_writereg(I2C_ARGSLAVE(arg), | 668 | lock_kernel(); |
669 | ret = i2c_writereg(I2C_ARGSLAVE(arg), | ||
669 | I2C_ARGREG(arg), | 670 | I2C_ARGREG(arg), |
670 | I2C_ARGVALUE(arg)); | 671 | I2C_ARGVALUE(arg)); |
672 | unlock_kernel(); | ||
673 | return ret; | ||
674 | |||
671 | case I2C_READREG: | 675 | case I2C_READREG: |
672 | { | 676 | { |
673 | unsigned char val; | 677 | unsigned char val; |
@@ -675,7 +679,9 @@ i2c_ioctl(struct inode *inode, struct file *file, | |||
675 | D(printk("i2cr %d %d ", | 679 | D(printk("i2cr %d %d ", |
676 | I2C_ARGSLAVE(arg), | 680 | I2C_ARGSLAVE(arg), |
677 | I2C_ARGREG(arg))); | 681 | I2C_ARGREG(arg))); |
682 | lock_kernel(); | ||
678 | val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg)); | 683 | val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg)); |
684 | unlock_kernel(); | ||
679 | D(printk("= %d\n", val)); | 685 | D(printk("= %d\n", val)); |
680 | return val; | 686 | return val; |
681 | } | 687 | } |
@@ -688,10 +694,10 @@ i2c_ioctl(struct inode *inode, struct file *file, | |||
688 | } | 694 | } |
689 | 695 | ||
690 | static const struct file_operations i2c_fops = { | 696 | static const struct file_operations i2c_fops = { |
691 | .owner = THIS_MODULE, | 697 | .owner = THIS_MODULE, |
692 | .ioctl = i2c_ioctl, | 698 | .unlocked_ioctl = i2c_ioctl, |
693 | .open = i2c_open, | 699 | .open = i2c_open, |
694 | .release = i2c_release, | 700 | .release = i2c_release, |
695 | }; | 701 | }; |
696 | 702 | ||
697 | static int __init i2c_init(void) | 703 | static int __init i2c_init(void) |
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index f4478506e52c..bef6eb53b153 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | #include <linux/smp_lock.h> | ||
27 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
28 | #include <linux/bcd.h> | 29 | #include <linux/bcd.h> |
29 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
@@ -49,7 +50,7 @@ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ | |||
49 | static const unsigned char days_in_month[] = | 50 | static const unsigned char days_in_month[] = |
50 | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; | 51 | { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; |
51 | 52 | ||
52 | int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 53 | static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
53 | 54 | ||
54 | /* Cache VL bit value read at driver init since writing the RTC_SECOND | 55 | /* Cache VL bit value read at driver init since writing the RTC_SECOND |
55 | * register clears the VL status. | 56 | * register clears the VL status. |
@@ -57,8 +58,8 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | |||
57 | static int voltage_low; | 58 | static int voltage_low; |
58 | 59 | ||
59 | static const struct file_operations pcf8563_fops = { | 60 | static const struct file_operations pcf8563_fops = { |
60 | .owner = THIS_MODULE, | 61 | .owner = THIS_MODULE, |
61 | .ioctl = pcf8563_ioctl | 62 | .unlocked_ioctl = pcf8563_unlocked_ioctl, |
62 | }; | 63 | }; |
63 | 64 | ||
64 | unsigned char | 65 | unsigned char |
@@ -208,8 +209,7 @@ pcf8563_exit(void) | |||
208 | * ioctl calls for this driver. Why return -ENOTTY upon error? Because | 209 | * ioctl calls for this driver. Why return -ENOTTY upon error? Because |
209 | * POSIX says so! | 210 | * POSIX says so! |
210 | */ | 211 | */ |
211 | int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 212 | static int pcf8563_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
212 | unsigned long arg) | ||
213 | { | 213 | { |
214 | /* Some sanity checks. */ | 214 | /* Some sanity checks. */ |
215 | if (_IOC_TYPE(cmd) != RTC_MAGIC) | 215 | if (_IOC_TYPE(cmd) != RTC_MAGIC) |
@@ -335,6 +335,17 @@ int pcf8563_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
335 | return 0; | 335 | return 0; |
336 | } | 336 | } |
337 | 337 | ||
338 | static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ||
339 | { | ||
340 | int ret; | ||
341 | |||
342 | lock_kernel(); | ||
343 | return pcf8563_ioctl(filp, cmd, arg); | ||
344 | unlock_kernel(); | ||
345 | |||
346 | return ret; | ||
347 | } | ||
348 | |||
338 | static int __init pcf8563_register(void) | 349 | static int __init pcf8563_register(void) |
339 | { | 350 | { |
340 | if (pcf8563_init() < 0) { | 351 | if (pcf8563_init() < 0) { |
diff --git a/arch/cris/arch-v32/kernel/crisksyms.c b/arch/cris/arch-v32/kernel/crisksyms.c index 64933e2c0f5b..bde8d1a10cad 100644 --- a/arch/cris/arch-v32/kernel/crisksyms.c +++ b/arch/cris/arch-v32/kernel/crisksyms.c | |||
@@ -24,5 +24,5 @@ EXPORT_SYMBOL(crisv32_io_get_name); | |||
24 | EXPORT_SYMBOL(crisv32_io_get); | 24 | EXPORT_SYMBOL(crisv32_io_get); |
25 | 25 | ||
26 | /* Functions masking/unmasking interrupts */ | 26 | /* Functions masking/unmasking interrupts */ |
27 | EXPORT_SYMBOL(mask_irq); | 27 | EXPORT_SYMBOL(crisv32_mask_irq); |
28 | EXPORT_SYMBOL(unmask_irq); | 28 | EXPORT_SYMBOL(crisv32_unmask_irq); |
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c index b6241198fb98..0b1febe44aa3 100644 --- a/arch/cris/arch-v32/kernel/irq.c +++ b/arch/cris/arch-v32/kernel/irq.c | |||
@@ -280,8 +280,7 @@ out: | |||
280 | return cpu; | 280 | return cpu; |
281 | } | 281 | } |
282 | 282 | ||
283 | void | 283 | void crisv32_mask_irq(int irq) |
284 | mask_irq(int irq) | ||
285 | { | 284 | { |
286 | int cpu; | 285 | int cpu; |
287 | 286 | ||
@@ -289,8 +288,7 @@ mask_irq(int irq) | |||
289 | block_irq(irq, cpu); | 288 | block_irq(irq, cpu); |
290 | } | 289 | } |
291 | 290 | ||
292 | void | 291 | void crisv32_unmask_irq(int irq) |
293 | unmask_irq(int irq) | ||
294 | { | 292 | { |
295 | unblock_irq(irq, irq_cpu(irq)); | 293 | unblock_irq(irq, irq_cpu(irq)); |
296 | } | 294 | } |
@@ -298,23 +296,23 @@ unmask_irq(int irq) | |||
298 | 296 | ||
299 | static unsigned int startup_crisv32_irq(unsigned int irq) | 297 | static unsigned int startup_crisv32_irq(unsigned int irq) |
300 | { | 298 | { |
301 | unmask_irq(irq); | 299 | crisv32_unmask_irq(irq); |
302 | return 0; | 300 | return 0; |
303 | } | 301 | } |
304 | 302 | ||
305 | static void shutdown_crisv32_irq(unsigned int irq) | 303 | static void shutdown_crisv32_irq(unsigned int irq) |
306 | { | 304 | { |
307 | mask_irq(irq); | 305 | crisv32_mask_irq(irq); |
308 | } | 306 | } |
309 | 307 | ||
310 | static void enable_crisv32_irq(unsigned int irq) | 308 | static void enable_crisv32_irq(unsigned int irq) |
311 | { | 309 | { |
312 | unmask_irq(irq); | 310 | crisv32_unmask_irq(irq); |
313 | } | 311 | } |
314 | 312 | ||
315 | static void disable_crisv32_irq(unsigned int irq) | 313 | static void disable_crisv32_irq(unsigned int irq) |
316 | { | 314 | { |
317 | mask_irq(irq); | 315 | crisv32_mask_irq(irq); |
318 | } | 316 | } |
319 | 317 | ||
320 | static void ack_crisv32_irq(unsigned int irq) | 318 | static void ack_crisv32_irq(unsigned int irq) |
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c index 058adddf4e4b..84fed3b4b079 100644 --- a/arch/cris/arch-v32/kernel/smp.c +++ b/arch/cris/arch-v32/kernel/smp.c | |||
@@ -168,8 +168,8 @@ void __init smp_callin(void) | |||
168 | 168 | ||
169 | /* Enable IRQ and idle */ | 169 | /* Enable IRQ and idle */ |
170 | REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask); | 170 | REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask); |
171 | unmask_irq(IPI_INTR_VECT); | 171 | crisv32_unmask_irq(IPI_INTR_VECT); |
172 | unmask_irq(TIMER0_INTR_VECT); | 172 | crisv32_unmask_irq(TIMER0_INTR_VECT); |
173 | preempt_disable(); | 173 | preempt_disable(); |
174 | notify_cpu_starting(cpu); | 174 | notify_cpu_starting(cpu); |
175 | local_irq_enable(); | 175 | local_irq_enable(); |
diff --git a/arch/cris/include/arch-v10/arch/irq.h b/arch/cris/include/arch-v10/arch/irq.h index 6248004eca1c..7d345947b3ee 100644 --- a/arch/cris/include/arch-v10/arch/irq.h +++ b/arch/cris/include/arch-v10/arch/irq.h | |||
@@ -93,15 +93,16 @@ void set_break_vector(int n, irqvectptr addr); | |||
93 | "push $r10\n\t" /* push orig_r10 */ \ | 93 | "push $r10\n\t" /* push orig_r10 */ \ |
94 | "clear.d [$sp=$sp-4]\n\t" /* frametype - this is a normal stackframe */ | 94 | "clear.d [$sp=$sp-4]\n\t" /* frametype - this is a normal stackframe */ |
95 | 95 | ||
96 | /* BLOCK_IRQ and UNBLOCK_IRQ do the same as mask_irq and unmask_irq */ | 96 | /* BLOCK_IRQ and UNBLOCK_IRQ do the same as |
97 | * crisv10_mask_irq and crisv10_unmask_irq */ | ||
97 | 98 | ||
98 | #define BLOCK_IRQ(mask,nr) \ | 99 | #define BLOCK_IRQ(mask,nr) \ |
99 | "move.d " #mask ",$r0\n\t" \ | 100 | "move.d " #mask ",$r0\n\t" \ |
100 | "move.d $r0,[0xb00000d8]\n\t" | 101 | "move.d $r0,[0xb00000d8]\n\t" |
101 | 102 | ||
102 | #define UNBLOCK_IRQ(mask) \ | 103 | #define UNBLOCK_IRQ(mask) \ |
103 | "move.d " #mask ",$r0\n\t" \ | 104 | "move.d " #mask ",$r0\n\t" \ |
104 | "move.d $r0,[0xb00000dc]\n\t" | 105 | "move.d $r0,[0xb00000dc]\n\t" |
105 | 106 | ||
106 | #define IRQ_NAME2(nr) nr##_interrupt(void) | 107 | #define IRQ_NAME2(nr) nr##_interrupt(void) |
107 | #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr) | 108 | #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr) |
diff --git a/arch/cris/include/arch-v32/arch/irq.h b/arch/cris/include/arch-v32/arch/irq.h index 9e4c9fbdfddf..b31e9984f849 100644 --- a/arch/cris/include/arch-v32/arch/irq.h +++ b/arch/cris/include/arch-v32/arch/irq.h | |||
@@ -23,8 +23,8 @@ struct etrax_interrupt_vector { | |||
23 | 23 | ||
24 | extern struct etrax_interrupt_vector *etrax_irv; /* head.S */ | 24 | extern struct etrax_interrupt_vector *etrax_irv; /* head.S */ |
25 | 25 | ||
26 | void mask_irq(int irq); | 26 | void crisv32_mask_irq(int irq); |
27 | void unmask_irq(int irq); | 27 | void crisv32_unmask_irq(int irq); |
28 | 28 | ||
29 | void set_exception_vector(int n, irqvectptr addr); | 29 | void set_exception_vector(int n, irqvectptr addr); |
30 | 30 | ||
diff --git a/arch/cris/include/asm/param.h b/arch/cris/include/asm/param.h index 0e47994e40be..484fcf8667c0 100644 --- a/arch/cris/include/asm/param.h +++ b/arch/cris/include/asm/param.h | |||
@@ -2,22 +2,9 @@ | |||
2 | #define _ASMCRIS_PARAM_H | 2 | #define _ASMCRIS_PARAM_H |
3 | 3 | ||
4 | /* Currently we assume that HZ=100 is good for CRIS. */ | 4 | /* Currently we assume that HZ=100 is good for CRIS. */ |
5 | #ifdef __KERNEL__ | ||
6 | # define HZ CONFIG_HZ /* Internal kernel timer frequency */ | ||
7 | # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | ||
8 | # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | ||
9 | #endif | ||
10 | |||
11 | #ifndef HZ | ||
12 | #define HZ 100 | ||
13 | #endif | ||
14 | 5 | ||
15 | #define EXEC_PAGESIZE 8192 | 6 | #define EXEC_PAGESIZE 8192 |
16 | 7 | ||
17 | #ifndef NOGROUP | 8 | #include <asm-generic/param.h> |
18 | #define NOGROUP (-1) | ||
19 | #endif | ||
20 | |||
21 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
22 | 9 | ||
23 | #endif | 10 | #endif /* _ASMCRIS_PARAM_H */ |
diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S index bd0bdf908d93..cbb6958a3147 100644 --- a/arch/frv/kernel/break.S +++ b/arch/frv/kernel/break.S | |||
@@ -21,7 +21,7 @@ | |||
21 | # | 21 | # |
22 | # the break handler has its own stack | 22 | # the break handler has its own stack |
23 | # | 23 | # |
24 | .section .bss.stack | 24 | .section .bss..stack |
25 | .globl __break_user_context | 25 | .globl __break_user_context |
26 | .balign THREAD_SIZE | 26 | .balign THREAD_SIZE |
27 | __break_stack: | 27 | __break_stack: |
@@ -63,7 +63,7 @@ __break_trace_through_exceptions: | |||
63 | # entry point for Break Exceptions/Interrupts | 63 | # entry point for Break Exceptions/Interrupts |
64 | # | 64 | # |
65 | ############################################################################### | 65 | ############################################################################### |
66 | .section .text.break | 66 | .section .text..break |
67 | .balign 4 | 67 | .balign 4 |
68 | .globl __entry_break | 68 | .globl __entry_break |
69 | __entry_break: | 69 | __entry_break: |
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S index 189397ec012a..63d579bf1c29 100644 --- a/arch/frv/kernel/entry.S +++ b/arch/frv/kernel/entry.S | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | #define nr_syscalls ((syscall_table_size)/4) | 39 | #define nr_syscalls ((syscall_table_size)/4) |
40 | 40 | ||
41 | .section .text.entry | 41 | .section .text..entry |
42 | .balign 4 | 42 | .balign 4 |
43 | 43 | ||
44 | .macro LEDS val | 44 | .macro LEDS val |
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S index b825ef3f2d54..e9a8cc63ac94 100644 --- a/arch/frv/kernel/head.S +++ b/arch/frv/kernel/head.S | |||
@@ -542,7 +542,7 @@ __head_end: | |||
542 | .size _boot, .-_boot | 542 | .size _boot, .-_boot |
543 | 543 | ||
544 | # provide a point for GDB to place a break | 544 | # provide a point for GDB to place a break |
545 | .section .text.start,"ax" | 545 | .section .text..start,"ax" |
546 | .globl _start | 546 | .globl _start |
547 | .balign 4 | 547 | .balign 4 |
548 | _start: | 548 | _start: |
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S index cbe811fccfcc..8b973f3cc90e 100644 --- a/arch/frv/kernel/vmlinux.lds.S +++ b/arch/frv/kernel/vmlinux.lds.S | |||
@@ -57,10 +57,10 @@ SECTIONS | |||
57 | _text = .; | 57 | _text = .; |
58 | _stext = .; | 58 | _stext = .; |
59 | .text : { | 59 | .text : { |
60 | *(.text.start) | 60 | *(.text..start) |
61 | *(.text.entry) | 61 | *(.text..entry) |
62 | *(.text.break) | 62 | *(.text..break) |
63 | *(.text.tlbmiss) | 63 | *(.text..tlbmiss) |
64 | TEXT_TEXT | 64 | TEXT_TEXT |
65 | SCHED_TEXT | 65 | SCHED_TEXT |
66 | LOCK_TEXT | 66 | LOCK_TEXT |
@@ -114,7 +114,7 @@ SECTIONS | |||
114 | 114 | ||
115 | .sbss : { *(.sbss .sbss.*) } | 115 | .sbss : { *(.sbss .sbss.*) } |
116 | .bss : { *(.bss .bss.*) } | 116 | .bss : { *(.bss .bss.*) } |
117 | .bss.stack : { *(.bss) } | 117 | .bss..stack : { *(.bss) } |
118 | 118 | ||
119 | __bss_stop = .; | 119 | __bss_stop = .; |
120 | _end = . ; | 120 | _end = . ; |
diff --git a/arch/frv/mm/tlb-miss.S b/arch/frv/mm/tlb-miss.S index 7f392bc651a3..f3ac019bb18b 100644 --- a/arch/frv/mm/tlb-miss.S +++ b/arch/frv/mm/tlb-miss.S | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <asm/pgtable.h> | 15 | #include <asm/pgtable.h> |
16 | #include <asm/spr-regs.h> | 16 | #include <asm/spr-regs.h> |
17 | 17 | ||
18 | .section .text.tlbmiss | 18 | .section .text..tlbmiss |
19 | .balign 4 | 19 | .balign 4 |
20 | 20 | ||
21 | .globl __entry_insn_mmu_miss | 21 | .globl __entry_insn_mmu_miss |
diff --git a/arch/h8300/boot/compressed/head.S b/arch/h8300/boot/compressed/head.S index 985a81a2435a..10e9a2d1cc6c 100644 --- a/arch/h8300/boot/compressed/head.S +++ b/arch/h8300/boot/compressed/head.S | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #define SRAM_START 0xff4000 | 10 | #define SRAM_START 0xff4000 |
11 | 11 | ||
12 | .section .text.startup | 12 | .section .text..startup |
13 | .global startup | 13 | .global startup |
14 | startup: | 14 | startup: |
15 | mov.l #SRAM_START+0x8000, sp | 15 | mov.l #SRAM_START+0x8000, sp |
diff --git a/arch/h8300/boot/compressed/vmlinux.lds b/arch/h8300/boot/compressed/vmlinux.lds index 65e2a0d1ae39..a0a3a0ed54ef 100644 --- a/arch/h8300/boot/compressed/vmlinux.lds +++ b/arch/h8300/boot/compressed/vmlinux.lds | |||
@@ -4,7 +4,7 @@ SECTIONS | |||
4 | { | 4 | { |
5 | __stext = . ; | 5 | __stext = . ; |
6 | __text = .; | 6 | __text = .; |
7 | *(.text.startup) | 7 | *(.text..startup) |
8 | *(.text) | 8 | *(.text) |
9 | __etext = . ; | 9 | __etext = . ; |
10 | } | 10 | } |
diff --git a/arch/ia64/include/asm/asmmacro.h b/arch/ia64/include/asm/asmmacro.h index c1642fd64029..3ab6d75aa3db 100644 --- a/arch/ia64/include/asm/asmmacro.h +++ b/arch/ia64/include/asm/asmmacro.h | |||
@@ -70,12 +70,12 @@ name: | |||
70 | * path (ivt.S - TLB miss processing) or in places where it might not be | 70 | * path (ivt.S - TLB miss processing) or in places where it might not be |
71 | * safe to use a "tpa" instruction (mca_asm.S - error recovery). | 71 | * safe to use a "tpa" instruction (mca_asm.S - error recovery). |
72 | */ | 72 | */ |
73 | .section ".data.patch.vtop", "a" // declare section & section attributes | 73 | .section ".data..patch.vtop", "a" // declare section & section attributes |
74 | .previous | 74 | .previous |
75 | 75 | ||
76 | #define LOAD_PHYSICAL(pr, reg, obj) \ | 76 | #define LOAD_PHYSICAL(pr, reg, obj) \ |
77 | [1:](pr)movl reg = obj; \ | 77 | [1:](pr)movl reg = obj; \ |
78 | .xdata4 ".data.patch.vtop", 1b-. | 78 | .xdata4 ".data..patch.vtop", 1b-. |
79 | 79 | ||
80 | /* | 80 | /* |
81 | * For now, we always put in the McKinley E9 workaround. On CPUs that don't need it, | 81 | * For now, we always put in the McKinley E9 workaround. On CPUs that don't need it, |
@@ -84,11 +84,11 @@ name: | |||
84 | #define DO_MCKINLEY_E9_WORKAROUND | 84 | #define DO_MCKINLEY_E9_WORKAROUND |
85 | 85 | ||
86 | #ifdef DO_MCKINLEY_E9_WORKAROUND | 86 | #ifdef DO_MCKINLEY_E9_WORKAROUND |
87 | .section ".data.patch.mckinley_e9", "a" | 87 | .section ".data..patch.mckinley_e9", "a" |
88 | .previous | 88 | .previous |
89 | /* workaround for Itanium 2 Errata 9: */ | 89 | /* workaround for Itanium 2 Errata 9: */ |
90 | # define FSYS_RETURN \ | 90 | # define FSYS_RETURN \ |
91 | .xdata4 ".data.patch.mckinley_e9", 1f-.; \ | 91 | .xdata4 ".data..patch.mckinley_e9", 1f-.; \ |
92 | 1:{ .mib; \ | 92 | 1:{ .mib; \ |
93 | nop.m 0; \ | 93 | nop.m 0; \ |
94 | mov r16=ar.pfs; \ | 94 | mov r16=ar.pfs; \ |
@@ -107,11 +107,11 @@ name: | |||
107 | * If physical stack register size is different from DEF_NUM_STACK_REG, | 107 | * If physical stack register size is different from DEF_NUM_STACK_REG, |
108 | * dynamically patch the kernel for correct size. | 108 | * dynamically patch the kernel for correct size. |
109 | */ | 109 | */ |
110 | .section ".data.patch.phys_stack_reg", "a" | 110 | .section ".data..patch.phys_stack_reg", "a" |
111 | .previous | 111 | .previous |
112 | #define LOAD_PHYS_STACK_REG_SIZE(reg) \ | 112 | #define LOAD_PHYS_STACK_REG_SIZE(reg) \ |
113 | [1:] adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0; \ | 113 | [1:] adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0; \ |
114 | .xdata4 ".data.patch.phys_stack_reg", 1b-. | 114 | .xdata4 ".data..patch.phys_stack_reg", 1b-. |
115 | 115 | ||
116 | /* | 116 | /* |
117 | * Up until early 2004, use of .align within a function caused bad unwind info. | 117 | * Up until early 2004, use of .align within a function caused bad unwind info. |
diff --git a/arch/ia64/include/asm/cache.h b/arch/ia64/include/asm/cache.h index e7482bd628ff..988254a7d349 100644 --- a/arch/ia64/include/asm/cache.h +++ b/arch/ia64/include/asm/cache.h | |||
@@ -24,6 +24,6 @@ | |||
24 | # define SMP_CACHE_BYTES (1 << 3) | 24 | # define SMP_CACHE_BYTES (1 << 3) |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 27 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
28 | 28 | ||
29 | #endif /* _ASM_IA64_CACHE_H */ | 29 | #endif /* _ASM_IA64_CACHE_H */ |
diff --git a/arch/ia64/include/asm/percpu.h b/arch/ia64/include/asm/percpu.h index 1bd408265694..14aa1c58912b 100644 --- a/arch/ia64/include/asm/percpu.h +++ b/arch/ia64/include/asm/percpu.h | |||
@@ -31,7 +31,7 @@ extern void *per_cpu_init(void); | |||
31 | 31 | ||
32 | #endif /* SMP */ | 32 | #endif /* SMP */ |
33 | 33 | ||
34 | #define PER_CPU_BASE_SECTION ".data.percpu" | 34 | #define PER_CPU_BASE_SECTION ".data..percpu" |
35 | 35 | ||
36 | /* | 36 | /* |
37 | * Be extremely careful when taking the address of this variable! Due to virtual | 37 | * Be extremely careful when taking the address of this variable! Due to virtual |
diff --git a/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate index ab9b03a9adcc..ceeffc509764 100644 --- a/arch/ia64/kernel/Makefile.gate +++ b/arch/ia64/kernel/Makefile.gate | |||
@@ -21,7 +21,7 @@ GATECFLAGS_gate-syms.o = -r | |||
21 | $(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE | 21 | $(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE |
22 | $(call if_changed,gate) | 22 | $(call if_changed,gate) |
23 | 23 | ||
24 | # gate-data.o contains the gate DSO image as data in section .data.gate. | 24 | # gate-data.o contains the gate DSO image as data in section .data..gate. |
25 | # We must build gate.so before we can assemble it. | 25 | # We must build gate.so before we can assemble it. |
26 | # Note: kbuild does not track this dependency due to usage of .incbin | 26 | # Note: kbuild does not track this dependency due to usage of .incbin |
27 | $(obj)/gate-data.o: $(obj)/gate.so | 27 | $(obj)/gate-data.o: $(obj)/gate.so |
diff --git a/arch/ia64/kernel/gate-data.S b/arch/ia64/kernel/gate-data.S index 258c0a3238fb..b3ef1c72e132 100644 --- a/arch/ia64/kernel/gate-data.S +++ b/arch/ia64/kernel/gate-data.S | |||
@@ -1,3 +1,3 @@ | |||
1 | .section .data.gate, "aw" | 1 | .section .data..gate, "aw" |
2 | 2 | ||
3 | .incbin "arch/ia64/kernel/gate.so" | 3 | .incbin "arch/ia64/kernel/gate.so" |
diff --git a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S index cf5e0a105e16..245d3e1ec7e1 100644 --- a/arch/ia64/kernel/gate.S +++ b/arch/ia64/kernel/gate.S | |||
@@ -21,18 +21,18 @@ | |||
21 | * to targets outside the shared object) and to avoid multi-phase kernel builds, we | 21 | * to targets outside the shared object) and to avoid multi-phase kernel builds, we |
22 | * simply create minimalistic "patch lists" in special ELF sections. | 22 | * simply create minimalistic "patch lists" in special ELF sections. |
23 | */ | 23 | */ |
24 | .section ".data.patch.fsyscall_table", "a" | 24 | .section ".data..patch.fsyscall_table", "a" |
25 | .previous | 25 | .previous |
26 | #define LOAD_FSYSCALL_TABLE(reg) \ | 26 | #define LOAD_FSYSCALL_TABLE(reg) \ |
27 | [1:] movl reg=0; \ | 27 | [1:] movl reg=0; \ |
28 | .xdata4 ".data.patch.fsyscall_table", 1b-. | 28 | .xdata4 ".data..patch.fsyscall_table", 1b-. |
29 | 29 | ||
30 | .section ".data.patch.brl_fsys_bubble_down", "a" | 30 | .section ".data..patch.brl_fsys_bubble_down", "a" |
31 | .previous | 31 | .previous |
32 | #define BRL_COND_FSYS_BUBBLE_DOWN(pr) \ | 32 | #define BRL_COND_FSYS_BUBBLE_DOWN(pr) \ |
33 | [1:](pr)brl.cond.sptk 0; \ | 33 | [1:](pr)brl.cond.sptk 0; \ |
34 | ;; \ | 34 | ;; \ |
35 | .xdata4 ".data.patch.brl_fsys_bubble_down", 1b-. | 35 | .xdata4 ".data..patch.brl_fsys_bubble_down", 1b-. |
36 | 36 | ||
37 | GLOBAL_ENTRY(__kernel_syscall_via_break) | 37 | GLOBAL_ENTRY(__kernel_syscall_via_break) |
38 | .prologue | 38 | .prologue |
diff --git a/arch/ia64/kernel/gate.lds.S b/arch/ia64/kernel/gate.lds.S index 88c64ed47c36..d32b0855110a 100644 --- a/arch/ia64/kernel/gate.lds.S +++ b/arch/ia64/kernel/gate.lds.S | |||
@@ -33,21 +33,21 @@ SECTIONS | |||
33 | */ | 33 | */ |
34 | . = GATE_ADDR + 0x600; | 34 | . = GATE_ADDR + 0x600; |
35 | 35 | ||
36 | .data.patch : { | 36 | .data..patch : { |
37 | __paravirt_start_gate_mckinley_e9_patchlist = .; | 37 | __paravirt_start_gate_mckinley_e9_patchlist = .; |
38 | *(.data.patch.mckinley_e9) | 38 | *(.data..patch.mckinley_e9) |
39 | __paravirt_end_gate_mckinley_e9_patchlist = .; | 39 | __paravirt_end_gate_mckinley_e9_patchlist = .; |
40 | 40 | ||
41 | __paravirt_start_gate_vtop_patchlist = .; | 41 | __paravirt_start_gate_vtop_patchlist = .; |
42 | *(.data.patch.vtop) | 42 | *(.data..patch.vtop) |
43 | __paravirt_end_gate_vtop_patchlist = .; | 43 | __paravirt_end_gate_vtop_patchlist = .; |
44 | 44 | ||
45 | __paravirt_start_gate_fsyscall_patchlist = .; | 45 | __paravirt_start_gate_fsyscall_patchlist = .; |
46 | *(.data.patch.fsyscall_table) | 46 | *(.data..patch.fsyscall_table) |
47 | __paravirt_end_gate_fsyscall_patchlist = .; | 47 | __paravirt_end_gate_fsyscall_patchlist = .; |
48 | 48 | ||
49 | __paravirt_start_gate_brl_fsys_bubble_down_patchlist = .; | 49 | __paravirt_start_gate_brl_fsys_bubble_down_patchlist = .; |
50 | *(.data.patch.brl_fsys_bubble_down) | 50 | *(.data..patch.brl_fsys_bubble_down) |
51 | __paravirt_end_gate_brl_fsys_bubble_down_patchlist = .; | 51 | __paravirt_end_gate_brl_fsys_bubble_down_patchlist = .; |
52 | } :readable | 52 | } :readable |
53 | 53 | ||
diff --git a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c index e253ab8fcbc8..f9efe9739d3f 100644 --- a/arch/ia64/kernel/init_task.c +++ b/arch/ia64/kernel/init_task.c | |||
@@ -23,7 +23,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | |||
23 | * Initial task structure. | 23 | * Initial task structure. |
24 | * | 24 | * |
25 | * We need to make sure that this is properly aligned due to the way process stacks are | 25 | * We need to make sure that this is properly aligned due to the way process stacks are |
26 | * handled. This is done by having a special ".data.init_task" section... | 26 | * handled. This is done by having a special ".data..init_task" section... |
27 | */ | 27 | */ |
28 | #define init_thread_info init_task_mem.s.thread_info | 28 | #define init_thread_info init_task_mem.s.thread_info |
29 | 29 | ||
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S index 179fd122e837..d93e396bf599 100644 --- a/arch/ia64/kernel/ivt.S +++ b/arch/ia64/kernel/ivt.S | |||
@@ -82,7 +82,7 @@ | |||
82 | mov r19=n;; /* prepare to save predicates */ \ | 82 | mov r19=n;; /* prepare to save predicates */ \ |
83 | br.sptk.many dispatch_to_fault_handler | 83 | br.sptk.many dispatch_to_fault_handler |
84 | 84 | ||
85 | .section .text.ivt,"ax" | 85 | .section .text..ivt,"ax" |
86 | 86 | ||
87 | .align 32768 // align on 32KB boundary | 87 | .align 32768 // align on 32KB boundary |
88 | .global ia64_ivt | 88 | .global ia64_ivt |
diff --git a/arch/ia64/kernel/minstate.h b/arch/ia64/kernel/minstate.h index 292e214a3b84..d56753a11636 100644 --- a/arch/ia64/kernel/minstate.h +++ b/arch/ia64/kernel/minstate.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #define ACCOUNT_SYS_ENTER | 16 | #define ACCOUNT_SYS_ENTER |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | .section ".data.patch.rse", "a" | 19 | .section ".data..patch.rse", "a" |
20 | .previous | 20 | .previous |
21 | 21 | ||
22 | /* | 22 | /* |
@@ -215,7 +215,7 @@ | |||
215 | (pUStk) extr.u r17=r18,3,6; \ | 215 | (pUStk) extr.u r17=r18,3,6; \ |
216 | (pUStk) sub r16=r18,r22; \ | 216 | (pUStk) sub r16=r18,r22; \ |
217 | [1:](pKStk) br.cond.sptk.many 1f; \ | 217 | [1:](pKStk) br.cond.sptk.many 1f; \ |
218 | .xdata4 ".data.patch.rse",1b-. \ | 218 | .xdata4 ".data..patch.rse",1b-. \ |
219 | ;; \ | 219 | ;; \ |
220 | cmp.ge p6,p7 = 33,r17; \ | 220 | cmp.ge p6,p7 = 33,r17; \ |
221 | ;; \ | 221 | ;; \ |
diff --git a/arch/ia64/kernel/paravirtentry.S b/arch/ia64/kernel/paravirtentry.S index 6158560d7f17..92d880c4d3d1 100644 --- a/arch/ia64/kernel/paravirtentry.S +++ b/arch/ia64/kernel/paravirtentry.S | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "entry.h" | 28 | #include "entry.h" |
29 | 29 | ||
30 | #define DATA8(sym, init_value) \ | 30 | #define DATA8(sym, init_value) \ |
31 | .pushsection .data.read_mostly ; \ | 31 | .pushsection .data..read_mostly ; \ |
32 | .align 8 ; \ | 32 | .align 8 ; \ |
33 | .global sym ; \ | 33 | .global sym ; \ |
34 | sym: ; \ | 34 | sym: ; \ |
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 1295ba327f6f..e07218a2577f 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #define IVT_TEXT \ | 9 | #define IVT_TEXT \ |
10 | VMLINUX_SYMBOL(__start_ivt_text) = .; \ | 10 | VMLINUX_SYMBOL(__start_ivt_text) = .; \ |
11 | *(.text.ivt) \ | 11 | *(.text..ivt) \ |
12 | VMLINUX_SYMBOL(__end_ivt_text) = .; | 12 | VMLINUX_SYMBOL(__end_ivt_text) = .; |
13 | 13 | ||
14 | OUTPUT_FORMAT("elf64-ia64-little") | 14 | OUTPUT_FORMAT("elf64-ia64-little") |
@@ -54,8 +54,8 @@ SECTIONS | |||
54 | .text2 : AT(ADDR(.text2) - LOAD_OFFSET) | 54 | .text2 : AT(ADDR(.text2) - LOAD_OFFSET) |
55 | { *(.text2) } | 55 | { *(.text2) } |
56 | #ifdef CONFIG_SMP | 56 | #ifdef CONFIG_SMP |
57 | .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET) | 57 | .text..lock : AT(ADDR(.text..lock) - LOAD_OFFSET) |
58 | { *(.text.lock) } | 58 | { *(.text..lock) } |
59 | #endif | 59 | #endif |
60 | _etext = .; | 60 | _etext = .; |
61 | 61 | ||
@@ -75,10 +75,10 @@ SECTIONS | |||
75 | __stop___mca_table = .; | 75 | __stop___mca_table = .; |
76 | } | 76 | } |
77 | 77 | ||
78 | .data.patch.phys_stack_reg : AT(ADDR(.data.patch.phys_stack_reg) - LOAD_OFFSET) | 78 | .data..patch.phys_stack_reg : AT(ADDR(.data..patch.phys_stack_reg) - LOAD_OFFSET) |
79 | { | 79 | { |
80 | __start___phys_stack_reg_patchlist = .; | 80 | __start___phys_stack_reg_patchlist = .; |
81 | *(.data.patch.phys_stack_reg) | 81 | *(.data..patch.phys_stack_reg) |
82 | __end___phys_stack_reg_patchlist = .; | 82 | __end___phys_stack_reg_patchlist = .; |
83 | } | 83 | } |
84 | 84 | ||
@@ -110,24 +110,24 @@ SECTIONS | |||
110 | INIT_TEXT_SECTION(PAGE_SIZE) | 110 | INIT_TEXT_SECTION(PAGE_SIZE) |
111 | INIT_DATA_SECTION(16) | 111 | INIT_DATA_SECTION(16) |
112 | 112 | ||
113 | .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET) | 113 | .data..patch.vtop : AT(ADDR(.data..patch.vtop) - LOAD_OFFSET) |
114 | { | 114 | { |
115 | __start___vtop_patchlist = .; | 115 | __start___vtop_patchlist = .; |
116 | *(.data.patch.vtop) | 116 | *(.data..patch.vtop) |
117 | __end___vtop_patchlist = .; | 117 | __end___vtop_patchlist = .; |
118 | } | 118 | } |
119 | 119 | ||
120 | .data.patch.rse : AT(ADDR(.data.patch.rse) - LOAD_OFFSET) | 120 | .data..patch.rse : AT(ADDR(.data..patch.rse) - LOAD_OFFSET) |
121 | { | 121 | { |
122 | __start___rse_patchlist = .; | 122 | __start___rse_patchlist = .; |
123 | *(.data.patch.rse) | 123 | *(.data..patch.rse) |
124 | __end___rse_patchlist = .; | 124 | __end___rse_patchlist = .; |
125 | } | 125 | } |
126 | 126 | ||
127 | .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET) | 127 | .data..patch.mckinley_e9 : AT(ADDR(.data..patch.mckinley_e9) - LOAD_OFFSET) |
128 | { | 128 | { |
129 | __start___mckinley_e9_bundles = .; | 129 | __start___mckinley_e9_bundles = .; |
130 | *(.data.patch.mckinley_e9) | 130 | *(.data..patch.mckinley_e9) |
131 | __end___mckinley_e9_bundles = .; | 131 | __end___mckinley_e9_bundles = .; |
132 | } | 132 | } |
133 | 133 | ||
@@ -175,17 +175,17 @@ SECTIONS | |||
175 | . = ALIGN(PAGE_SIZE); | 175 | . = ALIGN(PAGE_SIZE); |
176 | __init_end = .; | 176 | __init_end = .; |
177 | 177 | ||
178 | .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) | 178 | .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) |
179 | { | 179 | { |
180 | PAGE_ALIGNED_DATA(PAGE_SIZE) | 180 | PAGE_ALIGNED_DATA(PAGE_SIZE) |
181 | . = ALIGN(PAGE_SIZE); | 181 | . = ALIGN(PAGE_SIZE); |
182 | __start_gate_section = .; | 182 | __start_gate_section = .; |
183 | *(.data.gate) | 183 | *(.data..gate) |
184 | __stop_gate_section = .; | 184 | __stop_gate_section = .; |
185 | #ifdef CONFIG_XEN | 185 | #ifdef CONFIG_XEN |
186 | . = ALIGN(PAGE_SIZE); | 186 | . = ALIGN(PAGE_SIZE); |
187 | __xen_start_gate_section = .; | 187 | __xen_start_gate_section = .; |
188 | *(.data.gate.xen) | 188 | *(.data..gate.xen) |
189 | __xen_stop_gate_section = .; | 189 | __xen_stop_gate_section = .; |
190 | #endif | 190 | #endif |
191 | } | 191 | } |
diff --git a/arch/ia64/kvm/vmm_ivt.S b/arch/ia64/kvm/vmm_ivt.S index 40920c630649..24018484c6e9 100644 --- a/arch/ia64/kvm/vmm_ivt.S +++ b/arch/ia64/kvm/vmm_ivt.S | |||
@@ -104,7 +104,7 @@ GLOBAL_ENTRY(kvm_vmm_panic) | |||
104 | br.call.sptk.many b6=vmm_panic_handler; | 104 | br.call.sptk.many b6=vmm_panic_handler; |
105 | END(kvm_vmm_panic) | 105 | END(kvm_vmm_panic) |
106 | 106 | ||
107 | .section .text.ivt,"ax" | 107 | .section .text..ivt,"ax" |
108 | 108 | ||
109 | .align 32768 // align on 32KB boundary | 109 | .align 32768 // align on 32KB boundary |
110 | .global kvm_ia64_ivt | 110 | .global kvm_ia64_ivt |
diff --git a/arch/ia64/scripts/unwcheck.py b/arch/ia64/scripts/unwcheck.py index c27849889e19..2bfd941ff7c7 100644 --- a/arch/ia64/scripts/unwcheck.py +++ b/arch/ia64/scripts/unwcheck.py | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/python |
2 | # | 2 | # |
3 | # Usage: unwcheck.py FILE | 3 | # Usage: unwcheck.py FILE |
4 | # | 4 | # |
diff --git a/arch/ia64/xen/gate-data.S b/arch/ia64/xen/gate-data.S index 7d4830afc91d..6f95b6b32a4e 100644 --- a/arch/ia64/xen/gate-data.S +++ b/arch/ia64/xen/gate-data.S | |||
@@ -1,3 +1,3 @@ | |||
1 | .section .data.gate.xen, "aw" | 1 | .section .data..gate.xen, "aw" |
2 | 2 | ||
3 | .incbin "arch/ia64/xen/gate.so" | 3 | .incbin "arch/ia64/xen/gate.so" |
diff --git a/arch/ia64/xen/xensetup.S b/arch/ia64/xen/xensetup.S index aff8346ea193..b820ed02ab9f 100644 --- a/arch/ia64/xen/xensetup.S +++ b/arch/ia64/xen/xensetup.S | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <xen/interface/elfnote.h> | 15 | #include <xen/interface/elfnote.h> |
16 | 16 | ||
17 | .section .data.read_mostly | 17 | .section .data..read_mostly |
18 | .align 8 | 18 | .align 8 |
19 | .global xen_domain_type | 19 | .global xen_domain_type |
20 | xen_domain_type: | 20 | xen_domain_type: |
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S index 9f1784f586b9..a91b2713451d 100644 --- a/arch/m68knommu/kernel/vmlinux.lds.S +++ b/arch/m68knommu/kernel/vmlinux.lds.S | |||
@@ -57,7 +57,7 @@ SECTIONS { | |||
57 | .romvec : { | 57 | .romvec : { |
58 | __rom_start = . ; | 58 | __rom_start = . ; |
59 | _romvec = .; | 59 | _romvec = .; |
60 | *(.data.initvect) | 60 | *(.data..initvect) |
61 | } > romvec | 61 | } > romvec |
62 | #endif | 62 | #endif |
63 | 63 | ||
@@ -68,7 +68,7 @@ SECTIONS { | |||
68 | TEXT_TEXT | 68 | TEXT_TEXT |
69 | SCHED_TEXT | 69 | SCHED_TEXT |
70 | LOCK_TEXT | 70 | LOCK_TEXT |
71 | *(.text.lock) | 71 | *(.text..lock) |
72 | 72 | ||
73 | . = ALIGN(16); /* Exception table */ | 73 | . = ALIGN(16); /* Exception table */ |
74 | __start___ex_table = .; | 74 | __start___ex_table = .; |
diff --git a/arch/m68knommu/platform/68360/head-ram.S b/arch/m68knommu/platform/68360/head-ram.S index 2ef06242398b..8eb94fb6b971 100644 --- a/arch/m68knommu/platform/68360/head-ram.S +++ b/arch/m68knommu/platform/68360/head-ram.S | |||
@@ -280,7 +280,7 @@ _dprbase: | |||
280 | * and then overwritten as needed. | 280 | * and then overwritten as needed. |
281 | */ | 281 | */ |
282 | 282 | ||
283 | .section ".data.initvect","awx" | 283 | .section ".data..initvect","awx" |
284 | .long RAMEND /* Reset: Initial Stack Pointer - 0. */ | 284 | .long RAMEND /* Reset: Initial Stack Pointer - 0. */ |
285 | .long _start /* Reset: Initial Program Counter - 1. */ | 285 | .long _start /* Reset: Initial Program Counter - 1. */ |
286 | .long buserr /* Bus Error - 2. */ | 286 | .long buserr /* Bus Error - 2. */ |
diff --git a/arch/m68knommu/platform/68360/head-rom.S b/arch/m68knommu/platform/68360/head-rom.S index 62ecf4144b3b..97510e55b802 100644 --- a/arch/m68knommu/platform/68360/head-rom.S +++ b/arch/m68knommu/platform/68360/head-rom.S | |||
@@ -291,7 +291,7 @@ _dprbase: | |||
291 | * and then overwritten as needed. | 291 | * and then overwritten as needed. |
292 | */ | 292 | */ |
293 | 293 | ||
294 | .section ".data.initvect","awx" | 294 | .section ".data..initvect","awx" |
295 | .long RAMEND /* Reset: Initial Stack Pointer - 0. */ | 295 | .long RAMEND /* Reset: Initial Stack Pointer - 0. */ |
296 | .long _start /* Reset: Initial Program Counter - 1. */ | 296 | .long _start /* Reset: Initial Program Counter - 1. */ |
297 | .long buserr /* Bus Error - 2. */ | 297 | .long buserr /* Bus Error - 2. */ |
diff --git a/arch/mips/lasat/image/head.S b/arch/mips/lasat/image/head.S index efb95f2609c2..e0ecda92c40a 100644 --- a/arch/mips/lasat/image/head.S +++ b/arch/mips/lasat/image/head.S | |||
@@ -1,7 +1,7 @@ | |||
1 | #include <asm/lasat/head.h> | 1 | #include <asm/lasat/head.h> |
2 | 2 | ||
3 | .text | 3 | .text |
4 | .section .text.start, "ax" | 4 | .section .text..start, "ax" |
5 | .set noreorder | 5 | .set noreorder |
6 | .set mips3 | 6 | .set mips3 |
7 | 7 | ||
diff --git a/arch/mips/lasat/image/romscript.normal b/arch/mips/lasat/image/romscript.normal index 988f8ad189cb..0864c963e188 100644 --- a/arch/mips/lasat/image/romscript.normal +++ b/arch/mips/lasat/image/romscript.normal | |||
@@ -4,7 +4,7 @@ SECTIONS | |||
4 | { | 4 | { |
5 | .text : | 5 | .text : |
6 | { | 6 | { |
7 | *(.text.start) | 7 | *(.text..start) |
8 | } | 8 | } |
9 | 9 | ||
10 | /* Data in ROM */ | 10 | /* Data in ROM */ |
diff --git a/arch/parisc/include/asm/cache.h b/arch/parisc/include/asm/cache.h index 32c2cca74345..45effe6978fa 100644 --- a/arch/parisc/include/asm/cache.h +++ b/arch/parisc/include/asm/cache.h | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 29 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
30 | 30 | ||
31 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 31 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
32 | 32 | ||
33 | void parisc_cache_init(void); /* initializes cache-flushing */ | 33 | void parisc_cache_init(void); /* initializes cache-flushing */ |
34 | void disable_sr_hashing_asm(int); /* low level support for above */ | 34 | void disable_sr_hashing_asm(int); /* low level support for above */ |
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h index 4653c77bf9d1..2ab4af58ecb9 100644 --- a/arch/parisc/include/asm/system.h +++ b/arch/parisc/include/asm/system.h | |||
@@ -174,7 +174,7 @@ static inline void set_eiem(unsigned long val) | |||
174 | }) | 174 | }) |
175 | 175 | ||
176 | #ifdef CONFIG_SMP | 176 | #ifdef CONFIG_SMP |
177 | # define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) | 177 | # define __lock_aligned __attribute__((__section__(".data..lock_aligned"))) |
178 | #endif | 178 | #endif |
179 | 179 | ||
180 | #define arch_align_stack(x) (x) | 180 | #define arch_align_stack(x) (x) |
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S index 0e3d9f9b9e33..4dbdf0ed6fa0 100644 --- a/arch/parisc/kernel/head.S +++ b/arch/parisc/kernel/head.S | |||
@@ -345,7 +345,7 @@ smp_slave_stext: | |||
345 | ENDPROC(stext) | 345 | ENDPROC(stext) |
346 | 346 | ||
347 | #ifndef CONFIG_64BIT | 347 | #ifndef CONFIG_64BIT |
348 | .section .data.read_mostly | 348 | .section .data..read_mostly |
349 | 349 | ||
350 | .align 4 | 350 | .align 4 |
351 | .export $global$,data | 351 | .export $global$,data |
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c index d020eae6525c..4a91e433416f 100644 --- a/arch/parisc/kernel/init_task.c +++ b/arch/parisc/kernel/init_task.c | |||
@@ -53,11 +53,11 @@ union thread_union init_thread_union __init_task_data | |||
53 | * guarantee that global objects will be laid out in memory in the same order | 53 | * guarantee that global objects will be laid out in memory in the same order |
54 | * as the order of declaration, so put these in different sections and use | 54 | * as the order of declaration, so put these in different sections and use |
55 | * the linker script to order them. */ | 55 | * the linker script to order them. */ |
56 | pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data.vm0.pmd"), aligned(PAGE_SIZE))); | 56 | pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data..vm0.pmd"), aligned(PAGE_SIZE))); |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data.vm0.pgd"), aligned(PAGE_SIZE))); | 59 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data..vm0.pgd"), aligned(PAGE_SIZE))); |
60 | pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data.vm0.pte"), aligned(PAGE_SIZE))); | 60 | pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data..vm0.pte"), aligned(PAGE_SIZE))); |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * Initial task structure. | 63 | * Initial task structure. |
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index 9dab4a4e09f7..d64a6bbec2aa 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S | |||
@@ -94,8 +94,8 @@ SECTIONS | |||
94 | 94 | ||
95 | /* PA-RISC locks requires 16-byte alignment */ | 95 | /* PA-RISC locks requires 16-byte alignment */ |
96 | . = ALIGN(16); | 96 | . = ALIGN(16); |
97 | .data.lock_aligned : { | 97 | .data..lock_aligned : { |
98 | *(.data.lock_aligned) | 98 | *(.data..lock_aligned) |
99 | } | 99 | } |
100 | 100 | ||
101 | /* End of data section */ | 101 | /* End of data section */ |
@@ -105,10 +105,10 @@ SECTIONS | |||
105 | __bss_start = .; | 105 | __bss_start = .; |
106 | /* page table entries need to be PAGE_SIZE aligned */ | 106 | /* page table entries need to be PAGE_SIZE aligned */ |
107 | . = ALIGN(PAGE_SIZE); | 107 | . = ALIGN(PAGE_SIZE); |
108 | .data.vmpages : { | 108 | .data..vmpages : { |
109 | *(.data.vm0.pmd) | 109 | *(.data..vm0.pmd) |
110 | *(.data.vm0.pgd) | 110 | *(.data..vm0.pgd) |
111 | *(.data.vm0.pte) | 111 | *(.data..vm0.pte) |
112 | } | 112 | } |
113 | .bss : { | 113 | .bss : { |
114 | *(.bss) | 114 | *(.bss) |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 66a315e06dce..328774bd41ee 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -351,7 +351,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE | |||
351 | 351 | ||
352 | config KEXEC | 352 | config KEXEC |
353 | bool "kexec system call (EXPERIMENTAL)" | 353 | bool "kexec system call (EXPERIMENTAL)" |
354 | depends on PPC_BOOK3S && EXPERIMENTAL | 354 | depends on (PPC_BOOK3S || (FSL_BOOKE && !SMP)) && EXPERIMENTAL |
355 | help | 355 | help |
356 | kexec is a system call that implements the ability to shutdown your | 356 | kexec is a system call that implements the ability to shutdown your |
357 | current kernel, and to start another kernel. It is like a reboot | 357 | current kernel, and to start another kernel. It is like a reboot |
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 1a54a3b3a3fa..42dcd3f4ad7b 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -112,6 +112,11 @@ KBUILD_CFLAGS += $(call cc-option,-mspe=no) | |||
112 | # kernel considerably. | 112 | # kernel considerably. |
113 | KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) | 113 | KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) |
114 | 114 | ||
115 | # FIXME: the module load should be taught about the additional relocs | ||
116 | # generated by this. | ||
117 | # revert to pre-gcc-4.4 behaviour of .eh_frame | ||
118 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) | ||
119 | |||
115 | # Never use string load/store instructions as they are | 120 | # Never use string load/store instructions as they are |
116 | # often slow when they are implemented at all | 121 | # often slow when they are implemented at all |
117 | KBUILD_CFLAGS += -mno-string | 122 | KBUILD_CFLAGS += -mno-string |
diff --git a/arch/powerpc/boot/4xx.c b/arch/powerpc/boot/4xx.c index 27db8938827a..9d3bd4c45a24 100644 --- a/arch/powerpc/boot/4xx.c +++ b/arch/powerpc/boot/4xx.c | |||
@@ -519,7 +519,7 @@ void ibm440ep_fixup_clocks(unsigned int sys_clk, | |||
519 | { | 519 | { |
520 | unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 0); | 520 | unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 0); |
521 | 521 | ||
522 | /* serial clocks beed fixup based on int/ext */ | 522 | /* serial clocks need fixup based on int/ext */ |
523 | eplike_fixup_uart_clk(0, "/plb/opb/serial@ef600300", ser_clk, plb_clk); | 523 | eplike_fixup_uart_clk(0, "/plb/opb/serial@ef600300", ser_clk, plb_clk); |
524 | eplike_fixup_uart_clk(1, "/plb/opb/serial@ef600400", ser_clk, plb_clk); | 524 | eplike_fixup_uart_clk(1, "/plb/opb/serial@ef600400", ser_clk, plb_clk); |
525 | eplike_fixup_uart_clk(2, "/plb/opb/serial@ef600500", ser_clk, plb_clk); | 525 | eplike_fixup_uart_clk(2, "/plb/opb/serial@ef600500", ser_clk, plb_clk); |
@@ -532,7 +532,7 @@ void ibm440gx_fixup_clocks(unsigned int sys_clk, | |||
532 | { | 532 | { |
533 | unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1); | 533 | unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1); |
534 | 534 | ||
535 | /* serial clocks beed fixup based on int/ext */ | 535 | /* serial clocks need fixup based on int/ext */ |
536 | eplike_fixup_uart_clk(0, "/plb/opb/serial@40000200", ser_clk, plb_clk); | 536 | eplike_fixup_uart_clk(0, "/plb/opb/serial@40000200", ser_clk, plb_clk); |
537 | eplike_fixup_uart_clk(1, "/plb/opb/serial@40000300", ser_clk, plb_clk); | 537 | eplike_fixup_uart_clk(1, "/plb/opb/serial@40000300", ser_clk, plb_clk); |
538 | } | 538 | } |
@@ -543,10 +543,10 @@ void ibm440spe_fixup_clocks(unsigned int sys_clk, | |||
543 | { | 543 | { |
544 | unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1); | 544 | unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1); |
545 | 545 | ||
546 | /* serial clocks beed fixup based on int/ext */ | 546 | /* serial clocks need fixup based on int/ext */ |
547 | eplike_fixup_uart_clk(0, "/plb/opb/serial@10000200", ser_clk, plb_clk); | 547 | eplike_fixup_uart_clk(0, "/plb/opb/serial@f0000200", ser_clk, plb_clk); |
548 | eplike_fixup_uart_clk(1, "/plb/opb/serial@10000300", ser_clk, plb_clk); | 548 | eplike_fixup_uart_clk(1, "/plb/opb/serial@f0000300", ser_clk, plb_clk); |
549 | eplike_fixup_uart_clk(2, "/plb/opb/serial@10000600", ser_clk, plb_clk); | 549 | eplike_fixup_uart_clk(2, "/plb/opb/serial@f0000600", ser_clk, plb_clk); |
550 | } | 550 | } |
551 | 551 | ||
552 | void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk) | 552 | void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk) |
diff --git a/arch/powerpc/boot/dts/icon.dts b/arch/powerpc/boot/dts/icon.dts new file mode 100644 index 000000000000..abcd0caeccae --- /dev/null +++ b/arch/powerpc/boot/dts/icon.dts | |||
@@ -0,0 +1,447 @@ | |||
1 | /* | ||
2 | * Device Tree Source for Mosaix Technologies, Inc. ICON board | ||
3 | * | ||
4 | * Copyright 2010 DENX Software Engineering, Stefan Roese <sr@denx.de> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without | ||
8 | * any warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | /dts-v1/; | ||
12 | |||
13 | / { | ||
14 | #address-cells = <2>; | ||
15 | #size-cells = <2>; | ||
16 | model = "mosaixtech,icon"; | ||
17 | compatible = "mosaixtech,icon"; | ||
18 | dcr-parent = <&{/cpus/cpu@0}>; | ||
19 | |||
20 | aliases { | ||
21 | ethernet0 = &EMAC0; | ||
22 | serial0 = &UART0; | ||
23 | serial1 = &UART1; | ||
24 | serial2 = &UART2; | ||
25 | }; | ||
26 | |||
27 | cpus { | ||
28 | #address-cells = <1>; | ||
29 | #size-cells = <0>; | ||
30 | |||
31 | cpu@0 { | ||
32 | device_type = "cpu"; | ||
33 | model = "PowerPC,440SPe"; | ||
34 | reg = <0x00000000>; | ||
35 | clock-frequency = <0>; /* Filled in by U-Boot */ | ||
36 | timebase-frequency = <0>; /* Filled in by U-Boot */ | ||
37 | i-cache-line-size = <32>; | ||
38 | d-cache-line-size = <32>; | ||
39 | i-cache-size = <32768>; | ||
40 | d-cache-size = <32768>; | ||
41 | dcr-controller; | ||
42 | dcr-access-method = "native"; | ||
43 | reset-type = <2>; /* Use chip-reset */ | ||
44 | }; | ||
45 | }; | ||
46 | |||
47 | memory { | ||
48 | device_type = "memory"; | ||
49 | reg = <0x0 0x00000000 0x0 0x00000000>; /* Filled in by U-Boot */ | ||
50 | }; | ||
51 | |||
52 | UIC0: interrupt-controller0 { | ||
53 | compatible = "ibm,uic-440spe","ibm,uic"; | ||
54 | interrupt-controller; | ||
55 | cell-index = <0>; | ||
56 | dcr-reg = <0x0c0 0x009>; | ||
57 | #address-cells = <0>; | ||
58 | #size-cells = <0>; | ||
59 | #interrupt-cells = <2>; | ||
60 | }; | ||
61 | |||
62 | UIC1: interrupt-controller1 { | ||
63 | compatible = "ibm,uic-440spe","ibm,uic"; | ||
64 | interrupt-controller; | ||
65 | cell-index = <1>; | ||
66 | dcr-reg = <0x0d0 0x009>; | ||
67 | #address-cells = <0>; | ||
68 | #size-cells = <0>; | ||
69 | #interrupt-cells = <2>; | ||
70 | interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */ | ||
71 | interrupt-parent = <&UIC0>; | ||
72 | }; | ||
73 | |||
74 | UIC2: interrupt-controller2 { | ||
75 | compatible = "ibm,uic-440spe","ibm,uic"; | ||
76 | interrupt-controller; | ||
77 | cell-index = <2>; | ||
78 | dcr-reg = <0x0e0 0x009>; | ||
79 | #address-cells = <0>; | ||
80 | #size-cells = <0>; | ||
81 | #interrupt-cells = <2>; | ||
82 | interrupts = <0xa 0x4 0xb 0x4>; /* cascade */ | ||
83 | interrupt-parent = <&UIC0>; | ||
84 | }; | ||
85 | |||
86 | UIC3: interrupt-controller3 { | ||
87 | compatible = "ibm,uic-440spe","ibm,uic"; | ||
88 | interrupt-controller; | ||
89 | cell-index = <3>; | ||
90 | dcr-reg = <0x0f0 0x009>; | ||
91 | #address-cells = <0>; | ||
92 | #size-cells = <0>; | ||
93 | #interrupt-cells = <2>; | ||
94 | interrupts = <0x10 0x4 0x11 0x4>; /* cascade */ | ||
95 | interrupt-parent = <&UIC0>; | ||
96 | }; | ||
97 | |||
98 | SDR0: sdr { | ||
99 | compatible = "ibm,sdr-440spe"; | ||
100 | dcr-reg = <0x00e 0x002>; | ||
101 | }; | ||
102 | |||
103 | CPR0: cpr { | ||
104 | compatible = "ibm,cpr-440spe"; | ||
105 | dcr-reg = <0x00c 0x002>; | ||
106 | }; | ||
107 | |||
108 | MQ0: mq { | ||
109 | compatible = "ibm,mq-440spe"; | ||
110 | dcr-reg = <0x040 0x020>; | ||
111 | }; | ||
112 | |||
113 | plb { | ||
114 | compatible = "ibm,plb-440spe", "ibm,plb-440gp", "ibm,plb4"; | ||
115 | #address-cells = <2>; | ||
116 | #size-cells = <1>; | ||
117 | /* addr-child addr-parent size */ | ||
118 | ranges = <0x4 0x00100000 0x4 0x00100000 0x00001000 | ||
119 | 0x4 0x00200000 0x4 0x00200000 0x00000400 | ||
120 | 0x4 0xe0000000 0x4 0xe0000000 0x20000000 | ||
121 | 0xc 0x00000000 0xc 0x00000000 0x20000000 | ||
122 | 0xd 0x00000000 0xd 0x00000000 0x80000000 | ||
123 | 0xd 0x80000000 0xd 0x80000000 0x80000000 | ||
124 | 0xe 0x00000000 0xe 0x00000000 0x80000000 | ||
125 | 0xe 0x80000000 0xe 0x80000000 0x80000000 | ||
126 | 0xf 0x00000000 0xf 0x00000000 0x80000000 | ||
127 | 0xf 0x80000000 0xf 0x80000000 0x80000000>; | ||
128 | clock-frequency = <0>; /* Filled in by U-Boot */ | ||
129 | |||
130 | SDRAM0: sdram { | ||
131 | compatible = "ibm,sdram-440spe", "ibm,sdram-405gp"; | ||
132 | dcr-reg = <0x010 0x002>; | ||
133 | }; | ||
134 | |||
135 | MAL0: mcmal { | ||
136 | compatible = "ibm,mcmal-440spe", "ibm,mcmal2"; | ||
137 | dcr-reg = <0x180 0x062>; | ||
138 | num-tx-chans = <2>; | ||
139 | num-rx-chans = <1>; | ||
140 | interrupt-parent = <&MAL0>; | ||
141 | interrupts = <0x0 0x1 0x2 0x3 0x4>; | ||
142 | #interrupt-cells = <1>; | ||
143 | #address-cells = <0>; | ||
144 | #size-cells = <0>; | ||
145 | interrupt-map = </*TXEOB*/ 0x0 &UIC1 0x6 0x4 | ||
146 | /*RXEOB*/ 0x1 &UIC1 0x7 0x4 | ||
147 | /*SERR*/ 0x2 &UIC1 0x1 0x4 | ||
148 | /*TXDE*/ 0x3 &UIC1 0x2 0x4 | ||
149 | /*RXDE*/ 0x4 &UIC1 0x3 0x4>; | ||
150 | }; | ||
151 | |||
152 | POB0: opb { | ||
153 | compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb"; | ||
154 | #address-cells = <1>; | ||
155 | #size-cells = <1>; | ||
156 | ranges = <0xe0000000 0x00000004 0xe0000000 0x20000000>; | ||
157 | clock-frequency = <0>; /* Filled in by U-Boot */ | ||
158 | |||
159 | EBC0: ebc { | ||
160 | compatible = "ibm,ebc-440spe", "ibm,ebc-440gp", "ibm,ebc"; | ||
161 | dcr-reg = <0x012 0x002>; | ||
162 | #address-cells = <2>; | ||
163 | #size-cells = <1>; | ||
164 | clock-frequency = <0>; /* Filled in by U-Boot */ | ||
165 | /* ranges property is supplied by U-Boot */ | ||
166 | interrupts = <0x5 0x1>; | ||
167 | interrupt-parent = <&UIC1>; | ||
168 | |||
169 | nor_flash@0,0 { | ||
170 | compatible = "cfi-flash"; | ||
171 | bank-width = <2>; | ||
172 | reg = <0x00000000 0x00000000 0x01000000>; | ||
173 | #address-cells = <1>; | ||
174 | #size-cells = <1>; | ||
175 | partition@0 { | ||
176 | label = "kernel"; | ||
177 | reg = <0x00000000 0x001e0000>; | ||
178 | }; | ||
179 | partition@1e0000 { | ||
180 | label = "dtb"; | ||
181 | reg = <0x001e0000 0x00020000>; | ||
182 | }; | ||
183 | partition@200000 { | ||
184 | label = "root"; | ||
185 | reg = <0x00200000 0x00200000>; | ||
186 | }; | ||
187 | partition@400000 { | ||
188 | label = "user"; | ||
189 | reg = <0x00400000 0x00b60000>; | ||
190 | }; | ||
191 | partition@f60000 { | ||
192 | label = "env"; | ||
193 | reg = <0x00f60000 0x00040000>; | ||
194 | }; | ||
195 | partition@fa0000 { | ||
196 | label = "u-boot"; | ||
197 | reg = <0x00fa0000 0x00060000>; | ||
198 | }; | ||
199 | }; | ||
200 | |||
201 | SysACE_CompactFlash: sysace@1,0 { | ||
202 | compatible = "xlnx,sysace"; | ||
203 | interrupt-parent = <&UIC2>; | ||
204 | interrupts = <24 0x4>; | ||
205 | reg = <0x00000001 0x00000000 0x10000>; | ||
206 | }; | ||
207 | }; | ||
208 | |||
209 | UART0: serial@f0000200 { | ||
210 | device_type = "serial"; | ||
211 | compatible = "ns16550"; | ||
212 | reg = <0xf0000200 0x00000008>; | ||
213 | virtual-reg = <0xa0000200>; | ||
214 | clock-frequency = <0>; /* Filled in by U-Boot */ | ||
215 | current-speed = <115200>; | ||
216 | interrupt-parent = <&UIC0>; | ||
217 | interrupts = <0x0 0x4>; | ||
218 | }; | ||
219 | |||
220 | UART1: serial@f0000300 { | ||
221 | device_type = "serial"; | ||
222 | compatible = "ns16550"; | ||
223 | reg = <0xf0000300 0x00000008>; | ||
224 | virtual-reg = <0xa0000300>; | ||
225 | clock-frequency = <0>; | ||
226 | current-speed = <0>; | ||
227 | interrupt-parent = <&UIC0>; | ||
228 | interrupts = <0x1 0x4>; | ||
229 | }; | ||
230 | |||
231 | |||
232 | UART2: serial@f0000600 { | ||
233 | device_type = "serial"; | ||
234 | compatible = "ns16550"; | ||
235 | reg = <0xf0000600 0x00000008>; | ||
236 | virtual-reg = <0xa0000600>; | ||
237 | clock-frequency = <0>; | ||
238 | current-speed = <0>; | ||
239 | interrupt-parent = <&UIC1>; | ||
240 | interrupts = <0x5 0x4>; | ||
241 | }; | ||
242 | |||
243 | IIC0: i2c@f0000400 { | ||
244 | compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic"; | ||
245 | reg = <0xf0000400 0x00000014>; | ||
246 | interrupt-parent = <&UIC0>; | ||
247 | interrupts = <0x2 0x4>; | ||
248 | }; | ||
249 | |||
250 | IIC1: i2c@f0000500 { | ||
251 | compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic"; | ||
252 | reg = <0xf0000500 0x00000014>; | ||
253 | interrupt-parent = <&UIC0>; | ||
254 | interrupts = <0x3 0x4>; | ||
255 | #address-cells = <1>; | ||
256 | #size-cells = <0>; | ||
257 | |||
258 | rtc@68 { | ||
259 | compatible = "stm,m41t00"; | ||
260 | reg = <0x68>; | ||
261 | }; | ||
262 | }; | ||
263 | |||
264 | EMAC0: ethernet@f0000800 { | ||
265 | linux,network-index = <0x0>; | ||
266 | device_type = "network"; | ||
267 | compatible = "ibm,emac-440spe", "ibm,emac4"; | ||
268 | interrupt-parent = <&UIC1>; | ||
269 | interrupts = <0x1c 0x4 0x1d 0x4>; | ||
270 | reg = <0xf0000800 0x00000074>; | ||
271 | local-mac-address = [000000000000]; | ||
272 | mal-device = <&MAL0>; | ||
273 | mal-tx-channel = <0>; | ||
274 | mal-rx-channel = <0>; | ||
275 | cell-index = <0>; | ||
276 | max-frame-size = <9000>; | ||
277 | rx-fifo-size = <4096>; | ||
278 | tx-fifo-size = <2048>; | ||
279 | phy-mode = "gmii"; | ||
280 | phy-map = <0x00000000>; | ||
281 | has-inverted-stacr-oc; | ||
282 | has-new-stacr-staopc; | ||
283 | }; | ||
284 | }; | ||
285 | |||
286 | PCIX0: pci@c0ec00000 { | ||
287 | device_type = "pci"; | ||
288 | #interrupt-cells = <1>; | ||
289 | #size-cells = <2>; | ||
290 | #address-cells = <3>; | ||
291 | compatible = "ibm,plb-pcix-440spe", "ibm,plb-pcix"; | ||
292 | primary; | ||
293 | large-inbound-windows; | ||
294 | enable-msi-hole; | ||
295 | reg = <0x0000000c 0x0ec00000 0x00000008 /* Config space access */ | ||
296 | 0x00000000 0x00000000 0x00000000 /* no IACK cycles */ | ||
297 | 0x0000000c 0x0ed00000 0x00000004 /* Special cycles */ | ||
298 | 0x0000000c 0x0ec80000 0x00000100 /* Internal registers */ | ||
299 | 0x0000000c 0x0ec80100 0x000000fc>; /* Internal messaging registers */ | ||
300 | |||
301 | /* Outbound ranges, one memory and one IO, | ||
302 | * later cannot be changed | ||
303 | */ | ||
304 | ranges = <0x02000000 0x00000000 0x80000000 0x0000000d 0x80000000 0x00000000 0x80000000 | ||
305 | 0x01000000 0x00000000 0x00000000 0x0000000c 0x08000000 0x00000000 0x00010000>; | ||
306 | |||
307 | /* Inbound 4GB range starting at 0 */ | ||
308 | dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x1 0x00000000>; | ||
309 | |||
310 | /* This drives busses 0 to 0xf */ | ||
311 | bus-range = <0x0 0xf>; | ||
312 | |||
313 | /* PCI-X interrupt (SM502) is routed to extIRQ10 (UIC1, 19) */ | ||
314 | interrupt-map-mask = <0x0 0x0 0x0 0x0>; | ||
315 | interrupt-map = <0x0 0x0 0x0 0x0 &UIC1 19 0x8>; | ||
316 | }; | ||
317 | |||
318 | PCIE0: pciex@d00000000 { | ||
319 | device_type = "pci"; | ||
320 | #interrupt-cells = <1>; | ||
321 | #size-cells = <2>; | ||
322 | #address-cells = <3>; | ||
323 | compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex"; | ||
324 | primary; | ||
325 | port = <0x0>; /* port number */ | ||
326 | reg = <0x0000000d 0x00000000 0x20000000 /* Config space access */ | ||
327 | 0x0000000c 0x10000000 0x00001000>; /* Registers */ | ||
328 | dcr-reg = <0x100 0x020>; | ||
329 | sdr-base = <0x300>; | ||
330 | |||
331 | /* Outbound ranges, one memory and one IO, | ||
332 | * later cannot be changed | ||
333 | */ | ||
334 | ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000 | ||
335 | 0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>; | ||
336 | |||
337 | /* Inbound 4GB range starting at 0 */ | ||
338 | dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x1 0x00000000>; | ||
339 | |||
340 | /* This drives busses 0x10 to 0x1f */ | ||
341 | bus-range = <0x10 0x1f>; | ||
342 | |||
343 | /* Legacy interrupts (note the weird polarity, the bridge seems | ||
344 | * to invert PCIe legacy interrupts). | ||
345 | * We are de-swizzling here because the numbers are actually for | ||
346 | * port of the root complex virtual P2P bridge. But I want | ||
347 | * to avoid putting a node for it in the tree, so the numbers | ||
348 | * below are basically de-swizzled numbers. | ||
349 | * The real slot is on idsel 0, so the swizzling is 1:1 | ||
350 | */ | ||
351 | interrupt-map-mask = <0x0 0x0 0x0 0x7>; | ||
352 | interrupt-map = < | ||
353 | 0x0 0x0 0x0 0x1 &UIC3 0x0 0x4 /* swizzled int A */ | ||
354 | 0x0 0x0 0x0 0x2 &UIC3 0x1 0x4 /* swizzled int B */ | ||
355 | 0x0 0x0 0x0 0x3 &UIC3 0x2 0x4 /* swizzled int C */ | ||
356 | 0x0 0x0 0x0 0x4 &UIC3 0x3 0x4 /* swizzled int D */>; | ||
357 | }; | ||
358 | |||
359 | PCIE1: pciex@d20000000 { | ||
360 | device_type = "pci"; | ||
361 | #interrupt-cells = <1>; | ||
362 | #size-cells = <2>; | ||
363 | #address-cells = <3>; | ||
364 | compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex"; | ||
365 | primary; | ||
366 | port = <0x1>; /* port number */ | ||
367 | reg = <0x0000000d 0x20000000 0x20000000 /* Config space access */ | ||
368 | 0x0000000c 0x10001000 0x00001000>; /* Registers */ | ||
369 | dcr-reg = <0x120 0x020>; | ||
370 | sdr-base = <0x340>; | ||
371 | |||
372 | /* Outbound ranges, one memory and one IO, | ||
373 | * later cannot be changed | ||
374 | */ | ||
375 | ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000 | ||
376 | 0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>; | ||
377 | |||
378 | /* Inbound 4GB range starting at 0 */ | ||
379 | dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x1 0x00000000>; | ||
380 | |||
381 | /* This drives busses 0x20 to 0x2f */ | ||
382 | bus-range = <0x20 0x2f>; | ||
383 | |||
384 | /* Legacy interrupts (note the weird polarity, the bridge seems | ||
385 | * to invert PCIe legacy interrupts). | ||
386 | * We are de-swizzling here because the numbers are actually for | ||
387 | * port of the root complex virtual P2P bridge. But I want | ||
388 | * to avoid putting a node for it in the tree, so the numbers | ||
389 | * below are basically de-swizzled numbers. | ||
390 | * The real slot is on idsel 0, so the swizzling is 1:1 | ||
391 | */ | ||
392 | interrupt-map-mask = <0x0 0x0 0x0 0x7>; | ||
393 | interrupt-map = < | ||
394 | 0x0 0x0 0x0 0x1 &UIC3 0x4 0x4 /* swizzled int A */ | ||
395 | 0x0 0x0 0x0 0x2 &UIC3 0x5 0x4 /* swizzled int B */ | ||
396 | 0x0 0x0 0x0 0x3 &UIC3 0x6 0x4 /* swizzled int C */ | ||
397 | 0x0 0x0 0x0 0x4 &UIC3 0x7 0x4 /* swizzled int D */>; | ||
398 | }; | ||
399 | |||
400 | I2O: i2o@400100000 { | ||
401 | compatible = "ibm,i2o-440spe"; | ||
402 | reg = <0x00000004 0x00100000 0x100>; | ||
403 | dcr-reg = <0x060 0x020>; | ||
404 | }; | ||
405 | |||
406 | DMA0: dma0@400100100 { | ||
407 | compatible = "ibm,dma-440spe"; | ||
408 | cell-index = <0>; | ||
409 | reg = <0x00000004 0x00100100 0x100>; | ||
410 | dcr-reg = <0x060 0x020>; | ||
411 | interrupt-parent = <&DMA0>; | ||
412 | interrupts = <0 1>; | ||
413 | #interrupt-cells = <1>; | ||
414 | #address-cells = <0>; | ||
415 | #size-cells = <0>; | ||
416 | interrupt-map = < | ||
417 | 0 &UIC0 0x14 4 | ||
418 | 1 &UIC1 0x16 4>; | ||
419 | }; | ||
420 | |||
421 | DMA1: dma1@400100200 { | ||
422 | compatible = "ibm,dma-440spe"; | ||
423 | cell-index = <1>; | ||
424 | reg = <0x00000004 0x00100200 0x100>; | ||
425 | dcr-reg = <0x060 0x020>; | ||
426 | interrupt-parent = <&DMA1>; | ||
427 | interrupts = <0 1>; | ||
428 | #interrupt-cells = <1>; | ||
429 | #address-cells = <0>; | ||
430 | #size-cells = <0>; | ||
431 | interrupt-map = < | ||
432 | 0 &UIC0 0x16 4 | ||
433 | 1 &UIC1 0x16 4>; | ||
434 | }; | ||
435 | |||
436 | xor-accel@400200000 { | ||
437 | compatible = "amcc,xor-accelerator"; | ||
438 | reg = <0x00000004 0x00200000 0x400>; | ||
439 | interrupt-parent = <&UIC1>; | ||
440 | interrupts = <0x1f 4>; | ||
441 | }; | ||
442 | }; | ||
443 | |||
444 | chosen { | ||
445 | linux,stdout-path = "/plb/opb/serial@f0000200"; | ||
446 | }; | ||
447 | }; | ||
diff --git a/arch/powerpc/boot/dts/katmai.dts b/arch/powerpc/boot/dts/katmai.dts index 8cf2c0c88c05..7c3be5e45748 100644 --- a/arch/powerpc/boot/dts/katmai.dts +++ b/arch/powerpc/boot/dts/katmai.dts | |||
@@ -44,6 +44,7 @@ | |||
44 | d-cache-size = <32768>; | 44 | d-cache-size = <32768>; |
45 | dcr-controller; | 45 | dcr-controller; |
46 | dcr-access-method = "native"; | 46 | dcr-access-method = "native"; |
47 | reset-type = <2>; /* Use chip-reset */ | ||
47 | }; | 48 | }; |
48 | }; | 49 | }; |
49 | 50 | ||
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts index 4173af387c63..0f5262452682 100644 --- a/arch/powerpc/boot/dts/mpc8548cds.dts +++ b/arch/powerpc/boot/dts/mpc8548cds.dts | |||
@@ -20,10 +20,8 @@ | |||
20 | aliases { | 20 | aliases { |
21 | ethernet0 = &enet0; | 21 | ethernet0 = &enet0; |
22 | ethernet1 = &enet1; | 22 | ethernet1 = &enet1; |
23 | /* | ||
24 | ethernet2 = &enet2; | 23 | ethernet2 = &enet2; |
25 | ethernet3 = &enet3; | 24 | ethernet3 = &enet3; |
26 | */ | ||
27 | serial0 = &serial0; | 25 | serial0 = &serial0; |
28 | serial1 = &serial1; | 26 | serial1 = &serial1; |
29 | pci0 = &pci0; | 27 | pci0 = &pci0; |
@@ -254,7 +252,6 @@ | |||
254 | }; | 252 | }; |
255 | }; | 253 | }; |
256 | 254 | ||
257 | /* eTSEC 3/4 are currently broken | ||
258 | enet2: ethernet@26000 { | 255 | enet2: ethernet@26000 { |
259 | #address-cells = <1>; | 256 | #address-cells = <1>; |
260 | #size-cells = <1>; | 257 | #size-cells = <1>; |
@@ -310,7 +307,6 @@ | |||
310 | }; | 307 | }; |
311 | }; | 308 | }; |
312 | }; | 309 | }; |
313 | */ | ||
314 | 310 | ||
315 | serial0: serial@4500 { | 311 | serial0: serial@4500 { |
316 | cell-index = <0>; | 312 | cell-index = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts index 5bd1011fde96..3375c2ab0c32 100644 --- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts +++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts | |||
@@ -215,6 +215,18 @@ | |||
215 | clock-frequency = <0>; | 215 | clock-frequency = <0>; |
216 | }; | 216 | }; |
217 | 217 | ||
218 | msi@41600 { | ||
219 | compatible = "fsl,mpc8572-msi", "fsl,mpic-msi"; | ||
220 | reg = <0x41600 0x80>; | ||
221 | msi-available-ranges = <0 0x80>; | ||
222 | interrupts = < | ||
223 | 0xe0 0 | ||
224 | 0xe1 0 | ||
225 | 0xe2 0 | ||
226 | 0xe3 0>; | ||
227 | interrupt-parent = <&mpic>; | ||
228 | }; | ||
229 | |||
218 | global-utilities@e0000 { //global utilities block | 230 | global-utilities@e0000 { //global utilities block |
219 | compatible = "fsl,mpc8572-guts"; | 231 | compatible = "fsl,mpc8572-guts"; |
220 | reg = <0xe0000 0x1000>; | 232 | reg = <0xe0000 0x1000>; |
@@ -243,8 +255,7 @@ | |||
243 | protected-sources = < | 255 | protected-sources = < |
244 | 31 32 33 37 38 39 /* enet2 enet3 */ | 256 | 31 32 33 37 38 39 /* enet2 enet3 */ |
245 | 76 77 78 79 26 42 /* dma2 pci2 serial*/ | 257 | 76 77 78 79 26 42 /* dma2 pci2 serial*/ |
246 | 0xe0 0xe1 0xe2 0xe3 /* msi */ | 258 | 0xe4 0xe5 0xe6 0xe7 /* msi */ |
247 | 0xe4 0xe5 0xe6 0xe7 | ||
248 | >; | 259 | >; |
249 | }; | 260 | }; |
250 | }; | 261 | }; |
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts index 0efc3456e297..e7b477f6a3fe 100644 --- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts +++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts | |||
@@ -154,12 +154,8 @@ | |||
154 | msi@41600 { | 154 | msi@41600 { |
155 | compatible = "fsl,mpc8572-msi", "fsl,mpic-msi"; | 155 | compatible = "fsl,mpc8572-msi", "fsl,mpic-msi"; |
156 | reg = <0x41600 0x80>; | 156 | reg = <0x41600 0x80>; |
157 | msi-available-ranges = <0 0x100>; | 157 | msi-available-ranges = <0x80 0x80>; |
158 | interrupts = < | 158 | interrupts = < |
159 | 0xe0 0 | ||
160 | 0xe1 0 | ||
161 | 0xe2 0 | ||
162 | 0xe3 0 | ||
163 | 0xe4 0 | 159 | 0xe4 0 |
164 | 0xe5 0 | 160 | 0xe5 0 |
165 | 0xe6 0 | 161 | 0xe6 0 |
@@ -190,6 +186,7 @@ | |||
190 | 0x1 0x2 0x3 0x4 /* pci slot */ | 186 | 0x1 0x2 0x3 0x4 /* pci slot */ |
191 | 0x9 0xa 0xb 0xc /* usb */ | 187 | 0x9 0xa 0xb 0xc /* usb */ |
192 | 0x6 0x7 0xe 0x5 /* Audio elgacy SATA */ | 188 | 0x6 0x7 0xe 0x5 /* Audio elgacy SATA */ |
189 | 0xe0 0xe1 0xe2 0xe3 /* msi */ | ||
193 | >; | 190 | >; |
194 | }; | 191 | }; |
195 | }; | 192 | }; |
diff --git a/arch/powerpc/boot/dts/p1021mds.dts b/arch/powerpc/boot/dts/p1021mds.dts new file mode 100644 index 000000000000..7fad2df25981 --- /dev/null +++ b/arch/powerpc/boot/dts/p1021mds.dts | |||
@@ -0,0 +1,698 @@ | |||
1 | /* | ||
2 | * P1021 MDS Device Tree Source | ||
3 | * | ||
4 | * Copyright 2010 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | /dts-v1/; | ||
13 | / { | ||
14 | model = "fsl,P1021"; | ||
15 | compatible = "fsl,P1021MDS"; | ||
16 | #address-cells = <2>; | ||
17 | #size-cells = <2>; | ||
18 | |||
19 | aliases { | ||
20 | serial0 = &serial0; | ||
21 | serial1 = &serial1; | ||
22 | ethernet0 = &enet0; | ||
23 | ethernet1 = &enet1; | ||
24 | ethernet2 = &enet2; | ||
25 | ethernet3 = &enet3; | ||
26 | ethernet4 = &enet4; | ||
27 | pci0 = &pci0; | ||
28 | pci1 = &pci1; | ||
29 | }; | ||
30 | |||
31 | cpus { | ||
32 | #address-cells = <1>; | ||
33 | #size-cells = <0>; | ||
34 | |||
35 | PowerPC,P1021@0 { | ||
36 | device_type = "cpu"; | ||
37 | reg = <0x0>; | ||
38 | next-level-cache = <&L2>; | ||
39 | }; | ||
40 | |||
41 | PowerPC,P1021@1 { | ||
42 | device_type = "cpu"; | ||
43 | reg = <0x1>; | ||
44 | next-level-cache = <&L2>; | ||
45 | }; | ||
46 | }; | ||
47 | |||
48 | memory { | ||
49 | device_type = "memory"; | ||
50 | }; | ||
51 | |||
52 | localbus@ffe05000 { | ||
53 | #address-cells = <2>; | ||
54 | #size-cells = <1>; | ||
55 | compatible = "fsl,p1021-elbc", "fsl,elbc", "simple-bus"; | ||
56 | reg = <0 0xffe05000 0 0x1000>; | ||
57 | interrupts = <19 2>; | ||
58 | interrupt-parent = <&mpic>; | ||
59 | |||
60 | /* NAND Flash, BCSR, PMC0/1*/ | ||
61 | ranges = <0x0 0x0 0x0 0xfc000000 0x02000000 | ||
62 | 0x1 0x0 0x0 0xf8000000 0x00008000 | ||
63 | 0x2 0x0 0x0 0xf8010000 0x00020000 | ||
64 | 0x3 0x0 0x0 0xf8020000 0x00020000>; | ||
65 | |||
66 | nand@0,0 { | ||
67 | #address-cells = <1>; | ||
68 | #size-cells = <1>; | ||
69 | compatible = "fsl,p1021-fcm-nand", | ||
70 | "fsl,elbc-fcm-nand"; | ||
71 | reg = <0x0 0x0 0x40000>; | ||
72 | |||
73 | partition@0 { | ||
74 | /* This location must not be altered */ | ||
75 | /* 1MB for u-boot Bootloader Image */ | ||
76 | reg = <0x0 0x00100000>; | ||
77 | label = "NAND (RO) U-Boot Image"; | ||
78 | read-only; | ||
79 | }; | ||
80 | |||
81 | partition@100000 { | ||
82 | /* 1MB for DTB Image */ | ||
83 | reg = <0x00100000 0x00100000>; | ||
84 | label = "NAND (RO) DTB Image"; | ||
85 | read-only; | ||
86 | }; | ||
87 | |||
88 | partition@200000 { | ||
89 | /* 4MB for Linux Kernel Image */ | ||
90 | reg = <0x00200000 0x00400000>; | ||
91 | label = "NAND (RO) Linux Kernel Image"; | ||
92 | read-only; | ||
93 | }; | ||
94 | |||
95 | partition@600000 { | ||
96 | /* 5MB for Compressed Root file System Image */ | ||
97 | reg = <0x00600000 0x00500000>; | ||
98 | label = "NAND (RO) Compressed RFS Image"; | ||
99 | read-only; | ||
100 | }; | ||
101 | |||
102 | partition@b00000 { | ||
103 | /* 6MB for JFFS2 based Root file System */ | ||
104 | reg = <0x00a00000 0x00600000>; | ||
105 | label = "NAND (RW) JFFS2 Root File System"; | ||
106 | }; | ||
107 | |||
108 | partition@1100000 { | ||
109 | /* 14MB for JFFS2 based Root file System */ | ||
110 | reg = <0x01100000 0x00e00000>; | ||
111 | label = "NAND (RW) Writable User area"; | ||
112 | }; | ||
113 | |||
114 | partition@1f00000 { | ||
115 | /* 1MB for microcode */ | ||
116 | reg = <0x01f00000 0x00100000>; | ||
117 | label = "NAND (RO) QE Ucode"; | ||
118 | read-only; | ||
119 | }; | ||
120 | }; | ||
121 | |||
122 | bcsr@1,0 { | ||
123 | #address-cells = <1>; | ||
124 | #size-cells = <1>; | ||
125 | compatible = "fsl,p1021mds-bcsr"; | ||
126 | reg = <1 0 0x8000>; | ||
127 | ranges = <0 1 0 0x8000>; | ||
128 | }; | ||
129 | |||
130 | pib@2,0 { | ||
131 | compatible = "fsl,p1021mds-pib"; | ||
132 | reg = <2 0 0x10000>; | ||
133 | }; | ||
134 | |||
135 | pib@3,0 { | ||
136 | compatible = "fsl,p1021mds-pib"; | ||
137 | reg = <3 0 0x10000>; | ||
138 | }; | ||
139 | }; | ||
140 | |||
141 | soc@ffe00000 { | ||
142 | |||
143 | #address-cells = <1>; | ||
144 | #size-cells = <1>; | ||
145 | device_type = "soc"; | ||
146 | compatible = "fsl,p1021-immr", "simple-bus"; | ||
147 | ranges = <0x0 0x0 0xffe00000 0x100000>; | ||
148 | bus-frequency = <0>; // Filled out by uboot. | ||
149 | |||
150 | ecm-law@0 { | ||
151 | compatible = "fsl,ecm-law"; | ||
152 | reg = <0x0 0x1000>; | ||
153 | fsl,num-laws = <12>; | ||
154 | }; | ||
155 | |||
156 | ecm@1000 { | ||
157 | compatible = "fsl,p1021-ecm", "fsl,ecm"; | ||
158 | reg = <0x1000 0x1000>; | ||
159 | interrupts = <16 2>; | ||
160 | interrupt-parent = <&mpic>; | ||
161 | }; | ||
162 | |||
163 | memory-controller@2000 { | ||
164 | compatible = "fsl,p1021-memory-controller"; | ||
165 | reg = <0x2000 0x1000>; | ||
166 | interrupt-parent = <&mpic>; | ||
167 | interrupts = <16 2>; | ||
168 | }; | ||
169 | |||
170 | i2c@3000 { | ||
171 | #address-cells = <1>; | ||
172 | #size-cells = <0>; | ||
173 | cell-index = <0>; | ||
174 | compatible = "fsl-i2c"; | ||
175 | reg = <0x3000 0x100>; | ||
176 | interrupts = <43 2>; | ||
177 | interrupt-parent = <&mpic>; | ||
178 | dfsrr; | ||
179 | rtc@68 { | ||
180 | compatible = "dallas,ds1374"; | ||
181 | reg = <0x68>; | ||
182 | }; | ||
183 | }; | ||
184 | |||
185 | i2c@3100 { | ||
186 | #address-cells = <1>; | ||
187 | #size-cells = <0>; | ||
188 | cell-index = <1>; | ||
189 | compatible = "fsl-i2c"; | ||
190 | reg = <0x3100 0x100>; | ||
191 | interrupts = <43 2>; | ||
192 | interrupt-parent = <&mpic>; | ||
193 | dfsrr; | ||
194 | }; | ||
195 | |||
196 | serial0: serial@4500 { | ||
197 | cell-index = <0>; | ||
198 | device_type = "serial"; | ||
199 | compatible = "ns16550"; | ||
200 | reg = <0x4500 0x100>; | ||
201 | clock-frequency = <0>; | ||
202 | interrupts = <42 2>; | ||
203 | interrupt-parent = <&mpic>; | ||
204 | }; | ||
205 | |||
206 | serial1: serial@4600 { | ||
207 | cell-index = <1>; | ||
208 | device_type = "serial"; | ||
209 | compatible = "ns16550"; | ||
210 | reg = <0x4600 0x100>; | ||
211 | clock-frequency = <0>; | ||
212 | interrupts = <42 2>; | ||
213 | interrupt-parent = <&mpic>; | ||
214 | }; | ||
215 | |||
216 | spi@7000 { | ||
217 | cell-index = <0>; | ||
218 | #address-cells = <1>; | ||
219 | #size-cells = <0>; | ||
220 | compatible = "fsl,espi"; | ||
221 | reg = <0x7000 0x1000>; | ||
222 | interrupts = <59 0x2>; | ||
223 | interrupt-parent = <&mpic>; | ||
224 | espi,num-ss-bits = <4>; | ||
225 | mode = "cpu"; | ||
226 | |||
227 | fsl_m25p80@0 { | ||
228 | #address-cells = <1>; | ||
229 | #size-cells = <1>; | ||
230 | compatible = "fsl,espi-flash"; | ||
231 | reg = <0>; | ||
232 | linux,modalias = "fsl_m25p80"; | ||
233 | spi-max-frequency = <40000000>; /* input clock */ | ||
234 | partition@u-boot { | ||
235 | label = "u-boot-spi"; | ||
236 | reg = <0x00000000 0x00100000>; | ||
237 | read-only; | ||
238 | }; | ||
239 | partition@kernel { | ||
240 | label = "kernel-spi"; | ||
241 | reg = <0x00100000 0x00500000>; | ||
242 | read-only; | ||
243 | }; | ||
244 | partition@dtb { | ||
245 | label = "dtb-spi"; | ||
246 | reg = <0x00600000 0x00100000>; | ||
247 | read-only; | ||
248 | }; | ||
249 | partition@fs { | ||
250 | label = "file system-spi"; | ||
251 | reg = <0x00700000 0x00900000>; | ||
252 | }; | ||
253 | }; | ||
254 | }; | ||
255 | |||
256 | gpio: gpio-controller@f000 { | ||
257 | #gpio-cells = <2>; | ||
258 | compatible = "fsl,mpc8572-gpio"; | ||
259 | reg = <0xf000 0x100>; | ||
260 | interrupts = <47 0x2>; | ||
261 | interrupt-parent = <&mpic>; | ||
262 | gpio-controller; | ||
263 | }; | ||
264 | |||
265 | L2: l2-cache-controller@20000 { | ||
266 | compatible = "fsl,p1021-l2-cache-controller"; | ||
267 | reg = <0x20000 0x1000>; | ||
268 | cache-line-size = <32>; // 32 bytes | ||
269 | cache-size = <0x40000>; // L2,256K | ||
270 | interrupt-parent = <&mpic>; | ||
271 | interrupts = <16 2>; | ||
272 | }; | ||
273 | |||
274 | dma@21300 { | ||
275 | #address-cells = <1>; | ||
276 | #size-cells = <1>; | ||
277 | compatible = "fsl,eloplus-dma"; | ||
278 | reg = <0x21300 0x4>; | ||
279 | ranges = <0x0 0x21100 0x200>; | ||
280 | cell-index = <0>; | ||
281 | dma-channel@0 { | ||
282 | compatible = "fsl,eloplus-dma-channel"; | ||
283 | reg = <0x0 0x80>; | ||
284 | cell-index = <0>; | ||
285 | interrupt-parent = <&mpic>; | ||
286 | interrupts = <20 2>; | ||
287 | }; | ||
288 | dma-channel@80 { | ||
289 | compatible = "fsl,eloplus-dma-channel"; | ||
290 | reg = <0x80 0x80>; | ||
291 | cell-index = <1>; | ||
292 | interrupt-parent = <&mpic>; | ||
293 | interrupts = <21 2>; | ||
294 | }; | ||
295 | dma-channel@100 { | ||
296 | compatible = "fsl,eloplus-dma-channel"; | ||
297 | reg = <0x100 0x80>; | ||
298 | cell-index = <2>; | ||
299 | interrupt-parent = <&mpic>; | ||
300 | interrupts = <22 2>; | ||
301 | }; | ||
302 | dma-channel@180 { | ||
303 | compatible = "fsl,eloplus-dma-channel"; | ||
304 | reg = <0x180 0x80>; | ||
305 | cell-index = <3>; | ||
306 | interrupt-parent = <&mpic>; | ||
307 | interrupts = <23 2>; | ||
308 | }; | ||
309 | }; | ||
310 | |||
311 | usb@22000 { | ||
312 | #address-cells = <1>; | ||
313 | #size-cells = <0>; | ||
314 | compatible = "fsl-usb2-dr"; | ||
315 | reg = <0x22000 0x1000>; | ||
316 | interrupt-parent = <&mpic>; | ||
317 | interrupts = <28 0x2>; | ||
318 | phy_type = "ulpi"; | ||
319 | }; | ||
320 | |||
321 | mdio@24000 { | ||
322 | #address-cells = <1>; | ||
323 | #size-cells = <0>; | ||
324 | compatible = "fsl,etsec2-mdio"; | ||
325 | reg = <0x24000 0x1000 0xb0030 0x4>; | ||
326 | |||
327 | phy0: ethernet-phy@0 { | ||
328 | interrupt-parent = <&mpic>; | ||
329 | interrupts = <1 1>; | ||
330 | reg = <0x0>; | ||
331 | }; | ||
332 | phy1: ethernet-phy@1 { | ||
333 | interrupt-parent = <&mpic>; | ||
334 | interrupts = <2 1>; | ||
335 | reg = <0x1>; | ||
336 | }; | ||
337 | phy4: ethernet-phy@4 { | ||
338 | interrupt-parent = <&mpic>; | ||
339 | reg = <0x4>; | ||
340 | }; | ||
341 | }; | ||
342 | |||
343 | mdio@25000 { | ||
344 | #address-cells = <1>; | ||
345 | #size-cells = <0>; | ||
346 | compatible = "fsl,etsec2-tbi"; | ||
347 | reg = <0x25000 0x1000 0xb1030 0x4>; | ||
348 | tbi0: tbi-phy@11 { | ||
349 | reg = <0x11>; | ||
350 | device_type = "tbi-phy"; | ||
351 | }; | ||
352 | }; | ||
353 | |||
354 | enet0: ethernet@B0000 { | ||
355 | #address-cells = <1>; | ||
356 | #size-cells = <1>; | ||
357 | cell-index = <0>; | ||
358 | device_type = "network"; | ||
359 | model = "eTSEC"; | ||
360 | compatible = "fsl,etsec2"; | ||
361 | fsl,num_rx_queues = <0x8>; | ||
362 | fsl,num_tx_queues = <0x8>; | ||
363 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
364 | interrupt-parent = <&mpic>; | ||
365 | phy-handle = <&phy0>; | ||
366 | phy-connection-type = "rgmii-id"; | ||
367 | queue-group@0{ | ||
368 | #address-cells = <1>; | ||
369 | #size-cells = <1>; | ||
370 | reg = <0xB0000 0x1000>; | ||
371 | interrupts = <29 2 30 2 34 2>; | ||
372 | }; | ||
373 | queue-group@1{ | ||
374 | #address-cells = <1>; | ||
375 | #size-cells = <1>; | ||
376 | reg = <0xB4000 0x1000>; | ||
377 | interrupts = <17 2 18 2 24 2>; | ||
378 | }; | ||
379 | }; | ||
380 | |||
381 | enet1: ethernet@B1000 { | ||
382 | #address-cells = <1>; | ||
383 | #size-cells = <1>; | ||
384 | cell-index = <0>; | ||
385 | device_type = "network"; | ||
386 | model = "eTSEC"; | ||
387 | compatible = "fsl,etsec2"; | ||
388 | fsl,num_rx_queues = <0x8>; | ||
389 | fsl,num_tx_queues = <0x8>; | ||
390 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
391 | interrupt-parent = <&mpic>; | ||
392 | phy-handle = <&phy4>; | ||
393 | tbi-handle = <&tbi0>; | ||
394 | phy-connection-type = "sgmii"; | ||
395 | queue-group@0{ | ||
396 | #address-cells = <1>; | ||
397 | #size-cells = <1>; | ||
398 | reg = <0xB1000 0x1000>; | ||
399 | interrupts = <35 2 36 2 40 2>; | ||
400 | }; | ||
401 | queue-group@1{ | ||
402 | #address-cells = <1>; | ||
403 | #size-cells = <1>; | ||
404 | reg = <0xB5000 0x1000>; | ||
405 | interrupts = <51 2 52 2 67 2>; | ||
406 | }; | ||
407 | }; | ||
408 | |||
409 | enet2: ethernet@B2000 { | ||
410 | #address-cells = <1>; | ||
411 | #size-cells = <1>; | ||
412 | cell-index = <0>; | ||
413 | device_type = "network"; | ||
414 | model = "eTSEC"; | ||
415 | compatible = "fsl,etsec2"; | ||
416 | fsl,num_rx_queues = <0x8>; | ||
417 | fsl,num_tx_queues = <0x8>; | ||
418 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
419 | interrupt-parent = <&mpic>; | ||
420 | phy-handle = <&phy1>; | ||
421 | phy-connection-type = "rgmii-id"; | ||
422 | queue-group@0{ | ||
423 | #address-cells = <1>; | ||
424 | #size-cells = <1>; | ||
425 | reg = <0xB2000 0x1000>; | ||
426 | interrupts = <31 2 32 2 33 2>; | ||
427 | }; | ||
428 | queue-group@1{ | ||
429 | #address-cells = <1>; | ||
430 | #size-cells = <1>; | ||
431 | reg = <0xB6000 0x1000>; | ||
432 | interrupts = <25 2 26 2 27 2>; | ||
433 | }; | ||
434 | }; | ||
435 | |||
436 | sdhci@2e000 { | ||
437 | compatible = "fsl,p1021-esdhc", "fsl,esdhc"; | ||
438 | reg = <0x2e000 0x1000>; | ||
439 | interrupts = <72 0x2>; | ||
440 | interrupt-parent = <&mpic>; | ||
441 | /* Filled in by U-Boot */ | ||
442 | clock-frequency = <0>; | ||
443 | }; | ||
444 | |||
445 | crypto@30000 { | ||
446 | compatible = "fsl,sec3.3", "fsl,sec3.1", | ||
447 | "fsl,sec3.0", "fsl,sec2.4", | ||
448 | "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0"; | ||
449 | reg = <0x30000 0x10000>; | ||
450 | interrupts = <45 2 58 2>; | ||
451 | interrupt-parent = <&mpic>; | ||
452 | fsl,num-channels = <4>; | ||
453 | fsl,channel-fifo-len = <24>; | ||
454 | fsl,exec-units-mask = <0x97c>; | ||
455 | fsl,descriptor-types-mask = <0x3a30abf>; | ||
456 | }; | ||
457 | |||
458 | mpic: pic@40000 { | ||
459 | interrupt-controller; | ||
460 | #address-cells = <0>; | ||
461 | #interrupt-cells = <2>; | ||
462 | reg = <0x40000 0x40000>; | ||
463 | compatible = "chrp,open-pic"; | ||
464 | device_type = "open-pic"; | ||
465 | }; | ||
466 | |||
467 | msi@41600 { | ||
468 | compatible = "fsl,p1021-msi", "fsl,mpic-msi"; | ||
469 | reg = <0x41600 0x80>; | ||
470 | msi-available-ranges = <0 0x100>; | ||
471 | interrupts = < | ||
472 | 0xe0 0 | ||
473 | 0xe1 0 | ||
474 | 0xe2 0 | ||
475 | 0xe3 0 | ||
476 | 0xe4 0 | ||
477 | 0xe5 0 | ||
478 | 0xe6 0 | ||
479 | 0xe7 0>; | ||
480 | interrupt-parent = <&mpic>; | ||
481 | }; | ||
482 | |||
483 | global-utilities@e0000 { //global utilities block | ||
484 | compatible = "fsl,p1021-guts"; | ||
485 | reg = <0xe0000 0x1000>; | ||
486 | fsl,has-rstcr; | ||
487 | }; | ||
488 | |||
489 | par_io@e0100 { | ||
490 | #address-cells = <1>; | ||
491 | #size-cells = <1>; | ||
492 | reg = <0xe0100 0x60>; | ||
493 | ranges = <0x0 0xe0100 0x60>; | ||
494 | device_type = "par_io"; | ||
495 | num-ports = <3>; | ||
496 | pio1: ucc_pin@01 { | ||
497 | pio-map = < | ||
498 | /* port pin dir open_drain assignment has_irq */ | ||
499 | 0x1 0x13 0x1 0x0 0x1 0x0 /* QE_MUX_MDC */ | ||
500 | 0x1 0x14 0x3 0x0 0x1 0x0 /* QE_MUX_MDIO */ | ||
501 | 0x0 0x17 0x2 0x0 0x2 0x0 /* CLK12 */ | ||
502 | 0x0 0x18 0x2 0x0 0x1 0x0 /* CLK9 | ||
503 | */ | ||
504 | 0x0 0x7 0x1 0x0 0x2 0x0 /* ENET1_TXD0_SER1_TXD0 */ | ||
505 | 0x0 0x9 0x1 0x0 0x2 0x0 /* ENET1_TXD1_SER1_TXD1 */ | ||
506 | 0x0 0xb 0x1 0x0 0x2 0x0 /* ENET1_TXD2_SER1_TXD2 */ | ||
507 | 0x0 0xc 0x1 0x0 0x2 0x0 /* ENET1_TXD3_SER1_TXD3 */ | ||
508 | 0x0 0x6 0x2 0x0 0x2 0x0 /* ENET1_RXD0_SER1_RXD0 */ | ||
509 | 0x0 0xa 0x2 0x0 0x2 0x0 /* ENET1_RXD1_SER1_RXD1 */ | ||
510 | 0x0 0xe 0x2 0x0 0x2 0x0 /* ENET1_RXD2_SER1_RXD2 */ | ||
511 | 0x0 0xf 0x2 0x0 0x2 0x0 /* ENET1_RXD3_SER1_RXD3 */ | ||
512 | 0x0 0x5 0x1 0x0 0x2 0x0 /* ENET1_TX_EN_SER1_RTS_B */ | ||
513 | 0x0 0xd 0x1 0x0 0x2 0x0 /* ENET1_TX_ER */ | ||
514 | 0x0 0x4 0x2 0x0 0x2 0x0 /* ENET1_RX_DV_SER1_CTS_B */ | ||
515 | 0x0 0x8 0x2 0x0 0x2 0x0 /* ENET1_RX_ER_SER1_CD_B */ | ||
516 | 0x0 0x11 0x2 0x0 0x2 0x0 /* ENET1_CRS */ | ||
517 | 0x0 0x10 0x2 0x0 0x2 0x0>; /* ENET1_COL */ | ||
518 | }; | ||
519 | |||
520 | pio2: ucc_pin@02 { | ||
521 | pio-map = < | ||
522 | /* port pin dir open_drain assignment has_irq */ | ||
523 | 0x1 0x13 0x1 0x0 0x1 0x0 /* QE_MUX_MDC */ | ||
524 | 0x1 0x14 0x3 0x0 0x1 0x0 /* QE_MUX_MDIO */ | ||
525 | 0x1 0xb 0x2 0x0 0x1 0x0 /* CLK13 */ | ||
526 | 0x1 0x7 0x1 0x0 0x2 0x0 /* ENET5_TXD0_SER5_TXD0 */ | ||
527 | 0x1 0xa 0x1 0x0 0x2 0x0 /* ENET5_TXD1_SER5_TXD1 */ | ||
528 | 0x1 0x6 0x2 0x0 0x2 0x0 /* ENET5_RXD0_SER5_RXD0 */ | ||
529 | 0x1 0x9 0x2 0x0 0x2 0x0 /* ENET5_RXD1_SER5_RXD1 */ | ||
530 | 0x1 0x5 0x1 0x0 0x2 0x0 /* ENET5_TX_EN_SER5_RTS_B */ | ||
531 | 0x1 0x4 0x2 0x0 0x2 0x0 /* ENET5_RX_DV_SER5_CTS_B */ | ||
532 | 0x1 0x8 0x2 0x0 0x2 0x0>; /* ENET5_RX_ER_SER5_CD_B */ | ||
533 | }; | ||
534 | }; | ||
535 | }; | ||
536 | |||
537 | pci0: pcie@ffe09000 { | ||
538 | compatible = "fsl,mpc8548-pcie"; | ||
539 | device_type = "pci"; | ||
540 | #interrupt-cells = <1>; | ||
541 | #size-cells = <2>; | ||
542 | #address-cells = <3>; | ||
543 | reg = <0 0xffe09000 0 0x1000>; | ||
544 | bus-range = <0 255>; | ||
545 | ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 | ||
546 | 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; | ||
547 | clock-frequency = <33333333>; | ||
548 | interrupt-parent = <&mpic>; | ||
549 | interrupts = <16 2>; | ||
550 | interrupt-map-mask = <0xf800 0 0 7>; | ||
551 | interrupt-map = < | ||
552 | /* IDSEL 0x0 */ | ||
553 | 0000 0 0 1 &mpic 4 1 | ||
554 | 0000 0 0 2 &mpic 5 1 | ||
555 | 0000 0 0 3 &mpic 6 1 | ||
556 | 0000 0 0 4 &mpic 7 1 | ||
557 | >; | ||
558 | pcie@0 { | ||
559 | reg = <0x0 0x0 0x0 0x0 0x0>; | ||
560 | #size-cells = <2>; | ||
561 | #address-cells = <3>; | ||
562 | device_type = "pci"; | ||
563 | ranges = <0x2000000 0x0 0xa0000000 | ||
564 | 0x2000000 0x0 0xa0000000 | ||
565 | 0x0 0x20000000 | ||
566 | |||
567 | 0x1000000 0x0 0x0 | ||
568 | 0x1000000 0x0 0x0 | ||
569 | 0x0 0x100000>; | ||
570 | }; | ||
571 | }; | ||
572 | |||
573 | pci1: pcie@ffe0a000 { | ||
574 | compatible = "fsl,mpc8548-pcie"; | ||
575 | device_type = "pci"; | ||
576 | #interrupt-cells = <1>; | ||
577 | #size-cells = <2>; | ||
578 | #address-cells = <3>; | ||
579 | reg = <0 0xffe0a000 0 0x1000>; | ||
580 | bus-range = <0 255>; | ||
581 | ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 | ||
582 | 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; | ||
583 | clock-frequency = <33333333>; | ||
584 | interrupt-parent = <&mpic>; | ||
585 | interrupts = <16 2>; | ||
586 | interrupt-map-mask = <0xf800 0 0 7>; | ||
587 | interrupt-map = < | ||
588 | /* IDSEL 0x0 */ | ||
589 | 0000 0 0 1 &mpic 0 1 | ||
590 | 0000 0 0 2 &mpic 1 1 | ||
591 | 0000 0 0 3 &mpic 2 1 | ||
592 | 0000 0 0 4 &mpic 3 1 | ||
593 | >; | ||
594 | pcie@0 { | ||
595 | reg = <0x0 0x0 0x0 0x0 0x0>; | ||
596 | #size-cells = <2>; | ||
597 | #address-cells = <3>; | ||
598 | device_type = "pci"; | ||
599 | ranges = <0x2000000 0x0 0xc0000000 | ||
600 | 0x2000000 0x0 0xc0000000 | ||
601 | 0x0 0x20000000 | ||
602 | |||
603 | 0x1000000 0x0 0x0 | ||
604 | 0x1000000 0x0 0x0 | ||
605 | 0x0 0x100000>; | ||
606 | }; | ||
607 | }; | ||
608 | |||
609 | qe@ffe80000 { | ||
610 | #address-cells = <1>; | ||
611 | #size-cells = <1>; | ||
612 | device_type = "qe"; | ||
613 | compatible = "fsl,qe"; | ||
614 | ranges = <0x0 0x0 0xffe80000 0x40000>; | ||
615 | reg = <0 0xffe80000 0 0x480>; | ||
616 | brg-frequency = <0>; | ||
617 | bus-frequency = <0>; | ||
618 | fsl,qe-num-riscs = <1>; | ||
619 | fsl,qe-num-snums = <28>; | ||
620 | |||
621 | qeic: interrupt-controller@80 { | ||
622 | interrupt-controller; | ||
623 | compatible = "fsl,qe-ic"; | ||
624 | #address-cells = <0>; | ||
625 | #interrupt-cells = <1>; | ||
626 | reg = <0x80 0x80>; | ||
627 | interrupts = <63 2 60 2>; //high:47 low:44 | ||
628 | interrupt-parent = <&mpic>; | ||
629 | }; | ||
630 | |||
631 | enet3: ucc@2000 { | ||
632 | device_type = "network"; | ||
633 | compatible = "ucc_geth"; | ||
634 | cell-index = <1>; | ||
635 | reg = <0x2000 0x200>; | ||
636 | interrupts = <32>; | ||
637 | interrupt-parent = <&qeic>; | ||
638 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
639 | rx-clock-name = "clk12"; | ||
640 | tx-clock-name = "clk9"; | ||
641 | pio-handle = <&pio1>; | ||
642 | phy-handle = <&qe_phy0>; | ||
643 | phy-connection-type = "mii"; | ||
644 | }; | ||
645 | |||
646 | mdio@2120 { | ||
647 | #address-cells = <1>; | ||
648 | #size-cells = <0>; | ||
649 | reg = <0x2120 0x18>; | ||
650 | compatible = "fsl,ucc-mdio"; | ||
651 | |||
652 | qe_phy0: ethernet-phy@0 { | ||
653 | interrupt-parent = <&mpic>; | ||
654 | interrupts = <4 1>; | ||
655 | reg = <0x0>; | ||
656 | device_type = "ethernet-phy"; | ||
657 | }; | ||
658 | qe_phy1: ethernet-phy@03 { | ||
659 | interrupt-parent = <&mpic>; | ||
660 | interrupts = <5 1>; | ||
661 | reg = <0x3>; | ||
662 | device_type = "ethernet-phy"; | ||
663 | }; | ||
664 | tbi-phy@11 { | ||
665 | reg = <0x11>; | ||
666 | device_type = "tbi-phy"; | ||
667 | }; | ||
668 | }; | ||
669 | |||
670 | enet4: ucc@2400 { | ||
671 | device_type = "network"; | ||
672 | compatible = "ucc_geth"; | ||
673 | cell-index = <5>; | ||
674 | reg = <0x2400 0x200>; | ||
675 | interrupts = <40>; | ||
676 | interrupt-parent = <&qeic>; | ||
677 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
678 | rx-clock-name = "none"; | ||
679 | tx-clock-name = "clk13"; | ||
680 | pio-handle = <&pio2>; | ||
681 | phy-handle = <&qe_phy1>; | ||
682 | phy-connection-type = "rmii"; | ||
683 | }; | ||
684 | |||
685 | muram@10000 { | ||
686 | #address-cells = <1>; | ||
687 | #size-cells = <1>; | ||
688 | compatible = "fsl,qe-muram", "fsl,cpm-muram"; | ||
689 | ranges = <0x0 0x10000 0x6000>; | ||
690 | |||
691 | data-only@0 { | ||
692 | compatible = "fsl,qe-muram-data", | ||
693 | "fsl,cpm-muram-data"; | ||
694 | reg = <0x0 0x6000>; | ||
695 | }; | ||
696 | }; | ||
697 | }; | ||
698 | }; | ||
diff --git a/arch/powerpc/boot/dts/redwood.dts b/arch/powerpc/boot/dts/redwood.dts index d2af32e2bf7a..81636c01d906 100644 --- a/arch/powerpc/boot/dts/redwood.dts +++ b/arch/powerpc/boot/dts/redwood.dts | |||
@@ -234,10 +234,132 @@ | |||
234 | has-inverted-stacr-oc; | 234 | has-inverted-stacr-oc; |
235 | has-new-stacr-staopc; | 235 | has-new-stacr-staopc; |
236 | }; | 236 | }; |
237 | }; | ||
238 | PCIE0: pciex@d00000000 { | ||
239 | device_type = "pci"; | ||
240 | #interrupt-cells = <1>; | ||
241 | #size-cells = <2>; | ||
242 | #address-cells = <3>; | ||
243 | compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex"; | ||
244 | primary; | ||
245 | port = <0x0>; /* port number */ | ||
246 | reg = <0x0000000d 0x00000000 0x20000000 /* Config space access */ | ||
247 | 0x0000000c 0x10000000 0x00001000>; /* Registers */ | ||
248 | dcr-reg = <0x100 0x020>; | ||
249 | sdr-base = <0x300>; | ||
250 | |||
251 | /* Outbound ranges, one memory and one IO, | ||
252 | * later cannot be changed | ||
253 | */ | ||
254 | ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000 | ||
255 | 0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>; | ||
256 | |||
257 | /* Inbound 2GB range starting at 0 */ | ||
258 | dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>; | ||
237 | 259 | ||
260 | /* This drives busses 10 to 0x1f */ | ||
261 | bus-range = <0x10 0x1f>; | ||
262 | |||
263 | /* Legacy interrupts (note the weird polarity, the bridge seems | ||
264 | * to invert PCIe legacy interrupts). | ||
265 | * We are de-swizzling here because the numbers are actually for | ||
266 | * port of the root complex virtual P2P bridge. But I want | ||
267 | * to avoid putting a node for it in the tree, so the numbers | ||
268 | * below are basically de-swizzled numbers. | ||
269 | * The real slot is on idsel 0, so the swizzling is 1:1 | ||
270 | */ | ||
271 | interrupt-map-mask = <0x0 0x0 0x0 0x7>; | ||
272 | interrupt-map = < | ||
273 | 0x0 0x0 0x0 0x1 &UIC3 0x0 0x4 /* swizzled int A */ | ||
274 | 0x0 0x0 0x0 0x2 &UIC3 0x1 0x4 /* swizzled int B */ | ||
275 | 0x0 0x0 0x0 0x3 &UIC3 0x2 0x4 /* swizzled int C */ | ||
276 | 0x0 0x0 0x0 0x4 &UIC3 0x3 0x4 /* swizzled int D */>; | ||
277 | }; | ||
278 | |||
279 | PCIE1: pciex@d20000000 { | ||
280 | device_type = "pci"; | ||
281 | #interrupt-cells = <1>; | ||
282 | #size-cells = <2>; | ||
283 | #address-cells = <3>; | ||
284 | compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex"; | ||
285 | primary; | ||
286 | port = <0x1>; /* port number */ | ||
287 | reg = <0x0000000d 0x20000000 0x20000000 /* Config space access */ | ||
288 | 0x0000000c 0x10001000 0x00001000>; /* Registers */ | ||
289 | dcr-reg = <0x120 0x020>; | ||
290 | sdr-base = <0x340>; | ||
291 | |||
292 | /* Outbound ranges, one memory and one IO, | ||
293 | * later cannot be changed | ||
294 | */ | ||
295 | ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000 | ||
296 | 0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>; | ||
297 | |||
298 | /* Inbound 2GB range starting at 0 */ | ||
299 | dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>; | ||
300 | |||
301 | /* This drives busses 10 to 0x1f */ | ||
302 | bus-range = <0x20 0x2f>; | ||
303 | |||
304 | /* Legacy interrupts (note the weird polarity, the bridge seems | ||
305 | * to invert PCIe legacy interrupts). | ||
306 | * We are de-swizzling here because the numbers are actually for | ||
307 | * port of the root complex virtual P2P bridge. But I want | ||
308 | * to avoid putting a node for it in the tree, so the numbers | ||
309 | * below are basically de-swizzled numbers. | ||
310 | * The real slot is on idsel 0, so the swizzling is 1:1 | ||
311 | */ | ||
312 | interrupt-map-mask = <0x0 0x0 0x0 0x7>; | ||
313 | interrupt-map = < | ||
314 | 0x0 0x0 0x0 0x1 &UIC3 0x4 0x4 /* swizzled int A */ | ||
315 | 0x0 0x0 0x0 0x2 &UIC3 0x5 0x4 /* swizzled int B */ | ||
316 | 0x0 0x0 0x0 0x3 &UIC3 0x6 0x4 /* swizzled int C */ | ||
317 | 0x0 0x0 0x0 0x4 &UIC3 0x7 0x4 /* swizzled int D */>; | ||
318 | }; | ||
319 | |||
320 | PCIE2: pciex@d40000000 { | ||
321 | device_type = "pci"; | ||
322 | #interrupt-cells = <1>; | ||
323 | #size-cells = <2>; | ||
324 | #address-cells = <3>; | ||
325 | compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex"; | ||
326 | primary; | ||
327 | port = <0x2>; /* port number */ | ||
328 | reg = <0x0000000d 0x40000000 0x20000000 /* Config space access */ | ||
329 | 0x0000000c 0x10002000 0x00001000>; /* Registers */ | ||
330 | dcr-reg = <0x140 0x020>; | ||
331 | sdr-base = <0x370>; | ||
332 | |||
333 | /* Outbound ranges, one memory and one IO, | ||
334 | * later cannot be changed | ||
335 | */ | ||
336 | ranges = <0x02000000 0x00000000 0x80000000 0x0000000f 0x00000000 0x00000000 0x80000000 | ||
337 | 0x01000000 0x00000000 0x00000000 0x0000000f 0x80020000 0x00000000 0x00010000>; | ||
338 | |||
339 | /* Inbound 2GB range starting at 0 */ | ||
340 | dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>; | ||
341 | |||
342 | /* This drives busses 10 to 0x1f */ | ||
343 | bus-range = <0x30 0x3f>; | ||
344 | |||
345 | /* Legacy interrupts (note the weird polarity, the bridge seems | ||
346 | * to invert PCIe legacy interrupts). | ||
347 | * We are de-swizzling here because the numbers are actually for | ||
348 | * port of the root complex virtual P2P bridge. But I want | ||
349 | * to avoid putting a node for it in the tree, so the numbers | ||
350 | * below are basically de-swizzled numbers. | ||
351 | * The real slot is on idsel 0, so the swizzling is 1:1 | ||
352 | */ | ||
353 | interrupt-map-mask = <0x0 0x0 0x0 0x7>; | ||
354 | interrupt-map = < | ||
355 | 0x0 0x0 0x0 0x1 &UIC3 0x8 0x4 /* swizzled int A */ | ||
356 | 0x0 0x0 0x0 0x2 &UIC3 0x9 0x4 /* swizzled int B */ | ||
357 | 0x0 0x0 0x0 0x3 &UIC3 0xa 0x4 /* swizzled int C */ | ||
358 | 0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /* swizzled int D */>; | ||
238 | }; | 359 | }; |
239 | 360 | ||
240 | }; | 361 | }; |
362 | |||
241 | chosen { | 363 | chosen { |
242 | linux,stdout-path = "/plb/opb/serial@ef600200"; | 364 | linux,stdout-path = "/plb/opb/serial@ef600200"; |
243 | }; | 365 | }; |
diff --git a/arch/powerpc/configs/44x/icon_defconfig b/arch/powerpc/configs/44x/icon_defconfig new file mode 100644 index 000000000000..277f88c2750f --- /dev/null +++ b/arch/powerpc/configs/44x/icon_defconfig | |||
@@ -0,0 +1,1451 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.34-rc7 | ||
4 | # Fri May 21 17:40:22 2010 | ||
5 | # | ||
6 | # CONFIG_PPC64 is not set | ||
7 | |||
8 | # | ||
9 | # Processor support | ||
10 | # | ||
11 | # CONFIG_PPC_BOOK3S_32 is not set | ||
12 | # CONFIG_PPC_85xx is not set | ||
13 | # CONFIG_PPC_8xx is not set | ||
14 | # CONFIG_40x is not set | ||
15 | CONFIG_44x=y | ||
16 | # CONFIG_E200 is not set | ||
17 | CONFIG_4xx=y | ||
18 | CONFIG_BOOKE=y | ||
19 | CONFIG_PTE_64BIT=y | ||
20 | CONFIG_PHYS_64BIT=y | ||
21 | CONFIG_PPC_MMU_NOHASH=y | ||
22 | CONFIG_PPC_MMU_NOHASH_32=y | ||
23 | # CONFIG_PPC_MM_SLICES is not set | ||
24 | CONFIG_NOT_COHERENT_CACHE=y | ||
25 | CONFIG_PPC32=y | ||
26 | CONFIG_WORD_SIZE=32 | ||
27 | CONFIG_ARCH_PHYS_ADDR_T_64BIT=y | ||
28 | CONFIG_MMU=y | ||
29 | CONFIG_GENERIC_CMOS_UPDATE=y | ||
30 | CONFIG_GENERIC_TIME=y | ||
31 | CONFIG_GENERIC_TIME_VSYSCALL=y | ||
32 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
33 | CONFIG_GENERIC_HARDIRQS=y | ||
34 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
35 | # CONFIG_HAVE_SETUP_PER_CPU_AREA is not set | ||
36 | # CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set | ||
37 | CONFIG_IRQ_PER_CPU=y | ||
38 | CONFIG_NR_IRQS=512 | ||
39 | CONFIG_STACKTRACE_SUPPORT=y | ||
40 | CONFIG_HAVE_LATENCYTOP_SUPPORT=y | ||
41 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
42 | CONFIG_LOCKDEP_SUPPORT=y | ||
43 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | ||
44 | CONFIG_ARCH_HAS_ILOG2_U32=y | ||
45 | CONFIG_GENERIC_HWEIGHT=y | ||
46 | CONFIG_GENERIC_FIND_NEXT_BIT=y | ||
47 | # CONFIG_ARCH_NO_VIRT_TO_BUS is not set | ||
48 | CONFIG_PPC=y | ||
49 | CONFIG_EARLY_PRINTK=y | ||
50 | CONFIG_GENERIC_NVRAM=y | ||
51 | CONFIG_SCHED_OMIT_FRAME_POINTER=y | ||
52 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | ||
53 | CONFIG_PPC_OF=y | ||
54 | CONFIG_OF=y | ||
55 | CONFIG_PPC_UDBG_16550=y | ||
56 | # CONFIG_GENERIC_TBSYNC is not set | ||
57 | CONFIG_AUDIT_ARCH=y | ||
58 | CONFIG_GENERIC_BUG=y | ||
59 | CONFIG_DTC=y | ||
60 | # CONFIG_DEFAULT_UIMAGE is not set | ||
61 | CONFIG_ARCH_HIBERNATION_POSSIBLE=y | ||
62 | CONFIG_PPC_DCR_NATIVE=y | ||
63 | # CONFIG_PPC_DCR_MMIO is not set | ||
64 | CONFIG_PPC_DCR=y | ||
65 | CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y | ||
66 | CONFIG_PPC_ADV_DEBUG_REGS=y | ||
67 | CONFIG_PPC_ADV_DEBUG_IACS=4 | ||
68 | CONFIG_PPC_ADV_DEBUG_DACS=2 | ||
69 | CONFIG_PPC_ADV_DEBUG_DVCS=2 | ||
70 | CONFIG_PPC_ADV_DEBUG_DAC_RANGE=y | ||
71 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
72 | CONFIG_CONSTRUCTORS=y | ||
73 | |||
74 | # | ||
75 | # General setup | ||
76 | # | ||
77 | CONFIG_EXPERIMENTAL=y | ||
78 | CONFIG_BROKEN_ON_SMP=y | ||
79 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
80 | CONFIG_LOCALVERSION="" | ||
81 | CONFIG_LOCALVERSION_AUTO=y | ||
82 | CONFIG_SWAP=y | ||
83 | CONFIG_SYSVIPC=y | ||
84 | CONFIG_SYSVIPC_SYSCTL=y | ||
85 | CONFIG_POSIX_MQUEUE=y | ||
86 | CONFIG_POSIX_MQUEUE_SYSCTL=y | ||
87 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
88 | # CONFIG_TASKSTATS is not set | ||
89 | # CONFIG_AUDIT is not set | ||
90 | |||
91 | # | ||
92 | # RCU Subsystem | ||
93 | # | ||
94 | CONFIG_TREE_RCU=y | ||
95 | # CONFIG_TREE_PREEMPT_RCU is not set | ||
96 | # CONFIG_TINY_RCU is not set | ||
97 | # CONFIG_RCU_TRACE is not set | ||
98 | CONFIG_RCU_FANOUT=32 | ||
99 | # CONFIG_RCU_FANOUT_EXACT is not set | ||
100 | # CONFIG_TREE_RCU_TRACE is not set | ||
101 | # CONFIG_IKCONFIG is not set | ||
102 | CONFIG_LOG_BUF_SHIFT=14 | ||
103 | # CONFIG_CGROUPS is not set | ||
104 | CONFIG_SYSFS_DEPRECATED=y | ||
105 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
106 | # CONFIG_RELAY is not set | ||
107 | # CONFIG_NAMESPACES is not set | ||
108 | CONFIG_BLK_DEV_INITRD=y | ||
109 | CONFIG_INITRAMFS_SOURCE="" | ||
110 | CONFIG_RD_GZIP=y | ||
111 | # CONFIG_RD_BZIP2 is not set | ||
112 | # CONFIG_RD_LZMA is not set | ||
113 | # CONFIG_RD_LZO is not set | ||
114 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
115 | CONFIG_SYSCTL=y | ||
116 | CONFIG_ANON_INODES=y | ||
117 | CONFIG_EMBEDDED=y | ||
118 | CONFIG_SYSCTL_SYSCALL=y | ||
119 | CONFIG_KALLSYMS=y | ||
120 | # CONFIG_KALLSYMS_ALL is not set | ||
121 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
122 | CONFIG_HOTPLUG=y | ||
123 | CONFIG_PRINTK=y | ||
124 | # CONFIG_LOGBUFFER is not set | ||
125 | CONFIG_BUG=y | ||
126 | CONFIG_ELF_CORE=y | ||
127 | CONFIG_BASE_FULL=y | ||
128 | CONFIG_FUTEX=y | ||
129 | CONFIG_EPOLL=y | ||
130 | CONFIG_SIGNALFD=y | ||
131 | CONFIG_TIMERFD=y | ||
132 | CONFIG_EVENTFD=y | ||
133 | CONFIG_SHMEM=y | ||
134 | CONFIG_AIO=y | ||
135 | CONFIG_HAVE_PERF_EVENTS=y | ||
136 | |||
137 | # | ||
138 | # Kernel Performance Events And Counters | ||
139 | # | ||
140 | # CONFIG_PERF_EVENTS is not set | ||
141 | # CONFIG_PERF_COUNTERS is not set | ||
142 | CONFIG_VM_EVENT_COUNTERS=y | ||
143 | CONFIG_PCI_QUIRKS=y | ||
144 | CONFIG_SLUB_DEBUG=y | ||
145 | CONFIG_COMPAT_BRK=y | ||
146 | # CONFIG_SLAB is not set | ||
147 | CONFIG_SLUB=y | ||
148 | # CONFIG_SLOB is not set | ||
149 | # CONFIG_PROFILING is not set | ||
150 | CONFIG_HAVE_OPROFILE=y | ||
151 | # CONFIG_KPROBES is not set | ||
152 | CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y | ||
153 | CONFIG_HAVE_IOREMAP_PROT=y | ||
154 | CONFIG_HAVE_KPROBES=y | ||
155 | CONFIG_HAVE_KRETPROBES=y | ||
156 | CONFIG_HAVE_ARCH_TRACEHOOK=y | ||
157 | CONFIG_HAVE_DMA_ATTRS=y | ||
158 | CONFIG_HAVE_DMA_API_DEBUG=y | ||
159 | |||
160 | # | ||
161 | # GCOV-based kernel profiling | ||
162 | # | ||
163 | # CONFIG_SLOW_WORK is not set | ||
164 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
165 | CONFIG_SLABINFO=y | ||
166 | CONFIG_RT_MUTEXES=y | ||
167 | CONFIG_BASE_SMALL=0 | ||
168 | CONFIG_MODULES=y | ||
169 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
170 | CONFIG_MODULE_UNLOAD=y | ||
171 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
172 | # CONFIG_MODVERSIONS is not set | ||
173 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
174 | CONFIG_BLOCK=y | ||
175 | CONFIG_LBDAF=y | ||
176 | # CONFIG_BLK_DEV_BSG is not set | ||
177 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
178 | |||
179 | # | ||
180 | # IO Schedulers | ||
181 | # | ||
182 | CONFIG_IOSCHED_NOOP=y | ||
183 | CONFIG_IOSCHED_DEADLINE=y | ||
184 | CONFIG_IOSCHED_CFQ=y | ||
185 | # CONFIG_DEFAULT_DEADLINE is not set | ||
186 | CONFIG_DEFAULT_CFQ=y | ||
187 | # CONFIG_DEFAULT_NOOP is not set | ||
188 | CONFIG_DEFAULT_IOSCHED="cfq" | ||
189 | # CONFIG_INLINE_SPIN_TRYLOCK is not set | ||
190 | # CONFIG_INLINE_SPIN_TRYLOCK_BH is not set | ||
191 | # CONFIG_INLINE_SPIN_LOCK is not set | ||
192 | # CONFIG_INLINE_SPIN_LOCK_BH is not set | ||
193 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set | ||
194 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set | ||
195 | CONFIG_INLINE_SPIN_UNLOCK=y | ||
196 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set | ||
197 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y | ||
198 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set | ||
199 | # CONFIG_INLINE_READ_TRYLOCK is not set | ||
200 | # CONFIG_INLINE_READ_LOCK is not set | ||
201 | # CONFIG_INLINE_READ_LOCK_BH is not set | ||
202 | # CONFIG_INLINE_READ_LOCK_IRQ is not set | ||
203 | # CONFIG_INLINE_READ_LOCK_IRQSAVE is not set | ||
204 | CONFIG_INLINE_READ_UNLOCK=y | ||
205 | # CONFIG_INLINE_READ_UNLOCK_BH is not set | ||
206 | CONFIG_INLINE_READ_UNLOCK_IRQ=y | ||
207 | # CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set | ||
208 | # CONFIG_INLINE_WRITE_TRYLOCK is not set | ||
209 | # CONFIG_INLINE_WRITE_LOCK is not set | ||
210 | # CONFIG_INLINE_WRITE_LOCK_BH is not set | ||
211 | # CONFIG_INLINE_WRITE_LOCK_IRQ is not set | ||
212 | # CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set | ||
213 | CONFIG_INLINE_WRITE_UNLOCK=y | ||
214 | # CONFIG_INLINE_WRITE_UNLOCK_BH is not set | ||
215 | CONFIG_INLINE_WRITE_UNLOCK_IRQ=y | ||
216 | # CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set | ||
217 | # CONFIG_MUTEX_SPIN_ON_OWNER is not set | ||
218 | # CONFIG_FREEZER is not set | ||
219 | CONFIG_PPC4xx_PCI_EXPRESS=y | ||
220 | |||
221 | # | ||
222 | # Platform support | ||
223 | # | ||
224 | # CONFIG_PPC_CELL is not set | ||
225 | # CONFIG_PPC_CELL_NATIVE is not set | ||
226 | # CONFIG_PQ2ADS is not set | ||
227 | # CONFIG_BAMBOO is not set | ||
228 | # CONFIG_EBONY is not set | ||
229 | # CONFIG_SAM440EP is not set | ||
230 | # CONFIG_SEQUOIA is not set | ||
231 | # CONFIG_TAISHAN is not set | ||
232 | # CONFIG_KATMAI is not set | ||
233 | # CONFIG_RAINIER is not set | ||
234 | # CONFIG_WARP is not set | ||
235 | # CONFIG_ARCHES is not set | ||
236 | # CONFIG_CANYONLANDS is not set | ||
237 | # CONFIG_GLACIER is not set | ||
238 | # CONFIG_REDWOOD is not set | ||
239 | # CONFIG_EIGER is not set | ||
240 | # CONFIG_YOSEMITE is not set | ||
241 | CONFIG_ICON=y | ||
242 | # CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set | ||
243 | CONFIG_PPC44x_SIMPLE=y | ||
244 | # CONFIG_PPC4xx_GPIO is not set | ||
245 | CONFIG_440SPe=y | ||
246 | CONFIG_STDBINUTILS=y | ||
247 | # CONFIG_IPIC is not set | ||
248 | # CONFIG_MPIC is not set | ||
249 | # CONFIG_MPIC_WEIRD is not set | ||
250 | # CONFIG_PPC_I8259 is not set | ||
251 | # CONFIG_PPC_RTAS is not set | ||
252 | # CONFIG_MMIO_NVRAM is not set | ||
253 | # CONFIG_PPC_MPC106 is not set | ||
254 | # CONFIG_PPC_970_NAP is not set | ||
255 | # CONFIG_PPC_INDIRECT_IO is not set | ||
256 | # CONFIG_GENERIC_IOMAP is not set | ||
257 | # CONFIG_CPU_FREQ is not set | ||
258 | # CONFIG_FSL_ULI1575 is not set | ||
259 | # CONFIG_SIMPLE_GPIO is not set | ||
260 | |||
261 | # | ||
262 | # Kernel options | ||
263 | # | ||
264 | CONFIG_HIGHMEM=y | ||
265 | # CONFIG_NO_HZ is not set | ||
266 | # CONFIG_HIGH_RES_TIMERS is not set | ||
267 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
268 | # CONFIG_HZ_100 is not set | ||
269 | CONFIG_HZ_250=y | ||
270 | # CONFIG_HZ_300 is not set | ||
271 | # CONFIG_HZ_1000 is not set | ||
272 | CONFIG_HZ=250 | ||
273 | # CONFIG_SCHED_HRTICK is not set | ||
274 | CONFIG_PREEMPT_NONE=y | ||
275 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
276 | # CONFIG_PREEMPT is not set | ||
277 | CONFIG_BINFMT_ELF=y | ||
278 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
279 | # CONFIG_HAVE_AOUT is not set | ||
280 | # CONFIG_BINFMT_MISC is not set | ||
281 | # CONFIG_MATH_EMULATION is not set | ||
282 | # CONFIG_IOMMU_HELPER is not set | ||
283 | # CONFIG_SWIOTLB is not set | ||
284 | CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y | ||
285 | CONFIG_ARCH_HAS_WALK_MEMORY=y | ||
286 | CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y | ||
287 | CONFIG_SPARSE_IRQ=y | ||
288 | CONFIG_MAX_ACTIVE_REGIONS=32 | ||
289 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
290 | CONFIG_ARCH_POPULATES_NODE_MAP=y | ||
291 | CONFIG_SELECT_MEMORY_MODEL=y | ||
292 | CONFIG_FLATMEM_MANUAL=y | ||
293 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
294 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
295 | CONFIG_FLATMEM=y | ||
296 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
297 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
298 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
299 | CONFIG_MIGRATION=y | ||
300 | CONFIG_PHYS_ADDR_T_64BIT=y | ||
301 | CONFIG_ZONE_DMA_FLAG=1 | ||
302 | CONFIG_BOUNCE=y | ||
303 | CONFIG_VIRT_TO_BUS=y | ||
304 | # CONFIG_KSM is not set | ||
305 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
306 | CONFIG_PPC_4K_PAGES=y | ||
307 | # CONFIG_PPC_16K_PAGES is not set | ||
308 | # CONFIG_PPC_64K_PAGES is not set | ||
309 | # CONFIG_PPC_256K_PAGES is not set | ||
310 | CONFIG_FORCE_MAX_ZONEORDER=11 | ||
311 | CONFIG_PROC_DEVICETREE=y | ||
312 | CONFIG_CMDLINE_BOOL=y | ||
313 | CONFIG_CMDLINE="" | ||
314 | CONFIG_EXTRA_TARGETS="" | ||
315 | # CONFIG_ARCH_HAS_NMI_WATCHDOG is not set | ||
316 | CONFIG_SECCOMP=y | ||
317 | CONFIG_ISA_DMA_API=y | ||
318 | |||
319 | # | ||
320 | # Bus options | ||
321 | # | ||
322 | CONFIG_ZONE_DMA=y | ||
323 | CONFIG_NEED_DMA_MAP_STATE=y | ||
324 | CONFIG_PPC_INDIRECT_PCI=y | ||
325 | CONFIG_4xx_SOC=y | ||
326 | CONFIG_PPC_PCI_CHOICE=y | ||
327 | CONFIG_PCI=y | ||
328 | CONFIG_PCI_DOMAINS=y | ||
329 | CONFIG_PCI_SYSCALL=y | ||
330 | CONFIG_PCIEPORTBUS=y | ||
331 | CONFIG_PCIEAER=y | ||
332 | # CONFIG_PCIE_ECRC is not set | ||
333 | # CONFIG_PCIEAER_INJECT is not set | ||
334 | # CONFIG_PCIEASPM is not set | ||
335 | CONFIG_ARCH_SUPPORTS_MSI=y | ||
336 | # CONFIG_PCI_MSI is not set | ||
337 | # CONFIG_PCI_DEBUG is not set | ||
338 | # CONFIG_PCI_STUB is not set | ||
339 | # CONFIG_PCI_IOV is not set | ||
340 | # CONFIG_PCCARD is not set | ||
341 | # CONFIG_HOTPLUG_PCI is not set | ||
342 | # CONFIG_HAS_RAPIDIO is not set | ||
343 | |||
344 | # | ||
345 | # Advanced setup | ||
346 | # | ||
347 | # CONFIG_ADVANCED_OPTIONS is not set | ||
348 | |||
349 | # | ||
350 | # Default settings for advanced configuration options are used | ||
351 | # | ||
352 | CONFIG_LOWMEM_SIZE=0x30000000 | ||
353 | CONFIG_PAGE_OFFSET=0xc0000000 | ||
354 | CONFIG_KERNEL_START=0xc0000000 | ||
355 | CONFIG_PHYSICAL_START=0x00000000 | ||
356 | CONFIG_TASK_SIZE=0xc0000000 | ||
357 | CONFIG_CONSISTENT_SIZE=0x00200000 | ||
358 | CONFIG_NET=y | ||
359 | |||
360 | # | ||
361 | # Networking options | ||
362 | # | ||
363 | CONFIG_PACKET=y | ||
364 | CONFIG_UNIX=y | ||
365 | # CONFIG_NET_KEY is not set | ||
366 | CONFIG_INET=y | ||
367 | # CONFIG_IP_MULTICAST is not set | ||
368 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
369 | CONFIG_IP_FIB_HASH=y | ||
370 | CONFIG_IP_PNP=y | ||
371 | CONFIG_IP_PNP_DHCP=y | ||
372 | CONFIG_IP_PNP_BOOTP=y | ||
373 | # CONFIG_IP_PNP_RARP is not set | ||
374 | # CONFIG_NET_IPIP is not set | ||
375 | # CONFIG_NET_IPGRE is not set | ||
376 | # CONFIG_ARPD is not set | ||
377 | # CONFIG_SYN_COOKIES is not set | ||
378 | # CONFIG_INET_AH is not set | ||
379 | # CONFIG_INET_ESP is not set | ||
380 | # CONFIG_INET_IPCOMP is not set | ||
381 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
382 | # CONFIG_INET_TUNNEL is not set | ||
383 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
384 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
385 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
386 | # CONFIG_INET_LRO is not set | ||
387 | CONFIG_INET_DIAG=y | ||
388 | CONFIG_INET_TCP_DIAG=y | ||
389 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
390 | CONFIG_TCP_CONG_CUBIC=y | ||
391 | CONFIG_DEFAULT_TCP_CONG="cubic" | ||
392 | # CONFIG_TCP_MD5SIG is not set | ||
393 | # CONFIG_IPV6 is not set | ||
394 | # CONFIG_NETWORK_SECMARK is not set | ||
395 | # CONFIG_NETFILTER is not set | ||
396 | # CONFIG_IP_DCCP is not set | ||
397 | # CONFIG_IP_SCTP is not set | ||
398 | # CONFIG_RDS is not set | ||
399 | # CONFIG_TIPC is not set | ||
400 | # CONFIG_ATM is not set | ||
401 | # CONFIG_BRIDGE is not set | ||
402 | # CONFIG_NET_DSA is not set | ||
403 | # CONFIG_VLAN_8021Q is not set | ||
404 | # CONFIG_DECNET is not set | ||
405 | # CONFIG_LLC2 is not set | ||
406 | # CONFIG_IPX is not set | ||
407 | # CONFIG_ATALK is not set | ||
408 | # CONFIG_X25 is not set | ||
409 | # CONFIG_LAPB is not set | ||
410 | # CONFIG_ECONET is not set | ||
411 | # CONFIG_WAN_ROUTER is not set | ||
412 | # CONFIG_PHONET is not set | ||
413 | # CONFIG_IEEE802154 is not set | ||
414 | # CONFIG_NET_SCHED is not set | ||
415 | # CONFIG_DCB is not set | ||
416 | |||
417 | # | ||
418 | # Network testing | ||
419 | # | ||
420 | # CONFIG_NET_PKTGEN is not set | ||
421 | # CONFIG_HAMRADIO is not set | ||
422 | # CONFIG_CAN is not set | ||
423 | # CONFIG_IRDA is not set | ||
424 | # CONFIG_BT is not set | ||
425 | # CONFIG_AF_RXRPC is not set | ||
426 | CONFIG_WIRELESS=y | ||
427 | # CONFIG_CFG80211 is not set | ||
428 | # CONFIG_LIB80211 is not set | ||
429 | |||
430 | # | ||
431 | # CFG80211 needs to be enabled for MAC80211 | ||
432 | # | ||
433 | # CONFIG_WIMAX is not set | ||
434 | # CONFIG_RFKILL is not set | ||
435 | # CONFIG_NET_9P is not set | ||
436 | |||
437 | # | ||
438 | # Device Drivers | ||
439 | # | ||
440 | |||
441 | # | ||
442 | # Generic Driver Options | ||
443 | # | ||
444 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
445 | # CONFIG_DEVTMPFS is not set | ||
446 | CONFIG_STANDALONE=y | ||
447 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
448 | CONFIG_FW_LOADER=y | ||
449 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
450 | CONFIG_EXTRA_FIRMWARE="" | ||
451 | # CONFIG_DEBUG_DRIVER is not set | ||
452 | # CONFIG_DEBUG_DEVRES is not set | ||
453 | # CONFIG_SYS_HYPERVISOR is not set | ||
454 | CONFIG_CONNECTOR=y | ||
455 | CONFIG_PROC_EVENTS=y | ||
456 | CONFIG_MTD=y | ||
457 | # CONFIG_MTD_DEBUG is not set | ||
458 | # CONFIG_MTD_TESTS is not set | ||
459 | # CONFIG_MTD_CONCAT is not set | ||
460 | CONFIG_MTD_PARTITIONS=y | ||
461 | # CONFIG_MTD_REDBOOT_PARTS is not set | ||
462 | CONFIG_MTD_CMDLINE_PARTS=y | ||
463 | CONFIG_MTD_OF_PARTS=y | ||
464 | # CONFIG_MTD_AR7_PARTS is not set | ||
465 | |||
466 | # | ||
467 | # User Modules And Translation Layers | ||
468 | # | ||
469 | CONFIG_MTD_CHAR=y | ||
470 | CONFIG_MTD_BLKDEVS=y | ||
471 | CONFIG_MTD_BLOCK=y | ||
472 | # CONFIG_FTL is not set | ||
473 | # CONFIG_NFTL is not set | ||
474 | # CONFIG_INFTL is not set | ||
475 | # CONFIG_RFD_FTL is not set | ||
476 | # CONFIG_SSFDC is not set | ||
477 | # CONFIG_MTD_OOPS is not set | ||
478 | |||
479 | # | ||
480 | # RAM/ROM/Flash chip drivers | ||
481 | # | ||
482 | CONFIG_MTD_CFI=y | ||
483 | # CONFIG_MTD_JEDECPROBE is not set | ||
484 | CONFIG_MTD_GEN_PROBE=y | ||
485 | # CONFIG_MTD_CFI_ADV_OPTIONS is not set | ||
486 | CONFIG_MTD_MAP_BANK_WIDTH_1=y | ||
487 | CONFIG_MTD_MAP_BANK_WIDTH_2=y | ||
488 | CONFIG_MTD_MAP_BANK_WIDTH_4=y | ||
489 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | ||
490 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | ||
491 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | ||
492 | CONFIG_MTD_CFI_I1=y | ||
493 | CONFIG_MTD_CFI_I2=y | ||
494 | # CONFIG_MTD_CFI_I4 is not set | ||
495 | # CONFIG_MTD_CFI_I8 is not set | ||
496 | # CONFIG_MTD_CFI_INTELEXT is not set | ||
497 | CONFIG_MTD_CFI_AMDSTD=y | ||
498 | # CONFIG_MTD_CFI_STAA is not set | ||
499 | CONFIG_MTD_CFI_UTIL=y | ||
500 | # CONFIG_MTD_RAM is not set | ||
501 | # CONFIG_MTD_ROM is not set | ||
502 | # CONFIG_MTD_ABSENT is not set | ||
503 | |||
504 | # | ||
505 | # Mapping drivers for chip access | ||
506 | # | ||
507 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | ||
508 | # CONFIG_MTD_PHYSMAP is not set | ||
509 | CONFIG_MTD_PHYSMAP_OF=y | ||
510 | # CONFIG_MTD_INTEL_VR_NOR is not set | ||
511 | # CONFIG_MTD_PLATRAM is not set | ||
512 | |||
513 | # | ||
514 | # Self-contained MTD device drivers | ||
515 | # | ||
516 | # CONFIG_MTD_PMC551 is not set | ||
517 | # CONFIG_MTD_SLRAM is not set | ||
518 | # CONFIG_MTD_PHRAM is not set | ||
519 | # CONFIG_MTD_MTDRAM is not set | ||
520 | # CONFIG_MTD_BLOCK2MTD is not set | ||
521 | |||
522 | # | ||
523 | # Disk-On-Chip Device Drivers | ||
524 | # | ||
525 | # CONFIG_MTD_DOC2000 is not set | ||
526 | # CONFIG_MTD_DOC2001 is not set | ||
527 | # CONFIG_MTD_DOC2001PLUS is not set | ||
528 | # CONFIG_MTD_NAND is not set | ||
529 | # CONFIG_MTD_ONENAND is not set | ||
530 | |||
531 | # | ||
532 | # LPDDR flash memory drivers | ||
533 | # | ||
534 | # CONFIG_MTD_LPDDR is not set | ||
535 | |||
536 | # | ||
537 | # UBI - Unsorted block images | ||
538 | # | ||
539 | # CONFIG_MTD_UBI is not set | ||
540 | CONFIG_OF_FLATTREE=y | ||
541 | CONFIG_OF_DYNAMIC=y | ||
542 | CONFIG_OF_DEVICE=y | ||
543 | CONFIG_OF_I2C=y | ||
544 | # CONFIG_PARPORT is not set | ||
545 | CONFIG_BLK_DEV=y | ||
546 | # CONFIG_BLK_DEV_FD is not set | ||
547 | # CONFIG_BLK_CPQ_DA is not set | ||
548 | # CONFIG_BLK_CPQ_CISS_DA is not set | ||
549 | # CONFIG_BLK_DEV_DAC960 is not set | ||
550 | # CONFIG_BLK_DEV_UMEM is not set | ||
551 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
552 | # CONFIG_BLK_DEV_LOOP is not set | ||
553 | # CONFIG_BLK_DEV_DRBD is not set | ||
554 | # CONFIG_BLK_DEV_NBD is not set | ||
555 | # CONFIG_BLK_DEV_SX8 is not set | ||
556 | CONFIG_BLK_DEV_RAM=y | ||
557 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
558 | CONFIG_BLK_DEV_RAM_SIZE=35000 | ||
559 | # CONFIG_BLK_DEV_XIP is not set | ||
560 | # CONFIG_CDROM_PKTCDVD is not set | ||
561 | # CONFIG_ATA_OVER_ETH is not set | ||
562 | CONFIG_XILINX_SYSACE=y | ||
563 | # CONFIG_BLK_DEV_HD is not set | ||
564 | # CONFIG_MISC_DEVICES is not set | ||
565 | CONFIG_HAVE_IDE=y | ||
566 | # CONFIG_IDE is not set | ||
567 | |||
568 | # | ||
569 | # SCSI device support | ||
570 | # | ||
571 | CONFIG_SCSI_MOD=y | ||
572 | # CONFIG_RAID_ATTRS is not set | ||
573 | CONFIG_SCSI=y | ||
574 | CONFIG_SCSI_DMA=y | ||
575 | # CONFIG_SCSI_TGT is not set | ||
576 | # CONFIG_SCSI_NETLINK is not set | ||
577 | CONFIG_SCSI_PROC_FS=y | ||
578 | |||
579 | # | ||
580 | # SCSI support type (disk, tape, CD-ROM) | ||
581 | # | ||
582 | CONFIG_BLK_DEV_SD=y | ||
583 | # CONFIG_CHR_DEV_ST is not set | ||
584 | # CONFIG_CHR_DEV_OSST is not set | ||
585 | # CONFIG_BLK_DEV_SR is not set | ||
586 | # CONFIG_CHR_DEV_SG is not set | ||
587 | # CONFIG_CHR_DEV_SCH is not set | ||
588 | # CONFIG_SCSI_MULTI_LUN is not set | ||
589 | CONFIG_SCSI_CONSTANTS=y | ||
590 | CONFIG_SCSI_LOGGING=y | ||
591 | # CONFIG_SCSI_SCAN_ASYNC is not set | ||
592 | CONFIG_SCSI_WAIT_SCAN=m | ||
593 | |||
594 | # | ||
595 | # SCSI Transports | ||
596 | # | ||
597 | # CONFIG_SCSI_SPI_ATTRS is not set | ||
598 | # CONFIG_SCSI_FC_ATTRS is not set | ||
599 | # CONFIG_SCSI_ISCSI_ATTRS is not set | ||
600 | CONFIG_SCSI_SAS_ATTRS=y | ||
601 | # CONFIG_SCSI_SAS_LIBSAS is not set | ||
602 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
603 | # CONFIG_SCSI_LOWLEVEL is not set | ||
604 | # CONFIG_SCSI_DH is not set | ||
605 | # CONFIG_SCSI_OSD_INITIATOR is not set | ||
606 | # CONFIG_ATA is not set | ||
607 | # CONFIG_MD is not set | ||
608 | CONFIG_FUSION=y | ||
609 | # CONFIG_FUSION_SPI is not set | ||
610 | # CONFIG_FUSION_FC is not set | ||
611 | CONFIG_FUSION_SAS=y | ||
612 | CONFIG_FUSION_MAX_SGE=128 | ||
613 | CONFIG_FUSION_CTL=y | ||
614 | CONFIG_FUSION_LOGGING=y | ||
615 | |||
616 | # | ||
617 | # IEEE 1394 (FireWire) support | ||
618 | # | ||
619 | |||
620 | # | ||
621 | # You can enable one or both FireWire driver stacks. | ||
622 | # | ||
623 | |||
624 | # | ||
625 | # The newer stack is recommended. | ||
626 | # | ||
627 | # CONFIG_FIREWIRE is not set | ||
628 | # CONFIG_IEEE1394 is not set | ||
629 | # CONFIG_I2O is not set | ||
630 | # CONFIG_MACINTOSH_DRIVERS is not set | ||
631 | CONFIG_NETDEVICES=y | ||
632 | # CONFIG_DUMMY is not set | ||
633 | # CONFIG_BONDING is not set | ||
634 | # CONFIG_MACVLAN is not set | ||
635 | # CONFIG_EQUALIZER is not set | ||
636 | # CONFIG_TUN is not set | ||
637 | # CONFIG_VETH is not set | ||
638 | # CONFIG_ARCNET is not set | ||
639 | # CONFIG_PHYLIB is not set | ||
640 | CONFIG_NET_ETHERNET=y | ||
641 | # CONFIG_MII is not set | ||
642 | # CONFIG_HAPPYMEAL is not set | ||
643 | # CONFIG_SUNGEM is not set | ||
644 | # CONFIG_CASSINI is not set | ||
645 | # CONFIG_NET_VENDOR_3COM is not set | ||
646 | # CONFIG_ETHOC is not set | ||
647 | # CONFIG_DNET is not set | ||
648 | # CONFIG_NET_TULIP is not set | ||
649 | # CONFIG_HP100 is not set | ||
650 | CONFIG_IBM_NEW_EMAC=y | ||
651 | CONFIG_IBM_NEW_EMAC_RXB=128 | ||
652 | CONFIG_IBM_NEW_EMAC_TXB=64 | ||
653 | CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32 | ||
654 | CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256 | ||
655 | CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0 | ||
656 | # CONFIG_IBM_NEW_EMAC_DEBUG is not set | ||
657 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
658 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
659 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
660 | CONFIG_IBM_NEW_EMAC_EMAC4=y | ||
661 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | ||
662 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | ||
663 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | ||
664 | # CONFIG_NET_PCI is not set | ||
665 | # CONFIG_B44 is not set | ||
666 | # CONFIG_KS8842 is not set | ||
667 | # CONFIG_KS8851_MLL is not set | ||
668 | # CONFIG_ATL2 is not set | ||
669 | # CONFIG_XILINX_EMACLITE is not set | ||
670 | # CONFIG_NETDEV_1000 is not set | ||
671 | # CONFIG_NETDEV_10000 is not set | ||
672 | # CONFIG_TR is not set | ||
673 | # CONFIG_WLAN is not set | ||
674 | |||
675 | # | ||
676 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
677 | # | ||
678 | # CONFIG_WAN is not set | ||
679 | # CONFIG_FDDI is not set | ||
680 | # CONFIG_HIPPI is not set | ||
681 | # CONFIG_PPP is not set | ||
682 | # CONFIG_SLIP is not set | ||
683 | # CONFIG_NET_FC is not set | ||
684 | # CONFIG_NETCONSOLE is not set | ||
685 | # CONFIG_NETPOLL is not set | ||
686 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
687 | # CONFIG_VMXNET3 is not set | ||
688 | # CONFIG_ISDN is not set | ||
689 | # CONFIG_PHONE is not set | ||
690 | |||
691 | # | ||
692 | # Input device support | ||
693 | # | ||
694 | CONFIG_INPUT=y | ||
695 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
696 | # CONFIG_INPUT_POLLDEV is not set | ||
697 | # CONFIG_INPUT_SPARSEKMAP is not set | ||
698 | |||
699 | # | ||
700 | # Userland interfaces | ||
701 | # | ||
702 | CONFIG_INPUT_MOUSEDEV=y | ||
703 | CONFIG_INPUT_MOUSEDEV_PSAUX=y | ||
704 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=640 | ||
705 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480 | ||
706 | # CONFIG_INPUT_JOYDEV is not set | ||
707 | # CONFIG_INPUT_EVDEV is not set | ||
708 | # CONFIG_INPUT_EVBUG is not set | ||
709 | |||
710 | # | ||
711 | # Input Device Drivers | ||
712 | # | ||
713 | CONFIG_INPUT_KEYBOARD=y | ||
714 | # CONFIG_KEYBOARD_ADP5588 is not set | ||
715 | CONFIG_KEYBOARD_ATKBD=y | ||
716 | # CONFIG_QT2160 is not set | ||
717 | # CONFIG_KEYBOARD_LKKBD is not set | ||
718 | # CONFIG_KEYBOARD_MAX7359 is not set | ||
719 | # CONFIG_KEYBOARD_NEWTON is not set | ||
720 | # CONFIG_KEYBOARD_OPENCORES is not set | ||
721 | # CONFIG_KEYBOARD_STOWAWAY is not set | ||
722 | # CONFIG_KEYBOARD_SUNKBD is not set | ||
723 | # CONFIG_KEYBOARD_XTKBD is not set | ||
724 | CONFIG_INPUT_MOUSE=y | ||
725 | CONFIG_MOUSE_PS2=y | ||
726 | # CONFIG_MOUSE_PS2_ALPS is not set | ||
727 | # CONFIG_MOUSE_PS2_LOGIPS2PP is not set | ||
728 | # CONFIG_MOUSE_PS2_SYNAPTICS is not set | ||
729 | # CONFIG_MOUSE_PS2_TRACKPOINT is not set | ||
730 | # CONFIG_MOUSE_PS2_ELANTECH is not set | ||
731 | # CONFIG_MOUSE_PS2_SENTELIC is not set | ||
732 | # CONFIG_MOUSE_PS2_TOUCHKIT is not set | ||
733 | # CONFIG_MOUSE_SERIAL is not set | ||
734 | # CONFIG_MOUSE_VSXXXAA is not set | ||
735 | # CONFIG_MOUSE_SYNAPTICS_I2C is not set | ||
736 | # CONFIG_INPUT_JOYSTICK is not set | ||
737 | # CONFIG_INPUT_TABLET is not set | ||
738 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
739 | # CONFIG_INPUT_MISC is not set | ||
740 | |||
741 | # | ||
742 | # Hardware I/O ports | ||
743 | # | ||
744 | CONFIG_SERIO=y | ||
745 | CONFIG_SERIO_I8042=y | ||
746 | CONFIG_SERIO_SERPORT=y | ||
747 | # CONFIG_SERIO_PCIPS2 is not set | ||
748 | CONFIG_SERIO_LIBPS2=y | ||
749 | # CONFIG_SERIO_RAW is not set | ||
750 | # CONFIG_SERIO_XILINX_XPS_PS2 is not set | ||
751 | # CONFIG_SERIO_ALTERA_PS2 is not set | ||
752 | # CONFIG_GAMEPORT is not set | ||
753 | |||
754 | # | ||
755 | # Character devices | ||
756 | # | ||
757 | CONFIG_VT=y | ||
758 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
759 | CONFIG_VT_CONSOLE=y | ||
760 | CONFIG_HW_CONSOLE=y | ||
761 | # CONFIG_VT_HW_CONSOLE_BINDING is not set | ||
762 | CONFIG_DEVKMEM=y | ||
763 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
764 | # CONFIG_NOZOMI is not set | ||
765 | |||
766 | # | ||
767 | # Serial drivers | ||
768 | # | ||
769 | CONFIG_SERIAL_8250=y | ||
770 | CONFIG_SERIAL_8250_CONSOLE=y | ||
771 | # CONFIG_SERIAL_8250_PCI is not set | ||
772 | CONFIG_SERIAL_8250_NR_UARTS=4 | ||
773 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | ||
774 | CONFIG_SERIAL_8250_EXTENDED=y | ||
775 | # CONFIG_SERIAL_8250_MANY_PORTS is not set | ||
776 | CONFIG_SERIAL_8250_SHARE_IRQ=y | ||
777 | # CONFIG_SERIAL_8250_DETECT_IRQ is not set | ||
778 | # CONFIG_SERIAL_8250_RSA is not set | ||
779 | |||
780 | # | ||
781 | # Non-8250 serial port support | ||
782 | # | ||
783 | # CONFIG_SERIAL_UARTLITE is not set | ||
784 | CONFIG_SERIAL_CORE=y | ||
785 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
786 | # CONFIG_SERIAL_JSM is not set | ||
787 | CONFIG_SERIAL_OF_PLATFORM=y | ||
788 | # CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL is not set | ||
789 | # CONFIG_SERIAL_TIMBERDALE is not set | ||
790 | # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set | ||
791 | CONFIG_UNIX98_PTYS=y | ||
792 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
793 | CONFIG_LEGACY_PTYS=y | ||
794 | CONFIG_LEGACY_PTY_COUNT=256 | ||
795 | # CONFIG_HVC_UDBG is not set | ||
796 | # CONFIG_IPMI_HANDLER is not set | ||
797 | # CONFIG_HW_RANDOM is not set | ||
798 | # CONFIG_NVRAM is not set | ||
799 | # CONFIG_R3964 is not set | ||
800 | # CONFIG_APPLICOM is not set | ||
801 | # CONFIG_RAW_DRIVER is not set | ||
802 | # CONFIG_BOOTCOUNT is not set | ||
803 | # CONFIG_DISPLAY_PDSP1880 is not set | ||
804 | # CONFIG_MUCMC52_IO is not set | ||
805 | # CONFIG_UC101_IO is not set | ||
806 | # CONFIG_SRAM is not set | ||
807 | # CONFIG_TCG_TPM is not set | ||
808 | CONFIG_DEVPORT=y | ||
809 | CONFIG_I2C=y | ||
810 | CONFIG_I2C_BOARDINFO=y | ||
811 | CONFIG_I2C_COMPAT=y | ||
812 | CONFIG_I2C_CHARDEV=y | ||
813 | CONFIG_I2C_HELPER_AUTO=y | ||
814 | |||
815 | # | ||
816 | # I2C Hardware Bus support | ||
817 | # | ||
818 | |||
819 | # | ||
820 | # PC SMBus host controller drivers | ||
821 | # | ||
822 | # CONFIG_I2C_ALI1535 is not set | ||
823 | # CONFIG_I2C_ALI1563 is not set | ||
824 | # CONFIG_I2C_ALI15X3 is not set | ||
825 | # CONFIG_I2C_AMD756 is not set | ||
826 | # CONFIG_I2C_AMD8111 is not set | ||
827 | # CONFIG_I2C_I801 is not set | ||
828 | # CONFIG_I2C_ISCH is not set | ||
829 | # CONFIG_I2C_PIIX4 is not set | ||
830 | # CONFIG_I2C_NFORCE2 is not set | ||
831 | # CONFIG_I2C_SIS5595 is not set | ||
832 | # CONFIG_I2C_SIS630 is not set | ||
833 | # CONFIG_I2C_SIS96X is not set | ||
834 | # CONFIG_I2C_VIA is not set | ||
835 | # CONFIG_I2C_VIAPRO is not set | ||
836 | |||
837 | # | ||
838 | # I2C system bus drivers (mostly embedded / system-on-chip) | ||
839 | # | ||
840 | CONFIG_I2C_IBM_IIC=y | ||
841 | # CONFIG_I2C_MPC is not set | ||
842 | # CONFIG_I2C_OCORES is not set | ||
843 | # CONFIG_I2C_SIMTEC is not set | ||
844 | # CONFIG_I2C_XILINX is not set | ||
845 | |||
846 | # | ||
847 | # External I2C/SMBus adapter drivers | ||
848 | # | ||
849 | # CONFIG_I2C_PARPORT_LIGHT is not set | ||
850 | # CONFIG_I2C_TAOS_EVM is not set | ||
851 | |||
852 | # | ||
853 | # Other I2C/SMBus bus drivers | ||
854 | # | ||
855 | # CONFIG_I2C_PCA_PLATFORM is not set | ||
856 | # CONFIG_I2C_STUB is not set | ||
857 | # CONFIG_I2C_DEBUG_CORE is not set | ||
858 | # CONFIG_I2C_DEBUG_ALGO is not set | ||
859 | # CONFIG_I2C_DEBUG_BUS is not set | ||
860 | # CONFIG_SPI is not set | ||
861 | |||
862 | # | ||
863 | # PPS support | ||
864 | # | ||
865 | # CONFIG_PPS is not set | ||
866 | CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y | ||
867 | # CONFIG_GPIOLIB is not set | ||
868 | # CONFIG_W1 is not set | ||
869 | # CONFIG_POWER_SUPPLY is not set | ||
870 | # CONFIG_HWMON is not set | ||
871 | # CONFIG_THERMAL is not set | ||
872 | # CONFIG_WATCHDOG is not set | ||
873 | CONFIG_SSB_POSSIBLE=y | ||
874 | |||
875 | # | ||
876 | # Sonics Silicon Backplane | ||
877 | # | ||
878 | # CONFIG_SSB is not set | ||
879 | |||
880 | # | ||
881 | # Multifunction device drivers | ||
882 | # | ||
883 | # CONFIG_MFD_CORE is not set | ||
884 | # CONFIG_MFD_88PM860X is not set | ||
885 | CONFIG_MFD_SM501=y | ||
886 | # CONFIG_HTC_PASIC3 is not set | ||
887 | # CONFIG_TWL4030_CORE is not set | ||
888 | # CONFIG_MFD_TMIO is not set | ||
889 | # CONFIG_PMIC_DA903X is not set | ||
890 | # CONFIG_PMIC_ADP5520 is not set | ||
891 | # CONFIG_MFD_MAX8925 is not set | ||
892 | # CONFIG_MFD_WM8400 is not set | ||
893 | # CONFIG_MFD_WM831X is not set | ||
894 | # CONFIG_MFD_WM8350_I2C is not set | ||
895 | # CONFIG_MFD_WM8994 is not set | ||
896 | # CONFIG_MFD_PCF50633 is not set | ||
897 | # CONFIG_AB3100_CORE is not set | ||
898 | # CONFIG_LPC_SCH is not set | ||
899 | # CONFIG_REGULATOR is not set | ||
900 | # CONFIG_MEDIA_SUPPORT is not set | ||
901 | |||
902 | # | ||
903 | # Graphics support | ||
904 | # | ||
905 | # CONFIG_AGP is not set | ||
906 | CONFIG_VGA_ARB=y | ||
907 | CONFIG_VGA_ARB_MAX_GPUS=16 | ||
908 | # CONFIG_DRM is not set | ||
909 | # CONFIG_VGASTATE is not set | ||
910 | CONFIG_VIDEO_OUTPUT_CONTROL=m | ||
911 | CONFIG_FB=y | ||
912 | # CONFIG_FIRMWARE_EDID is not set | ||
913 | # CONFIG_FB_DDC is not set | ||
914 | # CONFIG_FB_BOOT_VESA_SUPPORT is not set | ||
915 | CONFIG_FB_CFB_FILLRECT=y | ||
916 | CONFIG_FB_CFB_COPYAREA=y | ||
917 | CONFIG_FB_CFB_IMAGEBLIT=y | ||
918 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
919 | # CONFIG_FB_SYS_FILLRECT is not set | ||
920 | # CONFIG_FB_SYS_COPYAREA is not set | ||
921 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
922 | # CONFIG_FB_FOREIGN_ENDIAN is not set | ||
923 | # CONFIG_FB_SYS_FOPS is not set | ||
924 | # CONFIG_FB_SVGALIB is not set | ||
925 | # CONFIG_FB_MACMODES is not set | ||
926 | # CONFIG_FB_BACKLIGHT is not set | ||
927 | # CONFIG_FB_MODE_HELPERS is not set | ||
928 | # CONFIG_FB_TILEBLITTING is not set | ||
929 | |||
930 | # | ||
931 | # Frame buffer hardware drivers | ||
932 | # | ||
933 | # CONFIG_FB_CIRRUS is not set | ||
934 | # CONFIG_FB_PM2 is not set | ||
935 | # CONFIG_FB_CYBER2000 is not set | ||
936 | # CONFIG_FB_OF is not set | ||
937 | # CONFIG_FB_CT65550 is not set | ||
938 | # CONFIG_FB_ASILIANT is not set | ||
939 | # CONFIG_FB_IMSTT is not set | ||
940 | # CONFIG_FB_VGA16 is not set | ||
941 | # CONFIG_FB_UVESA is not set | ||
942 | # CONFIG_FB_S1D13XXX is not set | ||
943 | # CONFIG_FB_NVIDIA is not set | ||
944 | # CONFIG_FB_RIVA is not set | ||
945 | # CONFIG_FB_MATROX is not set | ||
946 | # CONFIG_FB_RADEON is not set | ||
947 | # CONFIG_FB_ATY128 is not set | ||
948 | # CONFIG_FB_ATY is not set | ||
949 | # CONFIG_FB_S3 is not set | ||
950 | # CONFIG_FB_SAVAGE is not set | ||
951 | # CONFIG_FB_SIS is not set | ||
952 | # CONFIG_FB_VIA is not set | ||
953 | # CONFIG_FB_NEOMAGIC is not set | ||
954 | # CONFIG_FB_KYRO is not set | ||
955 | # CONFIG_FB_3DFX is not set | ||
956 | # CONFIG_FB_VOODOO1 is not set | ||
957 | # CONFIG_FB_VT8623 is not set | ||
958 | # CONFIG_FB_TRIDENT is not set | ||
959 | # CONFIG_FB_ARK is not set | ||
960 | # CONFIG_FB_PM3 is not set | ||
961 | # CONFIG_FB_CARMINE is not set | ||
962 | CONFIG_FB_SM501=y | ||
963 | # CONFIG_FB_IBM_GXT4500 is not set | ||
964 | # CONFIG_FB_VIRTUAL is not set | ||
965 | # CONFIG_FB_METRONOME is not set | ||
966 | # CONFIG_FB_MB862XX is not set | ||
967 | # CONFIG_FB_BROADSHEET is not set | ||
968 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
969 | |||
970 | # | ||
971 | # Display device support | ||
972 | # | ||
973 | # CONFIG_DISPLAY_SUPPORT is not set | ||
974 | |||
975 | # | ||
976 | # Console display driver support | ||
977 | # | ||
978 | CONFIG_DUMMY_CONSOLE=y | ||
979 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
980 | # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set | ||
981 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
982 | # CONFIG_FONTS is not set | ||
983 | CONFIG_FONT_8x8=y | ||
984 | CONFIG_FONT_8x16=y | ||
985 | CONFIG_LOGO=y | ||
986 | # CONFIG_LOGO_LINUX_MONO is not set | ||
987 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
988 | CONFIG_LOGO_LINUX_CLUT224=y | ||
989 | # CONFIG_SOUND is not set | ||
990 | CONFIG_HID_SUPPORT=y | ||
991 | CONFIG_HID=y | ||
992 | # CONFIG_HIDRAW is not set | ||
993 | # CONFIG_HID_PID is not set | ||
994 | |||
995 | # | ||
996 | # Special HID drivers | ||
997 | # | ||
998 | # CONFIG_USB_SUPPORT is not set | ||
999 | # CONFIG_UWB is not set | ||
1000 | # CONFIG_MMC is not set | ||
1001 | # CONFIG_MEMSTICK is not set | ||
1002 | # CONFIG_NEW_LEDS is not set | ||
1003 | # CONFIG_ACCESSIBILITY is not set | ||
1004 | # CONFIG_INFINIBAND is not set | ||
1005 | # CONFIG_EDAC is not set | ||
1006 | CONFIG_RTC_LIB=y | ||
1007 | CONFIG_RTC_CLASS=y | ||
1008 | CONFIG_RTC_HCTOSYS=y | ||
1009 | CONFIG_RTC_HCTOSYS_DEVICE="rtc0" | ||
1010 | # CONFIG_RTC_DEBUG is not set | ||
1011 | |||
1012 | # | ||
1013 | # RTC interfaces | ||
1014 | # | ||
1015 | CONFIG_RTC_INTF_SYSFS=y | ||
1016 | CONFIG_RTC_INTF_PROC=y | ||
1017 | CONFIG_RTC_INTF_DEV=y | ||
1018 | # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set | ||
1019 | # CONFIG_RTC_DRV_TEST is not set | ||
1020 | |||
1021 | # | ||
1022 | # I2C RTC drivers | ||
1023 | # | ||
1024 | CONFIG_RTC_DRV_DS1307=y | ||
1025 | # CONFIG_RTC_DRV_DS1374 is not set | ||
1026 | # CONFIG_RTC_DRV_DS1672 is not set | ||
1027 | # CONFIG_RTC_DRV_MAX6900 is not set | ||
1028 | # CONFIG_RTC_DRV_RS5C372 is not set | ||
1029 | # CONFIG_RTC_DRV_ISL1208 is not set | ||
1030 | # CONFIG_RTC_DRV_X1205 is not set | ||
1031 | # CONFIG_RTC_DRV_PCF8563 is not set | ||
1032 | # CONFIG_RTC_DRV_PCF8583 is not set | ||
1033 | # CONFIG_RTC_DRV_M41T80 is not set | ||
1034 | # CONFIG_RTC_DRV_BQ32K is not set | ||
1035 | # CONFIG_RTC_DRV_S35390A is not set | ||
1036 | # CONFIG_RTC_DRV_FM3130 is not set | ||
1037 | # CONFIG_RTC_DRV_RX8581 is not set | ||
1038 | # CONFIG_RTC_DRV_RX8025 is not set | ||
1039 | |||
1040 | # | ||
1041 | # SPI RTC drivers | ||
1042 | # | ||
1043 | |||
1044 | # | ||
1045 | # Platform RTC drivers | ||
1046 | # | ||
1047 | # CONFIG_RTC_DRV_CMOS is not set | ||
1048 | # CONFIG_RTC_DRV_DS1286 is not set | ||
1049 | # CONFIG_RTC_DRV_DS1511 is not set | ||
1050 | # CONFIG_RTC_DRV_DS1553 is not set | ||
1051 | # CONFIG_RTC_DRV_DS1742 is not set | ||
1052 | # CONFIG_RTC_DRV_STK17TA8 is not set | ||
1053 | # CONFIG_RTC_DRV_M48T86 is not set | ||
1054 | # CONFIG_RTC_DRV_M48T35 is not set | ||
1055 | # CONFIG_RTC_DRV_M48T59 is not set | ||
1056 | # CONFIG_RTC_DRV_MSM6242 is not set | ||
1057 | # CONFIG_RTC_DRV_BQ4802 is not set | ||
1058 | # CONFIG_RTC_DRV_RP5C01 is not set | ||
1059 | # CONFIG_RTC_DRV_V3020 is not set | ||
1060 | |||
1061 | # | ||
1062 | # on-CPU RTC drivers | ||
1063 | # | ||
1064 | # CONFIG_RTC_DRV_GENERIC is not set | ||
1065 | # CONFIG_DMADEVICES is not set | ||
1066 | # CONFIG_AUXDISPLAY is not set | ||
1067 | # CONFIG_UIO is not set | ||
1068 | |||
1069 | # | ||
1070 | # TI VLYNQ | ||
1071 | # | ||
1072 | # CONFIG_STAGING is not set | ||
1073 | |||
1074 | # | ||
1075 | # File systems | ||
1076 | # | ||
1077 | CONFIG_EXT2_FS=y | ||
1078 | # CONFIG_EXT2_FS_XATTR is not set | ||
1079 | # CONFIG_EXT2_FS_XIP is not set | ||
1080 | CONFIG_EXT3_FS=y | ||
1081 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | ||
1082 | CONFIG_EXT3_FS_XATTR=y | ||
1083 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
1084 | # CONFIG_EXT3_FS_SECURITY is not set | ||
1085 | # CONFIG_EXT4_FS is not set | ||
1086 | CONFIG_JBD=y | ||
1087 | CONFIG_FS_MBCACHE=y | ||
1088 | # CONFIG_REISERFS_FS is not set | ||
1089 | # CONFIG_JFS_FS is not set | ||
1090 | # CONFIG_FS_POSIX_ACL is not set | ||
1091 | # CONFIG_XFS_FS is not set | ||
1092 | # CONFIG_GFS2_FS is not set | ||
1093 | # CONFIG_OCFS2_FS is not set | ||
1094 | # CONFIG_BTRFS_FS is not set | ||
1095 | # CONFIG_NILFS2_FS is not set | ||
1096 | CONFIG_FILE_LOCKING=y | ||
1097 | CONFIG_FSNOTIFY=y | ||
1098 | CONFIG_DNOTIFY=y | ||
1099 | CONFIG_INOTIFY=y | ||
1100 | CONFIG_INOTIFY_USER=y | ||
1101 | # CONFIG_QUOTA is not set | ||
1102 | # CONFIG_AUTOFS_FS is not set | ||
1103 | # CONFIG_AUTOFS4_FS is not set | ||
1104 | # CONFIG_FUSE_FS is not set | ||
1105 | |||
1106 | # | ||
1107 | # Caches | ||
1108 | # | ||
1109 | # CONFIG_FSCACHE is not set | ||
1110 | |||
1111 | # | ||
1112 | # CD-ROM/DVD Filesystems | ||
1113 | # | ||
1114 | # CONFIG_ISO9660_FS is not set | ||
1115 | # CONFIG_UDF_FS is not set | ||
1116 | |||
1117 | # | ||
1118 | # DOS/FAT/NT Filesystems | ||
1119 | # | ||
1120 | CONFIG_FAT_FS=y | ||
1121 | # CONFIG_MSDOS_FS is not set | ||
1122 | CONFIG_VFAT_FS=y | ||
1123 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
1124 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | ||
1125 | # CONFIG_NTFS_FS is not set | ||
1126 | |||
1127 | # | ||
1128 | # Pseudo filesystems | ||
1129 | # | ||
1130 | CONFIG_PROC_FS=y | ||
1131 | CONFIG_PROC_KCORE=y | ||
1132 | CONFIG_PROC_SYSCTL=y | ||
1133 | CONFIG_PROC_PAGE_MONITOR=y | ||
1134 | CONFIG_SYSFS=y | ||
1135 | CONFIG_TMPFS=y | ||
1136 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
1137 | # CONFIG_HUGETLB_PAGE is not set | ||
1138 | # CONFIG_CONFIGFS_FS is not set | ||
1139 | CONFIG_MISC_FILESYSTEMS=y | ||
1140 | # CONFIG_ADFS_FS is not set | ||
1141 | # CONFIG_AFFS_FS is not set | ||
1142 | # CONFIG_HFS_FS is not set | ||
1143 | # CONFIG_HFSPLUS_FS is not set | ||
1144 | # CONFIG_BEFS_FS is not set | ||
1145 | # CONFIG_BFS_FS is not set | ||
1146 | # CONFIG_EFS_FS is not set | ||
1147 | # CONFIG_JFFS2_FS is not set | ||
1148 | # CONFIG_YAFFS_FS is not set | ||
1149 | # CONFIG_LOGFS is not set | ||
1150 | CONFIG_CRAMFS=y | ||
1151 | # CONFIG_SQUASHFS is not set | ||
1152 | # CONFIG_VXFS_FS is not set | ||
1153 | # CONFIG_MINIX_FS is not set | ||
1154 | # CONFIG_OMFS_FS is not set | ||
1155 | # CONFIG_HPFS_FS is not set | ||
1156 | # CONFIG_QNX4FS_FS is not set | ||
1157 | # CONFIG_ROMFS_FS is not set | ||
1158 | # CONFIG_SYSV_FS is not set | ||
1159 | # CONFIG_UFS_FS is not set | ||
1160 | CONFIG_NETWORK_FILESYSTEMS=y | ||
1161 | CONFIG_NFS_FS=y | ||
1162 | CONFIG_NFS_V3=y | ||
1163 | # CONFIG_NFS_V3_ACL is not set | ||
1164 | # CONFIG_NFS_V4 is not set | ||
1165 | CONFIG_ROOT_NFS=y | ||
1166 | # CONFIG_NFSD is not set | ||
1167 | CONFIG_LOCKD=y | ||
1168 | CONFIG_LOCKD_V4=y | ||
1169 | CONFIG_NFS_COMMON=y | ||
1170 | CONFIG_SUNRPC=y | ||
1171 | # CONFIG_RPCSEC_GSS_KRB5 is not set | ||
1172 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
1173 | # CONFIG_SMB_FS is not set | ||
1174 | # CONFIG_CEPH_FS is not set | ||
1175 | # CONFIG_CIFS is not set | ||
1176 | # CONFIG_NCP_FS is not set | ||
1177 | # CONFIG_CODA_FS is not set | ||
1178 | # CONFIG_AFS_FS is not set | ||
1179 | |||
1180 | # | ||
1181 | # Partition Types | ||
1182 | # | ||
1183 | # CONFIG_PARTITION_ADVANCED is not set | ||
1184 | CONFIG_MSDOS_PARTITION=y | ||
1185 | CONFIG_NLS=y | ||
1186 | CONFIG_NLS_DEFAULT="iso8859-1" | ||
1187 | CONFIG_NLS_CODEPAGE_437=y | ||
1188 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
1189 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
1190 | CONFIG_NLS_CODEPAGE_850=y | ||
1191 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
1192 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
1193 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
1194 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
1195 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
1196 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
1197 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
1198 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
1199 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
1200 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
1201 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
1202 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
1203 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
1204 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
1205 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
1206 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
1207 | # CONFIG_NLS_ISO8859_8 is not set | ||
1208 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
1209 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
1210 | # CONFIG_NLS_ASCII is not set | ||
1211 | CONFIG_NLS_ISO8859_1=y | ||
1212 | # CONFIG_NLS_ISO8859_2 is not set | ||
1213 | # CONFIG_NLS_ISO8859_3 is not set | ||
1214 | # CONFIG_NLS_ISO8859_4 is not set | ||
1215 | # CONFIG_NLS_ISO8859_5 is not set | ||
1216 | # CONFIG_NLS_ISO8859_6 is not set | ||
1217 | # CONFIG_NLS_ISO8859_7 is not set | ||
1218 | # CONFIG_NLS_ISO8859_9 is not set | ||
1219 | # CONFIG_NLS_ISO8859_13 is not set | ||
1220 | # CONFIG_NLS_ISO8859_14 is not set | ||
1221 | CONFIG_NLS_ISO8859_15=y | ||
1222 | # CONFIG_NLS_KOI8_R is not set | ||
1223 | # CONFIG_NLS_KOI8_U is not set | ||
1224 | # CONFIG_NLS_UTF8 is not set | ||
1225 | # CONFIG_DLM is not set | ||
1226 | # CONFIG_BINARY_PRINTF is not set | ||
1227 | |||
1228 | # | ||
1229 | # Library routines | ||
1230 | # | ||
1231 | CONFIG_BITREVERSE=y | ||
1232 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
1233 | # CONFIG_CRC_CCITT is not set | ||
1234 | # CONFIG_CRC16 is not set | ||
1235 | # CONFIG_CRC_T10DIF is not set | ||
1236 | # CONFIG_CRC_ITU_T is not set | ||
1237 | CONFIG_CRC32=y | ||
1238 | # CONFIG_CRC7 is not set | ||
1239 | # CONFIG_LIBCRC32C is not set | ||
1240 | CONFIG_ZLIB_INFLATE=y | ||
1241 | CONFIG_DECOMPRESS_GZIP=y | ||
1242 | CONFIG_HAS_IOMEM=y | ||
1243 | CONFIG_HAS_IOPORT=y | ||
1244 | CONFIG_HAS_DMA=y | ||
1245 | CONFIG_HAVE_LMB=y | ||
1246 | CONFIG_NLATTR=y | ||
1247 | CONFIG_GENERIC_ATOMIC64=y | ||
1248 | |||
1249 | # | ||
1250 | # Kernel hacking | ||
1251 | # | ||
1252 | # CONFIG_PRINTK_TIME is not set | ||
1253 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
1254 | CONFIG_ENABLE_MUST_CHECK=y | ||
1255 | CONFIG_FRAME_WARN=1024 | ||
1256 | CONFIG_MAGIC_SYSRQ=y | ||
1257 | # CONFIG_STRIP_ASM_SYMS is not set | ||
1258 | # CONFIG_UNUSED_SYMBOLS is not set | ||
1259 | # CONFIG_DEBUG_FS is not set | ||
1260 | # CONFIG_HEADERS_CHECK is not set | ||
1261 | CONFIG_DEBUG_KERNEL=y | ||
1262 | # CONFIG_DEBUG_SHIRQ is not set | ||
1263 | CONFIG_DETECT_SOFTLOCKUP=y | ||
1264 | # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set | ||
1265 | CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 | ||
1266 | CONFIG_DETECT_HUNG_TASK=y | ||
1267 | # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set | ||
1268 | CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 | ||
1269 | CONFIG_SCHED_DEBUG=y | ||
1270 | # CONFIG_SCHEDSTATS is not set | ||
1271 | # CONFIG_TIMER_STATS is not set | ||
1272 | # CONFIG_DEBUG_OBJECTS is not set | ||
1273 | # CONFIG_SLUB_DEBUG_ON is not set | ||
1274 | # CONFIG_SLUB_STATS is not set | ||
1275 | # CONFIG_DEBUG_KMEMLEAK is not set | ||
1276 | # CONFIG_DEBUG_RT_MUTEXES is not set | ||
1277 | # CONFIG_RT_MUTEX_TESTER is not set | ||
1278 | # CONFIG_DEBUG_SPINLOCK is not set | ||
1279 | # CONFIG_DEBUG_MUTEXES is not set | ||
1280 | # CONFIG_DEBUG_LOCK_ALLOC is not set | ||
1281 | # CONFIG_PROVE_LOCKING is not set | ||
1282 | # CONFIG_LOCK_STAT is not set | ||
1283 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | ||
1284 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | ||
1285 | # CONFIG_DEBUG_KOBJECT is not set | ||
1286 | # CONFIG_DEBUG_HIGHMEM is not set | ||
1287 | # CONFIG_DEBUG_BUGVERBOSE is not set | ||
1288 | # CONFIG_DEBUG_INFO is not set | ||
1289 | # CONFIG_DEBUG_VM is not set | ||
1290 | # CONFIG_DEBUG_WRITECOUNT is not set | ||
1291 | # CONFIG_DEBUG_MEMORY_INIT is not set | ||
1292 | # CONFIG_DEBUG_LIST is not set | ||
1293 | # CONFIG_DEBUG_SG is not set | ||
1294 | # CONFIG_DEBUG_NOTIFIERS is not set | ||
1295 | # CONFIG_DEBUG_CREDENTIALS is not set | ||
1296 | # CONFIG_RCU_TORTURE_TEST is not set | ||
1297 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
1298 | # CONFIG_BACKTRACE_SELF_TEST is not set | ||
1299 | # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set | ||
1300 | # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set | ||
1301 | # CONFIG_FAULT_INJECTION is not set | ||
1302 | # CONFIG_LATENCYTOP is not set | ||
1303 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
1304 | # CONFIG_DEBUG_PAGEALLOC is not set | ||
1305 | CONFIG_HAVE_FUNCTION_TRACER=y | ||
1306 | CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y | ||
1307 | CONFIG_HAVE_DYNAMIC_FTRACE=y | ||
1308 | CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y | ||
1309 | CONFIG_TRACING_SUPPORT=y | ||
1310 | CONFIG_FTRACE=y | ||
1311 | # CONFIG_FUNCTION_TRACER is not set | ||
1312 | # CONFIG_IRQSOFF_TRACER is not set | ||
1313 | # CONFIG_SCHED_TRACER is not set | ||
1314 | # CONFIG_ENABLE_DEFAULT_TRACERS is not set | ||
1315 | # CONFIG_BOOT_TRACER is not set | ||
1316 | CONFIG_BRANCH_PROFILE_NONE=y | ||
1317 | # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set | ||
1318 | # CONFIG_PROFILE_ALL_BRANCHES is not set | ||
1319 | # CONFIG_STACK_TRACER is not set | ||
1320 | # CONFIG_KMEMTRACE is not set | ||
1321 | # CONFIG_WORKQUEUE_TRACER is not set | ||
1322 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
1323 | # CONFIG_DMA_API_DEBUG is not set | ||
1324 | # CONFIG_SAMPLES is not set | ||
1325 | CONFIG_HAVE_ARCH_KGDB=y | ||
1326 | # CONFIG_KGDB is not set | ||
1327 | # CONFIG_PPC_DISABLE_WERROR is not set | ||
1328 | CONFIG_PPC_WERROR=y | ||
1329 | CONFIG_PRINT_STACK_DEPTH=64 | ||
1330 | # CONFIG_DEBUG_STACKOVERFLOW is not set | ||
1331 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
1332 | # CONFIG_CODE_PATCHING_SELFTEST is not set | ||
1333 | # CONFIG_FTR_FIXUP_SELFTEST is not set | ||
1334 | # CONFIG_MSI_BITMAP_SELFTEST is not set | ||
1335 | # CONFIG_XMON is not set | ||
1336 | # CONFIG_IRQSTACKS is not set | ||
1337 | # CONFIG_BDI_SWITCH is not set | ||
1338 | # CONFIG_PPC_EARLY_DEBUG is not set | ||
1339 | |||
1340 | # | ||
1341 | # Security options | ||
1342 | # | ||
1343 | # CONFIG_KEYS is not set | ||
1344 | # CONFIG_SECURITY is not set | ||
1345 | # CONFIG_SECURITYFS is not set | ||
1346 | # CONFIG_DEFAULT_SECURITY_SELINUX is not set | ||
1347 | # CONFIG_DEFAULT_SECURITY_SMACK is not set | ||
1348 | # CONFIG_DEFAULT_SECURITY_TOMOYO is not set | ||
1349 | CONFIG_DEFAULT_SECURITY_DAC=y | ||
1350 | CONFIG_DEFAULT_SECURITY="" | ||
1351 | CONFIG_CRYPTO=y | ||
1352 | |||
1353 | # | ||
1354 | # Crypto core or helper | ||
1355 | # | ||
1356 | CONFIG_CRYPTO_ALGAPI=y | ||
1357 | CONFIG_CRYPTO_ALGAPI2=y | ||
1358 | CONFIG_CRYPTO_AEAD2=y | ||
1359 | CONFIG_CRYPTO_BLKCIPHER=y | ||
1360 | CONFIG_CRYPTO_BLKCIPHER2=y | ||
1361 | CONFIG_CRYPTO_HASH=y | ||
1362 | CONFIG_CRYPTO_HASH2=y | ||
1363 | CONFIG_CRYPTO_RNG2=y | ||
1364 | CONFIG_CRYPTO_PCOMP=y | ||
1365 | CONFIG_CRYPTO_MANAGER=y | ||
1366 | CONFIG_CRYPTO_MANAGER2=y | ||
1367 | # CONFIG_CRYPTO_GF128MUL is not set | ||
1368 | # CONFIG_CRYPTO_NULL is not set | ||
1369 | CONFIG_CRYPTO_WORKQUEUE=y | ||
1370 | # CONFIG_CRYPTO_CRYPTD is not set | ||
1371 | # CONFIG_CRYPTO_AUTHENC is not set | ||
1372 | # CONFIG_CRYPTO_TEST is not set | ||
1373 | |||
1374 | # | ||
1375 | # Authenticated Encryption with Associated Data | ||
1376 | # | ||
1377 | # CONFIG_CRYPTO_CCM is not set | ||
1378 | # CONFIG_CRYPTO_GCM is not set | ||
1379 | # CONFIG_CRYPTO_SEQIV is not set | ||
1380 | |||
1381 | # | ||
1382 | # Block modes | ||
1383 | # | ||
1384 | CONFIG_CRYPTO_CBC=y | ||
1385 | # CONFIG_CRYPTO_CTR is not set | ||
1386 | # CONFIG_CRYPTO_CTS is not set | ||
1387 | CONFIG_CRYPTO_ECB=y | ||
1388 | # CONFIG_CRYPTO_LRW is not set | ||
1389 | CONFIG_CRYPTO_PCBC=y | ||
1390 | # CONFIG_CRYPTO_XTS is not set | ||
1391 | |||
1392 | # | ||
1393 | # Hash modes | ||
1394 | # | ||
1395 | # CONFIG_CRYPTO_HMAC is not set | ||
1396 | # CONFIG_CRYPTO_XCBC is not set | ||
1397 | # CONFIG_CRYPTO_VMAC is not set | ||
1398 | |||
1399 | # | ||
1400 | # Digest | ||
1401 | # | ||
1402 | # CONFIG_CRYPTO_CRC32C is not set | ||
1403 | # CONFIG_CRYPTO_GHASH is not set | ||
1404 | # CONFIG_CRYPTO_MD4 is not set | ||
1405 | CONFIG_CRYPTO_MD5=y | ||
1406 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
1407 | # CONFIG_CRYPTO_RMD128 is not set | ||
1408 | # CONFIG_CRYPTO_RMD160 is not set | ||
1409 | # CONFIG_CRYPTO_RMD256 is not set | ||
1410 | # CONFIG_CRYPTO_RMD320 is not set | ||
1411 | # CONFIG_CRYPTO_SHA1 is not set | ||
1412 | # CONFIG_CRYPTO_SHA256 is not set | ||
1413 | # CONFIG_CRYPTO_SHA512 is not set | ||
1414 | # CONFIG_CRYPTO_TGR192 is not set | ||
1415 | # CONFIG_CRYPTO_WP512 is not set | ||
1416 | |||
1417 | # | ||
1418 | # Ciphers | ||
1419 | # | ||
1420 | # CONFIG_CRYPTO_AES is not set | ||
1421 | # CONFIG_CRYPTO_ANUBIS is not set | ||
1422 | # CONFIG_CRYPTO_ARC4 is not set | ||
1423 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
1424 | # CONFIG_CRYPTO_CAMELLIA is not set | ||
1425 | # CONFIG_CRYPTO_CAST5 is not set | ||
1426 | # CONFIG_CRYPTO_CAST6 is not set | ||
1427 | CONFIG_CRYPTO_DES=y | ||
1428 | # CONFIG_CRYPTO_FCRYPT is not set | ||
1429 | # CONFIG_CRYPTO_KHAZAD is not set | ||
1430 | # CONFIG_CRYPTO_SALSA20 is not set | ||
1431 | # CONFIG_CRYPTO_SEED is not set | ||
1432 | # CONFIG_CRYPTO_SERPENT is not set | ||
1433 | # CONFIG_CRYPTO_TEA is not set | ||
1434 | # CONFIG_CRYPTO_TWOFISH is not set | ||
1435 | |||
1436 | # | ||
1437 | # Compression | ||
1438 | # | ||
1439 | # CONFIG_CRYPTO_DEFLATE is not set | ||
1440 | # CONFIG_CRYPTO_ZLIB is not set | ||
1441 | # CONFIG_CRYPTO_LZO is not set | ||
1442 | |||
1443 | # | ||
1444 | # Random Number Generation | ||
1445 | # | ||
1446 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
1447 | CONFIG_CRYPTO_HW=y | ||
1448 | # CONFIG_CRYPTO_DEV_HIFN_795X is not set | ||
1449 | # CONFIG_CRYPTO_DEV_PPC4XX is not set | ||
1450 | # CONFIG_PPC_CLOCK is not set | ||
1451 | # CONFIG_VIRTUALIZATION is not set | ||
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h index 725634fc18c6..4b509411ad8a 100644 --- a/arch/powerpc/include/asm/cache.h +++ b/arch/powerpc/include/asm/cache.h | |||
@@ -42,7 +42,7 @@ extern struct ppc64_caches ppc64_caches; | |||
42 | #endif /* __powerpc64__ && ! __ASSEMBLY__ */ | 42 | #endif /* __powerpc64__ && ! __ASSEMBLY__ */ |
43 | 43 | ||
44 | #if !defined(__ASSEMBLY__) | 44 | #if !defined(__ASSEMBLY__) |
45 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 45 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #endif /* __KERNEL__ */ | 48 | #endif /* __KERNEL__ */ |
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index e3cba4e1eb34..b0b21134f61a 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h | |||
@@ -70,6 +70,7 @@ struct pt_regs; | |||
70 | extern int machine_check_generic(struct pt_regs *regs); | 70 | extern int machine_check_generic(struct pt_regs *regs); |
71 | extern int machine_check_4xx(struct pt_regs *regs); | 71 | extern int machine_check_4xx(struct pt_regs *regs); |
72 | extern int machine_check_440A(struct pt_regs *regs); | 72 | extern int machine_check_440A(struct pt_regs *regs); |
73 | extern int machine_check_e500mc(struct pt_regs *regs); | ||
73 | extern int machine_check_e500(struct pt_regs *regs); | 74 | extern int machine_check_e500(struct pt_regs *regs); |
74 | extern int machine_check_e200(struct pt_regs *regs); | 75 | extern int machine_check_e200(struct pt_regs *regs); |
75 | extern int machine_check_47x(struct pt_regs *regs); | 76 | extern int machine_check_47x(struct pt_regs *regs); |
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h index a6ca6da1430b..2a9cd74a841e 100644 --- a/arch/powerpc/include/asm/kexec.h +++ b/arch/powerpc/include/asm/kexec.h | |||
@@ -2,6 +2,18 @@ | |||
2 | #define _ASM_POWERPC_KEXEC_H | 2 | #define _ASM_POWERPC_KEXEC_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #ifdef CONFIG_FSL_BOOKE | ||
6 | |||
7 | /* | ||
8 | * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory | ||
9 | * and therefore we can only deal with memory within this range | ||
10 | */ | ||
11 | #define KEXEC_SOURCE_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | ||
12 | #define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | ||
13 | #define KEXEC_CONTROL_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | ||
14 | |||
15 | #else | ||
16 | |||
5 | /* | 17 | /* |
6 | * Maximum page that is mapped directly into kernel memory. | 18 | * Maximum page that is mapped directly into kernel memory. |
7 | * XXX: Since we copy virt we can use any page we allocate | 19 | * XXX: Since we copy virt we can use any page we allocate |
@@ -21,6 +33,7 @@ | |||
21 | /* TASK_SIZE, probably left over from use_mm ?? */ | 33 | /* TASK_SIZE, probably left over from use_mm ?? */ |
22 | #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE | 34 | #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE |
23 | #endif | 35 | #endif |
36 | #endif | ||
24 | 37 | ||
25 | #define KEXEC_CONTROL_PAGE_SIZE 4096 | 38 | #define KEXEC_CONTROL_PAGE_SIZE 4096 |
26 | 39 | ||
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h index bfc4e027e2ad..358ff14ea25e 100644 --- a/arch/powerpc/include/asm/page_64.h +++ b/arch/powerpc/include/asm/page_64.h | |||
@@ -162,14 +162,6 @@ do { \ | |||
162 | 162 | ||
163 | #endif /* !CONFIG_HUGETLB_PAGE */ | 163 | #endif /* !CONFIG_HUGETLB_PAGE */ |
164 | 164 | ||
165 | #ifdef MODULE | ||
166 | #define __page_aligned __attribute__((__aligned__(PAGE_SIZE))) | ||
167 | #else | ||
168 | #define __page_aligned \ | ||
169 | __attribute__((__aligned__(PAGE_SIZE), \ | ||
170 | __section__(".data.page_aligned"))) | ||
171 | #endif | ||
172 | |||
173 | #define VM_DATA_DEFAULT_FLAGS \ | 165 | #define VM_DATA_DEFAULT_FLAGS \ |
174 | (test_thread_flag(TIF_32BIT) ? \ | 166 | (test_thread_flag(TIF_32BIT) ? \ |
175 | VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64) | 167 | VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64) |
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h index 5304a37ba425..2360317179a9 100644 --- a/arch/powerpc/include/asm/reg_booke.h +++ b/arch/powerpc/include/asm/reg_booke.h | |||
@@ -4,6 +4,12 @@ | |||
4 | * are not true Book E PowerPCs, they borrowed a number of features | 4 | * are not true Book E PowerPCs, they borrowed a number of features |
5 | * before Book E was finalized, and are included here as well. Unfortunatly, | 5 | * before Book E was finalized, and are included here as well. Unfortunatly, |
6 | * they sometimes used different locations than true Book E CPUs did. | 6 | * they sometimes used different locations than true Book E CPUs did. |
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License version 2 | ||
10 | * as published by the Free Software Foundation. | ||
11 | * | ||
12 | * Copyright 2009-2010 Freescale Semiconductor, Inc. | ||
7 | */ | 13 | */ |
8 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
9 | #ifndef __ASM_POWERPC_REG_BOOKE_H__ | 15 | #ifndef __ASM_POWERPC_REG_BOOKE_H__ |
@@ -88,6 +94,7 @@ | |||
88 | #define SPRN_IVOR35 0x213 /* Interrupt Vector Offset Register 35 */ | 94 | #define SPRN_IVOR35 0x213 /* Interrupt Vector Offset Register 35 */ |
89 | #define SPRN_IVOR36 0x214 /* Interrupt Vector Offset Register 36 */ | 95 | #define SPRN_IVOR36 0x214 /* Interrupt Vector Offset Register 36 */ |
90 | #define SPRN_IVOR37 0x215 /* Interrupt Vector Offset Register 37 */ | 96 | #define SPRN_IVOR37 0x215 /* Interrupt Vector Offset Register 37 */ |
97 | #define SPRN_MCARU 0x239 /* Machine Check Address Register Upper */ | ||
91 | #define SPRN_MCSRR0 0x23A /* Machine Check Save and Restore Register 0 */ | 98 | #define SPRN_MCSRR0 0x23A /* Machine Check Save and Restore Register 0 */ |
92 | #define SPRN_MCSRR1 0x23B /* Machine Check Save and Restore Register 1 */ | 99 | #define SPRN_MCSRR1 0x23B /* Machine Check Save and Restore Register 1 */ |
93 | #define SPRN_MCSR 0x23C /* Machine Check Status Register */ | 100 | #define SPRN_MCSR 0x23C /* Machine Check Status Register */ |
@@ -196,8 +203,11 @@ | |||
196 | #define PPC47x_MCSR_IPR 0x00400000 /* Imprecise Machine Check Exception */ | 203 | #define PPC47x_MCSR_IPR 0x00400000 /* Imprecise Machine Check Exception */ |
197 | 204 | ||
198 | #ifdef CONFIG_E500 | 205 | #ifdef CONFIG_E500 |
206 | /* All e500 */ | ||
199 | #define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */ | 207 | #define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */ |
200 | #define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */ | 208 | #define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */ |
209 | |||
210 | /* e500v1/v2 */ | ||
201 | #define MCSR_DCP_PERR 0x20000000UL /* D-Cache Push Parity Error */ | 211 | #define MCSR_DCP_PERR 0x20000000UL /* D-Cache Push Parity Error */ |
202 | #define MCSR_DCPERR 0x10000000UL /* D-Cache Parity Error */ | 212 | #define MCSR_DCPERR 0x10000000UL /* D-Cache Parity Error */ |
203 | #define MCSR_BUS_IAERR 0x00000080UL /* Instruction Address Error */ | 213 | #define MCSR_BUS_IAERR 0x00000080UL /* Instruction Address Error */ |
@@ -209,12 +219,20 @@ | |||
209 | #define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */ | 219 | #define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */ |
210 | #define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */ | 220 | #define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */ |
211 | 221 | ||
212 | /* e500 parts may set unused bits in MCSR; mask these off */ | 222 | /* e500mc */ |
213 | #define MCSR_MASK (MCSR_MCP | MCSR_ICPERR | MCSR_DCP_PERR | \ | 223 | #define MCSR_DCPERR_MC 0x20000000UL /* D-Cache Parity Error */ |
214 | MCSR_DCPERR | MCSR_BUS_IAERR | MCSR_BUS_RAERR | \ | 224 | #define MCSR_L2MMU_MHIT 0x04000000UL /* Hit on multiple TLB entries */ |
215 | MCSR_BUS_WAERR | MCSR_BUS_IBERR | MCSR_BUS_RBERR | \ | 225 | #define MCSR_NMI 0x00100000UL /* Non-Maskable Interrupt */ |
216 | MCSR_BUS_WBERR | MCSR_BUS_IPERR | MCSR_BUS_RPERR) | 226 | #define MCSR_MAV 0x00080000UL /* MCAR address valid */ |
227 | #define MCSR_MEA 0x00040000UL /* MCAR is effective address */ | ||
228 | #define MCSR_IF 0x00010000UL /* Instruction Fetch */ | ||
229 | #define MCSR_LD 0x00008000UL /* Load */ | ||
230 | #define MCSR_ST 0x00004000UL /* Store */ | ||
231 | #define MCSR_LDG 0x00002000UL /* Guarded Load */ | ||
232 | #define MCSR_TLBSYNC 0x00000002UL /* Multiple tlbsyncs detected */ | ||
233 | #define MCSR_BSL2_ERR 0x00000001UL /* Backside L2 cache error */ | ||
217 | #endif | 234 | #endif |
235 | |||
218 | #ifdef CONFIG_E200 | 236 | #ifdef CONFIG_E200 |
219 | #define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */ | 237 | #define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */ |
220 | #define MCSR_CP_PERR 0x20000000UL /* Cache Push Parity Error */ | 238 | #define MCSR_CP_PERR 0x20000000UL /* Cache Push Parity Error */ |
@@ -225,11 +243,6 @@ | |||
225 | #define MCSR_BUS_DRERR 0x00000008UL /* Read Bus Error on data load */ | 243 | #define MCSR_BUS_DRERR 0x00000008UL /* Read Bus Error on data load */ |
226 | #define MCSR_BUS_WRERR 0x00000004UL /* Write Bus Error on buffered | 244 | #define MCSR_BUS_WRERR 0x00000004UL /* Write Bus Error on buffered |
227 | store or cache line push */ | 245 | store or cache line push */ |
228 | |||
229 | /* e200 parts may set unused bits in MCSR; mask these off */ | ||
230 | #define MCSR_MASK (MCSR_MCP | MCSR_CP_PERR | MCSR_CPERR | \ | ||
231 | MCSR_EXCP_ERR | MCSR_BUS_IRERR | MCSR_BUS_DRERR | \ | ||
232 | MCSR_BUS_WRERR) | ||
233 | #endif | 246 | #endif |
234 | 247 | ||
235 | /* Bit definitions for the DBSR. */ | 248 | /* Bit definitions for the DBSR. */ |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 877326320e74..58d0572de6f9 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -57,8 +57,12 @@ obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | |||
57 | obj-$(CONFIG_E500) += idle_e500.o | 57 | obj-$(CONFIG_E500) += idle_e500.o |
58 | obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o | 58 | obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o |
59 | obj-$(CONFIG_TAU) += tau_6xx.o | 59 | obj-$(CONFIG_TAU) += tau_6xx.o |
60 | obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o \ | 60 | obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o |
61 | swsusp_$(CONFIG_WORD_SIZE).o | 61 | ifeq ($(CONFIG_FSL_BOOKE),y) |
62 | obj-$(CONFIG_HIBERNATION) += swsusp_booke.o | ||
63 | else | ||
64 | obj-$(CONFIG_HIBERNATION) += swsusp_$(CONFIG_WORD_SIZE).o | ||
65 | endif | ||
62 | obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o | 66 | obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o |
63 | obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o | 67 | obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o |
64 | obj-$(CONFIG_44x) += cpu_setup_44x.o | 68 | obj-$(CONFIG_44x) += cpu_setup_44x.o |
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 9556be903e96..87aa0f3c6047 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -1840,7 +1840,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
1840 | .oprofile_cpu_type = "ppc/e500mc", | 1840 | .oprofile_cpu_type = "ppc/e500mc", |
1841 | .oprofile_type = PPC_OPROFILE_FSL_EMB, | 1841 | .oprofile_type = PPC_OPROFILE_FSL_EMB, |
1842 | .cpu_setup = __setup_cpu_e500mc, | 1842 | .cpu_setup = __setup_cpu_e500mc, |
1843 | .machine_check = machine_check_e500, | 1843 | .machine_check = machine_check_e500mc, |
1844 | .platform = "ppce500mc", | 1844 | .platform = "ppce500mc", |
1845 | }, | 1845 | }, |
1846 | { /* default match */ | 1846 | { /* default match */ |
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index 8c066d6a8e4b..b46f2e09bd81 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c | |||
@@ -163,6 +163,7 @@ static void crash_kexec_prepare_cpus(int cpu) | |||
163 | } | 163 | } |
164 | 164 | ||
165 | /* wait for all the CPUs to hit real mode but timeout if they don't come in */ | 165 | /* wait for all the CPUs to hit real mode but timeout if they don't come in */ |
166 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
166 | static void crash_kexec_wait_realmode(int cpu) | 167 | static void crash_kexec_wait_realmode(int cpu) |
167 | { | 168 | { |
168 | unsigned int msecs; | 169 | unsigned int msecs; |
@@ -187,6 +188,7 @@ static void crash_kexec_wait_realmode(int cpu) | |||
187 | } | 188 | } |
188 | mb(); | 189 | mb(); |
189 | } | 190 | } |
191 | #endif | ||
190 | 192 | ||
191 | /* | 193 | /* |
192 | * This function will be called by secondary cpus or by kexec cpu | 194 | * This function will be called by secondary cpus or by kexec cpu |
@@ -445,7 +447,9 @@ void default_machine_crash_shutdown(struct pt_regs *regs) | |||
445 | crash_kexec_prepare_cpus(crashing_cpu); | 447 | crash_kexec_prepare_cpus(crashing_cpu); |
446 | cpu_set(crashing_cpu, cpus_in_crash); | 448 | cpu_set(crashing_cpu, cpus_in_crash); |
447 | crash_kexec_stop_spus(); | 449 | crash_kexec_stop_spus(); |
450 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
448 | crash_kexec_wait_realmode(crashing_cpu); | 451 | crash_kexec_wait_realmode(crashing_cpu); |
452 | #endif | ||
449 | if (ppc_md.kexec_cpu_down) | 453 | if (ppc_md.kexec_cpu_down) |
450 | ppc_md.kexec_cpu_down(1, 0); | 454 | ppc_md.kexec_cpu_down(1, 0); |
451 | } | 455 | } |
diff --git a/arch/powerpc/kernel/fsl_booke_entry_mapping.S b/arch/powerpc/kernel/fsl_booke_entry_mapping.S new file mode 100644 index 000000000000..beb4d78a2304 --- /dev/null +++ b/arch/powerpc/kernel/fsl_booke_entry_mapping.S | |||
@@ -0,0 +1,237 @@ | |||
1 | |||
2 | /* 1. Find the index of the entry we're executing in */ | ||
3 | bl invstr /* Find our address */ | ||
4 | invstr: mflr r6 /* Make it accessible */ | ||
5 | mfmsr r7 | ||
6 | rlwinm r4,r7,27,31,31 /* extract MSR[IS] */ | ||
7 | mfspr r7, SPRN_PID0 | ||
8 | slwi r7,r7,16 | ||
9 | or r7,r7,r4 | ||
10 | mtspr SPRN_MAS6,r7 | ||
11 | tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */ | ||
12 | mfspr r7,SPRN_MAS1 | ||
13 | andis. r7,r7,MAS1_VALID@h | ||
14 | bne match_TLB | ||
15 | |||
16 | mfspr r7,SPRN_MMUCFG | ||
17 | rlwinm r7,r7,21,28,31 /* extract MMUCFG[NPIDS] */ | ||
18 | cmpwi r7,3 | ||
19 | bne match_TLB /* skip if NPIDS != 3 */ | ||
20 | |||
21 | mfspr r7,SPRN_PID1 | ||
22 | slwi r7,r7,16 | ||
23 | or r7,r7,r4 | ||
24 | mtspr SPRN_MAS6,r7 | ||
25 | tlbsx 0,r6 /* search MSR[IS], SPID=PID1 */ | ||
26 | mfspr r7,SPRN_MAS1 | ||
27 | andis. r7,r7,MAS1_VALID@h | ||
28 | bne match_TLB | ||
29 | mfspr r7, SPRN_PID2 | ||
30 | slwi r7,r7,16 | ||
31 | or r7,r7,r4 | ||
32 | mtspr SPRN_MAS6,r7 | ||
33 | tlbsx 0,r6 /* Fall through, we had to match */ | ||
34 | |||
35 | match_TLB: | ||
36 | mfspr r7,SPRN_MAS0 | ||
37 | rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */ | ||
38 | |||
39 | mfspr r7,SPRN_MAS1 /* Insure IPROT set */ | ||
40 | oris r7,r7,MAS1_IPROT@h | ||
41 | mtspr SPRN_MAS1,r7 | ||
42 | tlbwe | ||
43 | |||
44 | /* 2. Invalidate all entries except the entry we're executing in */ | ||
45 | mfspr r9,SPRN_TLB1CFG | ||
46 | andi. r9,r9,0xfff | ||
47 | li r6,0 /* Set Entry counter to 0 */ | ||
48 | 1: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
49 | rlwimi r7,r6,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r6) */ | ||
50 | mtspr SPRN_MAS0,r7 | ||
51 | tlbre | ||
52 | mfspr r7,SPRN_MAS1 | ||
53 | rlwinm r7,r7,0,2,31 /* Clear MAS1 Valid and IPROT */ | ||
54 | cmpw r3,r6 | ||
55 | beq skpinv /* Dont update the current execution TLB */ | ||
56 | mtspr SPRN_MAS1,r7 | ||
57 | tlbwe | ||
58 | isync | ||
59 | skpinv: addi r6,r6,1 /* Increment */ | ||
60 | cmpw r6,r9 /* Are we done? */ | ||
61 | bne 1b /* If not, repeat */ | ||
62 | |||
63 | /* Invalidate TLB0 */ | ||
64 | li r6,0x04 | ||
65 | tlbivax 0,r6 | ||
66 | TLBSYNC | ||
67 | /* Invalidate TLB1 */ | ||
68 | li r6,0x0c | ||
69 | tlbivax 0,r6 | ||
70 | TLBSYNC | ||
71 | |||
72 | /* 3. Setup a temp mapping and jump to it */ | ||
73 | andi. r5, r3, 0x1 /* Find an entry not used and is non-zero */ | ||
74 | addi r5, r5, 0x1 | ||
75 | lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
76 | rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ | ||
77 | mtspr SPRN_MAS0,r7 | ||
78 | tlbre | ||
79 | |||
80 | /* grab and fixup the RPN */ | ||
81 | mfspr r6,SPRN_MAS1 /* extract MAS1[SIZE] */ | ||
82 | rlwinm r6,r6,25,27,31 | ||
83 | li r8,-1 | ||
84 | addi r6,r6,10 | ||
85 | slw r6,r8,r6 /* convert to mask */ | ||
86 | |||
87 | bl 1f /* Find our address */ | ||
88 | 1: mflr r7 | ||
89 | |||
90 | mfspr r8,SPRN_MAS3 | ||
91 | #ifdef CONFIG_PHYS_64BIT | ||
92 | mfspr r23,SPRN_MAS7 | ||
93 | #endif | ||
94 | and r8,r6,r8 | ||
95 | subfic r9,r6,-4096 | ||
96 | and r9,r9,r7 | ||
97 | |||
98 | or r25,r8,r9 | ||
99 | ori r8,r25,(MAS3_SX|MAS3_SW|MAS3_SR) | ||
100 | |||
101 | /* Just modify the entry ID and EPN for the temp mapping */ | ||
102 | lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
103 | rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ | ||
104 | mtspr SPRN_MAS0,r7 | ||
105 | xori r6,r4,1 /* Setup TMP mapping in the other Address space */ | ||
106 | slwi r6,r6,12 | ||
107 | oris r6,r6,(MAS1_VALID|MAS1_IPROT)@h | ||
108 | ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_4K))@l | ||
109 | mtspr SPRN_MAS1,r6 | ||
110 | mfspr r6,SPRN_MAS2 | ||
111 | li r7,0 /* temp EPN = 0 */ | ||
112 | rlwimi r7,r6,0,20,31 | ||
113 | mtspr SPRN_MAS2,r7 | ||
114 | mtspr SPRN_MAS3,r8 | ||
115 | tlbwe | ||
116 | |||
117 | xori r6,r4,1 | ||
118 | slwi r6,r6,5 /* setup new context with other address space */ | ||
119 | bl 1f /* Find our address */ | ||
120 | 1: mflr r9 | ||
121 | rlwimi r7,r9,0,20,31 | ||
122 | addi r7,r7,(2f - 1b) | ||
123 | mtspr SPRN_SRR0,r7 | ||
124 | mtspr SPRN_SRR1,r6 | ||
125 | rfi | ||
126 | 2: | ||
127 | /* 4. Clear out PIDs & Search info */ | ||
128 | li r6,0 | ||
129 | mtspr SPRN_MAS6,r6 | ||
130 | mtspr SPRN_PID0,r6 | ||
131 | |||
132 | mfspr r7,SPRN_MMUCFG | ||
133 | rlwinm r7,r7,21,28,31 /* extract MMUCFG[NPIDS] */ | ||
134 | cmpwi r7,3 | ||
135 | bne 2f /* skip if NPIDS != 3 */ | ||
136 | |||
137 | mtspr SPRN_PID1,r6 | ||
138 | mtspr SPRN_PID2,r6 | ||
139 | |||
140 | /* 5. Invalidate mapping we started in */ | ||
141 | 2: | ||
142 | lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
143 | rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ | ||
144 | mtspr SPRN_MAS0,r7 | ||
145 | tlbre | ||
146 | mfspr r6,SPRN_MAS1 | ||
147 | rlwinm r6,r6,0,2,0 /* clear IPROT */ | ||
148 | mtspr SPRN_MAS1,r6 | ||
149 | tlbwe | ||
150 | /* Invalidate TLB1 */ | ||
151 | li r9,0x0c | ||
152 | tlbivax 0,r9 | ||
153 | TLBSYNC | ||
154 | |||
155 | /* The mapping only needs to be cache-coherent on SMP */ | ||
156 | #ifdef CONFIG_SMP | ||
157 | #define M_IF_SMP MAS2_M | ||
158 | #else | ||
159 | #define M_IF_SMP 0 | ||
160 | #endif | ||
161 | |||
162 | #if defined(ENTRY_MAPPING_BOOT_SETUP) | ||
163 | |||
164 | /* 6. Setup KERNELBASE mapping in TLB1[0] */ | ||
165 | lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */ | ||
166 | mtspr SPRN_MAS0,r6 | ||
167 | lis r6,(MAS1_VALID|MAS1_IPROT)@h | ||
168 | ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_64M))@l | ||
169 | mtspr SPRN_MAS1,r6 | ||
170 | lis r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_SMP)@h | ||
171 | ori r6,r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_SMP)@l | ||
172 | mtspr SPRN_MAS2,r6 | ||
173 | mtspr SPRN_MAS3,r8 | ||
174 | tlbwe | ||
175 | |||
176 | /* 7. Jump to KERNELBASE mapping */ | ||
177 | lis r6,(KERNELBASE & ~0xfff)@h | ||
178 | ori r6,r6,(KERNELBASE & ~0xfff)@l | ||
179 | |||
180 | #elif defined(ENTRY_MAPPING_KEXEC_SETUP) | ||
181 | /* | ||
182 | * 6. Setup a 1:1 mapping in TLB1. Esel 0 is unsued, 1 or 2 contains the tmp | ||
183 | * mapping so we start at 3. We setup 8 mappings, each 256MiB in size. This | ||
184 | * will cover the first 2GiB of memory. | ||
185 | */ | ||
186 | |||
187 | lis r10, (MAS1_VALID|MAS1_IPROT)@h | ||
188 | ori r10,r10, (MAS1_TSIZE(BOOK3E_PAGESZ_256M))@l | ||
189 | li r11, 0 | ||
190 | li r0, 8 | ||
191 | mtctr r0 | ||
192 | |||
193 | next_tlb_setup: | ||
194 | addi r0, r11, 3 | ||
195 | rlwinm r0, r0, 16, 4, 15 // Compute esel | ||
196 | rlwinm r9, r11, 28, 0, 3 // Compute [ER]PN | ||
197 | oris r0, r0, (MAS0_TLBSEL(1))@h | ||
198 | mtspr SPRN_MAS0,r0 | ||
199 | mtspr SPRN_MAS1,r10 | ||
200 | mtspr SPRN_MAS2,r9 | ||
201 | ori r9, r9, (MAS3_SX|MAS3_SW|MAS3_SR) | ||
202 | mtspr SPRN_MAS3,r9 | ||
203 | tlbwe | ||
204 | addi r11, r11, 1 | ||
205 | bdnz+ next_tlb_setup | ||
206 | |||
207 | /* 7. Jump to our 1:1 mapping */ | ||
208 | li r6, 0 | ||
209 | |||
210 | #else | ||
211 | #error You need to specify the mapping or not use this at all. | ||
212 | #endif | ||
213 | |||
214 | lis r7,MSR_KERNEL@h | ||
215 | ori r7,r7,MSR_KERNEL@l | ||
216 | bl 1f /* Find our address */ | ||
217 | 1: mflr r9 | ||
218 | rlwimi r6,r9,0,20,31 | ||
219 | addi r6,r6,(2f - 1b) | ||
220 | add r6, r6, r25 | ||
221 | mtspr SPRN_SRR0,r6 | ||
222 | mtspr SPRN_SRR1,r7 | ||
223 | rfi /* start execution out of TLB1[0] entry */ | ||
224 | |||
225 | /* 8. Clear out the temp mapping */ | ||
226 | 2: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
227 | rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ | ||
228 | mtspr SPRN_MAS0,r7 | ||
229 | tlbre | ||
230 | mfspr r8,SPRN_MAS1 | ||
231 | rlwinm r8,r8,0,2,0 /* clear IPROT */ | ||
232 | mtspr SPRN_MAS1,r8 | ||
233 | tlbwe | ||
234 | /* Invalidate TLB1 */ | ||
235 | li r9,0x0c | ||
236 | tlbivax 0,r9 | ||
237 | TLBSYNC | ||
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S index edd4a57fd29e..4faeba247854 100644 --- a/arch/powerpc/kernel/head_fsl_booke.S +++ b/arch/powerpc/kernel/head_fsl_booke.S | |||
@@ -94,204 +94,10 @@ _ENTRY(_start); | |||
94 | */ | 94 | */ |
95 | 95 | ||
96 | _ENTRY(__early_start) | 96 | _ENTRY(__early_start) |
97 | /* 1. Find the index of the entry we're executing in */ | ||
98 | bl invstr /* Find our address */ | ||
99 | invstr: mflr r6 /* Make it accessible */ | ||
100 | mfmsr r7 | ||
101 | rlwinm r4,r7,27,31,31 /* extract MSR[IS] */ | ||
102 | mfspr r7, SPRN_PID0 | ||
103 | slwi r7,r7,16 | ||
104 | or r7,r7,r4 | ||
105 | mtspr SPRN_MAS6,r7 | ||
106 | tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */ | ||
107 | mfspr r7,SPRN_MAS1 | ||
108 | andis. r7,r7,MAS1_VALID@h | ||
109 | bne match_TLB | ||
110 | |||
111 | mfspr r7,SPRN_MMUCFG | ||
112 | rlwinm r7,r7,21,28,31 /* extract MMUCFG[NPIDS] */ | ||
113 | cmpwi r7,3 | ||
114 | bne match_TLB /* skip if NPIDS != 3 */ | ||
115 | |||
116 | mfspr r7,SPRN_PID1 | ||
117 | slwi r7,r7,16 | ||
118 | or r7,r7,r4 | ||
119 | mtspr SPRN_MAS6,r7 | ||
120 | tlbsx 0,r6 /* search MSR[IS], SPID=PID1 */ | ||
121 | mfspr r7,SPRN_MAS1 | ||
122 | andis. r7,r7,MAS1_VALID@h | ||
123 | bne match_TLB | ||
124 | mfspr r7, SPRN_PID2 | ||
125 | slwi r7,r7,16 | ||
126 | or r7,r7,r4 | ||
127 | mtspr SPRN_MAS6,r7 | ||
128 | tlbsx 0,r6 /* Fall through, we had to match */ | ||
129 | |||
130 | match_TLB: | ||
131 | mfspr r7,SPRN_MAS0 | ||
132 | rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */ | ||
133 | |||
134 | mfspr r7,SPRN_MAS1 /* Insure IPROT set */ | ||
135 | oris r7,r7,MAS1_IPROT@h | ||
136 | mtspr SPRN_MAS1,r7 | ||
137 | tlbwe | ||
138 | |||
139 | /* 2. Invalidate all entries except the entry we're executing in */ | ||
140 | mfspr r9,SPRN_TLB1CFG | ||
141 | andi. r9,r9,0xfff | ||
142 | li r6,0 /* Set Entry counter to 0 */ | ||
143 | 1: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
144 | rlwimi r7,r6,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r6) */ | ||
145 | mtspr SPRN_MAS0,r7 | ||
146 | tlbre | ||
147 | mfspr r7,SPRN_MAS1 | ||
148 | rlwinm r7,r7,0,2,31 /* Clear MAS1 Valid and IPROT */ | ||
149 | cmpw r3,r6 | ||
150 | beq skpinv /* Dont update the current execution TLB */ | ||
151 | mtspr SPRN_MAS1,r7 | ||
152 | tlbwe | ||
153 | isync | ||
154 | skpinv: addi r6,r6,1 /* Increment */ | ||
155 | cmpw r6,r9 /* Are we done? */ | ||
156 | bne 1b /* If not, repeat */ | ||
157 | |||
158 | /* Invalidate TLB0 */ | ||
159 | li r6,0x04 | ||
160 | tlbivax 0,r6 | ||
161 | TLBSYNC | ||
162 | /* Invalidate TLB1 */ | ||
163 | li r6,0x0c | ||
164 | tlbivax 0,r6 | ||
165 | TLBSYNC | ||
166 | |||
167 | /* 3. Setup a temp mapping and jump to it */ | ||
168 | andi. r5, r3, 0x1 /* Find an entry not used and is non-zero */ | ||
169 | addi r5, r5, 0x1 | ||
170 | lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
171 | rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ | ||
172 | mtspr SPRN_MAS0,r7 | ||
173 | tlbre | ||
174 | |||
175 | /* grab and fixup the RPN */ | ||
176 | mfspr r6,SPRN_MAS1 /* extract MAS1[SIZE] */ | ||
177 | rlwinm r6,r6,25,27,31 | ||
178 | li r8,-1 | ||
179 | addi r6,r6,10 | ||
180 | slw r6,r8,r6 /* convert to mask */ | ||
181 | |||
182 | bl 1f /* Find our address */ | ||
183 | 1: mflr r7 | ||
184 | |||
185 | mfspr r8,SPRN_MAS3 | ||
186 | #ifdef CONFIG_PHYS_64BIT | ||
187 | mfspr r23,SPRN_MAS7 | ||
188 | #endif | ||
189 | and r8,r6,r8 | ||
190 | subfic r9,r6,-4096 | ||
191 | and r9,r9,r7 | ||
192 | |||
193 | or r25,r8,r9 | ||
194 | ori r8,r25,(MAS3_SX|MAS3_SW|MAS3_SR) | ||
195 | |||
196 | /* Just modify the entry ID and EPN for the temp mapping */ | ||
197 | lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
198 | rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ | ||
199 | mtspr SPRN_MAS0,r7 | ||
200 | xori r6,r4,1 /* Setup TMP mapping in the other Address space */ | ||
201 | slwi r6,r6,12 | ||
202 | oris r6,r6,(MAS1_VALID|MAS1_IPROT)@h | ||
203 | ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_4K))@l | ||
204 | mtspr SPRN_MAS1,r6 | ||
205 | mfspr r6,SPRN_MAS2 | ||
206 | li r7,0 /* temp EPN = 0 */ | ||
207 | rlwimi r7,r6,0,20,31 | ||
208 | mtspr SPRN_MAS2,r7 | ||
209 | mtspr SPRN_MAS3,r8 | ||
210 | tlbwe | ||
211 | |||
212 | xori r6,r4,1 | ||
213 | slwi r6,r6,5 /* setup new context with other address space */ | ||
214 | bl 1f /* Find our address */ | ||
215 | 1: mflr r9 | ||
216 | rlwimi r7,r9,0,20,31 | ||
217 | addi r7,r7,(2f - 1b) | ||
218 | mtspr SPRN_SRR0,r7 | ||
219 | mtspr SPRN_SRR1,r6 | ||
220 | rfi | ||
221 | 2: | ||
222 | /* 4. Clear out PIDs & Search info */ | ||
223 | li r6,0 | ||
224 | mtspr SPRN_MAS6,r6 | ||
225 | mtspr SPRN_PID0,r6 | ||
226 | |||
227 | mfspr r7,SPRN_MMUCFG | ||
228 | rlwinm r7,r7,21,28,31 /* extract MMUCFG[NPIDS] */ | ||
229 | cmpwi r7,3 | ||
230 | bne 2f /* skip if NPIDS != 3 */ | ||
231 | 97 | ||
232 | mtspr SPRN_PID1,r6 | 98 | #define ENTRY_MAPPING_BOOT_SETUP |
233 | mtspr SPRN_PID2,r6 | 99 | #include "fsl_booke_entry_mapping.S" |
234 | 100 | #undef ENTRY_MAPPING_BOOT_SETUP | |
235 | /* 5. Invalidate mapping we started in */ | ||
236 | 2: | ||
237 | lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
238 | rlwimi r7,r3,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r3) */ | ||
239 | mtspr SPRN_MAS0,r7 | ||
240 | tlbre | ||
241 | mfspr r6,SPRN_MAS1 | ||
242 | rlwinm r6,r6,0,2,0 /* clear IPROT */ | ||
243 | mtspr SPRN_MAS1,r6 | ||
244 | tlbwe | ||
245 | /* Invalidate TLB1 */ | ||
246 | li r9,0x0c | ||
247 | tlbivax 0,r9 | ||
248 | TLBSYNC | ||
249 | |||
250 | /* The mapping only needs to be cache-coherent on SMP */ | ||
251 | #ifdef CONFIG_SMP | ||
252 | #define M_IF_SMP MAS2_M | ||
253 | #else | ||
254 | #define M_IF_SMP 0 | ||
255 | #endif | ||
256 | |||
257 | /* 6. Setup KERNELBASE mapping in TLB1[0] */ | ||
258 | lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */ | ||
259 | mtspr SPRN_MAS0,r6 | ||
260 | lis r6,(MAS1_VALID|MAS1_IPROT)@h | ||
261 | ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_64M))@l | ||
262 | mtspr SPRN_MAS1,r6 | ||
263 | lis r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_SMP)@h | ||
264 | ori r6,r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_SMP)@l | ||
265 | mtspr SPRN_MAS2,r6 | ||
266 | mtspr SPRN_MAS3,r8 | ||
267 | tlbwe | ||
268 | |||
269 | /* 7. Jump to KERNELBASE mapping */ | ||
270 | lis r6,(KERNELBASE & ~0xfff)@h | ||
271 | ori r6,r6,(KERNELBASE & ~0xfff)@l | ||
272 | lis r7,MSR_KERNEL@h | ||
273 | ori r7,r7,MSR_KERNEL@l | ||
274 | bl 1f /* Find our address */ | ||
275 | 1: mflr r9 | ||
276 | rlwimi r6,r9,0,20,31 | ||
277 | addi r6,r6,(2f - 1b) | ||
278 | mtspr SPRN_SRR0,r6 | ||
279 | mtspr SPRN_SRR1,r7 | ||
280 | rfi /* start execution out of TLB1[0] entry */ | ||
281 | |||
282 | /* 8. Clear out the temp mapping */ | ||
283 | 2: lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | ||
284 | rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ | ||
285 | mtspr SPRN_MAS0,r7 | ||
286 | tlbre | ||
287 | mfspr r8,SPRN_MAS1 | ||
288 | rlwinm r8,r8,0,2,0 /* clear IPROT */ | ||
289 | mtspr SPRN_MAS1,r8 | ||
290 | tlbwe | ||
291 | /* Invalidate TLB1 */ | ||
292 | li r9,0x0c | ||
293 | tlbivax 0,r9 | ||
294 | TLBSYNC | ||
295 | 101 | ||
296 | /* Establish the interrupt vector offsets */ | 102 | /* Establish the interrupt vector offsets */ |
297 | SET_IVOR(0, CriticalInput); | 103 | SET_IVOR(0, CriticalInput); |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 8043d1b73cf0..dc66d52dcff5 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -711,6 +711,22 @@ relocate_new_kernel: | |||
711 | /* r4 = reboot_code_buffer */ | 711 | /* r4 = reboot_code_buffer */ |
712 | /* r5 = start_address */ | 712 | /* r5 = start_address */ |
713 | 713 | ||
714 | #ifdef CONFIG_FSL_BOOKE | ||
715 | |||
716 | mr r29, r3 | ||
717 | mr r30, r4 | ||
718 | mr r31, r5 | ||
719 | |||
720 | #define ENTRY_MAPPING_KEXEC_SETUP | ||
721 | #include "fsl_booke_entry_mapping.S" | ||
722 | #undef ENTRY_MAPPING_KEXEC_SETUP | ||
723 | |||
724 | mr r3, r29 | ||
725 | mr r4, r30 | ||
726 | mr r5, r31 | ||
727 | |||
728 | li r0, 0 | ||
729 | #else | ||
714 | li r0, 0 | 730 | li r0, 0 |
715 | 731 | ||
716 | /* | 732 | /* |
@@ -727,6 +743,7 @@ relocate_new_kernel: | |||
727 | rfi | 743 | rfi |
728 | 744 | ||
729 | 1: | 745 | 1: |
746 | #endif | ||
730 | /* from this point address translation is turned off */ | 747 | /* from this point address translation is turned off */ |
731 | /* and interrupts are disabled */ | 748 | /* and interrupts are disabled */ |
732 | 749 | ||
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index bc9f39d2598b..3b4dcc82a4c1 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -101,7 +101,7 @@ EXPORT_SYMBOL(pci_dram_offset); | |||
101 | EXPORT_SYMBOL(start_thread); | 101 | EXPORT_SYMBOL(start_thread); |
102 | EXPORT_SYMBOL(kernel_thread); | 102 | EXPORT_SYMBOL(kernel_thread); |
103 | 103 | ||
104 | #ifndef CONFIG_BOOKE | 104 | #ifdef CONFIG_PPC_FPU |
105 | EXPORT_SYMBOL_GPL(cvt_df); | 105 | EXPORT_SYMBOL_GPL(cvt_df); |
106 | EXPORT_SYMBOL_GPL(cvt_fd); | 106 | EXPORT_SYMBOL_GPL(cvt_fd); |
107 | #endif | 107 | #endif |
diff --git a/arch/powerpc/kernel/swsusp_booke.S b/arch/powerpc/kernel/swsusp_booke.S new file mode 100644 index 000000000000..11a39307dd71 --- /dev/null +++ b/arch/powerpc/kernel/swsusp_booke.S | |||
@@ -0,0 +1,193 @@ | |||
1 | /* | ||
2 | * Based on swsusp_32.S, modified for FSL BookE by | ||
3 | * Anton Vorontsov <avorontsov@ru.mvista.com> | ||
4 | * Copyright (c) 2009-2010 MontaVista Software, LLC. | ||
5 | */ | ||
6 | |||
7 | #include <linux/threads.h> | ||
8 | #include <asm/processor.h> | ||
9 | #include <asm/page.h> | ||
10 | #include <asm/cputable.h> | ||
11 | #include <asm/thread_info.h> | ||
12 | #include <asm/ppc_asm.h> | ||
13 | #include <asm/asm-offsets.h> | ||
14 | #include <asm/mmu.h> | ||
15 | |||
16 | /* | ||
17 | * Structure for storing CPU registers on the save area. | ||
18 | */ | ||
19 | #define SL_SP 0 | ||
20 | #define SL_PC 4 | ||
21 | #define SL_MSR 8 | ||
22 | #define SL_TCR 0xc | ||
23 | #define SL_SPRG0 0x10 | ||
24 | #define SL_SPRG1 0x14 | ||
25 | #define SL_SPRG2 0x18 | ||
26 | #define SL_SPRG3 0x1c | ||
27 | #define SL_SPRG4 0x20 | ||
28 | #define SL_SPRG5 0x24 | ||
29 | #define SL_SPRG6 0x28 | ||
30 | #define SL_SPRG7 0x2c | ||
31 | #define SL_TBU 0x30 | ||
32 | #define SL_TBL 0x34 | ||
33 | #define SL_R2 0x38 | ||
34 | #define SL_CR 0x3c | ||
35 | #define SL_LR 0x40 | ||
36 | #define SL_R12 0x44 /* r12 to r31 */ | ||
37 | #define SL_SIZE (SL_R12 + 80) | ||
38 | |||
39 | .section .data | ||
40 | .align 5 | ||
41 | |||
42 | _GLOBAL(swsusp_save_area) | ||
43 | .space SL_SIZE | ||
44 | |||
45 | |||
46 | .section .text | ||
47 | .align 5 | ||
48 | |||
49 | _GLOBAL(swsusp_arch_suspend) | ||
50 | lis r11,swsusp_save_area@h | ||
51 | ori r11,r11,swsusp_save_area@l | ||
52 | |||
53 | mflr r0 | ||
54 | stw r0,SL_LR(r11) | ||
55 | mfcr r0 | ||
56 | stw r0,SL_CR(r11) | ||
57 | stw r1,SL_SP(r11) | ||
58 | stw r2,SL_R2(r11) | ||
59 | stmw r12,SL_R12(r11) | ||
60 | |||
61 | /* Save MSR & TCR */ | ||
62 | mfmsr r4 | ||
63 | stw r4,SL_MSR(r11) | ||
64 | mfspr r4,SPRN_TCR | ||
65 | stw r4,SL_TCR(r11) | ||
66 | |||
67 | /* Get a stable timebase and save it */ | ||
68 | 1: mfspr r4,SPRN_TBRU | ||
69 | stw r4,SL_TBU(r11) | ||
70 | mfspr r5,SPRN_TBRL | ||
71 | stw r5,SL_TBL(r11) | ||
72 | mfspr r3,SPRN_TBRU | ||
73 | cmpw r3,r4 | ||
74 | bne 1b | ||
75 | |||
76 | /* Save SPRGs */ | ||
77 | mfsprg r4,0 | ||
78 | stw r4,SL_SPRG0(r11) | ||
79 | mfsprg r4,1 | ||
80 | stw r4,SL_SPRG1(r11) | ||
81 | mfsprg r4,2 | ||
82 | stw r4,SL_SPRG2(r11) | ||
83 | mfsprg r4,3 | ||
84 | stw r4,SL_SPRG3(r11) | ||
85 | mfsprg r4,4 | ||
86 | stw r4,SL_SPRG4(r11) | ||
87 | mfsprg r4,5 | ||
88 | stw r4,SL_SPRG5(r11) | ||
89 | mfsprg r4,6 | ||
90 | stw r4,SL_SPRG6(r11) | ||
91 | mfsprg r4,7 | ||
92 | stw r4,SL_SPRG7(r11) | ||
93 | |||
94 | /* Call the low level suspend stuff (we should probably have made | ||
95 | * a stackframe... | ||
96 | */ | ||
97 | bl swsusp_save | ||
98 | |||
99 | /* Restore LR from the save area */ | ||
100 | lis r11,swsusp_save_area@h | ||
101 | ori r11,r11,swsusp_save_area@l | ||
102 | lwz r0,SL_LR(r11) | ||
103 | mtlr r0 | ||
104 | |||
105 | blr | ||
106 | |||
107 | _GLOBAL(swsusp_arch_resume) | ||
108 | sync | ||
109 | |||
110 | /* Load ptr the list of pages to copy in r3 */ | ||
111 | lis r11,(restore_pblist)@h | ||
112 | ori r11,r11,restore_pblist@l | ||
113 | lwz r3,0(r11) | ||
114 | |||
115 | /* Copy the pages. This is a very basic implementation, to | ||
116 | * be replaced by something more cache efficient */ | ||
117 | 1: | ||
118 | li r0,256 | ||
119 | mtctr r0 | ||
120 | lwz r5,pbe_address(r3) /* source */ | ||
121 | lwz r6,pbe_orig_address(r3) /* destination */ | ||
122 | 2: | ||
123 | lwz r8,0(r5) | ||
124 | lwz r9,4(r5) | ||
125 | lwz r10,8(r5) | ||
126 | lwz r11,12(r5) | ||
127 | addi r5,r5,16 | ||
128 | stw r8,0(r6) | ||
129 | stw r9,4(r6) | ||
130 | stw r10,8(r6) | ||
131 | stw r11,12(r6) | ||
132 | addi r6,r6,16 | ||
133 | bdnz 2b | ||
134 | lwz r3,pbe_next(r3) | ||
135 | cmpwi 0,r3,0 | ||
136 | bne 1b | ||
137 | |||
138 | bl flush_dcache_L1 | ||
139 | bl flush_instruction_cache | ||
140 | |||
141 | lis r11,swsusp_save_area@h | ||
142 | ori r11,r11,swsusp_save_area@l | ||
143 | |||
144 | lwz r4,SL_SPRG0(r11) | ||
145 | mtsprg 0,r4 | ||
146 | lwz r4,SL_SPRG1(r11) | ||
147 | mtsprg 1,r4 | ||
148 | lwz r4,SL_SPRG2(r11) | ||
149 | mtsprg 2,r4 | ||
150 | lwz r4,SL_SPRG3(r11) | ||
151 | mtsprg 3,r4 | ||
152 | lwz r4,SL_SPRG4(r11) | ||
153 | mtsprg 4,r4 | ||
154 | lwz r4,SL_SPRG5(r11) | ||
155 | mtsprg 5,r4 | ||
156 | lwz r4,SL_SPRG6(r11) | ||
157 | mtsprg 6,r4 | ||
158 | lwz r4,SL_SPRG7(r11) | ||
159 | mtsprg 7,r4 | ||
160 | |||
161 | /* restore the MSR */ | ||
162 | lwz r3,SL_MSR(r11) | ||
163 | mtmsr r3 | ||
164 | |||
165 | /* Restore TB */ | ||
166 | li r3,0 | ||
167 | mtspr SPRN_TBWL,r3 | ||
168 | lwz r3,SL_TBU(r11) | ||
169 | lwz r4,SL_TBL(r11) | ||
170 | mtspr SPRN_TBWU,r3 | ||
171 | mtspr SPRN_TBWL,r4 | ||
172 | |||
173 | /* Restore TCR and clear any pending bits in TSR. */ | ||
174 | lwz r4,SL_TCR(r11) | ||
175 | mtspr SPRN_TCR,r4 | ||
176 | lis r4, (TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS)@h | ||
177 | mtspr SPRN_TSR,r4 | ||
178 | |||
179 | /* Kick decrementer */ | ||
180 | li r0,1 | ||
181 | mtdec r0 | ||
182 | |||
183 | /* Restore the callee-saved registers and return */ | ||
184 | lwz r0,SL_CR(r11) | ||
185 | mtcr r0 | ||
186 | lwz r2,SL_R2(r11) | ||
187 | lmw r12,SL_R12(r11) | ||
188 | lwz r1,SL_SP(r11) | ||
189 | lwz r0,SL_LR(r11) | ||
190 | mtlr r0 | ||
191 | |||
192 | li r3,0 | ||
193 | blr | ||
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 3031fc712ad0..25fc33984c2b 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) | 2 | * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) |
3 | * Copyright 2007-2010 Freescale Semiconductor, Inc. | ||
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License | 6 | * modify it under the terms of the GNU General Public License |
@@ -305,7 +306,7 @@ static inline int check_io_access(struct pt_regs *regs) | |||
305 | #ifndef CONFIG_FSL_BOOKE | 306 | #ifndef CONFIG_FSL_BOOKE |
306 | #define get_mc_reason(regs) ((regs)->dsisr) | 307 | #define get_mc_reason(regs) ((regs)->dsisr) |
307 | #else | 308 | #else |
308 | #define get_mc_reason(regs) (mfspr(SPRN_MCSR) & MCSR_MASK) | 309 | #define get_mc_reason(regs) (mfspr(SPRN_MCSR)) |
309 | #endif | 310 | #endif |
310 | #define REASON_FP ESR_FP | 311 | #define REASON_FP ESR_FP |
311 | #define REASON_ILLEGAL (ESR_PIL | ESR_PUO) | 312 | #define REASON_ILLEGAL (ESR_PIL | ESR_PUO) |
@@ -421,6 +422,91 @@ int machine_check_47x(struct pt_regs *regs) | |||
421 | return 0; | 422 | return 0; |
422 | } | 423 | } |
423 | #elif defined(CONFIG_E500) | 424 | #elif defined(CONFIG_E500) |
425 | int machine_check_e500mc(struct pt_regs *regs) | ||
426 | { | ||
427 | unsigned long mcsr = mfspr(SPRN_MCSR); | ||
428 | unsigned long reason = mcsr; | ||
429 | int recoverable = 1; | ||
430 | |||
431 | printk("Machine check in kernel mode.\n"); | ||
432 | printk("Caused by (from MCSR=%lx): ", reason); | ||
433 | |||
434 | if (reason & MCSR_MCP) | ||
435 | printk("Machine Check Signal\n"); | ||
436 | |||
437 | if (reason & MCSR_ICPERR) { | ||
438 | printk("Instruction Cache Parity Error\n"); | ||
439 | |||
440 | /* | ||
441 | * This is recoverable by invalidating the i-cache. | ||
442 | */ | ||
443 | mtspr(SPRN_L1CSR1, mfspr(SPRN_L1CSR1) | L1CSR1_ICFI); | ||
444 | while (mfspr(SPRN_L1CSR1) & L1CSR1_ICFI) | ||
445 | ; | ||
446 | |||
447 | /* | ||
448 | * This will generally be accompanied by an instruction | ||
449 | * fetch error report -- only treat MCSR_IF as fatal | ||
450 | * if it wasn't due to an L1 parity error. | ||
451 | */ | ||
452 | reason &= ~MCSR_IF; | ||
453 | } | ||
454 | |||
455 | if (reason & MCSR_DCPERR_MC) { | ||
456 | printk("Data Cache Parity Error\n"); | ||
457 | recoverable = 0; | ||
458 | } | ||
459 | |||
460 | if (reason & MCSR_L2MMU_MHIT) { | ||
461 | printk("Hit on multiple TLB entries\n"); | ||
462 | recoverable = 0; | ||
463 | } | ||
464 | |||
465 | if (reason & MCSR_NMI) | ||
466 | printk("Non-maskable interrupt\n"); | ||
467 | |||
468 | if (reason & MCSR_IF) { | ||
469 | printk("Instruction Fetch Error Report\n"); | ||
470 | recoverable = 0; | ||
471 | } | ||
472 | |||
473 | if (reason & MCSR_LD) { | ||
474 | printk("Load Error Report\n"); | ||
475 | recoverable = 0; | ||
476 | } | ||
477 | |||
478 | if (reason & MCSR_ST) { | ||
479 | printk("Store Error Report\n"); | ||
480 | recoverable = 0; | ||
481 | } | ||
482 | |||
483 | if (reason & MCSR_LDG) { | ||
484 | printk("Guarded Load Error Report\n"); | ||
485 | recoverable = 0; | ||
486 | } | ||
487 | |||
488 | if (reason & MCSR_TLBSYNC) | ||
489 | printk("Simultaneous tlbsync operations\n"); | ||
490 | |||
491 | if (reason & MCSR_BSL2_ERR) { | ||
492 | printk("Level 2 Cache Error\n"); | ||
493 | recoverable = 0; | ||
494 | } | ||
495 | |||
496 | if (reason & MCSR_MAV) { | ||
497 | u64 addr; | ||
498 | |||
499 | addr = mfspr(SPRN_MCAR); | ||
500 | addr |= (u64)mfspr(SPRN_MCARU) << 32; | ||
501 | |||
502 | printk("Machine Check %s Address: %#llx\n", | ||
503 | reason & MCSR_MEA ? "Effective" : "Physical", addr); | ||
504 | } | ||
505 | |||
506 | mtspr(SPRN_MCSR, mcsr); | ||
507 | return mfspr(SPRN_MCSR) == 0 && recoverable; | ||
508 | } | ||
509 | |||
424 | int machine_check_e500(struct pt_regs *regs) | 510 | int machine_check_e500(struct pt_regs *regs) |
425 | { | 511 | { |
426 | unsigned long reason = get_mc_reason(regs); | 512 | unsigned long reason = get_mc_reason(regs); |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index dcd01c82e701..8a0deefac08d 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -223,19 +223,17 @@ SECTIONS | |||
223 | #endif | 223 | #endif |
224 | 224 | ||
225 | /* The initial task and kernel stack */ | 225 | /* The initial task and kernel stack */ |
226 | .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) { | 226 | INIT_TASK_DATA_SECTION(THREAD_SIZE) |
227 | INIT_TASK_DATA(THREAD_SIZE) | ||
228 | } | ||
229 | 227 | ||
230 | .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) { | 228 | .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) { |
231 | PAGE_ALIGNED_DATA(PAGE_SIZE) | 229 | PAGE_ALIGNED_DATA(PAGE_SIZE) |
232 | } | 230 | } |
233 | 231 | ||
234 | .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) { | 232 | .data..cacheline_aligned : AT(ADDR(.data..cacheline_aligned) - LOAD_OFFSET) { |
235 | CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) | 233 | CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) |
236 | } | 234 | } |
237 | 235 | ||
238 | .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { | 236 | .data..read_mostly : AT(ADDR(.data..read_mostly) - LOAD_OFFSET) { |
239 | READ_MOSTLY_DATA(L1_CACHE_BYTES) | 237 | READ_MOSTLY_DATA(L1_CACHE_BYTES) |
240 | } | 238 | } |
241 | 239 | ||
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig index eeba0a70e466..69d668c072ae 100644 --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig | |||
@@ -171,6 +171,17 @@ config ISS4xx | |||
171 | help | 171 | help |
172 | This option enables support for the IBM ISS simulation environment | 172 | This option enables support for the IBM ISS simulation environment |
173 | 173 | ||
174 | config ICON | ||
175 | bool "Icon" | ||
176 | depends on 44x | ||
177 | default n | ||
178 | select PPC44x_SIMPLE | ||
179 | select 440SPe | ||
180 | select PCI | ||
181 | select PPC4xx_PCI_EXPRESS | ||
182 | help | ||
183 | This option enables support for the AMCC PPC440SPe evaluation board. | ||
184 | |||
174 | #config LUAN | 185 | #config LUAN |
175 | # bool "Luan" | 186 | # bool "Luan" |
176 | # depends on 44x | 187 | # depends on 44x |
diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c index e8c23ccaa1fc..5f7a29d7f590 100644 --- a/arch/powerpc/platforms/44x/ppc44x_simple.c +++ b/arch/powerpc/platforms/44x/ppc44x_simple.c | |||
@@ -61,7 +61,8 @@ static char *board[] __initdata = { | |||
61 | "amcc,redwood", | 61 | "amcc,redwood", |
62 | "amcc,sequoia", | 62 | "amcc,sequoia", |
63 | "amcc,taishan", | 63 | "amcc,taishan", |
64 | "amcc,yosemite" | 64 | "amcc,yosemite", |
65 | "mosaixtech,icon" | ||
65 | }; | 66 | }; |
66 | 67 | ||
67 | static int __init ppc44x_probe(void) | 68 | static int __init ppc44x_probe(void) |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index f0684c8ac960..8fe87fc61485 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) Freescale Semicondutor, Inc. 2006-2007. All rights reserved. | 2 | * Copyright (C) Freescale Semicondutor, Inc. 2006-2010. All rights reserved. |
3 | * | 3 | * |
4 | * Author: Andy Fleming <afleming@freescale.com> | 4 | * Author: Andy Fleming <afleming@freescale.com> |
5 | * | 5 | * |
@@ -154,6 +154,10 @@ static int mpc8568_mds_phy_fixups(struct phy_device *phydev) | |||
154 | * Setup the architecture | 154 | * Setup the architecture |
155 | * | 155 | * |
156 | */ | 156 | */ |
157 | #ifdef CONFIG_SMP | ||
158 | extern void __init mpc85xx_smp_init(void); | ||
159 | #endif | ||
160 | |||
157 | static void __init mpc85xx_mds_setup_arch(void) | 161 | static void __init mpc85xx_mds_setup_arch(void) |
158 | { | 162 | { |
159 | struct device_node *np; | 163 | struct device_node *np; |
@@ -194,6 +198,10 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
194 | } | 198 | } |
195 | #endif | 199 | #endif |
196 | 200 | ||
201 | #ifdef CONFIG_SMP | ||
202 | mpc85xx_smp_init(); | ||
203 | #endif | ||
204 | |||
197 | #ifdef CONFIG_QUICC_ENGINE | 205 | #ifdef CONFIG_QUICC_ENGINE |
198 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); | 206 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); |
199 | if (!np) { | 207 | if (!np) { |
@@ -271,9 +279,49 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
271 | BCSR_UCC_RGMII, BCSR_UCC_RTBI); | 279 | BCSR_UCC_RGMII, BCSR_UCC_RTBI); |
272 | } | 280 | } |
273 | 281 | ||
282 | } else if (machine_is(p1021_mds)) { | ||
283 | #define BCSR11_ENET_MICRST (0x1 << 5) | ||
284 | /* Reset Micrel PHY */ | ||
285 | clrbits8(&bcsr_regs[11], BCSR11_ENET_MICRST); | ||
286 | setbits8(&bcsr_regs[11], BCSR11_ENET_MICRST); | ||
274 | } | 287 | } |
288 | |||
275 | iounmap(bcsr_regs); | 289 | iounmap(bcsr_regs); |
276 | } | 290 | } |
291 | |||
292 | if (machine_is(p1021_mds)) { | ||
293 | #define MPC85xx_PMUXCR_OFFSET 0x60 | ||
294 | #define MPC85xx_PMUXCR_QE0 0x00008000 | ||
295 | #define MPC85xx_PMUXCR_QE3 0x00001000 | ||
296 | #define MPC85xx_PMUXCR_QE9 0x00000040 | ||
297 | #define MPC85xx_PMUXCR_QE12 0x00000008 | ||
298 | static __be32 __iomem *pmuxcr; | ||
299 | |||
300 | np = of_find_node_by_name(NULL, "global-utilities"); | ||
301 | |||
302 | if (np) { | ||
303 | pmuxcr = of_iomap(np, 0) + MPC85xx_PMUXCR_OFFSET; | ||
304 | |||
305 | if (!pmuxcr) | ||
306 | printk(KERN_EMERG "Error: Alternate function" | ||
307 | " signal multiplex control register not" | ||
308 | " mapped!\n"); | ||
309 | else | ||
310 | /* P1021 has pins muxed for QE and other functions. To | ||
311 | * enable QE UEC mode, we need to set bit QE0 for UCC1 | ||
312 | * in Eth mode, QE0 and QE3 for UCC5 in Eth mode, QE9 | ||
313 | * and QE12 for QE MII management singals in PMUXCR | ||
314 | * register. | ||
315 | */ | ||
316 | setbits32(pmuxcr, MPC85xx_PMUXCR_QE0 | | ||
317 | MPC85xx_PMUXCR_QE3 | | ||
318 | MPC85xx_PMUXCR_QE9 | | ||
319 | MPC85xx_PMUXCR_QE12); | ||
320 | |||
321 | of_node_put(np); | ||
322 | } | ||
323 | |||
324 | } | ||
277 | #endif /* CONFIG_QUICC_ENGINE */ | 325 | #endif /* CONFIG_QUICC_ENGINE */ |
278 | 326 | ||
279 | #ifdef CONFIG_SWIOTLB | 327 | #ifdef CONFIG_SWIOTLB |
@@ -330,6 +378,16 @@ static struct of_device_id mpc85xx_ids[] = { | |||
330 | {}, | 378 | {}, |
331 | }; | 379 | }; |
332 | 380 | ||
381 | static struct of_device_id p1021_ids[] = { | ||
382 | { .type = "soc", }, | ||
383 | { .compatible = "soc", }, | ||
384 | { .compatible = "simple-bus", }, | ||
385 | { .type = "qe", }, | ||
386 | { .compatible = "fsl,qe", }, | ||
387 | { .compatible = "gianfar", }, | ||
388 | {}, | ||
389 | }; | ||
390 | |||
333 | static int __init mpc85xx_publish_devices(void) | 391 | static int __init mpc85xx_publish_devices(void) |
334 | { | 392 | { |
335 | if (machine_is(mpc8568_mds)) | 393 | if (machine_is(mpc8568_mds)) |
@@ -342,11 +400,22 @@ static int __init mpc85xx_publish_devices(void) | |||
342 | 400 | ||
343 | return 0; | 401 | return 0; |
344 | } | 402 | } |
403 | |||
404 | static int __init p1021_publish_devices(void) | ||
405 | { | ||
406 | /* Publish the QE devices */ | ||
407 | of_platform_bus_probe(NULL, p1021_ids, NULL); | ||
408 | |||
409 | return 0; | ||
410 | } | ||
411 | |||
345 | machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); | 412 | machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); |
346 | machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices); | 413 | machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices); |
414 | machine_device_initcall(p1021_mds, p1021_publish_devices); | ||
347 | 415 | ||
348 | machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier); | 416 | machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier); |
349 | machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier); | 417 | machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier); |
418 | machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier); | ||
350 | 419 | ||
351 | static void __init mpc85xx_mds_pic_init(void) | 420 | static void __init mpc85xx_mds_pic_init(void) |
352 | { | 421 | { |
@@ -366,7 +435,7 @@ static void __init mpc85xx_mds_pic_init(void) | |||
366 | 435 | ||
367 | mpic = mpic_alloc(np, r.start, | 436 | mpic = mpic_alloc(np, r.start, |
368 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | 437 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
369 | MPIC_BROKEN_FRR_NIRQS, | 438 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
370 | 0, 256, " OpenPIC "); | 439 | 0, 256, " OpenPIC "); |
371 | BUG_ON(mpic == NULL); | 440 | BUG_ON(mpic == NULL); |
372 | of_node_put(np); | 441 | of_node_put(np); |
@@ -380,7 +449,11 @@ static void __init mpc85xx_mds_pic_init(void) | |||
380 | if (!np) | 449 | if (!np) |
381 | return; | 450 | return; |
382 | } | 451 | } |
383 | qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL); | 452 | if (machine_is(p1021_mds)) |
453 | qe_ic_init(np, 0, qe_ic_cascade_low_mpic, | ||
454 | qe_ic_cascade_high_mpic); | ||
455 | else | ||
456 | qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL); | ||
384 | of_node_put(np); | 457 | of_node_put(np); |
385 | #endif /* CONFIG_QUICC_ENGINE */ | 458 | #endif /* CONFIG_QUICC_ENGINE */ |
386 | } | 459 | } |
@@ -426,3 +499,26 @@ define_machine(mpc8569_mds) { | |||
426 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | 499 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, |
427 | #endif | 500 | #endif |
428 | }; | 501 | }; |
502 | |||
503 | static int __init p1021_mds_probe(void) | ||
504 | { | ||
505 | unsigned long root = of_get_flat_dt_root(); | ||
506 | |||
507 | return of_flat_dt_is_compatible(root, "fsl,P1021MDS"); | ||
508 | |||
509 | } | ||
510 | |||
511 | define_machine(p1021_mds) { | ||
512 | .name = "P1021 MDS", | ||
513 | .probe = p1021_mds_probe, | ||
514 | .setup_arch = mpc85xx_mds_setup_arch, | ||
515 | .init_IRQ = mpc85xx_mds_pic_init, | ||
516 | .get_irq = mpic_get_irq, | ||
517 | .restart = fsl_rstcr_restart, | ||
518 | .calibrate_decr = generic_calibrate_decr, | ||
519 | .progress = udbg_progress, | ||
520 | #ifdef CONFIG_PCI | ||
521 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
522 | #endif | ||
523 | }; | ||
524 | |||
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index a7be144f5874..0f5bee90ee4e 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008 Freescale Semiconductor, Inc. All rights reserved. | 2 | * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. |
3 | * | 3 | * |
4 | * Author: Tony Li <tony.li@freescale.com> | 4 | * Author: Tony Li <tony.li@freescale.com> |
5 | * Jason Jin <Jason.jin@freescale.com> | 5 | * Jason Jin <Jason.jin@freescale.com> |
@@ -22,14 +22,20 @@ | |||
22 | #include <asm/prom.h> | 22 | #include <asm/prom.h> |
23 | #include <asm/hw_irq.h> | 23 | #include <asm/hw_irq.h> |
24 | #include <asm/ppc-pci.h> | 24 | #include <asm/ppc-pci.h> |
25 | #include <asm/mpic.h> | ||
25 | #include "fsl_msi.h" | 26 | #include "fsl_msi.h" |
26 | 27 | ||
28 | LIST_HEAD(msi_head); | ||
29 | |||
27 | struct fsl_msi_feature { | 30 | struct fsl_msi_feature { |
28 | u32 fsl_pic_ip; | 31 | u32 fsl_pic_ip; |
29 | u32 msiir_offset; | 32 | u32 msiir_offset; |
30 | }; | 33 | }; |
31 | 34 | ||
32 | static struct fsl_msi *fsl_msi; | 35 | struct fsl_msi_cascade_data { |
36 | struct fsl_msi *msi_data; | ||
37 | int index; | ||
38 | }; | ||
33 | 39 | ||
34 | static inline u32 fsl_msi_read(u32 __iomem *base, unsigned int reg) | 40 | static inline u32 fsl_msi_read(u32 __iomem *base, unsigned int reg) |
35 | { | 41 | { |
@@ -54,10 +60,12 @@ static struct irq_chip fsl_msi_chip = { | |||
54 | static int fsl_msi_host_map(struct irq_host *h, unsigned int virq, | 60 | static int fsl_msi_host_map(struct irq_host *h, unsigned int virq, |
55 | irq_hw_number_t hw) | 61 | irq_hw_number_t hw) |
56 | { | 62 | { |
63 | struct fsl_msi *msi_data = h->host_data; | ||
57 | struct irq_chip *chip = &fsl_msi_chip; | 64 | struct irq_chip *chip = &fsl_msi_chip; |
58 | 65 | ||
59 | irq_to_desc(virq)->status |= IRQ_TYPE_EDGE_FALLING; | 66 | irq_to_desc(virq)->status |= IRQ_TYPE_EDGE_FALLING; |
60 | 67 | ||
68 | set_irq_chip_data(virq, msi_data); | ||
61 | set_irq_chip_and_handler(virq, chip, handle_edge_irq); | 69 | set_irq_chip_and_handler(virq, chip, handle_edge_irq); |
62 | 70 | ||
63 | return 0; | 71 | return 0; |
@@ -96,11 +104,12 @@ static int fsl_msi_check_device(struct pci_dev *pdev, int nvec, int type) | |||
96 | static void fsl_teardown_msi_irqs(struct pci_dev *pdev) | 104 | static void fsl_teardown_msi_irqs(struct pci_dev *pdev) |
97 | { | 105 | { |
98 | struct msi_desc *entry; | 106 | struct msi_desc *entry; |
99 | struct fsl_msi *msi_data = fsl_msi; | 107 | struct fsl_msi *msi_data; |
100 | 108 | ||
101 | list_for_each_entry(entry, &pdev->msi_list, list) { | 109 | list_for_each_entry(entry, &pdev->msi_list, list) { |
102 | if (entry->irq == NO_IRQ) | 110 | if (entry->irq == NO_IRQ) |
103 | continue; | 111 | continue; |
112 | msi_data = get_irq_data(entry->irq); | ||
104 | set_irq_msi(entry->irq, NULL); | 113 | set_irq_msi(entry->irq, NULL); |
105 | msi_bitmap_free_hwirqs(&msi_data->bitmap, | 114 | msi_bitmap_free_hwirqs(&msi_data->bitmap, |
106 | virq_to_hw(entry->irq), 1); | 115 | virq_to_hw(entry->irq), 1); |
@@ -111,9 +120,10 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev) | |||
111 | } | 120 | } |
112 | 121 | ||
113 | static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq, | 122 | static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq, |
114 | struct msi_msg *msg) | 123 | struct msi_msg *msg, |
124 | struct fsl_msi *fsl_msi_data) | ||
115 | { | 125 | { |
116 | struct fsl_msi *msi_data = fsl_msi; | 126 | struct fsl_msi *msi_data = fsl_msi_data; |
117 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); | 127 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); |
118 | u32 base = 0; | 128 | u32 base = 0; |
119 | 129 | ||
@@ -130,14 +140,19 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq, | |||
130 | 140 | ||
131 | static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | 141 | static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) |
132 | { | 142 | { |
133 | int rc, hwirq; | 143 | int rc, hwirq = -ENOMEM; |
134 | unsigned int virq; | 144 | unsigned int virq; |
135 | struct msi_desc *entry; | 145 | struct msi_desc *entry; |
136 | struct msi_msg msg; | 146 | struct msi_msg msg; |
137 | struct fsl_msi *msi_data = fsl_msi; | 147 | struct fsl_msi *msi_data; |
138 | 148 | ||
139 | list_for_each_entry(entry, &pdev->msi_list, list) { | 149 | list_for_each_entry(entry, &pdev->msi_list, list) { |
140 | hwirq = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1); | 150 | list_for_each_entry(msi_data, &msi_head, list) { |
151 | hwirq = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1); | ||
152 | if (hwirq >= 0) | ||
153 | break; | ||
154 | } | ||
155 | |||
141 | if (hwirq < 0) { | 156 | if (hwirq < 0) { |
142 | rc = hwirq; | 157 | rc = hwirq; |
143 | pr_debug("%s: fail allocating msi interrupt\n", | 158 | pr_debug("%s: fail allocating msi interrupt\n", |
@@ -154,25 +169,31 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
154 | rc = -ENOSPC; | 169 | rc = -ENOSPC; |
155 | goto out_free; | 170 | goto out_free; |
156 | } | 171 | } |
172 | set_irq_data(virq, msi_data); | ||
157 | set_irq_msi(virq, entry); | 173 | set_irq_msi(virq, entry); |
158 | 174 | ||
159 | fsl_compose_msi_msg(pdev, hwirq, &msg); | 175 | fsl_compose_msi_msg(pdev, hwirq, &msg, msi_data); |
160 | write_msi_msg(virq, &msg); | 176 | write_msi_msg(virq, &msg); |
161 | } | 177 | } |
162 | return 0; | 178 | return 0; |
163 | 179 | ||
164 | out_free: | 180 | out_free: |
181 | /* free by the caller of this function */ | ||
165 | return rc; | 182 | return rc; |
166 | } | 183 | } |
167 | 184 | ||
168 | static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc) | 185 | static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc) |
169 | { | 186 | { |
170 | unsigned int cascade_irq; | 187 | unsigned int cascade_irq; |
171 | struct fsl_msi *msi_data = fsl_msi; | 188 | struct fsl_msi *msi_data; |
172 | int msir_index = -1; | 189 | int msir_index = -1; |
173 | u32 msir_value = 0; | 190 | u32 msir_value = 0; |
174 | u32 intr_index; | 191 | u32 intr_index; |
175 | u32 have_shift = 0; | 192 | u32 have_shift = 0; |
193 | struct fsl_msi_cascade_data *cascade_data; | ||
194 | |||
195 | cascade_data = (struct fsl_msi_cascade_data *)get_irq_data(irq); | ||
196 | msi_data = cascade_data->msi_data; | ||
176 | 197 | ||
177 | raw_spin_lock(&desc->lock); | 198 | raw_spin_lock(&desc->lock); |
178 | if ((msi_data->feature & FSL_PIC_IP_MASK) == FSL_PIC_IP_IPIC) { | 199 | if ((msi_data->feature & FSL_PIC_IP_MASK) == FSL_PIC_IP_IPIC) { |
@@ -187,13 +208,13 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc) | |||
187 | if (unlikely(desc->status & IRQ_INPROGRESS)) | 208 | if (unlikely(desc->status & IRQ_INPROGRESS)) |
188 | goto unlock; | 209 | goto unlock; |
189 | 210 | ||
190 | msir_index = (int)desc->handler_data; | 211 | msir_index = cascade_data->index; |
191 | 212 | ||
192 | if (msir_index >= NR_MSI_REG) | 213 | if (msir_index >= NR_MSI_REG) |
193 | cascade_irq = NO_IRQ; | 214 | cascade_irq = NO_IRQ; |
194 | 215 | ||
195 | desc->status |= IRQ_INPROGRESS; | 216 | desc->status |= IRQ_INPROGRESS; |
196 | switch (fsl_msi->feature & FSL_PIC_IP_MASK) { | 217 | switch (msi_data->feature & FSL_PIC_IP_MASK) { |
197 | case FSL_PIC_IP_MPIC: | 218 | case FSL_PIC_IP_MPIC: |
198 | msir_value = fsl_msi_read(msi_data->msi_regs, | 219 | msir_value = fsl_msi_read(msi_data->msi_regs, |
199 | msir_index * 0x10); | 220 | msir_index * 0x10); |
@@ -229,6 +250,30 @@ unlock: | |||
229 | raw_spin_unlock(&desc->lock); | 250 | raw_spin_unlock(&desc->lock); |
230 | } | 251 | } |
231 | 252 | ||
253 | static int fsl_of_msi_remove(struct of_device *ofdev) | ||
254 | { | ||
255 | struct fsl_msi *msi = ofdev->dev.platform_data; | ||
256 | int virq, i; | ||
257 | struct fsl_msi_cascade_data *cascade_data; | ||
258 | |||
259 | if (msi->list.prev != NULL) | ||
260 | list_del(&msi->list); | ||
261 | for (i = 0; i < NR_MSI_REG; i++) { | ||
262 | virq = msi->msi_virqs[i]; | ||
263 | if (virq != NO_IRQ) { | ||
264 | cascade_data = get_irq_data(virq); | ||
265 | kfree(cascade_data); | ||
266 | irq_dispose_mapping(virq); | ||
267 | } | ||
268 | } | ||
269 | if (msi->bitmap.bitmap) | ||
270 | msi_bitmap_free(&msi->bitmap); | ||
271 | iounmap(msi->msi_regs); | ||
272 | kfree(msi); | ||
273 | |||
274 | return 0; | ||
275 | } | ||
276 | |||
232 | static int __devinit fsl_of_msi_probe(struct of_device *dev, | 277 | static int __devinit fsl_of_msi_probe(struct of_device *dev, |
233 | const struct of_device_id *match) | 278 | const struct of_device_id *match) |
234 | { | 279 | { |
@@ -239,15 +284,18 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev, | |||
239 | int virt_msir; | 284 | int virt_msir; |
240 | const u32 *p; | 285 | const u32 *p; |
241 | struct fsl_msi_feature *features = match->data; | 286 | struct fsl_msi_feature *features = match->data; |
287 | struct fsl_msi_cascade_data *cascade_data = NULL; | ||
288 | int len; | ||
289 | u32 offset; | ||
242 | 290 | ||
243 | printk(KERN_DEBUG "Setting up Freescale MSI support\n"); | 291 | printk(KERN_DEBUG "Setting up Freescale MSI support\n"); |
244 | 292 | ||
245 | msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL); | 293 | msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL); |
246 | if (!msi) { | 294 | if (!msi) { |
247 | dev_err(&dev->dev, "No memory for MSI structure\n"); | 295 | dev_err(&dev->dev, "No memory for MSI structure\n"); |
248 | err = -ENOMEM; | 296 | return -ENOMEM; |
249 | goto error_out; | ||
250 | } | 297 | } |
298 | dev->dev.platform_data = msi; | ||
251 | 299 | ||
252 | msi->irqhost = irq_alloc_host(dev->dev.of_node, IRQ_HOST_MAP_LINEAR, | 300 | msi->irqhost = irq_alloc_host(dev->dev.of_node, IRQ_HOST_MAP_LINEAR, |
253 | NR_MSI_IRQS, &fsl_msi_host_ops, 0); | 301 | NR_MSI_IRQS, &fsl_msi_host_ops, 0); |
@@ -298,27 +346,47 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev, | |||
298 | err = -EINVAL; | 346 | err = -EINVAL; |
299 | goto error_out; | 347 | goto error_out; |
300 | } | 348 | } |
349 | offset = 0; | ||
350 | p = of_get_property(dev->node, "msi-available-ranges", &len); | ||
351 | if (p) | ||
352 | offset = *p / IRQS_PER_MSI_REG; | ||
301 | 353 | ||
302 | count /= sizeof(u32); | 354 | count /= sizeof(u32); |
303 | for (i = 0; i < count / 2; i++) { | 355 | for (i = 0; i < min(count / 2, NR_MSI_REG); i++) { |
304 | if (i > NR_MSI_REG) | ||
305 | break; | ||
306 | virt_msir = irq_of_parse_and_map(dev->dev.of_node, i); | 356 | virt_msir = irq_of_parse_and_map(dev->dev.of_node, i); |
307 | if (virt_msir != NO_IRQ) { | 357 | if (virt_msir != NO_IRQ) { |
308 | set_irq_data(virt_msir, (void *)i); | 358 | cascade_data = kzalloc( |
359 | sizeof(struct fsl_msi_cascade_data), | ||
360 | GFP_KERNEL); | ||
361 | if (!cascade_data) { | ||
362 | dev_err(&dev->dev, | ||
363 | "No memory for MSI cascade data\n"); | ||
364 | err = -ENOMEM; | ||
365 | goto error_out; | ||
366 | } | ||
367 | msi->msi_virqs[i] = virt_msir; | ||
368 | cascade_data->index = i + offset; | ||
369 | cascade_data->msi_data = msi; | ||
370 | set_irq_data(virt_msir, (void *)cascade_data); | ||
309 | set_irq_chained_handler(virt_msir, fsl_msi_cascade); | 371 | set_irq_chained_handler(virt_msir, fsl_msi_cascade); |
310 | } | 372 | } |
311 | } | 373 | } |
312 | 374 | ||
313 | fsl_msi = msi; | 375 | list_add_tail(&msi->list, &msi_head); |
314 | 376 | ||
315 | WARN_ON(ppc_md.setup_msi_irqs); | 377 | /* The multiple setting ppc_md.setup_msi_irqs will not harm things */ |
316 | ppc_md.setup_msi_irqs = fsl_setup_msi_irqs; | 378 | if (!ppc_md.setup_msi_irqs) { |
317 | ppc_md.teardown_msi_irqs = fsl_teardown_msi_irqs; | 379 | ppc_md.setup_msi_irqs = fsl_setup_msi_irqs; |
318 | ppc_md.msi_check_device = fsl_msi_check_device; | 380 | ppc_md.teardown_msi_irqs = fsl_teardown_msi_irqs; |
381 | ppc_md.msi_check_device = fsl_msi_check_device; | ||
382 | } else if (ppc_md.setup_msi_irqs != fsl_setup_msi_irqs) { | ||
383 | dev_err(&dev->dev, "Different MSI driver already installed!\n"); | ||
384 | err = -ENODEV; | ||
385 | goto error_out; | ||
386 | } | ||
319 | return 0; | 387 | return 0; |
320 | error_out: | 388 | error_out: |
321 | kfree(msi); | 389 | fsl_of_msi_remove(dev); |
322 | return err; | 390 | return err; |
323 | } | 391 | } |
324 | 392 | ||
@@ -351,6 +419,7 @@ static struct of_platform_driver fsl_of_msi_driver = { | |||
351 | .of_match_table = fsl_of_msi_ids, | 419 | .of_match_table = fsl_of_msi_ids, |
352 | }, | 420 | }, |
353 | .probe = fsl_of_msi_probe, | 421 | .probe = fsl_of_msi_probe, |
422 | .remove = fsl_of_msi_remove, | ||
354 | }; | 423 | }; |
355 | 424 | ||
356 | static __init int fsl_of_msi_init(void) | 425 | static __init int fsl_of_msi_init(void) |
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h index 331c7e7025b7..624580c252d7 100644 --- a/arch/powerpc/sysdev/fsl_msi.h +++ b/arch/powerpc/sysdev/fsl_msi.h | |||
@@ -32,8 +32,11 @@ struct fsl_msi { | |||
32 | u32 msi_addr_hi; | 32 | u32 msi_addr_hi; |
33 | void __iomem *msi_regs; | 33 | void __iomem *msi_regs; |
34 | u32 feature; | 34 | u32 feature; |
35 | int msi_virqs[NR_MSI_REG]; | ||
35 | 36 | ||
36 | struct msi_bitmap bitmap; | 37 | struct msi_bitmap bitmap; |
38 | |||
39 | struct list_head list; /* support multiple MSI banks */ | ||
37 | }; | 40 | }; |
38 | 41 | ||
39 | #endif /* _POWERPC_SYSDEV_FSL_MSI_H */ | 42 | #endif /* _POWERPC_SYSDEV_FSL_MSI_H */ |
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 106d767bf65b..156aa7d36258 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -974,6 +974,123 @@ static struct ppc4xx_pciex_hwops ppc460ex_pcie_hwops __initdata = | |||
974 | .setup_utl = ppc460ex_pciex_init_utl, | 974 | .setup_utl = ppc460ex_pciex_init_utl, |
975 | }; | 975 | }; |
976 | 976 | ||
977 | static int __init ppc460sx_pciex_core_init(struct device_node *np) | ||
978 | { | ||
979 | /* HSS drive amplitude */ | ||
980 | mtdcri(SDR0, PESDR0_460SX_HSSL0DAMP, 0xB9843211); | ||
981 | mtdcri(SDR0, PESDR0_460SX_HSSL1DAMP, 0xB9843211); | ||
982 | mtdcri(SDR0, PESDR0_460SX_HSSL2DAMP, 0xB9843211); | ||
983 | mtdcri(SDR0, PESDR0_460SX_HSSL3DAMP, 0xB9843211); | ||
984 | mtdcri(SDR0, PESDR0_460SX_HSSL4DAMP, 0xB9843211); | ||
985 | mtdcri(SDR0, PESDR0_460SX_HSSL5DAMP, 0xB9843211); | ||
986 | mtdcri(SDR0, PESDR0_460SX_HSSL6DAMP, 0xB9843211); | ||
987 | mtdcri(SDR0, PESDR0_460SX_HSSL7DAMP, 0xB9843211); | ||
988 | |||
989 | mtdcri(SDR0, PESDR1_460SX_HSSL0DAMP, 0xB9843211); | ||
990 | mtdcri(SDR0, PESDR1_460SX_HSSL1DAMP, 0xB9843211); | ||
991 | mtdcri(SDR0, PESDR1_460SX_HSSL2DAMP, 0xB9843211); | ||
992 | mtdcri(SDR0, PESDR1_460SX_HSSL3DAMP, 0xB9843211); | ||
993 | |||
994 | mtdcri(SDR0, PESDR2_460SX_HSSL0DAMP, 0xB9843211); | ||
995 | mtdcri(SDR0, PESDR2_460SX_HSSL1DAMP, 0xB9843211); | ||
996 | mtdcri(SDR0, PESDR2_460SX_HSSL2DAMP, 0xB9843211); | ||
997 | mtdcri(SDR0, PESDR2_460SX_HSSL3DAMP, 0xB9843211); | ||
998 | |||
999 | /* HSS TX pre-emphasis */ | ||
1000 | mtdcri(SDR0, PESDR0_460SX_HSSL0COEFA, 0xDCB98987); | ||
1001 | mtdcri(SDR0, PESDR0_460SX_HSSL1COEFA, 0xDCB98987); | ||
1002 | mtdcri(SDR0, PESDR0_460SX_HSSL2COEFA, 0xDCB98987); | ||
1003 | mtdcri(SDR0, PESDR0_460SX_HSSL3COEFA, 0xDCB98987); | ||
1004 | mtdcri(SDR0, PESDR0_460SX_HSSL4COEFA, 0xDCB98987); | ||
1005 | mtdcri(SDR0, PESDR0_460SX_HSSL5COEFA, 0xDCB98987); | ||
1006 | mtdcri(SDR0, PESDR0_460SX_HSSL6COEFA, 0xDCB98987); | ||
1007 | mtdcri(SDR0, PESDR0_460SX_HSSL7COEFA, 0xDCB98987); | ||
1008 | |||
1009 | mtdcri(SDR0, PESDR1_460SX_HSSL0COEFA, 0xDCB98987); | ||
1010 | mtdcri(SDR0, PESDR1_460SX_HSSL1COEFA, 0xDCB98987); | ||
1011 | mtdcri(SDR0, PESDR1_460SX_HSSL2COEFA, 0xDCB98987); | ||
1012 | mtdcri(SDR0, PESDR1_460SX_HSSL3COEFA, 0xDCB98987); | ||
1013 | |||
1014 | mtdcri(SDR0, PESDR2_460SX_HSSL0COEFA, 0xDCB98987); | ||
1015 | mtdcri(SDR0, PESDR2_460SX_HSSL1COEFA, 0xDCB98987); | ||
1016 | mtdcri(SDR0, PESDR2_460SX_HSSL2COEFA, 0xDCB98987); | ||
1017 | mtdcri(SDR0, PESDR2_460SX_HSSL3COEFA, 0xDCB98987); | ||
1018 | |||
1019 | /* HSS TX calibration control */ | ||
1020 | mtdcri(SDR0, PESDR0_460SX_HSSL1CALDRV, 0x22222222); | ||
1021 | mtdcri(SDR0, PESDR1_460SX_HSSL1CALDRV, 0x22220000); | ||
1022 | mtdcri(SDR0, PESDR2_460SX_HSSL1CALDRV, 0x22220000); | ||
1023 | |||
1024 | /* HSS TX slew control */ | ||
1025 | mtdcri(SDR0, PESDR0_460SX_HSSSLEW, 0xFFFFFFFF); | ||
1026 | mtdcri(SDR0, PESDR1_460SX_HSSSLEW, 0xFFFF0000); | ||
1027 | mtdcri(SDR0, PESDR2_460SX_HSSSLEW, 0xFFFF0000); | ||
1028 | |||
1029 | udelay(100); | ||
1030 | |||
1031 | /* De-assert PLLRESET */ | ||
1032 | dcri_clrset(SDR0, PESDR0_PLLLCT2, 0x00000100, 0); | ||
1033 | |||
1034 | /* Reset DL, UTL, GPL before configuration */ | ||
1035 | mtdcri(SDR0, PESDR0_460SX_RCSSET, | ||
1036 | PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU); | ||
1037 | mtdcri(SDR0, PESDR1_460SX_RCSSET, | ||
1038 | PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU); | ||
1039 | mtdcri(SDR0, PESDR2_460SX_RCSSET, | ||
1040 | PESDRx_RCSSET_RSTDL | PESDRx_RCSSET_RSTGU); | ||
1041 | |||
1042 | udelay(100); | ||
1043 | |||
1044 | /* | ||
1045 | * If bifurcation is not enabled, u-boot would have disabled the | ||
1046 | * third PCIe port | ||
1047 | */ | ||
1048 | if (((mfdcri(SDR0, PESDR1_460SX_HSSCTLSET) & 0x00000001) == | ||
1049 | 0x00000001)) { | ||
1050 | printk(KERN_INFO "PCI: PCIE bifurcation setup successfully.\n"); | ||
1051 | printk(KERN_INFO "PCI: Total 3 PCIE ports are present\n"); | ||
1052 | return 3; | ||
1053 | } | ||
1054 | |||
1055 | printk(KERN_INFO "PCI: Total 2 PCIE ports are present\n"); | ||
1056 | return 2; | ||
1057 | } | ||
1058 | |||
1059 | static int ppc460sx_pciex_init_port_hw(struct ppc4xx_pciex_port *port) | ||
1060 | { | ||
1061 | |||
1062 | if (port->endpoint) | ||
1063 | dcri_clrset(SDR0, port->sdr_base + PESDRn_UTLSET2, | ||
1064 | 0x01000000, 0); | ||
1065 | else | ||
1066 | dcri_clrset(SDR0, port->sdr_base + PESDRn_UTLSET2, | ||
1067 | 0, 0x01000000); | ||
1068 | |||
1069 | /*Gen-1*/ | ||
1070 | mtdcri(SDR0, port->sdr_base + PESDRn_460SX_RCEI, 0x08000000); | ||
1071 | |||
1072 | dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET, | ||
1073 | (PESDRx_RCSSET_RSTGU | PESDRx_RCSSET_RSTDL), | ||
1074 | PESDRx_RCSSET_RSTPYN); | ||
1075 | |||
1076 | port->has_ibpre = 1; | ||
1077 | |||
1078 | return 0; | ||
1079 | } | ||
1080 | |||
1081 | static int ppc460sx_pciex_init_utl(struct ppc4xx_pciex_port *port) | ||
1082 | { | ||
1083 | /* Max 128 Bytes */ | ||
1084 | out_be32 (port->utl_base + PEUTL_PBBSZ, 0x00000000); | ||
1085 | return 0; | ||
1086 | } | ||
1087 | |||
1088 | static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = { | ||
1089 | .core_init = ppc460sx_pciex_core_init, | ||
1090 | .port_init_hw = ppc460sx_pciex_init_port_hw, | ||
1091 | .setup_utl = ppc460sx_pciex_init_utl, | ||
1092 | }; | ||
1093 | |||
977 | #endif /* CONFIG_44x */ | 1094 | #endif /* CONFIG_44x */ |
978 | 1095 | ||
979 | #ifdef CONFIG_40x | 1096 | #ifdef CONFIG_40x |
@@ -1089,6 +1206,8 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np) | |||
1089 | } | 1206 | } |
1090 | if (of_device_is_compatible(np, "ibm,plb-pciex-460ex")) | 1207 | if (of_device_is_compatible(np, "ibm,plb-pciex-460ex")) |
1091 | ppc4xx_pciex_hwops = &ppc460ex_pcie_hwops; | 1208 | ppc4xx_pciex_hwops = &ppc460ex_pcie_hwops; |
1209 | if (of_device_is_compatible(np, "ibm,plb-pciex-460sx")) | ||
1210 | ppc4xx_pciex_hwops = &ppc460sx_pcie_hwops; | ||
1092 | #endif /* CONFIG_44x */ | 1211 | #endif /* CONFIG_44x */ |
1093 | #ifdef CONFIG_40x | 1212 | #ifdef CONFIG_40x |
1094 | if (of_device_is_compatible(np, "ibm,plb-pciex-405ex")) | 1213 | if (of_device_is_compatible(np, "ibm,plb-pciex-405ex")) |
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.h b/arch/powerpc/sysdev/ppc4xx_pci.h index d04e40b306fb..56d9e5deccbf 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.h +++ b/arch/powerpc/sysdev/ppc4xx_pci.h | |||
@@ -324,6 +324,64 @@ | |||
324 | #define PESDR0_460EX_IHS2 0x036D | 324 | #define PESDR0_460EX_IHS2 0x036D |
325 | 325 | ||
326 | /* | 326 | /* |
327 | * 460SX addtional DCRs | ||
328 | */ | ||
329 | #define PESDRn_460SX_RCEI 0x02 | ||
330 | |||
331 | #define PESDR0_460SX_HSSL0DAMP 0x320 | ||
332 | #define PESDR0_460SX_HSSL1DAMP 0x321 | ||
333 | #define PESDR0_460SX_HSSL2DAMP 0x322 | ||
334 | #define PESDR0_460SX_HSSL3DAMP 0x323 | ||
335 | #define PESDR0_460SX_HSSL4DAMP 0x324 | ||
336 | #define PESDR0_460SX_HSSL5DAMP 0x325 | ||
337 | #define PESDR0_460SX_HSSL6DAMP 0x326 | ||
338 | #define PESDR0_460SX_HSSL7DAMP 0x327 | ||
339 | |||
340 | #define PESDR1_460SX_HSSL0DAMP 0x354 | ||
341 | #define PESDR1_460SX_HSSL1DAMP 0x355 | ||
342 | #define PESDR1_460SX_HSSL2DAMP 0x356 | ||
343 | #define PESDR1_460SX_HSSL3DAMP 0x357 | ||
344 | |||
345 | #define PESDR2_460SX_HSSL0DAMP 0x384 | ||
346 | #define PESDR2_460SX_HSSL1DAMP 0x385 | ||
347 | #define PESDR2_460SX_HSSL2DAMP 0x386 | ||
348 | #define PESDR2_460SX_HSSL3DAMP 0x387 | ||
349 | |||
350 | #define PESDR0_460SX_HSSL0COEFA 0x328 | ||
351 | #define PESDR0_460SX_HSSL1COEFA 0x329 | ||
352 | #define PESDR0_460SX_HSSL2COEFA 0x32A | ||
353 | #define PESDR0_460SX_HSSL3COEFA 0x32B | ||
354 | #define PESDR0_460SX_HSSL4COEFA 0x32C | ||
355 | #define PESDR0_460SX_HSSL5COEFA 0x32D | ||
356 | #define PESDR0_460SX_HSSL6COEFA 0x32E | ||
357 | #define PESDR0_460SX_HSSL7COEFA 0x32F | ||
358 | |||
359 | #define PESDR1_460SX_HSSL0COEFA 0x358 | ||
360 | #define PESDR1_460SX_HSSL1COEFA 0x359 | ||
361 | #define PESDR1_460SX_HSSL2COEFA 0x35A | ||
362 | #define PESDR1_460SX_HSSL3COEFA 0x35B | ||
363 | |||
364 | #define PESDR2_460SX_HSSL0COEFA 0x388 | ||
365 | #define PESDR2_460SX_HSSL1COEFA 0x389 | ||
366 | #define PESDR2_460SX_HSSL2COEFA 0x38A | ||
367 | #define PESDR2_460SX_HSSL3COEFA 0x38B | ||
368 | |||
369 | #define PESDR0_460SX_HSSL1CALDRV 0x339 | ||
370 | #define PESDR1_460SX_HSSL1CALDRV 0x361 | ||
371 | #define PESDR2_460SX_HSSL1CALDRV 0x391 | ||
372 | |||
373 | #define PESDR0_460SX_HSSSLEW 0x338 | ||
374 | #define PESDR1_460SX_HSSSLEW 0x360 | ||
375 | #define PESDR2_460SX_HSSSLEW 0x390 | ||
376 | |||
377 | #define PESDR0_460SX_HSSCTLSET 0x31E | ||
378 | #define PESDR1_460SX_HSSCTLSET 0x352 | ||
379 | #define PESDR2_460SX_HSSCTLSET 0x382 | ||
380 | |||
381 | #define PESDR0_460SX_RCSSET 0x304 | ||
382 | #define PESDR1_460SX_RCSSET 0x344 | ||
383 | #define PESDR2_460SX_RCSSET 0x374 | ||
384 | /* | ||
327 | * Of the above, some are common offsets from the base | 385 | * Of the above, some are common offsets from the base |
328 | */ | 386 | */ |
329 | #define PESDRn_UTLSET1 0x00 | 387 | #define PESDRn_UTLSET1 0x00 |
diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h index 9b866816863c..24aafa68b643 100644 --- a/arch/s390/include/asm/cache.h +++ b/arch/s390/include/asm/cache.h | |||
@@ -14,6 +14,6 @@ | |||
14 | #define L1_CACHE_BYTES 256 | 14 | #define L1_CACHE_BYTES 256 |
15 | #define L1_CACHE_SHIFT 8 | 15 | #define L1_CACHE_SHIFT 8 |
16 | 16 | ||
17 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 17 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
18 | 18 | ||
19 | #endif | 19 | #endif |
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S index c56d3f56d020..1f066e46e83e 100644 --- a/arch/s390/kernel/swsusp_asm64.S +++ b/arch/s390/kernel/swsusp_asm64.S | |||
@@ -264,7 +264,7 @@ restore_registers: | |||
264 | lghi %r2,0 | 264 | lghi %r2,0 |
265 | br %r14 | 265 | br %r14 |
266 | 266 | ||
267 | .section .data.nosave,"aw",@progbits | 267 | .section .data..nosave,"aw",@progbits |
268 | .align 8 | 268 | .align 8 |
269 | .Ldisabled_wait_31: | 269 | .Ldisabled_wait_31: |
270 | .long 0x000a0000,0x00000000 | 270 | .long 0x000a0000,0x00000000 |
diff --git a/arch/sh/boot/compressed/vmlinux.scr b/arch/sh/boot/compressed/vmlinux.scr index f02382ae5c48..862d74808236 100644 --- a/arch/sh/boot/compressed/vmlinux.scr +++ b/arch/sh/boot/compressed/vmlinux.scr | |||
@@ -1,6 +1,6 @@ | |||
1 | SECTIONS | 1 | SECTIONS |
2 | { | 2 | { |
3 | .rodata.compressed : { | 3 | .rodata..compressed : { |
4 | input_len = .; | 4 | input_len = .; |
5 | LONG(input_data_end - input_data) input_data = .; | 5 | LONG(input_data_end - input_data) input_data = .; |
6 | *(.data) | 6 | *(.data) |
diff --git a/arch/sh/include/asm/cache.h b/arch/sh/include/asm/cache.h index e461d67f03c3..ef9e555aafba 100644 --- a/arch/sh/include/asm/cache.h +++ b/arch/sh/include/asm/cache.h | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 15 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
16 | 16 | ||
17 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 17 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
18 | 18 | ||
19 | #ifndef __ASSEMBLY__ | 19 | #ifndef __ASSEMBLY__ |
20 | struct cache_info { | 20 | struct cache_info { |
diff --git a/arch/sparc/boot/btfixupprep.c b/arch/sparc/boot/btfixupprep.c index bbf91b9c3d39..e7f2940bd270 100644 --- a/arch/sparc/boot/btfixupprep.c +++ b/arch/sparc/boot/btfixupprep.c | |||
@@ -325,7 +325,7 @@ main1: | |||
325 | (*rr)->next = NULL; | 325 | (*rr)->next = NULL; |
326 | } | 326 | } |
327 | printf("! Generated by btfixupprep. Do not edit.\n\n"); | 327 | printf("! Generated by btfixupprep. Do not edit.\n\n"); |
328 | printf("\t.section\t\".data.init\",#alloc,#write\n\t.align\t4\n\n"); | 328 | printf("\t.section\t\".data..init\",#alloc,#write\n\t.align\t4\n\n"); |
329 | printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n"); | 329 | printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n"); |
330 | for (i = 0; i < last; i++) { | 330 | for (i = 0; i < last; i++) { |
331 | f = array + i; | 331 | f = array + i; |
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h index 78b07009f60a..0588b8c7faa2 100644 --- a/arch/sparc/include/asm/cache.h +++ b/arch/sparc/include/asm/cache.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) | 22 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) |
23 | 23 | ||
24 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 24 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
25 | 25 | ||
26 | #ifdef CONFIG_SPARC32 | 26 | #ifdef CONFIG_SPARC32 |
27 | #include <asm/asi.h> | 27 | #include <asm/asi.h> |
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S index 7fcad58e216d..69268014dd8e 100644 --- a/arch/um/kernel/dyn.lds.S +++ b/arch/um/kernel/dyn.lds.S | |||
@@ -94,7 +94,7 @@ SECTIONS | |||
94 | .data : { | 94 | .data : { |
95 | INIT_TASK_DATA(KERNEL_STACK_SIZE) | 95 | INIT_TASK_DATA(KERNEL_STACK_SIZE) |
96 | . = ALIGN(KERNEL_STACK_SIZE); | 96 | . = ALIGN(KERNEL_STACK_SIZE); |
97 | *(.data.init_irqstack) | 97 | *(.data..init_irqstack) |
98 | DATA_DATA | 98 | DATA_DATA |
99 | *(.data.* .gnu.linkonce.d.*) | 99 | *(.data.* .gnu.linkonce.d.*) |
100 | SORT(CONSTRUCTORS) | 100 | SORT(CONSTRUCTORS) |
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c index 8aa77b61a5ff..ddc9698b66ed 100644 --- a/arch/um/kernel/init_task.c +++ b/arch/um/kernel/init_task.c | |||
@@ -34,5 +34,5 @@ union thread_union init_thread_union __init_task_data = | |||
34 | { INIT_THREAD_INFO(init_task) }; | 34 | { INIT_THREAD_INFO(init_task) }; |
35 | 35 | ||
36 | union thread_union cpu0_irqstack | 36 | union thread_union cpu0_irqstack |
37 | __attribute__((__section__(".data.init_irqstack"))) = | 37 | __attribute__((__section__(".data..init_irqstack"))) = |
38 | { INIT_THREAD_INFO(init_task) }; | 38 | { INIT_THREAD_INFO(init_task) }; |
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S index e7a6cca667aa..ec6378550671 100644 --- a/arch/um/kernel/uml.lds.S +++ b/arch/um/kernel/uml.lds.S | |||
@@ -50,7 +50,7 @@ SECTIONS | |||
50 | { | 50 | { |
51 | INIT_TASK_DATA(KERNEL_STACK_SIZE) | 51 | INIT_TASK_DATA(KERNEL_STACK_SIZE) |
52 | . = ALIGN(KERNEL_STACK_SIZE); | 52 | . = ALIGN(KERNEL_STACK_SIZE); |
53 | *(.data.init_irqstack) | 53 | *(.data..init_irqstack) |
54 | DATA_DATA | 54 | DATA_DATA |
55 | *(.gnu.linkonce.d*) | 55 | *(.gnu.linkonce.d*) |
56 | CONSTRUCTORS | 56 | CONSTRUCTORS |
diff --git a/arch/x86/.gitignore b/arch/x86/.gitignore new file mode 100644 index 000000000000..028079065af6 --- /dev/null +++ b/arch/x86/.gitignore | |||
@@ -0,0 +1,3 @@ | |||
1 | boot/compressed/vmlinux | ||
2 | tools/test_get_len | ||
3 | |||
diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c index bcbd36c41432..5c228129d175 100644 --- a/arch/x86/boot/compressed/mkpiggy.c +++ b/arch/x86/boot/compressed/mkpiggy.c | |||
@@ -77,7 +77,7 @@ int main(int argc, char *argv[]) | |||
77 | offs += 32*1024 + 18; /* Add 32K + 18 bytes slack */ | 77 | offs += 32*1024 + 18; /* Add 32K + 18 bytes slack */ |
78 | offs = (offs+4095) & ~4095; /* Round to a 4K boundary */ | 78 | offs = (offs+4095) & ~4095; /* Round to a 4K boundary */ |
79 | 79 | ||
80 | printf(".section \".rodata.compressed\",\"a\",@progbits\n"); | 80 | printf(".section \".rodata..compressed\",\"a\",@progbits\n"); |
81 | printf(".globl z_input_len\n"); | 81 | printf(".globl z_input_len\n"); |
82 | printf("z_input_len = %lu\n", ilen); | 82 | printf("z_input_len = %lu\n", ilen); |
83 | printf(".globl z_output_len\n"); | 83 | printf(".globl z_output_len\n"); |
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S index a6f1a59a5b0c..5ddabceee124 100644 --- a/arch/x86/boot/compressed/vmlinux.lds.S +++ b/arch/x86/boot/compressed/vmlinux.lds.S | |||
@@ -26,8 +26,8 @@ SECTIONS | |||
26 | HEAD_TEXT | 26 | HEAD_TEXT |
27 | _ehead = . ; | 27 | _ehead = . ; |
28 | } | 28 | } |
29 | .rodata.compressed : { | 29 | .rodata..compressed : { |
30 | *(.rodata.compressed) | 30 | *(.rodata..compressed) |
31 | } | 31 | } |
32 | .text : { | 32 | .text : { |
33 | _text = .; /* Text */ | 33 | _text = .; /* Text */ |
diff --git a/arch/x86/include/asm/cache.h b/arch/x86/include/asm/cache.h index 2f9047cfaaca..48f99f15452e 100644 --- a/arch/x86/include/asm/cache.h +++ b/arch/x86/include/asm/cache.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) | 7 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) |
8 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 8 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
9 | 9 | ||
10 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 10 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
11 | 11 | ||
12 | #define INTERNODE_CACHE_SHIFT CONFIG_X86_INTERNODE_CACHE_SHIFT | 12 | #define INTERNODE_CACHE_SHIFT CONFIG_X86_INTERNODE_CACHE_SHIFT |
13 | #define INTERNODE_CACHE_BYTES (1 << INTERNODE_CACHE_SHIFT) | 13 | #define INTERNODE_CACHE_BYTES (1 << INTERNODE_CACHE_SHIFT) |
diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S index 8ded418b0593..13ab720573e3 100644 --- a/arch/x86/kernel/acpi/wakeup_32.S +++ b/arch/x86/kernel/acpi/wakeup_32.S | |||
@@ -1,4 +1,4 @@ | |||
1 | .section .text.page_aligned | 1 | .section .text..page_aligned |
2 | #include <linux/linkage.h> | 2 | #include <linux/linkage.h> |
3 | #include <asm/segment.h> | 3 | #include <asm/segment.h> |
4 | #include <asm/page_types.h> | 4 | #include <asm/page_types.h> |
diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c index 3a54dcb9cd0e..43e9ccf44947 100644 --- a/arch/x86/kernel/init_task.c +++ b/arch/x86/kernel/init_task.c | |||
@@ -34,7 +34,7 @@ EXPORT_SYMBOL(init_task); | |||
34 | /* | 34 | /* |
35 | * per-CPU TSS segments. Threads are completely 'soft' on Linux, | 35 | * per-CPU TSS segments. Threads are completely 'soft' on Linux, |
36 | * no more per-task TSS's. The TSS size is kept cacheline-aligned | 36 | * no more per-task TSS's. The TSS size is kept cacheline-aligned |
37 | * so they are allowed to end up in the .data.cacheline_aligned | 37 | * so they are allowed to end up in the .data..cacheline_aligned |
38 | * section. Since TSS's are completely CPU-local, we want them | 38 | * section. Since TSS's are completely CPU-local, we want them |
39 | * on exact cacheline boundaries, to eliminate cacheline ping-pong. | 39 | * on exact cacheline boundaries, to eliminate cacheline ping-pong. |
40 | */ | 40 | */ |
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index a867940a6dfc..cf592767812e 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -247,7 +247,7 @@ void __init setup_per_cpu_areas(void) | |||
247 | #endif | 247 | #endif |
248 | #endif | 248 | #endif |
249 | /* | 249 | /* |
250 | * Up to this point, the boot CPU has been using .data.init | 250 | * Up to this point, the boot CPU has been using .init.data |
251 | * area. Reload any changed state for the boot CPU. | 251 | * area. Reload any changed state for the boot CPU. |
252 | */ | 252 | */ |
253 | if (cpu == boot_cpu_id) | 253 | if (cpu == boot_cpu_id) |
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 2cc249718c46..d0bb52296fa3 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S | |||
@@ -97,7 +97,7 @@ SECTIONS | |||
97 | HEAD_TEXT | 97 | HEAD_TEXT |
98 | #ifdef CONFIG_X86_32 | 98 | #ifdef CONFIG_X86_32 |
99 | . = ALIGN(PAGE_SIZE); | 99 | . = ALIGN(PAGE_SIZE); |
100 | *(.text.page_aligned) | 100 | *(.text..page_aligned) |
101 | #endif | 101 | #endif |
102 | . = ALIGN(8); | 102 | . = ALIGN(8); |
103 | _stext = .; | 103 | _stext = .; |
@@ -305,7 +305,7 @@ SECTIONS | |||
305 | . = ALIGN(PAGE_SIZE); | 305 | . = ALIGN(PAGE_SIZE); |
306 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { | 306 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { |
307 | __bss_start = .; | 307 | __bss_start = .; |
308 | *(.bss.page_aligned) | 308 | *(.bss..page_aligned) |
309 | *(.bss) | 309 | *(.bss) |
310 | . = ALIGN(4); | 310 | . = ALIGN(4); |
311 | __bss_stop = .; | 311 | __bss_stop = .; |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index e8ea6825822c..9344216183a4 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -1059,7 +1059,7 @@ static void intel_i9xx_setup_flush(void) | |||
1059 | } | 1059 | } |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | static int intel_i915_configure(void) | 1062 | static int intel_i9xx_configure(void) |
1063 | { | 1063 | { |
1064 | struct aper_size_info_fixed *current_size; | 1064 | struct aper_size_info_fixed *current_size; |
1065 | u32 temp; | 1065 | u32 temp; |
@@ -1207,6 +1207,38 @@ static int intel_i9xx_fetch_size(void) | |||
1207 | return 0; | 1207 | return 0; |
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | static int intel_i915_get_gtt_size(void) | ||
1211 | { | ||
1212 | int size; | ||
1213 | |||
1214 | if (IS_G33) { | ||
1215 | u16 gmch_ctrl; | ||
1216 | |||
1217 | /* G33's GTT size defined in gmch_ctrl */ | ||
1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); | ||
1219 | switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) { | ||
1220 | case G33_PGETBL_SIZE_1M: | ||
1221 | size = 1024; | ||
1222 | break; | ||
1223 | case G33_PGETBL_SIZE_2M: | ||
1224 | size = 2048; | ||
1225 | break; | ||
1226 | default: | ||
1227 | dev_info(&agp_bridge->dev->dev, | ||
1228 | "unknown page table size 0x%x, assuming 512KB\n", | ||
1229 | (gmch_ctrl & G33_PGETBL_SIZE_MASK)); | ||
1230 | size = 512; | ||
1231 | } | ||
1232 | } else { | ||
1233 | /* On previous hardware, the GTT size was just what was | ||
1234 | * required to map the aperture. | ||
1235 | */ | ||
1236 | size = agp_bridge->driver->fetch_size(); | ||
1237 | } | ||
1238 | |||
1239 | return KB(size); | ||
1240 | } | ||
1241 | |||
1210 | /* The intel i915 automatically initializes the agp aperture during POST. | 1242 | /* The intel i915 automatically initializes the agp aperture during POST. |
1211 | * Use the memory already set aside for in the GTT. | 1243 | * Use the memory already set aside for in the GTT. |
1212 | */ | 1244 | */ |
@@ -1216,7 +1248,7 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) | |||
1216 | struct aper_size_info_fixed *size; | 1248 | struct aper_size_info_fixed *size; |
1217 | int num_entries; | 1249 | int num_entries; |
1218 | u32 temp, temp2; | 1250 | u32 temp, temp2; |
1219 | int gtt_map_size = 256 * 1024; | 1251 | int gtt_map_size; |
1220 | 1252 | ||
1221 | size = agp_bridge->current_size; | 1253 | size = agp_bridge->current_size; |
1222 | page_order = size->page_order; | 1254 | page_order = size->page_order; |
@@ -1226,8 +1258,8 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) | |||
1226 | pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); | 1258 | pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); |
1227 | pci_read_config_dword(intel_private.pcidev, I915_PTEADDR, &temp2); | 1259 | pci_read_config_dword(intel_private.pcidev, I915_PTEADDR, &temp2); |
1228 | 1260 | ||
1229 | if (IS_G33) | 1261 | gtt_map_size = intel_i915_get_gtt_size(); |
1230 | gtt_map_size = 1024 * 1024; /* 1M on G33 */ | 1262 | |
1231 | intel_private.gtt = ioremap(temp2, gtt_map_size); | 1263 | intel_private.gtt = ioremap(temp2, gtt_map_size); |
1232 | if (!intel_private.gtt) | 1264 | if (!intel_private.gtt) |
1233 | return -ENOMEM; | 1265 | return -ENOMEM; |
@@ -1422,7 +1454,7 @@ static const struct agp_bridge_driver intel_915_driver = { | |||
1422 | .size_type = FIXED_APER_SIZE, | 1454 | .size_type = FIXED_APER_SIZE, |
1423 | .num_aperture_sizes = 4, | 1455 | .num_aperture_sizes = 4, |
1424 | .needs_scratch_page = true, | 1456 | .needs_scratch_page = true, |
1425 | .configure = intel_i915_configure, | 1457 | .configure = intel_i9xx_configure, |
1426 | .fetch_size = intel_i9xx_fetch_size, | 1458 | .fetch_size = intel_i9xx_fetch_size, |
1427 | .cleanup = intel_i915_cleanup, | 1459 | .cleanup = intel_i915_cleanup, |
1428 | .mask_memory = intel_i810_mask_memory, | 1460 | .mask_memory = intel_i810_mask_memory, |
@@ -1455,7 +1487,7 @@ static const struct agp_bridge_driver intel_i965_driver = { | |||
1455 | .size_type = FIXED_APER_SIZE, | 1487 | .size_type = FIXED_APER_SIZE, |
1456 | .num_aperture_sizes = 4, | 1488 | .num_aperture_sizes = 4, |
1457 | .needs_scratch_page = true, | 1489 | .needs_scratch_page = true, |
1458 | .configure = intel_i915_configure, | 1490 | .configure = intel_i9xx_configure, |
1459 | .fetch_size = intel_i9xx_fetch_size, | 1491 | .fetch_size = intel_i9xx_fetch_size, |
1460 | .cleanup = intel_i915_cleanup, | 1492 | .cleanup = intel_i915_cleanup, |
1461 | .mask_memory = intel_i965_mask_memory, | 1493 | .mask_memory = intel_i965_mask_memory, |
@@ -1488,7 +1520,7 @@ static const struct agp_bridge_driver intel_g33_driver = { | |||
1488 | .size_type = FIXED_APER_SIZE, | 1520 | .size_type = FIXED_APER_SIZE, |
1489 | .num_aperture_sizes = 4, | 1521 | .num_aperture_sizes = 4, |
1490 | .needs_scratch_page = true, | 1522 | .needs_scratch_page = true, |
1491 | .configure = intel_i915_configure, | 1523 | .configure = intel_i9xx_configure, |
1492 | .fetch_size = intel_i9xx_fetch_size, | 1524 | .fetch_size = intel_i9xx_fetch_size, |
1493 | .cleanup = intel_i915_cleanup, | 1525 | .cleanup = intel_i915_cleanup, |
1494 | .mask_memory = intel_i965_mask_memory, | 1526 | .mask_memory = intel_i965_mask_memory, |
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 95639017bdbe..da78f2c0d909 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile | |||
@@ -22,6 +22,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o i915_mem.o \ | |||
22 | intel_fb.o \ | 22 | intel_fb.o \ |
23 | intel_tv.o \ | 23 | intel_tv.o \ |
24 | intel_dvo.o \ | 24 | intel_dvo.o \ |
25 | intel_ringbuffer.o \ | ||
25 | intel_overlay.o \ | 26 | intel_overlay.o \ |
26 | dvo_ch7xxx.o \ | 27 | dvo_ch7xxx.o \ |
27 | dvo_ch7017.o \ | 28 | dvo_ch7017.o \ |
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 322070c0c631..52510ad8b25d 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -77,7 +77,7 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
77 | case ACTIVE_LIST: | 77 | case ACTIVE_LIST: |
78 | seq_printf(m, "Active:\n"); | 78 | seq_printf(m, "Active:\n"); |
79 | lock = &dev_priv->mm.active_list_lock; | 79 | lock = &dev_priv->mm.active_list_lock; |
80 | head = &dev_priv->mm.active_list; | 80 | head = &dev_priv->render_ring.active_list; |
81 | break; | 81 | break; |
82 | case INACTIVE_LIST: | 82 | case INACTIVE_LIST: |
83 | seq_printf(m, "Inactive:\n"); | 83 | seq_printf(m, "Inactive:\n"); |
@@ -129,7 +129,8 @@ static int i915_gem_request_info(struct seq_file *m, void *data) | |||
129 | struct drm_i915_gem_request *gem_request; | 129 | struct drm_i915_gem_request *gem_request; |
130 | 130 | ||
131 | seq_printf(m, "Request:\n"); | 131 | seq_printf(m, "Request:\n"); |
132 | list_for_each_entry(gem_request, &dev_priv->mm.request_list, list) { | 132 | list_for_each_entry(gem_request, &dev_priv->render_ring.request_list, |
133 | list) { | ||
133 | seq_printf(m, " %d @ %d\n", | 134 | seq_printf(m, " %d @ %d\n", |
134 | gem_request->seqno, | 135 | gem_request->seqno, |
135 | (int) (jiffies - gem_request->emitted_jiffies)); | 136 | (int) (jiffies - gem_request->emitted_jiffies)); |
@@ -143,9 +144,9 @@ static int i915_gem_seqno_info(struct seq_file *m, void *data) | |||
143 | struct drm_device *dev = node->minor->dev; | 144 | struct drm_device *dev = node->minor->dev; |
144 | drm_i915_private_t *dev_priv = dev->dev_private; | 145 | drm_i915_private_t *dev_priv = dev->dev_private; |
145 | 146 | ||
146 | if (dev_priv->hw_status_page != NULL) { | 147 | if (dev_priv->render_ring.status_page.page_addr != NULL) { |
147 | seq_printf(m, "Current sequence: %d\n", | 148 | seq_printf(m, "Current sequence: %d\n", |
148 | i915_get_gem_seqno(dev)); | 149 | i915_get_gem_seqno(dev, &dev_priv->render_ring)); |
149 | } else { | 150 | } else { |
150 | seq_printf(m, "Current sequence: hws uninitialized\n"); | 151 | seq_printf(m, "Current sequence: hws uninitialized\n"); |
151 | } | 152 | } |
@@ -195,9 +196,9 @@ static int i915_interrupt_info(struct seq_file *m, void *data) | |||
195 | } | 196 | } |
196 | seq_printf(m, "Interrupts received: %d\n", | 197 | seq_printf(m, "Interrupts received: %d\n", |
197 | atomic_read(&dev_priv->irq_received)); | 198 | atomic_read(&dev_priv->irq_received)); |
198 | if (dev_priv->hw_status_page != NULL) { | 199 | if (dev_priv->render_ring.status_page.page_addr != NULL) { |
199 | seq_printf(m, "Current sequence: %d\n", | 200 | seq_printf(m, "Current sequence: %d\n", |
200 | i915_get_gem_seqno(dev)); | 201 | i915_get_gem_seqno(dev, &dev_priv->render_ring)); |
201 | } else { | 202 | } else { |
202 | seq_printf(m, "Current sequence: hws uninitialized\n"); | 203 | seq_printf(m, "Current sequence: hws uninitialized\n"); |
203 | } | 204 | } |
@@ -251,7 +252,7 @@ static int i915_hws_info(struct seq_file *m, void *data) | |||
251 | int i; | 252 | int i; |
252 | volatile u32 *hws; | 253 | volatile u32 *hws; |
253 | 254 | ||
254 | hws = (volatile u32 *)dev_priv->hw_status_page; | 255 | hws = (volatile u32 *)dev_priv->render_ring.status_page.page_addr; |
255 | if (hws == NULL) | 256 | if (hws == NULL) |
256 | return 0; | 257 | return 0; |
257 | 258 | ||
@@ -287,7 +288,8 @@ static int i915_batchbuffer_info(struct seq_file *m, void *data) | |||
287 | 288 | ||
288 | spin_lock(&dev_priv->mm.active_list_lock); | 289 | spin_lock(&dev_priv->mm.active_list_lock); |
289 | 290 | ||
290 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { | 291 | list_for_each_entry(obj_priv, &dev_priv->render_ring.active_list, |
292 | list) { | ||
291 | obj = &obj_priv->base; | 293 | obj = &obj_priv->base; |
292 | if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) { | 294 | if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) { |
293 | ret = i915_gem_object_get_pages(obj, 0); | 295 | ret = i915_gem_object_get_pages(obj, 0); |
@@ -317,14 +319,14 @@ static int i915_ringbuffer_data(struct seq_file *m, void *data) | |||
317 | u8 *virt; | 319 | u8 *virt; |
318 | uint32_t *ptr, off; | 320 | uint32_t *ptr, off; |
319 | 321 | ||
320 | if (!dev_priv->ring.ring_obj) { | 322 | if (!dev_priv->render_ring.gem_object) { |
321 | seq_printf(m, "No ringbuffer setup\n"); | 323 | seq_printf(m, "No ringbuffer setup\n"); |
322 | return 0; | 324 | return 0; |
323 | } | 325 | } |
324 | 326 | ||
325 | virt = dev_priv->ring.virtual_start; | 327 | virt = dev_priv->render_ring.virtual_start; |
326 | 328 | ||
327 | for (off = 0; off < dev_priv->ring.Size; off += 4) { | 329 | for (off = 0; off < dev_priv->render_ring.size; off += 4) { |
328 | ptr = (uint32_t *)(virt + off); | 330 | ptr = (uint32_t *)(virt + off); |
329 | seq_printf(m, "%08x : %08x\n", off, *ptr); | 331 | seq_printf(m, "%08x : %08x\n", off, *ptr); |
330 | } | 332 | } |
@@ -344,7 +346,7 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data) | |||
344 | 346 | ||
345 | seq_printf(m, "RingHead : %08x\n", head); | 347 | seq_printf(m, "RingHead : %08x\n", head); |
346 | seq_printf(m, "RingTail : %08x\n", tail); | 348 | seq_printf(m, "RingTail : %08x\n", tail); |
347 | seq_printf(m, "RingSize : %08lx\n", dev_priv->ring.Size); | 349 | seq_printf(m, "RingSize : %08lx\n", dev_priv->render_ring.size); |
348 | seq_printf(m, "Acthd : %08x\n", I915_READ(IS_I965G(dev) ? ACTHD_I965 : ACTHD)); | 350 | seq_printf(m, "Acthd : %08x\n", I915_READ(IS_I965G(dev) ? ACTHD_I965 : ACTHD)); |
349 | 351 | ||
350 | return 0; | 352 | return 0; |
@@ -489,11 +491,14 @@ static int i915_cur_delayinfo(struct seq_file *m, void *unused) | |||
489 | struct drm_device *dev = node->minor->dev; | 491 | struct drm_device *dev = node->minor->dev; |
490 | drm_i915_private_t *dev_priv = dev->dev_private; | 492 | drm_i915_private_t *dev_priv = dev->dev_private; |
491 | u16 rgvswctl = I915_READ16(MEMSWCTL); | 493 | u16 rgvswctl = I915_READ16(MEMSWCTL); |
494 | u16 rgvstat = I915_READ16(MEMSTAT_ILK); | ||
492 | 495 | ||
493 | seq_printf(m, "Last command: 0x%01x\n", (rgvswctl >> 13) & 0x3); | 496 | seq_printf(m, "Requested P-state: %d\n", (rgvswctl >> 8) & 0xf); |
494 | seq_printf(m, "Command status: %d\n", (rgvswctl >> 12) & 1); | 497 | seq_printf(m, "Requested VID: %d\n", rgvswctl & 0x3f); |
495 | seq_printf(m, "P%d DELAY 0x%02x\n", (rgvswctl >> 8) & 0xf, | 498 | seq_printf(m, "Current VID: %d\n", (rgvstat & MEMSTAT_VID_MASK) >> |
496 | rgvswctl & 0x3f); | 499 | MEMSTAT_VID_SHIFT); |
500 | seq_printf(m, "Current P-state: %d\n", | ||
501 | (rgvstat & MEMSTAT_PSTATE_MASK) >> MEMSTAT_PSTATE_SHIFT); | ||
497 | 502 | ||
498 | return 0; | 503 | return 0; |
499 | } | 504 | } |
@@ -508,7 +513,8 @@ static int i915_delayfreq_table(struct seq_file *m, void *unused) | |||
508 | 513 | ||
509 | for (i = 0; i < 16; i++) { | 514 | for (i = 0; i < 16; i++) { |
510 | delayfreq = I915_READ(PXVFREQ_BASE + i * 4); | 515 | delayfreq = I915_READ(PXVFREQ_BASE + i * 4); |
511 | seq_printf(m, "P%02dVIDFREQ: 0x%08x\n", i, delayfreq); | 516 | seq_printf(m, "P%02dVIDFREQ: 0x%08x (VID: %d)\n", i, delayfreq, |
517 | (delayfreq & PXVFREQ_PX_MASK) >> PXVFREQ_PX_SHIFT); | ||
512 | } | 518 | } |
513 | 519 | ||
514 | return 0; | 520 | return 0; |
@@ -541,6 +547,8 @@ static int i915_drpc_info(struct seq_file *m, void *unused) | |||
541 | struct drm_device *dev = node->minor->dev; | 547 | struct drm_device *dev = node->minor->dev; |
542 | drm_i915_private_t *dev_priv = dev->dev_private; | 548 | drm_i915_private_t *dev_priv = dev->dev_private; |
543 | u32 rgvmodectl = I915_READ(MEMMODECTL); | 549 | u32 rgvmodectl = I915_READ(MEMMODECTL); |
550 | u32 rstdbyctl = I915_READ(MCHBAR_RENDER_STANDBY); | ||
551 | u16 crstandvid = I915_READ16(CRSTANDVID); | ||
544 | 552 | ||
545 | seq_printf(m, "HD boost: %s\n", (rgvmodectl & MEMMODE_BOOST_EN) ? | 553 | seq_printf(m, "HD boost: %s\n", (rgvmodectl & MEMMODE_BOOST_EN) ? |
546 | "yes" : "no"); | 554 | "yes" : "no"); |
@@ -555,9 +563,13 @@ static int i915_drpc_info(struct seq_file *m, void *unused) | |||
555 | rgvmodectl & MEMMODE_RCLK_GATE ? "yes" : "no"); | 563 | rgvmodectl & MEMMODE_RCLK_GATE ? "yes" : "no"); |
556 | seq_printf(m, "Starting frequency: P%d\n", | 564 | seq_printf(m, "Starting frequency: P%d\n", |
557 | (rgvmodectl & MEMMODE_FSTART_MASK) >> MEMMODE_FSTART_SHIFT); | 565 | (rgvmodectl & MEMMODE_FSTART_MASK) >> MEMMODE_FSTART_SHIFT); |
558 | seq_printf(m, "Max frequency: P%d\n", | 566 | seq_printf(m, "Max P-state: P%d\n", |
559 | (rgvmodectl & MEMMODE_FMAX_MASK) >> MEMMODE_FMAX_SHIFT); | 567 | (rgvmodectl & MEMMODE_FMAX_MASK) >> MEMMODE_FMAX_SHIFT); |
560 | seq_printf(m, "Min frequency: P%d\n", (rgvmodectl & MEMMODE_FMIN_MASK)); | 568 | seq_printf(m, "Min P-state: P%d\n", (rgvmodectl & MEMMODE_FMIN_MASK)); |
569 | seq_printf(m, "RS1 VID: %d\n", (crstandvid & 0x3f)); | ||
570 | seq_printf(m, "RS2 VID: %d\n", ((crstandvid >> 8) & 0x3f)); | ||
571 | seq_printf(m, "Render standby enabled: %s\n", | ||
572 | (rstdbyctl & RCX_SW_EXIT) ? "no" : "yes"); | ||
561 | 573 | ||
562 | return 0; | 574 | return 0; |
563 | } | 575 | } |
@@ -621,6 +633,36 @@ static int i915_sr_status(struct seq_file *m, void *unused) | |||
621 | return 0; | 633 | return 0; |
622 | } | 634 | } |
623 | 635 | ||
636 | static int i915_emon_status(struct seq_file *m, void *unused) | ||
637 | { | ||
638 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
639 | struct drm_device *dev = node->minor->dev; | ||
640 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
641 | unsigned long temp, chipset, gfx; | ||
642 | |||
643 | temp = i915_mch_val(dev_priv); | ||
644 | chipset = i915_chipset_val(dev_priv); | ||
645 | gfx = i915_gfx_val(dev_priv); | ||
646 | |||
647 | seq_printf(m, "GMCH temp: %ld\n", temp); | ||
648 | seq_printf(m, "Chipset power: %ld\n", chipset); | ||
649 | seq_printf(m, "GFX power: %ld\n", gfx); | ||
650 | seq_printf(m, "Total power: %ld\n", chipset + gfx); | ||
651 | |||
652 | return 0; | ||
653 | } | ||
654 | |||
655 | static int i915_gfxec(struct seq_file *m, void *unused) | ||
656 | { | ||
657 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
658 | struct drm_device *dev = node->minor->dev; | ||
659 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
660 | |||
661 | seq_printf(m, "GFXEC: %ld\n", (unsigned long)I915_READ(0x112f4)); | ||
662 | |||
663 | return 0; | ||
664 | } | ||
665 | |||
624 | static int | 666 | static int |
625 | i915_wedged_open(struct inode *inode, | 667 | i915_wedged_open(struct inode *inode, |
626 | struct file *filp) | 668 | struct file *filp) |
@@ -743,6 +785,8 @@ static struct drm_info_list i915_debugfs_list[] = { | |||
743 | {"i915_delayfreq_table", i915_delayfreq_table, 0}, | 785 | {"i915_delayfreq_table", i915_delayfreq_table, 0}, |
744 | {"i915_inttoext_table", i915_inttoext_table, 0}, | 786 | {"i915_inttoext_table", i915_inttoext_table, 0}, |
745 | {"i915_drpc_info", i915_drpc_info, 0}, | 787 | {"i915_drpc_info", i915_drpc_info, 0}, |
788 | {"i915_emon_status", i915_emon_status, 0}, | ||
789 | {"i915_gfxec", i915_gfxec, 0}, | ||
746 | {"i915_fbc_status", i915_fbc_status, 0}, | 790 | {"i915_fbc_status", i915_fbc_status, 0}, |
747 | {"i915_sr_status", i915_sr_status, 0}, | 791 | {"i915_sr_status", i915_sr_status, 0}, |
748 | }; | 792 | }; |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 2a6b5de5ae5d..84ce95602f00 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -40,84 +40,6 @@ | |||
40 | #include <linux/vga_switcheroo.h> | 40 | #include <linux/vga_switcheroo.h> |
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | 42 | ||
43 | /* Really want an OS-independent resettable timer. Would like to have | ||
44 | * this loop run for (eg) 3 sec, but have the timer reset every time | ||
45 | * the head pointer changes, so that EBUSY only happens if the ring | ||
46 | * actually stalls for (eg) 3 seconds. | ||
47 | */ | ||
48 | int i915_wait_ring(struct drm_device * dev, int n, const char *caller) | ||
49 | { | ||
50 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
51 | drm_i915_ring_buffer_t *ring = &(dev_priv->ring); | ||
52 | u32 acthd_reg = IS_I965G(dev) ? ACTHD_I965 : ACTHD; | ||
53 | u32 last_acthd = I915_READ(acthd_reg); | ||
54 | u32 acthd; | ||
55 | u32 last_head = I915_READ(PRB0_HEAD) & HEAD_ADDR; | ||
56 | int i; | ||
57 | |||
58 | trace_i915_ring_wait_begin (dev); | ||
59 | |||
60 | for (i = 0; i < 100000; i++) { | ||
61 | ring->head = I915_READ(PRB0_HEAD) & HEAD_ADDR; | ||
62 | acthd = I915_READ(acthd_reg); | ||
63 | ring->space = ring->head - (ring->tail + 8); | ||
64 | if (ring->space < 0) | ||
65 | ring->space += ring->Size; | ||
66 | if (ring->space >= n) { | ||
67 | trace_i915_ring_wait_end (dev); | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | if (dev->primary->master) { | ||
72 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | ||
73 | if (master_priv->sarea_priv) | ||
74 | master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; | ||
75 | } | ||
76 | |||
77 | |||
78 | if (ring->head != last_head) | ||
79 | i = 0; | ||
80 | if (acthd != last_acthd) | ||
81 | i = 0; | ||
82 | |||
83 | last_head = ring->head; | ||
84 | last_acthd = acthd; | ||
85 | msleep_interruptible(10); | ||
86 | |||
87 | } | ||
88 | |||
89 | trace_i915_ring_wait_end (dev); | ||
90 | return -EBUSY; | ||
91 | } | ||
92 | |||
93 | /* As a ringbuffer is only allowed to wrap between instructions, fill | ||
94 | * the tail with NOOPs. | ||
95 | */ | ||
96 | int i915_wrap_ring(struct drm_device *dev) | ||
97 | { | ||
98 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
99 | volatile unsigned int *virt; | ||
100 | int rem; | ||
101 | |||
102 | rem = dev_priv->ring.Size - dev_priv->ring.tail; | ||
103 | if (dev_priv->ring.space < rem) { | ||
104 | int ret = i915_wait_ring(dev, rem, __func__); | ||
105 | if (ret) | ||
106 | return ret; | ||
107 | } | ||
108 | dev_priv->ring.space -= rem; | ||
109 | |||
110 | virt = (unsigned int *) | ||
111 | (dev_priv->ring.virtual_start + dev_priv->ring.tail); | ||
112 | rem /= 4; | ||
113 | while (rem--) | ||
114 | *virt++ = MI_NOOP; | ||
115 | |||
116 | dev_priv->ring.tail = 0; | ||
117 | |||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | /** | 43 | /** |
122 | * Sets up the hardware status page for devices that need a physical address | 44 | * Sets up the hardware status page for devices that need a physical address |
123 | * in the register. | 45 | * in the register. |
@@ -133,10 +55,11 @@ static int i915_init_phys_hws(struct drm_device *dev) | |||
133 | DRM_ERROR("Can not allocate hardware status page\n"); | 55 | DRM_ERROR("Can not allocate hardware status page\n"); |
134 | return -ENOMEM; | 56 | return -ENOMEM; |
135 | } | 57 | } |
136 | dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; | 58 | dev_priv->render_ring.status_page.page_addr |
59 | = dev_priv->status_page_dmah->vaddr; | ||
137 | dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; | 60 | dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; |
138 | 61 | ||
139 | memset(dev_priv->hw_status_page, 0, PAGE_SIZE); | 62 | memset(dev_priv->render_ring.status_page.page_addr, 0, PAGE_SIZE); |
140 | 63 | ||
141 | if (IS_I965G(dev)) | 64 | if (IS_I965G(dev)) |
142 | dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) & | 65 | dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) & |
@@ -159,8 +82,8 @@ static void i915_free_hws(struct drm_device *dev) | |||
159 | dev_priv->status_page_dmah = NULL; | 82 | dev_priv->status_page_dmah = NULL; |
160 | } | 83 | } |
161 | 84 | ||
162 | if (dev_priv->status_gfx_addr) { | 85 | if (dev_priv->render_ring.status_page.gfx_addr) { |
163 | dev_priv->status_gfx_addr = 0; | 86 | dev_priv->render_ring.status_page.gfx_addr = 0; |
164 | drm_core_ioremapfree(&dev_priv->hws_map, dev); | 87 | drm_core_ioremapfree(&dev_priv->hws_map, dev); |
165 | } | 88 | } |
166 | 89 | ||
@@ -172,7 +95,7 @@ void i915_kernel_lost_context(struct drm_device * dev) | |||
172 | { | 95 | { |
173 | drm_i915_private_t *dev_priv = dev->dev_private; | 96 | drm_i915_private_t *dev_priv = dev->dev_private; |
174 | struct drm_i915_master_private *master_priv; | 97 | struct drm_i915_master_private *master_priv; |
175 | drm_i915_ring_buffer_t *ring = &(dev_priv->ring); | 98 | struct intel_ring_buffer *ring = &dev_priv->render_ring; |
176 | 99 | ||
177 | /* | 100 | /* |
178 | * We should never lose context on the ring with modesetting | 101 | * We should never lose context on the ring with modesetting |
@@ -185,7 +108,7 @@ void i915_kernel_lost_context(struct drm_device * dev) | |||
185 | ring->tail = I915_READ(PRB0_TAIL) & TAIL_ADDR; | 108 | ring->tail = I915_READ(PRB0_TAIL) & TAIL_ADDR; |
186 | ring->space = ring->head - (ring->tail + 8); | 109 | ring->space = ring->head - (ring->tail + 8); |
187 | if (ring->space < 0) | 110 | if (ring->space < 0) |
188 | ring->space += ring->Size; | 111 | ring->space += ring->size; |
189 | 112 | ||
190 | if (!dev->primary->master) | 113 | if (!dev->primary->master) |
191 | return; | 114 | return; |
@@ -205,12 +128,9 @@ static int i915_dma_cleanup(struct drm_device * dev) | |||
205 | if (dev->irq_enabled) | 128 | if (dev->irq_enabled) |
206 | drm_irq_uninstall(dev); | 129 | drm_irq_uninstall(dev); |
207 | 130 | ||
208 | if (dev_priv->ring.virtual_start) { | 131 | intel_cleanup_ring_buffer(dev, &dev_priv->render_ring); |
209 | drm_core_ioremapfree(&dev_priv->ring.map, dev); | 132 | if (HAS_BSD(dev)) |
210 | dev_priv->ring.virtual_start = NULL; | 133 | intel_cleanup_ring_buffer(dev, &dev_priv->bsd_ring); |
211 | dev_priv->ring.map.handle = NULL; | ||
212 | dev_priv->ring.map.size = 0; | ||
213 | } | ||
214 | 134 | ||
215 | /* Clear the HWS virtual address at teardown */ | 135 | /* Clear the HWS virtual address at teardown */ |
216 | if (I915_NEED_GFX_HWS(dev)) | 136 | if (I915_NEED_GFX_HWS(dev)) |
@@ -233,24 +153,24 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init) | |||
233 | } | 153 | } |
234 | 154 | ||
235 | if (init->ring_size != 0) { | 155 | if (init->ring_size != 0) { |
236 | if (dev_priv->ring.ring_obj != NULL) { | 156 | if (dev_priv->render_ring.gem_object != NULL) { |
237 | i915_dma_cleanup(dev); | 157 | i915_dma_cleanup(dev); |
238 | DRM_ERROR("Client tried to initialize ringbuffer in " | 158 | DRM_ERROR("Client tried to initialize ringbuffer in " |
239 | "GEM mode\n"); | 159 | "GEM mode\n"); |
240 | return -EINVAL; | 160 | return -EINVAL; |
241 | } | 161 | } |
242 | 162 | ||
243 | dev_priv->ring.Size = init->ring_size; | 163 | dev_priv->render_ring.size = init->ring_size; |
244 | 164 | ||
245 | dev_priv->ring.map.offset = init->ring_start; | 165 | dev_priv->render_ring.map.offset = init->ring_start; |
246 | dev_priv->ring.map.size = init->ring_size; | 166 | dev_priv->render_ring.map.size = init->ring_size; |
247 | dev_priv->ring.map.type = 0; | 167 | dev_priv->render_ring.map.type = 0; |
248 | dev_priv->ring.map.flags = 0; | 168 | dev_priv->render_ring.map.flags = 0; |
249 | dev_priv->ring.map.mtrr = 0; | 169 | dev_priv->render_ring.map.mtrr = 0; |
250 | 170 | ||
251 | drm_core_ioremap_wc(&dev_priv->ring.map, dev); | 171 | drm_core_ioremap_wc(&dev_priv->render_ring.map, dev); |
252 | 172 | ||
253 | if (dev_priv->ring.map.handle == NULL) { | 173 | if (dev_priv->render_ring.map.handle == NULL) { |
254 | i915_dma_cleanup(dev); | 174 | i915_dma_cleanup(dev); |
255 | DRM_ERROR("can not ioremap virtual address for" | 175 | DRM_ERROR("can not ioremap virtual address for" |
256 | " ring buffer\n"); | 176 | " ring buffer\n"); |
@@ -258,7 +178,7 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init) | |||
258 | } | 178 | } |
259 | } | 179 | } |
260 | 180 | ||
261 | dev_priv->ring.virtual_start = dev_priv->ring.map.handle; | 181 | dev_priv->render_ring.virtual_start = dev_priv->render_ring.map.handle; |
262 | 182 | ||
263 | dev_priv->cpp = init->cpp; | 183 | dev_priv->cpp = init->cpp; |
264 | dev_priv->back_offset = init->back_offset; | 184 | dev_priv->back_offset = init->back_offset; |
@@ -278,26 +198,29 @@ static int i915_dma_resume(struct drm_device * dev) | |||
278 | { | 198 | { |
279 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 199 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
280 | 200 | ||
201 | struct intel_ring_buffer *ring; | ||
281 | DRM_DEBUG_DRIVER("%s\n", __func__); | 202 | DRM_DEBUG_DRIVER("%s\n", __func__); |
282 | 203 | ||
283 | if (dev_priv->ring.map.handle == NULL) { | 204 | ring = &dev_priv->render_ring; |
205 | |||
206 | if (ring->map.handle == NULL) { | ||
284 | DRM_ERROR("can not ioremap virtual address for" | 207 | DRM_ERROR("can not ioremap virtual address for" |
285 | " ring buffer\n"); | 208 | " ring buffer\n"); |
286 | return -ENOMEM; | 209 | return -ENOMEM; |
287 | } | 210 | } |
288 | 211 | ||
289 | /* Program Hardware Status Page */ | 212 | /* Program Hardware Status Page */ |
290 | if (!dev_priv->hw_status_page) { | 213 | if (!ring->status_page.page_addr) { |
291 | DRM_ERROR("Can not find hardware status page\n"); | 214 | DRM_ERROR("Can not find hardware status page\n"); |
292 | return -EINVAL; | 215 | return -EINVAL; |
293 | } | 216 | } |
294 | DRM_DEBUG_DRIVER("hw status page @ %p\n", | 217 | DRM_DEBUG_DRIVER("hw status page @ %p\n", |
295 | dev_priv->hw_status_page); | 218 | ring->status_page.page_addr); |
296 | 219 | if (ring->status_page.gfx_addr != 0) | |
297 | if (dev_priv->status_gfx_addr != 0) | 220 | ring->setup_status_page(dev, ring); |
298 | I915_WRITE(HWS_PGA, dev_priv->status_gfx_addr); | ||
299 | else | 221 | else |
300 | I915_WRITE(HWS_PGA, dev_priv->dma_status_page); | 222 | I915_WRITE(HWS_PGA, dev_priv->dma_status_page); |
223 | |||
301 | DRM_DEBUG_DRIVER("Enabled hardware status page\n"); | 224 | DRM_DEBUG_DRIVER("Enabled hardware status page\n"); |
302 | 225 | ||
303 | return 0; | 226 | return 0; |
@@ -407,9 +330,8 @@ static int i915_emit_cmds(struct drm_device * dev, int *buffer, int dwords) | |||
407 | { | 330 | { |
408 | drm_i915_private_t *dev_priv = dev->dev_private; | 331 | drm_i915_private_t *dev_priv = dev->dev_private; |
409 | int i; | 332 | int i; |
410 | RING_LOCALS; | ||
411 | 333 | ||
412 | if ((dwords+1) * sizeof(int) >= dev_priv->ring.Size - 8) | 334 | if ((dwords+1) * sizeof(int) >= dev_priv->render_ring.size - 8) |
413 | return -EINVAL; | 335 | return -EINVAL; |
414 | 336 | ||
415 | BEGIN_LP_RING((dwords+1)&~1); | 337 | BEGIN_LP_RING((dwords+1)&~1); |
@@ -442,9 +364,7 @@ i915_emit_box(struct drm_device *dev, | |||
442 | struct drm_clip_rect *boxes, | 364 | struct drm_clip_rect *boxes, |
443 | int i, int DR1, int DR4) | 365 | int i, int DR1, int DR4) |
444 | { | 366 | { |
445 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
446 | struct drm_clip_rect box = boxes[i]; | 367 | struct drm_clip_rect box = boxes[i]; |
447 | RING_LOCALS; | ||
448 | 368 | ||
449 | if (box.y2 <= box.y1 || box.x2 <= box.x1 || box.y2 <= 0 || box.x2 <= 0) { | 369 | if (box.y2 <= box.y1 || box.x2 <= box.x1 || box.y2 <= 0 || box.x2 <= 0) { |
450 | DRM_ERROR("Bad box %d,%d..%d,%d\n", | 370 | DRM_ERROR("Bad box %d,%d..%d,%d\n", |
@@ -481,7 +401,6 @@ static void i915_emit_breadcrumb(struct drm_device *dev) | |||
481 | { | 401 | { |
482 | drm_i915_private_t *dev_priv = dev->dev_private; | 402 | drm_i915_private_t *dev_priv = dev->dev_private; |
483 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | 403 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; |
484 | RING_LOCALS; | ||
485 | 404 | ||
486 | dev_priv->counter++; | 405 | dev_priv->counter++; |
487 | if (dev_priv->counter > 0x7FFFFFFFUL) | 406 | if (dev_priv->counter > 0x7FFFFFFFUL) |
@@ -535,10 +454,8 @@ static int i915_dispatch_batchbuffer(struct drm_device * dev, | |||
535 | drm_i915_batchbuffer_t * batch, | 454 | drm_i915_batchbuffer_t * batch, |
536 | struct drm_clip_rect *cliprects) | 455 | struct drm_clip_rect *cliprects) |
537 | { | 456 | { |
538 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
539 | int nbox = batch->num_cliprects; | 457 | int nbox = batch->num_cliprects; |
540 | int i = 0, count; | 458 | int i = 0, count; |
541 | RING_LOCALS; | ||
542 | 459 | ||
543 | if ((batch->start | batch->used) & 0x7) { | 460 | if ((batch->start | batch->used) & 0x7) { |
544 | DRM_ERROR("alignment"); | 461 | DRM_ERROR("alignment"); |
@@ -587,7 +504,6 @@ static int i915_dispatch_flip(struct drm_device * dev) | |||
587 | drm_i915_private_t *dev_priv = dev->dev_private; | 504 | drm_i915_private_t *dev_priv = dev->dev_private; |
588 | struct drm_i915_master_private *master_priv = | 505 | struct drm_i915_master_private *master_priv = |
589 | dev->primary->master->driver_priv; | 506 | dev->primary->master->driver_priv; |
590 | RING_LOCALS; | ||
591 | 507 | ||
592 | if (!master_priv->sarea_priv) | 508 | if (!master_priv->sarea_priv) |
593 | return -EINVAL; | 509 | return -EINVAL; |
@@ -640,7 +556,8 @@ static int i915_quiescent(struct drm_device * dev) | |||
640 | drm_i915_private_t *dev_priv = dev->dev_private; | 556 | drm_i915_private_t *dev_priv = dev->dev_private; |
641 | 557 | ||
642 | i915_kernel_lost_context(dev); | 558 | i915_kernel_lost_context(dev); |
643 | return i915_wait_ring(dev, dev_priv->ring.Size - 8, __func__); | 559 | return intel_wait_ring_buffer(dev, &dev_priv->render_ring, |
560 | dev_priv->render_ring.size - 8); | ||
644 | } | 561 | } |
645 | 562 | ||
646 | static int i915_flush_ioctl(struct drm_device *dev, void *data, | 563 | static int i915_flush_ioctl(struct drm_device *dev, void *data, |
@@ -827,6 +744,9 @@ static int i915_getparam(struct drm_device *dev, void *data, | |||
827 | /* depends on GEM */ | 744 | /* depends on GEM */ |
828 | value = dev_priv->has_gem; | 745 | value = dev_priv->has_gem; |
829 | break; | 746 | break; |
747 | case I915_PARAM_HAS_BSD: | ||
748 | value = HAS_BSD(dev); | ||
749 | break; | ||
830 | default: | 750 | default: |
831 | DRM_DEBUG_DRIVER("Unknown parameter %d\n", | 751 | DRM_DEBUG_DRIVER("Unknown parameter %d\n", |
832 | param->param); | 752 | param->param); |
@@ -882,6 +802,7 @@ static int i915_set_status_page(struct drm_device *dev, void *data, | |||
882 | { | 802 | { |
883 | drm_i915_private_t *dev_priv = dev->dev_private; | 803 | drm_i915_private_t *dev_priv = dev->dev_private; |
884 | drm_i915_hws_addr_t *hws = data; | 804 | drm_i915_hws_addr_t *hws = data; |
805 | struct intel_ring_buffer *ring = &dev_priv->render_ring; | ||
885 | 806 | ||
886 | if (!I915_NEED_GFX_HWS(dev)) | 807 | if (!I915_NEED_GFX_HWS(dev)) |
887 | return -EINVAL; | 808 | return -EINVAL; |
@@ -898,7 +819,7 @@ static int i915_set_status_page(struct drm_device *dev, void *data, | |||
898 | 819 | ||
899 | DRM_DEBUG_DRIVER("set status page addr 0x%08x\n", (u32)hws->addr); | 820 | DRM_DEBUG_DRIVER("set status page addr 0x%08x\n", (u32)hws->addr); |
900 | 821 | ||
901 | dev_priv->status_gfx_addr = hws->addr & (0x1ffff<<12); | 822 | ring->status_page.gfx_addr = hws->addr & (0x1ffff<<12); |
902 | 823 | ||
903 | dev_priv->hws_map.offset = dev->agp->base + hws->addr; | 824 | dev_priv->hws_map.offset = dev->agp->base + hws->addr; |
904 | dev_priv->hws_map.size = 4*1024; | 825 | dev_priv->hws_map.size = 4*1024; |
@@ -909,19 +830,19 @@ static int i915_set_status_page(struct drm_device *dev, void *data, | |||
909 | drm_core_ioremap_wc(&dev_priv->hws_map, dev); | 830 | drm_core_ioremap_wc(&dev_priv->hws_map, dev); |
910 | if (dev_priv->hws_map.handle == NULL) { | 831 | if (dev_priv->hws_map.handle == NULL) { |
911 | i915_dma_cleanup(dev); | 832 | i915_dma_cleanup(dev); |
912 | dev_priv->status_gfx_addr = 0; | 833 | ring->status_page.gfx_addr = 0; |
913 | DRM_ERROR("can not ioremap virtual address for" | 834 | DRM_ERROR("can not ioremap virtual address for" |
914 | " G33 hw status page\n"); | 835 | " G33 hw status page\n"); |
915 | return -ENOMEM; | 836 | return -ENOMEM; |
916 | } | 837 | } |
917 | dev_priv->hw_status_page = dev_priv->hws_map.handle; | 838 | ring->status_page.page_addr = dev_priv->hws_map.handle; |
839 | memset(ring->status_page.page_addr, 0, PAGE_SIZE); | ||
840 | I915_WRITE(HWS_PGA, ring->status_page.gfx_addr); | ||
918 | 841 | ||
919 | memset(dev_priv->hw_status_page, 0, PAGE_SIZE); | ||
920 | I915_WRITE(HWS_PGA, dev_priv->status_gfx_addr); | ||
921 | DRM_DEBUG_DRIVER("load hws HWS_PGA with gfx mem 0x%x\n", | 842 | DRM_DEBUG_DRIVER("load hws HWS_PGA with gfx mem 0x%x\n", |
922 | dev_priv->status_gfx_addr); | 843 | ring->status_page.gfx_addr); |
923 | DRM_DEBUG_DRIVER("load hws at %p\n", | 844 | DRM_DEBUG_DRIVER("load hws at %p\n", |
924 | dev_priv->hw_status_page); | 845 | ring->status_page.page_addr); |
925 | return 0; | 846 | return 0; |
926 | } | 847 | } |
927 | 848 | ||
@@ -1539,14 +1460,11 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master) | |||
1539 | master->driver_priv = NULL; | 1460 | master->driver_priv = NULL; |
1540 | } | 1461 | } |
1541 | 1462 | ||
1542 | static void i915_get_mem_freq(struct drm_device *dev) | 1463 | static void i915_pineview_get_mem_freq(struct drm_device *dev) |
1543 | { | 1464 | { |
1544 | drm_i915_private_t *dev_priv = dev->dev_private; | 1465 | drm_i915_private_t *dev_priv = dev->dev_private; |
1545 | u32 tmp; | 1466 | u32 tmp; |
1546 | 1467 | ||
1547 | if (!IS_PINEVIEW(dev)) | ||
1548 | return; | ||
1549 | |||
1550 | tmp = I915_READ(CLKCFG); | 1468 | tmp = I915_READ(CLKCFG); |
1551 | 1469 | ||
1552 | switch (tmp & CLKCFG_FSB_MASK) { | 1470 | switch (tmp & CLKCFG_FSB_MASK) { |
@@ -1575,8 +1493,525 @@ static void i915_get_mem_freq(struct drm_device *dev) | |||
1575 | dev_priv->mem_freq = 800; | 1493 | dev_priv->mem_freq = 800; |
1576 | break; | 1494 | break; |
1577 | } | 1495 | } |
1496 | |||
1497 | /* detect pineview DDR3 setting */ | ||
1498 | tmp = I915_READ(CSHRDDR3CTL); | ||
1499 | dev_priv->is_ddr3 = (tmp & CSHRDDR3CTL_DDR3) ? 1 : 0; | ||
1500 | } | ||
1501 | |||
1502 | static void i915_ironlake_get_mem_freq(struct drm_device *dev) | ||
1503 | { | ||
1504 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1505 | u16 ddrpll, csipll; | ||
1506 | |||
1507 | ddrpll = I915_READ16(DDRMPLL1); | ||
1508 | csipll = I915_READ16(CSIPLL0); | ||
1509 | |||
1510 | switch (ddrpll & 0xff) { | ||
1511 | case 0xc: | ||
1512 | dev_priv->mem_freq = 800; | ||
1513 | break; | ||
1514 | case 0x10: | ||
1515 | dev_priv->mem_freq = 1066; | ||
1516 | break; | ||
1517 | case 0x14: | ||
1518 | dev_priv->mem_freq = 1333; | ||
1519 | break; | ||
1520 | case 0x18: | ||
1521 | dev_priv->mem_freq = 1600; | ||
1522 | break; | ||
1523 | default: | ||
1524 | DRM_DEBUG_DRIVER("unknown memory frequency 0x%02x\n", | ||
1525 | ddrpll & 0xff); | ||
1526 | dev_priv->mem_freq = 0; | ||
1527 | break; | ||
1528 | } | ||
1529 | |||
1530 | dev_priv->r_t = dev_priv->mem_freq; | ||
1531 | |||
1532 | switch (csipll & 0x3ff) { | ||
1533 | case 0x00c: | ||
1534 | dev_priv->fsb_freq = 3200; | ||
1535 | break; | ||
1536 | case 0x00e: | ||
1537 | dev_priv->fsb_freq = 3733; | ||
1538 | break; | ||
1539 | case 0x010: | ||
1540 | dev_priv->fsb_freq = 4266; | ||
1541 | break; | ||
1542 | case 0x012: | ||
1543 | dev_priv->fsb_freq = 4800; | ||
1544 | break; | ||
1545 | case 0x014: | ||
1546 | dev_priv->fsb_freq = 5333; | ||
1547 | break; | ||
1548 | case 0x016: | ||
1549 | dev_priv->fsb_freq = 5866; | ||
1550 | break; | ||
1551 | case 0x018: | ||
1552 | dev_priv->fsb_freq = 6400; | ||
1553 | break; | ||
1554 | default: | ||
1555 | DRM_DEBUG_DRIVER("unknown fsb frequency 0x%04x\n", | ||
1556 | csipll & 0x3ff); | ||
1557 | dev_priv->fsb_freq = 0; | ||
1558 | break; | ||
1559 | } | ||
1560 | |||
1561 | if (dev_priv->fsb_freq == 3200) { | ||
1562 | dev_priv->c_m = 0; | ||
1563 | } else if (dev_priv->fsb_freq > 3200 && dev_priv->fsb_freq <= 4800) { | ||
1564 | dev_priv->c_m = 1; | ||
1565 | } else { | ||
1566 | dev_priv->c_m = 2; | ||
1567 | } | ||
1568 | } | ||
1569 | |||
1570 | struct v_table { | ||
1571 | u8 vid; | ||
1572 | unsigned long vd; /* in .1 mil */ | ||
1573 | unsigned long vm; /* in .1 mil */ | ||
1574 | u8 pvid; | ||
1575 | }; | ||
1576 | |||
1577 | static struct v_table v_table[] = { | ||
1578 | { 0, 16125, 15000, 0x7f, }, | ||
1579 | { 1, 16000, 14875, 0x7e, }, | ||
1580 | { 2, 15875, 14750, 0x7d, }, | ||
1581 | { 3, 15750, 14625, 0x7c, }, | ||
1582 | { 4, 15625, 14500, 0x7b, }, | ||
1583 | { 5, 15500, 14375, 0x7a, }, | ||
1584 | { 6, 15375, 14250, 0x79, }, | ||
1585 | { 7, 15250, 14125, 0x78, }, | ||
1586 | { 8, 15125, 14000, 0x77, }, | ||
1587 | { 9, 15000, 13875, 0x76, }, | ||
1588 | { 10, 14875, 13750, 0x75, }, | ||
1589 | { 11, 14750, 13625, 0x74, }, | ||
1590 | { 12, 14625, 13500, 0x73, }, | ||
1591 | { 13, 14500, 13375, 0x72, }, | ||
1592 | { 14, 14375, 13250, 0x71, }, | ||
1593 | { 15, 14250, 13125, 0x70, }, | ||
1594 | { 16, 14125, 13000, 0x6f, }, | ||
1595 | { 17, 14000, 12875, 0x6e, }, | ||
1596 | { 18, 13875, 12750, 0x6d, }, | ||
1597 | { 19, 13750, 12625, 0x6c, }, | ||
1598 | { 20, 13625, 12500, 0x6b, }, | ||
1599 | { 21, 13500, 12375, 0x6a, }, | ||
1600 | { 22, 13375, 12250, 0x69, }, | ||
1601 | { 23, 13250, 12125, 0x68, }, | ||
1602 | { 24, 13125, 12000, 0x67, }, | ||
1603 | { 25, 13000, 11875, 0x66, }, | ||
1604 | { 26, 12875, 11750, 0x65, }, | ||
1605 | { 27, 12750, 11625, 0x64, }, | ||
1606 | { 28, 12625, 11500, 0x63, }, | ||
1607 | { 29, 12500, 11375, 0x62, }, | ||
1608 | { 30, 12375, 11250, 0x61, }, | ||
1609 | { 31, 12250, 11125, 0x60, }, | ||
1610 | { 32, 12125, 11000, 0x5f, }, | ||
1611 | { 33, 12000, 10875, 0x5e, }, | ||
1612 | { 34, 11875, 10750, 0x5d, }, | ||
1613 | { 35, 11750, 10625, 0x5c, }, | ||
1614 | { 36, 11625, 10500, 0x5b, }, | ||
1615 | { 37, 11500, 10375, 0x5a, }, | ||
1616 | { 38, 11375, 10250, 0x59, }, | ||
1617 | { 39, 11250, 10125, 0x58, }, | ||
1618 | { 40, 11125, 10000, 0x57, }, | ||
1619 | { 41, 11000, 9875, 0x56, }, | ||
1620 | { 42, 10875, 9750, 0x55, }, | ||
1621 | { 43, 10750, 9625, 0x54, }, | ||
1622 | { 44, 10625, 9500, 0x53, }, | ||
1623 | { 45, 10500, 9375, 0x52, }, | ||
1624 | { 46, 10375, 9250, 0x51, }, | ||
1625 | { 47, 10250, 9125, 0x50, }, | ||
1626 | { 48, 10125, 9000, 0x4f, }, | ||
1627 | { 49, 10000, 8875, 0x4e, }, | ||
1628 | { 50, 9875, 8750, 0x4d, }, | ||
1629 | { 51, 9750, 8625, 0x4c, }, | ||
1630 | { 52, 9625, 8500, 0x4b, }, | ||
1631 | { 53, 9500, 8375, 0x4a, }, | ||
1632 | { 54, 9375, 8250, 0x49, }, | ||
1633 | { 55, 9250, 8125, 0x48, }, | ||
1634 | { 56, 9125, 8000, 0x47, }, | ||
1635 | { 57, 9000, 7875, 0x46, }, | ||
1636 | { 58, 8875, 7750, 0x45, }, | ||
1637 | { 59, 8750, 7625, 0x44, }, | ||
1638 | { 60, 8625, 7500, 0x43, }, | ||
1639 | { 61, 8500, 7375, 0x42, }, | ||
1640 | { 62, 8375, 7250, 0x41, }, | ||
1641 | { 63, 8250, 7125, 0x40, }, | ||
1642 | { 64, 8125, 7000, 0x3f, }, | ||
1643 | { 65, 8000, 6875, 0x3e, }, | ||
1644 | { 66, 7875, 6750, 0x3d, }, | ||
1645 | { 67, 7750, 6625, 0x3c, }, | ||
1646 | { 68, 7625, 6500, 0x3b, }, | ||
1647 | { 69, 7500, 6375, 0x3a, }, | ||
1648 | { 70, 7375, 6250, 0x39, }, | ||
1649 | { 71, 7250, 6125, 0x38, }, | ||
1650 | { 72, 7125, 6000, 0x37, }, | ||
1651 | { 73, 7000, 5875, 0x36, }, | ||
1652 | { 74, 6875, 5750, 0x35, }, | ||
1653 | { 75, 6750, 5625, 0x34, }, | ||
1654 | { 76, 6625, 5500, 0x33, }, | ||
1655 | { 77, 6500, 5375, 0x32, }, | ||
1656 | { 78, 6375, 5250, 0x31, }, | ||
1657 | { 79, 6250, 5125, 0x30, }, | ||
1658 | { 80, 6125, 5000, 0x2f, }, | ||
1659 | { 81, 6000, 4875, 0x2e, }, | ||
1660 | { 82, 5875, 4750, 0x2d, }, | ||
1661 | { 83, 5750, 4625, 0x2c, }, | ||
1662 | { 84, 5625, 4500, 0x2b, }, | ||
1663 | { 85, 5500, 4375, 0x2a, }, | ||
1664 | { 86, 5375, 4250, 0x29, }, | ||
1665 | { 87, 5250, 4125, 0x28, }, | ||
1666 | { 88, 5125, 4000, 0x27, }, | ||
1667 | { 89, 5000, 3875, 0x26, }, | ||
1668 | { 90, 4875, 3750, 0x25, }, | ||
1669 | { 91, 4750, 3625, 0x24, }, | ||
1670 | { 92, 4625, 3500, 0x23, }, | ||
1671 | { 93, 4500, 3375, 0x22, }, | ||
1672 | { 94, 4375, 3250, 0x21, }, | ||
1673 | { 95, 4250, 3125, 0x20, }, | ||
1674 | { 96, 4125, 3000, 0x1f, }, | ||
1675 | { 97, 4125, 3000, 0x1e, }, | ||
1676 | { 98, 4125, 3000, 0x1d, }, | ||
1677 | { 99, 4125, 3000, 0x1c, }, | ||
1678 | { 100, 4125, 3000, 0x1b, }, | ||
1679 | { 101, 4125, 3000, 0x1a, }, | ||
1680 | { 102, 4125, 3000, 0x19, }, | ||
1681 | { 103, 4125, 3000, 0x18, }, | ||
1682 | { 104, 4125, 3000, 0x17, }, | ||
1683 | { 105, 4125, 3000, 0x16, }, | ||
1684 | { 106, 4125, 3000, 0x15, }, | ||
1685 | { 107, 4125, 3000, 0x14, }, | ||
1686 | { 108, 4125, 3000, 0x13, }, | ||
1687 | { 109, 4125, 3000, 0x12, }, | ||
1688 | { 110, 4125, 3000, 0x11, }, | ||
1689 | { 111, 4125, 3000, 0x10, }, | ||
1690 | { 112, 4125, 3000, 0x0f, }, | ||
1691 | { 113, 4125, 3000, 0x0e, }, | ||
1692 | { 114, 4125, 3000, 0x0d, }, | ||
1693 | { 115, 4125, 3000, 0x0c, }, | ||
1694 | { 116, 4125, 3000, 0x0b, }, | ||
1695 | { 117, 4125, 3000, 0x0a, }, | ||
1696 | { 118, 4125, 3000, 0x09, }, | ||
1697 | { 119, 4125, 3000, 0x08, }, | ||
1698 | { 120, 1125, 0, 0x07, }, | ||
1699 | { 121, 1000, 0, 0x06, }, | ||
1700 | { 122, 875, 0, 0x05, }, | ||
1701 | { 123, 750, 0, 0x04, }, | ||
1702 | { 124, 625, 0, 0x03, }, | ||
1703 | { 125, 500, 0, 0x02, }, | ||
1704 | { 126, 375, 0, 0x01, }, | ||
1705 | { 127, 0, 0, 0x00, }, | ||
1706 | }; | ||
1707 | |||
1708 | struct cparams { | ||
1709 | int i; | ||
1710 | int t; | ||
1711 | int m; | ||
1712 | int c; | ||
1713 | }; | ||
1714 | |||
1715 | static struct cparams cparams[] = { | ||
1716 | { 1, 1333, 301, 28664 }, | ||
1717 | { 1, 1066, 294, 24460 }, | ||
1718 | { 1, 800, 294, 25192 }, | ||
1719 | { 0, 1333, 276, 27605 }, | ||
1720 | { 0, 1066, 276, 27605 }, | ||
1721 | { 0, 800, 231, 23784 }, | ||
1722 | }; | ||
1723 | |||
1724 | unsigned long i915_chipset_val(struct drm_i915_private *dev_priv) | ||
1725 | { | ||
1726 | u64 total_count, diff, ret; | ||
1727 | u32 count1, count2, count3, m = 0, c = 0; | ||
1728 | unsigned long now = jiffies_to_msecs(jiffies), diff1; | ||
1729 | int i; | ||
1730 | |||
1731 | diff1 = now - dev_priv->last_time1; | ||
1732 | |||
1733 | count1 = I915_READ(DMIEC); | ||
1734 | count2 = I915_READ(DDREC); | ||
1735 | count3 = I915_READ(CSIEC); | ||
1736 | |||
1737 | total_count = count1 + count2 + count3; | ||
1738 | |||
1739 | /* FIXME: handle per-counter overflow */ | ||
1740 | if (total_count < dev_priv->last_count1) { | ||
1741 | diff = ~0UL - dev_priv->last_count1; | ||
1742 | diff += total_count; | ||
1743 | } else { | ||
1744 | diff = total_count - dev_priv->last_count1; | ||
1745 | } | ||
1746 | |||
1747 | for (i = 0; i < ARRAY_SIZE(cparams); i++) { | ||
1748 | if (cparams[i].i == dev_priv->c_m && | ||
1749 | cparams[i].t == dev_priv->r_t) { | ||
1750 | m = cparams[i].m; | ||
1751 | c = cparams[i].c; | ||
1752 | break; | ||
1753 | } | ||
1754 | } | ||
1755 | |||
1756 | div_u64(diff, diff1); | ||
1757 | ret = ((m * diff) + c); | ||
1758 | div_u64(ret, 10); | ||
1759 | |||
1760 | dev_priv->last_count1 = total_count; | ||
1761 | dev_priv->last_time1 = now; | ||
1762 | |||
1763 | return ret; | ||
1764 | } | ||
1765 | |||
1766 | unsigned long i915_mch_val(struct drm_i915_private *dev_priv) | ||
1767 | { | ||
1768 | unsigned long m, x, b; | ||
1769 | u32 tsfs; | ||
1770 | |||
1771 | tsfs = I915_READ(TSFS); | ||
1772 | |||
1773 | m = ((tsfs & TSFS_SLOPE_MASK) >> TSFS_SLOPE_SHIFT); | ||
1774 | x = I915_READ8(TR1); | ||
1775 | |||
1776 | b = tsfs & TSFS_INTR_MASK; | ||
1777 | |||
1778 | return ((m * x) / 127) - b; | ||
1779 | } | ||
1780 | |||
1781 | static unsigned long pvid_to_extvid(struct drm_i915_private *dev_priv, u8 pxvid) | ||
1782 | { | ||
1783 | unsigned long val = 0; | ||
1784 | int i; | ||
1785 | |||
1786 | for (i = 0; i < ARRAY_SIZE(v_table); i++) { | ||
1787 | if (v_table[i].pvid == pxvid) { | ||
1788 | if (IS_MOBILE(dev_priv->dev)) | ||
1789 | val = v_table[i].vm; | ||
1790 | else | ||
1791 | val = v_table[i].vd; | ||
1792 | } | ||
1793 | } | ||
1794 | |||
1795 | return val; | ||
1796 | } | ||
1797 | |||
1798 | void i915_update_gfx_val(struct drm_i915_private *dev_priv) | ||
1799 | { | ||
1800 | struct timespec now, diff1; | ||
1801 | u64 diff; | ||
1802 | unsigned long diffms; | ||
1803 | u32 count; | ||
1804 | |||
1805 | getrawmonotonic(&now); | ||
1806 | diff1 = timespec_sub(now, dev_priv->last_time2); | ||
1807 | |||
1808 | /* Don't divide by 0 */ | ||
1809 | diffms = diff1.tv_sec * 1000 + diff1.tv_nsec / 1000000; | ||
1810 | if (!diffms) | ||
1811 | return; | ||
1812 | |||
1813 | count = I915_READ(GFXEC); | ||
1814 | |||
1815 | if (count < dev_priv->last_count2) { | ||
1816 | diff = ~0UL - dev_priv->last_count2; | ||
1817 | diff += count; | ||
1818 | } else { | ||
1819 | diff = count - dev_priv->last_count2; | ||
1820 | } | ||
1821 | |||
1822 | dev_priv->last_count2 = count; | ||
1823 | dev_priv->last_time2 = now; | ||
1824 | |||
1825 | /* More magic constants... */ | ||
1826 | diff = diff * 1181; | ||
1827 | div_u64(diff, diffms * 10); | ||
1828 | dev_priv->gfx_power = diff; | ||
1578 | } | 1829 | } |
1579 | 1830 | ||
1831 | unsigned long i915_gfx_val(struct drm_i915_private *dev_priv) | ||
1832 | { | ||
1833 | unsigned long t, corr, state1, corr2, state2; | ||
1834 | u32 pxvid, ext_v; | ||
1835 | |||
1836 | pxvid = I915_READ(PXVFREQ_BASE + (dev_priv->cur_delay * 4)); | ||
1837 | pxvid = (pxvid >> 24) & 0x7f; | ||
1838 | ext_v = pvid_to_extvid(dev_priv, pxvid); | ||
1839 | |||
1840 | state1 = ext_v; | ||
1841 | |||
1842 | t = i915_mch_val(dev_priv); | ||
1843 | |||
1844 | /* Revel in the empirically derived constants */ | ||
1845 | |||
1846 | /* Correction factor in 1/100000 units */ | ||
1847 | if (t > 80) | ||
1848 | corr = ((t * 2349) + 135940); | ||
1849 | else if (t >= 50) | ||
1850 | corr = ((t * 964) + 29317); | ||
1851 | else /* < 50 */ | ||
1852 | corr = ((t * 301) + 1004); | ||
1853 | |||
1854 | corr = corr * ((150142 * state1) / 10000 - 78642); | ||
1855 | corr /= 100000; | ||
1856 | corr2 = (corr * dev_priv->corr); | ||
1857 | |||
1858 | state2 = (corr2 * state1) / 10000; | ||
1859 | state2 /= 100; /* convert to mW */ | ||
1860 | |||
1861 | i915_update_gfx_val(dev_priv); | ||
1862 | |||
1863 | return dev_priv->gfx_power + state2; | ||
1864 | } | ||
1865 | |||
1866 | /* Global for IPS driver to get at the current i915 device */ | ||
1867 | static struct drm_i915_private *i915_mch_dev; | ||
1868 | /* | ||
1869 | * Lock protecting IPS related data structures | ||
1870 | * - i915_mch_dev | ||
1871 | * - dev_priv->max_delay | ||
1872 | * - dev_priv->min_delay | ||
1873 | * - dev_priv->fmax | ||
1874 | * - dev_priv->gpu_busy | ||
1875 | */ | ||
1876 | DEFINE_SPINLOCK(mchdev_lock); | ||
1877 | |||
1878 | /** | ||
1879 | * i915_read_mch_val - return value for IPS use | ||
1880 | * | ||
1881 | * Calculate and return a value for the IPS driver to use when deciding whether | ||
1882 | * we have thermal and power headroom to increase CPU or GPU power budget. | ||
1883 | */ | ||
1884 | unsigned long i915_read_mch_val(void) | ||
1885 | { | ||
1886 | struct drm_i915_private *dev_priv; | ||
1887 | unsigned long chipset_val, graphics_val, ret = 0; | ||
1888 | |||
1889 | spin_lock(&mchdev_lock); | ||
1890 | if (!i915_mch_dev) | ||
1891 | goto out_unlock; | ||
1892 | dev_priv = i915_mch_dev; | ||
1893 | |||
1894 | chipset_val = i915_chipset_val(dev_priv); | ||
1895 | graphics_val = i915_gfx_val(dev_priv); | ||
1896 | |||
1897 | ret = chipset_val + graphics_val; | ||
1898 | |||
1899 | out_unlock: | ||
1900 | spin_unlock(&mchdev_lock); | ||
1901 | |||
1902 | return ret; | ||
1903 | } | ||
1904 | EXPORT_SYMBOL_GPL(i915_read_mch_val); | ||
1905 | |||
1906 | /** | ||
1907 | * i915_gpu_raise - raise GPU frequency limit | ||
1908 | * | ||
1909 | * Raise the limit; IPS indicates we have thermal headroom. | ||
1910 | */ | ||
1911 | bool i915_gpu_raise(void) | ||
1912 | { | ||
1913 | struct drm_i915_private *dev_priv; | ||
1914 | bool ret = true; | ||
1915 | |||
1916 | spin_lock(&mchdev_lock); | ||
1917 | if (!i915_mch_dev) { | ||
1918 | ret = false; | ||
1919 | goto out_unlock; | ||
1920 | } | ||
1921 | dev_priv = i915_mch_dev; | ||
1922 | |||
1923 | if (dev_priv->max_delay > dev_priv->fmax) | ||
1924 | dev_priv->max_delay--; | ||
1925 | |||
1926 | out_unlock: | ||
1927 | spin_unlock(&mchdev_lock); | ||
1928 | |||
1929 | return ret; | ||
1930 | } | ||
1931 | EXPORT_SYMBOL_GPL(i915_gpu_raise); | ||
1932 | |||
1933 | /** | ||
1934 | * i915_gpu_lower - lower GPU frequency limit | ||
1935 | * | ||
1936 | * IPS indicates we're close to a thermal limit, so throttle back the GPU | ||
1937 | * frequency maximum. | ||
1938 | */ | ||
1939 | bool i915_gpu_lower(void) | ||
1940 | { | ||
1941 | struct drm_i915_private *dev_priv; | ||
1942 | bool ret = true; | ||
1943 | |||
1944 | spin_lock(&mchdev_lock); | ||
1945 | if (!i915_mch_dev) { | ||
1946 | ret = false; | ||
1947 | goto out_unlock; | ||
1948 | } | ||
1949 | dev_priv = i915_mch_dev; | ||
1950 | |||
1951 | if (dev_priv->max_delay < dev_priv->min_delay) | ||
1952 | dev_priv->max_delay++; | ||
1953 | |||
1954 | out_unlock: | ||
1955 | spin_unlock(&mchdev_lock); | ||
1956 | |||
1957 | return ret; | ||
1958 | } | ||
1959 | EXPORT_SYMBOL_GPL(i915_gpu_lower); | ||
1960 | |||
1961 | /** | ||
1962 | * i915_gpu_busy - indicate GPU business to IPS | ||
1963 | * | ||
1964 | * Tell the IPS driver whether or not the GPU is busy. | ||
1965 | */ | ||
1966 | bool i915_gpu_busy(void) | ||
1967 | { | ||
1968 | struct drm_i915_private *dev_priv; | ||
1969 | bool ret = false; | ||
1970 | |||
1971 | spin_lock(&mchdev_lock); | ||
1972 | if (!i915_mch_dev) | ||
1973 | goto out_unlock; | ||
1974 | dev_priv = i915_mch_dev; | ||
1975 | |||
1976 | ret = dev_priv->busy; | ||
1977 | |||
1978 | out_unlock: | ||
1979 | spin_unlock(&mchdev_lock); | ||
1980 | |||
1981 | return ret; | ||
1982 | } | ||
1983 | EXPORT_SYMBOL_GPL(i915_gpu_busy); | ||
1984 | |||
1985 | /** | ||
1986 | * i915_gpu_turbo_disable - disable graphics turbo | ||
1987 | * | ||
1988 | * Disable graphics turbo by resetting the max frequency and setting the | ||
1989 | * current frequency to the default. | ||
1990 | */ | ||
1991 | bool i915_gpu_turbo_disable(void) | ||
1992 | { | ||
1993 | struct drm_i915_private *dev_priv; | ||
1994 | bool ret = true; | ||
1995 | |||
1996 | spin_lock(&mchdev_lock); | ||
1997 | if (!i915_mch_dev) { | ||
1998 | ret = false; | ||
1999 | goto out_unlock; | ||
2000 | } | ||
2001 | dev_priv = i915_mch_dev; | ||
2002 | |||
2003 | dev_priv->max_delay = dev_priv->fstart; | ||
2004 | |||
2005 | if (!ironlake_set_drps(dev_priv->dev, dev_priv->fstart)) | ||
2006 | ret = false; | ||
2007 | |||
2008 | out_unlock: | ||
2009 | spin_unlock(&mchdev_lock); | ||
2010 | |||
2011 | return ret; | ||
2012 | } | ||
2013 | EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable); | ||
2014 | |||
1580 | /** | 2015 | /** |
1581 | * i915_driver_load - setup chip and create an initial config | 2016 | * i915_driver_load - setup chip and create an initial config |
1582 | * @dev: DRM device | 2017 | * @dev: DRM device |
@@ -1594,7 +2029,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1594 | resource_size_t base, size; | 2029 | resource_size_t base, size; |
1595 | int ret = 0, mmio_bar; | 2030 | int ret = 0, mmio_bar; |
1596 | uint32_t agp_size, prealloc_size, prealloc_start; | 2031 | uint32_t agp_size, prealloc_size, prealloc_start; |
1597 | |||
1598 | /* i915 has 4 more counters */ | 2032 | /* i915 has 4 more counters */ |
1599 | dev->counters += 4; | 2033 | dev->counters += 4; |
1600 | dev->types[6] = _DRM_STAT_IRQ; | 2034 | dev->types[6] = _DRM_STAT_IRQ; |
@@ -1672,6 +2106,13 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1672 | dev_priv->has_gem = 0; | 2106 | dev_priv->has_gem = 0; |
1673 | } | 2107 | } |
1674 | 2108 | ||
2109 | if (dev_priv->has_gem == 0 && | ||
2110 | drm_core_check_feature(dev, DRIVER_MODESET)) { | ||
2111 | DRM_ERROR("kernel modesetting requires GEM, disabling driver.\n"); | ||
2112 | ret = -ENODEV; | ||
2113 | goto out_iomapfree; | ||
2114 | } | ||
2115 | |||
1675 | dev->driver->get_vblank_counter = i915_get_vblank_counter; | 2116 | dev->driver->get_vblank_counter = i915_get_vblank_counter; |
1676 | dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ | 2117 | dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ |
1677 | if (IS_G4X(dev) || IS_IRONLAKE(dev) || IS_GEN6(dev)) { | 2118 | if (IS_G4X(dev) || IS_IRONLAKE(dev) || IS_GEN6(dev)) { |
@@ -1691,7 +2132,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1691 | goto out_workqueue_free; | 2132 | goto out_workqueue_free; |
1692 | } | 2133 | } |
1693 | 2134 | ||
1694 | i915_get_mem_freq(dev); | 2135 | if (IS_PINEVIEW(dev)) |
2136 | i915_pineview_get_mem_freq(dev); | ||
2137 | else if (IS_IRONLAKE(dev)) | ||
2138 | i915_ironlake_get_mem_freq(dev); | ||
1695 | 2139 | ||
1696 | /* On the 945G/GM, the chipset reports the MSI capability on the | 2140 | /* On the 945G/GM, the chipset reports the MSI capability on the |
1697 | * integrated graphics even though the support isn't actually there | 2141 | * integrated graphics even though the support isn't actually there |
@@ -1709,7 +2153,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1709 | 2153 | ||
1710 | spin_lock_init(&dev_priv->user_irq_lock); | 2154 | spin_lock_init(&dev_priv->user_irq_lock); |
1711 | spin_lock_init(&dev_priv->error_lock); | 2155 | spin_lock_init(&dev_priv->error_lock); |
1712 | dev_priv->user_irq_refcount = 0; | ||
1713 | dev_priv->trace_irq_seqno = 0; | 2156 | dev_priv->trace_irq_seqno = 0; |
1714 | 2157 | ||
1715 | ret = drm_vblank_init(dev, I915_NUM_PIPE); | 2158 | ret = drm_vblank_init(dev, I915_NUM_PIPE); |
@@ -1738,6 +2181,12 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1738 | 2181 | ||
1739 | setup_timer(&dev_priv->hangcheck_timer, i915_hangcheck_elapsed, | 2182 | setup_timer(&dev_priv->hangcheck_timer, i915_hangcheck_elapsed, |
1740 | (unsigned long) dev); | 2183 | (unsigned long) dev); |
2184 | |||
2185 | spin_lock(&mchdev_lock); | ||
2186 | i915_mch_dev = dev_priv; | ||
2187 | dev_priv->mchdev_lock = &mchdev_lock; | ||
2188 | spin_unlock(&mchdev_lock); | ||
2189 | |||
1741 | return 0; | 2190 | return 0; |
1742 | 2191 | ||
1743 | out_workqueue_free: | 2192 | out_workqueue_free: |
@@ -1759,6 +2208,10 @@ int i915_driver_unload(struct drm_device *dev) | |||
1759 | 2208 | ||
1760 | i915_destroy_error_state(dev); | 2209 | i915_destroy_error_state(dev); |
1761 | 2210 | ||
2211 | spin_lock(&mchdev_lock); | ||
2212 | i915_mch_dev = NULL; | ||
2213 | spin_unlock(&mchdev_lock); | ||
2214 | |||
1762 | destroy_workqueue(dev_priv->wq); | 2215 | destroy_workqueue(dev_priv->wq); |
1763 | del_timer_sync(&dev_priv->hangcheck_timer); | 2216 | del_timer_sync(&dev_priv->hangcheck_timer); |
1764 | 2217 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 5c51e45ab68d..423dc90c1e20 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -60,95 +60,95 @@ extern int intel_agp_enabled; | |||
60 | .subdevice = PCI_ANY_ID, \ | 60 | .subdevice = PCI_ANY_ID, \ |
61 | .driver_data = (unsigned long) info } | 61 | .driver_data = (unsigned long) info } |
62 | 62 | ||
63 | const static struct intel_device_info intel_i830_info = { | 63 | static const struct intel_device_info intel_i830_info = { |
64 | .is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1, | 64 | .is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1, |
65 | }; | 65 | }; |
66 | 66 | ||
67 | const static struct intel_device_info intel_845g_info = { | 67 | static const struct intel_device_info intel_845g_info = { |
68 | .is_i8xx = 1, | 68 | .is_i8xx = 1, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | const static struct intel_device_info intel_i85x_info = { | 71 | static const struct intel_device_info intel_i85x_info = { |
72 | .is_i8xx = 1, .is_i85x = 1, .is_mobile = 1, | 72 | .is_i8xx = 1, .is_i85x = 1, .is_mobile = 1, |
73 | .cursor_needs_physical = 1, | 73 | .cursor_needs_physical = 1, |
74 | }; | 74 | }; |
75 | 75 | ||
76 | const static struct intel_device_info intel_i865g_info = { | 76 | static const struct intel_device_info intel_i865g_info = { |
77 | .is_i8xx = 1, | 77 | .is_i8xx = 1, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | const static struct intel_device_info intel_i915g_info = { | 80 | static const struct intel_device_info intel_i915g_info = { |
81 | .is_i915g = 1, .is_i9xx = 1, .cursor_needs_physical = 1, | 81 | .is_i915g = 1, .is_i9xx = 1, .cursor_needs_physical = 1, |
82 | }; | 82 | }; |
83 | const static struct intel_device_info intel_i915gm_info = { | 83 | static const struct intel_device_info intel_i915gm_info = { |
84 | .is_i9xx = 1, .is_mobile = 1, | 84 | .is_i9xx = 1, .is_mobile = 1, |
85 | .cursor_needs_physical = 1, | 85 | .cursor_needs_physical = 1, |
86 | }; | 86 | }; |
87 | const static struct intel_device_info intel_i945g_info = { | 87 | static const struct intel_device_info intel_i945g_info = { |
88 | .is_i9xx = 1, .has_hotplug = 1, .cursor_needs_physical = 1, | 88 | .is_i9xx = 1, .has_hotplug = 1, .cursor_needs_physical = 1, |
89 | }; | 89 | }; |
90 | const static struct intel_device_info intel_i945gm_info = { | 90 | static const struct intel_device_info intel_i945gm_info = { |
91 | .is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1, | 91 | .is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1, |
92 | .has_hotplug = 1, .cursor_needs_physical = 1, | 92 | .has_hotplug = 1, .cursor_needs_physical = 1, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | const static struct intel_device_info intel_i965g_info = { | 95 | static const struct intel_device_info intel_i965g_info = { |
96 | .is_i965g = 1, .is_i9xx = 1, .has_hotplug = 1, | 96 | .is_i965g = 1, .is_i9xx = 1, .has_hotplug = 1, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | const static struct intel_device_info intel_i965gm_info = { | 99 | static const struct intel_device_info intel_i965gm_info = { |
100 | .is_i965g = 1, .is_mobile = 1, .is_i965gm = 1, .is_i9xx = 1, | 100 | .is_i965g = 1, .is_mobile = 1, .is_i965gm = 1, .is_i9xx = 1, |
101 | .is_mobile = 1, .has_fbc = 1, .has_rc6 = 1, | 101 | .is_mobile = 1, .has_fbc = 1, .has_rc6 = 1, |
102 | .has_hotplug = 1, | 102 | .has_hotplug = 1, |
103 | }; | 103 | }; |
104 | 104 | ||
105 | const static struct intel_device_info intel_g33_info = { | 105 | static const struct intel_device_info intel_g33_info = { |
106 | .is_g33 = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 106 | .is_g33 = 1, .is_i9xx = 1, .need_gfx_hws = 1, |
107 | .has_hotplug = 1, | 107 | .has_hotplug = 1, |
108 | }; | 108 | }; |
109 | 109 | ||
110 | const static struct intel_device_info intel_g45_info = { | 110 | static const struct intel_device_info intel_g45_info = { |
111 | .is_i965g = 1, .is_g4x = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 111 | .is_i965g = 1, .is_g4x = 1, .is_i9xx = 1, .need_gfx_hws = 1, |
112 | .has_pipe_cxsr = 1, | 112 | .has_pipe_cxsr = 1, |
113 | .has_hotplug = 1, | 113 | .has_hotplug = 1, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | const static struct intel_device_info intel_gm45_info = { | 116 | static const struct intel_device_info intel_gm45_info = { |
117 | .is_i965g = 1, .is_mobile = 1, .is_g4x = 1, .is_i9xx = 1, | 117 | .is_i965g = 1, .is_mobile = 1, .is_g4x = 1, .is_i9xx = 1, |
118 | .is_mobile = 1, .need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1, | 118 | .is_mobile = 1, .need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1, |
119 | .has_pipe_cxsr = 1, | 119 | .has_pipe_cxsr = 1, |
120 | .has_hotplug = 1, | 120 | .has_hotplug = 1, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | const static struct intel_device_info intel_pineview_info = { | 123 | static const struct intel_device_info intel_pineview_info = { |
124 | .is_g33 = 1, .is_pineview = 1, .is_mobile = 1, .is_i9xx = 1, | 124 | .is_g33 = 1, .is_pineview = 1, .is_mobile = 1, .is_i9xx = 1, |
125 | .need_gfx_hws = 1, | 125 | .need_gfx_hws = 1, |
126 | .has_hotplug = 1, | 126 | .has_hotplug = 1, |
127 | }; | 127 | }; |
128 | 128 | ||
129 | const static struct intel_device_info intel_ironlake_d_info = { | 129 | static const struct intel_device_info intel_ironlake_d_info = { |
130 | .is_ironlake = 1, .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 130 | .is_ironlake = 1, .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1, |
131 | .has_pipe_cxsr = 1, | 131 | .has_pipe_cxsr = 1, |
132 | .has_hotplug = 1, | 132 | .has_hotplug = 1, |
133 | }; | 133 | }; |
134 | 134 | ||
135 | const static struct intel_device_info intel_ironlake_m_info = { | 135 | static const struct intel_device_info intel_ironlake_m_info = { |
136 | .is_ironlake = 1, .is_mobile = 1, .is_i965g = 1, .is_i9xx = 1, | 136 | .is_ironlake = 1, .is_mobile = 1, .is_i965g = 1, .is_i9xx = 1, |
137 | .need_gfx_hws = 1, .has_rc6 = 1, | 137 | .need_gfx_hws = 1, .has_rc6 = 1, |
138 | .has_hotplug = 1, | 138 | .has_hotplug = 1, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | const static struct intel_device_info intel_sandybridge_d_info = { | 141 | static const struct intel_device_info intel_sandybridge_d_info = { |
142 | .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 142 | .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1, |
143 | .has_hotplug = 1, .is_gen6 = 1, | 143 | .has_hotplug = 1, .is_gen6 = 1, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | const static struct intel_device_info intel_sandybridge_m_info = { | 146 | static const struct intel_device_info intel_sandybridge_m_info = { |
147 | .is_i965g = 1, .is_mobile = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 147 | .is_i965g = 1, .is_mobile = 1, .is_i9xx = 1, .need_gfx_hws = 1, |
148 | .has_hotplug = 1, .is_gen6 = 1, | 148 | .has_hotplug = 1, .is_gen6 = 1, |
149 | }; | 149 | }; |
150 | 150 | ||
151 | const static struct pci_device_id pciidlist[] = { | 151 | static const struct pci_device_id pciidlist[] = { |
152 | INTEL_VGA_DEVICE(0x3577, &intel_i830_info), | 152 | INTEL_VGA_DEVICE(0x3577, &intel_i830_info), |
153 | INTEL_VGA_DEVICE(0x2562, &intel_845g_info), | 153 | INTEL_VGA_DEVICE(0x2562, &intel_845g_info), |
154 | INTEL_VGA_DEVICE(0x3582, &intel_i85x_info), | 154 | INTEL_VGA_DEVICE(0x3582, &intel_i85x_info), |
@@ -340,7 +340,7 @@ int i965_reset(struct drm_device *dev, u8 flags) | |||
340 | /* | 340 | /* |
341 | * Clear request list | 341 | * Clear request list |
342 | */ | 342 | */ |
343 | i915_gem_retire_requests(dev); | 343 | i915_gem_retire_requests(dev, &dev_priv->render_ring); |
344 | 344 | ||
345 | if (need_display) | 345 | if (need_display) |
346 | i915_save_display(dev); | 346 | i915_save_display(dev); |
@@ -370,6 +370,7 @@ int i965_reset(struct drm_device *dev, u8 flags) | |||
370 | } | 370 | } |
371 | } else { | 371 | } else { |
372 | DRM_ERROR("Error occurred. Don't know how to reset this chip.\n"); | 372 | DRM_ERROR("Error occurred. Don't know how to reset this chip.\n"); |
373 | mutex_unlock(&dev->struct_mutex); | ||
373 | return -ENODEV; | 374 | return -ENODEV; |
374 | } | 375 | } |
375 | 376 | ||
@@ -388,33 +389,10 @@ int i965_reset(struct drm_device *dev, u8 flags) | |||
388 | * switched away). | 389 | * switched away). |
389 | */ | 390 | */ |
390 | if (drm_core_check_feature(dev, DRIVER_MODESET) || | 391 | if (drm_core_check_feature(dev, DRIVER_MODESET) || |
391 | !dev_priv->mm.suspended) { | 392 | !dev_priv->mm.suspended) { |
392 | drm_i915_ring_buffer_t *ring = &dev_priv->ring; | 393 | struct intel_ring_buffer *ring = &dev_priv->render_ring; |
393 | struct drm_gem_object *obj = ring->ring_obj; | ||
394 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | ||
395 | dev_priv->mm.suspended = 0; | 394 | dev_priv->mm.suspended = 0; |
396 | 395 | ring->init(dev, ring); | |
397 | /* Stop the ring if it's running. */ | ||
398 | I915_WRITE(PRB0_CTL, 0); | ||
399 | I915_WRITE(PRB0_TAIL, 0); | ||
400 | I915_WRITE(PRB0_HEAD, 0); | ||
401 | |||
402 | /* Initialize the ring. */ | ||
403 | I915_WRITE(PRB0_START, obj_priv->gtt_offset); | ||
404 | I915_WRITE(PRB0_CTL, | ||
405 | ((obj->size - 4096) & RING_NR_PAGES) | | ||
406 | RING_NO_REPORT | | ||
407 | RING_VALID); | ||
408 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | ||
409 | i915_kernel_lost_context(dev); | ||
410 | else { | ||
411 | ring->head = I915_READ(PRB0_HEAD) & HEAD_ADDR; | ||
412 | ring->tail = I915_READ(PRB0_TAIL) & TAIL_ADDR; | ||
413 | ring->space = ring->head - (ring->tail + 8); | ||
414 | if (ring->space < 0) | ||
415 | ring->space += ring->Size; | ||
416 | } | ||
417 | |||
418 | mutex_unlock(&dev->struct_mutex); | 396 | mutex_unlock(&dev->struct_mutex); |
419 | drm_irq_uninstall(dev); | 397 | drm_irq_uninstall(dev); |
420 | drm_irq_install(dev); | 398 | drm_irq_install(dev); |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 7f797ef1ab39..9ed8ecd95801 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | #include "i915_reg.h" | 33 | #include "i915_reg.h" |
34 | #include "intel_bios.h" | 34 | #include "intel_bios.h" |
35 | #include "intel_ringbuffer.h" | ||
35 | #include <linux/io-mapping.h> | 36 | #include <linux/io-mapping.h> |
36 | 37 | ||
37 | /* General customization: | 38 | /* General customization: |
@@ -55,6 +56,8 @@ enum plane { | |||
55 | 56 | ||
56 | #define I915_NUM_PIPE 2 | 57 | #define I915_NUM_PIPE 2 |
57 | 58 | ||
59 | #define I915_GEM_GPU_DOMAINS (~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT)) | ||
60 | |||
58 | /* Interface history: | 61 | /* Interface history: |
59 | * | 62 | * |
60 | * 1.1: Original. | 63 | * 1.1: Original. |
@@ -89,16 +92,6 @@ struct drm_i915_gem_phys_object { | |||
89 | struct drm_gem_object *cur_obj; | 92 | struct drm_gem_object *cur_obj; |
90 | }; | 93 | }; |
91 | 94 | ||
92 | typedef struct _drm_i915_ring_buffer { | ||
93 | unsigned long Size; | ||
94 | u8 *virtual_start; | ||
95 | int head; | ||
96 | int tail; | ||
97 | int space; | ||
98 | drm_local_map_t map; | ||
99 | struct drm_gem_object *ring_obj; | ||
100 | } drm_i915_ring_buffer_t; | ||
101 | |||
102 | struct mem_block { | 95 | struct mem_block { |
103 | struct mem_block *next; | 96 | struct mem_block *next; |
104 | struct mem_block *prev; | 97 | struct mem_block *prev; |
@@ -241,17 +234,15 @@ typedef struct drm_i915_private { | |||
241 | void __iomem *regs; | 234 | void __iomem *regs; |
242 | 235 | ||
243 | struct pci_dev *bridge_dev; | 236 | struct pci_dev *bridge_dev; |
244 | drm_i915_ring_buffer_t ring; | 237 | struct intel_ring_buffer render_ring; |
238 | struct intel_ring_buffer bsd_ring; | ||
245 | 239 | ||
246 | drm_dma_handle_t *status_page_dmah; | 240 | drm_dma_handle_t *status_page_dmah; |
247 | void *hw_status_page; | ||
248 | void *seqno_page; | 241 | void *seqno_page; |
249 | dma_addr_t dma_status_page; | 242 | dma_addr_t dma_status_page; |
250 | uint32_t counter; | 243 | uint32_t counter; |
251 | unsigned int status_gfx_addr; | ||
252 | unsigned int seqno_gfx_addr; | 244 | unsigned int seqno_gfx_addr; |
253 | drm_local_map_t hws_map; | 245 | drm_local_map_t hws_map; |
254 | struct drm_gem_object *hws_obj; | ||
255 | struct drm_gem_object *seqno_obj; | 246 | struct drm_gem_object *seqno_obj; |
256 | struct drm_gem_object *pwrctx; | 247 | struct drm_gem_object *pwrctx; |
257 | 248 | ||
@@ -267,8 +258,6 @@ typedef struct drm_i915_private { | |||
267 | atomic_t irq_received; | 258 | atomic_t irq_received; |
268 | /** Protects user_irq_refcount and irq_mask_reg */ | 259 | /** Protects user_irq_refcount and irq_mask_reg */ |
269 | spinlock_t user_irq_lock; | 260 | spinlock_t user_irq_lock; |
270 | /** Refcount for i915_user_irq_get() versus i915_user_irq_put(). */ | ||
271 | int user_irq_refcount; | ||
272 | u32 trace_irq_seqno; | 261 | u32 trace_irq_seqno; |
273 | /** Cached value of IMR to avoid reads in updating the bitfield */ | 262 | /** Cached value of IMR to avoid reads in updating the bitfield */ |
274 | u32 irq_mask_reg; | 263 | u32 irq_mask_reg; |
@@ -334,7 +323,7 @@ typedef struct drm_i915_private { | |||
334 | int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ | 323 | int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ |
335 | int num_fence_regs; /* 8 on pre-965, 16 otherwise */ | 324 | int num_fence_regs; /* 8 on pre-965, 16 otherwise */ |
336 | 325 | ||
337 | unsigned int fsb_freq, mem_freq; | 326 | unsigned int fsb_freq, mem_freq, is_ddr3; |
338 | 327 | ||
339 | spinlock_t error_lock; | 328 | spinlock_t error_lock; |
340 | struct drm_i915_error_state *first_error; | 329 | struct drm_i915_error_state *first_error; |
@@ -514,18 +503,7 @@ typedef struct drm_i915_private { | |||
514 | */ | 503 | */ |
515 | struct list_head shrink_list; | 504 | struct list_head shrink_list; |
516 | 505 | ||
517 | /** | ||
518 | * List of objects currently involved in rendering from the | ||
519 | * ringbuffer. | ||
520 | * | ||
521 | * Includes buffers having the contents of their GPU caches | ||
522 | * flushed, not necessarily primitives. last_rendering_seqno | ||
523 | * represents when the rendering involved will be completed. | ||
524 | * | ||
525 | * A reference is held on the buffer while on this list. | ||
526 | */ | ||
527 | spinlock_t active_list_lock; | 506 | spinlock_t active_list_lock; |
528 | struct list_head active_list; | ||
529 | 507 | ||
530 | /** | 508 | /** |
531 | * List of objects which are not in the ringbuffer but which | 509 | * List of objects which are not in the ringbuffer but which |
@@ -563,12 +541,6 @@ typedef struct drm_i915_private { | |||
563 | struct list_head fence_list; | 541 | struct list_head fence_list; |
564 | 542 | ||
565 | /** | 543 | /** |
566 | * List of breadcrumbs associated with GPU requests currently | ||
567 | * outstanding. | ||
568 | */ | ||
569 | struct list_head request_list; | ||
570 | |||
571 | /** | ||
572 | * We leave the user IRQ off as much as possible, | 544 | * We leave the user IRQ off as much as possible, |
573 | * but this means that requests will finish and never | 545 | * but this means that requests will finish and never |
574 | * be retired once the system goes idle. Set a timer to | 546 | * be retired once the system goes idle. Set a timer to |
@@ -644,6 +616,18 @@ typedef struct drm_i915_private { | |||
644 | u8 cur_delay; | 616 | u8 cur_delay; |
645 | u8 min_delay; | 617 | u8 min_delay; |
646 | u8 max_delay; | 618 | u8 max_delay; |
619 | u8 fmax; | ||
620 | u8 fstart; | ||
621 | |||
622 | u64 last_count1; | ||
623 | unsigned long last_time1; | ||
624 | u64 last_count2; | ||
625 | struct timespec last_time2; | ||
626 | unsigned long gfx_power; | ||
627 | int c_m; | ||
628 | int r_t; | ||
629 | u8 corr; | ||
630 | spinlock_t *mchdev_lock; | ||
647 | 631 | ||
648 | enum no_fbc_reason no_fbc_reason; | 632 | enum no_fbc_reason no_fbc_reason; |
649 | 633 | ||
@@ -671,19 +655,64 @@ struct drm_i915_gem_object { | |||
671 | * (has pending rendering), and is not set if it's on inactive (ready | 655 | * (has pending rendering), and is not set if it's on inactive (ready |
672 | * to be unbound). | 656 | * to be unbound). |
673 | */ | 657 | */ |
674 | int active; | 658 | unsigned int active : 1; |
675 | 659 | ||
676 | /** | 660 | /** |
677 | * This is set if the object has been written to since last bound | 661 | * This is set if the object has been written to since last bound |
678 | * to the GTT | 662 | * to the GTT |
679 | */ | 663 | */ |
680 | int dirty; | 664 | unsigned int dirty : 1; |
665 | |||
666 | /** | ||
667 | * Fence register bits (if any) for this object. Will be set | ||
668 | * as needed when mapped into the GTT. | ||
669 | * Protected by dev->struct_mutex. | ||
670 | * | ||
671 | * Size: 4 bits for 16 fences + sign (for FENCE_REG_NONE) | ||
672 | */ | ||
673 | int fence_reg : 5; | ||
674 | |||
675 | /** | ||
676 | * Used for checking the object doesn't appear more than once | ||
677 | * in an execbuffer object list. | ||
678 | */ | ||
679 | unsigned int in_execbuffer : 1; | ||
680 | |||
681 | /** | ||
682 | * Advice: are the backing pages purgeable? | ||
683 | */ | ||
684 | unsigned int madv : 2; | ||
685 | |||
686 | /** | ||
687 | * Refcount for the pages array. With the current locking scheme, there | ||
688 | * are at most two concurrent users: Binding a bo to the gtt and | ||
689 | * pwrite/pread using physical addresses. So two bits for a maximum | ||
690 | * of two users are enough. | ||
691 | */ | ||
692 | unsigned int pages_refcount : 2; | ||
693 | #define DRM_I915_GEM_OBJECT_MAX_PAGES_REFCOUNT 0x3 | ||
694 | |||
695 | /** | ||
696 | * Current tiling mode for the object. | ||
697 | */ | ||
698 | unsigned int tiling_mode : 2; | ||
699 | |||
700 | /** How many users have pinned this object in GTT space. The following | ||
701 | * users can each hold at most one reference: pwrite/pread, pin_ioctl | ||
702 | * (via user_pin_count), execbuffer (objects are not allowed multiple | ||
703 | * times for the same batchbuffer), and the framebuffer code. When | ||
704 | * switching/pageflipping, the framebuffer code has at most two buffers | ||
705 | * pinned per crtc. | ||
706 | * | ||
707 | * In the worst case this is 1 + 1 + 1 + 2*2 = 7. That would fit into 3 | ||
708 | * bits with absolutely no headroom. So use 4 bits. */ | ||
709 | int pin_count : 4; | ||
710 | #define DRM_I915_GEM_OBJECT_MAX_PIN_COUNT 0xf | ||
681 | 711 | ||
682 | /** AGP memory structure for our GTT binding. */ | 712 | /** AGP memory structure for our GTT binding. */ |
683 | DRM_AGP_MEM *agp_mem; | 713 | DRM_AGP_MEM *agp_mem; |
684 | 714 | ||
685 | struct page **pages; | 715 | struct page **pages; |
686 | int pages_refcount; | ||
687 | 716 | ||
688 | /** | 717 | /** |
689 | * Current offset of the object in GTT space. | 718 | * Current offset of the object in GTT space. |
@@ -692,26 +721,18 @@ struct drm_i915_gem_object { | |||
692 | */ | 721 | */ |
693 | uint32_t gtt_offset; | 722 | uint32_t gtt_offset; |
694 | 723 | ||
724 | /* Which ring is refering to is this object */ | ||
725 | struct intel_ring_buffer *ring; | ||
726 | |||
695 | /** | 727 | /** |
696 | * Fake offset for use by mmap(2) | 728 | * Fake offset for use by mmap(2) |
697 | */ | 729 | */ |
698 | uint64_t mmap_offset; | 730 | uint64_t mmap_offset; |
699 | 731 | ||
700 | /** | ||
701 | * Fence register bits (if any) for this object. Will be set | ||
702 | * as needed when mapped into the GTT. | ||
703 | * Protected by dev->struct_mutex. | ||
704 | */ | ||
705 | int fence_reg; | ||
706 | |||
707 | /** How many users have pinned this object in GTT space */ | ||
708 | int pin_count; | ||
709 | |||
710 | /** Breadcrumb of last rendering to the buffer. */ | 732 | /** Breadcrumb of last rendering to the buffer. */ |
711 | uint32_t last_rendering_seqno; | 733 | uint32_t last_rendering_seqno; |
712 | 734 | ||
713 | /** Current tiling mode for the object. */ | 735 | /** Current tiling stride for the object, if it's tiled. */ |
714 | uint32_t tiling_mode; | ||
715 | uint32_t stride; | 736 | uint32_t stride; |
716 | 737 | ||
717 | /** Record of address bit 17 of each page at last unbind. */ | 738 | /** Record of address bit 17 of each page at last unbind. */ |
@@ -734,17 +755,6 @@ struct drm_i915_gem_object { | |||
734 | struct drm_i915_gem_phys_object *phys_obj; | 755 | struct drm_i915_gem_phys_object *phys_obj; |
735 | 756 | ||
736 | /** | 757 | /** |
737 | * Used for checking the object doesn't appear more than once | ||
738 | * in an execbuffer object list. | ||
739 | */ | ||
740 | int in_execbuffer; | ||
741 | |||
742 | /** | ||
743 | * Advice: are the backing pages purgeable? | ||
744 | */ | ||
745 | int madv; | ||
746 | |||
747 | /** | ||
748 | * Number of crtcs where this object is currently the fb, but | 758 | * Number of crtcs where this object is currently the fb, but |
749 | * will be page flipped away on the next vblank. When it | 759 | * will be page flipped away on the next vblank. When it |
750 | * reaches 0, dev_priv->pending_flip_queue will be woken up. | 760 | * reaches 0, dev_priv->pending_flip_queue will be woken up. |
@@ -765,6 +775,9 @@ struct drm_i915_gem_object { | |||
765 | * an emission time with seqnos for tracking how far ahead of the GPU we are. | 775 | * an emission time with seqnos for tracking how far ahead of the GPU we are. |
766 | */ | 776 | */ |
767 | struct drm_i915_gem_request { | 777 | struct drm_i915_gem_request { |
778 | /** On Which ring this request was generated */ | ||
779 | struct intel_ring_buffer *ring; | ||
780 | |||
768 | /** GEM sequence number associated with this request. */ | 781 | /** GEM sequence number associated with this request. */ |
769 | uint32_t seqno; | 782 | uint32_t seqno; |
770 | 783 | ||
@@ -821,6 +834,11 @@ extern int i915_emit_box(struct drm_device *dev, | |||
821 | struct drm_clip_rect *boxes, | 834 | struct drm_clip_rect *boxes, |
822 | int i, int DR1, int DR4); | 835 | int i, int DR1, int DR4); |
823 | extern int i965_reset(struct drm_device *dev, u8 flags); | 836 | extern int i965_reset(struct drm_device *dev, u8 flags); |
837 | extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv); | ||
838 | extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv); | ||
839 | extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); | ||
840 | extern void i915_update_gfx_val(struct drm_i915_private *dev_priv); | ||
841 | |||
824 | 842 | ||
825 | /* i915_irq.c */ | 843 | /* i915_irq.c */ |
826 | void i915_hangcheck_elapsed(unsigned long data); | 844 | void i915_hangcheck_elapsed(unsigned long data); |
@@ -829,9 +847,7 @@ extern int i915_irq_emit(struct drm_device *dev, void *data, | |||
829 | struct drm_file *file_priv); | 847 | struct drm_file *file_priv); |
830 | extern int i915_irq_wait(struct drm_device *dev, void *data, | 848 | extern int i915_irq_wait(struct drm_device *dev, void *data, |
831 | struct drm_file *file_priv); | 849 | struct drm_file *file_priv); |
832 | void i915_user_irq_get(struct drm_device *dev); | ||
833 | void i915_trace_irq_get(struct drm_device *dev, u32 seqno); | 850 | void i915_trace_irq_get(struct drm_device *dev, u32 seqno); |
834 | void i915_user_irq_put(struct drm_device *dev); | ||
835 | extern void i915_enable_interrupt (struct drm_device *dev); | 851 | extern void i915_enable_interrupt (struct drm_device *dev); |
836 | 852 | ||
837 | extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); | 853 | extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); |
@@ -849,6 +865,11 @@ extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc); | |||
849 | extern int i915_vblank_swap(struct drm_device *dev, void *data, | 865 | extern int i915_vblank_swap(struct drm_device *dev, void *data, |
850 | struct drm_file *file_priv); | 866 | struct drm_file *file_priv); |
851 | extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask); | 867 | extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask); |
868 | extern void i915_disable_irq(drm_i915_private_t *dev_priv, u32 mask); | ||
869 | extern void ironlake_enable_graphics_irq(drm_i915_private_t *dev_priv, | ||
870 | u32 mask); | ||
871 | extern void ironlake_disable_graphics_irq(drm_i915_private_t *dev_priv, | ||
872 | u32 mask); | ||
852 | 873 | ||
853 | void | 874 | void |
854 | i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); | 875 | i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); |
@@ -922,11 +943,13 @@ void i915_gem_object_unpin(struct drm_gem_object *obj); | |||
922 | int i915_gem_object_unbind(struct drm_gem_object *obj); | 943 | int i915_gem_object_unbind(struct drm_gem_object *obj); |
923 | void i915_gem_release_mmap(struct drm_gem_object *obj); | 944 | void i915_gem_release_mmap(struct drm_gem_object *obj); |
924 | void i915_gem_lastclose(struct drm_device *dev); | 945 | void i915_gem_lastclose(struct drm_device *dev); |
925 | uint32_t i915_get_gem_seqno(struct drm_device *dev); | 946 | uint32_t i915_get_gem_seqno(struct drm_device *dev, |
947 | struct intel_ring_buffer *ring); | ||
926 | bool i915_seqno_passed(uint32_t seq1, uint32_t seq2); | 948 | bool i915_seqno_passed(uint32_t seq1, uint32_t seq2); |
927 | int i915_gem_object_get_fence_reg(struct drm_gem_object *obj); | 949 | int i915_gem_object_get_fence_reg(struct drm_gem_object *obj); |
928 | int i915_gem_object_put_fence_reg(struct drm_gem_object *obj); | 950 | int i915_gem_object_put_fence_reg(struct drm_gem_object *obj); |
929 | void i915_gem_retire_requests(struct drm_device *dev); | 951 | void i915_gem_retire_requests(struct drm_device *dev, |
952 | struct intel_ring_buffer *ring); | ||
930 | void i915_gem_retire_work_handler(struct work_struct *work); | 953 | void i915_gem_retire_work_handler(struct work_struct *work); |
931 | void i915_gem_clflush_object(struct drm_gem_object *obj); | 954 | void i915_gem_clflush_object(struct drm_gem_object *obj); |
932 | int i915_gem_object_set_domain(struct drm_gem_object *obj, | 955 | int i915_gem_object_set_domain(struct drm_gem_object *obj, |
@@ -937,9 +960,13 @@ void i915_gem_cleanup_ringbuffer(struct drm_device *dev); | |||
937 | int i915_gem_do_init(struct drm_device *dev, unsigned long start, | 960 | int i915_gem_do_init(struct drm_device *dev, unsigned long start, |
938 | unsigned long end); | 961 | unsigned long end); |
939 | int i915_gem_idle(struct drm_device *dev); | 962 | int i915_gem_idle(struct drm_device *dev); |
940 | uint32_t i915_add_request(struct drm_device *dev, struct drm_file *file_priv, | 963 | uint32_t i915_add_request(struct drm_device *dev, |
941 | uint32_t flush_domains); | 964 | struct drm_file *file_priv, |
942 | int i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible); | 965 | uint32_t flush_domains, |
966 | struct intel_ring_buffer *ring); | ||
967 | int i915_do_wait_request(struct drm_device *dev, | ||
968 | uint32_t seqno, int interruptible, | ||
969 | struct intel_ring_buffer *ring); | ||
943 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); | 970 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); |
944 | int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, | 971 | int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, |
945 | int write); | 972 | int write); |
@@ -1015,7 +1042,7 @@ extern void g4x_disable_fbc(struct drm_device *dev); | |||
1015 | extern void intel_disable_fbc(struct drm_device *dev); | 1042 | extern void intel_disable_fbc(struct drm_device *dev); |
1016 | extern void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval); | 1043 | extern void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval); |
1017 | extern bool intel_fbc_enabled(struct drm_device *dev); | 1044 | extern bool intel_fbc_enabled(struct drm_device *dev); |
1018 | 1045 | extern bool ironlake_set_drps(struct drm_device *dev, u8 val); | |
1019 | extern void intel_detect_pch (struct drm_device *dev); | 1046 | extern void intel_detect_pch (struct drm_device *dev); |
1020 | extern int intel_trans_dp_port_sel (struct drm_crtc *crtc); | 1047 | extern int intel_trans_dp_port_sel (struct drm_crtc *crtc); |
1021 | 1048 | ||
@@ -1026,7 +1053,8 @@ extern int intel_trans_dp_port_sel (struct drm_crtc *crtc); | |||
1026 | * has access to the ring. | 1053 | * has access to the ring. |
1027 | */ | 1054 | */ |
1028 | #define RING_LOCK_TEST_WITH_RETURN(dev, file_priv) do { \ | 1055 | #define RING_LOCK_TEST_WITH_RETURN(dev, file_priv) do { \ |
1029 | if (((drm_i915_private_t *)dev->dev_private)->ring.ring_obj == NULL) \ | 1056 | if (((drm_i915_private_t *)dev->dev_private)->render_ring.gem_object \ |
1057 | == NULL) \ | ||
1030 | LOCK_TEST_WITH_RETURN(dev, file_priv); \ | 1058 | LOCK_TEST_WITH_RETURN(dev, file_priv); \ |
1031 | } while (0) | 1059 | } while (0) |
1032 | 1060 | ||
@@ -1039,35 +1067,31 @@ extern int intel_trans_dp_port_sel (struct drm_crtc *crtc); | |||
1039 | #define I915_WRITE64(reg, val) writeq(val, dev_priv->regs + (reg)) | 1067 | #define I915_WRITE64(reg, val) writeq(val, dev_priv->regs + (reg)) |
1040 | #define I915_READ64(reg) readq(dev_priv->regs + (reg)) | 1068 | #define I915_READ64(reg) readq(dev_priv->regs + (reg)) |
1041 | #define POSTING_READ(reg) (void)I915_READ(reg) | 1069 | #define POSTING_READ(reg) (void)I915_READ(reg) |
1070 | #define POSTING_READ16(reg) (void)I915_READ16(reg) | ||
1042 | 1071 | ||
1043 | #define I915_VERBOSE 0 | 1072 | #define I915_VERBOSE 0 |
1044 | 1073 | ||
1045 | #define RING_LOCALS volatile unsigned int *ring_virt__; | 1074 | #define BEGIN_LP_RING(n) do { \ |
1046 | 1075 | drm_i915_private_t *dev_priv = dev->dev_private; \ | |
1047 | #define BEGIN_LP_RING(n) do { \ | 1076 | if (I915_VERBOSE) \ |
1048 | int bytes__ = 4*(n); \ | 1077 | DRM_DEBUG(" BEGIN_LP_RING %x\n", (int)(n)); \ |
1049 | if (I915_VERBOSE) DRM_DEBUG("BEGIN_LP_RING(%d)\n", (n)); \ | 1078 | intel_ring_begin(dev, &dev_priv->render_ring, 4*(n)); \ |
1050 | /* a wrap must occur between instructions so pad beforehand */ \ | ||
1051 | if (unlikely (dev_priv->ring.tail + bytes__ > dev_priv->ring.Size)) \ | ||
1052 | i915_wrap_ring(dev); \ | ||
1053 | if (unlikely (dev_priv->ring.space < bytes__)) \ | ||
1054 | i915_wait_ring(dev, bytes__, __func__); \ | ||
1055 | ring_virt__ = (unsigned int *) \ | ||
1056 | (dev_priv->ring.virtual_start + dev_priv->ring.tail); \ | ||
1057 | dev_priv->ring.tail += bytes__; \ | ||
1058 | dev_priv->ring.tail &= dev_priv->ring.Size - 1; \ | ||
1059 | dev_priv->ring.space -= bytes__; \ | ||
1060 | } while (0) | 1079 | } while (0) |
1061 | 1080 | ||
1062 | #define OUT_RING(n) do { \ | 1081 | |
1063 | if (I915_VERBOSE) DRM_DEBUG(" OUT_RING %x\n", (int)(n)); \ | 1082 | #define OUT_RING(x) do { \ |
1064 | *ring_virt__++ = (n); \ | 1083 | drm_i915_private_t *dev_priv = dev->dev_private; \ |
1084 | if (I915_VERBOSE) \ | ||
1085 | DRM_DEBUG(" OUT_RING %x\n", (int)(x)); \ | ||
1086 | intel_ring_emit(dev, &dev_priv->render_ring, x); \ | ||
1065 | } while (0) | 1087 | } while (0) |
1066 | 1088 | ||
1067 | #define ADVANCE_LP_RING() do { \ | 1089 | #define ADVANCE_LP_RING() do { \ |
1090 | drm_i915_private_t *dev_priv = dev->dev_private; \ | ||
1068 | if (I915_VERBOSE) \ | 1091 | if (I915_VERBOSE) \ |
1069 | DRM_DEBUG("ADVANCE_LP_RING %x\n", dev_priv->ring.tail); \ | 1092 | DRM_DEBUG("ADVANCE_LP_RING %x\n", \ |
1070 | I915_WRITE(PRB0_TAIL, dev_priv->ring.tail); \ | 1093 | dev_priv->render_ring.tail); \ |
1094 | intel_ring_advance(dev, &dev_priv->render_ring); \ | ||
1071 | } while(0) | 1095 | } while(0) |
1072 | 1096 | ||
1073 | /** | 1097 | /** |
@@ -1085,14 +1109,12 @@ extern int intel_trans_dp_port_sel (struct drm_crtc *crtc); | |||
1085 | * | 1109 | * |
1086 | * The area from dword 0x20 to 0x3ff is available for driver usage. | 1110 | * The area from dword 0x20 to 0x3ff is available for driver usage. |
1087 | */ | 1111 | */ |
1088 | #define READ_HWSP(dev_priv, reg) (((volatile u32*)(dev_priv->hw_status_page))[reg]) | 1112 | #define READ_HWSP(dev_priv, reg) (((volatile u32 *)\ |
1113 | (dev_priv->render_ring.status_page.page_addr))[reg]) | ||
1089 | #define READ_BREADCRUMB(dev_priv) READ_HWSP(dev_priv, I915_BREADCRUMB_INDEX) | 1114 | #define READ_BREADCRUMB(dev_priv) READ_HWSP(dev_priv, I915_BREADCRUMB_INDEX) |
1090 | #define I915_GEM_HWS_INDEX 0x20 | 1115 | #define I915_GEM_HWS_INDEX 0x20 |
1091 | #define I915_BREADCRUMB_INDEX 0x21 | 1116 | #define I915_BREADCRUMB_INDEX 0x21 |
1092 | 1117 | ||
1093 | extern int i915_wrap_ring(struct drm_device * dev); | ||
1094 | extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | ||
1095 | |||
1096 | #define INTEL_INFO(dev) (((struct drm_i915_private *) (dev)->dev_private)->info) | 1118 | #define INTEL_INFO(dev) (((struct drm_i915_private *) (dev)->dev_private)->info) |
1097 | 1119 | ||
1098 | #define IS_I830(dev) ((dev)->pci_device == 0x3577) | 1120 | #define IS_I830(dev) ((dev)->pci_device == 0x3577) |
@@ -1138,6 +1160,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | |||
1138 | (dev)->pci_device == 0x2A42 || \ | 1160 | (dev)->pci_device == 0x2A42 || \ |
1139 | (dev)->pci_device == 0x2E42) | 1161 | (dev)->pci_device == 0x2E42) |
1140 | 1162 | ||
1163 | #define HAS_BSD(dev) (IS_IRONLAKE(dev) || IS_G4X(dev)) | ||
1141 | #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) | 1164 | #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) |
1142 | 1165 | ||
1143 | /* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte | 1166 | /* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 112699f71fa4..9ded3dae6c87 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -35,8 +35,6 @@ | |||
35 | #include <linux/swap.h> | 35 | #include <linux/swap.h> |
36 | #include <linux/pci.h> | 36 | #include <linux/pci.h> |
37 | 37 | ||
38 | #define I915_GEM_GPU_DOMAINS (~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT)) | ||
39 | |||
40 | static void i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); | 38 | static void i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); |
41 | static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj); | 39 | static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj); |
42 | static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj); | 40 | static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj); |
@@ -169,7 +167,7 @@ static int i915_gem_object_needs_bit17_swizzle(struct drm_gem_object *obj) | |||
169 | obj_priv->tiling_mode != I915_TILING_NONE; | 167 | obj_priv->tiling_mode != I915_TILING_NONE; |
170 | } | 168 | } |
171 | 169 | ||
172 | static inline int | 170 | static inline void |
173 | slow_shmem_copy(struct page *dst_page, | 171 | slow_shmem_copy(struct page *dst_page, |
174 | int dst_offset, | 172 | int dst_offset, |
175 | struct page *src_page, | 173 | struct page *src_page, |
@@ -178,25 +176,16 @@ slow_shmem_copy(struct page *dst_page, | |||
178 | { | 176 | { |
179 | char *dst_vaddr, *src_vaddr; | 177 | char *dst_vaddr, *src_vaddr; |
180 | 178 | ||
181 | dst_vaddr = kmap_atomic(dst_page, KM_USER0); | 179 | dst_vaddr = kmap(dst_page); |
182 | if (dst_vaddr == NULL) | 180 | src_vaddr = kmap(src_page); |
183 | return -ENOMEM; | ||
184 | |||
185 | src_vaddr = kmap_atomic(src_page, KM_USER1); | ||
186 | if (src_vaddr == NULL) { | ||
187 | kunmap_atomic(dst_vaddr, KM_USER0); | ||
188 | return -ENOMEM; | ||
189 | } | ||
190 | 181 | ||
191 | memcpy(dst_vaddr + dst_offset, src_vaddr + src_offset, length); | 182 | memcpy(dst_vaddr + dst_offset, src_vaddr + src_offset, length); |
192 | 183 | ||
193 | kunmap_atomic(src_vaddr, KM_USER1); | 184 | kunmap(src_page); |
194 | kunmap_atomic(dst_vaddr, KM_USER0); | 185 | kunmap(dst_page); |
195 | |||
196 | return 0; | ||
197 | } | 186 | } |
198 | 187 | ||
199 | static inline int | 188 | static inline void |
200 | slow_shmem_bit17_copy(struct page *gpu_page, | 189 | slow_shmem_bit17_copy(struct page *gpu_page, |
201 | int gpu_offset, | 190 | int gpu_offset, |
202 | struct page *cpu_page, | 191 | struct page *cpu_page, |
@@ -216,15 +205,8 @@ slow_shmem_bit17_copy(struct page *gpu_page, | |||
216 | cpu_page, cpu_offset, length); | 205 | cpu_page, cpu_offset, length); |
217 | } | 206 | } |
218 | 207 | ||
219 | gpu_vaddr = kmap_atomic(gpu_page, KM_USER0); | 208 | gpu_vaddr = kmap(gpu_page); |
220 | if (gpu_vaddr == NULL) | 209 | cpu_vaddr = kmap(cpu_page); |
221 | return -ENOMEM; | ||
222 | |||
223 | cpu_vaddr = kmap_atomic(cpu_page, KM_USER1); | ||
224 | if (cpu_vaddr == NULL) { | ||
225 | kunmap_atomic(gpu_vaddr, KM_USER0); | ||
226 | return -ENOMEM; | ||
227 | } | ||
228 | 210 | ||
229 | /* Copy the data, XORing A6 with A17 (1). The user already knows he's | 211 | /* Copy the data, XORing A6 with A17 (1). The user already knows he's |
230 | * XORing with the other bits (A9 for Y, A9 and A10 for X) | 212 | * XORing with the other bits (A9 for Y, A9 and A10 for X) |
@@ -248,10 +230,8 @@ slow_shmem_bit17_copy(struct page *gpu_page, | |||
248 | length -= this_length; | 230 | length -= this_length; |
249 | } | 231 | } |
250 | 232 | ||
251 | kunmap_atomic(cpu_vaddr, KM_USER1); | 233 | kunmap(cpu_page); |
252 | kunmap_atomic(gpu_vaddr, KM_USER0); | 234 | kunmap(gpu_page); |
253 | |||
254 | return 0; | ||
255 | } | 235 | } |
256 | 236 | ||
257 | /** | 237 | /** |
@@ -427,21 +407,19 @@ i915_gem_shmem_pread_slow(struct drm_device *dev, struct drm_gem_object *obj, | |||
427 | page_length = PAGE_SIZE - data_page_offset; | 407 | page_length = PAGE_SIZE - data_page_offset; |
428 | 408 | ||
429 | if (do_bit17_swizzling) { | 409 | if (do_bit17_swizzling) { |
430 | ret = slow_shmem_bit17_copy(obj_priv->pages[shmem_page_index], | 410 | slow_shmem_bit17_copy(obj_priv->pages[shmem_page_index], |
431 | shmem_page_offset, | ||
432 | user_pages[data_page_index], | ||
433 | data_page_offset, | ||
434 | page_length, | ||
435 | 1); | ||
436 | } else { | ||
437 | ret = slow_shmem_copy(user_pages[data_page_index], | ||
438 | data_page_offset, | ||
439 | obj_priv->pages[shmem_page_index], | ||
440 | shmem_page_offset, | 411 | shmem_page_offset, |
441 | page_length); | 412 | user_pages[data_page_index], |
413 | data_page_offset, | ||
414 | page_length, | ||
415 | 1); | ||
416 | } else { | ||
417 | slow_shmem_copy(user_pages[data_page_index], | ||
418 | data_page_offset, | ||
419 | obj_priv->pages[shmem_page_index], | ||
420 | shmem_page_offset, | ||
421 | page_length); | ||
442 | } | 422 | } |
443 | if (ret) | ||
444 | goto fail_put_pages; | ||
445 | 423 | ||
446 | remain -= page_length; | 424 | remain -= page_length; |
447 | data_ptr += page_length; | 425 | data_ptr += page_length; |
@@ -531,25 +509,24 @@ fast_user_write(struct io_mapping *mapping, | |||
531 | * page faults | 509 | * page faults |
532 | */ | 510 | */ |
533 | 511 | ||
534 | static inline int | 512 | static inline void |
535 | slow_kernel_write(struct io_mapping *mapping, | 513 | slow_kernel_write(struct io_mapping *mapping, |
536 | loff_t gtt_base, int gtt_offset, | 514 | loff_t gtt_base, int gtt_offset, |
537 | struct page *user_page, int user_offset, | 515 | struct page *user_page, int user_offset, |
538 | int length) | 516 | int length) |
539 | { | 517 | { |
540 | char *src_vaddr, *dst_vaddr; | 518 | char __iomem *dst_vaddr; |
541 | unsigned long unwritten; | 519 | char *src_vaddr; |
542 | 520 | ||
543 | dst_vaddr = io_mapping_map_atomic_wc(mapping, gtt_base); | 521 | dst_vaddr = io_mapping_map_wc(mapping, gtt_base); |
544 | src_vaddr = kmap_atomic(user_page, KM_USER1); | 522 | src_vaddr = kmap(user_page); |
545 | unwritten = __copy_from_user_inatomic_nocache(dst_vaddr + gtt_offset, | 523 | |
546 | src_vaddr + user_offset, | 524 | memcpy_toio(dst_vaddr + gtt_offset, |
547 | length); | 525 | src_vaddr + user_offset, |
548 | kunmap_atomic(src_vaddr, KM_USER1); | 526 | length); |
549 | io_mapping_unmap_atomic(dst_vaddr); | 527 | |
550 | if (unwritten) | 528 | kunmap(user_page); |
551 | return -EFAULT; | 529 | io_mapping_unmap(dst_vaddr); |
552 | return 0; | ||
553 | } | 530 | } |
554 | 531 | ||
555 | static inline int | 532 | static inline int |
@@ -722,18 +699,11 @@ i915_gem_gtt_pwrite_slow(struct drm_device *dev, struct drm_gem_object *obj, | |||
722 | if ((data_page_offset + page_length) > PAGE_SIZE) | 699 | if ((data_page_offset + page_length) > PAGE_SIZE) |
723 | page_length = PAGE_SIZE - data_page_offset; | 700 | page_length = PAGE_SIZE - data_page_offset; |
724 | 701 | ||
725 | ret = slow_kernel_write(dev_priv->mm.gtt_mapping, | 702 | slow_kernel_write(dev_priv->mm.gtt_mapping, |
726 | gtt_page_base, gtt_page_offset, | 703 | gtt_page_base, gtt_page_offset, |
727 | user_pages[data_page_index], | 704 | user_pages[data_page_index], |
728 | data_page_offset, | 705 | data_page_offset, |
729 | page_length); | 706 | page_length); |
730 | |||
731 | /* If we get a fault while copying data, then (presumably) our | ||
732 | * source page isn't available. Return the error and we'll | ||
733 | * retry in the slow path. | ||
734 | */ | ||
735 | if (ret) | ||
736 | goto out_unpin_object; | ||
737 | 707 | ||
738 | remain -= page_length; | 708 | remain -= page_length; |
739 | offset += page_length; | 709 | offset += page_length; |
@@ -902,21 +872,19 @@ i915_gem_shmem_pwrite_slow(struct drm_device *dev, struct drm_gem_object *obj, | |||
902 | page_length = PAGE_SIZE - data_page_offset; | 872 | page_length = PAGE_SIZE - data_page_offset; |
903 | 873 | ||
904 | if (do_bit17_swizzling) { | 874 | if (do_bit17_swizzling) { |
905 | ret = slow_shmem_bit17_copy(obj_priv->pages[shmem_page_index], | 875 | slow_shmem_bit17_copy(obj_priv->pages[shmem_page_index], |
906 | shmem_page_offset, | ||
907 | user_pages[data_page_index], | ||
908 | data_page_offset, | ||
909 | page_length, | ||
910 | 0); | ||
911 | } else { | ||
912 | ret = slow_shmem_copy(obj_priv->pages[shmem_page_index], | ||
913 | shmem_page_offset, | 876 | shmem_page_offset, |
914 | user_pages[data_page_index], | 877 | user_pages[data_page_index], |
915 | data_page_offset, | 878 | data_page_offset, |
916 | page_length); | 879 | page_length, |
880 | 0); | ||
881 | } else { | ||
882 | slow_shmem_copy(obj_priv->pages[shmem_page_index], | ||
883 | shmem_page_offset, | ||
884 | user_pages[data_page_index], | ||
885 | data_page_offset, | ||
886 | page_length); | ||
917 | } | 887 | } |
918 | if (ret) | ||
919 | goto fail_put_pages; | ||
920 | 888 | ||
921 | remain -= page_length; | 889 | remain -= page_length; |
922 | data_ptr += page_length; | 890 | data_ptr += page_length; |
@@ -973,7 +941,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, | |||
973 | if (obj_priv->phys_obj) | 941 | if (obj_priv->phys_obj) |
974 | ret = i915_gem_phys_pwrite(dev, obj, args, file_priv); | 942 | ret = i915_gem_phys_pwrite(dev, obj, args, file_priv); |
975 | else if (obj_priv->tiling_mode == I915_TILING_NONE && | 943 | else if (obj_priv->tiling_mode == I915_TILING_NONE && |
976 | dev->gtt_total != 0) { | 944 | dev->gtt_total != 0 && |
945 | obj->write_domain != I915_GEM_DOMAIN_CPU) { | ||
977 | ret = i915_gem_gtt_pwrite_fast(dev, obj, args, file_priv); | 946 | ret = i915_gem_gtt_pwrite_fast(dev, obj, args, file_priv); |
978 | if (ret == -EFAULT) { | 947 | if (ret == -EFAULT) { |
979 | ret = i915_gem_gtt_pwrite_slow(dev, obj, args, | 948 | ret = i915_gem_gtt_pwrite_slow(dev, obj, args, |
@@ -1484,11 +1453,14 @@ i915_gem_object_put_pages(struct drm_gem_object *obj) | |||
1484 | } | 1453 | } |
1485 | 1454 | ||
1486 | static void | 1455 | static void |
1487 | i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno) | 1456 | i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno, |
1457 | struct intel_ring_buffer *ring) | ||
1488 | { | 1458 | { |
1489 | struct drm_device *dev = obj->dev; | 1459 | struct drm_device *dev = obj->dev; |
1490 | drm_i915_private_t *dev_priv = dev->dev_private; | 1460 | drm_i915_private_t *dev_priv = dev->dev_private; |
1491 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | 1461 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); |
1462 | BUG_ON(ring == NULL); | ||
1463 | obj_priv->ring = ring; | ||
1492 | 1464 | ||
1493 | /* Add a reference if we're newly entering the active list. */ | 1465 | /* Add a reference if we're newly entering the active list. */ |
1494 | if (!obj_priv->active) { | 1466 | if (!obj_priv->active) { |
@@ -1497,8 +1469,7 @@ i915_gem_object_move_to_active(struct drm_gem_object *obj, uint32_t seqno) | |||
1497 | } | 1469 | } |
1498 | /* Move from whatever list we were on to the tail of execution. */ | 1470 | /* Move from whatever list we were on to the tail of execution. */ |
1499 | spin_lock(&dev_priv->mm.active_list_lock); | 1471 | spin_lock(&dev_priv->mm.active_list_lock); |
1500 | list_move_tail(&obj_priv->list, | 1472 | list_move_tail(&obj_priv->list, &ring->active_list); |
1501 | &dev_priv->mm.active_list); | ||
1502 | spin_unlock(&dev_priv->mm.active_list_lock); | 1473 | spin_unlock(&dev_priv->mm.active_list_lock); |
1503 | obj_priv->last_rendering_seqno = seqno; | 1474 | obj_priv->last_rendering_seqno = seqno; |
1504 | } | 1475 | } |
@@ -1551,6 +1522,7 @@ i915_gem_object_move_to_inactive(struct drm_gem_object *obj) | |||
1551 | BUG_ON(!list_empty(&obj_priv->gpu_write_list)); | 1522 | BUG_ON(!list_empty(&obj_priv->gpu_write_list)); |
1552 | 1523 | ||
1553 | obj_priv->last_rendering_seqno = 0; | 1524 | obj_priv->last_rendering_seqno = 0; |
1525 | obj_priv->ring = NULL; | ||
1554 | if (obj_priv->active) { | 1526 | if (obj_priv->active) { |
1555 | obj_priv->active = 0; | 1527 | obj_priv->active = 0; |
1556 | drm_gem_object_unreference(obj); | 1528 | drm_gem_object_unreference(obj); |
@@ -1560,7 +1532,8 @@ i915_gem_object_move_to_inactive(struct drm_gem_object *obj) | |||
1560 | 1532 | ||
1561 | static void | 1533 | static void |
1562 | i915_gem_process_flushing_list(struct drm_device *dev, | 1534 | i915_gem_process_flushing_list(struct drm_device *dev, |
1563 | uint32_t flush_domains, uint32_t seqno) | 1535 | uint32_t flush_domains, uint32_t seqno, |
1536 | struct intel_ring_buffer *ring) | ||
1564 | { | 1537 | { |
1565 | drm_i915_private_t *dev_priv = dev->dev_private; | 1538 | drm_i915_private_t *dev_priv = dev->dev_private; |
1566 | struct drm_i915_gem_object *obj_priv, *next; | 1539 | struct drm_i915_gem_object *obj_priv, *next; |
@@ -1571,12 +1544,13 @@ i915_gem_process_flushing_list(struct drm_device *dev, | |||
1571 | struct drm_gem_object *obj = &obj_priv->base; | 1544 | struct drm_gem_object *obj = &obj_priv->base; |
1572 | 1545 | ||
1573 | if ((obj->write_domain & flush_domains) == | 1546 | if ((obj->write_domain & flush_domains) == |
1574 | obj->write_domain) { | 1547 | obj->write_domain && |
1548 | obj_priv->ring->ring_flag == ring->ring_flag) { | ||
1575 | uint32_t old_write_domain = obj->write_domain; | 1549 | uint32_t old_write_domain = obj->write_domain; |
1576 | 1550 | ||
1577 | obj->write_domain = 0; | 1551 | obj->write_domain = 0; |
1578 | list_del_init(&obj_priv->gpu_write_list); | 1552 | list_del_init(&obj_priv->gpu_write_list); |
1579 | i915_gem_object_move_to_active(obj, seqno); | 1553 | i915_gem_object_move_to_active(obj, seqno, ring); |
1580 | 1554 | ||
1581 | /* update the fence lru list */ | 1555 | /* update the fence lru list */ |
1582 | if (obj_priv->fence_reg != I915_FENCE_REG_NONE) { | 1556 | if (obj_priv->fence_reg != I915_FENCE_REG_NONE) { |
@@ -1593,31 +1567,15 @@ i915_gem_process_flushing_list(struct drm_device *dev, | |||
1593 | } | 1567 | } |
1594 | } | 1568 | } |
1595 | 1569 | ||
1596 | #define PIPE_CONTROL_FLUSH(addr) \ | ||
1597 | OUT_RING(GFX_OP_PIPE_CONTROL | PIPE_CONTROL_QW_WRITE | \ | ||
1598 | PIPE_CONTROL_DEPTH_STALL); \ | ||
1599 | OUT_RING(addr | PIPE_CONTROL_GLOBAL_GTT); \ | ||
1600 | OUT_RING(0); \ | ||
1601 | OUT_RING(0); \ | ||
1602 | |||
1603 | /** | ||
1604 | * Creates a new sequence number, emitting a write of it to the status page | ||
1605 | * plus an interrupt, which will trigger i915_user_interrupt_handler. | ||
1606 | * | ||
1607 | * Must be called with struct_lock held. | ||
1608 | * | ||
1609 | * Returned sequence numbers are nonzero on success. | ||
1610 | */ | ||
1611 | uint32_t | 1570 | uint32_t |
1612 | i915_add_request(struct drm_device *dev, struct drm_file *file_priv, | 1571 | i915_add_request(struct drm_device *dev, struct drm_file *file_priv, |
1613 | uint32_t flush_domains) | 1572 | uint32_t flush_domains, struct intel_ring_buffer *ring) |
1614 | { | 1573 | { |
1615 | drm_i915_private_t *dev_priv = dev->dev_private; | 1574 | drm_i915_private_t *dev_priv = dev->dev_private; |
1616 | struct drm_i915_file_private *i915_file_priv = NULL; | 1575 | struct drm_i915_file_private *i915_file_priv = NULL; |
1617 | struct drm_i915_gem_request *request; | 1576 | struct drm_i915_gem_request *request; |
1618 | uint32_t seqno; | 1577 | uint32_t seqno; |
1619 | int was_empty; | 1578 | int was_empty; |
1620 | RING_LOCALS; | ||
1621 | 1579 | ||
1622 | if (file_priv != NULL) | 1580 | if (file_priv != NULL) |
1623 | i915_file_priv = file_priv->driver_priv; | 1581 | i915_file_priv = file_priv->driver_priv; |
@@ -1626,62 +1584,14 @@ i915_add_request(struct drm_device *dev, struct drm_file *file_priv, | |||
1626 | if (request == NULL) | 1584 | if (request == NULL) |
1627 | return 0; | 1585 | return 0; |
1628 | 1586 | ||
1629 | /* Grab the seqno we're going to make this request be, and bump the | 1587 | seqno = ring->add_request(dev, ring, file_priv, flush_domains); |
1630 | * next (skipping 0 so it can be the reserved no-seqno value). | ||
1631 | */ | ||
1632 | seqno = dev_priv->mm.next_gem_seqno; | ||
1633 | dev_priv->mm.next_gem_seqno++; | ||
1634 | if (dev_priv->mm.next_gem_seqno == 0) | ||
1635 | dev_priv->mm.next_gem_seqno++; | ||
1636 | |||
1637 | if (HAS_PIPE_CONTROL(dev)) { | ||
1638 | u32 scratch_addr = dev_priv->seqno_gfx_addr + 128; | ||
1639 | |||
1640 | /* | ||
1641 | * Workaround qword write incoherence by flushing the | ||
1642 | * PIPE_NOTIFY buffers out to memory before requesting | ||
1643 | * an interrupt. | ||
1644 | */ | ||
1645 | BEGIN_LP_RING(32); | ||
1646 | OUT_RING(GFX_OP_PIPE_CONTROL | PIPE_CONTROL_QW_WRITE | | ||
1647 | PIPE_CONTROL_WC_FLUSH | PIPE_CONTROL_TC_FLUSH); | ||
1648 | OUT_RING(dev_priv->seqno_gfx_addr | PIPE_CONTROL_GLOBAL_GTT); | ||
1649 | OUT_RING(seqno); | ||
1650 | OUT_RING(0); | ||
1651 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
1652 | scratch_addr += 128; /* write to separate cachelines */ | ||
1653 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
1654 | scratch_addr += 128; | ||
1655 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
1656 | scratch_addr += 128; | ||
1657 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
1658 | scratch_addr += 128; | ||
1659 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
1660 | scratch_addr += 128; | ||
1661 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
1662 | OUT_RING(GFX_OP_PIPE_CONTROL | PIPE_CONTROL_QW_WRITE | | ||
1663 | PIPE_CONTROL_WC_FLUSH | PIPE_CONTROL_TC_FLUSH | | ||
1664 | PIPE_CONTROL_NOTIFY); | ||
1665 | OUT_RING(dev_priv->seqno_gfx_addr | PIPE_CONTROL_GLOBAL_GTT); | ||
1666 | OUT_RING(seqno); | ||
1667 | OUT_RING(0); | ||
1668 | ADVANCE_LP_RING(); | ||
1669 | } else { | ||
1670 | BEGIN_LP_RING(4); | ||
1671 | OUT_RING(MI_STORE_DWORD_INDEX); | ||
1672 | OUT_RING(I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT); | ||
1673 | OUT_RING(seqno); | ||
1674 | |||
1675 | OUT_RING(MI_USER_INTERRUPT); | ||
1676 | ADVANCE_LP_RING(); | ||
1677 | } | ||
1678 | |||
1679 | DRM_DEBUG_DRIVER("%d\n", seqno); | ||
1680 | 1588 | ||
1681 | request->seqno = seqno; | 1589 | request->seqno = seqno; |
1590 | request->ring = ring; | ||
1682 | request->emitted_jiffies = jiffies; | 1591 | request->emitted_jiffies = jiffies; |
1683 | was_empty = list_empty(&dev_priv->mm.request_list); | 1592 | was_empty = list_empty(&ring->request_list); |
1684 | list_add_tail(&request->list, &dev_priv->mm.request_list); | 1593 | list_add_tail(&request->list, &ring->request_list); |
1594 | |||
1685 | if (i915_file_priv) { | 1595 | if (i915_file_priv) { |
1686 | list_add_tail(&request->client_list, | 1596 | list_add_tail(&request->client_list, |
1687 | &i915_file_priv->mm.request_list); | 1597 | &i915_file_priv->mm.request_list); |
@@ -1693,7 +1603,7 @@ i915_add_request(struct drm_device *dev, struct drm_file *file_priv, | |||
1693 | * domain we're flushing with our flush. | 1603 | * domain we're flushing with our flush. |
1694 | */ | 1604 | */ |
1695 | if (flush_domains != 0) | 1605 | if (flush_domains != 0) |
1696 | i915_gem_process_flushing_list(dev, flush_domains, seqno); | 1606 | i915_gem_process_flushing_list(dev, flush_domains, seqno, ring); |
1697 | 1607 | ||
1698 | if (!dev_priv->mm.suspended) { | 1608 | if (!dev_priv->mm.suspended) { |
1699 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); | 1609 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); |
@@ -1710,20 +1620,16 @@ i915_add_request(struct drm_device *dev, struct drm_file *file_priv, | |||
1710 | * before signalling the CPU | 1620 | * before signalling the CPU |
1711 | */ | 1621 | */ |
1712 | static uint32_t | 1622 | static uint32_t |
1713 | i915_retire_commands(struct drm_device *dev) | 1623 | i915_retire_commands(struct drm_device *dev, struct intel_ring_buffer *ring) |
1714 | { | 1624 | { |
1715 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
1716 | uint32_t cmd = MI_FLUSH | MI_NO_WRITE_FLUSH; | ||
1717 | uint32_t flush_domains = 0; | 1625 | uint32_t flush_domains = 0; |
1718 | RING_LOCALS; | ||
1719 | 1626 | ||
1720 | /* The sampler always gets flushed on i965 (sigh) */ | 1627 | /* The sampler always gets flushed on i965 (sigh) */ |
1721 | if (IS_I965G(dev)) | 1628 | if (IS_I965G(dev)) |
1722 | flush_domains |= I915_GEM_DOMAIN_SAMPLER; | 1629 | flush_domains |= I915_GEM_DOMAIN_SAMPLER; |
1723 | BEGIN_LP_RING(2); | 1630 | |
1724 | OUT_RING(cmd); | 1631 | ring->flush(dev, ring, |
1725 | OUT_RING(0); /* noop */ | 1632 | I915_GEM_DOMAIN_COMMAND, flush_domains); |
1726 | ADVANCE_LP_RING(); | ||
1727 | return flush_domains; | 1633 | return flush_domains; |
1728 | } | 1634 | } |
1729 | 1635 | ||
@@ -1743,11 +1649,11 @@ i915_gem_retire_request(struct drm_device *dev, | |||
1743 | * by the ringbuffer to the flushing/inactive lists as appropriate. | 1649 | * by the ringbuffer to the flushing/inactive lists as appropriate. |
1744 | */ | 1650 | */ |
1745 | spin_lock(&dev_priv->mm.active_list_lock); | 1651 | spin_lock(&dev_priv->mm.active_list_lock); |
1746 | while (!list_empty(&dev_priv->mm.active_list)) { | 1652 | while (!list_empty(&request->ring->active_list)) { |
1747 | struct drm_gem_object *obj; | 1653 | struct drm_gem_object *obj; |
1748 | struct drm_i915_gem_object *obj_priv; | 1654 | struct drm_i915_gem_object *obj_priv; |
1749 | 1655 | ||
1750 | obj_priv = list_first_entry(&dev_priv->mm.active_list, | 1656 | obj_priv = list_first_entry(&request->ring->active_list, |
1751 | struct drm_i915_gem_object, | 1657 | struct drm_i915_gem_object, |
1752 | list); | 1658 | list); |
1753 | obj = &obj_priv->base; | 1659 | obj = &obj_priv->base; |
@@ -1794,35 +1700,33 @@ i915_seqno_passed(uint32_t seq1, uint32_t seq2) | |||
1794 | } | 1700 | } |
1795 | 1701 | ||
1796 | uint32_t | 1702 | uint32_t |
1797 | i915_get_gem_seqno(struct drm_device *dev) | 1703 | i915_get_gem_seqno(struct drm_device *dev, |
1704 | struct intel_ring_buffer *ring) | ||
1798 | { | 1705 | { |
1799 | drm_i915_private_t *dev_priv = dev->dev_private; | 1706 | return ring->get_gem_seqno(dev, ring); |
1800 | |||
1801 | if (HAS_PIPE_CONTROL(dev)) | ||
1802 | return ((volatile u32 *)(dev_priv->seqno_page))[0]; | ||
1803 | else | ||
1804 | return READ_HWSP(dev_priv, I915_GEM_HWS_INDEX); | ||
1805 | } | 1707 | } |
1806 | 1708 | ||
1807 | /** | 1709 | /** |
1808 | * This function clears the request list as sequence numbers are passed. | 1710 | * This function clears the request list as sequence numbers are passed. |
1809 | */ | 1711 | */ |
1810 | void | 1712 | void |
1811 | i915_gem_retire_requests(struct drm_device *dev) | 1713 | i915_gem_retire_requests(struct drm_device *dev, |
1714 | struct intel_ring_buffer *ring) | ||
1812 | { | 1715 | { |
1813 | drm_i915_private_t *dev_priv = dev->dev_private; | 1716 | drm_i915_private_t *dev_priv = dev->dev_private; |
1814 | uint32_t seqno; | 1717 | uint32_t seqno; |
1815 | 1718 | ||
1816 | if (!dev_priv->hw_status_page || list_empty(&dev_priv->mm.request_list)) | 1719 | if (!ring->status_page.page_addr |
1720 | || list_empty(&ring->request_list)) | ||
1817 | return; | 1721 | return; |
1818 | 1722 | ||
1819 | seqno = i915_get_gem_seqno(dev); | 1723 | seqno = i915_get_gem_seqno(dev, ring); |
1820 | 1724 | ||
1821 | while (!list_empty(&dev_priv->mm.request_list)) { | 1725 | while (!list_empty(&ring->request_list)) { |
1822 | struct drm_i915_gem_request *request; | 1726 | struct drm_i915_gem_request *request; |
1823 | uint32_t retiring_seqno; | 1727 | uint32_t retiring_seqno; |
1824 | 1728 | ||
1825 | request = list_first_entry(&dev_priv->mm.request_list, | 1729 | request = list_first_entry(&ring->request_list, |
1826 | struct drm_i915_gem_request, | 1730 | struct drm_i915_gem_request, |
1827 | list); | 1731 | list); |
1828 | retiring_seqno = request->seqno; | 1732 | retiring_seqno = request->seqno; |
@@ -1840,7 +1744,8 @@ i915_gem_retire_requests(struct drm_device *dev) | |||
1840 | 1744 | ||
1841 | if (unlikely (dev_priv->trace_irq_seqno && | 1745 | if (unlikely (dev_priv->trace_irq_seqno && |
1842 | i915_seqno_passed(dev_priv->trace_irq_seqno, seqno))) { | 1746 | i915_seqno_passed(dev_priv->trace_irq_seqno, seqno))) { |
1843 | i915_user_irq_put(dev); | 1747 | |
1748 | ring->user_irq_put(dev, ring); | ||
1844 | dev_priv->trace_irq_seqno = 0; | 1749 | dev_priv->trace_irq_seqno = 0; |
1845 | } | 1750 | } |
1846 | } | 1751 | } |
@@ -1856,15 +1761,22 @@ i915_gem_retire_work_handler(struct work_struct *work) | |||
1856 | dev = dev_priv->dev; | 1761 | dev = dev_priv->dev; |
1857 | 1762 | ||
1858 | mutex_lock(&dev->struct_mutex); | 1763 | mutex_lock(&dev->struct_mutex); |
1859 | i915_gem_retire_requests(dev); | 1764 | i915_gem_retire_requests(dev, &dev_priv->render_ring); |
1765 | |||
1766 | if (HAS_BSD(dev)) | ||
1767 | i915_gem_retire_requests(dev, &dev_priv->bsd_ring); | ||
1768 | |||
1860 | if (!dev_priv->mm.suspended && | 1769 | if (!dev_priv->mm.suspended && |
1861 | !list_empty(&dev_priv->mm.request_list)) | 1770 | (!list_empty(&dev_priv->render_ring.request_list) || |
1771 | (HAS_BSD(dev) && | ||
1772 | !list_empty(&dev_priv->bsd_ring.request_list)))) | ||
1862 | queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ); | 1773 | queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ); |
1863 | mutex_unlock(&dev->struct_mutex); | 1774 | mutex_unlock(&dev->struct_mutex); |
1864 | } | 1775 | } |
1865 | 1776 | ||
1866 | int | 1777 | int |
1867 | i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible) | 1778 | i915_do_wait_request(struct drm_device *dev, uint32_t seqno, |
1779 | int interruptible, struct intel_ring_buffer *ring) | ||
1868 | { | 1780 | { |
1869 | drm_i915_private_t *dev_priv = dev->dev_private; | 1781 | drm_i915_private_t *dev_priv = dev->dev_private; |
1870 | u32 ier; | 1782 | u32 ier; |
@@ -1875,7 +1787,7 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible) | |||
1875 | if (atomic_read(&dev_priv->mm.wedged)) | 1787 | if (atomic_read(&dev_priv->mm.wedged)) |
1876 | return -EIO; | 1788 | return -EIO; |
1877 | 1789 | ||
1878 | if (!i915_seqno_passed(i915_get_gem_seqno(dev), seqno)) { | 1790 | if (!i915_seqno_passed(ring->get_gem_seqno(dev, ring), seqno)) { |
1879 | if (HAS_PCH_SPLIT(dev)) | 1791 | if (HAS_PCH_SPLIT(dev)) |
1880 | ier = I915_READ(DEIER) | I915_READ(GTIER); | 1792 | ier = I915_READ(DEIER) | I915_READ(GTIER); |
1881 | else | 1793 | else |
@@ -1889,19 +1801,21 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible) | |||
1889 | 1801 | ||
1890 | trace_i915_gem_request_wait_begin(dev, seqno); | 1802 | trace_i915_gem_request_wait_begin(dev, seqno); |
1891 | 1803 | ||
1892 | dev_priv->mm.waiting_gem_seqno = seqno; | 1804 | ring->waiting_gem_seqno = seqno; |
1893 | i915_user_irq_get(dev); | 1805 | ring->user_irq_get(dev, ring); |
1894 | if (interruptible) | 1806 | if (interruptible) |
1895 | ret = wait_event_interruptible(dev_priv->irq_queue, | 1807 | ret = wait_event_interruptible(ring->irq_queue, |
1896 | i915_seqno_passed(i915_get_gem_seqno(dev), seqno) || | 1808 | i915_seqno_passed( |
1897 | atomic_read(&dev_priv->mm.wedged)); | 1809 | ring->get_gem_seqno(dev, ring), seqno) |
1810 | || atomic_read(&dev_priv->mm.wedged)); | ||
1898 | else | 1811 | else |
1899 | wait_event(dev_priv->irq_queue, | 1812 | wait_event(ring->irq_queue, |
1900 | i915_seqno_passed(i915_get_gem_seqno(dev), seqno) || | 1813 | i915_seqno_passed( |
1901 | atomic_read(&dev_priv->mm.wedged)); | 1814 | ring->get_gem_seqno(dev, ring), seqno) |
1815 | || atomic_read(&dev_priv->mm.wedged)); | ||
1902 | 1816 | ||
1903 | i915_user_irq_put(dev); | 1817 | ring->user_irq_put(dev, ring); |
1904 | dev_priv->mm.waiting_gem_seqno = 0; | 1818 | ring->waiting_gem_seqno = 0; |
1905 | 1819 | ||
1906 | trace_i915_gem_request_wait_end(dev, seqno); | 1820 | trace_i915_gem_request_wait_end(dev, seqno); |
1907 | } | 1821 | } |
@@ -1910,7 +1824,7 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible) | |||
1910 | 1824 | ||
1911 | if (ret && ret != -ERESTARTSYS) | 1825 | if (ret && ret != -ERESTARTSYS) |
1912 | DRM_ERROR("%s returns %d (awaiting %d at %d)\n", | 1826 | DRM_ERROR("%s returns %d (awaiting %d at %d)\n", |
1913 | __func__, ret, seqno, i915_get_gem_seqno(dev)); | 1827 | __func__, ret, seqno, ring->get_gem_seqno(dev, ring)); |
1914 | 1828 | ||
1915 | /* Directly dispatch request retiring. While we have the work queue | 1829 | /* Directly dispatch request retiring. While we have the work queue |
1916 | * to handle this, the waiter on a request often wants an associated | 1830 | * to handle this, the waiter on a request often wants an associated |
@@ -1918,7 +1832,7 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible) | |||
1918 | * a separate wait queue to handle that. | 1832 | * a separate wait queue to handle that. |
1919 | */ | 1833 | */ |
1920 | if (ret == 0) | 1834 | if (ret == 0) |
1921 | i915_gem_retire_requests(dev); | 1835 | i915_gem_retire_requests(dev, ring); |
1922 | 1836 | ||
1923 | return ret; | 1837 | return ret; |
1924 | } | 1838 | } |
@@ -1928,9 +1842,10 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible) | |||
1928 | * request and object lists appropriately for that event. | 1842 | * request and object lists appropriately for that event. |
1929 | */ | 1843 | */ |
1930 | static int | 1844 | static int |
1931 | i915_wait_request(struct drm_device *dev, uint32_t seqno) | 1845 | i915_wait_request(struct drm_device *dev, uint32_t seqno, |
1846 | struct intel_ring_buffer *ring) | ||
1932 | { | 1847 | { |
1933 | return i915_do_wait_request(dev, seqno, 1); | 1848 | return i915_do_wait_request(dev, seqno, 1, ring); |
1934 | } | 1849 | } |
1935 | 1850 | ||
1936 | static void | 1851 | static void |
@@ -1939,71 +1854,29 @@ i915_gem_flush(struct drm_device *dev, | |||
1939 | uint32_t flush_domains) | 1854 | uint32_t flush_domains) |
1940 | { | 1855 | { |
1941 | drm_i915_private_t *dev_priv = dev->dev_private; | 1856 | drm_i915_private_t *dev_priv = dev->dev_private; |
1942 | uint32_t cmd; | ||
1943 | RING_LOCALS; | ||
1944 | |||
1945 | #if WATCH_EXEC | ||
1946 | DRM_INFO("%s: invalidate %08x flush %08x\n", __func__, | ||
1947 | invalidate_domains, flush_domains); | ||
1948 | #endif | ||
1949 | trace_i915_gem_request_flush(dev, dev_priv->mm.next_gem_seqno, | ||
1950 | invalidate_domains, flush_domains); | ||
1951 | |||
1952 | if (flush_domains & I915_GEM_DOMAIN_CPU) | 1857 | if (flush_domains & I915_GEM_DOMAIN_CPU) |
1953 | drm_agp_chipset_flush(dev); | 1858 | drm_agp_chipset_flush(dev); |
1859 | dev_priv->render_ring.flush(dev, &dev_priv->render_ring, | ||
1860 | invalidate_domains, | ||
1861 | flush_domains); | ||
1862 | |||
1863 | if (HAS_BSD(dev)) | ||
1864 | dev_priv->bsd_ring.flush(dev, &dev_priv->bsd_ring, | ||
1865 | invalidate_domains, | ||
1866 | flush_domains); | ||
1867 | } | ||
1954 | 1868 | ||
1955 | if ((invalidate_domains | flush_domains) & I915_GEM_GPU_DOMAINS) { | 1869 | static void |
1956 | /* | 1870 | i915_gem_flush_ring(struct drm_device *dev, |
1957 | * read/write caches: | 1871 | uint32_t invalidate_domains, |
1958 | * | 1872 | uint32_t flush_domains, |
1959 | * I915_GEM_DOMAIN_RENDER is always invalidated, but is | 1873 | struct intel_ring_buffer *ring) |
1960 | * only flushed if MI_NO_WRITE_FLUSH is unset. On 965, it is | 1874 | { |
1961 | * also flushed at 2d versus 3d pipeline switches. | 1875 | if (flush_domains & I915_GEM_DOMAIN_CPU) |
1962 | * | 1876 | drm_agp_chipset_flush(dev); |
1963 | * read-only caches: | 1877 | ring->flush(dev, ring, |
1964 | * | 1878 | invalidate_domains, |
1965 | * I915_GEM_DOMAIN_SAMPLER is flushed on pre-965 if | 1879 | flush_domains); |
1966 | * MI_READ_FLUSH is set, and is always flushed on 965. | ||
1967 | * | ||
1968 | * I915_GEM_DOMAIN_COMMAND may not exist? | ||
1969 | * | ||
1970 | * I915_GEM_DOMAIN_INSTRUCTION, which exists on 965, is | ||
1971 | * invalidated when MI_EXE_FLUSH is set. | ||
1972 | * | ||
1973 | * I915_GEM_DOMAIN_VERTEX, which exists on 965, is | ||
1974 | * invalidated with every MI_FLUSH. | ||
1975 | * | ||
1976 | * TLBs: | ||
1977 | * | ||
1978 | * On 965, TLBs associated with I915_GEM_DOMAIN_COMMAND | ||
1979 | * and I915_GEM_DOMAIN_CPU in are invalidated at PTE write and | ||
1980 | * I915_GEM_DOMAIN_RENDER and I915_GEM_DOMAIN_SAMPLER | ||
1981 | * are flushed at any MI_FLUSH. | ||
1982 | */ | ||
1983 | |||
1984 | cmd = MI_FLUSH | MI_NO_WRITE_FLUSH; | ||
1985 | if ((invalidate_domains|flush_domains) & | ||
1986 | I915_GEM_DOMAIN_RENDER) | ||
1987 | cmd &= ~MI_NO_WRITE_FLUSH; | ||
1988 | if (!IS_I965G(dev)) { | ||
1989 | /* | ||
1990 | * On the 965, the sampler cache always gets flushed | ||
1991 | * and this bit is reserved. | ||
1992 | */ | ||
1993 | if (invalidate_domains & I915_GEM_DOMAIN_SAMPLER) | ||
1994 | cmd |= MI_READ_FLUSH; | ||
1995 | } | ||
1996 | if (invalidate_domains & I915_GEM_DOMAIN_INSTRUCTION) | ||
1997 | cmd |= MI_EXE_FLUSH; | ||
1998 | |||
1999 | #if WATCH_EXEC | ||
2000 | DRM_INFO("%s: queue flush %08x to ring\n", __func__, cmd); | ||
2001 | #endif | ||
2002 | BEGIN_LP_RING(2); | ||
2003 | OUT_RING(cmd); | ||
2004 | OUT_RING(MI_NOOP); | ||
2005 | ADVANCE_LP_RING(); | ||
2006 | } | ||
2007 | } | 1880 | } |
2008 | 1881 | ||
2009 | /** | 1882 | /** |
@@ -2030,7 +1903,8 @@ i915_gem_object_wait_rendering(struct drm_gem_object *obj) | |||
2030 | DRM_INFO("%s: object %p wait for seqno %08x\n", | 1903 | DRM_INFO("%s: object %p wait for seqno %08x\n", |
2031 | __func__, obj, obj_priv->last_rendering_seqno); | 1904 | __func__, obj, obj_priv->last_rendering_seqno); |
2032 | #endif | 1905 | #endif |
2033 | ret = i915_wait_request(dev, obj_priv->last_rendering_seqno); | 1906 | ret = i915_wait_request(dev, |
1907 | obj_priv->last_rendering_seqno, obj_priv->ring); | ||
2034 | if (ret != 0) | 1908 | if (ret != 0) |
2035 | return ret; | 1909 | return ret; |
2036 | } | 1910 | } |
@@ -2146,11 +2020,14 @@ i915_gpu_idle(struct drm_device *dev) | |||
2146 | { | 2020 | { |
2147 | drm_i915_private_t *dev_priv = dev->dev_private; | 2021 | drm_i915_private_t *dev_priv = dev->dev_private; |
2148 | bool lists_empty; | 2022 | bool lists_empty; |
2149 | uint32_t seqno; | 2023 | uint32_t seqno1, seqno2; |
2024 | int ret; | ||
2150 | 2025 | ||
2151 | spin_lock(&dev_priv->mm.active_list_lock); | 2026 | spin_lock(&dev_priv->mm.active_list_lock); |
2152 | lists_empty = list_empty(&dev_priv->mm.flushing_list) && | 2027 | lists_empty = (list_empty(&dev_priv->mm.flushing_list) && |
2153 | list_empty(&dev_priv->mm.active_list); | 2028 | list_empty(&dev_priv->render_ring.active_list) && |
2029 | (!HAS_BSD(dev) || | ||
2030 | list_empty(&dev_priv->bsd_ring.active_list))); | ||
2154 | spin_unlock(&dev_priv->mm.active_list_lock); | 2031 | spin_unlock(&dev_priv->mm.active_list_lock); |
2155 | 2032 | ||
2156 | if (lists_empty) | 2033 | if (lists_empty) |
@@ -2158,11 +2035,25 @@ i915_gpu_idle(struct drm_device *dev) | |||
2158 | 2035 | ||
2159 | /* Flush everything onto the inactive list. */ | 2036 | /* Flush everything onto the inactive list. */ |
2160 | i915_gem_flush(dev, I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS); | 2037 | i915_gem_flush(dev, I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS); |
2161 | seqno = i915_add_request(dev, NULL, I915_GEM_GPU_DOMAINS); | 2038 | seqno1 = i915_add_request(dev, NULL, I915_GEM_GPU_DOMAINS, |
2162 | if (seqno == 0) | 2039 | &dev_priv->render_ring); |
2040 | if (seqno1 == 0) | ||
2163 | return -ENOMEM; | 2041 | return -ENOMEM; |
2042 | ret = i915_wait_request(dev, seqno1, &dev_priv->render_ring); | ||
2043 | |||
2044 | if (HAS_BSD(dev)) { | ||
2045 | seqno2 = i915_add_request(dev, NULL, I915_GEM_GPU_DOMAINS, | ||
2046 | &dev_priv->bsd_ring); | ||
2047 | if (seqno2 == 0) | ||
2048 | return -ENOMEM; | ||
2049 | |||
2050 | ret = i915_wait_request(dev, seqno2, &dev_priv->bsd_ring); | ||
2051 | if (ret) | ||
2052 | return ret; | ||
2053 | } | ||
2054 | |||
2164 | 2055 | ||
2165 | return i915_wait_request(dev, seqno); | 2056 | return ret; |
2166 | } | 2057 | } |
2167 | 2058 | ||
2168 | static int | 2059 | static int |
@@ -2175,7 +2066,9 @@ i915_gem_evict_everything(struct drm_device *dev) | |||
2175 | spin_lock(&dev_priv->mm.active_list_lock); | 2066 | spin_lock(&dev_priv->mm.active_list_lock); |
2176 | lists_empty = (list_empty(&dev_priv->mm.inactive_list) && | 2067 | lists_empty = (list_empty(&dev_priv->mm.inactive_list) && |
2177 | list_empty(&dev_priv->mm.flushing_list) && | 2068 | list_empty(&dev_priv->mm.flushing_list) && |
2178 | list_empty(&dev_priv->mm.active_list)); | 2069 | list_empty(&dev_priv->render_ring.active_list) && |
2070 | (!HAS_BSD(dev) | ||
2071 | || list_empty(&dev_priv->bsd_ring.active_list))); | ||
2179 | spin_unlock(&dev_priv->mm.active_list_lock); | 2072 | spin_unlock(&dev_priv->mm.active_list_lock); |
2180 | 2073 | ||
2181 | if (lists_empty) | 2074 | if (lists_empty) |
@@ -2195,7 +2088,9 @@ i915_gem_evict_everything(struct drm_device *dev) | |||
2195 | spin_lock(&dev_priv->mm.active_list_lock); | 2088 | spin_lock(&dev_priv->mm.active_list_lock); |
2196 | lists_empty = (list_empty(&dev_priv->mm.inactive_list) && | 2089 | lists_empty = (list_empty(&dev_priv->mm.inactive_list) && |
2197 | list_empty(&dev_priv->mm.flushing_list) && | 2090 | list_empty(&dev_priv->mm.flushing_list) && |
2198 | list_empty(&dev_priv->mm.active_list)); | 2091 | list_empty(&dev_priv->render_ring.active_list) && |
2092 | (!HAS_BSD(dev) | ||
2093 | || list_empty(&dev_priv->bsd_ring.active_list))); | ||
2199 | spin_unlock(&dev_priv->mm.active_list_lock); | 2094 | spin_unlock(&dev_priv->mm.active_list_lock); |
2200 | BUG_ON(!lists_empty); | 2095 | BUG_ON(!lists_empty); |
2201 | 2096 | ||
@@ -2209,8 +2104,13 @@ i915_gem_evict_something(struct drm_device *dev, int min_size) | |||
2209 | struct drm_gem_object *obj; | 2104 | struct drm_gem_object *obj; |
2210 | int ret; | 2105 | int ret; |
2211 | 2106 | ||
2107 | struct intel_ring_buffer *render_ring = &dev_priv->render_ring; | ||
2108 | struct intel_ring_buffer *bsd_ring = &dev_priv->bsd_ring; | ||
2212 | for (;;) { | 2109 | for (;;) { |
2213 | i915_gem_retire_requests(dev); | 2110 | i915_gem_retire_requests(dev, render_ring); |
2111 | |||
2112 | if (HAS_BSD(dev)) | ||
2113 | i915_gem_retire_requests(dev, bsd_ring); | ||
2214 | 2114 | ||
2215 | /* If there's an inactive buffer available now, grab it | 2115 | /* If there's an inactive buffer available now, grab it |
2216 | * and be done. | 2116 | * and be done. |
@@ -2234,14 +2134,30 @@ i915_gem_evict_something(struct drm_device *dev, int min_size) | |||
2234 | * things, wait for the next to finish and hopefully leave us | 2134 | * things, wait for the next to finish and hopefully leave us |
2235 | * a buffer to evict. | 2135 | * a buffer to evict. |
2236 | */ | 2136 | */ |
2237 | if (!list_empty(&dev_priv->mm.request_list)) { | 2137 | if (!list_empty(&render_ring->request_list)) { |
2138 | struct drm_i915_gem_request *request; | ||
2139 | |||
2140 | request = list_first_entry(&render_ring->request_list, | ||
2141 | struct drm_i915_gem_request, | ||
2142 | list); | ||
2143 | |||
2144 | ret = i915_wait_request(dev, | ||
2145 | request->seqno, request->ring); | ||
2146 | if (ret) | ||
2147 | return ret; | ||
2148 | |||
2149 | continue; | ||
2150 | } | ||
2151 | |||
2152 | if (HAS_BSD(dev) && !list_empty(&bsd_ring->request_list)) { | ||
2238 | struct drm_i915_gem_request *request; | 2153 | struct drm_i915_gem_request *request; |
2239 | 2154 | ||
2240 | request = list_first_entry(&dev_priv->mm.request_list, | 2155 | request = list_first_entry(&bsd_ring->request_list, |
2241 | struct drm_i915_gem_request, | 2156 | struct drm_i915_gem_request, |
2242 | list); | 2157 | list); |
2243 | 2158 | ||
2244 | ret = i915_wait_request(dev, request->seqno); | 2159 | ret = i915_wait_request(dev, |
2160 | request->seqno, request->ring); | ||
2245 | if (ret) | 2161 | if (ret) |
2246 | return ret; | 2162 | return ret; |
2247 | 2163 | ||
@@ -2268,10 +2184,13 @@ i915_gem_evict_something(struct drm_device *dev, int min_size) | |||
2268 | if (obj != NULL) { | 2184 | if (obj != NULL) { |
2269 | uint32_t seqno; | 2185 | uint32_t seqno; |
2270 | 2186 | ||
2271 | i915_gem_flush(dev, | 2187 | i915_gem_flush_ring(dev, |
2188 | obj->write_domain, | ||
2272 | obj->write_domain, | 2189 | obj->write_domain, |
2273 | obj->write_domain); | 2190 | obj_priv->ring); |
2274 | seqno = i915_add_request(dev, NULL, obj->write_domain); | 2191 | seqno = i915_add_request(dev, NULL, |
2192 | obj->write_domain, | ||
2193 | obj_priv->ring); | ||
2275 | if (seqno == 0) | 2194 | if (seqno == 0) |
2276 | return -ENOMEM; | 2195 | return -ENOMEM; |
2277 | continue; | 2196 | continue; |
@@ -2299,6 +2218,9 @@ i915_gem_object_get_pages(struct drm_gem_object *obj, | |||
2299 | struct inode *inode; | 2218 | struct inode *inode; |
2300 | struct page *page; | 2219 | struct page *page; |
2301 | 2220 | ||
2221 | BUG_ON(obj_priv->pages_refcount | ||
2222 | == DRM_I915_GEM_OBJECT_MAX_PAGES_REFCOUNT); | ||
2223 | |||
2302 | if (obj_priv->pages_refcount++ != 0) | 2224 | if (obj_priv->pages_refcount++ != 0) |
2303 | return 0; | 2225 | return 0; |
2304 | 2226 | ||
@@ -2697,6 +2619,14 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment) | |||
2697 | return -EINVAL; | 2619 | return -EINVAL; |
2698 | } | 2620 | } |
2699 | 2621 | ||
2622 | /* If the object is bigger than the entire aperture, reject it early | ||
2623 | * before evicting everything in a vain attempt to find space. | ||
2624 | */ | ||
2625 | if (obj->size > dev->gtt_total) { | ||
2626 | DRM_ERROR("Attempting to bind an object larger than the aperture\n"); | ||
2627 | return -E2BIG; | ||
2628 | } | ||
2629 | |||
2700 | search_free: | 2630 | search_free: |
2701 | free_space = drm_mm_search_free(&dev_priv->mm.gtt_space, | 2631 | free_space = drm_mm_search_free(&dev_priv->mm.gtt_space, |
2702 | obj->size, alignment, 0); | 2632 | obj->size, alignment, 0); |
@@ -2807,6 +2737,7 @@ i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj) | |||
2807 | { | 2737 | { |
2808 | struct drm_device *dev = obj->dev; | 2738 | struct drm_device *dev = obj->dev; |
2809 | uint32_t old_write_domain; | 2739 | uint32_t old_write_domain; |
2740 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | ||
2810 | 2741 | ||
2811 | if ((obj->write_domain & I915_GEM_GPU_DOMAINS) == 0) | 2742 | if ((obj->write_domain & I915_GEM_GPU_DOMAINS) == 0) |
2812 | return; | 2743 | return; |
@@ -2814,7 +2745,7 @@ i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj) | |||
2814 | /* Queue the GPU write cache flushing we need. */ | 2745 | /* Queue the GPU write cache flushing we need. */ |
2815 | old_write_domain = obj->write_domain; | 2746 | old_write_domain = obj->write_domain; |
2816 | i915_gem_flush(dev, 0, obj->write_domain); | 2747 | i915_gem_flush(dev, 0, obj->write_domain); |
2817 | (void) i915_add_request(dev, NULL, obj->write_domain); | 2748 | (void) i915_add_request(dev, NULL, obj->write_domain, obj_priv->ring); |
2818 | BUG_ON(obj->write_domain); | 2749 | BUG_ON(obj->write_domain); |
2819 | 2750 | ||
2820 | trace_i915_gem_object_change_domain(obj, | 2751 | trace_i915_gem_object_change_domain(obj, |
@@ -2954,23 +2885,24 @@ i915_gem_object_set_to_display_plane(struct drm_gem_object *obj) | |||
2954 | DRM_INFO("%s: object %p wait for seqno %08x\n", | 2885 | DRM_INFO("%s: object %p wait for seqno %08x\n", |
2955 | __func__, obj, obj_priv->last_rendering_seqno); | 2886 | __func__, obj, obj_priv->last_rendering_seqno); |
2956 | #endif | 2887 | #endif |
2957 | ret = i915_do_wait_request(dev, obj_priv->last_rendering_seqno, 0); | 2888 | ret = i915_do_wait_request(dev, |
2889 | obj_priv->last_rendering_seqno, | ||
2890 | 0, | ||
2891 | obj_priv->ring); | ||
2958 | if (ret != 0) | 2892 | if (ret != 0) |
2959 | return ret; | 2893 | return ret; |
2960 | } | 2894 | } |
2961 | 2895 | ||
2896 | i915_gem_object_flush_cpu_write_domain(obj); | ||
2897 | |||
2962 | old_write_domain = obj->write_domain; | 2898 | old_write_domain = obj->write_domain; |
2963 | old_read_domains = obj->read_domains; | 2899 | old_read_domains = obj->read_domains; |
2964 | 2900 | ||
2965 | obj->read_domains &= I915_GEM_DOMAIN_GTT; | ||
2966 | |||
2967 | i915_gem_object_flush_cpu_write_domain(obj); | ||
2968 | |||
2969 | /* It should now be out of any other write domains, and we can update | 2901 | /* It should now be out of any other write domains, and we can update |
2970 | * the domain values for our changes. | 2902 | * the domain values for our changes. |
2971 | */ | 2903 | */ |
2972 | BUG_ON((obj->write_domain & ~I915_GEM_DOMAIN_GTT) != 0); | 2904 | BUG_ON((obj->write_domain & ~I915_GEM_DOMAIN_GTT) != 0); |
2973 | obj->read_domains |= I915_GEM_DOMAIN_GTT; | 2905 | obj->read_domains = I915_GEM_DOMAIN_GTT; |
2974 | obj->write_domain = I915_GEM_DOMAIN_GTT; | 2906 | obj->write_domain = I915_GEM_DOMAIN_GTT; |
2975 | obj_priv->dirty = 1; | 2907 | obj_priv->dirty = 1; |
2976 | 2908 | ||
@@ -3354,9 +3286,13 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, | |||
3354 | obj_priv->tiling_mode != I915_TILING_NONE; | 3286 | obj_priv->tiling_mode != I915_TILING_NONE; |
3355 | 3287 | ||
3356 | /* Check fence reg constraints and rebind if necessary */ | 3288 | /* Check fence reg constraints and rebind if necessary */ |
3357 | if (need_fence && !i915_gem_object_fence_offset_ok(obj, | 3289 | if (need_fence && |
3358 | obj_priv->tiling_mode)) | 3290 | !i915_gem_object_fence_offset_ok(obj, |
3359 | i915_gem_object_unbind(obj); | 3291 | obj_priv->tiling_mode)) { |
3292 | ret = i915_gem_object_unbind(obj); | ||
3293 | if (ret) | ||
3294 | return ret; | ||
3295 | } | ||
3360 | 3296 | ||
3361 | /* Choose the GTT offset for our buffer and put it there. */ | 3297 | /* Choose the GTT offset for our buffer and put it there. */ |
3362 | ret = i915_gem_object_pin(obj, (uint32_t) entry->alignment); | 3298 | ret = i915_gem_object_pin(obj, (uint32_t) entry->alignment); |
@@ -3370,9 +3306,6 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, | |||
3370 | if (need_fence) { | 3306 | if (need_fence) { |
3371 | ret = i915_gem_object_get_fence_reg(obj); | 3307 | ret = i915_gem_object_get_fence_reg(obj); |
3372 | if (ret != 0) { | 3308 | if (ret != 0) { |
3373 | if (ret != -EBUSY && ret != -ERESTARTSYS) | ||
3374 | DRM_ERROR("Failure to install fence: %d\n", | ||
3375 | ret); | ||
3376 | i915_gem_object_unpin(obj); | 3309 | i915_gem_object_unpin(obj); |
3377 | return ret; | 3310 | return ret; |
3378 | } | 3311 | } |
@@ -3545,62 +3478,6 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, | |||
3545 | return 0; | 3478 | return 0; |
3546 | } | 3479 | } |
3547 | 3480 | ||
3548 | /** Dispatch a batchbuffer to the ring | ||
3549 | */ | ||
3550 | static int | ||
3551 | i915_dispatch_gem_execbuffer(struct drm_device *dev, | ||
3552 | struct drm_i915_gem_execbuffer2 *exec, | ||
3553 | struct drm_clip_rect *cliprects, | ||
3554 | uint64_t exec_offset) | ||
3555 | { | ||
3556 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
3557 | int nbox = exec->num_cliprects; | ||
3558 | int i = 0, count; | ||
3559 | uint32_t exec_start, exec_len; | ||
3560 | RING_LOCALS; | ||
3561 | |||
3562 | exec_start = (uint32_t) exec_offset + exec->batch_start_offset; | ||
3563 | exec_len = (uint32_t) exec->batch_len; | ||
3564 | |||
3565 | trace_i915_gem_request_submit(dev, dev_priv->mm.next_gem_seqno + 1); | ||
3566 | |||
3567 | count = nbox ? nbox : 1; | ||
3568 | |||
3569 | for (i = 0; i < count; i++) { | ||
3570 | if (i < nbox) { | ||
3571 | int ret = i915_emit_box(dev, cliprects, i, | ||
3572 | exec->DR1, exec->DR4); | ||
3573 | if (ret) | ||
3574 | return ret; | ||
3575 | } | ||
3576 | |||
3577 | if (IS_I830(dev) || IS_845G(dev)) { | ||
3578 | BEGIN_LP_RING(4); | ||
3579 | OUT_RING(MI_BATCH_BUFFER); | ||
3580 | OUT_RING(exec_start | MI_BATCH_NON_SECURE); | ||
3581 | OUT_RING(exec_start + exec_len - 4); | ||
3582 | OUT_RING(0); | ||
3583 | ADVANCE_LP_RING(); | ||
3584 | } else { | ||
3585 | BEGIN_LP_RING(2); | ||
3586 | if (IS_I965G(dev)) { | ||
3587 | OUT_RING(MI_BATCH_BUFFER_START | | ||
3588 | (2 << 6) | | ||
3589 | MI_BATCH_NON_SECURE_I965); | ||
3590 | OUT_RING(exec_start); | ||
3591 | } else { | ||
3592 | OUT_RING(MI_BATCH_BUFFER_START | | ||
3593 | (2 << 6)); | ||
3594 | OUT_RING(exec_start | MI_BATCH_NON_SECURE); | ||
3595 | } | ||
3596 | ADVANCE_LP_RING(); | ||
3597 | } | ||
3598 | } | ||
3599 | |||
3600 | /* XXX breadcrumb */ | ||
3601 | return 0; | ||
3602 | } | ||
3603 | |||
3604 | /* Throttle our rendering by waiting until the ring has completed our requests | 3481 | /* Throttle our rendering by waiting until the ring has completed our requests |
3605 | * emitted over 20 msec ago. | 3482 | * emitted over 20 msec ago. |
3606 | * | 3483 | * |
@@ -3629,7 +3506,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file_priv) | |||
3629 | if (time_after_eq(request->emitted_jiffies, recent_enough)) | 3506 | if (time_after_eq(request->emitted_jiffies, recent_enough)) |
3630 | break; | 3507 | break; |
3631 | 3508 | ||
3632 | ret = i915_wait_request(dev, request->seqno); | 3509 | ret = i915_wait_request(dev, request->seqno, request->ring); |
3633 | if (ret != 0) | 3510 | if (ret != 0) |
3634 | break; | 3511 | break; |
3635 | } | 3512 | } |
@@ -3786,10 +3663,22 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
3786 | uint32_t seqno, flush_domains, reloc_index; | 3663 | uint32_t seqno, flush_domains, reloc_index; |
3787 | int pin_tries, flips; | 3664 | int pin_tries, flips; |
3788 | 3665 | ||
3666 | struct intel_ring_buffer *ring = NULL; | ||
3667 | |||
3789 | #if WATCH_EXEC | 3668 | #if WATCH_EXEC |
3790 | DRM_INFO("buffers_ptr %d buffer_count %d len %08x\n", | 3669 | DRM_INFO("buffers_ptr %d buffer_count %d len %08x\n", |
3791 | (int) args->buffers_ptr, args->buffer_count, args->batch_len); | 3670 | (int) args->buffers_ptr, args->buffer_count, args->batch_len); |
3792 | #endif | 3671 | #endif |
3672 | if (args->flags & I915_EXEC_BSD) { | ||
3673 | if (!HAS_BSD(dev)) { | ||
3674 | DRM_ERROR("execbuf with wrong flag\n"); | ||
3675 | return -EINVAL; | ||
3676 | } | ||
3677 | ring = &dev_priv->bsd_ring; | ||
3678 | } else { | ||
3679 | ring = &dev_priv->render_ring; | ||
3680 | } | ||
3681 | |||
3793 | 3682 | ||
3794 | if (args->buffer_count < 1) { | 3683 | if (args->buffer_count < 1) { |
3795 | DRM_ERROR("execbuf with %d buffers\n", args->buffer_count); | 3684 | DRM_ERROR("execbuf with %d buffers\n", args->buffer_count); |
@@ -3902,11 +3791,19 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
3902 | if (ret != -ENOSPC || pin_tries >= 1) { | 3791 | if (ret != -ENOSPC || pin_tries >= 1) { |
3903 | if (ret != -ERESTARTSYS) { | 3792 | if (ret != -ERESTARTSYS) { |
3904 | unsigned long long total_size = 0; | 3793 | unsigned long long total_size = 0; |
3905 | for (i = 0; i < args->buffer_count; i++) | 3794 | int num_fences = 0; |
3795 | for (i = 0; i < args->buffer_count; i++) { | ||
3796 | obj_priv = object_list[i]->driver_private; | ||
3797 | |||
3906 | total_size += object_list[i]->size; | 3798 | total_size += object_list[i]->size; |
3907 | DRM_ERROR("Failed to pin buffer %d of %d, total %llu bytes: %d\n", | 3799 | num_fences += |
3800 | exec_list[i].flags & EXEC_OBJECT_NEEDS_FENCE && | ||
3801 | obj_priv->tiling_mode != I915_TILING_NONE; | ||
3802 | } | ||
3803 | DRM_ERROR("Failed to pin buffer %d of %d, total %llu bytes, %d fences: %d\n", | ||
3908 | pinned+1, args->buffer_count, | 3804 | pinned+1, args->buffer_count, |
3909 | total_size, ret); | 3805 | total_size, num_fences, |
3806 | ret); | ||
3910 | DRM_ERROR("%d objects [%d pinned], " | 3807 | DRM_ERROR("%d objects [%d pinned], " |
3911 | "%d object bytes [%d pinned], " | 3808 | "%d object bytes [%d pinned], " |
3912 | "%d/%d gtt bytes\n", | 3809 | "%d/%d gtt bytes\n", |
@@ -3976,9 +3873,16 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
3976 | i915_gem_flush(dev, | 3873 | i915_gem_flush(dev, |
3977 | dev->invalidate_domains, | 3874 | dev->invalidate_domains, |
3978 | dev->flush_domains); | 3875 | dev->flush_domains); |
3979 | if (dev->flush_domains & I915_GEM_GPU_DOMAINS) | 3876 | if (dev->flush_domains & I915_GEM_GPU_DOMAINS) { |
3980 | (void)i915_add_request(dev, file_priv, | 3877 | (void)i915_add_request(dev, file_priv, |
3981 | dev->flush_domains); | 3878 | dev->flush_domains, |
3879 | &dev_priv->render_ring); | ||
3880 | |||
3881 | if (HAS_BSD(dev)) | ||
3882 | (void)i915_add_request(dev, file_priv, | ||
3883 | dev->flush_domains, | ||
3884 | &dev_priv->bsd_ring); | ||
3885 | } | ||
3982 | } | 3886 | } |
3983 | 3887 | ||
3984 | for (i = 0; i < args->buffer_count; i++) { | 3888 | for (i = 0; i < args->buffer_count; i++) { |
@@ -4015,7 +3919,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
4015 | #endif | 3919 | #endif |
4016 | 3920 | ||
4017 | /* Exec the batchbuffer */ | 3921 | /* Exec the batchbuffer */ |
4018 | ret = i915_dispatch_gem_execbuffer(dev, args, cliprects, exec_offset); | 3922 | ret = ring->dispatch_gem_execbuffer(dev, ring, args, |
3923 | cliprects, exec_offset); | ||
4019 | if (ret) { | 3924 | if (ret) { |
4020 | DRM_ERROR("dispatch failed %d\n", ret); | 3925 | DRM_ERROR("dispatch failed %d\n", ret); |
4021 | goto err; | 3926 | goto err; |
@@ -4025,7 +3930,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
4025 | * Ensure that the commands in the batch buffer are | 3930 | * Ensure that the commands in the batch buffer are |
4026 | * finished before the interrupt fires | 3931 | * finished before the interrupt fires |
4027 | */ | 3932 | */ |
4028 | flush_domains = i915_retire_commands(dev); | 3933 | flush_domains = i915_retire_commands(dev, ring); |
4029 | 3934 | ||
4030 | i915_verify_inactive(dev, __FILE__, __LINE__); | 3935 | i915_verify_inactive(dev, __FILE__, __LINE__); |
4031 | 3936 | ||
@@ -4036,12 +3941,13 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
4036 | * *some* interrupts representing completion of buffers that we can | 3941 | * *some* interrupts representing completion of buffers that we can |
4037 | * wait on when trying to clear up gtt space). | 3942 | * wait on when trying to clear up gtt space). |
4038 | */ | 3943 | */ |
4039 | seqno = i915_add_request(dev, file_priv, flush_domains); | 3944 | seqno = i915_add_request(dev, file_priv, flush_domains, ring); |
4040 | BUG_ON(seqno == 0); | 3945 | BUG_ON(seqno == 0); |
4041 | for (i = 0; i < args->buffer_count; i++) { | 3946 | for (i = 0; i < args->buffer_count; i++) { |
4042 | struct drm_gem_object *obj = object_list[i]; | 3947 | struct drm_gem_object *obj = object_list[i]; |
3948 | obj_priv = to_intel_bo(obj); | ||
4043 | 3949 | ||
4044 | i915_gem_object_move_to_active(obj, seqno); | 3950 | i915_gem_object_move_to_active(obj, seqno, ring); |
4045 | #if WATCH_LRU | 3951 | #if WATCH_LRU |
4046 | DRM_INFO("%s: move to exec list %p\n", __func__, obj); | 3952 | DRM_INFO("%s: move to exec list %p\n", __func__, obj); |
4047 | #endif | 3953 | #endif |
@@ -4153,7 +4059,7 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, | |||
4153 | exec2.DR4 = args->DR4; | 4059 | exec2.DR4 = args->DR4; |
4154 | exec2.num_cliprects = args->num_cliprects; | 4060 | exec2.num_cliprects = args->num_cliprects; |
4155 | exec2.cliprects_ptr = args->cliprects_ptr; | 4061 | exec2.cliprects_ptr = args->cliprects_ptr; |
4156 | exec2.flags = 0; | 4062 | exec2.flags = I915_EXEC_RENDER; |
4157 | 4063 | ||
4158 | ret = i915_gem_do_execbuffer(dev, data, file_priv, &exec2, exec2_list); | 4064 | ret = i915_gem_do_execbuffer(dev, data, file_priv, &exec2, exec2_list); |
4159 | if (!ret) { | 4065 | if (!ret) { |
@@ -4239,7 +4145,20 @@ i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment) | |||
4239 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | 4145 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); |
4240 | int ret; | 4146 | int ret; |
4241 | 4147 | ||
4148 | BUG_ON(obj_priv->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT); | ||
4149 | |||
4242 | i915_verify_inactive(dev, __FILE__, __LINE__); | 4150 | i915_verify_inactive(dev, __FILE__, __LINE__); |
4151 | |||
4152 | if (obj_priv->gtt_space != NULL) { | ||
4153 | if (alignment == 0) | ||
4154 | alignment = i915_gem_get_gtt_alignment(obj); | ||
4155 | if (obj_priv->gtt_offset & (alignment - 1)) { | ||
4156 | ret = i915_gem_object_unbind(obj); | ||
4157 | if (ret) | ||
4158 | return ret; | ||
4159 | } | ||
4160 | } | ||
4161 | |||
4243 | if (obj_priv->gtt_space == NULL) { | 4162 | if (obj_priv->gtt_space == NULL) { |
4244 | ret = i915_gem_object_bind_to_gtt(obj, alignment); | 4163 | ret = i915_gem_object_bind_to_gtt(obj, alignment); |
4245 | if (ret) | 4164 | if (ret) |
@@ -4392,6 +4311,7 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data, | |||
4392 | struct drm_i915_gem_busy *args = data; | 4311 | struct drm_i915_gem_busy *args = data; |
4393 | struct drm_gem_object *obj; | 4312 | struct drm_gem_object *obj; |
4394 | struct drm_i915_gem_object *obj_priv; | 4313 | struct drm_i915_gem_object *obj_priv; |
4314 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
4395 | 4315 | ||
4396 | obj = drm_gem_object_lookup(dev, file_priv, args->handle); | 4316 | obj = drm_gem_object_lookup(dev, file_priv, args->handle); |
4397 | if (obj == NULL) { | 4317 | if (obj == NULL) { |
@@ -4406,7 +4326,10 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data, | |||
4406 | * actually unmasked, and our working set ends up being larger than | 4326 | * actually unmasked, and our working set ends up being larger than |
4407 | * required. | 4327 | * required. |
4408 | */ | 4328 | */ |
4409 | i915_gem_retire_requests(dev); | 4329 | i915_gem_retire_requests(dev, &dev_priv->render_ring); |
4330 | |||
4331 | if (HAS_BSD(dev)) | ||
4332 | i915_gem_retire_requests(dev, &dev_priv->bsd_ring); | ||
4410 | 4333 | ||
4411 | obj_priv = to_intel_bo(obj); | 4334 | obj_priv = to_intel_bo(obj); |
4412 | /* Don't count being on the flushing list against the object being | 4335 | /* Don't count being on the flushing list against the object being |
@@ -4573,7 +4496,10 @@ i915_gem_idle(struct drm_device *dev) | |||
4573 | 4496 | ||
4574 | mutex_lock(&dev->struct_mutex); | 4497 | mutex_lock(&dev->struct_mutex); |
4575 | 4498 | ||
4576 | if (dev_priv->mm.suspended || dev_priv->ring.ring_obj == NULL) { | 4499 | if (dev_priv->mm.suspended || |
4500 | (dev_priv->render_ring.gem_object == NULL) || | ||
4501 | (HAS_BSD(dev) && | ||
4502 | dev_priv->bsd_ring.gem_object == NULL)) { | ||
4577 | mutex_unlock(&dev->struct_mutex); | 4503 | mutex_unlock(&dev->struct_mutex); |
4578 | return 0; | 4504 | return 0; |
4579 | } | 4505 | } |
@@ -4654,71 +4580,6 @@ err: | |||
4654 | return ret; | 4580 | return ret; |
4655 | } | 4581 | } |
4656 | 4582 | ||
4657 | static int | ||
4658 | i915_gem_init_hws(struct drm_device *dev) | ||
4659 | { | ||
4660 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
4661 | struct drm_gem_object *obj; | ||
4662 | struct drm_i915_gem_object *obj_priv; | ||
4663 | int ret; | ||
4664 | |||
4665 | /* If we need a physical address for the status page, it's already | ||
4666 | * initialized at driver load time. | ||
4667 | */ | ||
4668 | if (!I915_NEED_GFX_HWS(dev)) | ||
4669 | return 0; | ||
4670 | |||
4671 | obj = i915_gem_alloc_object(dev, 4096); | ||
4672 | if (obj == NULL) { | ||
4673 | DRM_ERROR("Failed to allocate status page\n"); | ||
4674 | ret = -ENOMEM; | ||
4675 | goto err; | ||
4676 | } | ||
4677 | obj_priv = to_intel_bo(obj); | ||
4678 | obj_priv->agp_type = AGP_USER_CACHED_MEMORY; | ||
4679 | |||
4680 | ret = i915_gem_object_pin(obj, 4096); | ||
4681 | if (ret != 0) { | ||
4682 | drm_gem_object_unreference(obj); | ||
4683 | goto err_unref; | ||
4684 | } | ||
4685 | |||
4686 | dev_priv->status_gfx_addr = obj_priv->gtt_offset; | ||
4687 | |||
4688 | dev_priv->hw_status_page = kmap(obj_priv->pages[0]); | ||
4689 | if (dev_priv->hw_status_page == NULL) { | ||
4690 | DRM_ERROR("Failed to map status page.\n"); | ||
4691 | memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); | ||
4692 | ret = -EINVAL; | ||
4693 | goto err_unpin; | ||
4694 | } | ||
4695 | |||
4696 | if (HAS_PIPE_CONTROL(dev)) { | ||
4697 | ret = i915_gem_init_pipe_control(dev); | ||
4698 | if (ret) | ||
4699 | goto err_unpin; | ||
4700 | } | ||
4701 | |||
4702 | dev_priv->hws_obj = obj; | ||
4703 | memset(dev_priv->hw_status_page, 0, PAGE_SIZE); | ||
4704 | if (IS_GEN6(dev)) { | ||
4705 | I915_WRITE(HWS_PGA_GEN6, dev_priv->status_gfx_addr); | ||
4706 | I915_READ(HWS_PGA_GEN6); /* posting read */ | ||
4707 | } else { | ||
4708 | I915_WRITE(HWS_PGA, dev_priv->status_gfx_addr); | ||
4709 | I915_READ(HWS_PGA); /* posting read */ | ||
4710 | } | ||
4711 | DRM_DEBUG_DRIVER("hws offset: 0x%08x\n", dev_priv->status_gfx_addr); | ||
4712 | |||
4713 | return 0; | ||
4714 | |||
4715 | err_unpin: | ||
4716 | i915_gem_object_unpin(obj); | ||
4717 | err_unref: | ||
4718 | drm_gem_object_unreference(obj); | ||
4719 | err: | ||
4720 | return 0; | ||
4721 | } | ||
4722 | 4583 | ||
4723 | static void | 4584 | static void |
4724 | i915_gem_cleanup_pipe_control(struct drm_device *dev) | 4585 | i915_gem_cleanup_pipe_control(struct drm_device *dev) |
@@ -4737,146 +4598,46 @@ i915_gem_cleanup_pipe_control(struct drm_device *dev) | |||
4737 | dev_priv->seqno_page = NULL; | 4598 | dev_priv->seqno_page = NULL; |
4738 | } | 4599 | } |
4739 | 4600 | ||
4740 | static void | ||
4741 | i915_gem_cleanup_hws(struct drm_device *dev) | ||
4742 | { | ||
4743 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
4744 | struct drm_gem_object *obj; | ||
4745 | struct drm_i915_gem_object *obj_priv; | ||
4746 | |||
4747 | if (dev_priv->hws_obj == NULL) | ||
4748 | return; | ||
4749 | |||
4750 | obj = dev_priv->hws_obj; | ||
4751 | obj_priv = to_intel_bo(obj); | ||
4752 | |||
4753 | kunmap(obj_priv->pages[0]); | ||
4754 | i915_gem_object_unpin(obj); | ||
4755 | drm_gem_object_unreference(obj); | ||
4756 | dev_priv->hws_obj = NULL; | ||
4757 | |||
4758 | memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); | ||
4759 | dev_priv->hw_status_page = NULL; | ||
4760 | |||
4761 | if (HAS_PIPE_CONTROL(dev)) | ||
4762 | i915_gem_cleanup_pipe_control(dev); | ||
4763 | |||
4764 | /* Write high address into HWS_PGA when disabling. */ | ||
4765 | I915_WRITE(HWS_PGA, 0x1ffff000); | ||
4766 | } | ||
4767 | |||
4768 | int | 4601 | int |
4769 | i915_gem_init_ringbuffer(struct drm_device *dev) | 4602 | i915_gem_init_ringbuffer(struct drm_device *dev) |
4770 | { | 4603 | { |
4771 | drm_i915_private_t *dev_priv = dev->dev_private; | 4604 | drm_i915_private_t *dev_priv = dev->dev_private; |
4772 | struct drm_gem_object *obj; | ||
4773 | struct drm_i915_gem_object *obj_priv; | ||
4774 | drm_i915_ring_buffer_t *ring = &dev_priv->ring; | ||
4775 | int ret; | 4605 | int ret; |
4776 | u32 head; | ||
4777 | |||
4778 | ret = i915_gem_init_hws(dev); | ||
4779 | if (ret != 0) | ||
4780 | return ret; | ||
4781 | 4606 | ||
4782 | obj = i915_gem_alloc_object(dev, 128 * 1024); | 4607 | dev_priv->render_ring = render_ring; |
4783 | if (obj == NULL) { | ||
4784 | DRM_ERROR("Failed to allocate ringbuffer\n"); | ||
4785 | i915_gem_cleanup_hws(dev); | ||
4786 | return -ENOMEM; | ||
4787 | } | ||
4788 | obj_priv = to_intel_bo(obj); | ||
4789 | 4608 | ||
4790 | ret = i915_gem_object_pin(obj, 4096); | 4609 | if (!I915_NEED_GFX_HWS(dev)) { |
4791 | if (ret != 0) { | 4610 | dev_priv->render_ring.status_page.page_addr |
4792 | drm_gem_object_unreference(obj); | 4611 | = dev_priv->status_page_dmah->vaddr; |
4793 | i915_gem_cleanup_hws(dev); | 4612 | memset(dev_priv->render_ring.status_page.page_addr, |
4794 | return ret; | 4613 | 0, PAGE_SIZE); |
4795 | } | 4614 | } |
4796 | 4615 | ||
4797 | /* Set up the kernel mapping for the ring. */ | 4616 | if (HAS_PIPE_CONTROL(dev)) { |
4798 | ring->Size = obj->size; | 4617 | ret = i915_gem_init_pipe_control(dev); |
4799 | 4618 | if (ret) | |
4800 | ring->map.offset = dev->agp->base + obj_priv->gtt_offset; | 4619 | return ret; |
4801 | ring->map.size = obj->size; | ||
4802 | ring->map.type = 0; | ||
4803 | ring->map.flags = 0; | ||
4804 | ring->map.mtrr = 0; | ||
4805 | |||
4806 | drm_core_ioremap_wc(&ring->map, dev); | ||
4807 | if (ring->map.handle == NULL) { | ||
4808 | DRM_ERROR("Failed to map ringbuffer.\n"); | ||
4809 | memset(&dev_priv->ring, 0, sizeof(dev_priv->ring)); | ||
4810 | i915_gem_object_unpin(obj); | ||
4811 | drm_gem_object_unreference(obj); | ||
4812 | i915_gem_cleanup_hws(dev); | ||
4813 | return -EINVAL; | ||
4814 | } | ||
4815 | ring->ring_obj = obj; | ||
4816 | ring->virtual_start = ring->map.handle; | ||
4817 | |||
4818 | /* Stop the ring if it's running. */ | ||
4819 | I915_WRITE(PRB0_CTL, 0); | ||
4820 | I915_WRITE(PRB0_TAIL, 0); | ||
4821 | I915_WRITE(PRB0_HEAD, 0); | ||
4822 | |||
4823 | /* Initialize the ring. */ | ||
4824 | I915_WRITE(PRB0_START, obj_priv->gtt_offset); | ||
4825 | head = I915_READ(PRB0_HEAD) & HEAD_ADDR; | ||
4826 | |||
4827 | /* G45 ring initialization fails to reset head to zero */ | ||
4828 | if (head != 0) { | ||
4829 | DRM_ERROR("Ring head not reset to zero " | ||
4830 | "ctl %08x head %08x tail %08x start %08x\n", | ||
4831 | I915_READ(PRB0_CTL), | ||
4832 | I915_READ(PRB0_HEAD), | ||
4833 | I915_READ(PRB0_TAIL), | ||
4834 | I915_READ(PRB0_START)); | ||
4835 | I915_WRITE(PRB0_HEAD, 0); | ||
4836 | |||
4837 | DRM_ERROR("Ring head forced to zero " | ||
4838 | "ctl %08x head %08x tail %08x start %08x\n", | ||
4839 | I915_READ(PRB0_CTL), | ||
4840 | I915_READ(PRB0_HEAD), | ||
4841 | I915_READ(PRB0_TAIL), | ||
4842 | I915_READ(PRB0_START)); | ||
4843 | } | ||
4844 | |||
4845 | I915_WRITE(PRB0_CTL, | ||
4846 | ((obj->size - 4096) & RING_NR_PAGES) | | ||
4847 | RING_NO_REPORT | | ||
4848 | RING_VALID); | ||
4849 | |||
4850 | head = I915_READ(PRB0_HEAD) & HEAD_ADDR; | ||
4851 | |||
4852 | /* If the head is still not zero, the ring is dead */ | ||
4853 | if (head != 0) { | ||
4854 | DRM_ERROR("Ring initialization failed " | ||
4855 | "ctl %08x head %08x tail %08x start %08x\n", | ||
4856 | I915_READ(PRB0_CTL), | ||
4857 | I915_READ(PRB0_HEAD), | ||
4858 | I915_READ(PRB0_TAIL), | ||
4859 | I915_READ(PRB0_START)); | ||
4860 | return -EIO; | ||
4861 | } | 4620 | } |
4862 | 4621 | ||
4863 | /* Update our cache of the ring state */ | 4622 | ret = intel_init_ring_buffer(dev, &dev_priv->render_ring); |
4864 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | 4623 | if (ret) |
4865 | i915_kernel_lost_context(dev); | 4624 | goto cleanup_pipe_control; |
4866 | else { | ||
4867 | ring->head = I915_READ(PRB0_HEAD) & HEAD_ADDR; | ||
4868 | ring->tail = I915_READ(PRB0_TAIL) & TAIL_ADDR; | ||
4869 | ring->space = ring->head - (ring->tail + 8); | ||
4870 | if (ring->space < 0) | ||
4871 | ring->space += ring->Size; | ||
4872 | } | ||
4873 | 4625 | ||
4874 | if (IS_I9XX(dev) && !IS_GEN3(dev)) { | 4626 | if (HAS_BSD(dev)) { |
4875 | I915_WRITE(MI_MODE, | 4627 | dev_priv->bsd_ring = bsd_ring; |
4876 | (VS_TIMER_DISPATCH) << 16 | VS_TIMER_DISPATCH); | 4628 | ret = intel_init_ring_buffer(dev, &dev_priv->bsd_ring); |
4629 | if (ret) | ||
4630 | goto cleanup_render_ring; | ||
4877 | } | 4631 | } |
4878 | 4632 | ||
4879 | return 0; | 4633 | return 0; |
4634 | |||
4635 | cleanup_render_ring: | ||
4636 | intel_cleanup_ring_buffer(dev, &dev_priv->render_ring); | ||
4637 | cleanup_pipe_control: | ||
4638 | if (HAS_PIPE_CONTROL(dev)) | ||
4639 | i915_gem_cleanup_pipe_control(dev); | ||
4640 | return ret; | ||
4880 | } | 4641 | } |
4881 | 4642 | ||
4882 | void | 4643 | void |
@@ -4884,17 +4645,11 @@ i915_gem_cleanup_ringbuffer(struct drm_device *dev) | |||
4884 | { | 4645 | { |
4885 | drm_i915_private_t *dev_priv = dev->dev_private; | 4646 | drm_i915_private_t *dev_priv = dev->dev_private; |
4886 | 4647 | ||
4887 | if (dev_priv->ring.ring_obj == NULL) | 4648 | intel_cleanup_ring_buffer(dev, &dev_priv->render_ring); |
4888 | return; | 4649 | if (HAS_BSD(dev)) |
4889 | 4650 | intel_cleanup_ring_buffer(dev, &dev_priv->bsd_ring); | |
4890 | drm_core_ioremapfree(&dev_priv->ring.map, dev); | 4651 | if (HAS_PIPE_CONTROL(dev)) |
4891 | 4652 | i915_gem_cleanup_pipe_control(dev); | |
4892 | i915_gem_object_unpin(dev_priv->ring.ring_obj); | ||
4893 | drm_gem_object_unreference(dev_priv->ring.ring_obj); | ||
4894 | dev_priv->ring.ring_obj = NULL; | ||
4895 | memset(&dev_priv->ring, 0, sizeof(dev_priv->ring)); | ||
4896 | |||
4897 | i915_gem_cleanup_hws(dev); | ||
4898 | } | 4653 | } |
4899 | 4654 | ||
4900 | int | 4655 | int |
@@ -4922,12 +4677,14 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data, | |||
4922 | } | 4677 | } |
4923 | 4678 | ||
4924 | spin_lock(&dev_priv->mm.active_list_lock); | 4679 | spin_lock(&dev_priv->mm.active_list_lock); |
4925 | BUG_ON(!list_empty(&dev_priv->mm.active_list)); | 4680 | BUG_ON(!list_empty(&dev_priv->render_ring.active_list)); |
4681 | BUG_ON(HAS_BSD(dev) && !list_empty(&dev_priv->bsd_ring.active_list)); | ||
4926 | spin_unlock(&dev_priv->mm.active_list_lock); | 4682 | spin_unlock(&dev_priv->mm.active_list_lock); |
4927 | 4683 | ||
4928 | BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); | 4684 | BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); |
4929 | BUG_ON(!list_empty(&dev_priv->mm.inactive_list)); | 4685 | BUG_ON(!list_empty(&dev_priv->mm.inactive_list)); |
4930 | BUG_ON(!list_empty(&dev_priv->mm.request_list)); | 4686 | BUG_ON(!list_empty(&dev_priv->render_ring.request_list)); |
4687 | BUG_ON(HAS_BSD(dev) && !list_empty(&dev_priv->bsd_ring.request_list)); | ||
4931 | mutex_unlock(&dev->struct_mutex); | 4688 | mutex_unlock(&dev->struct_mutex); |
4932 | 4689 | ||
4933 | drm_irq_install(dev); | 4690 | drm_irq_install(dev); |
@@ -4966,18 +4723,20 @@ i915_gem_load(struct drm_device *dev) | |||
4966 | drm_i915_private_t *dev_priv = dev->dev_private; | 4723 | drm_i915_private_t *dev_priv = dev->dev_private; |
4967 | 4724 | ||
4968 | spin_lock_init(&dev_priv->mm.active_list_lock); | 4725 | spin_lock_init(&dev_priv->mm.active_list_lock); |
4969 | INIT_LIST_HEAD(&dev_priv->mm.active_list); | ||
4970 | INIT_LIST_HEAD(&dev_priv->mm.flushing_list); | 4726 | INIT_LIST_HEAD(&dev_priv->mm.flushing_list); |
4971 | INIT_LIST_HEAD(&dev_priv->mm.gpu_write_list); | 4727 | INIT_LIST_HEAD(&dev_priv->mm.gpu_write_list); |
4972 | INIT_LIST_HEAD(&dev_priv->mm.inactive_list); | 4728 | INIT_LIST_HEAD(&dev_priv->mm.inactive_list); |
4973 | INIT_LIST_HEAD(&dev_priv->mm.request_list); | ||
4974 | INIT_LIST_HEAD(&dev_priv->mm.fence_list); | 4729 | INIT_LIST_HEAD(&dev_priv->mm.fence_list); |
4730 | INIT_LIST_HEAD(&dev_priv->render_ring.active_list); | ||
4731 | INIT_LIST_HEAD(&dev_priv->render_ring.request_list); | ||
4732 | if (HAS_BSD(dev)) { | ||
4733 | INIT_LIST_HEAD(&dev_priv->bsd_ring.active_list); | ||
4734 | INIT_LIST_HEAD(&dev_priv->bsd_ring.request_list); | ||
4735 | } | ||
4975 | for (i = 0; i < 16; i++) | 4736 | for (i = 0; i < 16; i++) |
4976 | INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list); | 4737 | INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list); |
4977 | INIT_DELAYED_WORK(&dev_priv->mm.retire_work, | 4738 | INIT_DELAYED_WORK(&dev_priv->mm.retire_work, |
4978 | i915_gem_retire_work_handler); | 4739 | i915_gem_retire_work_handler); |
4979 | dev_priv->mm.next_gem_seqno = 1; | ||
4980 | |||
4981 | spin_lock(&shrink_list_lock); | 4740 | spin_lock(&shrink_list_lock); |
4982 | list_add(&dev_priv->mm.shrink_list, &shrink_list); | 4741 | list_add(&dev_priv->mm.shrink_list, &shrink_list); |
4983 | spin_unlock(&shrink_list_lock); | 4742 | spin_unlock(&shrink_list_lock); |
@@ -5209,7 +4968,9 @@ i915_gpu_is_active(struct drm_device *dev) | |||
5209 | 4968 | ||
5210 | spin_lock(&dev_priv->mm.active_list_lock); | 4969 | spin_lock(&dev_priv->mm.active_list_lock); |
5211 | lists_empty = list_empty(&dev_priv->mm.flushing_list) && | 4970 | lists_empty = list_empty(&dev_priv->mm.flushing_list) && |
5212 | list_empty(&dev_priv->mm.active_list); | 4971 | list_empty(&dev_priv->render_ring.active_list); |
4972 | if (HAS_BSD(dev)) | ||
4973 | lists_empty &= list_empty(&dev_priv->bsd_ring.active_list); | ||
5213 | spin_unlock(&dev_priv->mm.active_list_lock); | 4974 | spin_unlock(&dev_priv->mm.active_list_lock); |
5214 | 4975 | ||
5215 | return !lists_empty; | 4976 | return !lists_empty; |
@@ -5254,8 +5015,10 @@ rescan: | |||
5254 | continue; | 5015 | continue; |
5255 | 5016 | ||
5256 | spin_unlock(&shrink_list_lock); | 5017 | spin_unlock(&shrink_list_lock); |
5018 | i915_gem_retire_requests(dev, &dev_priv->render_ring); | ||
5257 | 5019 | ||
5258 | i915_gem_retire_requests(dev); | 5020 | if (HAS_BSD(dev)) |
5021 | i915_gem_retire_requests(dev, &dev_priv->bsd_ring); | ||
5259 | 5022 | ||
5260 | list_for_each_entry_safe(obj_priv, next_obj, | 5023 | list_for_each_entry_safe(obj_priv, next_obj, |
5261 | &dev_priv->mm.inactive_list, | 5024 | &dev_priv->mm.inactive_list, |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 8c3f0802686d..2479be001e40 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -53,7 +53,7 @@ | |||
53 | I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT) | 53 | I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT) |
54 | 54 | ||
55 | /** Interrupts that we mask and unmask at runtime. */ | 55 | /** Interrupts that we mask and unmask at runtime. */ |
56 | #define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT) | 56 | #define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT | I915_BSD_USER_INTERRUPT) |
57 | 57 | ||
58 | #define I915_PIPE_VBLANK_STATUS (PIPE_START_VBLANK_INTERRUPT_STATUS |\ | 58 | #define I915_PIPE_VBLANK_STATUS (PIPE_START_VBLANK_INTERRUPT_STATUS |\ |
59 | PIPE_VBLANK_INTERRUPT_STATUS) | 59 | PIPE_VBLANK_INTERRUPT_STATUS) |
@@ -74,7 +74,7 @@ ironlake_enable_graphics_irq(drm_i915_private_t *dev_priv, u32 mask) | |||
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | static inline void | 77 | void |
78 | ironlake_disable_graphics_irq(drm_i915_private_t *dev_priv, u32 mask) | 78 | ironlake_disable_graphics_irq(drm_i915_private_t *dev_priv, u32 mask) |
79 | { | 79 | { |
80 | if ((dev_priv->gt_irq_mask_reg & mask) != mask) { | 80 | if ((dev_priv->gt_irq_mask_reg & mask) != mask) { |
@@ -115,7 +115,7 @@ i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask) | |||
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | static inline void | 118 | void |
119 | i915_disable_irq(drm_i915_private_t *dev_priv, u32 mask) | 119 | i915_disable_irq(drm_i915_private_t *dev_priv, u32 mask) |
120 | { | 120 | { |
121 | if ((dev_priv->irq_mask_reg & mask) != mask) { | 121 | if ((dev_priv->irq_mask_reg & mask) != mask) { |
@@ -278,10 +278,9 @@ static void i915_handle_rps_change(struct drm_device *dev) | |||
278 | { | 278 | { |
279 | drm_i915_private_t *dev_priv = dev->dev_private; | 279 | drm_i915_private_t *dev_priv = dev->dev_private; |
280 | u32 busy_up, busy_down, max_avg, min_avg; | 280 | u32 busy_up, busy_down, max_avg, min_avg; |
281 | u16 rgvswctl; | ||
282 | u8 new_delay = dev_priv->cur_delay; | 281 | u8 new_delay = dev_priv->cur_delay; |
283 | 282 | ||
284 | I915_WRITE(MEMINTRSTS, I915_READ(MEMINTRSTS) & ~MEMINT_EVAL_CHG); | 283 | I915_WRITE16(MEMINTRSTS, MEMINT_EVAL_CHG); |
285 | busy_up = I915_READ(RCPREVBSYTUPAVG); | 284 | busy_up = I915_READ(RCPREVBSYTUPAVG); |
286 | busy_down = I915_READ(RCPREVBSYTDNAVG); | 285 | busy_down = I915_READ(RCPREVBSYTDNAVG); |
287 | max_avg = I915_READ(RCBMAXAVG); | 286 | max_avg = I915_READ(RCBMAXAVG); |
@@ -300,27 +299,8 @@ static void i915_handle_rps_change(struct drm_device *dev) | |||
300 | new_delay = dev_priv->min_delay; | 299 | new_delay = dev_priv->min_delay; |
301 | } | 300 | } |
302 | 301 | ||
303 | DRM_DEBUG("rps change requested: %d -> %d\n", | 302 | if (ironlake_set_drps(dev, new_delay)) |
304 | dev_priv->cur_delay, new_delay); | 303 | dev_priv->cur_delay = new_delay; |
305 | |||
306 | rgvswctl = I915_READ(MEMSWCTL); | ||
307 | if (rgvswctl & MEMCTL_CMD_STS) { | ||
308 | DRM_ERROR("gpu busy, RCS change rejected\n"); | ||
309 | return; /* still busy with another command */ | ||
310 | } | ||
311 | |||
312 | /* Program the new state */ | ||
313 | rgvswctl = (MEMCTL_CMD_CHFREQ << MEMCTL_CMD_SHIFT) | | ||
314 | (new_delay << MEMCTL_FREQ_SHIFT) | MEMCTL_SFCAVM; | ||
315 | I915_WRITE(MEMSWCTL, rgvswctl); | ||
316 | POSTING_READ(MEMSWCTL); | ||
317 | |||
318 | rgvswctl |= MEMCTL_CMD_STS; | ||
319 | I915_WRITE(MEMSWCTL, rgvswctl); | ||
320 | |||
321 | dev_priv->cur_delay = new_delay; | ||
322 | |||
323 | DRM_DEBUG("rps changed\n"); | ||
324 | 304 | ||
325 | return; | 305 | return; |
326 | } | 306 | } |
@@ -331,6 +311,7 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
331 | int ret = IRQ_NONE; | 311 | int ret = IRQ_NONE; |
332 | u32 de_iir, gt_iir, de_ier, pch_iir; | 312 | u32 de_iir, gt_iir, de_ier, pch_iir; |
333 | struct drm_i915_master_private *master_priv; | 313 | struct drm_i915_master_private *master_priv; |
314 | struct intel_ring_buffer *render_ring = &dev_priv->render_ring; | ||
334 | 315 | ||
335 | /* disable master interrupt before clearing iir */ | 316 | /* disable master interrupt before clearing iir */ |
336 | de_ier = I915_READ(DEIER); | 317 | de_ier = I915_READ(DEIER); |
@@ -354,13 +335,16 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
354 | } | 335 | } |
355 | 336 | ||
356 | if (gt_iir & GT_PIPE_NOTIFY) { | 337 | if (gt_iir & GT_PIPE_NOTIFY) { |
357 | u32 seqno = i915_get_gem_seqno(dev); | 338 | u32 seqno = render_ring->get_gem_seqno(dev, render_ring); |
358 | dev_priv->mm.irq_gem_seqno = seqno; | 339 | render_ring->irq_gem_seqno = seqno; |
359 | trace_i915_gem_request_complete(dev, seqno); | 340 | trace_i915_gem_request_complete(dev, seqno); |
360 | DRM_WAKEUP(&dev_priv->irq_queue); | 341 | DRM_WAKEUP(&dev_priv->render_ring.irq_queue); |
361 | dev_priv->hangcheck_count = 0; | 342 | dev_priv->hangcheck_count = 0; |
362 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); | 343 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); |
363 | } | 344 | } |
345 | if (gt_iir & GT_BSD_USER_INTERRUPT) | ||
346 | DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue); | ||
347 | |||
364 | 348 | ||
365 | if (de_iir & DE_GSE) | 349 | if (de_iir & DE_GSE) |
366 | ironlake_opregion_gse_intr(dev); | 350 | ironlake_opregion_gse_intr(dev); |
@@ -388,7 +372,7 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev) | |||
388 | } | 372 | } |
389 | 373 | ||
390 | if (de_iir & DE_PCU_EVENT) { | 374 | if (de_iir & DE_PCU_EVENT) { |
391 | I915_WRITE(MEMINTRSTS, I915_READ(MEMINTRSTS)); | 375 | I915_WRITE16(MEMINTRSTS, I915_READ(MEMINTRSTS)); |
392 | i915_handle_rps_change(dev); | 376 | i915_handle_rps_change(dev); |
393 | } | 377 | } |
394 | 378 | ||
@@ -536,17 +520,18 @@ i915_ringbuffer_last_batch(struct drm_device *dev) | |||
536 | */ | 520 | */ |
537 | bbaddr = 0; | 521 | bbaddr = 0; |
538 | head = I915_READ(PRB0_HEAD) & HEAD_ADDR; | 522 | head = I915_READ(PRB0_HEAD) & HEAD_ADDR; |
539 | ring = (u32 *)(dev_priv->ring.virtual_start + head); | 523 | ring = (u32 *)(dev_priv->render_ring.virtual_start + head); |
540 | 524 | ||
541 | while (--ring >= (u32 *)dev_priv->ring.virtual_start) { | 525 | while (--ring >= (u32 *)dev_priv->render_ring.virtual_start) { |
542 | bbaddr = i915_get_bbaddr(dev, ring); | 526 | bbaddr = i915_get_bbaddr(dev, ring); |
543 | if (bbaddr) | 527 | if (bbaddr) |
544 | break; | 528 | break; |
545 | } | 529 | } |
546 | 530 | ||
547 | if (bbaddr == 0) { | 531 | if (bbaddr == 0) { |
548 | ring = (u32 *)(dev_priv->ring.virtual_start + dev_priv->ring.Size); | 532 | ring = (u32 *)(dev_priv->render_ring.virtual_start |
549 | while (--ring >= (u32 *)dev_priv->ring.virtual_start) { | 533 | + dev_priv->render_ring.size); |
534 | while (--ring >= (u32 *)dev_priv->render_ring.virtual_start) { | ||
550 | bbaddr = i915_get_bbaddr(dev, ring); | 535 | bbaddr = i915_get_bbaddr(dev, ring); |
551 | if (bbaddr) | 536 | if (bbaddr) |
552 | break; | 537 | break; |
@@ -587,7 +572,7 @@ static void i915_capture_error_state(struct drm_device *dev) | |||
587 | return; | 572 | return; |
588 | } | 573 | } |
589 | 574 | ||
590 | error->seqno = i915_get_gem_seqno(dev); | 575 | error->seqno = i915_get_gem_seqno(dev, &dev_priv->render_ring); |
591 | error->eir = I915_READ(EIR); | 576 | error->eir = I915_READ(EIR); |
592 | error->pgtbl_er = I915_READ(PGTBL_ER); | 577 | error->pgtbl_er = I915_READ(PGTBL_ER); |
593 | error->pipeastat = I915_READ(PIPEASTAT); | 578 | error->pipeastat = I915_READ(PIPEASTAT); |
@@ -615,7 +600,9 @@ static void i915_capture_error_state(struct drm_device *dev) | |||
615 | batchbuffer[0] = NULL; | 600 | batchbuffer[0] = NULL; |
616 | batchbuffer[1] = NULL; | 601 | batchbuffer[1] = NULL; |
617 | count = 0; | 602 | count = 0; |
618 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { | 603 | list_for_each_entry(obj_priv, |
604 | &dev_priv->render_ring.active_list, list) { | ||
605 | |||
619 | struct drm_gem_object *obj = &obj_priv->base; | 606 | struct drm_gem_object *obj = &obj_priv->base; |
620 | 607 | ||
621 | if (batchbuffer[0] == NULL && | 608 | if (batchbuffer[0] == NULL && |
@@ -639,7 +626,8 @@ static void i915_capture_error_state(struct drm_device *dev) | |||
639 | error->batchbuffer[1] = i915_error_object_create(dev, batchbuffer[1]); | 626 | error->batchbuffer[1] = i915_error_object_create(dev, batchbuffer[1]); |
640 | 627 | ||
641 | /* Record the ringbuffer */ | 628 | /* Record the ringbuffer */ |
642 | error->ringbuffer = i915_error_object_create(dev, dev_priv->ring.ring_obj); | 629 | error->ringbuffer = i915_error_object_create(dev, |
630 | dev_priv->render_ring.gem_object); | ||
643 | 631 | ||
644 | /* Record buffers on the active list. */ | 632 | /* Record buffers on the active list. */ |
645 | error->active_bo = NULL; | 633 | error->active_bo = NULL; |
@@ -651,7 +639,8 @@ static void i915_capture_error_state(struct drm_device *dev) | |||
651 | 639 | ||
652 | if (error->active_bo) { | 640 | if (error->active_bo) { |
653 | int i = 0; | 641 | int i = 0; |
654 | list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { | 642 | list_for_each_entry(obj_priv, |
643 | &dev_priv->render_ring.active_list, list) { | ||
655 | struct drm_gem_object *obj = &obj_priv->base; | 644 | struct drm_gem_object *obj = &obj_priv->base; |
656 | 645 | ||
657 | error->active_bo[i].size = obj->size; | 646 | error->active_bo[i].size = obj->size; |
@@ -703,24 +692,13 @@ void i915_destroy_error_state(struct drm_device *dev) | |||
703 | i915_error_state_free(dev, error); | 692 | i915_error_state_free(dev, error); |
704 | } | 693 | } |
705 | 694 | ||
706 | /** | 695 | static void i915_report_and_clear_eir(struct drm_device *dev) |
707 | * i915_handle_error - handle an error interrupt | ||
708 | * @dev: drm device | ||
709 | * | ||
710 | * Do some basic checking of regsiter state at error interrupt time and | ||
711 | * dump it to the syslog. Also call i915_capture_error_state() to make | ||
712 | * sure we get a record and make it available in debugfs. Fire a uevent | ||
713 | * so userspace knows something bad happened (should trigger collection | ||
714 | * of a ring dump etc.). | ||
715 | */ | ||
716 | static void i915_handle_error(struct drm_device *dev, bool wedged) | ||
717 | { | 696 | { |
718 | struct drm_i915_private *dev_priv = dev->dev_private; | 697 | struct drm_i915_private *dev_priv = dev->dev_private; |
719 | u32 eir = I915_READ(EIR); | 698 | u32 eir = I915_READ(EIR); |
720 | u32 pipea_stats = I915_READ(PIPEASTAT); | ||
721 | u32 pipeb_stats = I915_READ(PIPEBSTAT); | ||
722 | 699 | ||
723 | i915_capture_error_state(dev); | 700 | if (!eir) |
701 | return; | ||
724 | 702 | ||
725 | printk(KERN_ERR "render error detected, EIR: 0x%08x\n", | 703 | printk(KERN_ERR "render error detected, EIR: 0x%08x\n", |
726 | eir); | 704 | eir); |
@@ -766,6 +744,9 @@ static void i915_handle_error(struct drm_device *dev, bool wedged) | |||
766 | } | 744 | } |
767 | 745 | ||
768 | if (eir & I915_ERROR_MEMORY_REFRESH) { | 746 | if (eir & I915_ERROR_MEMORY_REFRESH) { |
747 | u32 pipea_stats = I915_READ(PIPEASTAT); | ||
748 | u32 pipeb_stats = I915_READ(PIPEBSTAT); | ||
749 | |||
769 | printk(KERN_ERR "memory refresh error\n"); | 750 | printk(KERN_ERR "memory refresh error\n"); |
770 | printk(KERN_ERR "PIPEASTAT: 0x%08x\n", | 751 | printk(KERN_ERR "PIPEASTAT: 0x%08x\n", |
771 | pipea_stats); | 752 | pipea_stats); |
@@ -822,6 +803,24 @@ static void i915_handle_error(struct drm_device *dev, bool wedged) | |||
822 | I915_WRITE(EMR, I915_READ(EMR) | eir); | 803 | I915_WRITE(EMR, I915_READ(EMR) | eir); |
823 | I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); | 804 | I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); |
824 | } | 805 | } |
806 | } | ||
807 | |||
808 | /** | ||
809 | * i915_handle_error - handle an error interrupt | ||
810 | * @dev: drm device | ||
811 | * | ||
812 | * Do some basic checking of regsiter state at error interrupt time and | ||
813 | * dump it to the syslog. Also call i915_capture_error_state() to make | ||
814 | * sure we get a record and make it available in debugfs. Fire a uevent | ||
815 | * so userspace knows something bad happened (should trigger collection | ||
816 | * of a ring dump etc.). | ||
817 | */ | ||
818 | static void i915_handle_error(struct drm_device *dev, bool wedged) | ||
819 | { | ||
820 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
821 | |||
822 | i915_capture_error_state(dev); | ||
823 | i915_report_and_clear_eir(dev); | ||
825 | 824 | ||
826 | if (wedged) { | 825 | if (wedged) { |
827 | atomic_set(&dev_priv->mm.wedged, 1); | 826 | atomic_set(&dev_priv->mm.wedged, 1); |
@@ -829,7 +828,7 @@ static void i915_handle_error(struct drm_device *dev, bool wedged) | |||
829 | /* | 828 | /* |
830 | * Wakeup waiting processes so they don't hang | 829 | * Wakeup waiting processes so they don't hang |
831 | */ | 830 | */ |
832 | DRM_WAKEUP(&dev_priv->irq_queue); | 831 | DRM_WAKEUP(&dev_priv->render_ring.irq_queue); |
833 | } | 832 | } |
834 | 833 | ||
835 | queue_work(dev_priv->wq, &dev_priv->error_work); | 834 | queue_work(dev_priv->wq, &dev_priv->error_work); |
@@ -848,6 +847,7 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | |||
848 | unsigned long irqflags; | 847 | unsigned long irqflags; |
849 | int irq_received; | 848 | int irq_received; |
850 | int ret = IRQ_NONE; | 849 | int ret = IRQ_NONE; |
850 | struct intel_ring_buffer *render_ring = &dev_priv->render_ring; | ||
851 | 851 | ||
852 | atomic_inc(&dev_priv->irq_received); | 852 | atomic_inc(&dev_priv->irq_received); |
853 | 853 | ||
@@ -928,14 +928,18 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | |||
928 | } | 928 | } |
929 | 929 | ||
930 | if (iir & I915_USER_INTERRUPT) { | 930 | if (iir & I915_USER_INTERRUPT) { |
931 | u32 seqno = i915_get_gem_seqno(dev); | 931 | u32 seqno = |
932 | dev_priv->mm.irq_gem_seqno = seqno; | 932 | render_ring->get_gem_seqno(dev, render_ring); |
933 | render_ring->irq_gem_seqno = seqno; | ||
933 | trace_i915_gem_request_complete(dev, seqno); | 934 | trace_i915_gem_request_complete(dev, seqno); |
934 | DRM_WAKEUP(&dev_priv->irq_queue); | 935 | DRM_WAKEUP(&dev_priv->render_ring.irq_queue); |
935 | dev_priv->hangcheck_count = 0; | 936 | dev_priv->hangcheck_count = 0; |
936 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); | 937 | mod_timer(&dev_priv->hangcheck_timer, jiffies + DRM_I915_HANGCHECK_PERIOD); |
937 | } | 938 | } |
938 | 939 | ||
940 | if (HAS_BSD(dev) && (iir & I915_BSD_USER_INTERRUPT)) | ||
941 | DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue); | ||
942 | |||
939 | if (iir & I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT) | 943 | if (iir & I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT) |
940 | intel_prepare_page_flip(dev, 0); | 944 | intel_prepare_page_flip(dev, 0); |
941 | 945 | ||
@@ -984,7 +988,6 @@ static int i915_emit_irq(struct drm_device * dev) | |||
984 | { | 988 | { |
985 | drm_i915_private_t *dev_priv = dev->dev_private; | 989 | drm_i915_private_t *dev_priv = dev->dev_private; |
986 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | 990 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; |
987 | RING_LOCALS; | ||
988 | 991 | ||
989 | i915_kernel_lost_context(dev); | 992 | i915_kernel_lost_context(dev); |
990 | 993 | ||
@@ -1006,43 +1009,13 @@ static int i915_emit_irq(struct drm_device * dev) | |||
1006 | return dev_priv->counter; | 1009 | return dev_priv->counter; |
1007 | } | 1010 | } |
1008 | 1011 | ||
1009 | void i915_user_irq_get(struct drm_device *dev) | ||
1010 | { | ||
1011 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
1012 | unsigned long irqflags; | ||
1013 | |||
1014 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); | ||
1015 | if (dev->irq_enabled && (++dev_priv->user_irq_refcount == 1)) { | ||
1016 | if (HAS_PCH_SPLIT(dev)) | ||
1017 | ironlake_enable_graphics_irq(dev_priv, GT_PIPE_NOTIFY); | ||
1018 | else | ||
1019 | i915_enable_irq(dev_priv, I915_USER_INTERRUPT); | ||
1020 | } | ||
1021 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | ||
1022 | } | ||
1023 | |||
1024 | void i915_user_irq_put(struct drm_device *dev) | ||
1025 | { | ||
1026 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
1027 | unsigned long irqflags; | ||
1028 | |||
1029 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); | ||
1030 | BUG_ON(dev->irq_enabled && dev_priv->user_irq_refcount <= 0); | ||
1031 | if (dev->irq_enabled && (--dev_priv->user_irq_refcount == 0)) { | ||
1032 | if (HAS_PCH_SPLIT(dev)) | ||
1033 | ironlake_disable_graphics_irq(dev_priv, GT_PIPE_NOTIFY); | ||
1034 | else | ||
1035 | i915_disable_irq(dev_priv, I915_USER_INTERRUPT); | ||
1036 | } | ||
1037 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | ||
1038 | } | ||
1039 | |||
1040 | void i915_trace_irq_get(struct drm_device *dev, u32 seqno) | 1012 | void i915_trace_irq_get(struct drm_device *dev, u32 seqno) |
1041 | { | 1013 | { |
1042 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1014 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1015 | struct intel_ring_buffer *render_ring = &dev_priv->render_ring; | ||
1043 | 1016 | ||
1044 | if (dev_priv->trace_irq_seqno == 0) | 1017 | if (dev_priv->trace_irq_seqno == 0) |
1045 | i915_user_irq_get(dev); | 1018 | render_ring->user_irq_get(dev, render_ring); |
1046 | 1019 | ||
1047 | dev_priv->trace_irq_seqno = seqno; | 1020 | dev_priv->trace_irq_seqno = seqno; |
1048 | } | 1021 | } |
@@ -1052,6 +1025,7 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr) | |||
1052 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1025 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1053 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | 1026 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; |
1054 | int ret = 0; | 1027 | int ret = 0; |
1028 | struct intel_ring_buffer *render_ring = &dev_priv->render_ring; | ||
1055 | 1029 | ||
1056 | DRM_DEBUG_DRIVER("irq_nr=%d breadcrumb=%d\n", irq_nr, | 1030 | DRM_DEBUG_DRIVER("irq_nr=%d breadcrumb=%d\n", irq_nr, |
1057 | READ_BREADCRUMB(dev_priv)); | 1031 | READ_BREADCRUMB(dev_priv)); |
@@ -1065,10 +1039,10 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr) | |||
1065 | if (master_priv->sarea_priv) | 1039 | if (master_priv->sarea_priv) |
1066 | master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; | 1040 | master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; |
1067 | 1041 | ||
1068 | i915_user_irq_get(dev); | 1042 | render_ring->user_irq_get(dev, render_ring); |
1069 | DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ, | 1043 | DRM_WAIT_ON(ret, dev_priv->render_ring.irq_queue, 3 * DRM_HZ, |
1070 | READ_BREADCRUMB(dev_priv) >= irq_nr); | 1044 | READ_BREADCRUMB(dev_priv) >= irq_nr); |
1071 | i915_user_irq_put(dev); | 1045 | render_ring->user_irq_put(dev, render_ring); |
1072 | 1046 | ||
1073 | if (ret == -EBUSY) { | 1047 | if (ret == -EBUSY) { |
1074 | DRM_ERROR("EBUSY -- rec: %d emitted: %d\n", | 1048 | DRM_ERROR("EBUSY -- rec: %d emitted: %d\n", |
@@ -1087,7 +1061,7 @@ int i915_irq_emit(struct drm_device *dev, void *data, | |||
1087 | drm_i915_irq_emit_t *emit = data; | 1061 | drm_i915_irq_emit_t *emit = data; |
1088 | int result; | 1062 | int result; |
1089 | 1063 | ||
1090 | if (!dev_priv || !dev_priv->ring.virtual_start) { | 1064 | if (!dev_priv || !dev_priv->render_ring.virtual_start) { |
1091 | DRM_ERROR("called with no initialization\n"); | 1065 | DRM_ERROR("called with no initialization\n"); |
1092 | return -EINVAL; | 1066 | return -EINVAL; |
1093 | } | 1067 | } |
@@ -1233,9 +1207,12 @@ int i915_vblank_swap(struct drm_device *dev, void *data, | |||
1233 | return -EINVAL; | 1207 | return -EINVAL; |
1234 | } | 1208 | } |
1235 | 1209 | ||
1236 | struct drm_i915_gem_request *i915_get_tail_request(struct drm_device *dev) { | 1210 | struct drm_i915_gem_request * |
1211 | i915_get_tail_request(struct drm_device *dev) | ||
1212 | { | ||
1237 | drm_i915_private_t *dev_priv = dev->dev_private; | 1213 | drm_i915_private_t *dev_priv = dev->dev_private; |
1238 | return list_entry(dev_priv->mm.request_list.prev, struct drm_i915_gem_request, list); | 1214 | return list_entry(dev_priv->render_ring.request_list.prev, |
1215 | struct drm_i915_gem_request, list); | ||
1239 | } | 1216 | } |
1240 | 1217 | ||
1241 | /** | 1218 | /** |
@@ -1260,8 +1237,10 @@ void i915_hangcheck_elapsed(unsigned long data) | |||
1260 | acthd = I915_READ(ACTHD_I965); | 1237 | acthd = I915_READ(ACTHD_I965); |
1261 | 1238 | ||
1262 | /* If all work is done then ACTHD clearly hasn't advanced. */ | 1239 | /* If all work is done then ACTHD clearly hasn't advanced. */ |
1263 | if (list_empty(&dev_priv->mm.request_list) || | 1240 | if (list_empty(&dev_priv->render_ring.request_list) || |
1264 | i915_seqno_passed(i915_get_gem_seqno(dev), i915_get_tail_request(dev)->seqno)) { | 1241 | i915_seqno_passed(i915_get_gem_seqno(dev, |
1242 | &dev_priv->render_ring), | ||
1243 | i915_get_tail_request(dev)->seqno)) { | ||
1265 | dev_priv->hangcheck_count = 0; | 1244 | dev_priv->hangcheck_count = 0; |
1266 | return; | 1245 | return; |
1267 | } | 1246 | } |
@@ -1314,7 +1293,7 @@ static int ironlake_irq_postinstall(struct drm_device *dev) | |||
1314 | /* enable kind of interrupts always enabled */ | 1293 | /* enable kind of interrupts always enabled */ |
1315 | u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT | | 1294 | u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT | |
1316 | DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE; | 1295 | DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE; |
1317 | u32 render_mask = GT_PIPE_NOTIFY; | 1296 | u32 render_mask = GT_PIPE_NOTIFY | GT_BSD_USER_INTERRUPT; |
1318 | u32 hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | | 1297 | u32 hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | |
1319 | SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG; | 1298 | SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG; |
1320 | 1299 | ||
@@ -1328,7 +1307,7 @@ static int ironlake_irq_postinstall(struct drm_device *dev) | |||
1328 | (void) I915_READ(DEIER); | 1307 | (void) I915_READ(DEIER); |
1329 | 1308 | ||
1330 | /* user interrupt should be enabled, but masked initial */ | 1309 | /* user interrupt should be enabled, but masked initial */ |
1331 | dev_priv->gt_irq_mask_reg = 0xffffffff; | 1310 | dev_priv->gt_irq_mask_reg = ~render_mask; |
1332 | dev_priv->gt_irq_enable_reg = render_mask; | 1311 | dev_priv->gt_irq_enable_reg = render_mask; |
1333 | 1312 | ||
1334 | I915_WRITE(GTIIR, I915_READ(GTIIR)); | 1313 | I915_WRITE(GTIIR, I915_READ(GTIIR)); |
@@ -1391,7 +1370,10 @@ int i915_driver_irq_postinstall(struct drm_device *dev) | |||
1391 | u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR; | 1370 | u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR; |
1392 | u32 error_mask; | 1371 | u32 error_mask; |
1393 | 1372 | ||
1394 | DRM_INIT_WAITQUEUE(&dev_priv->irq_queue); | 1373 | DRM_INIT_WAITQUEUE(&dev_priv->render_ring.irq_queue); |
1374 | |||
1375 | if (HAS_BSD(dev)) | ||
1376 | DRM_INIT_WAITQUEUE(&dev_priv->bsd_ring.irq_queue); | ||
1395 | 1377 | ||
1396 | dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; | 1378 | dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; |
1397 | 1379 | ||
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index f3e39cc46f0d..64b0a3afd92b 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -334,6 +334,7 @@ | |||
334 | #define I915_DEBUG_INTERRUPT (1<<2) | 334 | #define I915_DEBUG_INTERRUPT (1<<2) |
335 | #define I915_USER_INTERRUPT (1<<1) | 335 | #define I915_USER_INTERRUPT (1<<1) |
336 | #define I915_ASLE_INTERRUPT (1<<0) | 336 | #define I915_ASLE_INTERRUPT (1<<0) |
337 | #define I915_BSD_USER_INTERRUPT (1<<25) | ||
337 | #define EIR 0x020b0 | 338 | #define EIR 0x020b0 |
338 | #define EMR 0x020b4 | 339 | #define EMR 0x020b4 |
339 | #define ESR 0x020b8 | 340 | #define ESR 0x020b8 |
@@ -368,6 +369,36 @@ | |||
368 | #define BB_ADDR 0x02140 /* 8 bytes */ | 369 | #define BB_ADDR 0x02140 /* 8 bytes */ |
369 | #define GFX_FLSH_CNTL 0x02170 /* 915+ only */ | 370 | #define GFX_FLSH_CNTL 0x02170 /* 915+ only */ |
370 | 371 | ||
372 | /* GEN6 interrupt control */ | ||
373 | #define GEN6_RENDER_HWSTAM 0x2098 | ||
374 | #define GEN6_RENDER_IMR 0x20a8 | ||
375 | #define GEN6_RENDER_CONTEXT_SWITCH_INTERRUPT (1 << 8) | ||
376 | #define GEN6_RENDER_PPGTT_PAGE_FAULT (1 << 7) | ||
377 | #define GEN6_RENDER TIMEOUT_COUNTER_EXPIRED (1 << 6) | ||
378 | #define GEN6_RENDER_L3_PARITY_ERROR (1 << 5) | ||
379 | #define GEN6_RENDER_PIPE_CONTROL_NOTIFY_INTERRUPT (1 << 4) | ||
380 | #define GEN6_RENDER_COMMAND_PARSER_MASTER_ERROR (1 << 3) | ||
381 | #define GEN6_RENDER_SYNC_STATUS (1 << 2) | ||
382 | #define GEN6_RENDER_DEBUG_INTERRUPT (1 << 1) | ||
383 | #define GEN6_RENDER_USER_INTERRUPT (1 << 0) | ||
384 | |||
385 | #define GEN6_BLITTER_HWSTAM 0x22098 | ||
386 | #define GEN6_BLITTER_IMR 0x220a8 | ||
387 | #define GEN6_BLITTER_MI_FLUSH_DW_NOTIFY_INTERRUPT (1 << 26) | ||
388 | #define GEN6_BLITTER_COMMAND_PARSER_MASTER_ERROR (1 << 25) | ||
389 | #define GEN6_BLITTER_SYNC_STATUS (1 << 24) | ||
390 | #define GEN6_BLITTER_USER_INTERRUPT (1 << 22) | ||
391 | /* | ||
392 | * BSD (bit stream decoder instruction and interrupt control register defines | ||
393 | * (G4X and Ironlake only) | ||
394 | */ | ||
395 | |||
396 | #define BSD_RING_TAIL 0x04030 | ||
397 | #define BSD_RING_HEAD 0x04034 | ||
398 | #define BSD_RING_START 0x04038 | ||
399 | #define BSD_RING_CTL 0x0403c | ||
400 | #define BSD_RING_ACTHD 0x04074 | ||
401 | #define BSD_HWS_PGA 0x04080 | ||
371 | 402 | ||
372 | /* | 403 | /* |
373 | * Framebuffer compression (915+ only) | 404 | * Framebuffer compression (915+ only) |
@@ -805,6 +836,10 @@ | |||
805 | #define DCC_CHANNEL_XOR_DISABLE (1 << 10) | 836 | #define DCC_CHANNEL_XOR_DISABLE (1 << 10) |
806 | #define DCC_CHANNEL_XOR_BIT_17 (1 << 9) | 837 | #define DCC_CHANNEL_XOR_BIT_17 (1 << 9) |
807 | 838 | ||
839 | /** Pineview MCH register contains DDR3 setting */ | ||
840 | #define CSHRDDR3CTL 0x101a8 | ||
841 | #define CSHRDDR3CTL_DDR3 (1 << 2) | ||
842 | |||
808 | /** 965 MCH register controlling DRAM channel configuration */ | 843 | /** 965 MCH register controlling DRAM channel configuration */ |
809 | #define C0DRB3 0x10206 | 844 | #define C0DRB3 0x10206 |
810 | #define C1DRB3 0x10606 | 845 | #define C1DRB3 0x10606 |
@@ -826,6 +861,12 @@ | |||
826 | #define CLKCFG_MEM_800 (3 << 4) | 861 | #define CLKCFG_MEM_800 (3 << 4) |
827 | #define CLKCFG_MEM_MASK (7 << 4) | 862 | #define CLKCFG_MEM_MASK (7 << 4) |
828 | 863 | ||
864 | #define TR1 0x11006 | ||
865 | #define TSFS 0x11020 | ||
866 | #define TSFS_SLOPE_MASK 0x0000ff00 | ||
867 | #define TSFS_SLOPE_SHIFT 8 | ||
868 | #define TSFS_INTR_MASK 0x000000ff | ||
869 | |||
829 | #define CRSTANDVID 0x11100 | 870 | #define CRSTANDVID 0x11100 |
830 | #define PXVFREQ_BASE 0x11110 /* P[0-15]VIDFREQ (0x1114c) (Ironlake) */ | 871 | #define PXVFREQ_BASE 0x11110 /* P[0-15]VIDFREQ (0x1114c) (Ironlake) */ |
831 | #define PXVFREQ_PX_MASK 0x7f000000 | 872 | #define PXVFREQ_PX_MASK 0x7f000000 |
@@ -964,6 +1005,41 @@ | |||
964 | #define MEMSTAT_SRC_CTL_STDBY 3 | 1005 | #define MEMSTAT_SRC_CTL_STDBY 3 |
965 | #define RCPREVBSYTUPAVG 0x113b8 | 1006 | #define RCPREVBSYTUPAVG 0x113b8 |
966 | #define RCPREVBSYTDNAVG 0x113bc | 1007 | #define RCPREVBSYTDNAVG 0x113bc |
1008 | #define SDEW 0x1124c | ||
1009 | #define CSIEW0 0x11250 | ||
1010 | #define CSIEW1 0x11254 | ||
1011 | #define CSIEW2 0x11258 | ||
1012 | #define PEW 0x1125c | ||
1013 | #define DEW 0x11270 | ||
1014 | #define MCHAFE 0x112c0 | ||
1015 | #define CSIEC 0x112e0 | ||
1016 | #define DMIEC 0x112e4 | ||
1017 | #define DDREC 0x112e8 | ||
1018 | #define PEG0EC 0x112ec | ||
1019 | #define PEG1EC 0x112f0 | ||
1020 | #define GFXEC 0x112f4 | ||
1021 | #define RPPREVBSYTUPAVG 0x113b8 | ||
1022 | #define RPPREVBSYTDNAVG 0x113bc | ||
1023 | #define ECR 0x11600 | ||
1024 | #define ECR_GPFE (1<<31) | ||
1025 | #define ECR_IMONE (1<<30) | ||
1026 | #define ECR_CAP_MASK 0x0000001f /* Event range, 0-31 */ | ||
1027 | #define OGW0 0x11608 | ||
1028 | #define OGW1 0x1160c | ||
1029 | #define EG0 0x11610 | ||
1030 | #define EG1 0x11614 | ||
1031 | #define EG2 0x11618 | ||
1032 | #define EG3 0x1161c | ||
1033 | #define EG4 0x11620 | ||
1034 | #define EG5 0x11624 | ||
1035 | #define EG6 0x11628 | ||
1036 | #define EG7 0x1162c | ||
1037 | #define PXW 0x11664 | ||
1038 | #define PXWL 0x11680 | ||
1039 | #define LCFUSE02 0x116c0 | ||
1040 | #define LCFUSE_HIV_MASK 0x000000ff | ||
1041 | #define CSIPLL0 0x12c10 | ||
1042 | #define DDRMPLL1 0X12c20 | ||
967 | #define PEG_BAND_GAP_DATA 0x14d68 | 1043 | #define PEG_BAND_GAP_DATA 0x14d68 |
968 | 1044 | ||
969 | /* | 1045 | /* |
@@ -1055,7 +1131,6 @@ | |||
1055 | #define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2) | 1131 | #define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2) |
1056 | #define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2) | 1132 | #define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2) |
1057 | #define CRT_HOTPLUG_MASK (0x3fc) /* Bits 9-2 */ | 1133 | #define CRT_HOTPLUG_MASK (0x3fc) /* Bits 9-2 */ |
1058 | #define CRT_FORCE_HOTPLUG_MASK 0xfffffe1f | ||
1059 | 1134 | ||
1060 | #define PORT_HOTPLUG_STAT 0x61114 | 1135 | #define PORT_HOTPLUG_STAT 0x61114 |
1061 | #define HDMIB_HOTPLUG_INT_STATUS (1 << 29) | 1136 | #define HDMIB_HOTPLUG_INT_STATUS (1 << 29) |
@@ -2355,6 +2430,8 @@ | |||
2355 | #define GT_PIPE_NOTIFY (1 << 4) | 2430 | #define GT_PIPE_NOTIFY (1 << 4) |
2356 | #define GT_SYNC_STATUS (1 << 2) | 2431 | #define GT_SYNC_STATUS (1 << 2) |
2357 | #define GT_USER_INTERRUPT (1 << 0) | 2432 | #define GT_USER_INTERRUPT (1 << 0) |
2433 | #define GT_BSD_USER_INTERRUPT (1 << 5) | ||
2434 | |||
2358 | 2435 | ||
2359 | #define GTISR 0x44010 | 2436 | #define GTISR 0x44010 |
2360 | #define GTIMR 0x44014 | 2437 | #define GTIMR 0x44014 |
@@ -2690,6 +2767,9 @@ | |||
2690 | #define SDVO_ENCODING (0) | 2767 | #define SDVO_ENCODING (0) |
2691 | #define TMDS_ENCODING (2 << 10) | 2768 | #define TMDS_ENCODING (2 << 10) |
2692 | #define NULL_PACKET_VSYNC_ENABLE (1 << 9) | 2769 | #define NULL_PACKET_VSYNC_ENABLE (1 << 9) |
2770 | /* CPT */ | ||
2771 | #define HDMI_MODE_SELECT (1 << 9) | ||
2772 | #define DVI_MODE_SELECT (0) | ||
2693 | #define SDVOB_BORDER_ENABLE (1 << 7) | 2773 | #define SDVOB_BORDER_ENABLE (1 << 7) |
2694 | #define AUDIO_ENABLE (1 << 6) | 2774 | #define AUDIO_ENABLE (1 << 6) |
2695 | #define VSYNC_ACTIVE_HIGH (1 << 4) | 2775 | #define VSYNC_ACTIVE_HIGH (1 << 4) |
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index 9e4c45f68d6e..fab21760dd57 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h | |||
@@ -53,23 +53,6 @@ TRACE_EVENT(i915_gem_object_bind, | |||
53 | __entry->obj, __entry->gtt_offset) | 53 | __entry->obj, __entry->gtt_offset) |
54 | ); | 54 | ); |
55 | 55 | ||
56 | TRACE_EVENT(i915_gem_object_clflush, | ||
57 | |||
58 | TP_PROTO(struct drm_gem_object *obj), | ||
59 | |||
60 | TP_ARGS(obj), | ||
61 | |||
62 | TP_STRUCT__entry( | ||
63 | __field(struct drm_gem_object *, obj) | ||
64 | ), | ||
65 | |||
66 | TP_fast_assign( | ||
67 | __entry->obj = obj; | ||
68 | ), | ||
69 | |||
70 | TP_printk("obj=%p", __entry->obj) | ||
71 | ); | ||
72 | |||
73 | TRACE_EVENT(i915_gem_object_change_domain, | 56 | TRACE_EVENT(i915_gem_object_change_domain, |
74 | 57 | ||
75 | TP_PROTO(struct drm_gem_object *obj, uint32_t old_read_domains, uint32_t old_write_domain), | 58 | TP_PROTO(struct drm_gem_object *obj, uint32_t old_read_domains, uint32_t old_write_domain), |
@@ -132,6 +115,13 @@ DECLARE_EVENT_CLASS(i915_gem_object, | |||
132 | TP_printk("obj=%p", __entry->obj) | 115 | TP_printk("obj=%p", __entry->obj) |
133 | ); | 116 | ); |
134 | 117 | ||
118 | DEFINE_EVENT(i915_gem_object, i915_gem_object_clflush, | ||
119 | |||
120 | TP_PROTO(struct drm_gem_object *obj), | ||
121 | |||
122 | TP_ARGS(obj) | ||
123 | ); | ||
124 | |||
135 | DEFINE_EVENT(i915_gem_object, i915_gem_object_unbind, | 125 | DEFINE_EVENT(i915_gem_object, i915_gem_object_unbind, |
136 | 126 | ||
137 | TP_PROTO(struct drm_gem_object *obj), | 127 | TP_PROTO(struct drm_gem_object *obj), |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 4c748d8f73d6..96f75d7f6633 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -95,6 +95,16 @@ fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode, | |||
95 | panel_fixed_mode->clock = dvo_timing->clock * 10; | 95 | panel_fixed_mode->clock = dvo_timing->clock * 10; |
96 | panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED; | 96 | panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED; |
97 | 97 | ||
98 | if (dvo_timing->hsync_positive) | ||
99 | panel_fixed_mode->flags |= DRM_MODE_FLAG_PHSYNC; | ||
100 | else | ||
101 | panel_fixed_mode->flags |= DRM_MODE_FLAG_NHSYNC; | ||
102 | |||
103 | if (dvo_timing->vsync_positive) | ||
104 | panel_fixed_mode->flags |= DRM_MODE_FLAG_PVSYNC; | ||
105 | else | ||
106 | panel_fixed_mode->flags |= DRM_MODE_FLAG_NVSYNC; | ||
107 | |||
98 | /* Some VBTs have bogus h/vtotal values */ | 108 | /* Some VBTs have bogus h/vtotal values */ |
99 | if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal) | 109 | if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal) |
100 | panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1; | 110 | panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1; |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index e16ac5a28c3c..22ff38455731 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -217,7 +217,8 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
217 | { | 217 | { |
218 | struct drm_device *dev = connector->dev; | 218 | struct drm_device *dev = connector->dev; |
219 | struct drm_i915_private *dev_priv = dev->dev_private; | 219 | struct drm_i915_private *dev_priv = dev->dev_private; |
220 | u32 hotplug_en; | 220 | u32 hotplug_en, orig, stat; |
221 | bool ret = false; | ||
221 | int i, tries = 0; | 222 | int i, tries = 0; |
222 | 223 | ||
223 | if (HAS_PCH_SPLIT(dev)) | 224 | if (HAS_PCH_SPLIT(dev)) |
@@ -232,8 +233,8 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
232 | tries = 2; | 233 | tries = 2; |
233 | else | 234 | else |
234 | tries = 1; | 235 | tries = 1; |
235 | hotplug_en = I915_READ(PORT_HOTPLUG_EN); | 236 | hotplug_en = orig = I915_READ(PORT_HOTPLUG_EN); |
236 | hotplug_en &= CRT_FORCE_HOTPLUG_MASK; | 237 | hotplug_en &= CRT_HOTPLUG_MASK; |
237 | hotplug_en |= CRT_HOTPLUG_FORCE_DETECT; | 238 | hotplug_en |= CRT_HOTPLUG_FORCE_DETECT; |
238 | 239 | ||
239 | if (IS_G4X(dev)) | 240 | if (IS_G4X(dev)) |
@@ -255,11 +256,17 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector) | |||
255 | } while (time_after(timeout, jiffies)); | 256 | } while (time_after(timeout, jiffies)); |
256 | } | 257 | } |
257 | 258 | ||
258 | if ((I915_READ(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) != | 259 | stat = I915_READ(PORT_HOTPLUG_STAT); |
259 | CRT_HOTPLUG_MONITOR_NONE) | 260 | if ((stat & CRT_HOTPLUG_MONITOR_MASK) != CRT_HOTPLUG_MONITOR_NONE) |
260 | return true; | 261 | ret = true; |
262 | |||
263 | /* clear the interrupt we just generated, if any */ | ||
264 | I915_WRITE(PORT_HOTPLUG_STAT, CRT_HOTPLUG_INT_STATUS); | ||
261 | 265 | ||
262 | return false; | 266 | /* and put the bits back */ |
267 | I915_WRITE(PORT_HOTPLUG_EN, orig); | ||
268 | |||
269 | return ret; | ||
263 | } | 270 | } |
264 | 271 | ||
265 | static bool intel_crt_detect_ddc(struct drm_encoder *encoder) | 272 | static bool intel_crt_detect_ddc(struct drm_encoder *encoder) |
@@ -569,7 +576,7 @@ void intel_crt_init(struct drm_device *dev) | |||
569 | (1 << INTEL_ANALOG_CLONE_BIT) | | 576 | (1 << INTEL_ANALOG_CLONE_BIT) | |
570 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); | 577 | (1 << INTEL_SDVO_LVDS_CLONE_BIT); |
571 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1); | 578 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1); |
572 | connector->interlace_allowed = 0; | 579 | connector->interlace_allowed = 1; |
573 | connector->doublescan_allowed = 0; | 580 | connector->doublescan_allowed = 0; |
574 | 581 | ||
575 | drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs); | 582 | drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f469a84cacfd..88a1ab7c05ce 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1029,19 +1029,28 @@ static void i8xx_enable_fbc(struct drm_crtc *crtc, unsigned long interval) | |||
1029 | void i8xx_disable_fbc(struct drm_device *dev) | 1029 | void i8xx_disable_fbc(struct drm_device *dev) |
1030 | { | 1030 | { |
1031 | struct drm_i915_private *dev_priv = dev->dev_private; | 1031 | struct drm_i915_private *dev_priv = dev->dev_private; |
1032 | unsigned long timeout = jiffies + msecs_to_jiffies(1); | ||
1032 | u32 fbc_ctl; | 1033 | u32 fbc_ctl; |
1033 | 1034 | ||
1034 | if (!I915_HAS_FBC(dev)) | 1035 | if (!I915_HAS_FBC(dev)) |
1035 | return; | 1036 | return; |
1036 | 1037 | ||
1038 | if (!(I915_READ(FBC_CONTROL) & FBC_CTL_EN)) | ||
1039 | return; /* Already off, just return */ | ||
1040 | |||
1037 | /* Disable compression */ | 1041 | /* Disable compression */ |
1038 | fbc_ctl = I915_READ(FBC_CONTROL); | 1042 | fbc_ctl = I915_READ(FBC_CONTROL); |
1039 | fbc_ctl &= ~FBC_CTL_EN; | 1043 | fbc_ctl &= ~FBC_CTL_EN; |
1040 | I915_WRITE(FBC_CONTROL, fbc_ctl); | 1044 | I915_WRITE(FBC_CONTROL, fbc_ctl); |
1041 | 1045 | ||
1042 | /* Wait for compressing bit to clear */ | 1046 | /* Wait for compressing bit to clear */ |
1043 | while (I915_READ(FBC_STATUS) & FBC_STAT_COMPRESSING) | 1047 | while (I915_READ(FBC_STATUS) & FBC_STAT_COMPRESSING) { |
1044 | ; /* nothing */ | 1048 | if (time_after(jiffies, timeout)) { |
1049 | DRM_DEBUG_DRIVER("FBC idle timed out\n"); | ||
1050 | break; | ||
1051 | } | ||
1052 | ; /* do nothing */ | ||
1053 | } | ||
1045 | 1054 | ||
1046 | intel_wait_for_vblank(dev); | 1055 | intel_wait_for_vblank(dev); |
1047 | 1056 | ||
@@ -1239,10 +1248,11 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1239 | return; | 1248 | return; |
1240 | 1249 | ||
1241 | out_disable: | 1250 | out_disable: |
1242 | DRM_DEBUG_KMS("unsupported config, disabling FBC\n"); | ||
1243 | /* Multiple disables should be harmless */ | 1251 | /* Multiple disables should be harmless */ |
1244 | if (intel_fbc_enabled(dev)) | 1252 | if (intel_fbc_enabled(dev)) { |
1253 | DRM_DEBUG_KMS("unsupported config, disabling FBC\n"); | ||
1245 | intel_disable_fbc(dev); | 1254 | intel_disable_fbc(dev); |
1255 | } | ||
1246 | } | 1256 | } |
1247 | 1257 | ||
1248 | static int | 1258 | static int |
@@ -1386,7 +1396,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
1386 | Start = obj_priv->gtt_offset; | 1396 | Start = obj_priv->gtt_offset; |
1387 | Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8); | 1397 | Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8); |
1388 | 1398 | ||
1389 | DRM_DEBUG_KMS("Writing base %08lX %08lX %d %d\n", Start, Offset, x, y); | 1399 | DRM_DEBUG_KMS("Writing base %08lX %08lX %d %d %d\n", |
1400 | Start, Offset, x, y, crtc->fb->pitch); | ||
1390 | I915_WRITE(dspstride, crtc->fb->pitch); | 1401 | I915_WRITE(dspstride, crtc->fb->pitch); |
1391 | if (IS_I965G(dev)) { | 1402 | if (IS_I965G(dev)) { |
1392 | I915_WRITE(dspbase, Offset); | 1403 | I915_WRITE(dspbase, Offset); |
@@ -2345,6 +2356,8 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, | |||
2345 | if (mode->clock * 3 > 27000 * 4) | 2356 | if (mode->clock * 3 > 27000 * 4) |
2346 | return MODE_CLOCK_HIGH; | 2357 | return MODE_CLOCK_HIGH; |
2347 | } | 2358 | } |
2359 | |||
2360 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
2348 | return true; | 2361 | return true; |
2349 | } | 2362 | } |
2350 | 2363 | ||
@@ -2629,6 +2642,7 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz, | |||
2629 | 2642 | ||
2630 | struct cxsr_latency { | 2643 | struct cxsr_latency { |
2631 | int is_desktop; | 2644 | int is_desktop; |
2645 | int is_ddr3; | ||
2632 | unsigned long fsb_freq; | 2646 | unsigned long fsb_freq; |
2633 | unsigned long mem_freq; | 2647 | unsigned long mem_freq; |
2634 | unsigned long display_sr; | 2648 | unsigned long display_sr; |
@@ -2638,33 +2652,45 @@ struct cxsr_latency { | |||
2638 | }; | 2652 | }; |
2639 | 2653 | ||
2640 | static struct cxsr_latency cxsr_latency_table[] = { | 2654 | static struct cxsr_latency cxsr_latency_table[] = { |
2641 | {1, 800, 400, 3382, 33382, 3983, 33983}, /* DDR2-400 SC */ | 2655 | {1, 0, 800, 400, 3382, 33382, 3983, 33983}, /* DDR2-400 SC */ |
2642 | {1, 800, 667, 3354, 33354, 3807, 33807}, /* DDR2-667 SC */ | 2656 | {1, 0, 800, 667, 3354, 33354, 3807, 33807}, /* DDR2-667 SC */ |
2643 | {1, 800, 800, 3347, 33347, 3763, 33763}, /* DDR2-800 SC */ | 2657 | {1, 0, 800, 800, 3347, 33347, 3763, 33763}, /* DDR2-800 SC */ |
2644 | 2658 | {1, 1, 800, 667, 6420, 36420, 6873, 36873}, /* DDR3-667 SC */ | |
2645 | {1, 667, 400, 3400, 33400, 4021, 34021}, /* DDR2-400 SC */ | 2659 | {1, 1, 800, 800, 5902, 35902, 6318, 36318}, /* DDR3-800 SC */ |
2646 | {1, 667, 667, 3372, 33372, 3845, 33845}, /* DDR2-667 SC */ | 2660 | |
2647 | {1, 667, 800, 3386, 33386, 3822, 33822}, /* DDR2-800 SC */ | 2661 | {1, 0, 667, 400, 3400, 33400, 4021, 34021}, /* DDR2-400 SC */ |
2648 | 2662 | {1, 0, 667, 667, 3372, 33372, 3845, 33845}, /* DDR2-667 SC */ | |
2649 | {1, 400, 400, 3472, 33472, 4173, 34173}, /* DDR2-400 SC */ | 2663 | {1, 0, 667, 800, 3386, 33386, 3822, 33822}, /* DDR2-800 SC */ |
2650 | {1, 400, 667, 3443, 33443, 3996, 33996}, /* DDR2-667 SC */ | 2664 | {1, 1, 667, 667, 6438, 36438, 6911, 36911}, /* DDR3-667 SC */ |
2651 | {1, 400, 800, 3430, 33430, 3946, 33946}, /* DDR2-800 SC */ | 2665 | {1, 1, 667, 800, 5941, 35941, 6377, 36377}, /* DDR3-800 SC */ |
2652 | 2666 | ||
2653 | {0, 800, 400, 3438, 33438, 4065, 34065}, /* DDR2-400 SC */ | 2667 | {1, 0, 400, 400, 3472, 33472, 4173, 34173}, /* DDR2-400 SC */ |
2654 | {0, 800, 667, 3410, 33410, 3889, 33889}, /* DDR2-667 SC */ | 2668 | {1, 0, 400, 667, 3443, 33443, 3996, 33996}, /* DDR2-667 SC */ |
2655 | {0, 800, 800, 3403, 33403, 3845, 33845}, /* DDR2-800 SC */ | 2669 | {1, 0, 400, 800, 3430, 33430, 3946, 33946}, /* DDR2-800 SC */ |
2656 | 2670 | {1, 1, 400, 667, 6509, 36509, 7062, 37062}, /* DDR3-667 SC */ | |
2657 | {0, 667, 400, 3456, 33456, 4103, 34106}, /* DDR2-400 SC */ | 2671 | {1, 1, 400, 800, 5985, 35985, 6501, 36501}, /* DDR3-800 SC */ |
2658 | {0, 667, 667, 3428, 33428, 3927, 33927}, /* DDR2-667 SC */ | 2672 | |
2659 | {0, 667, 800, 3443, 33443, 3905, 33905}, /* DDR2-800 SC */ | 2673 | {0, 0, 800, 400, 3438, 33438, 4065, 34065}, /* DDR2-400 SC */ |
2660 | 2674 | {0, 0, 800, 667, 3410, 33410, 3889, 33889}, /* DDR2-667 SC */ | |
2661 | {0, 400, 400, 3528, 33528, 4255, 34255}, /* DDR2-400 SC */ | 2675 | {0, 0, 800, 800, 3403, 33403, 3845, 33845}, /* DDR2-800 SC */ |
2662 | {0, 400, 667, 3500, 33500, 4079, 34079}, /* DDR2-667 SC */ | 2676 | {0, 1, 800, 667, 6476, 36476, 6955, 36955}, /* DDR3-667 SC */ |
2663 | {0, 400, 800, 3487, 33487, 4029, 34029}, /* DDR2-800 SC */ | 2677 | {0, 1, 800, 800, 5958, 35958, 6400, 36400}, /* DDR3-800 SC */ |
2678 | |||
2679 | {0, 0, 667, 400, 3456, 33456, 4103, 34106}, /* DDR2-400 SC */ | ||
2680 | {0, 0, 667, 667, 3428, 33428, 3927, 33927}, /* DDR2-667 SC */ | ||
2681 | {0, 0, 667, 800, 3443, 33443, 3905, 33905}, /* DDR2-800 SC */ | ||
2682 | {0, 1, 667, 667, 6494, 36494, 6993, 36993}, /* DDR3-667 SC */ | ||
2683 | {0, 1, 667, 800, 5998, 35998, 6460, 36460}, /* DDR3-800 SC */ | ||
2684 | |||
2685 | {0, 0, 400, 400, 3528, 33528, 4255, 34255}, /* DDR2-400 SC */ | ||
2686 | {0, 0, 400, 667, 3500, 33500, 4079, 34079}, /* DDR2-667 SC */ | ||
2687 | {0, 0, 400, 800, 3487, 33487, 4029, 34029}, /* DDR2-800 SC */ | ||
2688 | {0, 1, 400, 667, 6566, 36566, 7145, 37145}, /* DDR3-667 SC */ | ||
2689 | {0, 1, 400, 800, 6042, 36042, 6584, 36584}, /* DDR3-800 SC */ | ||
2664 | }; | 2690 | }; |
2665 | 2691 | ||
2666 | static struct cxsr_latency *intel_get_cxsr_latency(int is_desktop, int fsb, | 2692 | static struct cxsr_latency *intel_get_cxsr_latency(int is_desktop, int is_ddr3, |
2667 | int mem) | 2693 | int fsb, int mem) |
2668 | { | 2694 | { |
2669 | int i; | 2695 | int i; |
2670 | struct cxsr_latency *latency; | 2696 | struct cxsr_latency *latency; |
@@ -2675,6 +2701,7 @@ static struct cxsr_latency *intel_get_cxsr_latency(int is_desktop, int fsb, | |||
2675 | for (i = 0; i < ARRAY_SIZE(cxsr_latency_table); i++) { | 2701 | for (i = 0; i < ARRAY_SIZE(cxsr_latency_table); i++) { |
2676 | latency = &cxsr_latency_table[i]; | 2702 | latency = &cxsr_latency_table[i]; |
2677 | if (is_desktop == latency->is_desktop && | 2703 | if (is_desktop == latency->is_desktop && |
2704 | is_ddr3 == latency->is_ddr3 && | ||
2678 | fsb == latency->fsb_freq && mem == latency->mem_freq) | 2705 | fsb == latency->fsb_freq && mem == latency->mem_freq) |
2679 | return latency; | 2706 | return latency; |
2680 | } | 2707 | } |
@@ -2789,8 +2816,8 @@ static void pineview_update_wm(struct drm_device *dev, int planea_clock, | |||
2789 | struct cxsr_latency *latency; | 2816 | struct cxsr_latency *latency; |
2790 | int sr_clock; | 2817 | int sr_clock; |
2791 | 2818 | ||
2792 | latency = intel_get_cxsr_latency(IS_PINEVIEW_G(dev), dev_priv->fsb_freq, | 2819 | latency = intel_get_cxsr_latency(IS_PINEVIEW_G(dev), dev_priv->is_ddr3, |
2793 | dev_priv->mem_freq); | 2820 | dev_priv->fsb_freq, dev_priv->mem_freq); |
2794 | if (!latency) { | 2821 | if (!latency) { |
2795 | DRM_DEBUG_KMS("Unknown FSB/MEM found, disable CxSR\n"); | 2822 | DRM_DEBUG_KMS("Unknown FSB/MEM found, disable CxSR\n"); |
2796 | pineview_disable_cxsr(dev); | 2823 | pineview_disable_cxsr(dev); |
@@ -3772,6 +3799,18 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
3772 | } | 3799 | } |
3773 | } | 3800 | } |
3774 | 3801 | ||
3802 | if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) { | ||
3803 | pipeconf |= PIPECONF_INTERLACE_W_FIELD_INDICATION; | ||
3804 | /* the chip adds 2 halflines automatically */ | ||
3805 | adjusted_mode->crtc_vdisplay -= 1; | ||
3806 | adjusted_mode->crtc_vtotal -= 1; | ||
3807 | adjusted_mode->crtc_vblank_start -= 1; | ||
3808 | adjusted_mode->crtc_vblank_end -= 1; | ||
3809 | adjusted_mode->crtc_vsync_end -= 1; | ||
3810 | adjusted_mode->crtc_vsync_start -= 1; | ||
3811 | } else | ||
3812 | pipeconf &= ~PIPECONF_INTERLACE_W_FIELD_INDICATION; /* progressive */ | ||
3813 | |||
3775 | I915_WRITE(htot_reg, (adjusted_mode->crtc_hdisplay - 1) | | 3814 | I915_WRITE(htot_reg, (adjusted_mode->crtc_hdisplay - 1) | |
3776 | ((adjusted_mode->crtc_htotal - 1) << 16)); | 3815 | ((adjusted_mode->crtc_htotal - 1) << 16)); |
3777 | I915_WRITE(hblank_reg, (adjusted_mode->crtc_hblank_start - 1) | | 3816 | I915_WRITE(hblank_reg, (adjusted_mode->crtc_hblank_start - 1) | |
@@ -4436,6 +4475,8 @@ static void intel_idle_update(struct work_struct *work) | |||
4436 | 4475 | ||
4437 | mutex_lock(&dev->struct_mutex); | 4476 | mutex_lock(&dev->struct_mutex); |
4438 | 4477 | ||
4478 | i915_update_gfx_val(dev_priv); | ||
4479 | |||
4439 | if (IS_I945G(dev) || IS_I945GM(dev)) { | 4480 | if (IS_I945G(dev) || IS_I945GM(dev)) { |
4440 | DRM_DEBUG_DRIVER("enable memory self refresh on 945\n"); | 4481 | DRM_DEBUG_DRIVER("enable memory self refresh on 945\n"); |
4441 | I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN_MASK | FW_BLC_SELF_EN); | 4482 | I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN_MASK | FW_BLC_SELF_EN); |
@@ -4564,12 +4605,6 @@ void intel_finish_page_flip(struct drm_device *dev, int pipe) | |||
4564 | spin_lock_irqsave(&dev->event_lock, flags); | 4605 | spin_lock_irqsave(&dev->event_lock, flags); |
4565 | work = intel_crtc->unpin_work; | 4606 | work = intel_crtc->unpin_work; |
4566 | if (work == NULL || !work->pending) { | 4607 | if (work == NULL || !work->pending) { |
4567 | if (work && !work->pending) { | ||
4568 | obj_priv = to_intel_bo(work->pending_flip_obj); | ||
4569 | DRM_DEBUG_DRIVER("flip finish: %p (%d) not pending?\n", | ||
4570 | obj_priv, | ||
4571 | atomic_read(&obj_priv->pending_flip)); | ||
4572 | } | ||
4573 | spin_unlock_irqrestore(&dev->event_lock, flags); | 4608 | spin_unlock_irqrestore(&dev->event_lock, flags); |
4574 | return; | 4609 | return; |
4575 | } | 4610 | } |
@@ -4629,14 +4664,11 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4629 | unsigned long flags; | 4664 | unsigned long flags; |
4630 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; | 4665 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; |
4631 | int ret, pipesrc; | 4666 | int ret, pipesrc; |
4632 | RING_LOCALS; | ||
4633 | 4667 | ||
4634 | work = kzalloc(sizeof *work, GFP_KERNEL); | 4668 | work = kzalloc(sizeof *work, GFP_KERNEL); |
4635 | if (work == NULL) | 4669 | if (work == NULL) |
4636 | return -ENOMEM; | 4670 | return -ENOMEM; |
4637 | 4671 | ||
4638 | mutex_lock(&dev->struct_mutex); | ||
4639 | |||
4640 | work->event = event; | 4672 | work->event = event; |
4641 | work->dev = crtc->dev; | 4673 | work->dev = crtc->dev; |
4642 | intel_fb = to_intel_framebuffer(crtc->fb); | 4674 | intel_fb = to_intel_framebuffer(crtc->fb); |
@@ -4646,10 +4678,10 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4646 | /* We borrow the event spin lock for protecting unpin_work */ | 4678 | /* We borrow the event spin lock for protecting unpin_work */ |
4647 | spin_lock_irqsave(&dev->event_lock, flags); | 4679 | spin_lock_irqsave(&dev->event_lock, flags); |
4648 | if (intel_crtc->unpin_work) { | 4680 | if (intel_crtc->unpin_work) { |
4649 | DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); | ||
4650 | spin_unlock_irqrestore(&dev->event_lock, flags); | 4681 | spin_unlock_irqrestore(&dev->event_lock, flags); |
4651 | kfree(work); | 4682 | kfree(work); |
4652 | mutex_unlock(&dev->struct_mutex); | 4683 | |
4684 | DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); | ||
4653 | return -EBUSY; | 4685 | return -EBUSY; |
4654 | } | 4686 | } |
4655 | intel_crtc->unpin_work = work; | 4687 | intel_crtc->unpin_work = work; |
@@ -4658,13 +4690,19 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4658 | intel_fb = to_intel_framebuffer(fb); | 4690 | intel_fb = to_intel_framebuffer(fb); |
4659 | obj = intel_fb->obj; | 4691 | obj = intel_fb->obj; |
4660 | 4692 | ||
4693 | mutex_lock(&dev->struct_mutex); | ||
4661 | ret = intel_pin_and_fence_fb_obj(dev, obj); | 4694 | ret = intel_pin_and_fence_fb_obj(dev, obj); |
4662 | if (ret != 0) { | 4695 | if (ret != 0) { |
4663 | DRM_DEBUG_DRIVER("flip queue: %p pin & fence failed\n", | ||
4664 | to_intel_bo(obj)); | ||
4665 | kfree(work); | ||
4666 | intel_crtc->unpin_work = NULL; | ||
4667 | mutex_unlock(&dev->struct_mutex); | 4696 | mutex_unlock(&dev->struct_mutex); |
4697 | |||
4698 | spin_lock_irqsave(&dev->event_lock, flags); | ||
4699 | intel_crtc->unpin_work = NULL; | ||
4700 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
4701 | |||
4702 | kfree(work); | ||
4703 | |||
4704 | DRM_DEBUG_DRIVER("flip queue: %p pin & fence failed\n", | ||
4705 | to_intel_bo(obj)); | ||
4668 | return ret; | 4706 | return ret; |
4669 | } | 4707 | } |
4670 | 4708 | ||
@@ -5023,10 +5061,32 @@ err_unref: | |||
5023 | return NULL; | 5061 | return NULL; |
5024 | } | 5062 | } |
5025 | 5063 | ||
5064 | bool ironlake_set_drps(struct drm_device *dev, u8 val) | ||
5065 | { | ||
5066 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5067 | u16 rgvswctl; | ||
5068 | |||
5069 | rgvswctl = I915_READ16(MEMSWCTL); | ||
5070 | if (rgvswctl & MEMCTL_CMD_STS) { | ||
5071 | DRM_DEBUG("gpu busy, RCS change rejected\n"); | ||
5072 | return false; /* still busy with another command */ | ||
5073 | } | ||
5074 | |||
5075 | rgvswctl = (MEMCTL_CMD_CHFREQ << MEMCTL_CMD_SHIFT) | | ||
5076 | (val << MEMCTL_FREQ_SHIFT) | MEMCTL_SFCAVM; | ||
5077 | I915_WRITE16(MEMSWCTL, rgvswctl); | ||
5078 | POSTING_READ16(MEMSWCTL); | ||
5079 | |||
5080 | rgvswctl |= MEMCTL_CMD_STS; | ||
5081 | I915_WRITE16(MEMSWCTL, rgvswctl); | ||
5082 | |||
5083 | return true; | ||
5084 | } | ||
5085 | |||
5026 | void ironlake_enable_drps(struct drm_device *dev) | 5086 | void ironlake_enable_drps(struct drm_device *dev) |
5027 | { | 5087 | { |
5028 | struct drm_i915_private *dev_priv = dev->dev_private; | 5088 | struct drm_i915_private *dev_priv = dev->dev_private; |
5029 | u32 rgvmodectl = I915_READ(MEMMODECTL), rgvswctl; | 5089 | u32 rgvmodectl = I915_READ(MEMMODECTL); |
5030 | u8 fmax, fmin, fstart, vstart; | 5090 | u8 fmax, fmin, fstart, vstart; |
5031 | int i = 0; | 5091 | int i = 0; |
5032 | 5092 | ||
@@ -5045,13 +5105,21 @@ void ironlake_enable_drps(struct drm_device *dev) | |||
5045 | fmin = (rgvmodectl & MEMMODE_FMIN_MASK); | 5105 | fmin = (rgvmodectl & MEMMODE_FMIN_MASK); |
5046 | fstart = (rgvmodectl & MEMMODE_FSTART_MASK) >> | 5106 | fstart = (rgvmodectl & MEMMODE_FSTART_MASK) >> |
5047 | MEMMODE_FSTART_SHIFT; | 5107 | MEMMODE_FSTART_SHIFT; |
5108 | fstart = fmax; | ||
5109 | |||
5048 | vstart = (I915_READ(PXVFREQ_BASE + (fstart * 4)) & PXVFREQ_PX_MASK) >> | 5110 | vstart = (I915_READ(PXVFREQ_BASE + (fstart * 4)) & PXVFREQ_PX_MASK) >> |
5049 | PXVFREQ_PX_SHIFT; | 5111 | PXVFREQ_PX_SHIFT; |
5050 | 5112 | ||
5051 | dev_priv->max_delay = fstart; /* can't go to fmax w/o IPS */ | 5113 | dev_priv->fmax = fstart; /* IPS callback will increase this */ |
5114 | dev_priv->fstart = fstart; | ||
5115 | |||
5116 | dev_priv->max_delay = fmax; | ||
5052 | dev_priv->min_delay = fmin; | 5117 | dev_priv->min_delay = fmin; |
5053 | dev_priv->cur_delay = fstart; | 5118 | dev_priv->cur_delay = fstart; |
5054 | 5119 | ||
5120 | DRM_DEBUG_DRIVER("fmax: %d, fmin: %d, fstart: %d\n", fmax, fmin, | ||
5121 | fstart); | ||
5122 | |||
5055 | I915_WRITE(MEMINTREN, MEMINT_CX_SUPR_EN | MEMINT_EVAL_CHG_EN); | 5123 | I915_WRITE(MEMINTREN, MEMINT_CX_SUPR_EN | MEMINT_EVAL_CHG_EN); |
5056 | 5124 | ||
5057 | /* | 5125 | /* |
@@ -5073,20 +5141,19 @@ void ironlake_enable_drps(struct drm_device *dev) | |||
5073 | } | 5141 | } |
5074 | msleep(1); | 5142 | msleep(1); |
5075 | 5143 | ||
5076 | rgvswctl = (MEMCTL_CMD_CHFREQ << MEMCTL_CMD_SHIFT) | | 5144 | ironlake_set_drps(dev, fstart); |
5077 | (fstart << MEMCTL_FREQ_SHIFT) | MEMCTL_SFCAVM; | ||
5078 | I915_WRITE(MEMSWCTL, rgvswctl); | ||
5079 | POSTING_READ(MEMSWCTL); | ||
5080 | 5145 | ||
5081 | rgvswctl |= MEMCTL_CMD_STS; | 5146 | dev_priv->last_count1 = I915_READ(0x112e4) + I915_READ(0x112e8) + |
5082 | I915_WRITE(MEMSWCTL, rgvswctl); | 5147 | I915_READ(0x112e0); |
5148 | dev_priv->last_time1 = jiffies_to_msecs(jiffies); | ||
5149 | dev_priv->last_count2 = I915_READ(0x112f4); | ||
5150 | getrawmonotonic(&dev_priv->last_time2); | ||
5083 | } | 5151 | } |
5084 | 5152 | ||
5085 | void ironlake_disable_drps(struct drm_device *dev) | 5153 | void ironlake_disable_drps(struct drm_device *dev) |
5086 | { | 5154 | { |
5087 | struct drm_i915_private *dev_priv = dev->dev_private; | 5155 | struct drm_i915_private *dev_priv = dev->dev_private; |
5088 | u32 rgvswctl; | 5156 | u16 rgvswctl = I915_READ16(MEMSWCTL); |
5089 | u8 fstart; | ||
5090 | 5157 | ||
5091 | /* Ack interrupts, disable EFC interrupt */ | 5158 | /* Ack interrupts, disable EFC interrupt */ |
5092 | I915_WRITE(MEMINTREN, I915_READ(MEMINTREN) & ~MEMINT_EVAL_CHG_EN); | 5159 | I915_WRITE(MEMINTREN, I915_READ(MEMINTREN) & ~MEMINT_EVAL_CHG_EN); |
@@ -5096,11 +5163,7 @@ void ironlake_disable_drps(struct drm_device *dev) | |||
5096 | I915_WRITE(DEIMR, I915_READ(DEIMR) | DE_PCU_EVENT); | 5163 | I915_WRITE(DEIMR, I915_READ(DEIMR) | DE_PCU_EVENT); |
5097 | 5164 | ||
5098 | /* Go back to the starting frequency */ | 5165 | /* Go back to the starting frequency */ |
5099 | fstart = (I915_READ(MEMMODECTL) & MEMMODE_FSTART_MASK) >> | 5166 | ironlake_set_drps(dev, dev_priv->fstart); |
5100 | MEMMODE_FSTART_SHIFT; | ||
5101 | rgvswctl = (MEMCTL_CMD_CHFREQ << MEMCTL_CMD_SHIFT) | | ||
5102 | (fstart << MEMCTL_FREQ_SHIFT) | MEMCTL_SFCAVM; | ||
5103 | I915_WRITE(MEMSWCTL, rgvswctl); | ||
5104 | msleep(1); | 5167 | msleep(1); |
5105 | rgvswctl |= MEMCTL_CMD_STS; | 5168 | rgvswctl |= MEMCTL_CMD_STS; |
5106 | I915_WRITE(MEMSWCTL, rgvswctl); | 5169 | I915_WRITE(MEMSWCTL, rgvswctl); |
@@ -5108,6 +5171,92 @@ void ironlake_disable_drps(struct drm_device *dev) | |||
5108 | 5171 | ||
5109 | } | 5172 | } |
5110 | 5173 | ||
5174 | static unsigned long intel_pxfreq(u32 vidfreq) | ||
5175 | { | ||
5176 | unsigned long freq; | ||
5177 | int div = (vidfreq & 0x3f0000) >> 16; | ||
5178 | int post = (vidfreq & 0x3000) >> 12; | ||
5179 | int pre = (vidfreq & 0x7); | ||
5180 | |||
5181 | if (!pre) | ||
5182 | return 0; | ||
5183 | |||
5184 | freq = ((div * 133333) / ((1<<post) * pre)); | ||
5185 | |||
5186 | return freq; | ||
5187 | } | ||
5188 | |||
5189 | void intel_init_emon(struct drm_device *dev) | ||
5190 | { | ||
5191 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5192 | u32 lcfuse; | ||
5193 | u8 pxw[16]; | ||
5194 | int i; | ||
5195 | |||
5196 | /* Disable to program */ | ||
5197 | I915_WRITE(ECR, 0); | ||
5198 | POSTING_READ(ECR); | ||
5199 | |||
5200 | /* Program energy weights for various events */ | ||
5201 | I915_WRITE(SDEW, 0x15040d00); | ||
5202 | I915_WRITE(CSIEW0, 0x007f0000); | ||
5203 | I915_WRITE(CSIEW1, 0x1e220004); | ||
5204 | I915_WRITE(CSIEW2, 0x04000004); | ||
5205 | |||
5206 | for (i = 0; i < 5; i++) | ||
5207 | I915_WRITE(PEW + (i * 4), 0); | ||
5208 | for (i = 0; i < 3; i++) | ||
5209 | I915_WRITE(DEW + (i * 4), 0); | ||
5210 | |||
5211 | /* Program P-state weights to account for frequency power adjustment */ | ||
5212 | for (i = 0; i < 16; i++) { | ||
5213 | u32 pxvidfreq = I915_READ(PXVFREQ_BASE + (i * 4)); | ||
5214 | unsigned long freq = intel_pxfreq(pxvidfreq); | ||
5215 | unsigned long vid = (pxvidfreq & PXVFREQ_PX_MASK) >> | ||
5216 | PXVFREQ_PX_SHIFT; | ||
5217 | unsigned long val; | ||
5218 | |||
5219 | val = vid * vid; | ||
5220 | val *= (freq / 1000); | ||
5221 | val *= 255; | ||
5222 | val /= (127*127*900); | ||
5223 | if (val > 0xff) | ||
5224 | DRM_ERROR("bad pxval: %ld\n", val); | ||
5225 | pxw[i] = val; | ||
5226 | } | ||
5227 | /* Render standby states get 0 weight */ | ||
5228 | pxw[14] = 0; | ||
5229 | pxw[15] = 0; | ||
5230 | |||
5231 | for (i = 0; i < 4; i++) { | ||
5232 | u32 val = (pxw[i*4] << 24) | (pxw[(i*4)+1] << 16) | | ||
5233 | (pxw[(i*4)+2] << 8) | (pxw[(i*4)+3]); | ||
5234 | I915_WRITE(PXW + (i * 4), val); | ||
5235 | } | ||
5236 | |||
5237 | /* Adjust magic regs to magic values (more experimental results) */ | ||
5238 | I915_WRITE(OGW0, 0); | ||
5239 | I915_WRITE(OGW1, 0); | ||
5240 | I915_WRITE(EG0, 0x00007f00); | ||
5241 | I915_WRITE(EG1, 0x0000000e); | ||
5242 | I915_WRITE(EG2, 0x000e0000); | ||
5243 | I915_WRITE(EG3, 0x68000300); | ||
5244 | I915_WRITE(EG4, 0x42000000); | ||
5245 | I915_WRITE(EG5, 0x00140031); | ||
5246 | I915_WRITE(EG6, 0); | ||
5247 | I915_WRITE(EG7, 0); | ||
5248 | |||
5249 | for (i = 0; i < 8; i++) | ||
5250 | I915_WRITE(PXWL + (i * 4), 0); | ||
5251 | |||
5252 | /* Enable PMON + select events */ | ||
5253 | I915_WRITE(ECR, 0x80000019); | ||
5254 | |||
5255 | lcfuse = I915_READ(LCFUSE02); | ||
5256 | |||
5257 | dev_priv->corr = (lcfuse & LCFUSE_HIV_MASK); | ||
5258 | } | ||
5259 | |||
5111 | void intel_init_clock_gating(struct drm_device *dev) | 5260 | void intel_init_clock_gating(struct drm_device *dev) |
5112 | { | 5261 | { |
5113 | struct drm_i915_private *dev_priv = dev->dev_private; | 5262 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -5277,11 +5426,13 @@ static void intel_init_display(struct drm_device *dev) | |||
5277 | dev_priv->display.update_wm = NULL; | 5426 | dev_priv->display.update_wm = NULL; |
5278 | } else if (IS_PINEVIEW(dev)) { | 5427 | } else if (IS_PINEVIEW(dev)) { |
5279 | if (!intel_get_cxsr_latency(IS_PINEVIEW_G(dev), | 5428 | if (!intel_get_cxsr_latency(IS_PINEVIEW_G(dev), |
5429 | dev_priv->is_ddr3, | ||
5280 | dev_priv->fsb_freq, | 5430 | dev_priv->fsb_freq, |
5281 | dev_priv->mem_freq)) { | 5431 | dev_priv->mem_freq)) { |
5282 | DRM_INFO("failed to find known CxSR latency " | 5432 | DRM_INFO("failed to find known CxSR latency " |
5283 | "(found fsb freq %d, mem freq %d), " | 5433 | "(found ddr%s fsb freq %d, mem freq %d), " |
5284 | "disabling CxSR\n", | 5434 | "disabling CxSR\n", |
5435 | (dev_priv->is_ddr3 == 1) ? "3": "2", | ||
5285 | dev_priv->fsb_freq, dev_priv->mem_freq); | 5436 | dev_priv->fsb_freq, dev_priv->mem_freq); |
5286 | /* Disable CxSR and never update its watermark again */ | 5437 | /* Disable CxSR and never update its watermark again */ |
5287 | pineview_disable_cxsr(dev); | 5438 | pineview_disable_cxsr(dev); |
@@ -5354,8 +5505,10 @@ void intel_modeset_init(struct drm_device *dev) | |||
5354 | 5505 | ||
5355 | intel_init_clock_gating(dev); | 5506 | intel_init_clock_gating(dev); |
5356 | 5507 | ||
5357 | if (IS_IRONLAKE_M(dev)) | 5508 | if (IS_IRONLAKE_M(dev)) { |
5358 | ironlake_enable_drps(dev); | 5509 | ironlake_enable_drps(dev); |
5510 | intel_init_emon(dev); | ||
5511 | } | ||
5359 | 5512 | ||
5360 | INIT_WORK(&dev_priv->idle_work, intel_idle_update); | 5513 | INIT_WORK(&dev_priv->idle_work, intel_idle_update); |
5361 | setup_timer(&dev_priv->idle_timer, intel_gpu_idle_timer, | 5514 | setup_timer(&dev_priv->idle_timer, intel_gpu_idle_timer, |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 6b1c9a27c27a..49b54f05d3cf 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -576,7 +576,7 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, | |||
576 | struct intel_encoder *intel_encoder; | 576 | struct intel_encoder *intel_encoder; |
577 | struct intel_dp_priv *dp_priv; | 577 | struct intel_dp_priv *dp_priv; |
578 | 578 | ||
579 | if (!encoder || encoder->crtc != crtc) | 579 | if (encoder->crtc != crtc) |
580 | continue; | 580 | continue; |
581 | 581 | ||
582 | intel_encoder = enc_to_intel_encoder(encoder); | 582 | intel_encoder = enc_to_intel_encoder(encoder); |
@@ -675,10 +675,9 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
675 | dp_priv->link_configuration[1] = dp_priv->lane_count; | 675 | dp_priv->link_configuration[1] = dp_priv->lane_count; |
676 | 676 | ||
677 | /* | 677 | /* |
678 | * Check for DPCD version > 1.1, | 678 | * Check for DPCD version > 1.1 and enhanced framing support |
679 | * enable enahanced frame stuff in that case | ||
680 | */ | 679 | */ |
681 | if (dp_priv->dpcd[0] >= 0x11) { | 680 | if (dp_priv->dpcd[0] >= 0x11 && (dp_priv->dpcd[2] & DP_ENHANCED_FRAME_CAP)) { |
682 | dp_priv->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; | 681 | dp_priv->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; |
683 | dp_priv->DP |= DP_ENHANCED_FRAMING; | 682 | dp_priv->DP |= DP_ENHANCED_FRAMING; |
684 | } | 683 | } |
@@ -1208,6 +1207,8 @@ ironlake_dp_detect(struct drm_connector *connector) | |||
1208 | if (dp_priv->dpcd[0] != 0) | 1207 | if (dp_priv->dpcd[0] != 0) |
1209 | status = connector_status_connected; | 1208 | status = connector_status_connected; |
1210 | } | 1209 | } |
1210 | DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", dp_priv->dpcd[0], | ||
1211 | dp_priv->dpcd[1], dp_priv->dpcd[2], dp_priv->dpcd[3]); | ||
1211 | return status; | 1212 | return status; |
1212 | } | 1213 | } |
1213 | 1214 | ||
@@ -1352,7 +1353,7 @@ intel_trans_dp_port_sel (struct drm_crtc *crtc) | |||
1352 | struct intel_encoder *intel_encoder = NULL; | 1353 | struct intel_encoder *intel_encoder = NULL; |
1353 | 1354 | ||
1354 | list_for_each_entry(encoder, &mode_config->encoder_list, head) { | 1355 | list_for_each_entry(encoder, &mode_config->encoder_list, head) { |
1355 | if (!encoder || encoder->crtc != crtc) | 1356 | if (encoder->crtc != crtc) |
1356 | continue; | 1357 | continue; |
1357 | 1358 | ||
1358 | intel_encoder = enc_to_intel_encoder(encoder); | 1359 | intel_encoder = enc_to_intel_encoder(encoder); |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 6f53cf7fbc50..f8c76e64bb77 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -105,7 +105,11 @@ static int intelfb_create(struct intel_fbdev *ifbdev, | |||
105 | } | 105 | } |
106 | 106 | ||
107 | /* Flush everything out, we'll be doing GTT only from now on */ | 107 | /* Flush everything out, we'll be doing GTT only from now on */ |
108 | i915_gem_object_set_to_gtt_domain(fbo, 1); | 108 | ret = i915_gem_object_set_to_gtt_domain(fbo, 1); |
109 | if (ret) { | ||
110 | DRM_ERROR("failed to bind fb: %d.\n", ret); | ||
111 | goto out_unpin; | ||
112 | } | ||
109 | 113 | ||
110 | info = framebuffer_alloc(0, device); | 114 | info = framebuffer_alloc(0, device); |
111 | if (!info) { | 115 | if (!info) { |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 65727f0a79a3..83bd764b000e 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -59,8 +59,11 @@ static void intel_hdmi_mode_set(struct drm_encoder *encoder, | |||
59 | SDVO_VSYNC_ACTIVE_HIGH | | 59 | SDVO_VSYNC_ACTIVE_HIGH | |
60 | SDVO_HSYNC_ACTIVE_HIGH; | 60 | SDVO_HSYNC_ACTIVE_HIGH; |
61 | 61 | ||
62 | if (hdmi_priv->has_hdmi_sink) | 62 | if (hdmi_priv->has_hdmi_sink) { |
63 | sdvox |= SDVO_AUDIO_ENABLE; | 63 | sdvox |= SDVO_AUDIO_ENABLE; |
64 | if (HAS_PCH_CPT(dev)) | ||
65 | sdvox |= HDMI_MODE_SELECT; | ||
66 | } | ||
64 | 67 | ||
65 | if (intel_crtc->pipe == 1) { | 68 | if (intel_crtc->pipe == 1) { |
66 | if (HAS_PCH_CPT(dev)) | 69 | if (HAS_PCH_CPT(dev)) |
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index b0e17b06eb6e..d7ad5139d17c 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -211,9 +211,8 @@ static void intel_overlay_unmap_regs_atomic(struct intel_overlay *overlay) | |||
211 | static int intel_overlay_on(struct intel_overlay *overlay) | 211 | static int intel_overlay_on(struct intel_overlay *overlay) |
212 | { | 212 | { |
213 | struct drm_device *dev = overlay->dev; | 213 | struct drm_device *dev = overlay->dev; |
214 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
215 | int ret; | 214 | int ret; |
216 | RING_LOCALS; | 215 | drm_i915_private_t *dev_priv = dev->dev_private; |
217 | 216 | ||
218 | BUG_ON(overlay->active); | 217 | BUG_ON(overlay->active); |
219 | 218 | ||
@@ -227,11 +226,13 @@ static int intel_overlay_on(struct intel_overlay *overlay) | |||
227 | OUT_RING(MI_NOOP); | 226 | OUT_RING(MI_NOOP); |
228 | ADVANCE_LP_RING(); | 227 | ADVANCE_LP_RING(); |
229 | 228 | ||
230 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 229 | overlay->last_flip_req = |
230 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
231 | if (overlay->last_flip_req == 0) | 231 | if (overlay->last_flip_req == 0) |
232 | return -ENOMEM; | 232 | return -ENOMEM; |
233 | 233 | ||
234 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 234 | ret = i915_do_wait_request(dev, |
235 | overlay->last_flip_req, 1, &dev_priv->render_ring); | ||
235 | if (ret != 0) | 236 | if (ret != 0) |
236 | return ret; | 237 | return ret; |
237 | 238 | ||
@@ -248,7 +249,6 @@ static void intel_overlay_continue(struct intel_overlay *overlay, | |||
248 | drm_i915_private_t *dev_priv = dev->dev_private; | 249 | drm_i915_private_t *dev_priv = dev->dev_private; |
249 | u32 flip_addr = overlay->flip_addr; | 250 | u32 flip_addr = overlay->flip_addr; |
250 | u32 tmp; | 251 | u32 tmp; |
251 | RING_LOCALS; | ||
252 | 252 | ||
253 | BUG_ON(!overlay->active); | 253 | BUG_ON(!overlay->active); |
254 | 254 | ||
@@ -265,7 +265,8 @@ static void intel_overlay_continue(struct intel_overlay *overlay, | |||
265 | OUT_RING(flip_addr); | 265 | OUT_RING(flip_addr); |
266 | ADVANCE_LP_RING(); | 266 | ADVANCE_LP_RING(); |
267 | 267 | ||
268 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 268 | overlay->last_flip_req = |
269 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
269 | } | 270 | } |
270 | 271 | ||
271 | static int intel_overlay_wait_flip(struct intel_overlay *overlay) | 272 | static int intel_overlay_wait_flip(struct intel_overlay *overlay) |
@@ -274,10 +275,10 @@ static int intel_overlay_wait_flip(struct intel_overlay *overlay) | |||
274 | drm_i915_private_t *dev_priv = dev->dev_private; | 275 | drm_i915_private_t *dev_priv = dev->dev_private; |
275 | int ret; | 276 | int ret; |
276 | u32 tmp; | 277 | u32 tmp; |
277 | RING_LOCALS; | ||
278 | 278 | ||
279 | if (overlay->last_flip_req != 0) { | 279 | if (overlay->last_flip_req != 0) { |
280 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 280 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
281 | 1, &dev_priv->render_ring); | ||
281 | if (ret == 0) { | 282 | if (ret == 0) { |
282 | overlay->last_flip_req = 0; | 283 | overlay->last_flip_req = 0; |
283 | 284 | ||
@@ -296,11 +297,13 @@ static int intel_overlay_wait_flip(struct intel_overlay *overlay) | |||
296 | OUT_RING(MI_NOOP); | 297 | OUT_RING(MI_NOOP); |
297 | ADVANCE_LP_RING(); | 298 | ADVANCE_LP_RING(); |
298 | 299 | ||
299 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 300 | overlay->last_flip_req = |
301 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
300 | if (overlay->last_flip_req == 0) | 302 | if (overlay->last_flip_req == 0) |
301 | return -ENOMEM; | 303 | return -ENOMEM; |
302 | 304 | ||
303 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 305 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
306 | 1, &dev_priv->render_ring); | ||
304 | if (ret != 0) | 307 | if (ret != 0) |
305 | return ret; | 308 | return ret; |
306 | 309 | ||
@@ -314,9 +317,8 @@ static int intel_overlay_off(struct intel_overlay *overlay) | |||
314 | { | 317 | { |
315 | u32 flip_addr = overlay->flip_addr; | 318 | u32 flip_addr = overlay->flip_addr; |
316 | struct drm_device *dev = overlay->dev; | 319 | struct drm_device *dev = overlay->dev; |
317 | drm_i915_private_t *dev_priv = dev->dev_private; | 320 | drm_i915_private_t *dev_priv = dev->dev_private; |
318 | int ret; | 321 | int ret; |
319 | RING_LOCALS; | ||
320 | 322 | ||
321 | BUG_ON(!overlay->active); | 323 | BUG_ON(!overlay->active); |
322 | 324 | ||
@@ -336,11 +338,13 @@ static int intel_overlay_off(struct intel_overlay *overlay) | |||
336 | OUT_RING(MI_NOOP); | 338 | OUT_RING(MI_NOOP); |
337 | ADVANCE_LP_RING(); | 339 | ADVANCE_LP_RING(); |
338 | 340 | ||
339 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 341 | overlay->last_flip_req = |
342 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
340 | if (overlay->last_flip_req == 0) | 343 | if (overlay->last_flip_req == 0) |
341 | return -ENOMEM; | 344 | return -ENOMEM; |
342 | 345 | ||
343 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 346 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
347 | 1, &dev_priv->render_ring); | ||
344 | if (ret != 0) | 348 | if (ret != 0) |
345 | return ret; | 349 | return ret; |
346 | 350 | ||
@@ -354,11 +358,13 @@ static int intel_overlay_off(struct intel_overlay *overlay) | |||
354 | OUT_RING(MI_NOOP); | 358 | OUT_RING(MI_NOOP); |
355 | ADVANCE_LP_RING(); | 359 | ADVANCE_LP_RING(); |
356 | 360 | ||
357 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 361 | overlay->last_flip_req = |
362 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
358 | if (overlay->last_flip_req == 0) | 363 | if (overlay->last_flip_req == 0) |
359 | return -ENOMEM; | 364 | return -ENOMEM; |
360 | 365 | ||
361 | ret = i915_do_wait_request(dev, overlay->last_flip_req, 1); | 366 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
367 | 1, &dev_priv->render_ring); | ||
362 | if (ret != 0) | 368 | if (ret != 0) |
363 | return ret; | 369 | return ret; |
364 | 370 | ||
@@ -390,22 +396,23 @@ int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay, | |||
390 | int interruptible) | 396 | int interruptible) |
391 | { | 397 | { |
392 | struct drm_device *dev = overlay->dev; | 398 | struct drm_device *dev = overlay->dev; |
393 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
394 | struct drm_gem_object *obj; | 399 | struct drm_gem_object *obj; |
400 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
395 | u32 flip_addr; | 401 | u32 flip_addr; |
396 | int ret; | 402 | int ret; |
397 | RING_LOCALS; | ||
398 | 403 | ||
399 | if (overlay->hw_wedged == HW_WEDGED) | 404 | if (overlay->hw_wedged == HW_WEDGED) |
400 | return -EIO; | 405 | return -EIO; |
401 | 406 | ||
402 | if (overlay->last_flip_req == 0) { | 407 | if (overlay->last_flip_req == 0) { |
403 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 408 | overlay->last_flip_req = |
409 | i915_add_request(dev, NULL, 0, &dev_priv->render_ring); | ||
404 | if (overlay->last_flip_req == 0) | 410 | if (overlay->last_flip_req == 0) |
405 | return -ENOMEM; | 411 | return -ENOMEM; |
406 | } | 412 | } |
407 | 413 | ||
408 | ret = i915_do_wait_request(dev, overlay->last_flip_req, interruptible); | 414 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
415 | interruptible, &dev_priv->render_ring); | ||
409 | if (ret != 0) | 416 | if (ret != 0) |
410 | return ret; | 417 | return ret; |
411 | 418 | ||
@@ -429,12 +436,13 @@ int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay, | |||
429 | OUT_RING(MI_NOOP); | 436 | OUT_RING(MI_NOOP); |
430 | ADVANCE_LP_RING(); | 437 | ADVANCE_LP_RING(); |
431 | 438 | ||
432 | overlay->last_flip_req = i915_add_request(dev, NULL, 0); | 439 | overlay->last_flip_req = i915_add_request(dev, NULL, |
440 | 0, &dev_priv->render_ring); | ||
433 | if (overlay->last_flip_req == 0) | 441 | if (overlay->last_flip_req == 0) |
434 | return -ENOMEM; | 442 | return -ENOMEM; |
435 | 443 | ||
436 | ret = i915_do_wait_request(dev, overlay->last_flip_req, | 444 | ret = i915_do_wait_request(dev, overlay->last_flip_req, |
437 | interruptible); | 445 | interruptible, &dev_priv->render_ring); |
438 | if (ret != 0) | 446 | if (ret != 0) |
439 | return ret; | 447 | return ret; |
440 | 448 | ||
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c new file mode 100644 index 000000000000..cea4f1a8709e --- /dev/null +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -0,0 +1,849 @@ | |||
1 | /* | ||
2 | * Copyright © 2008-2010 Intel Corporation | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice (including the next | ||
12 | * paragraph) shall be included in all copies or substantial portions of the | ||
13 | * Software. | ||
14 | * | ||
15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
21 | * IN THE SOFTWARE. | ||
22 | * | ||
23 | * Authors: | ||
24 | * Eric Anholt <eric@anholt.net> | ||
25 | * Zou Nan hai <nanhai.zou@intel.com> | ||
26 | * Xiang Hai hao<haihao.xiang@intel.com> | ||
27 | * | ||
28 | */ | ||
29 | |||
30 | #include "drmP.h" | ||
31 | #include "drm.h" | ||
32 | #include "i915_drv.h" | ||
33 | #include "i915_drm.h" | ||
34 | #include "i915_trace.h" | ||
35 | |||
36 | static void | ||
37 | render_ring_flush(struct drm_device *dev, | ||
38 | struct intel_ring_buffer *ring, | ||
39 | u32 invalidate_domains, | ||
40 | u32 flush_domains) | ||
41 | { | ||
42 | #if WATCH_EXEC | ||
43 | DRM_INFO("%s: invalidate %08x flush %08x\n", __func__, | ||
44 | invalidate_domains, flush_domains); | ||
45 | #endif | ||
46 | u32 cmd; | ||
47 | trace_i915_gem_request_flush(dev, ring->next_seqno, | ||
48 | invalidate_domains, flush_domains); | ||
49 | |||
50 | if ((invalidate_domains | flush_domains) & I915_GEM_GPU_DOMAINS) { | ||
51 | /* | ||
52 | * read/write caches: | ||
53 | * | ||
54 | * I915_GEM_DOMAIN_RENDER is always invalidated, but is | ||
55 | * only flushed if MI_NO_WRITE_FLUSH is unset. On 965, it is | ||
56 | * also flushed at 2d versus 3d pipeline switches. | ||
57 | * | ||
58 | * read-only caches: | ||
59 | * | ||
60 | * I915_GEM_DOMAIN_SAMPLER is flushed on pre-965 if | ||
61 | * MI_READ_FLUSH is set, and is always flushed on 965. | ||
62 | * | ||
63 | * I915_GEM_DOMAIN_COMMAND may not exist? | ||
64 | * | ||
65 | * I915_GEM_DOMAIN_INSTRUCTION, which exists on 965, is | ||
66 | * invalidated when MI_EXE_FLUSH is set. | ||
67 | * | ||
68 | * I915_GEM_DOMAIN_VERTEX, which exists on 965, is | ||
69 | * invalidated with every MI_FLUSH. | ||
70 | * | ||
71 | * TLBs: | ||
72 | * | ||
73 | * On 965, TLBs associated with I915_GEM_DOMAIN_COMMAND | ||
74 | * and I915_GEM_DOMAIN_CPU in are invalidated at PTE write and | ||
75 | * I915_GEM_DOMAIN_RENDER and I915_GEM_DOMAIN_SAMPLER | ||
76 | * are flushed at any MI_FLUSH. | ||
77 | */ | ||
78 | |||
79 | cmd = MI_FLUSH | MI_NO_WRITE_FLUSH; | ||
80 | if ((invalidate_domains|flush_domains) & | ||
81 | I915_GEM_DOMAIN_RENDER) | ||
82 | cmd &= ~MI_NO_WRITE_FLUSH; | ||
83 | if (!IS_I965G(dev)) { | ||
84 | /* | ||
85 | * On the 965, the sampler cache always gets flushed | ||
86 | * and this bit is reserved. | ||
87 | */ | ||
88 | if (invalidate_domains & I915_GEM_DOMAIN_SAMPLER) | ||
89 | cmd |= MI_READ_FLUSH; | ||
90 | } | ||
91 | if (invalidate_domains & I915_GEM_DOMAIN_INSTRUCTION) | ||
92 | cmd |= MI_EXE_FLUSH; | ||
93 | |||
94 | #if WATCH_EXEC | ||
95 | DRM_INFO("%s: queue flush %08x to ring\n", __func__, cmd); | ||
96 | #endif | ||
97 | intel_ring_begin(dev, ring, 8); | ||
98 | intel_ring_emit(dev, ring, cmd); | ||
99 | intel_ring_emit(dev, ring, MI_NOOP); | ||
100 | intel_ring_advance(dev, ring); | ||
101 | } | ||
102 | } | ||
103 | |||
104 | static unsigned int render_ring_get_head(struct drm_device *dev, | ||
105 | struct intel_ring_buffer *ring) | ||
106 | { | ||
107 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
108 | return I915_READ(PRB0_HEAD) & HEAD_ADDR; | ||
109 | } | ||
110 | |||
111 | static unsigned int render_ring_get_tail(struct drm_device *dev, | ||
112 | struct intel_ring_buffer *ring) | ||
113 | { | ||
114 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
115 | return I915_READ(PRB0_TAIL) & TAIL_ADDR; | ||
116 | } | ||
117 | |||
118 | static unsigned int render_ring_get_active_head(struct drm_device *dev, | ||
119 | struct intel_ring_buffer *ring) | ||
120 | { | ||
121 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
122 | u32 acthd_reg = IS_I965G(dev) ? ACTHD_I965 : ACTHD; | ||
123 | |||
124 | return I915_READ(acthd_reg); | ||
125 | } | ||
126 | |||
127 | static void render_ring_advance_ring(struct drm_device *dev, | ||
128 | struct intel_ring_buffer *ring) | ||
129 | { | ||
130 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
131 | I915_WRITE(PRB0_TAIL, ring->tail); | ||
132 | } | ||
133 | |||
134 | static int init_ring_common(struct drm_device *dev, | ||
135 | struct intel_ring_buffer *ring) | ||
136 | { | ||
137 | u32 head; | ||
138 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
139 | struct drm_i915_gem_object *obj_priv; | ||
140 | obj_priv = to_intel_bo(ring->gem_object); | ||
141 | |||
142 | /* Stop the ring if it's running. */ | ||
143 | I915_WRITE(ring->regs.ctl, 0); | ||
144 | I915_WRITE(ring->regs.head, 0); | ||
145 | I915_WRITE(ring->regs.tail, 0); | ||
146 | |||
147 | /* Initialize the ring. */ | ||
148 | I915_WRITE(ring->regs.start, obj_priv->gtt_offset); | ||
149 | head = ring->get_head(dev, ring); | ||
150 | |||
151 | /* G45 ring initialization fails to reset head to zero */ | ||
152 | if (head != 0) { | ||
153 | DRM_ERROR("%s head not reset to zero " | ||
154 | "ctl %08x head %08x tail %08x start %08x\n", | ||
155 | ring->name, | ||
156 | I915_READ(ring->regs.ctl), | ||
157 | I915_READ(ring->regs.head), | ||
158 | I915_READ(ring->regs.tail), | ||
159 | I915_READ(ring->regs.start)); | ||
160 | |||
161 | I915_WRITE(ring->regs.head, 0); | ||
162 | |||
163 | DRM_ERROR("%s head forced to zero " | ||
164 | "ctl %08x head %08x tail %08x start %08x\n", | ||
165 | ring->name, | ||
166 | I915_READ(ring->regs.ctl), | ||
167 | I915_READ(ring->regs.head), | ||
168 | I915_READ(ring->regs.tail), | ||
169 | I915_READ(ring->regs.start)); | ||
170 | } | ||
171 | |||
172 | I915_WRITE(ring->regs.ctl, | ||
173 | ((ring->gem_object->size - PAGE_SIZE) & RING_NR_PAGES) | ||
174 | | RING_NO_REPORT | RING_VALID); | ||
175 | |||
176 | head = I915_READ(ring->regs.head) & HEAD_ADDR; | ||
177 | /* If the head is still not zero, the ring is dead */ | ||
178 | if (head != 0) { | ||
179 | DRM_ERROR("%s initialization failed " | ||
180 | "ctl %08x head %08x tail %08x start %08x\n", | ||
181 | ring->name, | ||
182 | I915_READ(ring->regs.ctl), | ||
183 | I915_READ(ring->regs.head), | ||
184 | I915_READ(ring->regs.tail), | ||
185 | I915_READ(ring->regs.start)); | ||
186 | return -EIO; | ||
187 | } | ||
188 | |||
189 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | ||
190 | i915_kernel_lost_context(dev); | ||
191 | else { | ||
192 | ring->head = ring->get_head(dev, ring); | ||
193 | ring->tail = ring->get_tail(dev, ring); | ||
194 | ring->space = ring->head - (ring->tail + 8); | ||
195 | if (ring->space < 0) | ||
196 | ring->space += ring->size; | ||
197 | } | ||
198 | return 0; | ||
199 | } | ||
200 | |||
201 | static int init_render_ring(struct drm_device *dev, | ||
202 | struct intel_ring_buffer *ring) | ||
203 | { | ||
204 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
205 | int ret = init_ring_common(dev, ring); | ||
206 | if (IS_I9XX(dev) && !IS_GEN3(dev)) { | ||
207 | I915_WRITE(MI_MODE, | ||
208 | (VS_TIMER_DISPATCH) << 16 | VS_TIMER_DISPATCH); | ||
209 | } | ||
210 | return ret; | ||
211 | } | ||
212 | |||
213 | #define PIPE_CONTROL_FLUSH(addr) \ | ||
214 | do { \ | ||
215 | OUT_RING(GFX_OP_PIPE_CONTROL | PIPE_CONTROL_QW_WRITE | \ | ||
216 | PIPE_CONTROL_DEPTH_STALL | 2); \ | ||
217 | OUT_RING(addr | PIPE_CONTROL_GLOBAL_GTT); \ | ||
218 | OUT_RING(0); \ | ||
219 | OUT_RING(0); \ | ||
220 | } while (0) | ||
221 | |||
222 | /** | ||
223 | * Creates a new sequence number, emitting a write of it to the status page | ||
224 | * plus an interrupt, which will trigger i915_user_interrupt_handler. | ||
225 | * | ||
226 | * Must be called with struct_lock held. | ||
227 | * | ||
228 | * Returned sequence numbers are nonzero on success. | ||
229 | */ | ||
230 | static u32 | ||
231 | render_ring_add_request(struct drm_device *dev, | ||
232 | struct intel_ring_buffer *ring, | ||
233 | struct drm_file *file_priv, | ||
234 | u32 flush_domains) | ||
235 | { | ||
236 | u32 seqno; | ||
237 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
238 | seqno = intel_ring_get_seqno(dev, ring); | ||
239 | |||
240 | if (IS_GEN6(dev)) { | ||
241 | BEGIN_LP_RING(6); | ||
242 | OUT_RING(GFX_OP_PIPE_CONTROL | 3); | ||
243 | OUT_RING(PIPE_CONTROL_QW_WRITE | | ||
244 | PIPE_CONTROL_WC_FLUSH | PIPE_CONTROL_IS_FLUSH | | ||
245 | PIPE_CONTROL_NOTIFY); | ||
246 | OUT_RING(dev_priv->seqno_gfx_addr | PIPE_CONTROL_GLOBAL_GTT); | ||
247 | OUT_RING(seqno); | ||
248 | OUT_RING(0); | ||
249 | OUT_RING(0); | ||
250 | ADVANCE_LP_RING(); | ||
251 | } else if (HAS_PIPE_CONTROL(dev)) { | ||
252 | u32 scratch_addr = dev_priv->seqno_gfx_addr + 128; | ||
253 | |||
254 | /* | ||
255 | * Workaround qword write incoherence by flushing the | ||
256 | * PIPE_NOTIFY buffers out to memory before requesting | ||
257 | * an interrupt. | ||
258 | */ | ||
259 | BEGIN_LP_RING(32); | ||
260 | OUT_RING(GFX_OP_PIPE_CONTROL | PIPE_CONTROL_QW_WRITE | | ||
261 | PIPE_CONTROL_WC_FLUSH | PIPE_CONTROL_TC_FLUSH); | ||
262 | OUT_RING(dev_priv->seqno_gfx_addr | PIPE_CONTROL_GLOBAL_GTT); | ||
263 | OUT_RING(seqno); | ||
264 | OUT_RING(0); | ||
265 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
266 | scratch_addr += 128; /* write to separate cachelines */ | ||
267 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
268 | scratch_addr += 128; | ||
269 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
270 | scratch_addr += 128; | ||
271 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
272 | scratch_addr += 128; | ||
273 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
274 | scratch_addr += 128; | ||
275 | PIPE_CONTROL_FLUSH(scratch_addr); | ||
276 | OUT_RING(GFX_OP_PIPE_CONTROL | PIPE_CONTROL_QW_WRITE | | ||
277 | PIPE_CONTROL_WC_FLUSH | PIPE_CONTROL_TC_FLUSH | | ||
278 | PIPE_CONTROL_NOTIFY); | ||
279 | OUT_RING(dev_priv->seqno_gfx_addr | PIPE_CONTROL_GLOBAL_GTT); | ||
280 | OUT_RING(seqno); | ||
281 | OUT_RING(0); | ||
282 | ADVANCE_LP_RING(); | ||
283 | } else { | ||
284 | BEGIN_LP_RING(4); | ||
285 | OUT_RING(MI_STORE_DWORD_INDEX); | ||
286 | OUT_RING(I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT); | ||
287 | OUT_RING(seqno); | ||
288 | |||
289 | OUT_RING(MI_USER_INTERRUPT); | ||
290 | ADVANCE_LP_RING(); | ||
291 | } | ||
292 | return seqno; | ||
293 | } | ||
294 | |||
295 | static u32 | ||
296 | render_ring_get_gem_seqno(struct drm_device *dev, | ||
297 | struct intel_ring_buffer *ring) | ||
298 | { | ||
299 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
300 | if (HAS_PIPE_CONTROL(dev)) | ||
301 | return ((volatile u32 *)(dev_priv->seqno_page))[0]; | ||
302 | else | ||
303 | return intel_read_status_page(ring, I915_GEM_HWS_INDEX); | ||
304 | } | ||
305 | |||
306 | static void | ||
307 | render_ring_get_user_irq(struct drm_device *dev, | ||
308 | struct intel_ring_buffer *ring) | ||
309 | { | ||
310 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
311 | unsigned long irqflags; | ||
312 | |||
313 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); | ||
314 | if (dev->irq_enabled && (++ring->user_irq_refcount == 1)) { | ||
315 | if (HAS_PCH_SPLIT(dev)) | ||
316 | ironlake_enable_graphics_irq(dev_priv, GT_PIPE_NOTIFY); | ||
317 | else | ||
318 | i915_enable_irq(dev_priv, I915_USER_INTERRUPT); | ||
319 | } | ||
320 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | ||
321 | } | ||
322 | |||
323 | static void | ||
324 | render_ring_put_user_irq(struct drm_device *dev, | ||
325 | struct intel_ring_buffer *ring) | ||
326 | { | ||
327 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | ||
328 | unsigned long irqflags; | ||
329 | |||
330 | spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags); | ||
331 | BUG_ON(dev->irq_enabled && ring->user_irq_refcount <= 0); | ||
332 | if (dev->irq_enabled && (--ring->user_irq_refcount == 0)) { | ||
333 | if (HAS_PCH_SPLIT(dev)) | ||
334 | ironlake_disable_graphics_irq(dev_priv, GT_PIPE_NOTIFY); | ||
335 | else | ||
336 | i915_disable_irq(dev_priv, I915_USER_INTERRUPT); | ||
337 | } | ||
338 | spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); | ||
339 | } | ||
340 | |||
341 | static void render_setup_status_page(struct drm_device *dev, | ||
342 | struct intel_ring_buffer *ring) | ||
343 | { | ||
344 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
345 | if (IS_GEN6(dev)) { | ||
346 | I915_WRITE(HWS_PGA_GEN6, ring->status_page.gfx_addr); | ||
347 | I915_READ(HWS_PGA_GEN6); /* posting read */ | ||
348 | } else { | ||
349 | I915_WRITE(HWS_PGA, ring->status_page.gfx_addr); | ||
350 | I915_READ(HWS_PGA); /* posting read */ | ||
351 | } | ||
352 | |||
353 | } | ||
354 | |||
355 | void | ||
356 | bsd_ring_flush(struct drm_device *dev, | ||
357 | struct intel_ring_buffer *ring, | ||
358 | u32 invalidate_domains, | ||
359 | u32 flush_domains) | ||
360 | { | ||
361 | intel_ring_begin(dev, ring, 8); | ||
362 | intel_ring_emit(dev, ring, MI_FLUSH); | ||
363 | intel_ring_emit(dev, ring, MI_NOOP); | ||
364 | intel_ring_advance(dev, ring); | ||
365 | } | ||
366 | |||
367 | static inline unsigned int bsd_ring_get_head(struct drm_device *dev, | ||
368 | struct intel_ring_buffer *ring) | ||
369 | { | ||
370 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
371 | return I915_READ(BSD_RING_HEAD) & HEAD_ADDR; | ||
372 | } | ||
373 | |||
374 | static inline unsigned int bsd_ring_get_tail(struct drm_device *dev, | ||
375 | struct intel_ring_buffer *ring) | ||
376 | { | ||
377 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
378 | return I915_READ(BSD_RING_TAIL) & TAIL_ADDR; | ||
379 | } | ||
380 | |||
381 | static inline unsigned int bsd_ring_get_active_head(struct drm_device *dev, | ||
382 | struct intel_ring_buffer *ring) | ||
383 | { | ||
384 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
385 | return I915_READ(BSD_RING_ACTHD); | ||
386 | } | ||
387 | |||
388 | static inline void bsd_ring_advance_ring(struct drm_device *dev, | ||
389 | struct intel_ring_buffer *ring) | ||
390 | { | ||
391 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
392 | I915_WRITE(BSD_RING_TAIL, ring->tail); | ||
393 | } | ||
394 | |||
395 | static int init_bsd_ring(struct drm_device *dev, | ||
396 | struct intel_ring_buffer *ring) | ||
397 | { | ||
398 | return init_ring_common(dev, ring); | ||
399 | } | ||
400 | |||
401 | static u32 | ||
402 | bsd_ring_add_request(struct drm_device *dev, | ||
403 | struct intel_ring_buffer *ring, | ||
404 | struct drm_file *file_priv, | ||
405 | u32 flush_domains) | ||
406 | { | ||
407 | u32 seqno; | ||
408 | seqno = intel_ring_get_seqno(dev, ring); | ||
409 | intel_ring_begin(dev, ring, 4); | ||
410 | intel_ring_emit(dev, ring, MI_STORE_DWORD_INDEX); | ||
411 | intel_ring_emit(dev, ring, | ||
412 | I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT); | ||
413 | intel_ring_emit(dev, ring, seqno); | ||
414 | intel_ring_emit(dev, ring, MI_USER_INTERRUPT); | ||
415 | intel_ring_advance(dev, ring); | ||
416 | |||
417 | DRM_DEBUG_DRIVER("%s %d\n", ring->name, seqno); | ||
418 | |||
419 | return seqno; | ||
420 | } | ||
421 | |||
422 | static void bsd_setup_status_page(struct drm_device *dev, | ||
423 | struct intel_ring_buffer *ring) | ||
424 | { | ||
425 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
426 | I915_WRITE(BSD_HWS_PGA, ring->status_page.gfx_addr); | ||
427 | I915_READ(BSD_HWS_PGA); | ||
428 | } | ||
429 | |||
430 | static void | ||
431 | bsd_ring_get_user_irq(struct drm_device *dev, | ||
432 | struct intel_ring_buffer *ring) | ||
433 | { | ||
434 | /* do nothing */ | ||
435 | } | ||
436 | static void | ||
437 | bsd_ring_put_user_irq(struct drm_device *dev, | ||
438 | struct intel_ring_buffer *ring) | ||
439 | { | ||
440 | /* do nothing */ | ||
441 | } | ||
442 | |||
443 | static u32 | ||
444 | bsd_ring_get_gem_seqno(struct drm_device *dev, | ||
445 | struct intel_ring_buffer *ring) | ||
446 | { | ||
447 | return intel_read_status_page(ring, I915_GEM_HWS_INDEX); | ||
448 | } | ||
449 | |||
450 | static int | ||
451 | bsd_ring_dispatch_gem_execbuffer(struct drm_device *dev, | ||
452 | struct intel_ring_buffer *ring, | ||
453 | struct drm_i915_gem_execbuffer2 *exec, | ||
454 | struct drm_clip_rect *cliprects, | ||
455 | uint64_t exec_offset) | ||
456 | { | ||
457 | uint32_t exec_start; | ||
458 | exec_start = (uint32_t) exec_offset + exec->batch_start_offset; | ||
459 | intel_ring_begin(dev, ring, 2); | ||
460 | intel_ring_emit(dev, ring, MI_BATCH_BUFFER_START | | ||
461 | (2 << 6) | MI_BATCH_NON_SECURE_I965); | ||
462 | intel_ring_emit(dev, ring, exec_start); | ||
463 | intel_ring_advance(dev, ring); | ||
464 | return 0; | ||
465 | } | ||
466 | |||
467 | |||
468 | static int | ||
469 | render_ring_dispatch_gem_execbuffer(struct drm_device *dev, | ||
470 | struct intel_ring_buffer *ring, | ||
471 | struct drm_i915_gem_execbuffer2 *exec, | ||
472 | struct drm_clip_rect *cliprects, | ||
473 | uint64_t exec_offset) | ||
474 | { | ||
475 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
476 | int nbox = exec->num_cliprects; | ||
477 | int i = 0, count; | ||
478 | uint32_t exec_start, exec_len; | ||
479 | exec_start = (uint32_t) exec_offset + exec->batch_start_offset; | ||
480 | exec_len = (uint32_t) exec->batch_len; | ||
481 | |||
482 | trace_i915_gem_request_submit(dev, dev_priv->mm.next_gem_seqno + 1); | ||
483 | |||
484 | count = nbox ? nbox : 1; | ||
485 | |||
486 | for (i = 0; i < count; i++) { | ||
487 | if (i < nbox) { | ||
488 | int ret = i915_emit_box(dev, cliprects, i, | ||
489 | exec->DR1, exec->DR4); | ||
490 | if (ret) | ||
491 | return ret; | ||
492 | } | ||
493 | |||
494 | if (IS_I830(dev) || IS_845G(dev)) { | ||
495 | intel_ring_begin(dev, ring, 4); | ||
496 | intel_ring_emit(dev, ring, MI_BATCH_BUFFER); | ||
497 | intel_ring_emit(dev, ring, | ||
498 | exec_start | MI_BATCH_NON_SECURE); | ||
499 | intel_ring_emit(dev, ring, exec_start + exec_len - 4); | ||
500 | intel_ring_emit(dev, ring, 0); | ||
501 | } else { | ||
502 | intel_ring_begin(dev, ring, 4); | ||
503 | if (IS_I965G(dev)) { | ||
504 | intel_ring_emit(dev, ring, | ||
505 | MI_BATCH_BUFFER_START | (2 << 6) | ||
506 | | MI_BATCH_NON_SECURE_I965); | ||
507 | intel_ring_emit(dev, ring, exec_start); | ||
508 | } else { | ||
509 | intel_ring_emit(dev, ring, MI_BATCH_BUFFER_START | ||
510 | | (2 << 6)); | ||
511 | intel_ring_emit(dev, ring, exec_start | | ||
512 | MI_BATCH_NON_SECURE); | ||
513 | } | ||
514 | } | ||
515 | intel_ring_advance(dev, ring); | ||
516 | } | ||
517 | |||
518 | /* XXX breadcrumb */ | ||
519 | return 0; | ||
520 | } | ||
521 | |||
522 | static void cleanup_status_page(struct drm_device *dev, | ||
523 | struct intel_ring_buffer *ring) | ||
524 | { | ||
525 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
526 | struct drm_gem_object *obj; | ||
527 | struct drm_i915_gem_object *obj_priv; | ||
528 | |||
529 | obj = ring->status_page.obj; | ||
530 | if (obj == NULL) | ||
531 | return; | ||
532 | obj_priv = to_intel_bo(obj); | ||
533 | |||
534 | kunmap(obj_priv->pages[0]); | ||
535 | i915_gem_object_unpin(obj); | ||
536 | drm_gem_object_unreference(obj); | ||
537 | ring->status_page.obj = NULL; | ||
538 | |||
539 | memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); | ||
540 | } | ||
541 | |||
542 | static int init_status_page(struct drm_device *dev, | ||
543 | struct intel_ring_buffer *ring) | ||
544 | { | ||
545 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
546 | struct drm_gem_object *obj; | ||
547 | struct drm_i915_gem_object *obj_priv; | ||
548 | int ret; | ||
549 | |||
550 | obj = i915_gem_alloc_object(dev, 4096); | ||
551 | if (obj == NULL) { | ||
552 | DRM_ERROR("Failed to allocate status page\n"); | ||
553 | ret = -ENOMEM; | ||
554 | goto err; | ||
555 | } | ||
556 | obj_priv = to_intel_bo(obj); | ||
557 | obj_priv->agp_type = AGP_USER_CACHED_MEMORY; | ||
558 | |||
559 | ret = i915_gem_object_pin(obj, 4096); | ||
560 | if (ret != 0) { | ||
561 | goto err_unref; | ||
562 | } | ||
563 | |||
564 | ring->status_page.gfx_addr = obj_priv->gtt_offset; | ||
565 | ring->status_page.page_addr = kmap(obj_priv->pages[0]); | ||
566 | if (ring->status_page.page_addr == NULL) { | ||
567 | memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map)); | ||
568 | goto err_unpin; | ||
569 | } | ||
570 | ring->status_page.obj = obj; | ||
571 | memset(ring->status_page.page_addr, 0, PAGE_SIZE); | ||
572 | |||
573 | ring->setup_status_page(dev, ring); | ||
574 | DRM_DEBUG_DRIVER("%s hws offset: 0x%08x\n", | ||
575 | ring->name, ring->status_page.gfx_addr); | ||
576 | |||
577 | return 0; | ||
578 | |||
579 | err_unpin: | ||
580 | i915_gem_object_unpin(obj); | ||
581 | err_unref: | ||
582 | drm_gem_object_unreference(obj); | ||
583 | err: | ||
584 | return ret; | ||
585 | } | ||
586 | |||
587 | |||
588 | int intel_init_ring_buffer(struct drm_device *dev, | ||
589 | struct intel_ring_buffer *ring) | ||
590 | { | ||
591 | int ret; | ||
592 | struct drm_i915_gem_object *obj_priv; | ||
593 | struct drm_gem_object *obj; | ||
594 | ring->dev = dev; | ||
595 | |||
596 | if (I915_NEED_GFX_HWS(dev)) { | ||
597 | ret = init_status_page(dev, ring); | ||
598 | if (ret) | ||
599 | return ret; | ||
600 | } | ||
601 | |||
602 | obj = i915_gem_alloc_object(dev, ring->size); | ||
603 | if (obj == NULL) { | ||
604 | DRM_ERROR("Failed to allocate ringbuffer\n"); | ||
605 | ret = -ENOMEM; | ||
606 | goto cleanup; | ||
607 | } | ||
608 | |||
609 | ring->gem_object = obj; | ||
610 | |||
611 | ret = i915_gem_object_pin(obj, ring->alignment); | ||
612 | if (ret != 0) { | ||
613 | drm_gem_object_unreference(obj); | ||
614 | goto cleanup; | ||
615 | } | ||
616 | |||
617 | obj_priv = to_intel_bo(obj); | ||
618 | ring->map.size = ring->size; | ||
619 | ring->map.offset = dev->agp->base + obj_priv->gtt_offset; | ||
620 | ring->map.type = 0; | ||
621 | ring->map.flags = 0; | ||
622 | ring->map.mtrr = 0; | ||
623 | |||
624 | drm_core_ioremap_wc(&ring->map, dev); | ||
625 | if (ring->map.handle == NULL) { | ||
626 | DRM_ERROR("Failed to map ringbuffer.\n"); | ||
627 | i915_gem_object_unpin(obj); | ||
628 | drm_gem_object_unreference(obj); | ||
629 | ret = -EINVAL; | ||
630 | goto cleanup; | ||
631 | } | ||
632 | |||
633 | ring->virtual_start = ring->map.handle; | ||
634 | ret = ring->init(dev, ring); | ||
635 | if (ret != 0) { | ||
636 | intel_cleanup_ring_buffer(dev, ring); | ||
637 | return ret; | ||
638 | } | ||
639 | |||
640 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | ||
641 | i915_kernel_lost_context(dev); | ||
642 | else { | ||
643 | ring->head = ring->get_head(dev, ring); | ||
644 | ring->tail = ring->get_tail(dev, ring); | ||
645 | ring->space = ring->head - (ring->tail + 8); | ||
646 | if (ring->space < 0) | ||
647 | ring->space += ring->size; | ||
648 | } | ||
649 | INIT_LIST_HEAD(&ring->active_list); | ||
650 | INIT_LIST_HEAD(&ring->request_list); | ||
651 | return ret; | ||
652 | cleanup: | ||
653 | cleanup_status_page(dev, ring); | ||
654 | return ret; | ||
655 | } | ||
656 | |||
657 | void intel_cleanup_ring_buffer(struct drm_device *dev, | ||
658 | struct intel_ring_buffer *ring) | ||
659 | { | ||
660 | if (ring->gem_object == NULL) | ||
661 | return; | ||
662 | |||
663 | drm_core_ioremapfree(&ring->map, dev); | ||
664 | |||
665 | i915_gem_object_unpin(ring->gem_object); | ||
666 | drm_gem_object_unreference(ring->gem_object); | ||
667 | ring->gem_object = NULL; | ||
668 | cleanup_status_page(dev, ring); | ||
669 | } | ||
670 | |||
671 | int intel_wrap_ring_buffer(struct drm_device *dev, | ||
672 | struct intel_ring_buffer *ring) | ||
673 | { | ||
674 | unsigned int *virt; | ||
675 | int rem; | ||
676 | rem = ring->size - ring->tail; | ||
677 | |||
678 | if (ring->space < rem) { | ||
679 | int ret = intel_wait_ring_buffer(dev, ring, rem); | ||
680 | if (ret) | ||
681 | return ret; | ||
682 | } | ||
683 | |||
684 | virt = (unsigned int *)(ring->virtual_start + ring->tail); | ||
685 | rem /= 4; | ||
686 | while (rem--) | ||
687 | *virt++ = MI_NOOP; | ||
688 | |||
689 | ring->tail = 0; | ||
690 | |||
691 | return 0; | ||
692 | } | ||
693 | |||
694 | int intel_wait_ring_buffer(struct drm_device *dev, | ||
695 | struct intel_ring_buffer *ring, int n) | ||
696 | { | ||
697 | unsigned long end; | ||
698 | |||
699 | trace_i915_ring_wait_begin (dev); | ||
700 | end = jiffies + 3 * HZ; | ||
701 | do { | ||
702 | ring->head = ring->get_head(dev, ring); | ||
703 | ring->space = ring->head - (ring->tail + 8); | ||
704 | if (ring->space < 0) | ||
705 | ring->space += ring->size; | ||
706 | if (ring->space >= n) { | ||
707 | trace_i915_ring_wait_end (dev); | ||
708 | return 0; | ||
709 | } | ||
710 | |||
711 | if (dev->primary->master) { | ||
712 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | ||
713 | if (master_priv->sarea_priv) | ||
714 | master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; | ||
715 | } | ||
716 | |||
717 | yield(); | ||
718 | } while (!time_after(jiffies, end)); | ||
719 | trace_i915_ring_wait_end (dev); | ||
720 | return -EBUSY; | ||
721 | } | ||
722 | |||
723 | void intel_ring_begin(struct drm_device *dev, | ||
724 | struct intel_ring_buffer *ring, int n) | ||
725 | { | ||
726 | if (unlikely(ring->tail + n > ring->size)) | ||
727 | intel_wrap_ring_buffer(dev, ring); | ||
728 | if (unlikely(ring->space < n)) | ||
729 | intel_wait_ring_buffer(dev, ring, n); | ||
730 | } | ||
731 | |||
732 | void intel_ring_emit(struct drm_device *dev, | ||
733 | struct intel_ring_buffer *ring, unsigned int data) | ||
734 | { | ||
735 | unsigned int *virt = ring->virtual_start + ring->tail; | ||
736 | *virt = data; | ||
737 | ring->tail += 4; | ||
738 | ring->tail &= ring->size - 1; | ||
739 | ring->space -= 4; | ||
740 | } | ||
741 | |||
742 | void intel_ring_advance(struct drm_device *dev, | ||
743 | struct intel_ring_buffer *ring) | ||
744 | { | ||
745 | ring->advance_ring(dev, ring); | ||
746 | } | ||
747 | |||
748 | void intel_fill_struct(struct drm_device *dev, | ||
749 | struct intel_ring_buffer *ring, | ||
750 | void *data, | ||
751 | unsigned int len) | ||
752 | { | ||
753 | unsigned int *virt = ring->virtual_start + ring->tail; | ||
754 | BUG_ON((len&~(4-1)) != 0); | ||
755 | intel_ring_begin(dev, ring, len); | ||
756 | memcpy(virt, data, len); | ||
757 | ring->tail += len; | ||
758 | ring->tail &= ring->size - 1; | ||
759 | ring->space -= len; | ||
760 | intel_ring_advance(dev, ring); | ||
761 | } | ||
762 | |||
763 | u32 intel_ring_get_seqno(struct drm_device *dev, | ||
764 | struct intel_ring_buffer *ring) | ||
765 | { | ||
766 | u32 seqno; | ||
767 | seqno = ring->next_seqno; | ||
768 | |||
769 | /* reserve 0 for non-seqno */ | ||
770 | if (++ring->next_seqno == 0) | ||
771 | ring->next_seqno = 1; | ||
772 | return seqno; | ||
773 | } | ||
774 | |||
775 | struct intel_ring_buffer render_ring = { | ||
776 | .name = "render ring", | ||
777 | .regs = { | ||
778 | .ctl = PRB0_CTL, | ||
779 | .head = PRB0_HEAD, | ||
780 | .tail = PRB0_TAIL, | ||
781 | .start = PRB0_START | ||
782 | }, | ||
783 | .ring_flag = I915_EXEC_RENDER, | ||
784 | .size = 32 * PAGE_SIZE, | ||
785 | .alignment = PAGE_SIZE, | ||
786 | .virtual_start = NULL, | ||
787 | .dev = NULL, | ||
788 | .gem_object = NULL, | ||
789 | .head = 0, | ||
790 | .tail = 0, | ||
791 | .space = 0, | ||
792 | .next_seqno = 1, | ||
793 | .user_irq_refcount = 0, | ||
794 | .irq_gem_seqno = 0, | ||
795 | .waiting_gem_seqno = 0, | ||
796 | .setup_status_page = render_setup_status_page, | ||
797 | .init = init_render_ring, | ||
798 | .get_head = render_ring_get_head, | ||
799 | .get_tail = render_ring_get_tail, | ||
800 | .get_active_head = render_ring_get_active_head, | ||
801 | .advance_ring = render_ring_advance_ring, | ||
802 | .flush = render_ring_flush, | ||
803 | .add_request = render_ring_add_request, | ||
804 | .get_gem_seqno = render_ring_get_gem_seqno, | ||
805 | .user_irq_get = render_ring_get_user_irq, | ||
806 | .user_irq_put = render_ring_put_user_irq, | ||
807 | .dispatch_gem_execbuffer = render_ring_dispatch_gem_execbuffer, | ||
808 | .status_page = {NULL, 0, NULL}, | ||
809 | .map = {0,} | ||
810 | }; | ||
811 | |||
812 | /* ring buffer for bit-stream decoder */ | ||
813 | |||
814 | struct intel_ring_buffer bsd_ring = { | ||
815 | .name = "bsd ring", | ||
816 | .regs = { | ||
817 | .ctl = BSD_RING_CTL, | ||
818 | .head = BSD_RING_HEAD, | ||
819 | .tail = BSD_RING_TAIL, | ||
820 | .start = BSD_RING_START | ||
821 | }, | ||
822 | .ring_flag = I915_EXEC_BSD, | ||
823 | .size = 32 * PAGE_SIZE, | ||
824 | .alignment = PAGE_SIZE, | ||
825 | .virtual_start = NULL, | ||
826 | .dev = NULL, | ||
827 | .gem_object = NULL, | ||
828 | .head = 0, | ||
829 | .tail = 0, | ||
830 | .space = 0, | ||
831 | .next_seqno = 1, | ||
832 | .user_irq_refcount = 0, | ||
833 | .irq_gem_seqno = 0, | ||
834 | .waiting_gem_seqno = 0, | ||
835 | .setup_status_page = bsd_setup_status_page, | ||
836 | .init = init_bsd_ring, | ||
837 | .get_head = bsd_ring_get_head, | ||
838 | .get_tail = bsd_ring_get_tail, | ||
839 | .get_active_head = bsd_ring_get_active_head, | ||
840 | .advance_ring = bsd_ring_advance_ring, | ||
841 | .flush = bsd_ring_flush, | ||
842 | .add_request = bsd_ring_add_request, | ||
843 | .get_gem_seqno = bsd_ring_get_gem_seqno, | ||
844 | .user_irq_get = bsd_ring_get_user_irq, | ||
845 | .user_irq_put = bsd_ring_put_user_irq, | ||
846 | .dispatch_gem_execbuffer = bsd_ring_dispatch_gem_execbuffer, | ||
847 | .status_page = {NULL, 0, NULL}, | ||
848 | .map = {0,} | ||
849 | }; | ||
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h new file mode 100644 index 000000000000..d5568d3766de --- /dev/null +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -0,0 +1,124 @@ | |||
1 | #ifndef _INTEL_RINGBUFFER_H_ | ||
2 | #define _INTEL_RINGBUFFER_H_ | ||
3 | |||
4 | struct intel_hw_status_page { | ||
5 | void *page_addr; | ||
6 | unsigned int gfx_addr; | ||
7 | struct drm_gem_object *obj; | ||
8 | }; | ||
9 | |||
10 | struct drm_i915_gem_execbuffer2; | ||
11 | struct intel_ring_buffer { | ||
12 | const char *name; | ||
13 | struct ring_regs { | ||
14 | u32 ctl; | ||
15 | u32 head; | ||
16 | u32 tail; | ||
17 | u32 start; | ||
18 | } regs; | ||
19 | unsigned int ring_flag; | ||
20 | unsigned long size; | ||
21 | unsigned int alignment; | ||
22 | void *virtual_start; | ||
23 | struct drm_device *dev; | ||
24 | struct drm_gem_object *gem_object; | ||
25 | |||
26 | unsigned int head; | ||
27 | unsigned int tail; | ||
28 | unsigned int space; | ||
29 | u32 next_seqno; | ||
30 | struct intel_hw_status_page status_page; | ||
31 | |||
32 | u32 irq_gem_seqno; /* last seq seem at irq time */ | ||
33 | u32 waiting_gem_seqno; | ||
34 | int user_irq_refcount; | ||
35 | void (*user_irq_get)(struct drm_device *dev, | ||
36 | struct intel_ring_buffer *ring); | ||
37 | void (*user_irq_put)(struct drm_device *dev, | ||
38 | struct intel_ring_buffer *ring); | ||
39 | void (*setup_status_page)(struct drm_device *dev, | ||
40 | struct intel_ring_buffer *ring); | ||
41 | |||
42 | int (*init)(struct drm_device *dev, | ||
43 | struct intel_ring_buffer *ring); | ||
44 | |||
45 | unsigned int (*get_head)(struct drm_device *dev, | ||
46 | struct intel_ring_buffer *ring); | ||
47 | unsigned int (*get_tail)(struct drm_device *dev, | ||
48 | struct intel_ring_buffer *ring); | ||
49 | unsigned int (*get_active_head)(struct drm_device *dev, | ||
50 | struct intel_ring_buffer *ring); | ||
51 | void (*advance_ring)(struct drm_device *dev, | ||
52 | struct intel_ring_buffer *ring); | ||
53 | void (*flush)(struct drm_device *dev, | ||
54 | struct intel_ring_buffer *ring, | ||
55 | u32 invalidate_domains, | ||
56 | u32 flush_domains); | ||
57 | u32 (*add_request)(struct drm_device *dev, | ||
58 | struct intel_ring_buffer *ring, | ||
59 | struct drm_file *file_priv, | ||
60 | u32 flush_domains); | ||
61 | u32 (*get_gem_seqno)(struct drm_device *dev, | ||
62 | struct intel_ring_buffer *ring); | ||
63 | int (*dispatch_gem_execbuffer)(struct drm_device *dev, | ||
64 | struct intel_ring_buffer *ring, | ||
65 | struct drm_i915_gem_execbuffer2 *exec, | ||
66 | struct drm_clip_rect *cliprects, | ||
67 | uint64_t exec_offset); | ||
68 | |||
69 | /** | ||
70 | * List of objects currently involved in rendering from the | ||
71 | * ringbuffer. | ||
72 | * | ||
73 | * Includes buffers having the contents of their GPU caches | ||
74 | * flushed, not necessarily primitives. last_rendering_seqno | ||
75 | * represents when the rendering involved will be completed. | ||
76 | * | ||
77 | * A reference is held on the buffer while on this list. | ||
78 | */ | ||
79 | struct list_head active_list; | ||
80 | |||
81 | /** | ||
82 | * List of breadcrumbs associated with GPU requests currently | ||
83 | * outstanding. | ||
84 | */ | ||
85 | struct list_head request_list; | ||
86 | |||
87 | wait_queue_head_t irq_queue; | ||
88 | drm_local_map_t map; | ||
89 | }; | ||
90 | |||
91 | static inline u32 | ||
92 | intel_read_status_page(struct intel_ring_buffer *ring, | ||
93 | int reg) | ||
94 | { | ||
95 | u32 *regs = ring->status_page.page_addr; | ||
96 | return regs[reg]; | ||
97 | } | ||
98 | |||
99 | int intel_init_ring_buffer(struct drm_device *dev, | ||
100 | struct intel_ring_buffer *ring); | ||
101 | void intel_cleanup_ring_buffer(struct drm_device *dev, | ||
102 | struct intel_ring_buffer *ring); | ||
103 | int intel_wait_ring_buffer(struct drm_device *dev, | ||
104 | struct intel_ring_buffer *ring, int n); | ||
105 | int intel_wrap_ring_buffer(struct drm_device *dev, | ||
106 | struct intel_ring_buffer *ring); | ||
107 | void intel_ring_begin(struct drm_device *dev, | ||
108 | struct intel_ring_buffer *ring, int n); | ||
109 | void intel_ring_emit(struct drm_device *dev, | ||
110 | struct intel_ring_buffer *ring, u32 data); | ||
111 | void intel_fill_struct(struct drm_device *dev, | ||
112 | struct intel_ring_buffer *ring, | ||
113 | void *data, | ||
114 | unsigned int len); | ||
115 | void intel_ring_advance(struct drm_device *dev, | ||
116 | struct intel_ring_buffer *ring); | ||
117 | |||
118 | u32 intel_ring_get_seqno(struct drm_device *dev, | ||
119 | struct intel_ring_buffer *ring); | ||
120 | |||
121 | extern struct intel_ring_buffer render_ring; | ||
122 | extern struct intel_ring_buffer bsd_ring; | ||
123 | |||
124 | #endif /* _INTEL_RINGBUFFER_H_ */ | ||
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index aba72c489a2f..76993ac16cc1 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1479,7 +1479,7 @@ intel_find_analog_connector(struct drm_device *dev) | |||
1479 | intel_encoder = enc_to_intel_encoder(encoder); | 1479 | intel_encoder = enc_to_intel_encoder(encoder); |
1480 | if (intel_encoder->type == INTEL_OUTPUT_ANALOG) { | 1480 | if (intel_encoder->type == INTEL_OUTPUT_ANALOG) { |
1481 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 1481 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
1482 | if (connector && encoder == intel_attached_encoder(connector)) | 1482 | if (encoder == intel_attached_encoder(connector)) |
1483 | return connector; | 1483 | return connector; |
1484 | } | 1484 | } |
1485 | } | 1485 | } |
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c index b3b7e2879bac..8700474747e8 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.c +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c | |||
@@ -97,8 +97,10 @@ static int write_reg(struct hfcsusb *hw, __u8 reg, __u8 val) | |||
97 | hw->name, __func__, reg, val); | 97 | hw->name, __func__, reg, val); |
98 | 98 | ||
99 | spin_lock(&hw->ctrl_lock); | 99 | spin_lock(&hw->ctrl_lock); |
100 | if (hw->ctrl_cnt >= HFC_CTRL_BUFSIZE) | 100 | if (hw->ctrl_cnt >= HFC_CTRL_BUFSIZE) { |
101 | spin_unlock(&hw->ctrl_lock); | ||
101 | return 1; | 102 | return 1; |
103 | } | ||
102 | buf = &hw->ctrl_buff[hw->ctrl_in_idx]; | 104 | buf = &hw->ctrl_buff[hw->ctrl_in_idx]; |
103 | buf->hfcs_reg = reg; | 105 | buf->hfcs_reg = reg; |
104 | buf->reg_val = val; | 106 | buf->reg_val = val; |
diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c index 0a3553df065f..54ae71a907f9 100644 --- a/drivers/isdn/hardware/mISDN/netjet.c +++ b/drivers/isdn/hardware/mISDN/netjet.c | |||
@@ -320,12 +320,12 @@ inittiger(struct tiger_hw *card) | |||
320 | return -ENOMEM; | 320 | return -ENOMEM; |
321 | } | 321 | } |
322 | for (i = 0; i < 2; i++) { | 322 | for (i = 0; i < 2; i++) { |
323 | card->bc[i].hsbuf = kmalloc(NJ_DMA_TXSIZE, GFP_KERNEL); | 323 | card->bc[i].hsbuf = kmalloc(NJ_DMA_TXSIZE, GFP_ATOMIC); |
324 | if (!card->bc[i].hsbuf) { | 324 | if (!card->bc[i].hsbuf) { |
325 | pr_info("%s: no B%d send buffer\n", card->name, i + 1); | 325 | pr_info("%s: no B%d send buffer\n", card->name, i + 1); |
326 | return -ENOMEM; | 326 | return -ENOMEM; |
327 | } | 327 | } |
328 | card->bc[i].hrbuf = kmalloc(NJ_DMA_RXSIZE, GFP_KERNEL); | 328 | card->bc[i].hrbuf = kmalloc(NJ_DMA_RXSIZE, GFP_ATOMIC); |
329 | if (!card->bc[i].hrbuf) { | 329 | if (!card->bc[i].hrbuf) { |
330 | pr_info("%s: no B%d recv buffer\n", card->name, i + 1); | 330 | pr_info("%s: no B%d recv buffer\n", card->name, i + 1); |
331 | return -ENOMEM; | 331 | return -ENOMEM; |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 9d11dbf5e4da..b9ad799c719f 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -1429,7 +1429,7 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, | |||
1429 | wrb = wrb_from_mccq(adapter); | 1429 | wrb = wrb_from_mccq(adapter); |
1430 | if (!wrb) { | 1430 | if (!wrb) { |
1431 | status = -EBUSY; | 1431 | status = -EBUSY; |
1432 | goto err; | 1432 | goto err_unlock; |
1433 | } | 1433 | } |
1434 | req = cmd->va; | 1434 | req = cmd->va; |
1435 | sge = nonembedded_sgl(wrb); | 1435 | sge = nonembedded_sgl(wrb); |
@@ -1457,7 +1457,10 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, | |||
1457 | else | 1457 | else |
1458 | status = adapter->flash_status; | 1458 | status = adapter->flash_status; |
1459 | 1459 | ||
1460 | err: | 1460 | return status; |
1461 | |||
1462 | err_unlock: | ||
1463 | spin_unlock_bh(&adapter->mcc_lock); | ||
1461 | return status; | 1464 | return status; |
1462 | } | 1465 | } |
1463 | 1466 | ||
@@ -1497,7 +1500,7 @@ err: | |||
1497 | return status; | 1500 | return status; |
1498 | } | 1501 | } |
1499 | 1502 | ||
1500 | extern int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac, | 1503 | int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac, |
1501 | struct be_dma_mem *nonemb_cmd) | 1504 | struct be_dma_mem *nonemb_cmd) |
1502 | { | 1505 | { |
1503 | struct be_mcc_wrb *wrb; | 1506 | struct be_mcc_wrb *wrb; |
@@ -1590,7 +1593,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num, | |||
1590 | 1593 | ||
1591 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL, | 1594 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL, |
1592 | OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req)); | 1595 | OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req)); |
1593 | req->hdr.timeout = 4; | 1596 | req->hdr.timeout = cpu_to_le32(4); |
1594 | 1597 | ||
1595 | req->pattern = cpu_to_le64(pattern); | 1598 | req->pattern = cpu_to_le64(pattern); |
1596 | req->src_port = cpu_to_le32(port_num); | 1599 | req->src_port = cpu_to_le32(port_num); |
@@ -1662,7 +1665,7 @@ err: | |||
1662 | return status; | 1665 | return status; |
1663 | } | 1666 | } |
1664 | 1667 | ||
1665 | extern int be_cmd_get_seeprom_data(struct be_adapter *adapter, | 1668 | int be_cmd_get_seeprom_data(struct be_adapter *adapter, |
1666 | struct be_dma_mem *nonemb_cmd) | 1669 | struct be_dma_mem *nonemb_cmd) |
1667 | { | 1670 | { |
1668 | struct be_mcc_wrb *wrb; | 1671 | struct be_mcc_wrb *wrb; |
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c index 8af8442c694a..af753936e835 100644 --- a/drivers/net/can/mscan/mpc5xxx_can.c +++ b/drivers/net/can/mscan/mpc5xxx_can.c | |||
@@ -73,7 +73,7 @@ static u32 __devinit mpc52xx_can_get_clock(struct of_device *ofdev, | |||
73 | else | 73 | else |
74 | *mscan_clksrc = MSCAN_CLKSRC_XTAL; | 74 | *mscan_clksrc = MSCAN_CLKSRC_XTAL; |
75 | 75 | ||
76 | freq = mpc5xxx_get_bus_frequency(ofdev->node); | 76 | freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node); |
77 | if (!freq) | 77 | if (!freq) |
78 | return 0; | 78 | return 0; |
79 | 79 | ||
@@ -152,7 +152,7 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev, | |||
152 | } | 152 | } |
153 | 153 | ||
154 | /* Determine the MSCAN device index from the physical address */ | 154 | /* Determine the MSCAN device index from the physical address */ |
155 | pval = of_get_property(ofdev->node, "reg", &plen); | 155 | pval = of_get_property(ofdev->dev.of_node, "reg", &plen); |
156 | BUG_ON(!pval || plen < sizeof(*pval)); | 156 | BUG_ON(!pval || plen < sizeof(*pval)); |
157 | clockidx = (*pval & 0x80) ? 1 : 0; | 157 | clockidx = (*pval & 0x80) ? 1 : 0; |
158 | if (*pval & 0x2000) | 158 | if (*pval & 0x2000) |
@@ -168,11 +168,11 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev, | |||
168 | */ | 168 | */ |
169 | if (clock_name && !strcmp(clock_name, "ip")) { | 169 | if (clock_name && !strcmp(clock_name, "ip")) { |
170 | *mscan_clksrc = MSCAN_CLKSRC_IPS; | 170 | *mscan_clksrc = MSCAN_CLKSRC_IPS; |
171 | freq = mpc5xxx_get_bus_frequency(ofdev->node); | 171 | freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node); |
172 | } else { | 172 | } else { |
173 | *mscan_clksrc = MSCAN_CLKSRC_BUS; | 173 | *mscan_clksrc = MSCAN_CLKSRC_BUS; |
174 | 174 | ||
175 | pval = of_get_property(ofdev->node, | 175 | pval = of_get_property(ofdev->dev.of_node, |
176 | "fsl,mscan-clock-divider", &plen); | 176 | "fsl,mscan-clock-divider", &plen); |
177 | if (pval && plen == sizeof(*pval)) | 177 | if (pval && plen == sizeof(*pval)) |
178 | clockdiv = *pval; | 178 | clockdiv = *pval; |
@@ -251,7 +251,7 @@ static int __devinit mpc5xxx_can_probe(struct of_device *ofdev, | |||
251 | const struct of_device_id *id) | 251 | const struct of_device_id *id) |
252 | { | 252 | { |
253 | struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; | 253 | struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data; |
254 | struct device_node *np = ofdev->node; | 254 | struct device_node *np = ofdev->dev.of_node; |
255 | struct net_device *dev; | 255 | struct net_device *dev; |
256 | struct mscan_priv *priv; | 256 | struct mscan_priv *priv; |
257 | void __iomem *base; | 257 | void __iomem *base; |
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index 5d45084b287d..48e91b6242ce 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c | |||
@@ -504,17 +504,54 @@ static int get_regs_len(struct net_device *dev) | |||
504 | } | 504 | } |
505 | 505 | ||
506 | /* Some transmit errors cause the transmitter to shut | 506 | /* Some transmit errors cause the transmitter to shut |
507 | * down. We now issue a restart transmit. Since the | 507 | * down. We now issue a restart transmit. |
508 | * errors close the BD and update the pointers, the restart | 508 | * Also, to workaround 8260 device erratum CPM37, we must |
509 | * _should_ pick up without having to reset any of our | 509 | * disable and then re-enable the transmitterfollowing a |
510 | * pointers either. Also, To workaround 8260 device erratum | 510 | * Late Collision, Underrun, or Retry Limit error. |
511 | * CPM37, we must disable and then re-enable the transmitter | 511 | * In addition, tbptr may point beyond BDs beyond still marked |
512 | * following a Late Collision, Underrun, or Retry Limit error. | 512 | * as ready due to internal pipelining, so we need to look back |
513 | * through the BDs and adjust tbptr to point to the last BD | ||
514 | * marked as ready. This may result in some buffers being | ||
515 | * retransmitted. | ||
513 | */ | 516 | */ |
514 | static void tx_restart(struct net_device *dev) | 517 | static void tx_restart(struct net_device *dev) |
515 | { | 518 | { |
516 | struct fs_enet_private *fep = netdev_priv(dev); | 519 | struct fs_enet_private *fep = netdev_priv(dev); |
517 | fcc_t __iomem *fccp = fep->fcc.fccp; | 520 | fcc_t __iomem *fccp = fep->fcc.fccp; |
521 | const struct fs_platform_info *fpi = fep->fpi; | ||
522 | fcc_enet_t __iomem *ep = fep->fcc.ep; | ||
523 | cbd_t __iomem *curr_tbptr; | ||
524 | cbd_t __iomem *recheck_bd; | ||
525 | cbd_t __iomem *prev_bd; | ||
526 | cbd_t __iomem *last_tx_bd; | ||
527 | |||
528 | last_tx_bd = fep->tx_bd_base + (fpi->tx_ring * sizeof(cbd_t)); | ||
529 | |||
530 | /* get the current bd held in TBPTR and scan back from this point */ | ||
531 | recheck_bd = curr_tbptr = (cbd_t __iomem *) | ||
532 | ((R32(ep, fen_genfcc.fcc_tbptr) - fep->ring_mem_addr) + | ||
533 | fep->ring_base); | ||
534 | |||
535 | prev_bd = (recheck_bd == fep->tx_bd_base) ? last_tx_bd : recheck_bd - 1; | ||
536 | |||
537 | /* Move through the bds in reverse, look for the earliest buffer | ||
538 | * that is not ready. Adjust TBPTR to the following buffer */ | ||
539 | while ((CBDR_SC(prev_bd) & BD_ENET_TX_READY) != 0) { | ||
540 | /* Go back one buffer */ | ||
541 | recheck_bd = prev_bd; | ||
542 | |||
543 | /* update the previous buffer */ | ||
544 | prev_bd = (prev_bd == fep->tx_bd_base) ? last_tx_bd : prev_bd - 1; | ||
545 | |||
546 | /* We should never see all bds marked as ready, check anyway */ | ||
547 | if (recheck_bd == curr_tbptr) | ||
548 | break; | ||
549 | } | ||
550 | /* Now update the TBPTR and dirty flag to the current buffer */ | ||
551 | W32(ep, fen_genfcc.fcc_tbptr, | ||
552 | (uint) (((void *)recheck_bd - fep->ring_base) + | ||
553 | fep->ring_mem_addr)); | ||
554 | fep->dirty_tx = recheck_bd; | ||
518 | 555 | ||
519 | C32(fccp, fcc_gfmr, FCC_GFMR_ENT); | 556 | C32(fccp, fcc_gfmr, FCC_GFMR_ENT); |
520 | udelay(10); | 557 | udelay(10); |
diff --git a/drivers/net/greth.c b/drivers/net/greth.c index f37a4c143ddd..3a029d02c2b4 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c | |||
@@ -1607,14 +1607,13 @@ static struct of_device_id greth_of_match[] = { | |||
1607 | MODULE_DEVICE_TABLE(of, greth_of_match); | 1607 | MODULE_DEVICE_TABLE(of, greth_of_match); |
1608 | 1608 | ||
1609 | static struct of_platform_driver greth_of_driver = { | 1609 | static struct of_platform_driver greth_of_driver = { |
1610 | .name = "grlib-greth", | 1610 | .driver = { |
1611 | .match_table = greth_of_match, | 1611 | .name = "grlib-greth", |
1612 | .owner = THIS_MODULE, | ||
1613 | .of_match_table = greth_of_match, | ||
1614 | }, | ||
1612 | .probe = greth_of_probe, | 1615 | .probe = greth_of_probe, |
1613 | .remove = __devexit_p(greth_of_remove), | 1616 | .remove = __devexit_p(greth_of_remove), |
1614 | .driver = { | ||
1615 | .owner = THIS_MODULE, | ||
1616 | .name = "grlib-greth", | ||
1617 | }, | ||
1618 | }; | 1617 | }; |
1619 | 1618 | ||
1620 | static int __init greth_init(void) | 1619 | static int __init greth_init(void) |
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c index c80ca64277b2..7805bbf1d53a 100644 --- a/drivers/net/ksz884x.c +++ b/drivers/net/ksz884x.c | |||
@@ -4854,7 +4854,7 @@ static inline void copy_old_skb(struct sk_buff *old, struct sk_buff *skb) | |||
4854 | * | 4854 | * |
4855 | * Return 0 if successful; otherwise an error code indicating failure. | 4855 | * Return 0 if successful; otherwise an error code indicating failure. |
4856 | */ | 4856 | */ |
4857 | static int netdev_tx(struct sk_buff *skb, struct net_device *dev) | 4857 | static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev) |
4858 | { | 4858 | { |
4859 | struct dev_priv *priv = netdev_priv(dev); | 4859 | struct dev_priv *priv = netdev_priv(dev); |
4860 | struct dev_info *hw_priv = priv->adapter; | 4860 | struct dev_info *hw_priv = priv->adapter; |
@@ -6863,6 +6863,7 @@ static const struct net_device_ops netdev_ops = { | |||
6863 | .ndo_tx_timeout = netdev_tx_timeout, | 6863 | .ndo_tx_timeout = netdev_tx_timeout, |
6864 | .ndo_change_mtu = netdev_change_mtu, | 6864 | .ndo_change_mtu = netdev_change_mtu, |
6865 | .ndo_set_mac_address = netdev_set_mac_address, | 6865 | .ndo_set_mac_address = netdev_set_mac_address, |
6866 | .ndo_validate_addr = eth_validate_addr, | ||
6866 | .ndo_do_ioctl = netdev_ioctl, | 6867 | .ndo_do_ioctl = netdev_ioctl, |
6867 | .ndo_set_rx_mode = netdev_set_rx_mode, | 6868 | .ndo_set_rx_mode = netdev_set_rx_mode, |
6868 | #ifdef CONFIG_NET_POLL_CONTROLLER | 6869 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 78eb3190b9b1..1edb7a61983c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -340,7 +340,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp) | |||
340 | 340 | ||
341 | skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len); | 341 | skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len); |
342 | 342 | ||
343 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 2, skb); | 343 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 2, skb, gfp); |
344 | if (err < 0) | 344 | if (err < 0) |
345 | dev_kfree_skb(skb); | 345 | dev_kfree_skb(skb); |
346 | 346 | ||
@@ -385,8 +385,8 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp) | |||
385 | 385 | ||
386 | /* chain first in list head */ | 386 | /* chain first in list head */ |
387 | first->private = (unsigned long)list; | 387 | first->private = (unsigned long)list; |
388 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2, | 388 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2, |
389 | first); | 389 | first, gfp); |
390 | if (err < 0) | 390 | if (err < 0) |
391 | give_pages(vi, first); | 391 | give_pages(vi, first); |
392 | 392 | ||
@@ -404,7 +404,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp) | |||
404 | 404 | ||
405 | sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE); | 405 | sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE); |
406 | 406 | ||
407 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 1, page); | 407 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 1, page, gfp); |
408 | if (err < 0) | 408 | if (err < 0) |
409 | give_pages(vi, page); | 409 | give_pages(vi, page); |
410 | 410 | ||
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c index 82ab532a4923..a93dc18a45c3 100644 --- a/drivers/net/wireless/ath/ar9170/usb.c +++ b/drivers/net/wireless/ath/ar9170/usb.c | |||
@@ -739,17 +739,27 @@ err_out: | |||
739 | static void ar9170_usb_firmware_failed(struct ar9170_usb *aru) | 739 | static void ar9170_usb_firmware_failed(struct ar9170_usb *aru) |
740 | { | 740 | { |
741 | struct device *parent = aru->udev->dev.parent; | 741 | struct device *parent = aru->udev->dev.parent; |
742 | struct usb_device *udev; | ||
743 | |||
744 | /* | ||
745 | * Store a copy of the usb_device pointer locally. | ||
746 | * This is because device_release_driver initiates | ||
747 | * ar9170_usb_disconnect, which in turn frees our | ||
748 | * driver context (aru). | ||
749 | */ | ||
750 | udev = aru->udev; | ||
742 | 751 | ||
743 | complete(&aru->firmware_loading_complete); | 752 | complete(&aru->firmware_loading_complete); |
744 | 753 | ||
745 | /* unbind anything failed */ | 754 | /* unbind anything failed */ |
746 | if (parent) | 755 | if (parent) |
747 | device_lock(parent); | 756 | device_lock(parent); |
748 | device_release_driver(&aru->udev->dev); | 757 | |
758 | device_release_driver(&udev->dev); | ||
749 | if (parent) | 759 | if (parent) |
750 | device_unlock(parent); | 760 | device_unlock(parent); |
751 | 761 | ||
752 | usb_put_dev(aru->udev); | 762 | usb_put_dev(udev); |
753 | } | 763 | } |
754 | 764 | ||
755 | static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) | 765 | static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context) |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 3db19172b43b..859aa4ab0769 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1198,7 +1198,7 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) | |||
1198 | int r; | 1198 | int r; |
1199 | 1199 | ||
1200 | ath_print(common, ATH_DBG_FATAL, | 1200 | ath_print(common, ATH_DBG_FATAL, |
1201 | "Unable to stop TxDMA. Reset HAL!\n"); | 1201 | "Failed to stop TX DMA. Resetting hardware!\n"); |
1202 | 1202 | ||
1203 | spin_lock_bh(&sc->sc_resetlock); | 1203 | spin_lock_bh(&sc->sc_resetlock); |
1204 | r = ath9k_hw_reset(ah, sc->sc_ah->curchan, false); | 1204 | r = ath9k_hw_reset(ah, sc->sc_ah->curchan, false); |
@@ -1728,6 +1728,8 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf, | |||
1728 | } else | 1728 | } else |
1729 | bf->bf_isnullfunc = false; | 1729 | bf->bf_isnullfunc = false; |
1730 | 1730 | ||
1731 | bf->bf_tx_aborted = false; | ||
1732 | |||
1731 | return 0; | 1733 | return 0; |
1732 | } | 1734 | } |
1733 | 1735 | ||
@@ -1989,7 +1991,7 @@ static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf, | |||
1989 | int nbad = 0; | 1991 | int nbad = 0; |
1990 | int isaggr = 0; | 1992 | int isaggr = 0; |
1991 | 1993 | ||
1992 | if (bf->bf_tx_aborted) | 1994 | if (bf->bf_lastbf->bf_tx_aborted) |
1993 | return 0; | 1995 | return 0; |
1994 | 1996 | ||
1995 | isaggr = bf_isaggr(bf); | 1997 | isaggr = bf_isaggr(bf); |
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index a115bfa9513a..7a377f5b7662 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c | |||
@@ -329,9 +329,8 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
329 | /* create the exported radio header */ | 329 | /* create the exported radio header */ |
330 | 330 | ||
331 | /* radiotap header */ | 331 | /* radiotap header */ |
332 | radiotap_hdr.hdr.it_version = 0; | 332 | memset(&radiotap_hdr, 0, sizeof(radiotap_hdr)); |
333 | /* XXX must check this value for pad */ | 333 | /* XXX must check radiotap_hdr.hdr.it_pad for pad */ |
334 | radiotap_hdr.hdr.it_pad = 0; | ||
335 | radiotap_hdr.hdr.it_len = cpu_to_le16 (sizeof(struct rx_radiotap_hdr)); | 334 | radiotap_hdr.hdr.it_len = cpu_to_le16 (sizeof(struct rx_radiotap_hdr)); |
336 | radiotap_hdr.hdr.it_present = cpu_to_le32 (RX_RADIOTAP_PRESENT); | 335 | radiotap_hdr.hdr.it_present = cpu_to_le32 (RX_RADIOTAP_PRESENT); |
337 | radiotap_hdr.rate = convert_mv_rate_to_radiotap(prxpd->rx_rate); | 336 | radiotap_hdr.rate = convert_mv_rate_to_radiotap(prxpd->rx_rate); |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 699161327d65..0f8b84b7224c 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -413,7 +413,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
413 | */ | 413 | */ |
414 | rt2x00_desc_read(txi, 0, &word); | 414 | rt2x00_desc_read(txi, 0, &word); |
415 | rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, | 415 | rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, |
416 | skb->len - TXINFO_DESC_SIZE); | 416 | skb->len + TXWI_DESC_SIZE); |
417 | rt2x00_set_field32(&word, TXINFO_W0_WIV, | 417 | rt2x00_set_field32(&word, TXINFO_W0_WIV, |
418 | !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags)); | 418 | !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags)); |
419 | rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2); | 419 | rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2); |
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 576c3ed92435..40658e3385b4 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
@@ -524,7 +524,7 @@ int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, | |||
524 | for (i = 0; i < inlen; i++) | 524 | for (i = 0; i < inlen; i++) |
525 | ipc_data_writel(*in++, 4 * i); | 525 | ipc_data_writel(*in++, 4 * i); |
526 | 526 | ||
527 | ipc_command(cmd << 12 | sub); | 527 | ipc_command((cmd << 12) | sub | (inlen << 18)); |
528 | err = busy_loop(); | 528 | err = busy_loop(); |
529 | 529 | ||
530 | for (i = 0; i < outlen; i++) | 530 | for (i = 0; i < outlen; i++) |
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c index 989e2752cc36..6dcda86be6eb 100644 --- a/drivers/ssb/pci.c +++ b/drivers/ssb/pci.c | |||
@@ -625,9 +625,12 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus, | |||
625 | ssb_printk(KERN_ERR PFX "No SPROM available!\n"); | 625 | ssb_printk(KERN_ERR PFX "No SPROM available!\n"); |
626 | return -ENODEV; | 626 | return -ENODEV; |
627 | } | 627 | } |
628 | 628 | if (bus->chipco.dev) { /* can be unavailible! */ | |
629 | bus->sprom_offset = (bus->chipco.dev->id.revision < 31) ? | 629 | bus->sprom_offset = (bus->chipco.dev->id.revision < 31) ? |
630 | SSB_SPROM_BASE1 : SSB_SPROM_BASE31; | 630 | SSB_SPROM_BASE1 : SSB_SPROM_BASE31; |
631 | } else { | ||
632 | bus->sprom_offset = SSB_SPROM_BASE1; | ||
633 | } | ||
631 | 634 | ||
632 | buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL); | 635 | buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL); |
633 | if (!buf) | 636 | if (!buf) |
diff --git a/drivers/ssb/sprom.c b/drivers/ssb/sprom.c index 007bc3a03486..4f7cc8d13277 100644 --- a/drivers/ssb/sprom.c +++ b/drivers/ssb/sprom.c | |||
@@ -185,6 +185,7 @@ bool ssb_is_sprom_available(struct ssb_bus *bus) | |||
185 | /* this routine differs from specs as we do not access SPROM directly | 185 | /* this routine differs from specs as we do not access SPROM directly |
186 | on PCMCIA */ | 186 | on PCMCIA */ |
187 | if (bus->bustype == SSB_BUSTYPE_PCI && | 187 | if (bus->bustype == SSB_BUSTYPE_PCI && |
188 | bus->chipco.dev && /* can be unavailible! */ | ||
188 | bus->chipco.dev->id.revision >= 31) | 189 | bus->chipco.dev->id.revision >= 31) |
189 | return bus->chipco.capabilities & SSB_CHIPCO_CAP_SPROM; | 190 | return bus->chipco.capabilities & SSB_CHIPCO_CAP_SPROM; |
190 | 191 | ||
diff --git a/fs/afs/server.c b/fs/afs/server.c index f49099516675..9fdc7fe3a7bc 100644 --- a/fs/afs/server.c +++ b/fs/afs/server.c | |||
@@ -91,9 +91,10 @@ static struct afs_server *afs_alloc_server(struct afs_cell *cell, | |||
91 | 91 | ||
92 | memcpy(&server->addr, addr, sizeof(struct in_addr)); | 92 | memcpy(&server->addr, addr, sizeof(struct in_addr)); |
93 | server->addr.s_addr = addr->s_addr; | 93 | server->addr.s_addr = addr->s_addr; |
94 | _leave(" = %p{%d}", server, atomic_read(&server->usage)); | ||
95 | } else { | ||
96 | _leave(" = NULL [nomem]"); | ||
94 | } | 97 | } |
95 | |||
96 | _leave(" = %p{%d}", server, atomic_read(&server->usage)); | ||
97 | return server; | 98 | return server; |
98 | } | 99 | } |
99 | 100 | ||
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 2c5f9a0e5d72..63039ed9576f 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -990,10 +990,9 @@ static int elf_fdpic_map_file_constdisp_on_uclinux( | |||
990 | 990 | ||
991 | /* clear any space allocated but not loaded */ | 991 | /* clear any space allocated but not loaded */ |
992 | if (phdr->p_filesz < phdr->p_memsz) { | 992 | if (phdr->p_filesz < phdr->p_memsz) { |
993 | ret = clear_user((void *) (seg->addr + phdr->p_filesz), | 993 | if (clear_user((void *) (seg->addr + phdr->p_filesz), |
994 | phdr->p_memsz - phdr->p_filesz); | 994 | phdr->p_memsz - phdr->p_filesz)) |
995 | if (ret) | 995 | return -EFAULT; |
996 | return ret; | ||
997 | } | 996 | } |
998 | 997 | ||
999 | if (mm) { | 998 | if (mm) { |
@@ -1027,7 +1026,7 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params, | |||
1027 | struct elf32_fdpic_loadseg *seg; | 1026 | struct elf32_fdpic_loadseg *seg; |
1028 | struct elf32_phdr *phdr; | 1027 | struct elf32_phdr *phdr; |
1029 | unsigned long load_addr, delta_vaddr; | 1028 | unsigned long load_addr, delta_vaddr; |
1030 | int loop, dvset, ret; | 1029 | int loop, dvset; |
1031 | 1030 | ||
1032 | load_addr = params->load_addr; | 1031 | load_addr = params->load_addr; |
1033 | delta_vaddr = 0; | 1032 | delta_vaddr = 0; |
@@ -1127,9 +1126,8 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params, | |||
1127 | * PT_LOAD */ | 1126 | * PT_LOAD */ |
1128 | if (prot & PROT_WRITE && disp > 0) { | 1127 | if (prot & PROT_WRITE && disp > 0) { |
1129 | kdebug("clear[%d] ad=%lx sz=%lx", loop, maddr, disp); | 1128 | kdebug("clear[%d] ad=%lx sz=%lx", loop, maddr, disp); |
1130 | ret = clear_user((void __user *) maddr, disp); | 1129 | if (clear_user((void __user *) maddr, disp)) |
1131 | if (ret) | 1130 | return -EFAULT; |
1132 | return ret; | ||
1133 | maddr += disp; | 1131 | maddr += disp; |
1134 | } | 1132 | } |
1135 | 1133 | ||
@@ -1164,19 +1162,17 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params, | |||
1164 | if (prot & PROT_WRITE && excess1 > 0) { | 1162 | if (prot & PROT_WRITE && excess1 > 0) { |
1165 | kdebug("clear[%d] ad=%lx sz=%lx", | 1163 | kdebug("clear[%d] ad=%lx sz=%lx", |
1166 | loop, maddr + phdr->p_filesz, excess1); | 1164 | loop, maddr + phdr->p_filesz, excess1); |
1167 | ret = clear_user((void __user *) maddr + phdr->p_filesz, | 1165 | if (clear_user((void __user *) maddr + phdr->p_filesz, |
1168 | excess1); | 1166 | excess1)) |
1169 | if (ret) | 1167 | return -EFAULT; |
1170 | return ret; | ||
1171 | } | 1168 | } |
1172 | 1169 | ||
1173 | #else | 1170 | #else |
1174 | if (excess > 0) { | 1171 | if (excess > 0) { |
1175 | kdebug("clear[%d] ad=%lx sz=%lx", | 1172 | kdebug("clear[%d] ad=%lx sz=%lx", |
1176 | loop, maddr + phdr->p_filesz, excess); | 1173 | loop, maddr + phdr->p_filesz, excess); |
1177 | ret = clear_user((void *) maddr + phdr->p_filesz, excess); | 1174 | if (clear_user((void *) maddr + phdr->p_filesz, excess)) |
1178 | if (ret) | 1175 | return -EFAULT; |
1179 | return ret; | ||
1180 | } | 1176 | } |
1181 | #endif | 1177 | #endif |
1182 | 1178 | ||
diff --git a/fs/fscache/page.c b/fs/fscache/page.c index 47aefd376e54..723b889fd219 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c | |||
@@ -710,30 +710,26 @@ static void fscache_write_op(struct fscache_operation *_op) | |||
710 | goto superseded; | 710 | goto superseded; |
711 | } | 711 | } |
712 | 712 | ||
713 | if (page) { | 713 | radix_tree_tag_set(&cookie->stores, page->index, |
714 | radix_tree_tag_set(&cookie->stores, page->index, | 714 | FSCACHE_COOKIE_STORING_TAG); |
715 | FSCACHE_COOKIE_STORING_TAG); | 715 | radix_tree_tag_clear(&cookie->stores, page->index, |
716 | radix_tree_tag_clear(&cookie->stores, page->index, | 716 | FSCACHE_COOKIE_PENDING_TAG); |
717 | FSCACHE_COOKIE_PENDING_TAG); | ||
718 | } | ||
719 | 717 | ||
720 | spin_unlock(&cookie->stores_lock); | 718 | spin_unlock(&cookie->stores_lock); |
721 | spin_unlock(&object->lock); | 719 | spin_unlock(&object->lock); |
722 | 720 | ||
723 | if (page) { | 721 | fscache_set_op_state(&op->op, "Store"); |
724 | fscache_set_op_state(&op->op, "Store"); | 722 | fscache_stat(&fscache_n_store_pages); |
725 | fscache_stat(&fscache_n_store_pages); | 723 | fscache_stat(&fscache_n_cop_write_page); |
726 | fscache_stat(&fscache_n_cop_write_page); | 724 | ret = object->cache->ops->write_page(op, page); |
727 | ret = object->cache->ops->write_page(op, page); | 725 | fscache_stat_d(&fscache_n_cop_write_page); |
728 | fscache_stat_d(&fscache_n_cop_write_page); | 726 | fscache_set_op_state(&op->op, "EndWrite"); |
729 | fscache_set_op_state(&op->op, "EndWrite"); | 727 | fscache_end_page_write(object, page); |
730 | fscache_end_page_write(object, page); | 728 | if (ret < 0) { |
731 | if (ret < 0) { | 729 | fscache_set_op_state(&op->op, "Abort"); |
732 | fscache_set_op_state(&op->op, "Abort"); | 730 | fscache_abort_object(object); |
733 | fscache_abort_object(object); | 731 | } else { |
734 | } else { | 732 | fscache_enqueue_operation(&op->op); |
735 | fscache_enqueue_operation(&op->op); | ||
736 | } | ||
737 | } | 733 | } |
738 | 734 | ||
739 | _leave(""); | 735 | _leave(""); |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index 04f91c2d3f7b..b5043a9890d8 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -80,7 +80,7 @@ extern void setup_per_cpu_areas(void); | |||
80 | 80 | ||
81 | #ifndef PER_CPU_BASE_SECTION | 81 | #ifndef PER_CPU_BASE_SECTION |
82 | #ifdef CONFIG_SMP | 82 | #ifdef CONFIG_SMP |
83 | #define PER_CPU_BASE_SECTION ".data.percpu" | 83 | #define PER_CPU_BASE_SECTION ".data..percpu" |
84 | #else | 84 | #else |
85 | #define PER_CPU_BASE_SECTION ".data" | 85 | #define PER_CPU_BASE_SECTION ".data" |
86 | #endif | 86 | #endif |
@@ -92,15 +92,15 @@ extern void setup_per_cpu_areas(void); | |||
92 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | 92 | #define PER_CPU_SHARED_ALIGNED_SECTION "" |
93 | #define PER_CPU_ALIGNED_SECTION "" | 93 | #define PER_CPU_ALIGNED_SECTION "" |
94 | #else | 94 | #else |
95 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" | 95 | #define PER_CPU_SHARED_ALIGNED_SECTION "..shared_aligned" |
96 | #define PER_CPU_ALIGNED_SECTION ".shared_aligned" | 96 | #define PER_CPU_ALIGNED_SECTION "..shared_aligned" |
97 | #endif | 97 | #endif |
98 | #define PER_CPU_FIRST_SECTION ".first" | 98 | #define PER_CPU_FIRST_SECTION "..first" |
99 | 99 | ||
100 | #else | 100 | #else |
101 | 101 | ||
102 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | 102 | #define PER_CPU_SHARED_ALIGNED_SECTION "" |
103 | #define PER_CPU_ALIGNED_SECTION ".shared_aligned" | 103 | #define PER_CPU_ALIGNED_SECTION "..shared_aligned" |
104 | #define PER_CPU_FIRST_SECTION "" | 104 | #define PER_CPU_FIRST_SECTION "" |
105 | 105 | ||
106 | #endif | 106 | #endif |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index ef779c6fc3d7..48c5299cbf26 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -175,25 +175,25 @@ | |||
175 | #define NOSAVE_DATA \ | 175 | #define NOSAVE_DATA \ |
176 | . = ALIGN(PAGE_SIZE); \ | 176 | . = ALIGN(PAGE_SIZE); \ |
177 | VMLINUX_SYMBOL(__nosave_begin) = .; \ | 177 | VMLINUX_SYMBOL(__nosave_begin) = .; \ |
178 | *(.data.nosave) \ | 178 | *(.data..nosave) \ |
179 | . = ALIGN(PAGE_SIZE); \ | 179 | . = ALIGN(PAGE_SIZE); \ |
180 | VMLINUX_SYMBOL(__nosave_end) = .; | 180 | VMLINUX_SYMBOL(__nosave_end) = .; |
181 | 181 | ||
182 | #define PAGE_ALIGNED_DATA(page_align) \ | 182 | #define PAGE_ALIGNED_DATA(page_align) \ |
183 | . = ALIGN(page_align); \ | 183 | . = ALIGN(page_align); \ |
184 | *(.data.page_aligned) | 184 | *(.data..page_aligned) |
185 | 185 | ||
186 | #define READ_MOSTLY_DATA(align) \ | 186 | #define READ_MOSTLY_DATA(align) \ |
187 | . = ALIGN(align); \ | 187 | . = ALIGN(align); \ |
188 | *(.data.read_mostly) | 188 | *(.data..read_mostly) |
189 | 189 | ||
190 | #define CACHELINE_ALIGNED_DATA(align) \ | 190 | #define CACHELINE_ALIGNED_DATA(align) \ |
191 | . = ALIGN(align); \ | 191 | . = ALIGN(align); \ |
192 | *(.data.cacheline_aligned) | 192 | *(.data..cacheline_aligned) |
193 | 193 | ||
194 | #define INIT_TASK_DATA(align) \ | 194 | #define INIT_TASK_DATA(align) \ |
195 | . = ALIGN(align); \ | 195 | . = ALIGN(align); \ |
196 | *(.data.init_task) | 196 | *(.data..init_task) |
197 | 197 | ||
198 | /* | 198 | /* |
199 | * Read only Data | 199 | * Read only Data |
@@ -435,7 +435,7 @@ | |||
435 | */ | 435 | */ |
436 | #define INIT_TASK_DATA_SECTION(align) \ | 436 | #define INIT_TASK_DATA_SECTION(align) \ |
437 | . = ALIGN(align); \ | 437 | . = ALIGN(align); \ |
438 | .data.init_task : { \ | 438 | .data..init_task : { \ |
439 | INIT_TASK_DATA(align) \ | 439 | INIT_TASK_DATA(align) \ |
440 | } | 440 | } |
441 | 441 | ||
@@ -499,7 +499,7 @@ | |||
499 | #define BSS(bss_align) \ | 499 | #define BSS(bss_align) \ |
500 | . = ALIGN(bss_align); \ | 500 | . = ALIGN(bss_align); \ |
501 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ | 501 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ |
502 | *(.bss.page_aligned) \ | 502 | *(.bss..page_aligned) \ |
503 | *(.dynbss) \ | 503 | *(.dynbss) \ |
504 | *(.bss) \ | 504 | *(.bss) \ |
505 | *(COMMON) \ | 505 | *(COMMON) \ |
@@ -666,16 +666,16 @@ | |||
666 | */ | 666 | */ |
667 | #define PERCPU_VADDR(vaddr, phdr) \ | 667 | #define PERCPU_VADDR(vaddr, phdr) \ |
668 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 668 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
669 | .data.percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ | 669 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ |
670 | - LOAD_OFFSET) { \ | 670 | - LOAD_OFFSET) { \ |
671 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 671 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ |
672 | *(.data.percpu.first) \ | 672 | *(.data..percpu..first) \ |
673 | *(.data.percpu.page_aligned) \ | 673 | *(.data..percpu..page_aligned) \ |
674 | *(.data.percpu) \ | 674 | *(.data..percpu) \ |
675 | *(.data.percpu.shared_aligned) \ | 675 | *(.data..percpu..shared_aligned) \ |
676 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | 676 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ |
677 | } phdr \ | 677 | } phdr \ |
678 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data.percpu); | 678 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu); |
679 | 679 | ||
680 | /** | 680 | /** |
681 | * PERCPU - define output section for percpu area, simple version | 681 | * PERCPU - define output section for percpu area, simple version |
@@ -687,18 +687,18 @@ | |||
687 | * | 687 | * |
688 | * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except | 688 | * This macro is equivalent to ALIGN(align); PERCPU_VADDR( , ) except |
689 | * that __per_cpu_load is defined as a relative symbol against | 689 | * that __per_cpu_load is defined as a relative symbol against |
690 | * .data.percpu which is required for relocatable x86_32 | 690 | * .data..percpu which is required for relocatable x86_32 |
691 | * configuration. | 691 | * configuration. |
692 | */ | 692 | */ |
693 | #define PERCPU(align) \ | 693 | #define PERCPU(align) \ |
694 | . = ALIGN(align); \ | 694 | . = ALIGN(align); \ |
695 | .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { \ | 695 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ |
696 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 696 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
697 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 697 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ |
698 | *(.data.percpu.first) \ | 698 | *(.data..percpu..first) \ |
699 | *(.data.percpu.page_aligned) \ | 699 | *(.data..percpu..page_aligned) \ |
700 | *(.data.percpu) \ | 700 | *(.data..percpu) \ |
701 | *(.data.percpu.shared_aligned) \ | 701 | *(.data..percpu..shared_aligned) \ |
702 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | 702 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ |
703 | } | 703 | } |
704 | 704 | ||
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index b64a8d7cdf6d..7f0028e1010b 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -275,6 +275,7 @@ typedef struct drm_i915_irq_wait { | |||
275 | #define I915_PARAM_HAS_OVERLAY 7 | 275 | #define I915_PARAM_HAS_OVERLAY 7 |
276 | #define I915_PARAM_HAS_PAGEFLIPPING 8 | 276 | #define I915_PARAM_HAS_PAGEFLIPPING 8 |
277 | #define I915_PARAM_HAS_EXECBUF2 9 | 277 | #define I915_PARAM_HAS_EXECBUF2 9 |
278 | #define I915_PARAM_HAS_BSD 10 | ||
278 | 279 | ||
279 | typedef struct drm_i915_getparam { | 280 | typedef struct drm_i915_getparam { |
280 | int param; | 281 | int param; |
@@ -616,7 +617,9 @@ struct drm_i915_gem_execbuffer2 { | |||
616 | __u32 num_cliprects; | 617 | __u32 num_cliprects; |
617 | /** This is a struct drm_clip_rect *cliprects */ | 618 | /** This is a struct drm_clip_rect *cliprects */ |
618 | __u64 cliprects_ptr; | 619 | __u64 cliprects_ptr; |
619 | __u64 flags; /* currently unused */ | 620 | #define I915_EXEC_RENDER (1<<0) |
621 | #define I915_EXEC_BSD (1<<1) | ||
622 | __u64 flags; | ||
620 | __u64 rsvd1; | 623 | __u64 rsvd1; |
621 | __u64 rsvd2; | 624 | __u64 rsvd2; |
622 | }; | 625 | }; |
diff --git a/include/linux/cache.h b/include/linux/cache.h index 97e24881c4c6..4c570653ab84 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #ifndef __cacheline_aligned | 31 | #ifndef __cacheline_aligned |
32 | #define __cacheline_aligned \ | 32 | #define __cacheline_aligned \ |
33 | __attribute__((__aligned__(SMP_CACHE_BYTES), \ | 33 | __attribute__((__aligned__(SMP_CACHE_BYTES), \ |
34 | __section__(".data.cacheline_aligned"))) | 34 | __section__(".data..cacheline_aligned"))) |
35 | #endif /* __cacheline_aligned */ | 35 | #endif /* __cacheline_aligned */ |
36 | 36 | ||
37 | #ifndef __cacheline_aligned_in_smp | 37 | #ifndef __cacheline_aligned_in_smp |
diff --git a/include/linux/init.h b/include/linux/init.h index ab1d31f9352b..de994304e0bb 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -301,7 +301,7 @@ void __init parse_early_options(char *cmdline); | |||
301 | #endif | 301 | #endif |
302 | 302 | ||
303 | /* Data marked not to be saved by software suspend */ | 303 | /* Data marked not to be saved by software suspend */ |
304 | #define __nosavedata __section(.data.nosave) | 304 | #define __nosavedata __section(.data..nosave) |
305 | 305 | ||
306 | /* This means "can be init if no module support, otherwise module load | 306 | /* This means "can be init if no module support, otherwise module load |
307 | may call it." */ | 307 | may call it." */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 2beaa13492be..1f43fa56f600 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -183,7 +183,7 @@ extern struct cred init_cred; | |||
183 | } | 183 | } |
184 | 184 | ||
185 | /* Attach to the init_task data structure for proper alignment */ | 185 | /* Attach to the init_task data structure for proper alignment */ |
186 | #define __init_task_data __attribute__((__section__(".data.init_task"))) | 186 | #define __init_task_data __attribute__((__section__(".data..init_task"))) |
187 | 187 | ||
188 | 188 | ||
189 | #endif | 189 | #endif |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 5126cceb6ae9..7135ebc8428c 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -18,8 +18,8 @@ | |||
18 | # define asmregparm | 18 | # define asmregparm |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | #define __page_aligned_data __section(.data.page_aligned) __aligned(PAGE_SIZE) | 21 | #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) |
22 | #define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE) | 22 | #define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE) |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * For assembly routines. | 25 | * For assembly routines. |
@@ -27,8 +27,8 @@ | |||
27 | * Note when using these that you must specify the appropriate | 27 | * Note when using these that you must specify the appropriate |
28 | * alignment directives yourself | 28 | * alignment directives yourself |
29 | */ | 29 | */ |
30 | #define __PAGE_ALIGNED_DATA .section ".data.page_aligned", "aw" | 30 | #define __PAGE_ALIGNED_DATA .section ".data..page_aligned", "aw" |
31 | #define __PAGE_ALIGNED_BSS .section ".bss.page_aligned", "aw" | 31 | #define __PAGE_ALIGNED_BSS .section ".bss..page_aligned", "aw" |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * This is used by architectures to keep arguments on the stack | 34 | * This is used by architectures to keep arguments on the stack |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index c00cc0c4d0b7..24e5d01d27d0 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -397,7 +397,7 @@ struct xt_table_info { | |||
397 | * @stacksize jumps (number of user chains) can possibly be made. | 397 | * @stacksize jumps (number of user chains) can possibly be made. |
398 | */ | 398 | */ |
399 | unsigned int stacksize; | 399 | unsigned int stacksize; |
400 | unsigned int *stackptr; | 400 | unsigned int __percpu *stackptr; |
401 | void ***jumpstack; | 401 | void ***jumpstack; |
402 | /* ipt_entry tables: one per CPU */ | 402 | /* ipt_entry tables: one per CPU */ |
403 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ | 403 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 68567c0b3a5d..ce2dc655cd1d 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -131,11 +131,11 @@ | |||
131 | * Declaration/definition used for per-CPU variables that must be page aligned. | 131 | * Declaration/definition used for per-CPU variables that must be page aligned. |
132 | */ | 132 | */ |
133 | #define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ | 133 | #define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ |
134 | DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") \ | 134 | DECLARE_PER_CPU_SECTION(type, name, "..page_aligned") \ |
135 | __aligned(PAGE_SIZE) | 135 | __aligned(PAGE_SIZE) |
136 | 136 | ||
137 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | 137 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ |
138 | DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") \ | 138 | DEFINE_PER_CPU_SECTION(type, name, "..page_aligned") \ |
139 | __aligned(PAGE_SIZE) | 139 | __aligned(PAGE_SIZE) |
140 | 140 | ||
141 | /* | 141 | /* |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 7cdfb4d52847..bf243fc54959 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -501,7 +501,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | |||
501 | return __alloc_skb(size, priority, 1, -1); | 501 | return __alloc_skb(size, priority, 1, -1); |
502 | } | 502 | } |
503 | 503 | ||
504 | extern int skb_recycle_check(struct sk_buff *skb, int skb_size); | 504 | extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); |
505 | 505 | ||
506 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); | 506 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); |
507 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 507 | extern struct sk_buff *skb_clone(struct sk_buff *skb, |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 89fac6a3f78b..f8854655860e 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -60,7 +60,7 @@ | |||
60 | /* | 60 | /* |
61 | * Must define these before including other files, inline functions need them | 61 | * Must define these before including other files, inline functions need them |
62 | */ | 62 | */ |
63 | #define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME | 63 | #define LOCK_SECTION_NAME ".text..lock."KBUILD_BASENAME |
64 | 64 | ||
65 | #define LOCK_SECTION_START(extra) \ | 65 | #define LOCK_SECTION_START(extra) \ |
66 | ".subsection 1\n\t" \ | 66 | ".subsection 1\n\t" \ |
diff --git a/include/net/sock.h b/include/net/sock.h index ca241ea14875..731150d52799 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1524,20 +1524,7 @@ extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); | |||
1524 | 1524 | ||
1525 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | 1525 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
1526 | 1526 | ||
1527 | static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) | 1527 | extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb); |
1528 | { | ||
1529 | /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces | ||
1530 | number of warnings when compiling with -W --ANK | ||
1531 | */ | ||
1532 | if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= | ||
1533 | (unsigned)sk->sk_rcvbuf) | ||
1534 | return -ENOMEM; | ||
1535 | skb_set_owner_r(skb, sk); | ||
1536 | skb_queue_tail(&sk->sk_error_queue, skb); | ||
1537 | if (!sock_flag(sk, SOCK_DEAD)) | ||
1538 | sk->sk_data_ready(sk, skb->len); | ||
1539 | return 0; | ||
1540 | } | ||
1541 | 1528 | ||
1542 | /* | 1529 | /* |
1543 | * Recover an error report and clear atomically | 1530 | * Recover an error report and clear atomically |
diff --git a/init/Kconfig b/init/Kconfig index 2cce9f343ad0..5cff9a980c39 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -76,6 +76,14 @@ config INIT_ENV_ARG_LIMIT | |||
76 | variables passed to init from the kernel command line. | 76 | variables passed to init from the kernel command line. |
77 | 77 | ||
78 | 78 | ||
79 | config CROSS_COMPILE | ||
80 | string "Cross-compiler tool prefix" | ||
81 | help | ||
82 | Same as running 'make CROSS_COMPILE=prefix-' but stored for | ||
83 | default make runs in this kernel build directory. You don't | ||
84 | need to set this unless you want the configured kernel build | ||
85 | directory to select the cross-compiler automatically. | ||
86 | |||
79 | config LOCALVERSION | 87 | config LOCALVERSION |
80 | string "Local version - append to kernel release" | 88 | string "Local version - append to kernel release" |
81 | help | 89 | help |
diff --git a/kernel/cpu.c b/kernel/cpu.c index 8b92539b4754..97d1b426a4ac 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -34,7 +34,7 @@ void cpu_maps_update_done(void) | |||
34 | mutex_unlock(&cpu_add_remove_lock); | 34 | mutex_unlock(&cpu_add_remove_lock); |
35 | } | 35 | } |
36 | 36 | ||
37 | static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain); | 37 | static RAW_NOTIFIER_HEAD(cpu_chain); |
38 | 38 | ||
39 | /* If set, cpu_up and cpu_down will return -EBUSY and do nothing. | 39 | /* If set, cpu_up and cpu_down will return -EBUSY and do nothing. |
40 | * Should always be manipulated under cpu_add_remove_lock | 40 | * Should always be manipulated under cpu_add_remove_lock |
diff --git a/kernel/module.c b/kernel/module.c index 333fbcc96978..0129769301e3 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -403,7 +403,7 @@ static unsigned int find_pcpusec(Elf_Ehdr *hdr, | |||
403 | Elf_Shdr *sechdrs, | 403 | Elf_Shdr *sechdrs, |
404 | const char *secstrings) | 404 | const char *secstrings) |
405 | { | 405 | { |
406 | return find_sec(hdr, sechdrs, secstrings, ".data.percpu"); | 406 | return find_sec(hdr, sechdrs, secstrings, ".data..percpu"); |
407 | } | 407 | } |
408 | 408 | ||
409 | static void percpu_modcopy(struct module *mod, | 409 | static void percpu_modcopy(struct module *mod, |
@@ -2014,6 +2014,7 @@ static noinline struct module *load_module(void __user *umod, | |||
2014 | long err = 0; | 2014 | long err = 0; |
2015 | void *ptr = NULL; /* Stops spurious gcc warning */ | 2015 | void *ptr = NULL; /* Stops spurious gcc warning */ |
2016 | unsigned long symoffs, stroffs, *strmap; | 2016 | unsigned long symoffs, stroffs, *strmap; |
2017 | void __percpu *percpu; | ||
2017 | 2018 | ||
2018 | mm_segment_t old_fs; | 2019 | mm_segment_t old_fs; |
2019 | 2020 | ||
@@ -2158,6 +2159,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2158 | goto free_mod; | 2159 | goto free_mod; |
2159 | sechdrs[pcpuindex].sh_flags &= ~(unsigned long)SHF_ALLOC; | 2160 | sechdrs[pcpuindex].sh_flags &= ~(unsigned long)SHF_ALLOC; |
2160 | } | 2161 | } |
2162 | /* Keep this around for failure path. */ | ||
2163 | percpu = mod_percpu(mod); | ||
2161 | 2164 | ||
2162 | /* Determine total sizes, and put offsets in sh_entsize. For now | 2165 | /* Determine total sizes, and put offsets in sh_entsize. For now |
2163 | this is done generically; there doesn't appear to be any | 2166 | this is done generically; there doesn't appear to be any |
@@ -2463,7 +2466,7 @@ static noinline struct module *load_module(void __user *umod, | |||
2463 | module_free(mod, mod->module_core); | 2466 | module_free(mod, mod->module_core); |
2464 | /* mod will be freed with core. Don't access it beyond this line! */ | 2467 | /* mod will be freed with core. Don't access it beyond this line! */ |
2465 | free_percpu: | 2468 | free_percpu: |
2466 | percpu_modfree(mod); | 2469 | free_percpu(percpu); |
2467 | free_mod: | 2470 | free_mod: |
2468 | kfree(args); | 2471 | kfree(args); |
2469 | kfree(strmap); | 2472 | kfree(strmap); |
diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c index cb4325a3dc83..965c5baace40 100644 --- a/net/caif/cfserl.c +++ b/net/caif/cfserl.c | |||
@@ -59,16 +59,18 @@ static int cfserl_receive(struct cflayer *l, struct cfpkt *newpkt) | |||
59 | u8 stx = CFSERL_STX; | 59 | u8 stx = CFSERL_STX; |
60 | int ret; | 60 | int ret; |
61 | u16 expectlen = 0; | 61 | u16 expectlen = 0; |
62 | |||
62 | caif_assert(newpkt != NULL); | 63 | caif_assert(newpkt != NULL); |
63 | spin_lock(&layr->sync); | 64 | spin_lock(&layr->sync); |
64 | 65 | ||
65 | if (layr->incomplete_frm != NULL) { | 66 | if (layr->incomplete_frm != NULL) { |
66 | |||
67 | layr->incomplete_frm = | 67 | layr->incomplete_frm = |
68 | cfpkt_append(layr->incomplete_frm, newpkt, expectlen); | 68 | cfpkt_append(layr->incomplete_frm, newpkt, expectlen); |
69 | pkt = layr->incomplete_frm; | 69 | pkt = layr->incomplete_frm; |
70 | if (pkt == NULL) | 70 | if (pkt == NULL) { |
71 | spin_unlock(&layr->sync); | ||
71 | return -ENOMEM; | 72 | return -ENOMEM; |
73 | } | ||
72 | } else { | 74 | } else { |
73 | pkt = newpkt; | 75 | pkt = newpkt; |
74 | } | 76 | } |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index f8abf68e3988..9f07e749d7b1 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -482,22 +482,22 @@ EXPORT_SYMBOL(consume_skb); | |||
482 | * reference count dropping and cleans up the skbuff as if it | 482 | * reference count dropping and cleans up the skbuff as if it |
483 | * just came from __alloc_skb(). | 483 | * just came from __alloc_skb(). |
484 | */ | 484 | */ |
485 | int skb_recycle_check(struct sk_buff *skb, int skb_size) | 485 | bool skb_recycle_check(struct sk_buff *skb, int skb_size) |
486 | { | 486 | { |
487 | struct skb_shared_info *shinfo; | 487 | struct skb_shared_info *shinfo; |
488 | 488 | ||
489 | if (irqs_disabled()) | 489 | if (irqs_disabled()) |
490 | return 0; | 490 | return false; |
491 | 491 | ||
492 | if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) | 492 | if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) |
493 | return 0; | 493 | return false; |
494 | 494 | ||
495 | skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); | 495 | skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); |
496 | if (skb_end_pointer(skb) - skb->head < skb_size) | 496 | if (skb_end_pointer(skb) - skb->head < skb_size) |
497 | return 0; | 497 | return false; |
498 | 498 | ||
499 | if (skb_shared(skb) || skb_cloned(skb)) | 499 | if (skb_shared(skb) || skb_cloned(skb)) |
500 | return 0; | 500 | return false; |
501 | 501 | ||
502 | skb_release_head_state(skb); | 502 | skb_release_head_state(skb); |
503 | 503 | ||
@@ -509,7 +509,7 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size) | |||
509 | skb->data = skb->head + NET_SKB_PAD; | 509 | skb->data = skb->head + NET_SKB_PAD; |
510 | skb_reset_tail_pointer(skb); | 510 | skb_reset_tail_pointer(skb); |
511 | 511 | ||
512 | return 1; | 512 | return true; |
513 | } | 513 | } |
514 | EXPORT_SYMBOL(skb_recycle_check); | 514 | EXPORT_SYMBOL(skb_recycle_check); |
515 | 515 | ||
@@ -2965,6 +2965,34 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer) | |||
2965 | } | 2965 | } |
2966 | EXPORT_SYMBOL_GPL(skb_cow_data); | 2966 | EXPORT_SYMBOL_GPL(skb_cow_data); |
2967 | 2967 | ||
2968 | static void sock_rmem_free(struct sk_buff *skb) | ||
2969 | { | ||
2970 | struct sock *sk = skb->sk; | ||
2971 | |||
2972 | atomic_sub(skb->truesize, &sk->sk_rmem_alloc); | ||
2973 | } | ||
2974 | |||
2975 | /* | ||
2976 | * Note: We dont mem charge error packets (no sk_forward_alloc changes) | ||
2977 | */ | ||
2978 | int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) | ||
2979 | { | ||
2980 | if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= | ||
2981 | (unsigned)sk->sk_rcvbuf) | ||
2982 | return -ENOMEM; | ||
2983 | |||
2984 | skb_orphan(skb); | ||
2985 | skb->sk = sk; | ||
2986 | skb->destructor = sock_rmem_free; | ||
2987 | atomic_add(skb->truesize, &sk->sk_rmem_alloc); | ||
2988 | |||
2989 | skb_queue_tail(&sk->sk_error_queue, skb); | ||
2990 | if (!sock_flag(sk, SOCK_DEAD)) | ||
2991 | sk->sk_data_ready(sk, skb->len); | ||
2992 | return 0; | ||
2993 | } | ||
2994 | EXPORT_SYMBOL(sock_queue_err_skb); | ||
2995 | |||
2968 | void skb_tstamp_tx(struct sk_buff *orig_skb, | 2996 | void skb_tstamp_tx(struct sk_buff *orig_skb, |
2969 | struct skb_shared_hwtstamps *hwtstamps) | 2997 | struct skb_shared_hwtstamps *hwtstamps) |
2970 | { | 2998 | { |
@@ -2996,7 +3024,9 @@ void skb_tstamp_tx(struct sk_buff *orig_skb, | |||
2996 | memset(serr, 0, sizeof(*serr)); | 3024 | memset(serr, 0, sizeof(*serr)); |
2997 | serr->ee.ee_errno = ENOMSG; | 3025 | serr->ee.ee_errno = ENOMSG; |
2998 | serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING; | 3026 | serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING; |
3027 | |||
2999 | err = sock_queue_err_skb(sk, skb); | 3028 | err = sock_queue_err_skb(sk, skb); |
3029 | |||
3000 | if (err) | 3030 | if (err) |
3001 | kfree_skb(skb); | 3031 | kfree_skb(skb); |
3002 | } | 3032 | } |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 63958f3394a5..4b6c5ca610fc 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -336,7 +336,7 @@ ipt_do_table(struct sk_buff *skb, | |||
336 | cpu = smp_processor_id(); | 336 | cpu = smp_processor_id(); |
337 | table_base = private->entries[cpu]; | 337 | table_base = private->entries[cpu]; |
338 | jumpstack = (struct ipt_entry **)private->jumpstack[cpu]; | 338 | jumpstack = (struct ipt_entry **)private->jumpstack[cpu]; |
339 | stackptr = &private->stackptr[cpu]; | 339 | stackptr = per_cpu_ptr(private->stackptr, cpu); |
340 | origptr = *stackptr; | 340 | origptr = *stackptr; |
341 | 341 | ||
342 | e = get_entry(table_base, private->hook_entry[hook]); | 342 | e = get_entry(table_base, private->hook_entry[hook]); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 3e6dafcb1071..548d575e6cc6 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2639,7 +2639,7 @@ static void DBGUNDO(struct sock *sk, const char *msg) | |||
2639 | if (sk->sk_family == AF_INET) { | 2639 | if (sk->sk_family == AF_INET) { |
2640 | printk(KERN_DEBUG "Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n", | 2640 | printk(KERN_DEBUG "Undo %s %pI4/%u c%u l%u ss%u/%u p%u\n", |
2641 | msg, | 2641 | msg, |
2642 | &inet->daddr, ntohs(inet->dport), | 2642 | &inet->inet_daddr, ntohs(inet->inet_dport), |
2643 | tp->snd_cwnd, tcp_left_out(tp), | 2643 | tp->snd_cwnd, tcp_left_out(tp), |
2644 | tp->snd_ssthresh, tp->prior_ssthresh, | 2644 | tp->snd_ssthresh, tp->prior_ssthresh, |
2645 | tp->packets_out); | 2645 | tp->packets_out); |
@@ -2649,7 +2649,7 @@ static void DBGUNDO(struct sock *sk, const char *msg) | |||
2649 | struct ipv6_pinfo *np = inet6_sk(sk); | 2649 | struct ipv6_pinfo *np = inet6_sk(sk); |
2650 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", | 2650 | printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n", |
2651 | msg, | 2651 | msg, |
2652 | &np->daddr, ntohs(inet->dport), | 2652 | &np->daddr, ntohs(inet->inet_dport), |
2653 | tp->snd_cwnd, tcp_left_out(tp), | 2653 | tp->snd_cwnd, tcp_left_out(tp), |
2654 | tp->snd_ssthresh, tp->prior_ssthresh, | 2654 | tp->snd_ssthresh, tp->prior_ssthresh, |
2655 | tp->packets_out); | 2655 | tp->packets_out); |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 58585748bdac..eec4ff456e33 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -633,9 +633,9 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable) | |||
633 | if (!inet->recverr) { | 633 | if (!inet->recverr) { |
634 | if (!harderr || sk->sk_state != TCP_ESTABLISHED) | 634 | if (!harderr || sk->sk_state != TCP_ESTABLISHED) |
635 | goto out; | 635 | goto out; |
636 | } else { | 636 | } else |
637 | ip_icmp_error(sk, skb, err, uh->dest, info, (u8 *)(uh+1)); | 637 | ip_icmp_error(sk, skb, err, uh->dest, info, (u8 *)(uh+1)); |
638 | } | 638 | |
639 | sk->sk_err = err; | 639 | sk->sk_err = err; |
640 | sk->sk_error_report(sk); | 640 | sk->sk_error_report(sk); |
641 | out: | 641 | out: |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 6f517bd83692..9d2d68f0e605 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -363,7 +363,7 @@ ip6t_do_table(struct sk_buff *skb, | |||
363 | cpu = smp_processor_id(); | 363 | cpu = smp_processor_id(); |
364 | table_base = private->entries[cpu]; | 364 | table_base = private->entries[cpu]; |
365 | jumpstack = (struct ip6t_entry **)private->jumpstack[cpu]; | 365 | jumpstack = (struct ip6t_entry **)private->jumpstack[cpu]; |
366 | stackptr = &private->stackptr[cpu]; | 366 | stackptr = per_cpu_ptr(private->stackptr, cpu); |
367 | origptr = *stackptr; | 367 | origptr = *stackptr; |
368 | 368 | ||
369 | e = get_entry(table_base, private->hook_entry[hook]); | 369 | e = get_entry(table_base, private->hook_entry[hook]); |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 294cbe8b0725..252d76199c41 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -814,7 +814,7 @@ struct dst_entry * ip6_route_output(struct net *net, struct sock *sk, | |||
814 | { | 814 | { |
815 | int flags = 0; | 815 | int flags = 0; |
816 | 816 | ||
817 | if (fl->oif || rt6_need_strict(&fl->fl6_dst)) | 817 | if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl->fl6_dst)) |
818 | flags |= RT6_LOOKUP_F_IFACE; | 818 | flags |= RT6_LOOKUP_F_IFACE; |
819 | 819 | ||
820 | if (!ipv6_addr_any(&fl->fl6_src)) | 820 | if (!ipv6_addr_any(&fl->fl6_src)) |
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 5d218c530a4e..32be11e4c4d9 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/nl80211.h> | 5 | #include <linux/nl80211.h> |
6 | #include "ieee80211_i.h" | 6 | #include "ieee80211_i.h" |
7 | 7 | ||
8 | enum ieee80211_chan_mode | 8 | static enum ieee80211_chan_mode |
9 | __ieee80211_get_channel_mode(struct ieee80211_local *local, | 9 | __ieee80211_get_channel_mode(struct ieee80211_local *local, |
10 | struct ieee80211_sub_if_data *ignore) | 10 | struct ieee80211_sub_if_data *ignore) |
11 | { | 11 | { |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 445de702b8b7..e34622fa0003 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
@@ -699,10 +699,8 @@ void xt_free_table_info(struct xt_table_info *info) | |||
699 | vfree(info->jumpstack); | 699 | vfree(info->jumpstack); |
700 | else | 700 | else |
701 | kfree(info->jumpstack); | 701 | kfree(info->jumpstack); |
702 | if (sizeof(unsigned int) * nr_cpu_ids > PAGE_SIZE) | 702 | |
703 | vfree(info->stackptr); | 703 | free_percpu(info->stackptr); |
704 | else | ||
705 | kfree(info->stackptr); | ||
706 | 704 | ||
707 | kfree(info); | 705 | kfree(info); |
708 | } | 706 | } |
@@ -753,14 +751,9 @@ static int xt_jumpstack_alloc(struct xt_table_info *i) | |||
753 | unsigned int size; | 751 | unsigned int size; |
754 | int cpu; | 752 | int cpu; |
755 | 753 | ||
756 | size = sizeof(unsigned int) * nr_cpu_ids; | 754 | i->stackptr = alloc_percpu(unsigned int); |
757 | if (size > PAGE_SIZE) | ||
758 | i->stackptr = vmalloc(size); | ||
759 | else | ||
760 | i->stackptr = kmalloc(size, GFP_KERNEL); | ||
761 | if (i->stackptr == NULL) | 755 | if (i->stackptr == NULL) |
762 | return -ENOMEM; | 756 | return -ENOMEM; |
763 | memset(i->stackptr, 0, size); | ||
764 | 757 | ||
765 | size = sizeof(void **) * nr_cpu_ids; | 758 | size = sizeof(void **) * nr_cpu_ids; |
766 | if (size > PAGE_SIZE) | 759 | if (size > PAGE_SIZE) |
@@ -844,10 +837,6 @@ struct xt_table *xt_register_table(struct net *net, | |||
844 | struct xt_table_info *private; | 837 | struct xt_table_info *private; |
845 | struct xt_table *t, *table; | 838 | struct xt_table *t, *table; |
846 | 839 | ||
847 | ret = xt_jumpstack_alloc(newinfo); | ||
848 | if (ret < 0) | ||
849 | return ERR_PTR(ret); | ||
850 | |||
851 | /* Don't add one object to multiple lists. */ | 840 | /* Don't add one object to multiple lists. */ |
852 | table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL); | 841 | table = kmemdup(input_table, sizeof(struct xt_table), GFP_KERNEL); |
853 | if (!table) { | 842 | if (!table) { |
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index 7b048a35ca58..94d72e85a475 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
@@ -1045,12 +1045,12 @@ static void pep_sock_unhash(struct sock *sk) | |||
1045 | lock_sock(sk); | 1045 | lock_sock(sk); |
1046 | if ((1 << sk->sk_state) & ~(TCPF_CLOSE|TCPF_LISTEN)) { | 1046 | if ((1 << sk->sk_state) & ~(TCPF_CLOSE|TCPF_LISTEN)) { |
1047 | skparent = pn->listener; | 1047 | skparent = pn->listener; |
1048 | sk_del_node_init(sk); | ||
1049 | release_sock(sk); | 1048 | release_sock(sk); |
1050 | 1049 | ||
1051 | sk = skparent; | ||
1052 | pn = pep_sk(skparent); | 1050 | pn = pep_sk(skparent); |
1053 | lock_sock(sk); | 1051 | lock_sock(skparent); |
1052 | sk_del_node_init(sk); | ||
1053 | sk = skparent; | ||
1054 | } | 1054 | } |
1055 | /* Unhash a listening sock only when it is closed | 1055 | /* Unhash a listening sock only when it is closed |
1056 | * and all of its active connected pipes are closed. */ | 1056 | * and all of its active connected pipes are closed. */ |
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 10ed0d55f759..f68832798db2 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c | |||
@@ -475,6 +475,7 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id, | |||
475 | err = rds_ib_setup_qp(conn); | 475 | err = rds_ib_setup_qp(conn); |
476 | if (err) { | 476 | if (err) { |
477 | rds_ib_conn_error(conn, "rds_ib_setup_qp failed (%d)\n", err); | 477 | rds_ib_conn_error(conn, "rds_ib_setup_qp failed (%d)\n", err); |
478 | mutex_unlock(&conn->c_cm_lock); | ||
478 | goto out; | 479 | goto out; |
479 | } | 480 | } |
480 | 481 | ||
diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c index a9d951b4fbae..b5dd6ac39be8 100644 --- a/net/rds/iw_cm.c +++ b/net/rds/iw_cm.c | |||
@@ -452,6 +452,7 @@ int rds_iw_cm_handle_connect(struct rdma_cm_id *cm_id, | |||
452 | err = rds_iw_setup_qp(conn); | 452 | err = rds_iw_setup_qp(conn); |
453 | if (err) { | 453 | if (err) { |
454 | rds_iw_conn_error(conn, "rds_iw_setup_qp failed (%d)\n", err); | 454 | rds_iw_conn_error(conn, "rds_iw_setup_qp failed (%d)\n", err); |
455 | mutex_unlock(&conn->c_cm_lock); | ||
455 | goto out; | 456 | goto out; |
456 | } | 457 | } |
457 | 458 | ||
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 0b94d2fa3a88..e4deb73e9a84 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -82,7 +82,7 @@ ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),) | |||
82 | lib-target := $(obj)/lib.a | 82 | lib-target := $(obj)/lib.a |
83 | endif | 83 | endif |
84 | 84 | ||
85 | ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(lib-target)),) | 85 | ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(subdir-m) $(lib-target)),) |
86 | builtin-target := $(obj)/built-in.o | 86 | builtin-target := $(obj)/built-in.o |
87 | endif | 87 | endif |
88 | 88 | ||
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index cbcd654215e6..54fd1b700131 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -241,7 +241,7 @@ cmd_lzma = (cat $(filter-out FORCE,$^) | \ | |||
241 | lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ | 241 | lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ |
242 | (rm -f $@ ; false) | 242 | (rm -f $@ ; false) |
243 | 243 | ||
244 | quiet_cmd_lzo = LZO $@ | 244 | quiet_cmd_lzo = LZO $@ |
245 | cmd_lzo = (cat $(filter-out FORCE,$^) | \ | 245 | cmd_lzo = (cat $(filter-out FORCE,$^) | \ |
246 | lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ | 246 | lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ |
247 | (rm -f $@ ; false) | 247 | (rm -f $@ ; false) |
diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl index 676ddc07d6fa..97b2c6143fe4 100755 --- a/scripts/checkincludes.pl +++ b/scripts/checkincludes.pl | |||
@@ -11,6 +11,8 @@ | |||
11 | # you do have real dups and do not have them under #ifdef's. You | 11 | # you do have real dups and do not have them under #ifdef's. You |
12 | # could also just review the results. | 12 | # could also just review the results. |
13 | 13 | ||
14 | use strict; | ||
15 | |||
14 | sub usage { | 16 | sub usage { |
15 | print "Usage: checkincludes.pl [-r]\n"; | 17 | print "Usage: checkincludes.pl [-r]\n"; |
16 | print "By default we just warn of duplicates\n"; | 18 | print "By default we just warn of duplicates\n"; |
@@ -35,23 +37,24 @@ if ($#ARGV >= 1) { | |||
35 | } | 37 | } |
36 | } | 38 | } |
37 | 39 | ||
38 | foreach $file (@ARGV) { | 40 | foreach my $file (@ARGV) { |
39 | open(FILE, $file) or die "Cannot open $file: $!.\n"; | 41 | open(my $f, '<', $file) |
42 | or die "Cannot open $file: $!.\n"; | ||
40 | 43 | ||
41 | my %includedfiles = (); | 44 | my %includedfiles = (); |
42 | my @file_lines = (); | 45 | my @file_lines = (); |
43 | 46 | ||
44 | while (<FILE>) { | 47 | while (<$f>) { |
45 | if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) { | 48 | if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) { |
46 | ++$includedfiles{$1}; | 49 | ++$includedfiles{$1}; |
47 | } | 50 | } |
48 | push(@file_lines, $_); | 51 | push(@file_lines, $_); |
49 | } | 52 | } |
50 | 53 | ||
51 | close(FILE); | 54 | close($f); |
52 | 55 | ||
53 | if (!$remove) { | 56 | if (!$remove) { |
54 | foreach $filename (keys %includedfiles) { | 57 | foreach my $filename (keys %includedfiles) { |
55 | if ($includedfiles{$filename} > 1) { | 58 | if ($includedfiles{$filename} > 1) { |
56 | print "$file: $filename is included more than once.\n"; | 59 | print "$file: $filename is included more than once.\n"; |
57 | } | 60 | } |
@@ -59,27 +62,28 @@ foreach $file (@ARGV) { | |||
59 | next; | 62 | next; |
60 | } | 63 | } |
61 | 64 | ||
62 | open(FILE,">$file") || die("Cannot write to $file: $!"); | 65 | open($f, '>', $file) |
66 | or die("Cannot write to $file: $!"); | ||
63 | 67 | ||
64 | my $dups = 0; | 68 | my $dups = 0; |
65 | foreach (@file_lines) { | 69 | foreach (@file_lines) { |
66 | if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) { | 70 | if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) { |
67 | foreach $filename (keys %includedfiles) { | 71 | foreach my $filename (keys %includedfiles) { |
68 | if ($1 eq $filename) { | 72 | if ($1 eq $filename) { |
69 | if ($includedfiles{$filename} > 1) { | 73 | if ($includedfiles{$filename} > 1) { |
70 | $includedfiles{$filename}--; | 74 | $includedfiles{$filename}--; |
71 | $dups++; | 75 | $dups++; |
72 | } else { | 76 | } else { |
73 | print FILE $_; | 77 | print {$f} $_; |
74 | } | 78 | } |
75 | } | 79 | } |
76 | } | 80 | } |
77 | } else { | 81 | } else { |
78 | print FILE $_; | 82 | print {$f} $_; |
79 | } | 83 | } |
80 | } | 84 | } |
81 | if ($dups > 0) { | 85 | if ($dups > 0) { |
82 | print "$file: removed $dups duplicate includes\n"; | 86 | print "$file: removed $dups duplicate includes\n"; |
83 | } | 87 | } |
84 | close(FILE); | 88 | close($f); |
85 | } | 89 | } |
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 14ee68e991dd..1afff6658a7d 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl | |||
@@ -21,6 +21,8 @@ | |||
21 | # | 21 | # |
22 | # TODO : Port to all architectures (one regex per arch) | 22 | # TODO : Port to all architectures (one regex per arch) |
23 | 23 | ||
24 | use strict; | ||
25 | |||
24 | # check for arch | 26 | # check for arch |
25 | # | 27 | # |
26 | # $re is used for two matches: | 28 | # $re is used for two matches: |
@@ -104,19 +106,11 @@ my (@stack, $re, $dre, $x, $xs); | |||
104 | } | 106 | } |
105 | } | 107 | } |
106 | 108 | ||
107 | sub bysize($) { | ||
108 | my ($asize, $bsize); | ||
109 | ($asize = $a) =~ s/.*: *(.*)$/$1/; | ||
110 | ($bsize = $b) =~ s/.*: *(.*)$/$1/; | ||
111 | $bsize <=> $asize | ||
112 | } | ||
113 | |||
114 | # | 109 | # |
115 | # main() | 110 | # main() |
116 | # | 111 | # |
117 | my $funcre = qr/^$x* <(.*)>:$/; | 112 | my $funcre = qr/^$x* <(.*)>:$/; |
118 | my $func; | 113 | my ($func, $file, $lastslash); |
119 | my $file, $lastslash; | ||
120 | 114 | ||
121 | while (my $line = <STDIN>) { | 115 | while (my $line = <STDIN>) { |
122 | if ($line =~ m/$funcre/) { | 116 | if ($line =~ m/$funcre/) { |
@@ -173,4 +167,6 @@ while (my $line = <STDIN>) { | |||
173 | } | 167 | } |
174 | } | 168 | } |
175 | 169 | ||
176 | print sort bysize @stack; | 170 | # Sort output by size (last field) |
171 | print sort { ($b =~ /:\t*(\d+)$/)[0] <=> ($a =~ /:\t*(\d+)$/)[0] } @stack; | ||
172 | |||
diff --git a/scripts/checkversion.pl b/scripts/checkversion.pl index ec7d21161bdc..b444e89a0095 100755 --- a/scripts/checkversion.pl +++ b/scripts/checkversion.pl | |||
@@ -5,23 +5,22 @@ | |||
5 | # including <linux/version.h> that don't need it. | 5 | # including <linux/version.h> that don't need it. |
6 | # Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net> | 6 | # Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net> |
7 | 7 | ||
8 | use strict; | ||
9 | |||
8 | $| = 1; | 10 | $| = 1; |
9 | 11 | ||
10 | my $debugging = 0; | 12 | my $debugging; |
11 | 13 | ||
12 | foreach $file (@ARGV) | 14 | foreach my $file (@ARGV) { |
13 | { | ||
14 | # Open this file. | 15 | # Open this file. |
15 | open(FILE, $file) || die "Can't open $file: $!\n"; | 16 | open( my $f, '<', $file ) |
17 | or die "Can't open $file: $!\n"; | ||
16 | 18 | ||
17 | # Initialize variables. | 19 | # Initialize variables. |
18 | my $fInComment = 0; | 20 | my ($fInComment, $fInString, $fUseVersion); |
19 | my $fInString = 0; | ||
20 | my $fUseVersion = 0; | ||
21 | my $iLinuxVersion = 0; | 21 | my $iLinuxVersion = 0; |
22 | 22 | ||
23 | LINE: while ( <FILE> ) | 23 | while (<$f>) { |
24 | { | ||
25 | # Strip comments. | 24 | # Strip comments. |
26 | $fInComment && (s+^.*?\*/+ +o ? ($fInComment = 0) : next); | 25 | $fInComment && (s+^.*?\*/+ +o ? ($fInComment = 0) : next); |
27 | m+/\*+o && (s+/\*.*?\*/+ +go, (s+/\*.*$+ +o && ($fInComment = 1))); | 26 | m+/\*+o && (s+/\*.*?\*/+ +go, (s+/\*.*$+ +o && ($fInComment = 1))); |
@@ -43,8 +42,8 @@ foreach $file (@ARGV) | |||
43 | # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE | 42 | # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE |
44 | if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) { | 43 | if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) { |
45 | $fUseVersion = 1; | 44 | $fUseVersion = 1; |
46 | last LINE if $iLinuxVersion; | 45 | last if $iLinuxVersion; |
47 | } | 46 | } |
48 | } | 47 | } |
49 | 48 | ||
50 | # Report used version IDs without include? | 49 | # Report used version IDs without include? |
@@ -67,5 +66,5 @@ foreach $file (@ARGV) | |||
67 | } | 66 | } |
68 | } | 67 | } |
69 | 68 | ||
70 | close(FILE); | 69 | close($f); |
71 | } | 70 | } |
diff --git a/scripts/decodecode b/scripts/decodecode index 4b00647814bc..8b30cc36744f 100755 --- a/scripts/decodecode +++ b/scripts/decodecode | |||
@@ -7,7 +7,7 @@ | |||
7 | # AFLAGS=--32 decodecode < 386.oops | 7 | # AFLAGS=--32 decodecode < 386.oops |
8 | 8 | ||
9 | cleanup() { | 9 | cleanup() { |
10 | rm -f $T $T.s $T.o $T.oo $T.aa $T.aaa | 10 | rm -f $T $T.s $T.o $T.oo $T.aa $T.dis |
11 | exit 1 | 11 | exit 1 |
12 | } | 12 | } |
13 | 13 | ||
@@ -39,6 +39,29 @@ fi | |||
39 | echo $code | 39 | echo $code |
40 | code=`echo $code | sed -e 's/.*Code: //'` | 40 | code=`echo $code | sed -e 's/.*Code: //'` |
41 | 41 | ||
42 | width=`expr index "$code" ' '` | ||
43 | width=$[($width-1)/2] | ||
44 | case $width in | ||
45 | 1) type=byte ;; | ||
46 | 2) type=2byte ;; | ||
47 | 4) type=4byte ;; | ||
48 | esac | ||
49 | |||
50 | disas() { | ||
51 | ${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s &> /dev/null | ||
52 | |||
53 | if [ "$ARCH" == "arm" ]; then | ||
54 | if [ $width == 2 ]; then | ||
55 | OBJDUMPFLAGS="-M force-thumb" | ||
56 | fi | ||
57 | |||
58 | ${CROSS_COMPILE}strip $1.o | ||
59 | fi | ||
60 | |||
61 | ${CROSS_COMPILE}objdump $OBJDUMPFLAGS -S $1.o | \ | ||
62 | grep -v "/tmp\|Disassembly\|\.text\|^$" &> $1.dis | ||
63 | } | ||
64 | |||
42 | marker=`expr index "$code" "\<"` | 65 | marker=`expr index "$code" "\<"` |
43 | if [ $marker -eq 0 ]; then | 66 | if [ $marker -eq 0 ]; then |
44 | marker=`expr index "$code" "\("` | 67 | marker=`expr index "$code" "\("` |
@@ -49,26 +72,25 @@ if [ $marker -ne 0 ]; then | |||
49 | echo All code >> $T.oo | 72 | echo All code >> $T.oo |
50 | echo ======== >> $T.oo | 73 | echo ======== >> $T.oo |
51 | beforemark=`echo "$code"` | 74 | beforemark=`echo "$code"` |
52 | echo -n " .byte 0x" > $T.s | 75 | echo -n " .$type 0x" > $T.s |
53 | echo $beforemark | sed -e 's/ /,0x/g' | sed -e 's/<//g' | sed -e 's/>//g' >> $T.s | 76 | echo $beforemark | sed -e 's/ /,0x/g; s/[<>()]//g' >> $T.s |
54 | as $AFLAGS -o $T.o $T.s &> /dev/null | 77 | disas $T |
55 | objdump -S $T.o | grep -v "/tmp" | grep -v "Disassembly" | grep -v "\.text" | grep -v "^$" &> $T.ooo | 78 | cat $T.dis >> $T.oo |
56 | cat $T.ooo >> $T.oo | 79 | rm -f $T.o $T.s $T.dis |
57 | rm -f $T.o $T.s $T.ooo | ||
58 | 80 | ||
59 | # and fix code at-and-after marker | 81 | # and fix code at-and-after marker |
60 | code=`echo "$code" | cut -c$((${marker} + 1))-` | 82 | code=`echo "$code" | cut -c$((${marker} + 1))-` |
61 | fi | 83 | fi |
62 | echo Code starting with the faulting instruction > $T.aa | 84 | echo Code starting with the faulting instruction > $T.aa |
63 | echo =========================================== >> $T.aa | 85 | echo =========================================== >> $T.aa |
64 | code=`echo $code | sed -e 's/ [<(]/ /;s/[>)] / /;s/ /,0x/g'` | 86 | code=`echo $code | sed -e 's/ [<(]/ /;s/[>)] / /;s/ /,0x/g; s/[>)]$//'` |
65 | echo -n " .byte 0x" > $T.s | 87 | echo -n " .$type 0x" > $T.s |
66 | echo $code >> $T.s | 88 | echo $code >> $T.s |
67 | as $AFLAGS -o $T.o $T.s &> /dev/null | 89 | disas $T |
68 | objdump -S $T.o | grep -v "Disassembly" | grep -v "/tmp" | grep -v "\.text" | grep -v "^$" &> $T.aaa | 90 | cat $T.dis >> $T.aa |
69 | cat $T.aaa >> $T.aa | ||
70 | 91 | ||
71 | faultline=`cat $T.aaa | head -1 | cut -d":" -f2` | 92 | faultline=`cat $T.dis | head -1 | cut -d":" -f2` |
93 | faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'` | ||
72 | 94 | ||
73 | cat $T.oo | sed -e "s/\($faultline\)/\*\1 <-- trapping instruction/g" | 95 | cat $T.oo | sed -e "s/\($faultline\)/\*\1 <-- trapping instruction/g" |
74 | echo | 96 | echo |
diff --git a/scripts/export_report.pl b/scripts/export_report.pl index 705b5ba7c152..04dce7c15f83 100644 --- a/scripts/export_report.pl +++ b/scripts/export_report.pl | |||
@@ -49,10 +49,10 @@ sub usage { | |||
49 | } | 49 | } |
50 | 50 | ||
51 | sub collectcfiles { | 51 | sub collectcfiles { |
52 | my @file = `cat .tmp_versions/*.mod | grep '.*\.ko\$'`; | 52 | my @file |
53 | @file = grep {s/\.ko/.mod.c/} @file; | 53 | = `cat .tmp_versions/*.mod | grep '.*\.ko\$' | sed s/\.ko$/.mod.c/`; |
54 | chomp @file; | 54 | chomp @file; |
55 | return @file; | 55 | return @file; |
56 | } | 56 | } |
57 | 57 | ||
58 | my (%SYMBOL, %MODULE, %opt, @allcfiles); | 58 | my (%SYMBOL, %MODULE, %opt, @allcfiles); |
@@ -71,37 +71,40 @@ if (not defined $opt{'k'}) { | |||
71 | $opt{'k'} = "Module.symvers"; | 71 | $opt{'k'} = "Module.symvers"; |
72 | } | 72 | } |
73 | 73 | ||
74 | unless (open(MODULE_SYMVERS, $opt{'k'})) { | 74 | open (my $module_symvers, '<', $opt{'k'}) |
75 | die "Sorry, cannot open $opt{'k'}: $!\n"; | 75 | or die "Sorry, cannot open $opt{'k'}: $!\n"; |
76 | } | ||
77 | 76 | ||
78 | if (defined $opt{'o'}) { | 77 | if (defined $opt{'o'}) { |
79 | unless (open(OUTPUT_HANDLE, ">$opt{'o'}")) { | 78 | open (my $out, '>', $opt{'o'}) |
80 | die "Sorry, cannot open $opt{'o'} $!\n"; | 79 | or die "Sorry, cannot open $opt{'o'} $!\n"; |
81 | } | 80 | |
82 | select OUTPUT_HANDLE; | 81 | select $out; |
83 | } | 82 | } |
83 | |||
84 | # | 84 | # |
85 | # collect all the symbols and their attributes from the | 85 | # collect all the symbols and their attributes from the |
86 | # Module.symvers file | 86 | # Module.symvers file |
87 | # | 87 | # |
88 | while ( <MODULE_SYMVERS> ) { | 88 | while ( <$module_symvers> ) { |
89 | chomp; | 89 | chomp; |
90 | my (undef, $symbol, $module, $gpl) = split; | 90 | my (undef, $symbol, $module, $gpl) = split; |
91 | $SYMBOL { $symbol } = [ $module , "0" , $symbol, $gpl]; | 91 | $SYMBOL { $symbol } = [ $module , "0" , $symbol, $gpl]; |
92 | } | 92 | } |
93 | close(MODULE_SYMVERS); | 93 | close($module_symvers); |
94 | 94 | ||
95 | # | 95 | # |
96 | # collect the usage count of each symbol. | 96 | # collect the usage count of each symbol. |
97 | # | 97 | # |
98 | foreach my $thismod (@allcfiles) { | 98 | foreach my $thismod (@allcfiles) { |
99 | unless (open(MODULE_MODULE, $thismod)) { | 99 | my $module; |
100 | print "Sorry, cannot open $thismod: $!\n"; | 100 | |
101 | unless (open ($module, '<', $thismod)) { | ||
102 | warn "Sorry, cannot open $thismod: $!\n"; | ||
101 | next; | 103 | next; |
102 | } | 104 | } |
105 | |||
103 | my $state=0; | 106 | my $state=0; |
104 | while ( <MODULE_MODULE> ) { | 107 | while ( <$module> ) { |
105 | chomp; | 108 | chomp; |
106 | if ($state == 0) { | 109 | if ($state == 0) { |
107 | $state = 1 if ($_ =~ /static const struct modversion_info/); | 110 | $state = 1 if ($_ =~ /static const struct modversion_info/); |
@@ -124,7 +127,7 @@ foreach my $thismod (@allcfiles) { | |||
124 | if ($state != 2) { | 127 | if ($state != 2) { |
125 | print "WARNING:$thismod is not built with CONFIG_MODVERSION enabled\n"; | 128 | print "WARNING:$thismod is not built with CONFIG_MODVERSION enabled\n"; |
126 | } | 129 | } |
127 | close(MODULE_MODULE); | 130 | close($module); |
128 | } | 131 | } |
129 | 132 | ||
130 | print "\tThis file reports the exported symbols usage patterns by in-tree\n", | 133 | print "\tThis file reports the exported symbols usage patterns by in-tree\n", |
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh index a932ae52f921..5958fffb2114 100644 --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh | |||
@@ -202,6 +202,7 @@ input_file() { | |||
202 | print_mtime "$1" >> ${output} | 202 | print_mtime "$1" >> ${output} |
203 | cat "$1" >> ${output} | 203 | cat "$1" >> ${output} |
204 | else | 204 | else |
205 | echo "$1 \\" | ||
205 | cat "$1" | while read type dir file perm ; do | 206 | cat "$1" | while read type dir file perm ; do |
206 | if [ "$type" == "file" ]; then | 207 | if [ "$type" == "file" ]; then |
207 | echo "$file \\"; | 208 | echo "$file \\"; |
@@ -231,7 +232,7 @@ arg="$1" | |||
231 | case "$arg" in | 232 | case "$arg" in |
232 | "-l") # files included in initramfs - used by kbuild | 233 | "-l") # files included in initramfs - used by kbuild |
233 | dep_list="list_" | 234 | dep_list="list_" |
234 | echo "deps_initramfs := \\" | 235 | echo "deps_initramfs := $0 \\" |
235 | shift | 236 | shift |
236 | ;; | 237 | ;; |
237 | "-o") # generate compressed cpio image named $1 | 238 | "-o") # generate compressed cpio image named $1 |
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c index af6b8363a2d5..f99115ebe925 100644 --- a/scripts/genksyms/genksyms.c +++ b/scripts/genksyms/genksyms.c | |||
@@ -758,8 +758,10 @@ int main(int argc, char **argv) | |||
758 | /* setlinebuf(debugfile); */ | 758 | /* setlinebuf(debugfile); */ |
759 | } | 759 | } |
760 | 760 | ||
761 | if (flag_reference) | 761 | if (flag_reference) { |
762 | read_reference(ref_file); | 762 | read_reference(ref_file); |
763 | fclose(ref_file); | ||
764 | } | ||
763 | 765 | ||
764 | yyparse(); | 766 | yyparse(); |
765 | 767 | ||
diff --git a/scripts/headerdep.pl b/scripts/headerdep.pl index b7f6c560e24d..8dd019bc5a73 100755 --- a/scripts/headerdep.pl +++ b/scripts/headerdep.pl | |||
@@ -80,8 +80,7 @@ sub search { | |||
80 | my $path = "$i/$filename"; | 80 | my $path = "$i/$filename"; |
81 | return $path if -f $path; | 81 | return $path if -f $path; |
82 | } | 82 | } |
83 | 83 | return; | |
84 | return undef; | ||
85 | } | 84 | } |
86 | 85 | ||
87 | sub parse_all { | 86 | sub parse_all { |
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl index db1dd7a549f2..50d6cfd1fa77 100644 --- a/scripts/headers_check.pl +++ b/scripts/headers_check.pl | |||
@@ -28,11 +28,12 @@ my $lineno = 0; | |||
28 | my $filename; | 28 | my $filename; |
29 | 29 | ||
30 | foreach my $file (@files) { | 30 | foreach my $file (@files) { |
31 | local *FH; | ||
32 | $filename = $file; | 31 | $filename = $file; |
33 | open(FH, "<$filename") or die "$filename: $!\n"; | 32 | |
33 | open(my $fh, '<', $filename) | ||
34 | or die "$filename: $!\n"; | ||
34 | $lineno = 0; | 35 | $lineno = 0; |
35 | while ($line = <FH>) { | 36 | while ($line = <$fh>) { |
36 | $lineno++; | 37 | $lineno++; |
37 | &check_include(); | 38 | &check_include(); |
38 | &check_asm_types(); | 39 | &check_asm_types(); |
@@ -40,7 +41,7 @@ foreach my $file (@files) { | |||
40 | &check_declarations(); | 41 | &check_declarations(); |
41 | # Dropped for now. Too much noise &check_config(); | 42 | # Dropped for now. Too much noise &check_config(); |
42 | } | 43 | } |
43 | close FH; | 44 | close $fh; |
44 | } | 45 | } |
45 | exit $ret; | 46 | exit $ret; |
46 | 47 | ||
@@ -78,7 +79,7 @@ sub check_config | |||
78 | } | 79 | } |
79 | 80 | ||
80 | my $linux_asm_types; | 81 | my $linux_asm_types; |
81 | sub check_asm_types() | 82 | sub check_asm_types |
82 | { | 83 | { |
83 | if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { | 84 | if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { |
84 | return; | 85 | return; |
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl index b89ca2c58fdb..4ca3be3b2e50 100644 --- a/scripts/headers_install.pl +++ b/scripts/headers_install.pl | |||
@@ -23,13 +23,13 @@ my ($readdir, $installdir, $arch, @files) = @ARGV; | |||
23 | my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__"; | 23 | my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__"; |
24 | 24 | ||
25 | foreach my $file (@files) { | 25 | foreach my $file (@files) { |
26 | local *INFILE; | ||
27 | local *OUTFILE; | ||
28 | my $tmpfile = "$installdir/$file.tmp"; | 26 | my $tmpfile = "$installdir/$file.tmp"; |
29 | open(INFILE, "<$readdir/$file") | 27 | |
30 | or die "$readdir/$file: $!\n"; | 28 | open(my $in, '<', "$readdir/$file") |
31 | open(OUTFILE, ">$tmpfile") or die "$tmpfile: $!\n"; | 29 | or die "$readdir/$file: $!\n"; |
32 | while (my $line = <INFILE>) { | 30 | open(my $out, '>', $tmpfile) |
31 | or die "$tmpfile: $!\n"; | ||
32 | while (my $line = <$in>) { | ||
33 | $line =~ s/([\s(])__user\s/$1/g; | 33 | $line =~ s/([\s(])__user\s/$1/g; |
34 | $line =~ s/([\s(])__force\s/$1/g; | 34 | $line =~ s/([\s(])__force\s/$1/g; |
35 | $line =~ s/([\s(])__iomem\s/$1/g; | 35 | $line =~ s/([\s(])__iomem\s/$1/g; |
@@ -39,10 +39,11 @@ foreach my $file (@files) { | |||
39 | $line =~ s/(^|\s)(inline)\b/$1__$2__/g; | 39 | $line =~ s/(^|\s)(inline)\b/$1__$2__/g; |
40 | $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; | 40 | $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; |
41 | $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; | 41 | $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; |
42 | printf OUTFILE "%s", $line; | 42 | printf {$out} "%s", $line; |
43 | } | 43 | } |
44 | close OUTFILE; | 44 | close $out; |
45 | close INFILE; | 45 | close $in; |
46 | |||
46 | system $unifdef . " $tmpfile > $installdir/$file"; | 47 | system $unifdef . " $tmpfile > $installdir/$file"; |
47 | unlink $tmpfile; | 48 | unlink $tmpfile; |
48 | } | 49 | } |
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 86c3896a1e01..e3902fb39afd 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c | |||
@@ -108,8 +108,10 @@ static int read_symbol(FILE *in, struct sym_entry *s) | |||
108 | rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str); | 108 | rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str); |
109 | if (rc != 3) { | 109 | if (rc != 3) { |
110 | if (rc != EOF) { | 110 | if (rc != EOF) { |
111 | /* skip line */ | 111 | /* skip line. sym is used as dummy to |
112 | fgets(str, 500, in); | 112 | * shut of "warn_unused_result" warning. |
113 | */ | ||
114 | sym = fgets(str, 500, in); | ||
113 | } | 115 | } |
114 | return -1; | 116 | return -1; |
115 | } | 117 | } |
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 186c46604d06..7cdae39b8f09 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -23,6 +23,9 @@ menuconfig: $(obj)/mconf | |||
23 | config: $(obj)/conf | 23 | config: $(obj)/conf |
24 | $< $(Kconfig) | 24 | $< $(Kconfig) |
25 | 25 | ||
26 | nconfig: $(obj)/nconf | ||
27 | $< $(Kconfig) | ||
28 | |||
26 | oldconfig: $(obj)/conf | 29 | oldconfig: $(obj)/conf |
27 | $< -o $(Kconfig) | 30 | $< -o $(Kconfig) |
28 | 31 | ||
@@ -120,6 +123,7 @@ endif | |||
120 | # Help text used by make help | 123 | # Help text used by make help |
121 | help: | 124 | help: |
122 | @echo ' config - Update current config utilising a line-oriented program' | 125 | @echo ' config - Update current config utilising a line-oriented program' |
126 | @echo ' nconfig - Update current config utilising a ncurses menu based program' | ||
123 | @echo ' menuconfig - Update current config utilising a menu based program' | 127 | @echo ' menuconfig - Update current config utilising a menu based program' |
124 | @echo ' xconfig - Update current config utilising a QT based front-end' | 128 | @echo ' xconfig - Update current config utilising a QT based front-end' |
125 | @echo ' gconfig - Update current config utilising a GTK based front-end' | 129 | @echo ' gconfig - Update current config utilising a GTK based front-end' |
@@ -147,6 +151,8 @@ HOST_EXTRACFLAGS += -DLOCALE | |||
147 | # =========================================================================== | 151 | # =========================================================================== |
148 | # Shared Makefile for the various kconfig executables: | 152 | # Shared Makefile for the various kconfig executables: |
149 | # conf: Used for defconfig, oldconfig and related targets | 153 | # conf: Used for defconfig, oldconfig and related targets |
154 | # nconf: Used for the nconfig target. | ||
155 | # Utilizes ncurses | ||
150 | # mconf: Used for the menuconfig target | 156 | # mconf: Used for the menuconfig target |
151 | # Utilizes the lxdialog package | 157 | # Utilizes the lxdialog package |
152 | # qconf: Used for the xconfig target | 158 | # qconf: Used for the xconfig target |
@@ -159,11 +165,16 @@ lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o | |||
159 | lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o | 165 | lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o |
160 | 166 | ||
161 | conf-objs := conf.o zconf.tab.o | 167 | conf-objs := conf.o zconf.tab.o |
162 | mconf-objs := mconf.o zconf.tab.o $(lxdialog) | 168 | mconf-objs := mconf.o zconf.tab.o $(lxdialog) |
169 | nconf-objs := nconf.o zconf.tab.o nconf.gui.o | ||
163 | kxgettext-objs := kxgettext.o zconf.tab.o | 170 | kxgettext-objs := kxgettext.o zconf.tab.o |
164 | 171 | ||
165 | hostprogs-y := conf qconf gconf kxgettext | 172 | hostprogs-y := conf qconf gconf kxgettext |
166 | 173 | ||
174 | ifeq ($(MAKECMDGOALS),nconfig) | ||
175 | hostprogs-y += nconf | ||
176 | endif | ||
177 | |||
167 | ifeq ($(MAKECMDGOALS),menuconfig) | 178 | ifeq ($(MAKECMDGOALS),menuconfig) |
168 | hostprogs-y += mconf | 179 | hostprogs-y += mconf |
169 | endif | 180 | endif |
@@ -187,7 +198,7 @@ endif | |||
187 | 198 | ||
188 | clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ | 199 | clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ |
189 | .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h | 200 | .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h |
190 | clean-files += mconf qconf gconf | 201 | clean-files += mconf qconf gconf nconf |
191 | clean-files += config.pot linux.pot | 202 | clean-files += config.pot linux.pot |
192 | 203 | ||
193 | # Check that we have the required ncurses stuff installed for lxdialog (menuconfig) | 204 | # Check that we have the required ncurses stuff installed for lxdialog (menuconfig) |
@@ -212,6 +223,7 @@ HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` | |||
212 | HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ | 223 | HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ |
213 | -D LKC_DIRECT_LINK | 224 | -D LKC_DIRECT_LINK |
214 | 225 | ||
226 | HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses | ||
215 | $(obj)/qconf.o: $(obj)/.tmp_qtcheck | 227 | $(obj)/qconf.o: $(obj)/.tmp_qtcheck |
216 | 228 | ||
217 | ifeq ($(qconf-target),1) | 229 | ifeq ($(qconf-target),1) |
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index edd3f39a080a..d83f2322893a 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c | |||
@@ -1097,9 +1097,32 @@ void expr_fprint(struct expr *e, FILE *out) | |||
1097 | 1097 | ||
1098 | static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) | 1098 | static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) |
1099 | { | 1099 | { |
1100 | str_append((struct gstr*)data, str); | 1100 | struct gstr *gs = (struct gstr*)data; |
1101 | const char *sym_str = NULL; | ||
1102 | |||
1103 | if (sym) | ||
1104 | sym_str = sym_get_string_value(sym); | ||
1105 | |||
1106 | if (gs->max_width) { | ||
1107 | unsigned extra_length = strlen(str); | ||
1108 | const char *last_cr = strrchr(gs->s, '\n'); | ||
1109 | unsigned last_line_length; | ||
1110 | |||
1111 | if (sym_str) | ||
1112 | extra_length += 4 + strlen(sym_str); | ||
1113 | |||
1114 | if (!last_cr) | ||
1115 | last_cr = gs->s; | ||
1116 | |||
1117 | last_line_length = strlen(gs->s) - (last_cr - gs->s); | ||
1118 | |||
1119 | if ((last_line_length + extra_length) > gs->max_width) | ||
1120 | str_append(gs, "\\\n"); | ||
1121 | } | ||
1122 | |||
1123 | str_append(gs, str); | ||
1101 | if (sym) | 1124 | if (sym) |
1102 | str_printf((struct gstr*)data, " [=%s]", sym_get_string_value(sym)); | 1125 | str_printf(gs, " [=%s]", sym_str); |
1103 | } | 1126 | } |
1104 | 1127 | ||
1105 | void expr_gstr_print(struct expr *e, struct gstr *gs) | 1128 | void expr_gstr_print(struct expr *e, struct gstr *gs) |
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 6408fefae083..891cd9ce9ba2 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
@@ -86,7 +86,7 @@ struct symbol { | |||
86 | struct expr_value rev_dep; | 86 | struct expr_value rev_dep; |
87 | }; | 87 | }; |
88 | 88 | ||
89 | #define for_all_symbols(i, sym) for (i = 0; i < 257; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER) | 89 | #define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER) |
90 | 90 | ||
91 | #define SYMBOL_CONST 0x0001 /* symbol is const */ | 91 | #define SYMBOL_CONST 0x0001 /* symbol is const */ |
92 | #define SYMBOL_CHECK 0x0008 /* used during dependency checking */ | 92 | #define SYMBOL_CHECK 0x0008 /* used during dependency checking */ |
@@ -108,8 +108,7 @@ struct symbol { | |||
108 | #define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */ | 108 | #define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */ |
109 | 109 | ||
110 | #define SYMBOL_MAXLENGTH 256 | 110 | #define SYMBOL_MAXLENGTH 256 |
111 | #define SYMBOL_HASHSIZE 257 | 111 | #define SYMBOL_HASHSIZE 9973 |
112 | #define SYMBOL_HASHMASK 0xff | ||
113 | 112 | ||
114 | /* A property represent the config options that can be associated | 113 | /* A property represent the config options that can be associated |
115 | * with a config "symbol". | 114 | * with a config "symbol". |
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 65464366fe38..bef10411837f 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c | |||
@@ -30,13 +30,16 @@ enum { | |||
30 | SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW | 30 | SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW |
31 | }; | 31 | }; |
32 | 32 | ||
33 | enum { | ||
34 | OPT_NORMAL, OPT_ALL, OPT_PROMPT | ||
35 | }; | ||
36 | |||
33 | static gint view_mode = FULL_VIEW; | 37 | static gint view_mode = FULL_VIEW; |
34 | static gboolean show_name = TRUE; | 38 | static gboolean show_name = TRUE; |
35 | static gboolean show_range = TRUE; | 39 | static gboolean show_range = TRUE; |
36 | static gboolean show_value = TRUE; | 40 | static gboolean show_value = TRUE; |
37 | static gboolean show_all = FALSE; | ||
38 | static gboolean show_debug = FALSE; | ||
39 | static gboolean resizeable = FALSE; | 41 | static gboolean resizeable = FALSE; |
42 | static int opt_mode = OPT_NORMAL; | ||
40 | 43 | ||
41 | GtkWidget *main_wnd = NULL; | 44 | GtkWidget *main_wnd = NULL; |
42 | GtkWidget *tree1_w = NULL; // left frame | 45 | GtkWidget *tree1_w = NULL; // left frame |
@@ -76,36 +79,7 @@ static void conf_changed(void); | |||
76 | 79 | ||
77 | /* Helping/Debugging Functions */ | 80 | /* Helping/Debugging Functions */ |
78 | 81 | ||
79 | 82 | const char *dbg_sym_flags(int val) | |
80 | const char *dbg_print_stype(int val) | ||
81 | { | ||
82 | static char buf[256]; | ||
83 | |||
84 | bzero(buf, 256); | ||
85 | |||
86 | if (val == S_UNKNOWN) | ||
87 | strcpy(buf, "unknown"); | ||
88 | if (val == S_BOOLEAN) | ||
89 | strcpy(buf, "boolean"); | ||
90 | if (val == S_TRISTATE) | ||
91 | strcpy(buf, "tristate"); | ||
92 | if (val == S_INT) | ||
93 | strcpy(buf, "int"); | ||
94 | if (val == S_HEX) | ||
95 | strcpy(buf, "hex"); | ||
96 | if (val == S_STRING) | ||
97 | strcpy(buf, "string"); | ||
98 | if (val == S_OTHER) | ||
99 | strcpy(buf, "other"); | ||
100 | |||
101 | #ifdef DEBUG | ||
102 | printf("%s", buf); | ||
103 | #endif | ||
104 | |||
105 | return buf; | ||
106 | } | ||
107 | |||
108 | const char *dbg_print_flags(int val) | ||
109 | { | 83 | { |
110 | static char buf[256]; | 84 | static char buf[256]; |
111 | 85 | ||
@@ -131,40 +105,10 @@ const char *dbg_print_flags(int val) | |||
131 | strcat(buf, "auto/"); | 105 | strcat(buf, "auto/"); |
132 | 106 | ||
133 | buf[strlen(buf) - 1] = '\0'; | 107 | buf[strlen(buf) - 1] = '\0'; |
134 | #ifdef DEBUG | ||
135 | printf("%s", buf); | ||
136 | #endif | ||
137 | |||
138 | return buf; | ||
139 | } | ||
140 | |||
141 | const char *dbg_print_ptype(int val) | ||
142 | { | ||
143 | static char buf[256]; | ||
144 | |||
145 | bzero(buf, 256); | ||
146 | |||
147 | if (val == P_UNKNOWN) | ||
148 | strcpy(buf, "unknown"); | ||
149 | if (val == P_PROMPT) | ||
150 | strcpy(buf, "prompt"); | ||
151 | if (val == P_COMMENT) | ||
152 | strcpy(buf, "comment"); | ||
153 | if (val == P_MENU) | ||
154 | strcpy(buf, "menu"); | ||
155 | if (val == P_DEFAULT) | ||
156 | strcpy(buf, "default"); | ||
157 | if (val == P_CHOICE) | ||
158 | strcpy(buf, "choice"); | ||
159 | |||
160 | #ifdef DEBUG | ||
161 | printf("%s", buf); | ||
162 | #endif | ||
163 | 108 | ||
164 | return buf; | 109 | return buf; |
165 | } | 110 | } |
166 | 111 | ||
167 | |||
168 | void replace_button_icon(GladeXML * xml, GdkDrawable * window, | 112 | void replace_button_icon(GladeXML * xml, GdkDrawable * window, |
169 | GtkStyle * style, gchar * btn_name, gchar ** xpm) | 113 | GtkStyle * style, gchar * btn_name, gchar ** xpm) |
170 | { | 114 | { |
@@ -697,20 +641,29 @@ void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data) | |||
697 | 641 | ||
698 | 642 | ||
699 | void | 643 | void |
700 | on_show_all_options1_activate(GtkMenuItem * menuitem, gpointer user_data) | 644 | on_set_option_mode1_activate(GtkMenuItem *menuitem, gpointer user_data) |
701 | { | 645 | { |
702 | show_all = GTK_CHECK_MENU_ITEM(menuitem)->active; | 646 | opt_mode = OPT_NORMAL; |
647 | gtk_tree_store_clear(tree2); | ||
648 | display_tree(&rootmenu); /* instead of update_tree to speed-up */ | ||
649 | } | ||
650 | |||
703 | 651 | ||
652 | void | ||
653 | on_set_option_mode2_activate(GtkMenuItem *menuitem, gpointer user_data) | ||
654 | { | ||
655 | opt_mode = OPT_ALL; | ||
704 | gtk_tree_store_clear(tree2); | 656 | gtk_tree_store_clear(tree2); |
705 | display_tree(&rootmenu); // instead of update_tree to speed-up | 657 | display_tree(&rootmenu); /* instead of update_tree to speed-up */ |
706 | } | 658 | } |
707 | 659 | ||
708 | 660 | ||
709 | void | 661 | void |
710 | on_show_debug_info1_activate(GtkMenuItem * menuitem, gpointer user_data) | 662 | on_set_option_mode3_activate(GtkMenuItem *menuitem, gpointer user_data) |
711 | { | 663 | { |
712 | show_debug = GTK_CHECK_MENU_ITEM(menuitem)->active; | 664 | opt_mode = OPT_PROMPT; |
713 | update_tree(&rootmenu, NULL); | 665 | gtk_tree_store_clear(tree2); |
666 | display_tree(&rootmenu); /* instead of update_tree to speed-up */ | ||
714 | } | 667 | } |
715 | 668 | ||
716 | 669 | ||
@@ -1163,7 +1116,10 @@ static gchar **fill_row(struct menu *menu) | |||
1163 | g_strdup_printf("%s %s", _(menu_get_prompt(menu)), | 1116 | g_strdup_printf("%s %s", _(menu_get_prompt(menu)), |
1164 | sym && sym_has_value(sym) ? "(NEW)" : ""); | 1117 | sym && sym_has_value(sym) ? "(NEW)" : ""); |
1165 | 1118 | ||
1166 | if (show_all && !menu_is_visible(menu)) | 1119 | if (opt_mode == OPT_ALL && !menu_is_visible(menu)) |
1120 | row[COL_COLOR] = g_strdup("DarkGray"); | ||
1121 | else if (opt_mode == OPT_PROMPT && | ||
1122 | menu_has_prompt(menu) && !menu_is_visible(menu)) | ||
1167 | row[COL_COLOR] = g_strdup("DarkGray"); | 1123 | row[COL_COLOR] = g_strdup("DarkGray"); |
1168 | else | 1124 | else |
1169 | row[COL_COLOR] = g_strdup("Black"); | 1125 | row[COL_COLOR] = g_strdup("Black"); |
@@ -1386,16 +1342,19 @@ static void update_tree(struct menu *src, GtkTreeIter * dst) | |||
1386 | menu2 ? menu_get_prompt(menu2) : "nil"); | 1342 | menu2 ? menu_get_prompt(menu2) : "nil"); |
1387 | #endif | 1343 | #endif |
1388 | 1344 | ||
1389 | if (!menu_is_visible(child1) && !show_all) { // remove node | 1345 | if ((opt_mode == OPT_NORMAL && !menu_is_visible(child1)) || |
1346 | (opt_mode == OPT_PROMPT && !menu_has_prompt(child1))) { | ||
1347 | |||
1348 | /* remove node */ | ||
1390 | if (gtktree_iter_find_node(dst, menu1) != NULL) { | 1349 | if (gtktree_iter_find_node(dst, menu1) != NULL) { |
1391 | memcpy(&tmp, child2, sizeof(GtkTreeIter)); | 1350 | memcpy(&tmp, child2, sizeof(GtkTreeIter)); |
1392 | valid = gtk_tree_model_iter_next(model2, | 1351 | valid = gtk_tree_model_iter_next(model2, |
1393 | child2); | 1352 | child2); |
1394 | gtk_tree_store_remove(tree2, &tmp); | 1353 | gtk_tree_store_remove(tree2, &tmp); |
1395 | if (!valid) | 1354 | if (!valid) |
1396 | return; // next parent | 1355 | return; /* next parent */ |
1397 | else | 1356 | else |
1398 | goto reparse; // next child | 1357 | goto reparse; /* next child */ |
1399 | } else | 1358 | } else |
1400 | continue; | 1359 | continue; |
1401 | } | 1360 | } |
@@ -1464,17 +1423,19 @@ static void display_tree(struct menu *menu) | |||
1464 | && (tree == tree2)) | 1423 | && (tree == tree2)) |
1465 | continue; | 1424 | continue; |
1466 | 1425 | ||
1467 | if (menu_is_visible(child) || show_all) | 1426 | if ((opt_mode == OPT_NORMAL && menu_is_visible(child)) || |
1427 | (opt_mode == OPT_PROMPT && menu_has_prompt(child)) || | ||
1428 | (opt_mode == OPT_ALL)) | ||
1468 | place_node(child, fill_row(child)); | 1429 | place_node(child, fill_row(child)); |
1469 | #ifdef DEBUG | 1430 | #ifdef DEBUG |
1470 | printf("%*c%s: ", indent, ' ', menu_get_prompt(child)); | 1431 | printf("%*c%s: ", indent, ' ', menu_get_prompt(child)); |
1471 | printf("%s", child->flags & MENU_ROOT ? "rootmenu | " : ""); | 1432 | printf("%s", child->flags & MENU_ROOT ? "rootmenu | " : ""); |
1472 | dbg_print_ptype(ptype); | 1433 | printf("%s", prop_get_type_name(ptype)); |
1473 | printf(" | "); | 1434 | printf(" | "); |
1474 | if (sym) { | 1435 | if (sym) { |
1475 | dbg_print_stype(sym->type); | 1436 | printf("%s", sym_type_name(sym->type)); |
1476 | printf(" | "); | 1437 | printf(" | "); |
1477 | dbg_print_flags(sym->flags); | 1438 | printf("%s", dbg_sym_flags(sym->flags)); |
1478 | printf("\n"); | 1439 | printf("\n"); |
1479 | } else | 1440 | } else |
1480 | printf("\n"); | 1441 | printf("\n"); |
diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade index b1c86c19292c..d52b0a75d824 100644 --- a/scripts/kconfig/gconf.glade +++ b/scripts/kconfig/gconf.glade | |||
@@ -190,26 +190,40 @@ | |||
190 | </child> | 190 | </child> |
191 | 191 | ||
192 | <child> | 192 | <child> |
193 | <widget class="GtkCheckMenuItem" id="show_all_options1"> | 193 | <widget class="GtkRadioMenuItem" id="set_option_mode1"> |
194 | <property name="visible">True</property> | ||
195 | <property name="tooltip" translatable="yes">Show normal options</property> | ||
196 | <property name="label" translatable="yes">Show normal options</property> | ||
197 | <property name="use_underline">True</property> | ||
198 | <property name="active">True</property> | ||
199 | <signal name="activate" handler="on_set_option_mode1_activate"/> | ||
200 | </widget> | ||
201 | </child> | ||
202 | |||
203 | <child> | ||
204 | <widget class="GtkRadioMenuItem" id="set_option_mode2"> | ||
194 | <property name="visible">True</property> | 205 | <property name="visible">True</property> |
195 | <property name="tooltip" translatable="yes">Show all options</property> | 206 | <property name="tooltip" translatable="yes">Show all options</property> |
196 | <property name="label" translatable="yes">Show all _options</property> | 207 | <property name="label" translatable="yes">Show all _options</property> |
197 | <property name="use_underline">True</property> | 208 | <property name="use_underline">True</property> |
198 | <property name="active">False</property> | 209 | <property name="active">False</property> |
199 | <signal name="activate" handler="on_show_all_options1_activate"/> | 210 | <property name="group">set_option_mode1</property> |
211 | <signal name="activate" handler="on_set_option_mode2_activate"/> | ||
200 | </widget> | 212 | </widget> |
201 | </child> | 213 | </child> |
202 | 214 | ||
203 | <child> | 215 | <child> |
204 | <widget class="GtkCheckMenuItem" id="show_debug_info1"> | 216 | <widget class="GtkRadioMenuItem" id="set_option_mode3"> |
205 | <property name="visible">True</property> | 217 | <property name="visible">True</property> |
206 | <property name="tooltip" translatable="yes">Show masked options</property> | 218 | <property name="tooltip" translatable="yes">Show all options with prompts</property> |
207 | <property name="label" translatable="yes">Show _debug info</property> | 219 | <property name="label" translatable="yes">Show all prompt options</property> |
208 | <property name="use_underline">True</property> | 220 | <property name="use_underline">True</property> |
209 | <property name="active">False</property> | 221 | <property name="active">False</property> |
210 | <signal name="activate" handler="on_show_debug_info1_activate"/> | 222 | <property name="group">set_option_mode1</property> |
223 | <signal name="activate" handler="on_set_option_mode3_activate"/> | ||
211 | </widget> | 224 | </widget> |
212 | </child> | 225 | </child> |
226 | |||
213 | </widget> | 227 | </widget> |
214 | </child> | 228 | </child> |
215 | </widget> | 229 | </widget> |
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index f379b0bf8c9e..ce6549cdaccf 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -84,7 +84,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode); | |||
84 | void kconfig_load(void); | 84 | void kconfig_load(void); |
85 | 85 | ||
86 | /* menu.c */ | 86 | /* menu.c */ |
87 | void menu_init(void); | 87 | void _menu_init(void); |
88 | void menu_warn(struct menu *menu, const char *fmt, ...); | 88 | void menu_warn(struct menu *menu, const char *fmt, ...); |
89 | struct menu *menu_add_menu(void); | 89 | struct menu *menu_add_menu(void); |
90 | void menu_end_menu(void); | 90 | void menu_end_menu(void); |
@@ -106,6 +106,11 @@ int file_write_dep(const char *name); | |||
106 | struct gstr { | 106 | struct gstr { |
107 | size_t len; | 107 | size_t len; |
108 | char *s; | 108 | char *s; |
109 | /* | ||
110 | * when max_width is not zero long lines in string s (if any) get | ||
111 | * wrapped not to exceed the max_width value | ||
112 | */ | ||
113 | int max_width; | ||
109 | }; | 114 | }; |
110 | struct gstr str_new(void); | 115 | struct gstr str_new(void); |
111 | struct gstr str_assign(const char *s); | 116 | struct gstr str_assign(const char *s); |
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index ffeb532b2cff..7cadcad8233b 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
@@ -11,13 +11,15 @@ P(conf_set_changed_callback, void,(void (*fn)(void))); | |||
11 | /* menu.c */ | 11 | /* menu.c */ |
12 | P(rootmenu,struct menu,); | 12 | P(rootmenu,struct menu,); |
13 | 13 | ||
14 | P(menu_is_visible,bool,(struct menu *menu)); | 14 | P(menu_is_visible, bool, (struct menu *menu)); |
15 | P(menu_has_prompt, bool, (struct menu *menu)); | ||
15 | P(menu_get_prompt,const char *,(struct menu *menu)); | 16 | P(menu_get_prompt,const char *,(struct menu *menu)); |
16 | P(menu_get_root_menu,struct menu *,(struct menu *menu)); | 17 | P(menu_get_root_menu,struct menu *,(struct menu *menu)); |
17 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); | 18 | P(menu_get_parent_menu,struct menu *,(struct menu *menu)); |
18 | P(menu_has_help,bool,(struct menu *menu)); | 19 | P(menu_has_help,bool,(struct menu *menu)); |
19 | P(menu_get_help,const char *,(struct menu *menu)); | 20 | P(menu_get_help,const char *,(struct menu *menu)); |
20 | P(get_symbol_str,void,(struct gstr *r, struct symbol *sym)); | 21 | P(get_symbol_str, void, (struct gstr *r, struct symbol *sym)); |
22 | P(get_relations_str, struct gstr, (struct symbol **sym_arr)); | ||
21 | P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); | 23 | P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); |
22 | 24 | ||
23 | /* symbol.c */ | 25 | /* symbol.c */ |
diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c index 616c60138183..dd8e587c50e2 100644 --- a/scripts/kconfig/lxdialog/inputbox.c +++ b/scripts/kconfig/lxdialog/inputbox.c | |||
@@ -180,7 +180,7 @@ do_resize: | |||
180 | case KEY_LEFT: | 180 | case KEY_LEFT: |
181 | switch (button) { | 181 | switch (button) { |
182 | case -1: | 182 | case -1: |
183 | button = 1; /* Indicates "Cancel" button is selected */ | 183 | button = 1; /* Indicates "Help" button is selected */ |
184 | print_buttons(dialog, height, width, 1); | 184 | print_buttons(dialog, height, width, 1); |
185 | break; | 185 | break; |
186 | case 0: | 186 | case 0: |
@@ -204,7 +204,7 @@ do_resize: | |||
204 | print_buttons(dialog, height, width, 0); | 204 | print_buttons(dialog, height, width, 0); |
205 | break; | 205 | break; |
206 | case 0: | 206 | case 0: |
207 | button = 1; /* Indicates "Cancel" button is selected */ | 207 | button = 1; /* Indicates "Help" button is selected */ |
208 | print_buttons(dialog, height, width, 1); | 208 | print_buttons(dialog, height, width, 1); |
209 | break; | 209 | break; |
210 | case 1: | 210 | case 1: |
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c index fa9d633f293c..1d604738fa13 100644 --- a/scripts/kconfig/lxdialog/menubox.c +++ b/scripts/kconfig/lxdialog/menubox.c | |||
@@ -383,6 +383,10 @@ do_resize: | |||
383 | case 'n': | 383 | case 'n': |
384 | case 'm': | 384 | case 'm': |
385 | case '/': | 385 | case '/': |
386 | case 'h': | ||
387 | case '?': | ||
388 | case 'z': | ||
389 | case '\n': | ||
386 | /* save scroll info */ | 390 | /* save scroll info */ |
387 | *s_scroll = scroll; | 391 | *s_scroll = scroll; |
388 | delwin(menu); | 392 | delwin(menu); |
@@ -390,8 +394,10 @@ do_resize: | |||
390 | item_set(scroll + choice); | 394 | item_set(scroll + choice); |
391 | item_set_selected(1); | 395 | item_set_selected(1); |
392 | switch (key) { | 396 | switch (key) { |
397 | case 'h': | ||
398 | case '?': | ||
399 | return 2; | ||
393 | case 's': | 400 | case 's': |
394 | return 3; | ||
395 | case 'y': | 401 | case 'y': |
396 | return 3; | 402 | return 3; |
397 | case 'n': | 403 | case 'n': |
@@ -402,18 +408,12 @@ do_resize: | |||
402 | return 6; | 408 | return 6; |
403 | case '/': | 409 | case '/': |
404 | return 7; | 410 | return 7; |
411 | case 'z': | ||
412 | return 8; | ||
413 | case '\n': | ||
414 | return button; | ||
405 | } | 415 | } |
406 | return 0; | 416 | return 0; |
407 | case 'h': | ||
408 | case '?': | ||
409 | button = 2; | ||
410 | case '\n': | ||
411 | *s_scroll = scroll; | ||
412 | delwin(menu); | ||
413 | delwin(dialog); | ||
414 | item_set(scroll + choice); | ||
415 | item_set_selected(1); | ||
416 | return button; | ||
417 | case 'e': | 417 | case 'e': |
418 | case 'x': | 418 | case 'x': |
419 | key = KEY_ESC; | 419 | key = KEY_ESC; |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 8413cf38ed27..2c83d3234d30 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -67,13 +67,15 @@ static const char mconf_readme[] = N_( | |||
67 | " there is a delayed response which you may find annoying.\n" | 67 | " there is a delayed response which you may find annoying.\n" |
68 | "\n" | 68 | "\n" |
69 | " Also, the <TAB> and cursor keys will cycle between <Select>,\n" | 69 | " Also, the <TAB> and cursor keys will cycle between <Select>,\n" |
70 | " <Exit> and <Help>\n" | 70 | " <Exit> and <Help>.\n" |
71 | "\n" | 71 | "\n" |
72 | "o To get help with an item, use the cursor keys to highlight <Help>\n" | 72 | "o To get help with an item, use the cursor keys to highlight <Help>\n" |
73 | " and Press <ENTER>.\n" | 73 | " and press <ENTER>.\n" |
74 | "\n" | 74 | "\n" |
75 | " Shortcut: Press <H> or <?>.\n" | 75 | " Shortcut: Press <H> or <?>.\n" |
76 | "\n" | 76 | "\n" |
77 | "o To show hidden options, press <Z>.\n" | ||
78 | "\n" | ||
77 | "\n" | 79 | "\n" |
78 | "Radiolists (Choice lists)\n" | 80 | "Radiolists (Choice lists)\n" |
79 | "-----------\n" | 81 | "-----------\n" |
@@ -272,6 +274,7 @@ static int indent; | |||
272 | static struct menu *current_menu; | 274 | static struct menu *current_menu; |
273 | static int child_count; | 275 | static int child_count; |
274 | static int single_menu_mode; | 276 | static int single_menu_mode; |
277 | static int show_all_options; | ||
275 | 278 | ||
276 | static void conf(struct menu *menu); | 279 | static void conf(struct menu *menu); |
277 | static void conf_choice(struct menu *menu); | 280 | static void conf_choice(struct menu *menu); |
@@ -282,19 +285,6 @@ static void show_textbox(const char *title, const char *text, int r, int c); | |||
282 | static void show_helptext(const char *title, const char *text); | 285 | static void show_helptext(const char *title, const char *text); |
283 | static void show_help(struct menu *menu); | 286 | static void show_help(struct menu *menu); |
284 | 287 | ||
285 | static struct gstr get_relations_str(struct symbol **sym_arr) | ||
286 | { | ||
287 | struct symbol *sym; | ||
288 | struct gstr res = str_new(); | ||
289 | int i; | ||
290 | |||
291 | for (i = 0; sym_arr && (sym = sym_arr[i]); i++) | ||
292 | get_symbol_str(&res, sym); | ||
293 | if (!i) | ||
294 | str_append(&res, _("No matches found.\n")); | ||
295 | return res; | ||
296 | } | ||
297 | |||
298 | static char filename[PATH_MAX+1]; | 288 | static char filename[PATH_MAX+1]; |
299 | static void set_config_filename(const char *config_filename) | 289 | static void set_config_filename(const char *config_filename) |
300 | { | 290 | { |
@@ -359,8 +349,16 @@ static void build_conf(struct menu *menu) | |||
359 | int type, tmp, doint = 2; | 349 | int type, tmp, doint = 2; |
360 | tristate val; | 350 | tristate val; |
361 | char ch; | 351 | char ch; |
362 | 352 | bool visible; | |
363 | if (!menu_is_visible(menu)) | 353 | |
354 | /* | ||
355 | * note: menu_is_visible() has side effect that it will | ||
356 | * recalc the value of the symbol. | ||
357 | */ | ||
358 | visible = menu_is_visible(menu); | ||
359 | if (show_all_options && !menu_has_prompt(menu)) | ||
360 | return; | ||
361 | else if (!show_all_options && !visible) | ||
364 | return; | 362 | return; |
365 | 363 | ||
366 | sym = menu->sym; | 364 | sym = menu->sym; |
@@ -619,6 +617,9 @@ static void conf(struct menu *menu) | |||
619 | case 7: | 617 | case 7: |
620 | search_conf(); | 618 | search_conf(); |
621 | break; | 619 | break; |
620 | case 8: | ||
621 | show_all_options = !show_all_options; | ||
622 | break; | ||
622 | } | 623 | } |
623 | } | 624 | } |
624 | } | 625 | } |
@@ -638,6 +639,7 @@ static void show_help(struct menu *menu) | |||
638 | { | 639 | { |
639 | struct gstr help = str_new(); | 640 | struct gstr help = str_new(); |
640 | 641 | ||
642 | help.max_width = getmaxx(stdscr) - 10; | ||
641 | menu_get_ext_help(menu, &help); | 643 | menu_get_ext_help(menu, &help); |
642 | 644 | ||
643 | show_helptext(_(menu_get_prompt(menu)), str_get(&help)); | 645 | show_helptext(_(menu_get_prompt(menu)), str_get(&help)); |
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 059a2465c574..203632cc30bd 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
@@ -38,7 +38,7 @@ static void prop_warn(struct property *prop, const char *fmt, ...) | |||
38 | va_end(ap); | 38 | va_end(ap); |
39 | } | 39 | } |
40 | 40 | ||
41 | void menu_init(void) | 41 | void _menu_init(void) |
42 | { | 42 | { |
43 | current_entry = current_menu = &rootmenu; | 43 | current_entry = current_menu = &rootmenu; |
44 | last_entry_ptr = &rootmenu.list; | 44 | last_entry_ptr = &rootmenu.list; |
@@ -197,7 +197,7 @@ static void sym_check_prop(struct symbol *sym) | |||
197 | if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) && | 197 | if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) && |
198 | prop->expr->type != E_SYMBOL) | 198 | prop->expr->type != E_SYMBOL) |
199 | prop_warn(prop, | 199 | prop_warn(prop, |
200 | "default for config symbol '%'" | 200 | "default for config symbol '%s'" |
201 | " must be a single symbol", sym->name); | 201 | " must be a single symbol", sym->name); |
202 | break; | 202 | break; |
203 | case P_SELECT: | 203 | case P_SELECT: |
@@ -390,6 +390,13 @@ void menu_finalize(struct menu *parent) | |||
390 | } | 390 | } |
391 | } | 391 | } |
392 | 392 | ||
393 | bool menu_has_prompt(struct menu *menu) | ||
394 | { | ||
395 | if (!menu->prompt) | ||
396 | return false; | ||
397 | return true; | ||
398 | } | ||
399 | |||
393 | bool menu_is_visible(struct menu *menu) | 400 | bool menu_is_visible(struct menu *menu) |
394 | { | 401 | { |
395 | struct menu *child; | 402 | struct menu *child; |
@@ -398,6 +405,7 @@ bool menu_is_visible(struct menu *menu) | |||
398 | 405 | ||
399 | if (!menu->prompt) | 406 | if (!menu->prompt) |
400 | return false; | 407 | return false; |
408 | |||
401 | sym = menu->sym; | 409 | sym = menu->sym; |
402 | if (sym) { | 410 | if (sym) { |
403 | sym_calc_value(sym); | 411 | sym_calc_value(sym); |
@@ -407,12 +415,14 @@ bool menu_is_visible(struct menu *menu) | |||
407 | 415 | ||
408 | if (visible != no) | 416 | if (visible != no) |
409 | return true; | 417 | return true; |
418 | |||
410 | if (!sym || sym_get_tristate_value(menu->sym) == no) | 419 | if (!sym || sym_get_tristate_value(menu->sym) == no) |
411 | return false; | 420 | return false; |
412 | 421 | ||
413 | for (child = menu->list; child; child = child->next) | 422 | for (child = menu->list; child; child = child->next) |
414 | if (menu_is_visible(child)) | 423 | if (menu_is_visible(child)) |
415 | return true; | 424 | return true; |
425 | |||
416 | return false; | 426 | return false; |
417 | } | 427 | } |
418 | 428 | ||
@@ -515,6 +525,20 @@ void get_symbol_str(struct gstr *r, struct symbol *sym) | |||
515 | str_append(r, "\n\n"); | 525 | str_append(r, "\n\n"); |
516 | } | 526 | } |
517 | 527 | ||
528 | struct gstr get_relations_str(struct symbol **sym_arr) | ||
529 | { | ||
530 | struct symbol *sym; | ||
531 | struct gstr res = str_new(); | ||
532 | int i; | ||
533 | |||
534 | for (i = 0; sym_arr && (sym = sym_arr[i]); i++) | ||
535 | get_symbol_str(&res, sym); | ||
536 | if (!i) | ||
537 | str_append(&res, _("No matches found.\n")); | ||
538 | return res; | ||
539 | } | ||
540 | |||
541 | |||
518 | void menu_get_ext_help(struct menu *menu, struct gstr *help) | 542 | void menu_get_ext_help(struct menu *menu, struct gstr *help) |
519 | { | 543 | { |
520 | struct symbol *sym = menu->sym; | 544 | struct symbol *sym = menu->sym; |
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c new file mode 100644 index 000000000000..762caf80ce37 --- /dev/null +++ b/scripts/kconfig/nconf.c | |||
@@ -0,0 +1,1568 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Nir Tzachar <nir.tzachar@gmail.com? | ||
3 | * Released under the terms of the GNU GPL v2.0. | ||
4 | * | ||
5 | * Derived from menuconfig. | ||
6 | * | ||
7 | */ | ||
8 | #define LKC_DIRECT_LINK | ||
9 | #include "lkc.h" | ||
10 | #include "nconf.h" | ||
11 | |||
12 | static const char nconf_readme[] = N_( | ||
13 | "Overview\n" | ||
14 | "--------\n" | ||
15 | "Some kernel features may be built directly into the kernel.\n" | ||
16 | "Some may be made into loadable runtime modules. Some features\n" | ||
17 | "may be completely removed altogether. There are also certain\n" | ||
18 | "kernel parameters which are not really features, but must be\n" | ||
19 | "entered in as decimal or hexadecimal numbers or possibly text.\n" | ||
20 | "\n" | ||
21 | "Menu items beginning with following braces represent features that\n" | ||
22 | " [ ] can be built in or removed\n" | ||
23 | " < > can be built in, modularized or removed\n" | ||
24 | " { } can be built in or modularized (selected by other feature)\n" | ||
25 | " - - are selected by other feature,\n" | ||
26 | " XXX cannot be selected. use Symbol Info to find out why,\n" | ||
27 | "while *, M or whitespace inside braces means to build in, build as\n" | ||
28 | "a module or to exclude the feature respectively.\n" | ||
29 | "\n" | ||
30 | "To change any of these features, highlight it with the cursor\n" | ||
31 | "keys and press <Y> to build it in, <M> to make it a module or\n" | ||
32 | "<N> to removed it. You may also press the <Space Bar> to cycle\n" | ||
33 | "through the available options (ie. Y->N->M->Y).\n" | ||
34 | "\n" | ||
35 | "Some additional keyboard hints:\n" | ||
36 | "\n" | ||
37 | "Menus\n" | ||
38 | "----------\n" | ||
39 | "o Use the Up/Down arrow keys (cursor keys) to highlight the item\n" | ||
40 | " you wish to change use <Enter> or <Space>. Goto submenu by \n" | ||
41 | " pressing <Enter> of <right-arrow>. Use <Esc> or <left-arrow> to go back.\n" | ||
42 | " Submenus are designated by \"--->\".\n" | ||
43 | "\n" | ||
44 | " Shortcut: Press the option's highlighted letter (hotkey).\n" | ||
45 | " Pressing a hotkey more than once will sequence\n" | ||
46 | " through all visible items which use that hotkey.\n" | ||
47 | "\n" | ||
48 | " You may also use the <PAGE UP> and <PAGE DOWN> keys to scroll\n" | ||
49 | " unseen options into view.\n" | ||
50 | "\n" | ||
51 | "o To exit a menu use the just press <ESC> <F5> <F8> or <left-arrow>.\n" | ||
52 | "\n" | ||
53 | "o To get help with an item, press <F1>\n" | ||
54 | " Shortcut: Press <h> or <?>.\n" | ||
55 | "\n" | ||
56 | "\n" | ||
57 | "Radiolists (Choice lists)\n" | ||
58 | "-----------\n" | ||
59 | "o Use the cursor keys to select the option you wish to set and press\n" | ||
60 | " <S> or the <SPACE BAR>.\n" | ||
61 | "\n" | ||
62 | " Shortcut: Press the first letter of the option you wish to set then\n" | ||
63 | " press <S> or <SPACE BAR>.\n" | ||
64 | "\n" | ||
65 | "o To see available help for the item, press <F1>\n" | ||
66 | " Shortcut: Press <H> or <?>.\n" | ||
67 | "\n" | ||
68 | "\n" | ||
69 | "Data Entry\n" | ||
70 | "-----------\n" | ||
71 | "o Enter the requested information and press <ENTER>\n" | ||
72 | " If you are entering hexadecimal values, it is not necessary to\n" | ||
73 | " add the '0x' prefix to the entry.\n" | ||
74 | "\n" | ||
75 | "o For help, press <F1>.\n" | ||
76 | "\n" | ||
77 | "\n" | ||
78 | "Text Box (Help Window)\n" | ||
79 | "--------\n" | ||
80 | "o Use the cursor keys to scroll up/down/left/right. The VI editor\n" | ||
81 | " keys h,j,k,l function here as do <SPACE BAR> for those\n" | ||
82 | " who are familiar with less and lynx.\n" | ||
83 | "\n" | ||
84 | "o Press <Enter>, <F1>, <F5>, <F7> or <Esc> to exit.\n" | ||
85 | "\n" | ||
86 | "\n" | ||
87 | "Alternate Configuration Files\n" | ||
88 | "-----------------------------\n" | ||
89 | "nconfig supports the use of alternate configuration files for\n" | ||
90 | "those who, for various reasons, find it necessary to switch\n" | ||
91 | "between different kernel configurations.\n" | ||
92 | "\n" | ||
93 | "At the end of the main menu you will find two options. One is\n" | ||
94 | "for saving the current configuration to a file of your choosing.\n" | ||
95 | "The other option is for loading a previously saved alternate\n" | ||
96 | "configuration.\n" | ||
97 | "\n" | ||
98 | "Even if you don't use alternate configuration files, but you\n" | ||
99 | "find during a nconfig session that you have completely messed\n" | ||
100 | "up your settings, you may use the \"Load Alternate...\" option to\n" | ||
101 | "restore your previously saved settings from \".config\" without\n" | ||
102 | "restarting nconfig.\n" | ||
103 | "\n" | ||
104 | "Other information\n" | ||
105 | "-----------------\n" | ||
106 | "If you use nconfig in an XTERM window make sure you have your\n" | ||
107 | "$TERM variable set to point to a xterm definition which supports color.\n" | ||
108 | "Otherwise, nconfig will look rather bad. nconfig will not\n" | ||
109 | "display correctly in a RXVT window because rxvt displays only one\n" | ||
110 | "intensity of color, bright.\n" | ||
111 | "\n" | ||
112 | "nconfig will display larger menus on screens or xterms which are\n" | ||
113 | "set to display more than the standard 25 row by 80 column geometry.\n" | ||
114 | "In order for this to work, the \"stty size\" command must be able to\n" | ||
115 | "display the screen's current row and column geometry. I STRONGLY\n" | ||
116 | "RECOMMEND that you make sure you do NOT have the shell variables\n" | ||
117 | "LINES and COLUMNS exported into your environment. Some distributions\n" | ||
118 | "export those variables via /etc/profile. Some ncurses programs can\n" | ||
119 | "become confused when those variables (LINES & COLUMNS) don't reflect\n" | ||
120 | "the true screen size.\n" | ||
121 | "\n" | ||
122 | "Optional personality available\n" | ||
123 | "------------------------------\n" | ||
124 | "If you prefer to have all of the kernel options listed in a single\n" | ||
125 | "menu, rather than the default multimenu hierarchy, run the nconfig\n" | ||
126 | "with NCONFIG_MODE environment variable set to single_menu. Example:\n" | ||
127 | "\n" | ||
128 | "make NCONFIG_MODE=single_menu nconfig\n" | ||
129 | "\n" | ||
130 | "<Enter> will then unroll the appropriate category, or enfold it if it\n" | ||
131 | "is already unrolled.\n" | ||
132 | "\n" | ||
133 | "Note that this mode can eventually be a little more CPU expensive\n" | ||
134 | "(especially with a larger number of unrolled categories) than the\n" | ||
135 | "default mode.\n" | ||
136 | "\n"), | ||
137 | menu_no_f_instructions[] = N_( | ||
138 | " You do not have function keys support. Please follow the\n" | ||
139 | " following instructions:\n" | ||
140 | " Arrow keys navigate the menu.\n" | ||
141 | " <Enter> or <right-arrow> selects submenus --->.\n" | ||
142 | " Capital Letters are hotkeys.\n" | ||
143 | " Pressing <Y> includes, <N> excludes, <M> modularizes features.\n" | ||
144 | " Pressing SpaceBar toggles between the above options\n" | ||
145 | " Press <Esc> or <left-arrow> to go back one menu, \n" | ||
146 | " <?> or <h> for Help, </> for Search.\n" | ||
147 | " <1> is interchangable with <F1>, <2> with <F2>, etc.\n" | ||
148 | " Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" | ||
149 | " <Esc> always leaves the current window\n"), | ||
150 | menu_instructions[] = N_( | ||
151 | " Arrow keys navigate the menu.\n" | ||
152 | " <Enter> or <right-arrow> selects submenus --->.\n" | ||
153 | " Capital Letters are hotkeys.\n" | ||
154 | " Pressing <Y> includes, <N> excludes, <M> modularizes features.\n" | ||
155 | " Pressing SpaceBar toggles between the above options\n" | ||
156 | " Press <Esc>, <F3> or <left-arrow> to go back one menu, \n" | ||
157 | " <?>, <F1> or <h> for Help, </> for Search.\n" | ||
158 | " <1> is interchangable with <F1>, <2> with <F2>, etc.\n" | ||
159 | " Legend: [*] built-in [ ] excluded <M> module < > module capable.\n" | ||
160 | " <Esc> always leaves the current window\n"), | ||
161 | radiolist_instructions[] = N_( | ||
162 | " Use the arrow keys to navigate this window or\n" | ||
163 | " press the hotkey of the item you wish to select\n" | ||
164 | " followed by the <SPACE BAR>.\n" | ||
165 | " Press <?>, <F1> or <h> for additional information about this option.\n"), | ||
166 | inputbox_instructions_int[] = N_( | ||
167 | "Please enter a decimal value.\n" | ||
168 | "Fractions will not be accepted.\n" | ||
169 | "Press <RETURN> to accept, <ESC> to cancel."), | ||
170 | inputbox_instructions_hex[] = N_( | ||
171 | "Please enter a hexadecimal value.\n" | ||
172 | "Press <RETURN> to accept, <ESC> to cancel."), | ||
173 | inputbox_instructions_string[] = N_( | ||
174 | "Please enter a string value.\n" | ||
175 | "Press <RETURN> to accept, <ESC> to cancel."), | ||
176 | setmod_text[] = N_( | ||
177 | "This feature depends on another which\n" | ||
178 | "has been configured as a module.\n" | ||
179 | "As a result, this feature will be built as a module."), | ||
180 | nohelp_text[] = N_( | ||
181 | "There is no help available for this kernel option.\n"), | ||
182 | load_config_text[] = N_( | ||
183 | "Enter the name of the configuration file you wish to load.\n" | ||
184 | "Accept the name shown to restore the configuration you\n" | ||
185 | "last retrieved. Leave blank to abort."), | ||
186 | load_config_help[] = N_( | ||
187 | "\n" | ||
188 | "For various reasons, one may wish to keep several different kernel\n" | ||
189 | "configurations available on a single machine.\n" | ||
190 | "\n" | ||
191 | "If you have saved a previous configuration in a file other than the\n" | ||
192 | "kernel's default, entering the name of the file here will allow you\n" | ||
193 | "to modify that configuration.\n" | ||
194 | "\n" | ||
195 | "If you are uncertain, then you have probably never used alternate\n" | ||
196 | "configuration files. You should therefor leave this blank to abort.\n"), | ||
197 | save_config_text[] = N_( | ||
198 | "Enter a filename to which this configuration should be saved\n" | ||
199 | "as an alternate. Leave blank to abort."), | ||
200 | save_config_help[] = N_( | ||
201 | "\n" | ||
202 | "For various reasons, one may wish to keep different kernel\n" | ||
203 | "configurations available on a single machine.\n" | ||
204 | "\n" | ||
205 | "Entering a file name here will allow you to later retrieve, modify\n" | ||
206 | "and use the current configuration as an alternate to whatever\n" | ||
207 | "configuration options you have selected at that time.\n" | ||
208 | "\n" | ||
209 | "If you are uncertain what all this means then you should probably\n" | ||
210 | "leave this blank.\n"), | ||
211 | search_help[] = N_( | ||
212 | "\n" | ||
213 | "Search for CONFIG_ symbols and display their relations.\n" | ||
214 | "Regular expressions are allowed.\n" | ||
215 | "Example: search for \"^FOO\"\n" | ||
216 | "Result:\n" | ||
217 | "-----------------------------------------------------------------\n" | ||
218 | "Symbol: FOO [ = m]\n" | ||
219 | "Prompt: Foo bus is used to drive the bar HW\n" | ||
220 | "Defined at drivers/pci/Kconfig:47\n" | ||
221 | "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" | ||
222 | "Location:\n" | ||
223 | " -> Bus options (PCI, PCMCIA, EISA, MCA, ISA)\n" | ||
224 | " -> PCI support (PCI [ = y])\n" | ||
225 | " -> PCI access mode (<choice> [ = y])\n" | ||
226 | "Selects: LIBCRC32\n" | ||
227 | "Selected by: BAR\n" | ||
228 | "-----------------------------------------------------------------\n" | ||
229 | "o The line 'Prompt:' shows the text used in the menu structure for\n" | ||
230 | " this CONFIG_ symbol\n" | ||
231 | "o The 'Defined at' line tell at what file / line number the symbol\n" | ||
232 | " is defined\n" | ||
233 | "o The 'Depends on:' line tell what symbols needs to be defined for\n" | ||
234 | " this symbol to be visible in the menu (selectable)\n" | ||
235 | "o The 'Location:' lines tell where in the menu structure this symbol\n" | ||
236 | " is located\n" | ||
237 | " A location followed by a [ = y] indicate that this is a selectable\n" | ||
238 | " menu item - and current value is displayed inside brackets.\n" | ||
239 | "o The 'Selects:' line tell what symbol will be automatically\n" | ||
240 | " selected if this symbol is selected (y or m)\n" | ||
241 | "o The 'Selected by' line tell what symbol has selected this symbol\n" | ||
242 | "\n" | ||
243 | "Only relevant lines are shown.\n" | ||
244 | "\n\n" | ||
245 | "Search examples:\n" | ||
246 | "Examples: USB = > find all CONFIG_ symbols containing USB\n" | ||
247 | " ^USB => find all CONFIG_ symbols starting with USB\n" | ||
248 | " USB$ => find all CONFIG_ symbols ending with USB\n" | ||
249 | "\n"); | ||
250 | |||
251 | struct mitem { | ||
252 | char str[256]; | ||
253 | char tag; | ||
254 | void *usrptr; | ||
255 | int is_hot; | ||
256 | int is_visible; | ||
257 | }; | ||
258 | |||
259 | #define MAX_MENU_ITEMS 4096 | ||
260 | static int show_all_items; | ||
261 | static int indent; | ||
262 | static struct menu *current_menu; | ||
263 | static int child_count; | ||
264 | static int single_menu_mode; | ||
265 | /* the window in which all information appears */ | ||
266 | static WINDOW *main_window; | ||
267 | /* the largest size of the menu window */ | ||
268 | static int mwin_max_lines; | ||
269 | static int mwin_max_cols; | ||
270 | /* the window in which we show option buttons */ | ||
271 | static MENU *curses_menu; | ||
272 | static ITEM *curses_menu_items[MAX_MENU_ITEMS]; | ||
273 | static struct mitem k_menu_items[MAX_MENU_ITEMS]; | ||
274 | static int items_num; | ||
275 | static int global_exit; | ||
276 | /* the currently selected button */ | ||
277 | const char *current_instructions = menu_instructions; | ||
278 | /* this array is used to implement hot keys. it is updated in item_make and | ||
279 | * resetted in clean_items. It would be better to use a hash, but lets keep it | ||
280 | * simple... */ | ||
281 | #define MAX_SAME_KEY MAX_MENU_ITEMS | ||
282 | struct { | ||
283 | int count; | ||
284 | int ptrs[MAX_MENU_ITEMS]; | ||
285 | } hotkeys[1<<(sizeof(char)*8)]; | ||
286 | |||
287 | static void conf(struct menu *menu); | ||
288 | static void conf_choice(struct menu *menu); | ||
289 | static void conf_string(struct menu *menu); | ||
290 | static void conf_load(void); | ||
291 | static void conf_save(void); | ||
292 | static void show_help(struct menu *menu); | ||
293 | static int do_exit(void); | ||
294 | static void setup_windows(void); | ||
295 | |||
296 | typedef void (*function_key_handler_t)(int *key, struct menu *menu); | ||
297 | static void handle_f1(int *key, struct menu *current_item); | ||
298 | static void handle_f2(int *key, struct menu *current_item); | ||
299 | static void handle_f3(int *key, struct menu *current_item); | ||
300 | static void handle_f4(int *key, struct menu *current_item); | ||
301 | static void handle_f5(int *key, struct menu *current_item); | ||
302 | static void handle_f6(int *key, struct menu *current_item); | ||
303 | static void handle_f7(int *key, struct menu *current_item); | ||
304 | static void handle_f8(int *key, struct menu *current_item); | ||
305 | |||
306 | struct function_keys { | ||
307 | const char *key_str; | ||
308 | const char *func; | ||
309 | function_key key; | ||
310 | function_key_handler_t handler; | ||
311 | }; | ||
312 | |||
313 | static const int function_keys_num = 8; | ||
314 | struct function_keys function_keys[] = { | ||
315 | { | ||
316 | .key_str = "F1", | ||
317 | .func = "Help", | ||
318 | .key = F_HELP, | ||
319 | .handler = handle_f1, | ||
320 | }, | ||
321 | { | ||
322 | .key_str = "F2", | ||
323 | .func = "Symbol Info", | ||
324 | .key = F_SYMBOL, | ||
325 | .handler = handle_f2, | ||
326 | }, | ||
327 | { | ||
328 | .key_str = "F3", | ||
329 | .func = "Instructions", | ||
330 | .key = F_INSTS, | ||
331 | .handler = handle_f3, | ||
332 | }, | ||
333 | { | ||
334 | .key_str = "F4", | ||
335 | .func = "Config", | ||
336 | .key = F_CONF, | ||
337 | .handler = handle_f4, | ||
338 | }, | ||
339 | { | ||
340 | .key_str = "F5", | ||
341 | .func = "Back", | ||
342 | .key = F_BACK, | ||
343 | .handler = handle_f5, | ||
344 | }, | ||
345 | { | ||
346 | .key_str = "F6", | ||
347 | .func = "Save", | ||
348 | .key = F_SAVE, | ||
349 | .handler = handle_f6, | ||
350 | }, | ||
351 | { | ||
352 | .key_str = "F7", | ||
353 | .func = "Load", | ||
354 | .key = F_LOAD, | ||
355 | .handler = handle_f7, | ||
356 | }, | ||
357 | { | ||
358 | .key_str = "F8", | ||
359 | .func = "Exit", | ||
360 | .key = F_EXIT, | ||
361 | .handler = handle_f8, | ||
362 | }, | ||
363 | }; | ||
364 | |||
365 | static void print_function_line(void) | ||
366 | { | ||
367 | int i; | ||
368 | int offset = 1; | ||
369 | const int skip = 1; | ||
370 | |||
371 | for (i = 0; i < function_keys_num; i++) { | ||
372 | wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]); | ||
373 | mvwprintw(main_window, LINES-3, offset, | ||
374 | "%s", | ||
375 | function_keys[i].key_str); | ||
376 | wattrset(main_window, attributes[FUNCTION_TEXT]); | ||
377 | offset += strlen(function_keys[i].key_str); | ||
378 | mvwprintw(main_window, LINES-3, | ||
379 | offset, "%s", | ||
380 | function_keys[i].func); | ||
381 | offset += strlen(function_keys[i].func) + skip; | ||
382 | } | ||
383 | wattrset(main_window, attributes[NORMAL]); | ||
384 | } | ||
385 | |||
386 | /* help */ | ||
387 | static void handle_f1(int *key, struct menu *current_item) | ||
388 | { | ||
389 | show_scroll_win(main_window, | ||
390 | _("README"), _(nconf_readme)); | ||
391 | return; | ||
392 | } | ||
393 | |||
394 | /* symbole help */ | ||
395 | static void handle_f2(int *key, struct menu *current_item) | ||
396 | { | ||
397 | show_help(current_item); | ||
398 | return; | ||
399 | } | ||
400 | |||
401 | /* instructions */ | ||
402 | static void handle_f3(int *key, struct menu *current_item) | ||
403 | { | ||
404 | show_scroll_win(main_window, | ||
405 | _("Instructions"), | ||
406 | _(current_instructions)); | ||
407 | return; | ||
408 | } | ||
409 | |||
410 | /* config */ | ||
411 | static void handle_f4(int *key, struct menu *current_item) | ||
412 | { | ||
413 | int res = btn_dialog(main_window, | ||
414 | _("Show all symbols?"), | ||
415 | 2, | ||
416 | " <Show All> ", | ||
417 | "<Don't show all>"); | ||
418 | if (res == 0) | ||
419 | show_all_items = 1; | ||
420 | else if (res == 1) | ||
421 | show_all_items = 0; | ||
422 | |||
423 | return; | ||
424 | } | ||
425 | |||
426 | /* back */ | ||
427 | static void handle_f5(int *key, struct menu *current_item) | ||
428 | { | ||
429 | *key = KEY_LEFT; | ||
430 | return; | ||
431 | } | ||
432 | |||
433 | /* save */ | ||
434 | static void handle_f6(int *key, struct menu *current_item) | ||
435 | { | ||
436 | conf_save(); | ||
437 | return; | ||
438 | } | ||
439 | |||
440 | /* load */ | ||
441 | static void handle_f7(int *key, struct menu *current_item) | ||
442 | { | ||
443 | conf_load(); | ||
444 | return; | ||
445 | } | ||
446 | |||
447 | /* exit */ | ||
448 | static void handle_f8(int *key, struct menu *current_item) | ||
449 | { | ||
450 | do_exit(); | ||
451 | return; | ||
452 | } | ||
453 | |||
454 | /* return != 0 to indicate the key was handles */ | ||
455 | static int process_special_keys(int *key, struct menu *menu) | ||
456 | { | ||
457 | int i; | ||
458 | |||
459 | if (*key == KEY_RESIZE) { | ||
460 | setup_windows(); | ||
461 | return 1; | ||
462 | } | ||
463 | |||
464 | for (i = 0; i < function_keys_num; i++) { | ||
465 | if (*key == KEY_F(function_keys[i].key) || | ||
466 | *key == '0' + function_keys[i].key){ | ||
467 | function_keys[i].handler(key, menu); | ||
468 | return 1; | ||
469 | } | ||
470 | } | ||
471 | |||
472 | return 0; | ||
473 | } | ||
474 | |||
475 | static void clean_items(void) | ||
476 | { | ||
477 | int i; | ||
478 | for (i = 0; curses_menu_items[i]; i++) | ||
479 | free_item(curses_menu_items[i]); | ||
480 | bzero(curses_menu_items, sizeof(curses_menu_items)); | ||
481 | bzero(k_menu_items, sizeof(k_menu_items)); | ||
482 | bzero(hotkeys, sizeof(hotkeys)); | ||
483 | items_num = 0; | ||
484 | } | ||
485 | |||
486 | /* return the index of the next hot item, or -1 if no such item exists */ | ||
487 | static int get_next_hot(int c) | ||
488 | { | ||
489 | static int hot_index; | ||
490 | static int hot_char; | ||
491 | |||
492 | if (c < 0 || c > 255 || hotkeys[c].count <= 0) | ||
493 | return -1; | ||
494 | |||
495 | if (hot_char == c) { | ||
496 | hot_index = (hot_index+1)%hotkeys[c].count; | ||
497 | return hotkeys[c].ptrs[hot_index]; | ||
498 | } else { | ||
499 | hot_char = c; | ||
500 | hot_index = 0; | ||
501 | return hotkeys[c].ptrs[0]; | ||
502 | } | ||
503 | } | ||
504 | |||
505 | /* can the char c be a hot key? no, if c is a common shortcut used elsewhere */ | ||
506 | static int canbhot(char c) | ||
507 | { | ||
508 | c = tolower(c); | ||
509 | return isalnum(c) && c != 'y' && c != 'm' && c != 'h' && | ||
510 | c != 'n' && c != '?'; | ||
511 | } | ||
512 | |||
513 | /* check if str already contains a hot key. */ | ||
514 | static int is_hot(int index) | ||
515 | { | ||
516 | return k_menu_items[index].is_hot; | ||
517 | } | ||
518 | |||
519 | /* find the first possible hot key, and mark it. | ||
520 | * index is the index of the item in the menu | ||
521 | * return 0 on success*/ | ||
522 | static int make_hot(char *dest, int len, const char *org, int index) | ||
523 | { | ||
524 | int position = -1; | ||
525 | int i; | ||
526 | int tmp; | ||
527 | int c; | ||
528 | int org_len = strlen(org); | ||
529 | |||
530 | if (org == NULL || is_hot(index)) | ||
531 | return 1; | ||
532 | |||
533 | /* make sure not to make hot keys out of markers. | ||
534 | * find where to start looking for a hot key | ||
535 | */ | ||
536 | i = 0; | ||
537 | /* skip white space */ | ||
538 | while (i < org_len && org[i] == ' ') | ||
539 | i++; | ||
540 | if (i == org_len) | ||
541 | return -1; | ||
542 | /* if encountering '(' or '<' or '[', find the match and look from there | ||
543 | **/ | ||
544 | if (org[i] == '[' || org[i] == '<' || org[i] == '(') { | ||
545 | i++; | ||
546 | for (; i < org_len; i++) | ||
547 | if (org[i] == ']' || org[i] == '>' || org[i] == ')') | ||
548 | break; | ||
549 | } | ||
550 | if (i == org_len) | ||
551 | return -1; | ||
552 | for (; i < org_len; i++) { | ||
553 | if (canbhot(org[i]) && org[i-1] != '<' && org[i-1] != '(') { | ||
554 | position = i; | ||
555 | break; | ||
556 | } | ||
557 | } | ||
558 | if (position == -1) | ||
559 | return 1; | ||
560 | |||
561 | /* ok, char at org[position] should be a hot key to this item */ | ||
562 | c = tolower(org[position]); | ||
563 | tmp = hotkeys[c].count; | ||
564 | hotkeys[c].ptrs[tmp] = index; | ||
565 | hotkeys[c].count++; | ||
566 | /* | ||
567 | snprintf(dest, len, "%.*s(%c)%s", position, org, org[position], | ||
568 | &org[position+1]); | ||
569 | */ | ||
570 | /* make org[position] uppercase, and all leading letter small case */ | ||
571 | strncpy(dest, org, len); | ||
572 | for (i = 0; i < position; i++) | ||
573 | dest[i] = tolower(dest[i]); | ||
574 | dest[position] = toupper(dest[position]); | ||
575 | k_menu_items[index].is_hot = 1; | ||
576 | return 0; | ||
577 | } | ||
578 | |||
579 | /* Make a new item. Add a hotkey mark in the first possible letter. | ||
580 | * As ncurses does not allow any attributes inside menue item, we mark the | ||
581 | * hot key as the first capitalized letter in the string */ | ||
582 | static void item_make(struct menu *menu, char tag, const char *fmt, ...) | ||
583 | { | ||
584 | va_list ap; | ||
585 | char tmp_str[256]; | ||
586 | |||
587 | if (items_num > MAX_MENU_ITEMS-1) | ||
588 | return; | ||
589 | |||
590 | bzero(&k_menu_items[items_num], sizeof(k_menu_items[0])); | ||
591 | k_menu_items[items_num].tag = tag; | ||
592 | k_menu_items[items_num].usrptr = menu; | ||
593 | if (menu != NULL) | ||
594 | k_menu_items[items_num].is_visible = | ||
595 | menu_is_visible(menu); | ||
596 | else | ||
597 | k_menu_items[items_num].is_visible = 1; | ||
598 | |||
599 | va_start(ap, fmt); | ||
600 | vsnprintf(tmp_str, sizeof(tmp_str), fmt, ap); | ||
601 | if (!k_menu_items[items_num].is_visible) | ||
602 | memcpy(tmp_str, "XXX", 3); | ||
603 | va_end(ap); | ||
604 | if (make_hot( | ||
605 | k_menu_items[items_num].str, | ||
606 | sizeof(k_menu_items[items_num].str), tmp_str, items_num) != 0) | ||
607 | strncpy(k_menu_items[items_num].str, | ||
608 | tmp_str, | ||
609 | sizeof(k_menu_items[items_num].str)); | ||
610 | |||
611 | curses_menu_items[items_num] = new_item( | ||
612 | k_menu_items[items_num].str, | ||
613 | k_menu_items[items_num].str); | ||
614 | set_item_userptr(curses_menu_items[items_num], | ||
615 | &k_menu_items[items_num]); | ||
616 | /* | ||
617 | if (!k_menu_items[items_num].is_visible) | ||
618 | item_opts_off(curses_menu_items[items_num], O_SELECTABLE); | ||
619 | */ | ||
620 | |||
621 | items_num++; | ||
622 | curses_menu_items[items_num] = NULL; | ||
623 | } | ||
624 | |||
625 | /* very hackish. adds a string to the last item added */ | ||
626 | static void item_add_str(const char *fmt, ...) | ||
627 | { | ||
628 | va_list ap; | ||
629 | int index = items_num-1; | ||
630 | char new_str[256]; | ||
631 | char tmp_str[256]; | ||
632 | |||
633 | if (index < 0) | ||
634 | return; | ||
635 | |||
636 | va_start(ap, fmt); | ||
637 | vsnprintf(new_str, sizeof(new_str), fmt, ap); | ||
638 | va_end(ap); | ||
639 | snprintf(tmp_str, sizeof(tmp_str), "%s%s", | ||
640 | k_menu_items[index].str, new_str); | ||
641 | if (make_hot(k_menu_items[index].str, | ||
642 | sizeof(k_menu_items[index].str), tmp_str, index) != 0) | ||
643 | strncpy(k_menu_items[index].str, | ||
644 | tmp_str, | ||
645 | sizeof(k_menu_items[index].str)); | ||
646 | |||
647 | free_item(curses_menu_items[index]); | ||
648 | curses_menu_items[index] = new_item( | ||
649 | k_menu_items[index].str, | ||
650 | k_menu_items[index].str); | ||
651 | set_item_userptr(curses_menu_items[index], | ||
652 | &k_menu_items[index]); | ||
653 | } | ||
654 | |||
655 | /* get the tag of the currently selected item */ | ||
656 | static char item_tag(void) | ||
657 | { | ||
658 | ITEM *cur; | ||
659 | struct mitem *mcur; | ||
660 | |||
661 | cur = current_item(curses_menu); | ||
662 | if (cur == NULL) | ||
663 | return 0; | ||
664 | mcur = (struct mitem *) item_userptr(cur); | ||
665 | return mcur->tag; | ||
666 | } | ||
667 | |||
668 | static int curses_item_index(void) | ||
669 | { | ||
670 | return item_index(current_item(curses_menu)); | ||
671 | } | ||
672 | |||
673 | static void *item_data(void) | ||
674 | { | ||
675 | ITEM *cur; | ||
676 | struct mitem *mcur; | ||
677 | |||
678 | cur = current_item(curses_menu); | ||
679 | mcur = (struct mitem *) item_userptr(cur); | ||
680 | return mcur->usrptr; | ||
681 | |||
682 | } | ||
683 | |||
684 | static int item_is_tag(char tag) | ||
685 | { | ||
686 | return item_tag() == tag; | ||
687 | } | ||
688 | |||
689 | static char filename[PATH_MAX+1]; | ||
690 | static char menu_backtitle[PATH_MAX+128]; | ||
691 | static const char *set_config_filename(const char *config_filename) | ||
692 | { | ||
693 | int size; | ||
694 | struct symbol *sym; | ||
695 | |||
696 | sym = sym_lookup("KERNELVERSION", 0); | ||
697 | sym_calc_value(sym); | ||
698 | size = snprintf(menu_backtitle, sizeof(menu_backtitle), | ||
699 | _("%s - Linux Kernel v%s Configuration"), | ||
700 | config_filename, sym_get_string_value(sym)); | ||
701 | if (size >= sizeof(menu_backtitle)) | ||
702 | menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; | ||
703 | |||
704 | size = snprintf(filename, sizeof(filename), "%s", config_filename); | ||
705 | if (size >= sizeof(filename)) | ||
706 | filename[sizeof(filename)-1] = '\0'; | ||
707 | return menu_backtitle; | ||
708 | } | ||
709 | |||
710 | /* command = 0 is supress, 1 is restore */ | ||
711 | static void supress_stdout(int command) | ||
712 | { | ||
713 | static FILE *org_stdout; | ||
714 | static FILE *org_stderr; | ||
715 | |||
716 | if (command == 0) { | ||
717 | org_stdout = stdout; | ||
718 | org_stderr = stderr; | ||
719 | stdout = fopen("/dev/null", "a"); | ||
720 | stderr = fopen("/dev/null", "a"); | ||
721 | } else { | ||
722 | fclose(stdout); | ||
723 | fclose(stderr); | ||
724 | stdout = org_stdout; | ||
725 | stderr = org_stderr; | ||
726 | } | ||
727 | } | ||
728 | |||
729 | /* return = 0 means we are successful. | ||
730 | * -1 means go on doing what you were doing | ||
731 | */ | ||
732 | static int do_exit(void) | ||
733 | { | ||
734 | int res; | ||
735 | if (!conf_get_changed()) { | ||
736 | global_exit = 1; | ||
737 | return 0; | ||
738 | } | ||
739 | res = btn_dialog(main_window, | ||
740 | _("Do you wish to save your " | ||
741 | "new kernel configuration?\n" | ||
742 | "<ESC> to cancel and resume nconfig."), | ||
743 | 2, | ||
744 | " <save> ", | ||
745 | "<don't save>"); | ||
746 | if (res == KEY_EXIT) { | ||
747 | global_exit = 0; | ||
748 | return -1; | ||
749 | } | ||
750 | |||
751 | /* if we got here, the user really wants to exit */ | ||
752 | switch (res) { | ||
753 | case 0: | ||
754 | supress_stdout(0); | ||
755 | res = conf_write(filename); | ||
756 | supress_stdout(1); | ||
757 | if (res) | ||
758 | btn_dialog( | ||
759 | main_window, | ||
760 | _("Error during writing of the kernel " | ||
761 | "configuration.\n" | ||
762 | "Your kernel configuration " | ||
763 | "changes were NOT saved."), | ||
764 | 1, | ||
765 | "<OK>"); | ||
766 | else { | ||
767 | char buf[1024]; | ||
768 | snprintf(buf, 1024, | ||
769 | _("Configuration written to %s\n" | ||
770 | "End of Linux kernel configuration.\n" | ||
771 | "Execute 'make' to build the kernel or try" | ||
772 | " 'make help'."), filename); | ||
773 | btn_dialog( | ||
774 | main_window, | ||
775 | buf, | ||
776 | 1, | ||
777 | "<OK>"); | ||
778 | } | ||
779 | break; | ||
780 | default: | ||
781 | btn_dialog( | ||
782 | main_window, | ||
783 | _("Your kernel configuration changes were NOT saved."), | ||
784 | 1, | ||
785 | "<OK>"); | ||
786 | break; | ||
787 | } | ||
788 | global_exit = 1; | ||
789 | return 0; | ||
790 | } | ||
791 | |||
792 | |||
793 | static void search_conf(void) | ||
794 | { | ||
795 | struct symbol **sym_arr; | ||
796 | struct gstr res; | ||
797 | char dialog_input_result[100]; | ||
798 | char *dialog_input; | ||
799 | int dres; | ||
800 | again: | ||
801 | dres = dialog_inputbox(main_window, | ||
802 | _("Search Configuration Parameter"), | ||
803 | _("Enter CONFIG_ (sub)string to search for " | ||
804 | "(with or without \"CONFIG\")"), | ||
805 | "", dialog_input_result, 99); | ||
806 | switch (dres) { | ||
807 | case 0: | ||
808 | break; | ||
809 | case 1: | ||
810 | show_scroll_win(main_window, | ||
811 | _("Search Configuration"), search_help); | ||
812 | goto again; | ||
813 | default: | ||
814 | return; | ||
815 | } | ||
816 | |||
817 | /* strip CONFIG_ if necessary */ | ||
818 | dialog_input = dialog_input_result; | ||
819 | if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0) | ||
820 | dialog_input += 7; | ||
821 | |||
822 | sym_arr = sym_re_search(dialog_input); | ||
823 | res = get_relations_str(sym_arr); | ||
824 | free(sym_arr); | ||
825 | show_scroll_win(main_window, | ||
826 | _("Search Results"), str_get(&res)); | ||
827 | str_free(&res); | ||
828 | } | ||
829 | |||
830 | |||
831 | static void build_conf(struct menu *menu) | ||
832 | { | ||
833 | struct symbol *sym; | ||
834 | struct property *prop; | ||
835 | struct menu *child; | ||
836 | int type, tmp, doint = 2; | ||
837 | tristate val; | ||
838 | char ch; | ||
839 | |||
840 | if (!menu || (!show_all_items && !menu_is_visible(menu))) | ||
841 | return; | ||
842 | |||
843 | sym = menu->sym; | ||
844 | prop = menu->prompt; | ||
845 | if (!sym) { | ||
846 | if (prop && menu != current_menu) { | ||
847 | const char *prompt = menu_get_prompt(menu); | ||
848 | enum prop_type ptype; | ||
849 | ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; | ||
850 | switch (ptype) { | ||
851 | case P_MENU: | ||
852 | child_count++; | ||
853 | prompt = _(prompt); | ||
854 | if (single_menu_mode) { | ||
855 | item_make(menu, 'm', | ||
856 | "%s%*c%s", | ||
857 | menu->data ? "-->" : "++>", | ||
858 | indent + 1, ' ', prompt); | ||
859 | } else | ||
860 | item_make(menu, 'm', | ||
861 | " %*c%s --->", | ||
862 | indent + 1, | ||
863 | ' ', prompt); | ||
864 | |||
865 | if (single_menu_mode && menu->data) | ||
866 | goto conf_childs; | ||
867 | return; | ||
868 | case P_COMMENT: | ||
869 | if (prompt) { | ||
870 | child_count++; | ||
871 | item_make(menu, ':', | ||
872 | " %*c*** %s ***", | ||
873 | indent + 1, ' ', | ||
874 | _(prompt)); | ||
875 | } | ||
876 | break; | ||
877 | default: | ||
878 | if (prompt) { | ||
879 | child_count++; | ||
880 | item_make(menu, ':', "---%*c%s", | ||
881 | indent + 1, ' ', | ||
882 | _(prompt)); | ||
883 | } | ||
884 | } | ||
885 | } else | ||
886 | doint = 0; | ||
887 | goto conf_childs; | ||
888 | } | ||
889 | |||
890 | type = sym_get_type(sym); | ||
891 | if (sym_is_choice(sym)) { | ||
892 | struct symbol *def_sym = sym_get_choice_value(sym); | ||
893 | struct menu *def_menu = NULL; | ||
894 | |||
895 | child_count++; | ||
896 | for (child = menu->list; child; child = child->next) { | ||
897 | if (menu_is_visible(child) && child->sym == def_sym) | ||
898 | def_menu = child; | ||
899 | } | ||
900 | |||
901 | val = sym_get_tristate_value(sym); | ||
902 | if (sym_is_changable(sym)) { | ||
903 | switch (type) { | ||
904 | case S_BOOLEAN: | ||
905 | item_make(menu, 't', "[%c]", | ||
906 | val == no ? ' ' : '*'); | ||
907 | break; | ||
908 | case S_TRISTATE: | ||
909 | switch (val) { | ||
910 | case yes: | ||
911 | ch = '*'; | ||
912 | break; | ||
913 | case mod: | ||
914 | ch = 'M'; | ||
915 | break; | ||
916 | default: | ||
917 | ch = ' '; | ||
918 | break; | ||
919 | } | ||
920 | item_make(menu, 't', "<%c>", ch); | ||
921 | break; | ||
922 | } | ||
923 | } else { | ||
924 | item_make(menu, def_menu ? 't' : ':', " "); | ||
925 | } | ||
926 | |||
927 | item_add_str("%*c%s", indent + 1, | ||
928 | ' ', _(menu_get_prompt(menu))); | ||
929 | if (val == yes) { | ||
930 | if (def_menu) { | ||
931 | item_add_str(" (%s)", | ||
932 | _(menu_get_prompt(def_menu))); | ||
933 | item_add_str(" --->"); | ||
934 | if (def_menu->list) { | ||
935 | indent += 2; | ||
936 | build_conf(def_menu); | ||
937 | indent -= 2; | ||
938 | } | ||
939 | } | ||
940 | return; | ||
941 | } | ||
942 | } else { | ||
943 | if (menu == current_menu) { | ||
944 | item_make(menu, ':', | ||
945 | "---%*c%s", indent + 1, | ||
946 | ' ', _(menu_get_prompt(menu))); | ||
947 | goto conf_childs; | ||
948 | } | ||
949 | child_count++; | ||
950 | val = sym_get_tristate_value(sym); | ||
951 | if (sym_is_choice_value(sym) && val == yes) { | ||
952 | item_make(menu, ':', " "); | ||
953 | } else { | ||
954 | switch (type) { | ||
955 | case S_BOOLEAN: | ||
956 | if (sym_is_changable(sym)) | ||
957 | item_make(menu, 't', "[%c]", | ||
958 | val == no ? ' ' : '*'); | ||
959 | else | ||
960 | item_make(menu, 't', "-%c-", | ||
961 | val == no ? ' ' : '*'); | ||
962 | break; | ||
963 | case S_TRISTATE: | ||
964 | switch (val) { | ||
965 | case yes: | ||
966 | ch = '*'; | ||
967 | break; | ||
968 | case mod: | ||
969 | ch = 'M'; | ||
970 | break; | ||
971 | default: | ||
972 | ch = ' '; | ||
973 | break; | ||
974 | } | ||
975 | if (sym_is_changable(sym)) { | ||
976 | if (sym->rev_dep.tri == mod) | ||
977 | item_make(menu, | ||
978 | 't', "{%c}", ch); | ||
979 | else | ||
980 | item_make(menu, | ||
981 | 't', "<%c>", ch); | ||
982 | } else | ||
983 | item_make(menu, 't', "-%c-", ch); | ||
984 | break; | ||
985 | default: | ||
986 | tmp = 2 + strlen(sym_get_string_value(sym)); | ||
987 | item_make(menu, 's', " (%s)", | ||
988 | sym_get_string_value(sym)); | ||
989 | tmp = indent - tmp + 4; | ||
990 | if (tmp < 0) | ||
991 | tmp = 0; | ||
992 | item_add_str("%*c%s%s", tmp, ' ', | ||
993 | _(menu_get_prompt(menu)), | ||
994 | (sym_has_value(sym) || | ||
995 | !sym_is_changable(sym)) ? "" : | ||
996 | _(" (NEW)")); | ||
997 | goto conf_childs; | ||
998 | } | ||
999 | } | ||
1000 | item_add_str("%*c%s%s", indent + 1, ' ', | ||
1001 | _(menu_get_prompt(menu)), | ||
1002 | (sym_has_value(sym) || !sym_is_changable(sym)) ? | ||
1003 | "" : _(" (NEW)")); | ||
1004 | if (menu->prompt && menu->prompt->type == P_MENU) { | ||
1005 | item_add_str(" --->"); | ||
1006 | return; | ||
1007 | } | ||
1008 | } | ||
1009 | |||
1010 | conf_childs: | ||
1011 | indent += doint; | ||
1012 | for (child = menu->list; child; child = child->next) | ||
1013 | build_conf(child); | ||
1014 | indent -= doint; | ||
1015 | } | ||
1016 | |||
1017 | static void reset_menu(void) | ||
1018 | { | ||
1019 | unpost_menu(curses_menu); | ||
1020 | clean_items(); | ||
1021 | } | ||
1022 | |||
1023 | /* adjust the menu to show this item. | ||
1024 | * prefer not to scroll the menu if possible*/ | ||
1025 | static void center_item(int selected_index, int *last_top_row) | ||
1026 | { | ||
1027 | int toprow; | ||
1028 | int maxy, maxx; | ||
1029 | |||
1030 | scale_menu(curses_menu, &maxy, &maxx); | ||
1031 | set_top_row(curses_menu, *last_top_row); | ||
1032 | toprow = top_row(curses_menu); | ||
1033 | if (selected_index >= toprow && selected_index < toprow+maxy) { | ||
1034 | /* we can only move the selected item. no need to scroll */ | ||
1035 | set_current_item(curses_menu, | ||
1036 | curses_menu_items[selected_index]); | ||
1037 | } else { | ||
1038 | toprow = max(selected_index-maxy/2, 0); | ||
1039 | if (toprow >= item_count(curses_menu)-maxy) | ||
1040 | toprow = item_count(curses_menu)-mwin_max_lines; | ||
1041 | set_top_row(curses_menu, toprow); | ||
1042 | set_current_item(curses_menu, | ||
1043 | curses_menu_items[selected_index]); | ||
1044 | } | ||
1045 | *last_top_row = toprow; | ||
1046 | post_menu(curses_menu); | ||
1047 | refresh_all_windows(main_window); | ||
1048 | } | ||
1049 | |||
1050 | /* this function assumes reset_menu has been called before */ | ||
1051 | static void show_menu(const char *prompt, const char *instructions, | ||
1052 | int selected_index, int *last_top_row) | ||
1053 | { | ||
1054 | int maxx, maxy; | ||
1055 | WINDOW *menu_window; | ||
1056 | |||
1057 | current_instructions = instructions; | ||
1058 | |||
1059 | clear(); | ||
1060 | wattrset(main_window, attributes[NORMAL]); | ||
1061 | print_in_middle(stdscr, 1, 0, COLS, | ||
1062 | menu_backtitle, | ||
1063 | attributes[MAIN_HEADING]); | ||
1064 | |||
1065 | wattrset(main_window, attributes[MAIN_MENU_BOX]); | ||
1066 | box(main_window, 0, 0); | ||
1067 | wattrset(main_window, attributes[MAIN_MENU_HEADING]); | ||
1068 | mvwprintw(main_window, 0, 3, " %s ", prompt); | ||
1069 | wattrset(main_window, attributes[NORMAL]); | ||
1070 | |||
1071 | set_menu_items(curses_menu, curses_menu_items); | ||
1072 | |||
1073 | /* position the menu at the middle of the screen */ | ||
1074 | scale_menu(curses_menu, &maxy, &maxx); | ||
1075 | maxx = min(maxx, mwin_max_cols-2); | ||
1076 | maxy = mwin_max_lines-2; | ||
1077 | menu_window = derwin(main_window, | ||
1078 | maxy, | ||
1079 | maxx, | ||
1080 | 2, | ||
1081 | (mwin_max_cols-maxx)/2); | ||
1082 | keypad(menu_window, TRUE); | ||
1083 | set_menu_win(curses_menu, menu_window); | ||
1084 | set_menu_sub(curses_menu, menu_window); | ||
1085 | |||
1086 | /* must reassert this after changing items, otherwise returns to a | ||
1087 | * default of 16 | ||
1088 | */ | ||
1089 | set_menu_format(curses_menu, maxy, 1); | ||
1090 | center_item(selected_index, last_top_row); | ||
1091 | set_menu_format(curses_menu, maxy, 1); | ||
1092 | |||
1093 | print_function_line(); | ||
1094 | |||
1095 | /* Post the menu */ | ||
1096 | post_menu(curses_menu); | ||
1097 | refresh_all_windows(main_window); | ||
1098 | } | ||
1099 | |||
1100 | |||
1101 | static void conf(struct menu *menu) | ||
1102 | { | ||
1103 | char pattern[256]; | ||
1104 | struct menu *submenu = 0; | ||
1105 | const char *prompt = menu_get_prompt(menu); | ||
1106 | struct symbol *sym; | ||
1107 | struct menu *active_menu = NULL; | ||
1108 | int res; | ||
1109 | int current_index = 0; | ||
1110 | int last_top_row = 0; | ||
1111 | |||
1112 | bzero(pattern, sizeof(pattern)); | ||
1113 | |||
1114 | while (!global_exit) { | ||
1115 | reset_menu(); | ||
1116 | current_menu = menu; | ||
1117 | build_conf(menu); | ||
1118 | if (!child_count) | ||
1119 | break; | ||
1120 | |||
1121 | show_menu(prompt ? _(prompt) : _("Main Menu"), | ||
1122 | _(menu_instructions), | ||
1123 | current_index, &last_top_row); | ||
1124 | keypad((menu_win(curses_menu)), TRUE); | ||
1125 | while (!global_exit && (res = wgetch(menu_win(curses_menu)))) { | ||
1126 | if (process_special_keys(&res, | ||
1127 | (struct menu *) item_data())) | ||
1128 | break; | ||
1129 | switch (res) { | ||
1130 | case KEY_DOWN: | ||
1131 | menu_driver(curses_menu, REQ_DOWN_ITEM); | ||
1132 | break; | ||
1133 | case KEY_UP: | ||
1134 | menu_driver(curses_menu, REQ_UP_ITEM); | ||
1135 | break; | ||
1136 | case KEY_NPAGE: | ||
1137 | menu_driver(curses_menu, REQ_SCR_DPAGE); | ||
1138 | break; | ||
1139 | case KEY_PPAGE: | ||
1140 | menu_driver(curses_menu, REQ_SCR_UPAGE); | ||
1141 | break; | ||
1142 | case KEY_HOME: | ||
1143 | menu_driver(curses_menu, REQ_FIRST_ITEM); | ||
1144 | break; | ||
1145 | case KEY_END: | ||
1146 | menu_driver(curses_menu, REQ_LAST_ITEM); | ||
1147 | break; | ||
1148 | case 'h': | ||
1149 | case '?': | ||
1150 | show_help((struct menu *) item_data()); | ||
1151 | break; | ||
1152 | } | ||
1153 | if (res == 10 || res == 27 || | ||
1154 | res == 32 || res == 'n' || res == 'y' || | ||
1155 | res == KEY_LEFT || res == KEY_RIGHT || | ||
1156 | res == 'm' || res == '/') | ||
1157 | break; | ||
1158 | else if (canbhot(res)) { | ||
1159 | /* check for hot keys: */ | ||
1160 | int tmp = get_next_hot(res); | ||
1161 | if (tmp != -1) | ||
1162 | center_item(tmp, &last_top_row); | ||
1163 | } | ||
1164 | refresh_all_windows(main_window); | ||
1165 | } | ||
1166 | |||
1167 | refresh_all_windows(main_window); | ||
1168 | /* if ESC or left*/ | ||
1169 | if (res == 27 || (menu != &rootmenu && res == KEY_LEFT)) | ||
1170 | break; | ||
1171 | |||
1172 | /* remember location in the menu */ | ||
1173 | last_top_row = top_row(curses_menu); | ||
1174 | current_index = curses_item_index(); | ||
1175 | |||
1176 | if (!item_tag()) | ||
1177 | continue; | ||
1178 | |||
1179 | submenu = (struct menu *) item_data(); | ||
1180 | active_menu = (struct menu *)item_data(); | ||
1181 | if (!submenu || !menu_is_visible(submenu)) | ||
1182 | continue; | ||
1183 | if (submenu) | ||
1184 | sym = submenu->sym; | ||
1185 | else | ||
1186 | sym = NULL; | ||
1187 | |||
1188 | switch (res) { | ||
1189 | case ' ': | ||
1190 | if (item_is_tag('t')) | ||
1191 | sym_toggle_tristate_value(sym); | ||
1192 | else if (item_is_tag('m')) | ||
1193 | conf(submenu); | ||
1194 | break; | ||
1195 | case KEY_RIGHT: | ||
1196 | case 10: /* ENTER WAS PRESSED */ | ||
1197 | switch (item_tag()) { | ||
1198 | case 'm': | ||
1199 | if (single_menu_mode) | ||
1200 | submenu->data = | ||
1201 | (void *) (long) !submenu->data; | ||
1202 | else | ||
1203 | conf(submenu); | ||
1204 | break; | ||
1205 | case 't': | ||
1206 | if (sym_is_choice(sym) && | ||
1207 | sym_get_tristate_value(sym) == yes) | ||
1208 | conf_choice(submenu); | ||
1209 | else if (submenu->prompt && | ||
1210 | submenu->prompt->type == P_MENU) | ||
1211 | conf(submenu); | ||
1212 | else if (res == 10) | ||
1213 | sym_toggle_tristate_value(sym); | ||
1214 | break; | ||
1215 | case 's': | ||
1216 | conf_string(submenu); | ||
1217 | break; | ||
1218 | } | ||
1219 | break; | ||
1220 | case 'y': | ||
1221 | if (item_is_tag('t')) { | ||
1222 | if (sym_set_tristate_value(sym, yes)) | ||
1223 | break; | ||
1224 | if (sym_set_tristate_value(sym, mod)) | ||
1225 | btn_dialog(main_window, setmod_text, 0); | ||
1226 | } | ||
1227 | break; | ||
1228 | case 'n': | ||
1229 | if (item_is_tag('t')) | ||
1230 | sym_set_tristate_value(sym, no); | ||
1231 | break; | ||
1232 | case 'm': | ||
1233 | if (item_is_tag('t')) | ||
1234 | sym_set_tristate_value(sym, mod); | ||
1235 | break; | ||
1236 | case '/': | ||
1237 | search_conf(); | ||
1238 | break; | ||
1239 | } | ||
1240 | } | ||
1241 | } | ||
1242 | |||
1243 | static void show_help(struct menu *menu) | ||
1244 | { | ||
1245 | struct gstr help = str_new(); | ||
1246 | |||
1247 | if (menu && menu->sym && menu_has_help(menu)) { | ||
1248 | if (menu->sym->name) { | ||
1249 | str_printf(&help, "CONFIG_%s:\n\n", menu->sym->name); | ||
1250 | str_append(&help, _(menu_get_help(menu))); | ||
1251 | str_append(&help, "\n"); | ||
1252 | get_symbol_str(&help, menu->sym); | ||
1253 | } | ||
1254 | } else { | ||
1255 | str_append(&help, nohelp_text); | ||
1256 | } | ||
1257 | show_scroll_win(main_window, _(menu_get_prompt(menu)), str_get(&help)); | ||
1258 | str_free(&help); | ||
1259 | } | ||
1260 | |||
1261 | static void conf_choice(struct menu *menu) | ||
1262 | { | ||
1263 | const char *prompt = _(menu_get_prompt(menu)); | ||
1264 | struct menu *child = 0; | ||
1265 | struct symbol *active; | ||
1266 | int selected_index = 0; | ||
1267 | int last_top_row = 0; | ||
1268 | int res, i = 0; | ||
1269 | |||
1270 | active = sym_get_choice_value(menu->sym); | ||
1271 | /* this is mostly duplicated from the conf() function. */ | ||
1272 | while (!global_exit) { | ||
1273 | reset_menu(); | ||
1274 | |||
1275 | for (i = 0, child = menu->list; child; child = child->next) { | ||
1276 | if (!show_all_items && !menu_is_visible(child)) | ||
1277 | continue; | ||
1278 | |||
1279 | if (child->sym == sym_get_choice_value(menu->sym)) | ||
1280 | item_make(child, ':', "<X> %s", | ||
1281 | _(menu_get_prompt(child))); | ||
1282 | else | ||
1283 | item_make(child, ':', " %s", | ||
1284 | _(menu_get_prompt(child))); | ||
1285 | if (child->sym == active){ | ||
1286 | last_top_row = top_row(curses_menu); | ||
1287 | selected_index = i; | ||
1288 | } | ||
1289 | i++; | ||
1290 | } | ||
1291 | show_menu(prompt ? _(prompt) : _("Choice Menu"), | ||
1292 | _(radiolist_instructions), | ||
1293 | selected_index, | ||
1294 | &last_top_row); | ||
1295 | while (!global_exit && (res = wgetch(menu_win(curses_menu)))) { | ||
1296 | if (process_special_keys( | ||
1297 | &res, | ||
1298 | (struct menu *) item_data())) | ||
1299 | break; | ||
1300 | switch (res) { | ||
1301 | case KEY_DOWN: | ||
1302 | menu_driver(curses_menu, REQ_DOWN_ITEM); | ||
1303 | break; | ||
1304 | case KEY_UP: | ||
1305 | menu_driver(curses_menu, REQ_UP_ITEM); | ||
1306 | break; | ||
1307 | case KEY_NPAGE: | ||
1308 | menu_driver(curses_menu, REQ_SCR_DPAGE); | ||
1309 | break; | ||
1310 | case KEY_PPAGE: | ||
1311 | menu_driver(curses_menu, REQ_SCR_UPAGE); | ||
1312 | break; | ||
1313 | case KEY_HOME: | ||
1314 | menu_driver(curses_menu, REQ_FIRST_ITEM); | ||
1315 | break; | ||
1316 | case KEY_END: | ||
1317 | menu_driver(curses_menu, REQ_LAST_ITEM); | ||
1318 | break; | ||
1319 | case 'h': | ||
1320 | case '?': | ||
1321 | show_help((struct menu *) item_data()); | ||
1322 | break; | ||
1323 | } | ||
1324 | if (res == 10 || res == 27 || res == ' ' || | ||
1325 | res == KEY_LEFT) | ||
1326 | break; | ||
1327 | else if (canbhot(res)) { | ||
1328 | /* check for hot keys: */ | ||
1329 | int tmp = get_next_hot(res); | ||
1330 | if (tmp != -1) | ||
1331 | center_item(tmp, &last_top_row); | ||
1332 | } | ||
1333 | refresh_all_windows(main_window); | ||
1334 | } | ||
1335 | /* if ESC or left */ | ||
1336 | if (res == 27 || res == KEY_LEFT) | ||
1337 | break; | ||
1338 | |||
1339 | child = item_data(); | ||
1340 | if (!child || !menu_is_visible(child)) | ||
1341 | continue; | ||
1342 | switch (res) { | ||
1343 | case ' ': | ||
1344 | case 10: | ||
1345 | case KEY_RIGHT: | ||
1346 | sym_set_tristate_value(child->sym, yes); | ||
1347 | return; | ||
1348 | case 'h': | ||
1349 | case '?': | ||
1350 | show_help(child); | ||
1351 | active = child->sym; | ||
1352 | break; | ||
1353 | case KEY_EXIT: | ||
1354 | return; | ||
1355 | } | ||
1356 | } | ||
1357 | } | ||
1358 | |||
1359 | static void conf_string(struct menu *menu) | ||
1360 | { | ||
1361 | const char *prompt = menu_get_prompt(menu); | ||
1362 | char dialog_input_result[256]; | ||
1363 | |||
1364 | while (1) { | ||
1365 | int res; | ||
1366 | const char *heading; | ||
1367 | |||
1368 | switch (sym_get_type(menu->sym)) { | ||
1369 | case S_INT: | ||
1370 | heading = _(inputbox_instructions_int); | ||
1371 | break; | ||
1372 | case S_HEX: | ||
1373 | heading = _(inputbox_instructions_hex); | ||
1374 | break; | ||
1375 | case S_STRING: | ||
1376 | heading = _(inputbox_instructions_string); | ||
1377 | break; | ||
1378 | default: | ||
1379 | heading = _("Internal nconf error!"); | ||
1380 | } | ||
1381 | res = dialog_inputbox(main_window, | ||
1382 | prompt ? _(prompt) : _("Main Menu"), | ||
1383 | heading, | ||
1384 | sym_get_string_value(menu->sym), | ||
1385 | dialog_input_result, | ||
1386 | sizeof(dialog_input_result)); | ||
1387 | switch (res) { | ||
1388 | case 0: | ||
1389 | if (sym_set_string_value(menu->sym, | ||
1390 | dialog_input_result)) | ||
1391 | return; | ||
1392 | btn_dialog(main_window, | ||
1393 | _("You have made an invalid entry."), 0); | ||
1394 | break; | ||
1395 | case 1: | ||
1396 | show_help(menu); | ||
1397 | break; | ||
1398 | case KEY_EXIT: | ||
1399 | return; | ||
1400 | } | ||
1401 | } | ||
1402 | } | ||
1403 | |||
1404 | static void conf_load(void) | ||
1405 | { | ||
1406 | char dialog_input_result[256]; | ||
1407 | while (1) { | ||
1408 | int res; | ||
1409 | res = dialog_inputbox(main_window, | ||
1410 | NULL, load_config_text, | ||
1411 | filename, | ||
1412 | dialog_input_result, | ||
1413 | sizeof(dialog_input_result)); | ||
1414 | switch (res) { | ||
1415 | case 0: | ||
1416 | if (!dialog_input_result[0]) | ||
1417 | return; | ||
1418 | if (!conf_read(dialog_input_result)) { | ||
1419 | set_config_filename(dialog_input_result); | ||
1420 | sym_set_change_count(1); | ||
1421 | return; | ||
1422 | } | ||
1423 | btn_dialog(main_window, _("File does not exist!"), 0); | ||
1424 | break; | ||
1425 | case 1: | ||
1426 | show_scroll_win(main_window, | ||
1427 | _("Load Alternate Configuration"), | ||
1428 | load_config_help); | ||
1429 | break; | ||
1430 | case KEY_EXIT: | ||
1431 | return; | ||
1432 | } | ||
1433 | } | ||
1434 | } | ||
1435 | |||
1436 | static void conf_save(void) | ||
1437 | { | ||
1438 | char dialog_input_result[256]; | ||
1439 | while (1) { | ||
1440 | int res; | ||
1441 | res = dialog_inputbox(main_window, | ||
1442 | NULL, save_config_text, | ||
1443 | filename, | ||
1444 | dialog_input_result, | ||
1445 | sizeof(dialog_input_result)); | ||
1446 | switch (res) { | ||
1447 | case 0: | ||
1448 | if (!dialog_input_result[0]) | ||
1449 | return; | ||
1450 | supress_stdout(0); | ||
1451 | res = conf_write(dialog_input_result); | ||
1452 | supress_stdout(1); | ||
1453 | if (!res) { | ||
1454 | char buf[1024]; | ||
1455 | sprintf(buf, "%s %s", | ||
1456 | _("configuration file saved to: "), | ||
1457 | dialog_input_result); | ||
1458 | btn_dialog(main_window, | ||
1459 | buf, 1, "<OK>"); | ||
1460 | set_config_filename(dialog_input_result); | ||
1461 | return; | ||
1462 | } | ||
1463 | btn_dialog(main_window, _("Can't create file! " | ||
1464 | "Probably a nonexistent directory."), | ||
1465 | 1, "<OK>"); | ||
1466 | break; | ||
1467 | case 1: | ||
1468 | show_scroll_win(main_window, | ||
1469 | _("Save Alternate Configuration"), | ||
1470 | save_config_help); | ||
1471 | break; | ||
1472 | case KEY_EXIT: | ||
1473 | return; | ||
1474 | } | ||
1475 | } | ||
1476 | } | ||
1477 | |||
1478 | void setup_windows(void) | ||
1479 | { | ||
1480 | if (main_window != NULL) | ||
1481 | delwin(main_window); | ||
1482 | |||
1483 | /* set up the menu and menu window */ | ||
1484 | main_window = newwin(LINES-2, COLS-2, 2, 1); | ||
1485 | keypad(main_window, TRUE); | ||
1486 | mwin_max_lines = LINES-6; | ||
1487 | mwin_max_cols = COLS-6; | ||
1488 | |||
1489 | /* panels order is from bottom to top */ | ||
1490 | new_panel(main_window); | ||
1491 | } | ||
1492 | |||
1493 | int main(int ac, char **av) | ||
1494 | { | ||
1495 | char *mode; | ||
1496 | |||
1497 | setlocale(LC_ALL, ""); | ||
1498 | bindtextdomain(PACKAGE, LOCALEDIR); | ||
1499 | textdomain(PACKAGE); | ||
1500 | |||
1501 | conf_parse(av[1]); | ||
1502 | conf_read(NULL); | ||
1503 | |||
1504 | mode = getenv("NCONFIG_MODE"); | ||
1505 | if (mode) { | ||
1506 | if (!strcasecmp(mode, "single_menu")) | ||
1507 | single_menu_mode = 1; | ||
1508 | } | ||
1509 | |||
1510 | /* Initialize curses */ | ||
1511 | initscr(); | ||
1512 | /* set color theme */ | ||
1513 | set_colors(); | ||
1514 | |||
1515 | cbreak(); | ||
1516 | noecho(); | ||
1517 | keypad(stdscr, TRUE); | ||
1518 | curs_set(0); | ||
1519 | |||
1520 | if (COLS < 75 || LINES < 20) { | ||
1521 | endwin(); | ||
1522 | printf("Your terminal should have at " | ||
1523 | "least 20 lines and 75 columns\n"); | ||
1524 | return 1; | ||
1525 | } | ||
1526 | |||
1527 | notimeout(stdscr, FALSE); | ||
1528 | ESCDELAY = 1; | ||
1529 | |||
1530 | /* set btns menu */ | ||
1531 | curses_menu = new_menu(curses_menu_items); | ||
1532 | menu_opts_off(curses_menu, O_SHOWDESC); | ||
1533 | menu_opts_off(curses_menu, O_SHOWMATCH); | ||
1534 | menu_opts_on(curses_menu, O_ONEVALUE); | ||
1535 | menu_opts_on(curses_menu, O_NONCYCLIC); | ||
1536 | set_menu_mark(curses_menu, " "); | ||
1537 | set_menu_fore(curses_menu, attributes[MAIN_MENU_FORE]); | ||
1538 | set_menu_back(curses_menu, attributes[MAIN_MENU_BACK]); | ||
1539 | set_menu_grey(curses_menu, attributes[MAIN_MENU_GREY]); | ||
1540 | |||
1541 | set_config_filename(conf_get_configname()); | ||
1542 | setup_windows(); | ||
1543 | |||
1544 | /* check for KEY_FUNC(1) */ | ||
1545 | if (has_key(KEY_F(1)) == FALSE) { | ||
1546 | show_scroll_win(main_window, | ||
1547 | _("Instructions"), | ||
1548 | _(menu_no_f_instructions)); | ||
1549 | } | ||
1550 | |||
1551 | |||
1552 | |||
1553 | /* do the work */ | ||
1554 | while (!global_exit) { | ||
1555 | conf(&rootmenu); | ||
1556 | if (!global_exit && do_exit() == 0) | ||
1557 | break; | ||
1558 | } | ||
1559 | /* ok, we are done */ | ||
1560 | unpost_menu(curses_menu); | ||
1561 | free_menu(curses_menu); | ||
1562 | delwin(main_window); | ||
1563 | clear(); | ||
1564 | refresh(); | ||
1565 | endwin(); | ||
1566 | return 0; | ||
1567 | } | ||
1568 | |||
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c new file mode 100644 index 000000000000..115edb437fb1 --- /dev/null +++ b/scripts/kconfig/nconf.gui.c | |||
@@ -0,0 +1,617 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Nir Tzachar <nir.tzachar@gmail.com? | ||
3 | * Released under the terms of the GNU GPL v2.0. | ||
4 | * | ||
5 | * Derived from menuconfig. | ||
6 | * | ||
7 | */ | ||
8 | #include "nconf.h" | ||
9 | |||
10 | /* a list of all the different widgets we use */ | ||
11 | attributes_t attributes[ATTR_MAX+1] = {0}; | ||
12 | |||
13 | /* available colors: | ||
14 | COLOR_BLACK 0 | ||
15 | COLOR_RED 1 | ||
16 | COLOR_GREEN 2 | ||
17 | COLOR_YELLOW 3 | ||
18 | COLOR_BLUE 4 | ||
19 | COLOR_MAGENTA 5 | ||
20 | COLOR_CYAN 6 | ||
21 | COLOR_WHITE 7 | ||
22 | */ | ||
23 | static void set_normal_colors(void) | ||
24 | { | ||
25 | init_pair(NORMAL, -1, -1); | ||
26 | init_pair(MAIN_HEADING, COLOR_MAGENTA, -1); | ||
27 | |||
28 | /* FORE is for the selected item */ | ||
29 | init_pair(MAIN_MENU_FORE, -1, -1); | ||
30 | /* BACK for all the rest */ | ||
31 | init_pair(MAIN_MENU_BACK, -1, -1); | ||
32 | init_pair(MAIN_MENU_GREY, -1, -1); | ||
33 | init_pair(MAIN_MENU_HEADING, COLOR_GREEN, -1); | ||
34 | init_pair(MAIN_MENU_BOX, COLOR_YELLOW, -1); | ||
35 | |||
36 | init_pair(SCROLLWIN_TEXT, -1, -1); | ||
37 | init_pair(SCROLLWIN_HEADING, COLOR_GREEN, -1); | ||
38 | init_pair(SCROLLWIN_BOX, COLOR_YELLOW, -1); | ||
39 | |||
40 | init_pair(DIALOG_TEXT, -1, -1); | ||
41 | init_pair(DIALOG_BOX, COLOR_YELLOW, -1); | ||
42 | init_pair(DIALOG_MENU_BACK, COLOR_YELLOW, -1); | ||
43 | init_pair(DIALOG_MENU_FORE, COLOR_RED, -1); | ||
44 | |||
45 | init_pair(INPUT_BOX, COLOR_YELLOW, -1); | ||
46 | init_pair(INPUT_HEADING, COLOR_GREEN, -1); | ||
47 | init_pair(INPUT_TEXT, -1, -1); | ||
48 | init_pair(INPUT_FIELD, -1, -1); | ||
49 | |||
50 | init_pair(FUNCTION_HIGHLIGHT, -1, -1); | ||
51 | init_pair(FUNCTION_TEXT, COLOR_BLUE, -1); | ||
52 | } | ||
53 | |||
54 | /* available attributes: | ||
55 | A_NORMAL Normal display (no highlight) | ||
56 | A_STANDOUT Best highlighting mode of the terminal. | ||
57 | A_UNDERLINE Underlining | ||
58 | A_REVERSE Reverse video | ||
59 | A_BLINK Blinking | ||
60 | A_DIM Half bright | ||
61 | A_BOLD Extra bright or bold | ||
62 | A_PROTECT Protected mode | ||
63 | A_INVIS Invisible or blank mode | ||
64 | A_ALTCHARSET Alternate character set | ||
65 | A_CHARTEXT Bit-mask to extract a character | ||
66 | COLOR_PAIR(n) Color-pair number n | ||
67 | */ | ||
68 | static void normal_color_theme(void) | ||
69 | { | ||
70 | /* automatically add color... */ | ||
71 | #define mkattr(name, attr) do { \ | ||
72 | attributes[name] = attr | COLOR_PAIR(name); } while (0) | ||
73 | mkattr(NORMAL, NORMAL); | ||
74 | mkattr(MAIN_HEADING, A_BOLD | A_UNDERLINE); | ||
75 | |||
76 | mkattr(MAIN_MENU_FORE, A_REVERSE); | ||
77 | mkattr(MAIN_MENU_BACK, A_NORMAL); | ||
78 | mkattr(MAIN_MENU_GREY, A_NORMAL); | ||
79 | mkattr(MAIN_MENU_HEADING, A_BOLD); | ||
80 | mkattr(MAIN_MENU_BOX, A_NORMAL); | ||
81 | |||
82 | mkattr(SCROLLWIN_TEXT, A_NORMAL); | ||
83 | mkattr(SCROLLWIN_HEADING, A_BOLD); | ||
84 | mkattr(SCROLLWIN_BOX, A_BOLD); | ||
85 | |||
86 | mkattr(DIALOG_TEXT, A_BOLD); | ||
87 | mkattr(DIALOG_BOX, A_BOLD); | ||
88 | mkattr(DIALOG_MENU_FORE, A_STANDOUT); | ||
89 | mkattr(DIALOG_MENU_BACK, A_NORMAL); | ||
90 | |||
91 | mkattr(INPUT_BOX, A_NORMAL); | ||
92 | mkattr(INPUT_HEADING, A_BOLD); | ||
93 | mkattr(INPUT_TEXT, A_NORMAL); | ||
94 | mkattr(INPUT_FIELD, A_UNDERLINE); | ||
95 | |||
96 | mkattr(FUNCTION_HIGHLIGHT, A_BOLD); | ||
97 | mkattr(FUNCTION_TEXT, A_REVERSE); | ||
98 | } | ||
99 | |||
100 | static void no_colors_theme(void) | ||
101 | { | ||
102 | /* automatically add highlight, no color */ | ||
103 | #define mkattrn(name, attr) { attributes[name] = attr; } | ||
104 | |||
105 | mkattrn(NORMAL, NORMAL); | ||
106 | mkattrn(MAIN_HEADING, A_BOLD | A_UNDERLINE); | ||
107 | |||
108 | mkattrn(MAIN_MENU_FORE, A_STANDOUT); | ||
109 | mkattrn(MAIN_MENU_BACK, A_NORMAL); | ||
110 | mkattrn(MAIN_MENU_GREY, A_NORMAL); | ||
111 | mkattrn(MAIN_MENU_HEADING, A_BOLD); | ||
112 | mkattrn(MAIN_MENU_BOX, A_NORMAL); | ||
113 | |||
114 | mkattrn(SCROLLWIN_TEXT, A_NORMAL); | ||
115 | mkattrn(SCROLLWIN_HEADING, A_BOLD); | ||
116 | mkattrn(SCROLLWIN_BOX, A_BOLD); | ||
117 | |||
118 | mkattrn(DIALOG_TEXT, A_NORMAL); | ||
119 | mkattrn(DIALOG_BOX, A_BOLD); | ||
120 | mkattrn(DIALOG_MENU_FORE, A_STANDOUT); | ||
121 | mkattrn(DIALOG_MENU_BACK, A_NORMAL); | ||
122 | |||
123 | mkattrn(INPUT_BOX, A_BOLD); | ||
124 | mkattrn(INPUT_HEADING, A_BOLD); | ||
125 | mkattrn(INPUT_TEXT, A_NORMAL); | ||
126 | mkattrn(INPUT_FIELD, A_UNDERLINE); | ||
127 | |||
128 | mkattrn(FUNCTION_HIGHLIGHT, A_BOLD); | ||
129 | mkattrn(FUNCTION_TEXT, A_REVERSE); | ||
130 | } | ||
131 | |||
132 | void set_colors() | ||
133 | { | ||
134 | start_color(); | ||
135 | use_default_colors(); | ||
136 | set_normal_colors(); | ||
137 | if (has_colors()) { | ||
138 | normal_color_theme(); | ||
139 | } else { | ||
140 | /* give deafults */ | ||
141 | no_colors_theme(); | ||
142 | } | ||
143 | } | ||
144 | |||
145 | |||
146 | /* this changes the windows attributes !!! */ | ||
147 | void print_in_middle(WINDOW *win, | ||
148 | int starty, | ||
149 | int startx, | ||
150 | int width, | ||
151 | const char *string, | ||
152 | chtype color) | ||
153 | { int length, x, y; | ||
154 | float temp; | ||
155 | |||
156 | |||
157 | if (win == NULL) | ||
158 | win = stdscr; | ||
159 | getyx(win, y, x); | ||
160 | if (startx != 0) | ||
161 | x = startx; | ||
162 | if (starty != 0) | ||
163 | y = starty; | ||
164 | if (width == 0) | ||
165 | width = 80; | ||
166 | |||
167 | length = strlen(string); | ||
168 | temp = (width - length) / 2; | ||
169 | x = startx + (int)temp; | ||
170 | wattrset(win, color); | ||
171 | mvwprintw(win, y, x, "%s", string); | ||
172 | refresh(); | ||
173 | } | ||
174 | |||
175 | int get_line_no(const char *text) | ||
176 | { | ||
177 | int i; | ||
178 | int total = 1; | ||
179 | |||
180 | if (!text) | ||
181 | return 0; | ||
182 | |||
183 | for (i = 0; text[i] != '\0'; i++) | ||
184 | if (text[i] == '\n') | ||
185 | total++; | ||
186 | return total; | ||
187 | } | ||
188 | |||
189 | const char *get_line(const char *text, int line_no) | ||
190 | { | ||
191 | int i; | ||
192 | int lines = 0; | ||
193 | |||
194 | if (!text) | ||
195 | return 0; | ||
196 | |||
197 | for (i = 0; text[i] != '\0' && lines < line_no; i++) | ||
198 | if (text[i] == '\n') | ||
199 | lines++; | ||
200 | return text+i; | ||
201 | } | ||
202 | |||
203 | int get_line_length(const char *line) | ||
204 | { | ||
205 | int res = 0; | ||
206 | while (*line != '\0' && *line != '\n') { | ||
207 | line++; | ||
208 | res++; | ||
209 | } | ||
210 | return res; | ||
211 | } | ||
212 | |||
213 | /* print all lines to the window. */ | ||
214 | void fill_window(WINDOW *win, const char *text) | ||
215 | { | ||
216 | int x, y; | ||
217 | int total_lines = get_line_no(text); | ||
218 | int i; | ||
219 | |||
220 | getmaxyx(win, y, x); | ||
221 | /* do not go over end of line */ | ||
222 | total_lines = min(total_lines, y); | ||
223 | for (i = 0; i < total_lines; i++) { | ||
224 | char tmp[x+10]; | ||
225 | const char *line = get_line(text, i); | ||
226 | int len = get_line_length(line); | ||
227 | strncpy(tmp, line, min(len, x)); | ||
228 | tmp[len] = '\0'; | ||
229 | mvwprintw(win, i, 0, tmp); | ||
230 | } | ||
231 | } | ||
232 | |||
233 | /* get the message, and buttons. | ||
234 | * each button must be a char* | ||
235 | * return the selected button | ||
236 | * | ||
237 | * this dialog is used for 2 different things: | ||
238 | * 1) show a text box, no buttons. | ||
239 | * 2) show a dialog, with horizontal buttons | ||
240 | */ | ||
241 | int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...) | ||
242 | { | ||
243 | va_list ap; | ||
244 | char *btn; | ||
245 | int btns_width = 0; | ||
246 | int msg_lines = 0; | ||
247 | int msg_width = 0; | ||
248 | int total_width; | ||
249 | int win_rows = 0; | ||
250 | WINDOW *win; | ||
251 | WINDOW *msg_win; | ||
252 | WINDOW *menu_win; | ||
253 | MENU *menu; | ||
254 | ITEM *btns[btn_num+1]; | ||
255 | int i, x, y; | ||
256 | int res = -1; | ||
257 | |||
258 | |||
259 | va_start(ap, btn_num); | ||
260 | for (i = 0; i < btn_num; i++) { | ||
261 | btn = va_arg(ap, char *); | ||
262 | btns[i] = new_item(btn, ""); | ||
263 | btns_width += strlen(btn)+1; | ||
264 | } | ||
265 | va_end(ap); | ||
266 | btns[btn_num] = NULL; | ||
267 | |||
268 | /* find the widest line of msg: */ | ||
269 | msg_lines = get_line_no(msg); | ||
270 | for (i = 0; i < msg_lines; i++) { | ||
271 | const char *line = get_line(msg, i); | ||
272 | int len = get_line_length(line); | ||
273 | if (msg_width < len) | ||
274 | msg_width = len; | ||
275 | } | ||
276 | |||
277 | total_width = max(msg_width, btns_width); | ||
278 | /* place dialog in middle of screen */ | ||
279 | y = (LINES-(msg_lines+4))/2; | ||
280 | x = (COLS-(total_width+4))/2; | ||
281 | |||
282 | |||
283 | /* create the windows */ | ||
284 | if (btn_num > 0) | ||
285 | win_rows = msg_lines+4; | ||
286 | else | ||
287 | win_rows = msg_lines+2; | ||
288 | |||
289 | win = newwin(win_rows, total_width+4, y, x); | ||
290 | keypad(win, TRUE); | ||
291 | menu_win = derwin(win, 1, btns_width, win_rows-2, | ||
292 | 1+(total_width+2-btns_width)/2); | ||
293 | menu = new_menu(btns); | ||
294 | msg_win = derwin(win, win_rows-2, msg_width, 1, | ||
295 | 1+(total_width+2-msg_width)/2); | ||
296 | |||
297 | set_menu_fore(menu, attributes[DIALOG_MENU_FORE]); | ||
298 | set_menu_back(menu, attributes[DIALOG_MENU_BACK]); | ||
299 | |||
300 | wattrset(win, attributes[DIALOG_BOX]); | ||
301 | box(win, 0, 0); | ||
302 | |||
303 | /* print message */ | ||
304 | wattrset(msg_win, attributes[DIALOG_TEXT]); | ||
305 | fill_window(msg_win, msg); | ||
306 | |||
307 | set_menu_win(menu, win); | ||
308 | set_menu_sub(menu, menu_win); | ||
309 | set_menu_format(menu, 1, btn_num); | ||
310 | menu_opts_off(menu, O_SHOWDESC); | ||
311 | menu_opts_off(menu, O_SHOWMATCH); | ||
312 | menu_opts_on(menu, O_ONEVALUE); | ||
313 | menu_opts_on(menu, O_NONCYCLIC); | ||
314 | set_menu_mark(menu, ""); | ||
315 | post_menu(menu); | ||
316 | |||
317 | |||
318 | touchwin(win); | ||
319 | refresh_all_windows(main_window); | ||
320 | while ((res = wgetch(win))) { | ||
321 | switch (res) { | ||
322 | case KEY_LEFT: | ||
323 | menu_driver(menu, REQ_LEFT_ITEM); | ||
324 | break; | ||
325 | case KEY_RIGHT: | ||
326 | menu_driver(menu, REQ_RIGHT_ITEM); | ||
327 | break; | ||
328 | case 10: /* ENTER */ | ||
329 | case 27: /* ESCAPE */ | ||
330 | case ' ': | ||
331 | case KEY_F(F_BACK): | ||
332 | case KEY_F(F_EXIT): | ||
333 | break; | ||
334 | } | ||
335 | touchwin(win); | ||
336 | refresh_all_windows(main_window); | ||
337 | |||
338 | if (res == 10 || res == ' ') { | ||
339 | res = item_index(current_item(menu)); | ||
340 | break; | ||
341 | } else if (res == 27 || res == KEY_F(F_BACK) || | ||
342 | res == KEY_F(F_EXIT)) { | ||
343 | res = KEY_EXIT; | ||
344 | break; | ||
345 | } | ||
346 | } | ||
347 | |||
348 | unpost_menu(menu); | ||
349 | free_menu(menu); | ||
350 | for (i = 0; i < btn_num; i++) | ||
351 | free_item(btns[i]); | ||
352 | |||
353 | delwin(win); | ||
354 | return res; | ||
355 | } | ||
356 | |||
357 | int dialog_inputbox(WINDOW *main_window, | ||
358 | const char *title, const char *prompt, | ||
359 | const char *init, char *result, int result_len) | ||
360 | { | ||
361 | int prompt_lines = 0; | ||
362 | int prompt_width = 0; | ||
363 | WINDOW *win; | ||
364 | WINDOW *prompt_win; | ||
365 | WINDOW *form_win; | ||
366 | PANEL *panel; | ||
367 | int i, x, y; | ||
368 | int res = -1; | ||
369 | int cursor_position = strlen(init); | ||
370 | |||
371 | |||
372 | /* find the widest line of msg: */ | ||
373 | prompt_lines = get_line_no(prompt); | ||
374 | for (i = 0; i < prompt_lines; i++) { | ||
375 | const char *line = get_line(prompt, i); | ||
376 | int len = get_line_length(line); | ||
377 | prompt_width = max(prompt_width, len); | ||
378 | } | ||
379 | |||
380 | if (title) | ||
381 | prompt_width = max(prompt_width, strlen(title)); | ||
382 | |||
383 | /* place dialog in middle of screen */ | ||
384 | y = (LINES-(prompt_lines+4))/2; | ||
385 | x = (COLS-(prompt_width+4))/2; | ||
386 | |||
387 | strncpy(result, init, result_len); | ||
388 | |||
389 | /* create the windows */ | ||
390 | win = newwin(prompt_lines+6, prompt_width+7, y, x); | ||
391 | prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2); | ||
392 | form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2); | ||
393 | keypad(form_win, TRUE); | ||
394 | |||
395 | wattrset(form_win, attributes[INPUT_FIELD]); | ||
396 | |||
397 | wattrset(win, attributes[INPUT_BOX]); | ||
398 | box(win, 0, 0); | ||
399 | wattrset(win, attributes[INPUT_HEADING]); | ||
400 | if (title) | ||
401 | mvwprintw(win, 0, 3, "%s", title); | ||
402 | |||
403 | /* print message */ | ||
404 | wattrset(prompt_win, attributes[INPUT_TEXT]); | ||
405 | fill_window(prompt_win, prompt); | ||
406 | |||
407 | mvwprintw(form_win, 0, 0, "%*s", prompt_width, " "); | ||
408 | mvwprintw(form_win, 0, 0, "%s", result); | ||
409 | |||
410 | /* create panels */ | ||
411 | panel = new_panel(win); | ||
412 | |||
413 | /* show the cursor */ | ||
414 | curs_set(1); | ||
415 | |||
416 | touchwin(win); | ||
417 | refresh_all_windows(main_window); | ||
418 | while ((res = wgetch(form_win))) { | ||
419 | int len = strlen(result); | ||
420 | switch (res) { | ||
421 | case 10: /* ENTER */ | ||
422 | case 27: /* ESCAPE */ | ||
423 | case KEY_F(F_HELP): | ||
424 | case KEY_F(F_EXIT): | ||
425 | case KEY_F(F_BACK): | ||
426 | break; | ||
427 | case 127: | ||
428 | case KEY_BACKSPACE: | ||
429 | if (cursor_position > 0) { | ||
430 | memmove(&result[cursor_position-1], | ||
431 | &result[cursor_position], | ||
432 | len-cursor_position+1); | ||
433 | cursor_position--; | ||
434 | } | ||
435 | break; | ||
436 | case KEY_DC: | ||
437 | if (cursor_position >= 0 && cursor_position < len) { | ||
438 | memmove(&result[cursor_position], | ||
439 | &result[cursor_position+1], | ||
440 | len-cursor_position+1); | ||
441 | } | ||
442 | break; | ||
443 | case KEY_UP: | ||
444 | case KEY_RIGHT: | ||
445 | if (cursor_position < len && | ||
446 | cursor_position < min(result_len, prompt_width)) | ||
447 | cursor_position++; | ||
448 | break; | ||
449 | case KEY_DOWN: | ||
450 | case KEY_LEFT: | ||
451 | if (cursor_position > 0) | ||
452 | cursor_position--; | ||
453 | break; | ||
454 | default: | ||
455 | if ((isgraph(res) || isspace(res)) && | ||
456 | len-2 < result_len) { | ||
457 | /* insert the char at the proper position */ | ||
458 | memmove(&result[cursor_position+1], | ||
459 | &result[cursor_position], | ||
460 | len+1); | ||
461 | result[cursor_position] = res; | ||
462 | cursor_position++; | ||
463 | } else { | ||
464 | mvprintw(0, 0, "unknow key: %d\n", res); | ||
465 | } | ||
466 | break; | ||
467 | } | ||
468 | wmove(form_win, 0, 0); | ||
469 | wclrtoeol(form_win); | ||
470 | mvwprintw(form_win, 0, 0, "%*s", prompt_width, " "); | ||
471 | mvwprintw(form_win, 0, 0, "%s", result); | ||
472 | wmove(form_win, 0, cursor_position); | ||
473 | touchwin(win); | ||
474 | refresh_all_windows(main_window); | ||
475 | |||
476 | if (res == 10) { | ||
477 | res = 0; | ||
478 | break; | ||
479 | } else if (res == 27 || res == KEY_F(F_BACK) || | ||
480 | res == KEY_F(F_EXIT)) { | ||
481 | res = KEY_EXIT; | ||
482 | break; | ||
483 | } else if (res == KEY_F(F_HELP)) { | ||
484 | res = 1; | ||
485 | break; | ||
486 | } | ||
487 | } | ||
488 | |||
489 | /* hide the cursor */ | ||
490 | curs_set(0); | ||
491 | del_panel(panel); | ||
492 | delwin(prompt_win); | ||
493 | delwin(form_win); | ||
494 | delwin(win); | ||
495 | return res; | ||
496 | } | ||
497 | |||
498 | /* refresh all windows in the correct order */ | ||
499 | void refresh_all_windows(WINDOW *main_window) | ||
500 | { | ||
501 | update_panels(); | ||
502 | touchwin(main_window); | ||
503 | refresh(); | ||
504 | } | ||
505 | |||
506 | /* layman's scrollable window... */ | ||
507 | void show_scroll_win(WINDOW *main_window, | ||
508 | const char *title, | ||
509 | const char *text) | ||
510 | { | ||
511 | int res; | ||
512 | int total_lines = get_line_no(text); | ||
513 | int x, y; | ||
514 | int start_x = 0, start_y = 0; | ||
515 | int text_lines = 0, text_cols = 0; | ||
516 | int total_cols = 0; | ||
517 | int win_cols = 0; | ||
518 | int win_lines = 0; | ||
519 | int i = 0; | ||
520 | WINDOW *win; | ||
521 | WINDOW *pad; | ||
522 | PANEL *panel; | ||
523 | |||
524 | /* find the widest line of msg: */ | ||
525 | total_lines = get_line_no(text); | ||
526 | for (i = 0; i < total_lines; i++) { | ||
527 | const char *line = get_line(text, i); | ||
528 | int len = get_line_length(line); | ||
529 | total_cols = max(total_cols, len+2); | ||
530 | } | ||
531 | |||
532 | /* create the pad */ | ||
533 | pad = newpad(total_lines+10, total_cols+10); | ||
534 | wattrset(pad, attributes[SCROLLWIN_TEXT]); | ||
535 | fill_window(pad, text); | ||
536 | |||
537 | win_lines = min(total_lines+4, LINES-2); | ||
538 | win_cols = min(total_cols+2, COLS-2); | ||
539 | text_lines = max(win_lines-4, 0); | ||
540 | text_cols = max(win_cols-2, 0); | ||
541 | |||
542 | /* place window in middle of screen */ | ||
543 | y = (LINES-win_lines)/2; | ||
544 | x = (COLS-win_cols)/2; | ||
545 | |||
546 | win = newwin(win_lines, win_cols, y, x); | ||
547 | keypad(win, TRUE); | ||
548 | /* show the help in the help window, and show the help panel */ | ||
549 | wattrset(win, attributes[SCROLLWIN_BOX]); | ||
550 | box(win, 0, 0); | ||
551 | wattrset(win, attributes[SCROLLWIN_HEADING]); | ||
552 | mvwprintw(win, 0, 3, " %s ", title); | ||
553 | panel = new_panel(win); | ||
554 | |||
555 | /* handle scrolling */ | ||
556 | do { | ||
557 | |||
558 | copywin(pad, win, start_y, start_x, 2, 2, text_lines, | ||
559 | text_cols, 0); | ||
560 | print_in_middle(win, | ||
561 | text_lines+2, | ||
562 | 0, | ||
563 | text_cols, | ||
564 | "<OK>", | ||
565 | attributes[DIALOG_MENU_FORE]); | ||
566 | wrefresh(win); | ||
567 | |||
568 | res = wgetch(win); | ||
569 | switch (res) { | ||
570 | case KEY_NPAGE: | ||
571 | case ' ': | ||
572 | start_y += text_lines-2; | ||
573 | break; | ||
574 | case KEY_PPAGE: | ||
575 | start_y -= text_lines+2; | ||
576 | break; | ||
577 | case KEY_HOME: | ||
578 | start_y = 0; | ||
579 | break; | ||
580 | case KEY_END: | ||
581 | start_y = total_lines-text_lines; | ||
582 | break; | ||
583 | case KEY_DOWN: | ||
584 | case 'j': | ||
585 | start_y++; | ||
586 | break; | ||
587 | case KEY_UP: | ||
588 | case 'k': | ||
589 | start_y--; | ||
590 | break; | ||
591 | case KEY_LEFT: | ||
592 | case 'h': | ||
593 | start_x--; | ||
594 | break; | ||
595 | case KEY_RIGHT: | ||
596 | case 'l': | ||
597 | start_x++; | ||
598 | break; | ||
599 | } | ||
600 | if (res == 10 || res == 27 || res == 'q' | ||
601 | || res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) { | ||
602 | break; | ||
603 | } | ||
604 | if (start_y < 0) | ||
605 | start_y = 0; | ||
606 | if (start_y >= total_lines-text_lines) | ||
607 | start_y = total_lines-text_lines; | ||
608 | if (start_x < 0) | ||
609 | start_x = 0; | ||
610 | if (start_x >= total_cols-text_cols) | ||
611 | start_x = total_cols-text_cols; | ||
612 | } while (res); | ||
613 | |||
614 | del_panel(panel); | ||
615 | delwin(win); | ||
616 | refresh_all_windows(main_window); | ||
617 | } | ||
diff --git a/scripts/kconfig/nconf.h b/scripts/kconfig/nconf.h new file mode 100644 index 000000000000..fb4296666004 --- /dev/null +++ b/scripts/kconfig/nconf.h | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Nir Tzachar <nir.tzachar@gmail.com? | ||
3 | * Released under the terms of the GNU GPL v2.0. | ||
4 | * | ||
5 | * Derived from menuconfig. | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #include <ctype.h> | ||
10 | #include <errno.h> | ||
11 | #include <fcntl.h> | ||
12 | #include <limits.h> | ||
13 | #include <stdarg.h> | ||
14 | #include <stdlib.h> | ||
15 | #include <string.h> | ||
16 | #include <unistd.h> | ||
17 | #include <locale.h> | ||
18 | #include <curses.h> | ||
19 | #include <menu.h> | ||
20 | #include <panel.h> | ||
21 | #include <form.h> | ||
22 | |||
23 | #include <stdio.h> | ||
24 | #include <time.h> | ||
25 | #include <sys/time.h> | ||
26 | |||
27 | #include "ncurses.h" | ||
28 | |||
29 | #define max(a, b) ({\ | ||
30 | typeof(a) _a = a;\ | ||
31 | typeof(b) _b = b;\ | ||
32 | _a > _b ? _a : _b; }) | ||
33 | |||
34 | #define min(a, b) ({\ | ||
35 | typeof(a) _a = a;\ | ||
36 | typeof(b) _b = b;\ | ||
37 | _a < _b ? _a : _b; }) | ||
38 | |||
39 | typedef enum { | ||
40 | NORMAL = 1, | ||
41 | MAIN_HEADING, | ||
42 | MAIN_MENU_BOX, | ||
43 | MAIN_MENU_FORE, | ||
44 | MAIN_MENU_BACK, | ||
45 | MAIN_MENU_GREY, | ||
46 | MAIN_MENU_HEADING, | ||
47 | SCROLLWIN_TEXT, | ||
48 | SCROLLWIN_HEADING, | ||
49 | SCROLLWIN_BOX, | ||
50 | DIALOG_TEXT, | ||
51 | DIALOG_MENU_FORE, | ||
52 | DIALOG_MENU_BACK, | ||
53 | DIALOG_BOX, | ||
54 | INPUT_BOX, | ||
55 | INPUT_HEADING, | ||
56 | INPUT_TEXT, | ||
57 | INPUT_FIELD, | ||
58 | FUNCTION_TEXT, | ||
59 | FUNCTION_HIGHLIGHT, | ||
60 | ATTR_MAX | ||
61 | } attributes_t; | ||
62 | extern attributes_t attributes[]; | ||
63 | |||
64 | typedef enum { | ||
65 | F_HELP = 1, | ||
66 | F_SYMBOL = 2, | ||
67 | F_INSTS = 3, | ||
68 | F_CONF = 4, | ||
69 | F_BACK = 5, | ||
70 | F_SAVE = 6, | ||
71 | F_LOAD = 7, | ||
72 | F_EXIT = 8 | ||
73 | } function_key; | ||
74 | |||
75 | void set_colors(void); | ||
76 | |||
77 | /* this changes the windows attributes !!! */ | ||
78 | void print_in_middle(WINDOW *win, | ||
79 | int starty, | ||
80 | int startx, | ||
81 | int width, | ||
82 | const char *string, | ||
83 | chtype color); | ||
84 | int get_line_length(const char *line); | ||
85 | int get_line_no(const char *text); | ||
86 | const char *get_line(const char *text, int line_no); | ||
87 | void fill_window(WINDOW *win, const char *text); | ||
88 | int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...); | ||
89 | int dialog_inputbox(WINDOW *main_window, | ||
90 | const char *title, const char *prompt, | ||
91 | const char *init, char *result, int result_len); | ||
92 | void refresh_all_windows(WINDOW *main_window); | ||
93 | void show_scroll_win(WINDOW *main_window, | ||
94 | const char *title, | ||
95 | const char *text); | ||
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 6c8fbbb66ebc..2e7a048e0cfc 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -651,12 +651,20 @@ bool sym_is_changable(struct symbol *sym) | |||
651 | return sym->visible > sym->rev_dep.tri; | 651 | return sym->visible > sym->rev_dep.tri; |
652 | } | 652 | } |
653 | 653 | ||
654 | static unsigned strhash(const char *s) | ||
655 | { | ||
656 | /* fnv32 hash */ | ||
657 | unsigned hash = 2166136261U; | ||
658 | for (; *s; s++) | ||
659 | hash = (hash ^ *s) * 0x01000193; | ||
660 | return hash; | ||
661 | } | ||
662 | |||
654 | struct symbol *sym_lookup(const char *name, int flags) | 663 | struct symbol *sym_lookup(const char *name, int flags) |
655 | { | 664 | { |
656 | struct symbol *symbol; | 665 | struct symbol *symbol; |
657 | const char *ptr; | ||
658 | char *new_name; | 666 | char *new_name; |
659 | int hash = 0; | 667 | int hash; |
660 | 668 | ||
661 | if (name) { | 669 | if (name) { |
662 | if (name[0] && !name[1]) { | 670 | if (name[0] && !name[1]) { |
@@ -666,12 +674,11 @@ struct symbol *sym_lookup(const char *name, int flags) | |||
666 | case 'n': return &symbol_no; | 674 | case 'n': return &symbol_no; |
667 | } | 675 | } |
668 | } | 676 | } |
669 | for (ptr = name; *ptr; ptr++) | 677 | hash = strhash(name) % SYMBOL_HASHSIZE; |
670 | hash += *ptr; | ||
671 | hash &= 0xff; | ||
672 | 678 | ||
673 | for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { | 679 | for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { |
674 | if (!strcmp(symbol->name, name) && | 680 | if (symbol->name && |
681 | !strcmp(symbol->name, name) && | ||
675 | (flags ? symbol->flags & flags | 682 | (flags ? symbol->flags & flags |
676 | : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE)))) | 683 | : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE)))) |
677 | return symbol; | 684 | return symbol; |
@@ -679,7 +686,7 @@ struct symbol *sym_lookup(const char *name, int flags) | |||
679 | new_name = strdup(name); | 686 | new_name = strdup(name); |
680 | } else { | 687 | } else { |
681 | new_name = NULL; | 688 | new_name = NULL; |
682 | hash = 256; | 689 | hash = 0; |
683 | } | 690 | } |
684 | 691 | ||
685 | symbol = malloc(sizeof(*symbol)); | 692 | symbol = malloc(sizeof(*symbol)); |
@@ -697,7 +704,6 @@ struct symbol *sym_lookup(const char *name, int flags) | |||
697 | struct symbol *sym_find(const char *name) | 704 | struct symbol *sym_find(const char *name) |
698 | { | 705 | { |
699 | struct symbol *symbol = NULL; | 706 | struct symbol *symbol = NULL; |
700 | const char *ptr; | ||
701 | int hash = 0; | 707 | int hash = 0; |
702 | 708 | ||
703 | if (!name) | 709 | if (!name) |
@@ -710,12 +716,11 @@ struct symbol *sym_find(const char *name) | |||
710 | case 'n': return &symbol_no; | 716 | case 'n': return &symbol_no; |
711 | } | 717 | } |
712 | } | 718 | } |
713 | for (ptr = name; *ptr; ptr++) | 719 | hash = strhash(name) % SYMBOL_HASHSIZE; |
714 | hash += *ptr; | ||
715 | hash &= 0xff; | ||
716 | 720 | ||
717 | for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { | 721 | for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { |
718 | if (!strcmp(symbol->name, name) && | 722 | if (symbol->name && |
723 | !strcmp(symbol->name, name) && | ||
719 | !(symbol->flags & SYMBOL_CONST)) | 724 | !(symbol->flags & SYMBOL_CONST)) |
720 | break; | 725 | break; |
721 | } | 726 | } |
@@ -750,6 +755,7 @@ struct symbol **sym_re_search(const char *pattern) | |||
750 | return NULL; | 755 | return NULL; |
751 | } | 756 | } |
752 | } | 757 | } |
758 | sym_calc_value(sym); | ||
753 | sym_arr[cnt++] = sym; | 759 | sym_arr[cnt++] = sym; |
754 | } | 760 | } |
755 | if (sym_arr) | 761 | if (sym_arr) |
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 25d1ec4ca28a..78b5c04e736b 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c | |||
@@ -78,6 +78,7 @@ struct gstr str_new(void) | |||
78 | struct gstr gs; | 78 | struct gstr gs; |
79 | gs.s = malloc(sizeof(char) * 64); | 79 | gs.s = malloc(sizeof(char) * 64); |
80 | gs.len = 64; | 80 | gs.len = 64; |
81 | gs.max_width = 0; | ||
81 | strcpy(gs.s, "\0"); | 82 | strcpy(gs.s, "\0"); |
82 | return gs; | 83 | return gs; |
83 | } | 84 | } |
@@ -88,6 +89,7 @@ struct gstr str_assign(const char *s) | |||
88 | struct gstr gs; | 89 | struct gstr gs; |
89 | gs.s = strdup(s); | 90 | gs.s = strdup(s); |
90 | gs.len = strlen(s) + 1; | 91 | gs.len = strlen(s) + 1; |
92 | gs.max_width = 0; | ||
91 | return gs; | 93 | return gs; |
92 | } | 94 | } |
93 | 95 | ||
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index 6e9dcd59aa87..32a9eefd842c 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped | |||
@@ -104,7 +104,7 @@ static void zconf_error(const char *err, ...); | |||
104 | static void zconferror(const char *err); | 104 | static void zconferror(const char *err); |
105 | static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); | 105 | static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); |
106 | 106 | ||
107 | struct symbol *symbol_hash[257]; | 107 | struct symbol *symbol_hash[SYMBOL_HASHSIZE]; |
108 | 108 | ||
109 | static struct menu *current_menu, *current_entry; | 109 | static struct menu *current_menu, *current_entry; |
110 | 110 | ||
@@ -2220,7 +2220,7 @@ void conf_parse(const char *name) | |||
2220 | zconf_initscan(name); | 2220 | zconf_initscan(name); |
2221 | 2221 | ||
2222 | sym_init(); | 2222 | sym_init(); |
2223 | menu_init(); | 2223 | _menu_init(); |
2224 | modules_sym = sym_lookup(NULL, 0); | 2224 | modules_sym = sym_lookup(NULL, 0); |
2225 | modules_sym->type = S_BOOLEAN; | 2225 | modules_sym->type = S_BOOLEAN; |
2226 | modules_sym->flags |= SYMBOL_AUTO; | 2226 | modules_sym->flags |= SYMBOL_AUTO; |
@@ -2336,9 +2336,9 @@ static void print_symbol(FILE *out, struct menu *menu) | |||
2336 | struct property *prop; | 2336 | struct property *prop; |
2337 | 2337 | ||
2338 | if (sym_is_choice(sym)) | 2338 | if (sym_is_choice(sym)) |
2339 | fprintf(out, "choice\n"); | 2339 | fprintf(out, "\nchoice\n"); |
2340 | else | 2340 | else |
2341 | fprintf(out, "config %s\n", sym->name); | 2341 | fprintf(out, "\nconfig %s\n", sym->name); |
2342 | switch (sym->type) { | 2342 | switch (sym->type) { |
2343 | case S_BOOLEAN: | 2343 | case S_BOOLEAN: |
2344 | fputs(" boolean\n", out); | 2344 | fputs(" boolean\n", out); |
@@ -2384,6 +2384,21 @@ static void print_symbol(FILE *out, struct menu *menu) | |||
2384 | case P_CHOICE: | 2384 | case P_CHOICE: |
2385 | fputs(" #choice value\n", out); | 2385 | fputs(" #choice value\n", out); |
2386 | break; | 2386 | break; |
2387 | case P_SELECT: | ||
2388 | fputs( " select ", out); | ||
2389 | expr_fprint(prop->expr, out); | ||
2390 | fputc('\n', out); | ||
2391 | break; | ||
2392 | case P_RANGE: | ||
2393 | fputs( " range ", out); | ||
2394 | expr_fprint(prop->expr, out); | ||
2395 | fputc('\n', out); | ||
2396 | break; | ||
2397 | case P_MENU: | ||
2398 | fputs( " menu ", out); | ||
2399 | print_quoted_string(out, prop->text); | ||
2400 | fputc('\n', out); | ||
2401 | break; | ||
2387 | default: | 2402 | default: |
2388 | fprintf(out, " unknown prop %d!\n", prop->type); | 2403 | fprintf(out, " unknown prop %d!\n", prop->type); |
2389 | break; | 2404 | break; |
@@ -2395,7 +2410,6 @@ static void print_symbol(FILE *out, struct menu *menu) | |||
2395 | menu->help[len] = 0; | 2410 | menu->help[len] = 0; |
2396 | fprintf(out, " help\n%s\n", menu->help); | 2411 | fprintf(out, " help\n%s\n", menu->help); |
2397 | } | 2412 | } |
2398 | fputc('\n', out); | ||
2399 | } | 2413 | } |
2400 | 2414 | ||
2401 | void zconfdump(FILE *out) | 2415 | void zconfdump(FILE *out) |
@@ -2428,7 +2442,6 @@ void zconfdump(FILE *out) | |||
2428 | expr_fprint(prop->visible.expr, out); | 2442 | expr_fprint(prop->visible.expr, out); |
2429 | fputc('\n', out); | 2443 | fputc('\n', out); |
2430 | } | 2444 | } |
2431 | fputs("\n", out); | ||
2432 | } | 2445 | } |
2433 | 2446 | ||
2434 | if (menu->list) | 2447 | if (menu->list) |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 8c43491f8cc9..23dfd3baa7a1 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
@@ -27,7 +27,7 @@ static void zconf_error(const char *err, ...); | |||
27 | static void zconferror(const char *err); | 27 | static void zconferror(const char *err); |
28 | static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); | 28 | static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); |
29 | 29 | ||
30 | struct symbol *symbol_hash[257]; | 30 | struct symbol *symbol_hash[SYMBOL_HASHSIZE]; |
31 | 31 | ||
32 | static struct menu *current_menu, *current_entry; | 32 | static struct menu *current_menu, *current_entry; |
33 | 33 | ||
@@ -475,7 +475,7 @@ void conf_parse(const char *name) | |||
475 | zconf_initscan(name); | 475 | zconf_initscan(name); |
476 | 476 | ||
477 | sym_init(); | 477 | sym_init(); |
478 | menu_init(); | 478 | _menu_init(); |
479 | modules_sym = sym_lookup(NULL, 0); | 479 | modules_sym = sym_lookup(NULL, 0); |
480 | modules_sym->type = S_BOOLEAN; | 480 | modules_sym->type = S_BOOLEAN; |
481 | modules_sym->flags |= SYMBOL_AUTO; | 481 | modules_sym->flags |= SYMBOL_AUTO; |
@@ -591,9 +591,9 @@ static void print_symbol(FILE *out, struct menu *menu) | |||
591 | struct property *prop; | 591 | struct property *prop; |
592 | 592 | ||
593 | if (sym_is_choice(sym)) | 593 | if (sym_is_choice(sym)) |
594 | fprintf(out, "choice\n"); | 594 | fprintf(out, "\nchoice\n"); |
595 | else | 595 | else |
596 | fprintf(out, "config %s\n", sym->name); | 596 | fprintf(out, "\nconfig %s\n", sym->name); |
597 | switch (sym->type) { | 597 | switch (sym->type) { |
598 | case S_BOOLEAN: | 598 | case S_BOOLEAN: |
599 | fputs(" boolean\n", out); | 599 | fputs(" boolean\n", out); |
@@ -639,6 +639,21 @@ static void print_symbol(FILE *out, struct menu *menu) | |||
639 | case P_CHOICE: | 639 | case P_CHOICE: |
640 | fputs(" #choice value\n", out); | 640 | fputs(" #choice value\n", out); |
641 | break; | 641 | break; |
642 | case P_SELECT: | ||
643 | fputs( " select ", out); | ||
644 | expr_fprint(prop->expr, out); | ||
645 | fputc('\n', out); | ||
646 | break; | ||
647 | case P_RANGE: | ||
648 | fputs( " range ", out); | ||
649 | expr_fprint(prop->expr, out); | ||
650 | fputc('\n', out); | ||
651 | break; | ||
652 | case P_MENU: | ||
653 | fputs( " menu ", out); | ||
654 | print_quoted_string(out, prop->text); | ||
655 | fputc('\n', out); | ||
656 | break; | ||
642 | default: | 657 | default: |
643 | fprintf(out, " unknown prop %d!\n", prop->type); | 658 | fprintf(out, " unknown prop %d!\n", prop->type); |
644 | break; | 659 | break; |
@@ -650,7 +665,6 @@ static void print_symbol(FILE *out, struct menu *menu) | |||
650 | menu->help[len] = 0; | 665 | menu->help[len] = 0; |
651 | fprintf(out, " help\n%s\n", menu->help); | 666 | fprintf(out, " help\n%s\n", menu->help); |
652 | } | 667 | } |
653 | fputc('\n', out); | ||
654 | } | 668 | } |
655 | 669 | ||
656 | void zconfdump(FILE *out) | 670 | void zconfdump(FILE *out) |
@@ -683,7 +697,6 @@ void zconfdump(FILE *out) | |||
683 | expr_fprint(prop->visible.expr, out); | 697 | expr_fprint(prop->visible.expr, out); |
684 | fputc('\n', out); | 698 | fputc('\n', out); |
685 | } | 699 | } |
686 | fputs("\n", out); | ||
687 | } | 700 | } |
688 | 701 | ||
689 | if (menu->list) | 702 | if (menu->list) |
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl index e950f9cde019..827896f56501 100644 --- a/scripts/markup_oops.pl +++ b/scripts/markup_oops.pl | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | use File::Basename; | 3 | use File::Basename; |
4 | use Math::BigInt; | 4 | use Math::BigInt; |
5 | use Getopt::Long; | ||
5 | 6 | ||
6 | # Copyright 2008, Intel Corporation | 7 | # Copyright 2008, Intel Corporation |
7 | # | 8 | # |
@@ -15,6 +16,16 @@ use Math::BigInt; | |||
15 | # Arjan van de Ven <arjan@linux.intel.com> | 16 | # Arjan van de Ven <arjan@linux.intel.com> |
16 | 17 | ||
17 | 18 | ||
19 | my $cross_compile = ""; | ||
20 | my $vmlinux_name = ""; | ||
21 | my $modulefile = ""; | ||
22 | |||
23 | # Get options | ||
24 | Getopt::Long::GetOptions( | ||
25 | 'cross-compile|c=s' => \$cross_compile, | ||
26 | 'module|m=s' => \$modulefile, | ||
27 | 'help|h' => \&usage, | ||
28 | ) || usage (); | ||
18 | my $vmlinux_name = $ARGV[0]; | 29 | my $vmlinux_name = $ARGV[0]; |
19 | if (!defined($vmlinux_name)) { | 30 | if (!defined($vmlinux_name)) { |
20 | my $kerver = `uname -r`; | 31 | my $kerver = `uname -r`; |
@@ -23,9 +34,8 @@ if (!defined($vmlinux_name)) { | |||
23 | print "No vmlinux specified, assuming $vmlinux_name\n"; | 34 | print "No vmlinux specified, assuming $vmlinux_name\n"; |
24 | } | 35 | } |
25 | my $filename = $vmlinux_name; | 36 | my $filename = $vmlinux_name; |
26 | # | 37 | |
27 | # Step 1: Parse the oops to find the EIP value | 38 | # Parse the oops to find the EIP value |
28 | # | ||
29 | 39 | ||
30 | my $target = "0"; | 40 | my $target = "0"; |
31 | my $function; | 41 | my $function; |
@@ -177,26 +187,26 @@ my $decodestart = Math::BigInt->from_hex("0x$target") - Math::BigInt->from_hex(" | |||
177 | my $decodestop = Math::BigInt->from_hex("0x$target") + 8192; | 187 | my $decodestop = Math::BigInt->from_hex("0x$target") + 8192; |
178 | if ($target eq "0") { | 188 | if ($target eq "0") { |
179 | print "No oops found!\n"; | 189 | print "No oops found!\n"; |
180 | print "Usage: \n"; | 190 | usage(); |
181 | print " dmesg | perl scripts/markup_oops.pl vmlinux\n"; | ||
182 | exit; | ||
183 | } | 191 | } |
184 | 192 | ||
185 | # if it's a module, we need to find the .ko file and calculate a load offset | 193 | # if it's a module, we need to find the .ko file and calculate a load offset |
186 | if ($module ne "") { | 194 | if ($module ne "") { |
187 | my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`; | 195 | if ($modulefile eq "") { |
188 | chomp($modulefile); | 196 | $modulefile = `modinfo -F filename $module`; |
197 | chomp($modulefile); | ||
198 | } | ||
189 | $filename = $modulefile; | 199 | $filename = $modulefile; |
190 | if ($filename eq "") { | 200 | if ($filename eq "") { |
191 | print "Module .ko file for $module not found. Aborting\n"; | 201 | print "Module .ko file for $module not found. Aborting\n"; |
192 | exit; | 202 | exit; |
193 | } | 203 | } |
194 | # ok so we found the module, now we need to calculate the vma offset | 204 | # ok so we found the module, now we need to calculate the vma offset |
195 | open(FILE, "objdump -dS $filename |") || die "Cannot start objdump"; | 205 | open(FILE, $cross_compile."objdump -dS $filename |") || die "Cannot start objdump"; |
196 | while (<FILE>) { | 206 | while (<FILE>) { |
197 | if ($_ =~ /^([0-9a-f]+) \<$function\>\:/) { | 207 | if ($_ =~ /^([0-9a-f]+) \<$function\>\:/) { |
198 | my $fu = $1; | 208 | my $fu = $1; |
199 | $vmaoffset = hex($target) - hex($fu) - hex($func_offset); | 209 | $vmaoffset = Math::BigInt->from_hex("0x$target") - Math::BigInt->from_hex("0x$fu") - Math::BigInt->from_hex("0x$func_offset"); |
200 | } | 210 | } |
201 | } | 211 | } |
202 | close(FILE); | 212 | close(FILE); |
@@ -204,7 +214,7 @@ if ($module ne "") { | |||
204 | 214 | ||
205 | my $counter = 0; | 215 | my $counter = 0; |
206 | my $state = 0; | 216 | my $state = 0; |
207 | my $center = 0; | 217 | my $center = -1; |
208 | my @lines; | 218 | my @lines; |
209 | my @reglines; | 219 | my @reglines; |
210 | 220 | ||
@@ -212,7 +222,7 @@ sub InRange { | |||
212 | my ($address, $target) = @_; | 222 | my ($address, $target) = @_; |
213 | my $ad = "0x".$address; | 223 | my $ad = "0x".$address; |
214 | my $ta = "0x".$target; | 224 | my $ta = "0x".$target; |
215 | my $delta = hex($ad) - hex($ta); | 225 | my $delta = Math::BigInt->from_hex($ad) - Math::BigInt->from_hex($ta); |
216 | 226 | ||
217 | if (($delta > -4096) && ($delta < 4096)) { | 227 | if (($delta > -4096) && ($delta < 4096)) { |
218 | return 1; | 228 | return 1; |
@@ -225,7 +235,7 @@ sub InRange { | |||
225 | # first, parse the input into the lines array, but to keep size down, | 235 | # first, parse the input into the lines array, but to keep size down, |
226 | # we only do this for 4Kb around the sweet spot | 236 | # we only do this for 4Kb around the sweet spot |
227 | 237 | ||
228 | open(FILE, "objdump -dS --adjust-vma=$vmaoffset --start-address=$decodestart --stop-address=$decodestop $filename |") || die "Cannot start objdump"; | 238 | open(FILE, $cross_compile."objdump -dS --adjust-vma=$vmaoffset --start-address=$decodestart --stop-address=$decodestop $filename |") || die "Cannot start objdump"; |
229 | 239 | ||
230 | while (<FILE>) { | 240 | while (<FILE>) { |
231 | my $line = $_; | 241 | my $line = $_; |
@@ -236,7 +246,8 @@ while (<FILE>) { | |||
236 | $state = 1; | 246 | $state = 1; |
237 | } | 247 | } |
238 | } | 248 | } |
239 | } else { | 249 | } |
250 | if ($state == 1) { | ||
240 | if ($line =~ /^([a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]+)\:/) { | 251 | if ($line =~ /^([a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]+)\:/) { |
241 | my $val = $1; | 252 | my $val = $1; |
242 | if (!InRange($val, $target)) { | 253 | if (!InRange($val, $target)) { |
@@ -259,7 +270,7 @@ if ($counter == 0) { | |||
259 | exit; | 270 | exit; |
260 | } | 271 | } |
261 | 272 | ||
262 | if ($center == 0) { | 273 | if ($center == -1) { |
263 | print "No matching code found \n"; | 274 | print "No matching code found \n"; |
264 | exit; | 275 | exit; |
265 | } | 276 | } |
@@ -344,3 +355,16 @@ while ($i < $finish) { | |||
344 | $i = $i +1; | 355 | $i = $i +1; |
345 | } | 356 | } |
346 | 357 | ||
358 | sub usage { | ||
359 | print <<EOT; | ||
360 | Usage: | ||
361 | dmesg | perl $0 [OPTION] [VMLINUX] | ||
362 | |||
363 | OPTION: | ||
364 | -c, --cross-compile CROSS_COMPILE Specify the prefix used for toolchain. | ||
365 | -m, --module MODULE_DIRNAME Specify the module filename. | ||
366 | -h, --help Help. | ||
367 | EOT | ||
368 | exit; | ||
369 | } | ||
370 | |||
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 23dbad80cce9..50ad317a4bf9 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h | |||
@@ -67,9 +67,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" | |||
67 | echo \#define LINUX_COMPILE_BY \"`whoami`\" | 67 | echo \#define LINUX_COMPILE_BY \"`whoami`\" |
68 | echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\" | 68 | echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\" |
69 | 69 | ||
70 | if [ -x /bin/dnsdomainname ]; then | 70 | domain=`dnsdomainname 2> /dev/null` |
71 | domain=`dnsdomainname 2> /dev/null` | 71 | if [ -z "$domain" ]; then |
72 | elif [ -x /bin/domainname ]; then | ||
73 | domain=`domainname 2> /dev/null` | 72 | domain=`domainname 2> /dev/null` |
74 | fi | 73 | fi |
75 | 74 | ||
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 20923613467c..3318692e4e76 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -781,10 +781,13 @@ static void check_section(const char *modname, struct elf_info *elf, | |||
781 | #define ALL_EXIT_TEXT_SECTIONS \ | 781 | #define ALL_EXIT_TEXT_SECTIONS \ |
782 | ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$" | 782 | ".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$" |
783 | 783 | ||
784 | #define ALL_INIT_SECTIONS INIT_SECTIONS, DEV_INIT_SECTIONS, \ | 784 | #define ALL_XXXINIT_SECTIONS DEV_INIT_SECTIONS, CPU_INIT_SECTIONS, \ |
785 | CPU_INIT_SECTIONS, MEM_INIT_SECTIONS | 785 | MEM_INIT_SECTIONS |
786 | #define ALL_EXIT_SECTIONS EXIT_SECTIONS, DEV_EXIT_SECTIONS, \ | 786 | #define ALL_XXXEXIT_SECTIONS DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, \ |
787 | CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS | 787 | MEM_EXIT_SECTIONS |
788 | |||
789 | #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS | ||
790 | #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS | ||
788 | 791 | ||
789 | #define DATA_SECTIONS ".data$", ".data.rel$" | 792 | #define DATA_SECTIONS ".data$", ".data.rel$" |
790 | #define TEXT_SECTIONS ".text$" | 793 | #define TEXT_SECTIONS ".text$" |
@@ -814,33 +817,29 @@ static const char *data_sections[] = { DATA_SECTIONS, NULL }; | |||
814 | 817 | ||
815 | 818 | ||
816 | /* symbols in .data that may refer to init/exit sections */ | 819 | /* symbols in .data that may refer to init/exit sections */ |
817 | static const char *symbol_white_list[] = | 820 | #define DEFAULT_SYMBOL_WHITE_LIST \ |
818 | { | 821 | "*driver", \ |
819 | "*driver", | 822 | "*_template", /* scsi uses *_template a lot */ \ |
820 | "*_template", /* scsi uses *_template a lot */ | 823 | "*_timer", /* arm uses ops structures named _timer a lot */ \ |
821 | "*_timer", /* arm uses ops structures named _timer a lot */ | 824 | "*_sht", /* scsi also used *_sht to some extent */ \ |
822 | "*_sht", /* scsi also used *_sht to some extent */ | 825 | "*_ops", \ |
823 | "*_ops", | 826 | "*_probe", \ |
824 | "*_probe", | 827 | "*_probe_one", \ |
825 | "*_probe_one", | 828 | "*_console" |
826 | "*_console", | ||
827 | NULL | ||
828 | }; | ||
829 | 829 | ||
830 | static const char *head_sections[] = { ".head.text*", NULL }; | 830 | static const char *head_sections[] = { ".head.text*", NULL }; |
831 | static const char *linker_symbols[] = | 831 | static const char *linker_symbols[] = |
832 | { "__init_begin", "_sinittext", "_einittext", NULL }; | 832 | { "__init_begin", "_sinittext", "_einittext", NULL }; |
833 | 833 | ||
834 | enum mismatch { | 834 | enum mismatch { |
835 | NO_MISMATCH, | 835 | TEXT_TO_ANY_INIT, |
836 | TEXT_TO_INIT, | 836 | DATA_TO_ANY_INIT, |
837 | DATA_TO_INIT, | 837 | TEXT_TO_ANY_EXIT, |
838 | TEXT_TO_EXIT, | 838 | DATA_TO_ANY_EXIT, |
839 | DATA_TO_EXIT, | 839 | XXXINIT_TO_SOME_INIT, |
840 | XXXINIT_TO_INIT, | 840 | XXXEXIT_TO_SOME_EXIT, |
841 | XXXEXIT_TO_EXIT, | 841 | ANY_INIT_TO_ANY_EXIT, |
842 | INIT_TO_EXIT, | 842 | ANY_EXIT_TO_ANY_INIT, |
843 | EXIT_TO_INIT, | ||
844 | EXPORT_TO_INIT_EXIT, | 843 | EXPORT_TO_INIT_EXIT, |
845 | }; | 844 | }; |
846 | 845 | ||
@@ -848,6 +847,7 @@ struct sectioncheck { | |||
848 | const char *fromsec[20]; | 847 | const char *fromsec[20]; |
849 | const char *tosec[20]; | 848 | const char *tosec[20]; |
850 | enum mismatch mismatch; | 849 | enum mismatch mismatch; |
850 | const char *symbol_white_list[20]; | ||
851 | }; | 851 | }; |
852 | 852 | ||
853 | const struct sectioncheck sectioncheck[] = { | 853 | const struct sectioncheck sectioncheck[] = { |
@@ -857,80 +857,103 @@ const struct sectioncheck sectioncheck[] = { | |||
857 | { | 857 | { |
858 | .fromsec = { TEXT_SECTIONS, NULL }, | 858 | .fromsec = { TEXT_SECTIONS, NULL }, |
859 | .tosec = { ALL_INIT_SECTIONS, NULL }, | 859 | .tosec = { ALL_INIT_SECTIONS, NULL }, |
860 | .mismatch = TEXT_TO_INIT, | 860 | .mismatch = TEXT_TO_ANY_INIT, |
861 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
861 | }, | 862 | }, |
862 | { | 863 | { |
863 | .fromsec = { DATA_SECTIONS, NULL }, | 864 | .fromsec = { DATA_SECTIONS, NULL }, |
864 | .tosec = { ALL_INIT_SECTIONS, NULL }, | 865 | .tosec = { ALL_XXXINIT_SECTIONS, NULL }, |
865 | .mismatch = DATA_TO_INIT, | 866 | .mismatch = DATA_TO_ANY_INIT, |
867 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
868 | }, | ||
869 | { | ||
870 | .fromsec = { DATA_SECTIONS, NULL }, | ||
871 | .tosec = { INIT_SECTIONS, NULL }, | ||
872 | .mismatch = DATA_TO_ANY_INIT, | ||
873 | .symbol_white_list = { | ||
874 | "*_template", "*_timer", "*_sht", "*_ops", | ||
875 | "*_probe", "*_probe_one", "*_console", NULL | ||
876 | }, | ||
866 | }, | 877 | }, |
867 | { | 878 | { |
868 | .fromsec = { TEXT_SECTIONS, NULL }, | 879 | .fromsec = { TEXT_SECTIONS, NULL }, |
869 | .tosec = { ALL_EXIT_SECTIONS, NULL }, | 880 | .tosec = { ALL_EXIT_SECTIONS, NULL }, |
870 | .mismatch = TEXT_TO_EXIT, | 881 | .mismatch = TEXT_TO_ANY_EXIT, |
882 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
871 | }, | 883 | }, |
872 | { | 884 | { |
873 | .fromsec = { DATA_SECTIONS, NULL }, | 885 | .fromsec = { DATA_SECTIONS, NULL }, |
874 | .tosec = { ALL_EXIT_SECTIONS, NULL }, | 886 | .tosec = { ALL_EXIT_SECTIONS, NULL }, |
875 | .mismatch = DATA_TO_EXIT, | 887 | .mismatch = DATA_TO_ANY_EXIT, |
888 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
876 | }, | 889 | }, |
877 | /* Do not reference init code/data from devinit/cpuinit/meminit code/data */ | 890 | /* Do not reference init code/data from devinit/cpuinit/meminit code/data */ |
878 | { | 891 | { |
879 | .fromsec = { DEV_INIT_SECTIONS, CPU_INIT_SECTIONS, MEM_INIT_SECTIONS, NULL }, | 892 | .fromsec = { ALL_XXXINIT_SECTIONS, NULL }, |
880 | .tosec = { INIT_SECTIONS, NULL }, | 893 | .tosec = { INIT_SECTIONS, NULL }, |
881 | .mismatch = XXXINIT_TO_INIT, | 894 | .mismatch = XXXINIT_TO_SOME_INIT, |
895 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
882 | }, | 896 | }, |
883 | /* Do not reference cpuinit code/data from meminit code/data */ | 897 | /* Do not reference cpuinit code/data from meminit code/data */ |
884 | { | 898 | { |
885 | .fromsec = { MEM_INIT_SECTIONS, NULL }, | 899 | .fromsec = { MEM_INIT_SECTIONS, NULL }, |
886 | .tosec = { CPU_INIT_SECTIONS, NULL }, | 900 | .tosec = { CPU_INIT_SECTIONS, NULL }, |
887 | .mismatch = XXXINIT_TO_INIT, | 901 | .mismatch = XXXINIT_TO_SOME_INIT, |
902 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
888 | }, | 903 | }, |
889 | /* Do not reference meminit code/data from cpuinit code/data */ | 904 | /* Do not reference meminit code/data from cpuinit code/data */ |
890 | { | 905 | { |
891 | .fromsec = { CPU_INIT_SECTIONS, NULL }, | 906 | .fromsec = { CPU_INIT_SECTIONS, NULL }, |
892 | .tosec = { MEM_INIT_SECTIONS, NULL }, | 907 | .tosec = { MEM_INIT_SECTIONS, NULL }, |
893 | .mismatch = XXXINIT_TO_INIT, | 908 | .mismatch = XXXINIT_TO_SOME_INIT, |
909 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
894 | }, | 910 | }, |
895 | /* Do not reference exit code/data from devexit/cpuexit/memexit code/data */ | 911 | /* Do not reference exit code/data from devexit/cpuexit/memexit code/data */ |
896 | { | 912 | { |
897 | .fromsec = { DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS, NULL }, | 913 | .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, |
898 | .tosec = { EXIT_SECTIONS, NULL }, | 914 | .tosec = { EXIT_SECTIONS, NULL }, |
899 | .mismatch = XXXEXIT_TO_EXIT, | 915 | .mismatch = XXXEXIT_TO_SOME_EXIT, |
916 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
900 | }, | 917 | }, |
901 | /* Do not reference cpuexit code/data from memexit code/data */ | 918 | /* Do not reference cpuexit code/data from memexit code/data */ |
902 | { | 919 | { |
903 | .fromsec = { MEM_EXIT_SECTIONS, NULL }, | 920 | .fromsec = { MEM_EXIT_SECTIONS, NULL }, |
904 | .tosec = { CPU_EXIT_SECTIONS, NULL }, | 921 | .tosec = { CPU_EXIT_SECTIONS, NULL }, |
905 | .mismatch = XXXEXIT_TO_EXIT, | 922 | .mismatch = XXXEXIT_TO_SOME_EXIT, |
923 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
906 | }, | 924 | }, |
907 | /* Do not reference memexit code/data from cpuexit code/data */ | 925 | /* Do not reference memexit code/data from cpuexit code/data */ |
908 | { | 926 | { |
909 | .fromsec = { CPU_EXIT_SECTIONS, NULL }, | 927 | .fromsec = { CPU_EXIT_SECTIONS, NULL }, |
910 | .tosec = { MEM_EXIT_SECTIONS, NULL }, | 928 | .tosec = { MEM_EXIT_SECTIONS, NULL }, |
911 | .mismatch = XXXEXIT_TO_EXIT, | 929 | .mismatch = XXXEXIT_TO_SOME_EXIT, |
930 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
912 | }, | 931 | }, |
913 | /* Do not use exit code/data from init code */ | 932 | /* Do not use exit code/data from init code */ |
914 | { | 933 | { |
915 | .fromsec = { ALL_INIT_SECTIONS, NULL }, | 934 | .fromsec = { ALL_INIT_SECTIONS, NULL }, |
916 | .tosec = { ALL_EXIT_SECTIONS, NULL }, | 935 | .tosec = { ALL_EXIT_SECTIONS, NULL }, |
917 | .mismatch = INIT_TO_EXIT, | 936 | .mismatch = ANY_INIT_TO_ANY_EXIT, |
937 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
918 | }, | 938 | }, |
919 | /* Do not use init code/data from exit code */ | 939 | /* Do not use init code/data from exit code */ |
920 | { | 940 | { |
921 | .fromsec = { ALL_EXIT_SECTIONS, NULL }, | 941 | .fromsec = { ALL_EXIT_SECTIONS, NULL }, |
922 | .tosec = { ALL_INIT_SECTIONS, NULL }, | 942 | .tosec = { ALL_INIT_SECTIONS, NULL }, |
923 | .mismatch = EXIT_TO_INIT, | 943 | .mismatch = ANY_EXIT_TO_ANY_INIT, |
944 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
924 | }, | 945 | }, |
925 | /* Do not export init/exit functions or data */ | 946 | /* Do not export init/exit functions or data */ |
926 | { | 947 | { |
927 | .fromsec = { "__ksymtab*", NULL }, | 948 | .fromsec = { "__ksymtab*", NULL }, |
928 | .tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL }, | 949 | .tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL }, |
929 | .mismatch = EXPORT_TO_INIT_EXIT | 950 | .mismatch = EXPORT_TO_INIT_EXIT, |
951 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
930 | } | 952 | } |
931 | }; | 953 | }; |
932 | 954 | ||
933 | static int section_mismatch(const char *fromsec, const char *tosec) | 955 | static const struct sectioncheck *section_mismatch( |
956 | const char *fromsec, const char *tosec) | ||
934 | { | 957 | { |
935 | int i; | 958 | int i; |
936 | int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck); | 959 | int elems = sizeof(sectioncheck) / sizeof(struct sectioncheck); |
@@ -939,10 +962,10 @@ static int section_mismatch(const char *fromsec, const char *tosec) | |||
939 | for (i = 0; i < elems; i++) { | 962 | for (i = 0; i < elems; i++) { |
940 | if (match(fromsec, check->fromsec) && | 963 | if (match(fromsec, check->fromsec) && |
941 | match(tosec, check->tosec)) | 964 | match(tosec, check->tosec)) |
942 | return check->mismatch; | 965 | return check; |
943 | check++; | 966 | check++; |
944 | } | 967 | } |
945 | return NO_MISMATCH; | 968 | return NULL; |
946 | } | 969 | } |
947 | 970 | ||
948 | /** | 971 | /** |
@@ -961,7 +984,7 @@ static int section_mismatch(const char *fromsec, const char *tosec) | |||
961 | * Pattern 2: | 984 | * Pattern 2: |
962 | * Many drivers utilise a *driver container with references to | 985 | * Many drivers utilise a *driver container with references to |
963 | * add, remove, probe functions etc. | 986 | * add, remove, probe functions etc. |
964 | * These functions may often be marked __init and we do not want to | 987 | * These functions may often be marked __devinit and we do not want to |
965 | * warn here. | 988 | * warn here. |
966 | * the pattern is identified by: | 989 | * the pattern is identified by: |
967 | * tosec = init or exit section | 990 | * tosec = init or exit section |
@@ -982,7 +1005,8 @@ static int section_mismatch(const char *fromsec, const char *tosec) | |||
982 | * refsymname = __init_begin, _sinittext, _einittext | 1005 | * refsymname = __init_begin, _sinittext, _einittext |
983 | * | 1006 | * |
984 | **/ | 1007 | **/ |
985 | static int secref_whitelist(const char *fromsec, const char *fromsym, | 1008 | static int secref_whitelist(const struct sectioncheck *mismatch, |
1009 | const char *fromsec, const char *fromsym, | ||
986 | const char *tosec, const char *tosym) | 1010 | const char *tosec, const char *tosym) |
987 | { | 1011 | { |
988 | /* Check for pattern 1 */ | 1012 | /* Check for pattern 1 */ |
@@ -994,7 +1018,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym, | |||
994 | /* Check for pattern 2 */ | 1018 | /* Check for pattern 2 */ |
995 | if (match(tosec, init_exit_sections) && | 1019 | if (match(tosec, init_exit_sections) && |
996 | match(fromsec, data_sections) && | 1020 | match(fromsec, data_sections) && |
997 | match(fromsym, symbol_white_list)) | 1021 | match(fromsym, mismatch->symbol_white_list)) |
998 | return 0; | 1022 | return 0; |
999 | 1023 | ||
1000 | /* Check for pattern 3 */ | 1024 | /* Check for pattern 3 */ |
@@ -1155,7 +1179,8 @@ static int is_function(Elf_Sym *sym) | |||
1155 | * Try to find symbols near it so user can find it. | 1179 | * Try to find symbols near it so user can find it. |
1156 | * Check whitelist before warning - it may be a false positive. | 1180 | * Check whitelist before warning - it may be a false positive. |
1157 | */ | 1181 | */ |
1158 | static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | 1182 | static void report_sec_mismatch(const char *modname, |
1183 | const struct sectioncheck *mismatch, | ||
1159 | const char *fromsec, | 1184 | const char *fromsec, |
1160 | unsigned long long fromaddr, | 1185 | unsigned long long fromaddr, |
1161 | const char *fromsym, | 1186 | const char *fromsym, |
@@ -1186,8 +1211,8 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | |||
1186 | modname, fromsec, fromaddr, from, fromsym, from_p, to, tosec, | 1211 | modname, fromsec, fromaddr, from, fromsym, from_p, to, tosec, |
1187 | tosym, to_p); | 1212 | tosym, to_p); |
1188 | 1213 | ||
1189 | switch (mismatch) { | 1214 | switch (mismatch->mismatch) { |
1190 | case TEXT_TO_INIT: | 1215 | case TEXT_TO_ANY_INIT: |
1191 | fprintf(stderr, | 1216 | fprintf(stderr, |
1192 | "The function %s%s() references\n" | 1217 | "The function %s%s() references\n" |
1193 | "the %s %s%s%s.\n" | 1218 | "the %s %s%s%s.\n" |
@@ -1197,8 +1222,8 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | |||
1197 | to, sec2annotation(tosec), tosym, to_p, | 1222 | to, sec2annotation(tosec), tosym, to_p, |
1198 | fromsym, sec2annotation(tosec), tosym); | 1223 | fromsym, sec2annotation(tosec), tosym); |
1199 | break; | 1224 | break; |
1200 | case DATA_TO_INIT: { | 1225 | case DATA_TO_ANY_INIT: { |
1201 | const char **s = symbol_white_list; | 1226 | const char *const *s = mismatch->symbol_white_list; |
1202 | fprintf(stderr, | 1227 | fprintf(stderr, |
1203 | "The variable %s references\n" | 1228 | "The variable %s references\n" |
1204 | "the %s %s%s%s\n" | 1229 | "the %s %s%s%s\n" |
@@ -1211,15 +1236,15 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | |||
1211 | fprintf(stderr, "\n"); | 1236 | fprintf(stderr, "\n"); |
1212 | break; | 1237 | break; |
1213 | } | 1238 | } |
1214 | case TEXT_TO_EXIT: | 1239 | case TEXT_TO_ANY_EXIT: |
1215 | fprintf(stderr, | 1240 | fprintf(stderr, |
1216 | "The function %s() references a %s in an exit section.\n" | 1241 | "The function %s() references a %s in an exit section.\n" |
1217 | "Often the %s %s%s has valid usage outside the exit section\n" | 1242 | "Often the %s %s%s has valid usage outside the exit section\n" |
1218 | "and the fix is to remove the %sannotation of %s.\n", | 1243 | "and the fix is to remove the %sannotation of %s.\n", |
1219 | fromsym, to, to, tosym, to_p, sec2annotation(tosec), tosym); | 1244 | fromsym, to, to, tosym, to_p, sec2annotation(tosec), tosym); |
1220 | break; | 1245 | break; |
1221 | case DATA_TO_EXIT: { | 1246 | case DATA_TO_ANY_EXIT: { |
1222 | const char **s = symbol_white_list; | 1247 | const char *const *s = mismatch->symbol_white_list; |
1223 | fprintf(stderr, | 1248 | fprintf(stderr, |
1224 | "The variable %s references\n" | 1249 | "The variable %s references\n" |
1225 | "the %s %s%s%s\n" | 1250 | "the %s %s%s%s\n" |
@@ -1232,8 +1257,8 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | |||
1232 | fprintf(stderr, "\n"); | 1257 | fprintf(stderr, "\n"); |
1233 | break; | 1258 | break; |
1234 | } | 1259 | } |
1235 | case XXXINIT_TO_INIT: | 1260 | case XXXINIT_TO_SOME_INIT: |
1236 | case XXXEXIT_TO_EXIT: | 1261 | case XXXEXIT_TO_SOME_EXIT: |
1237 | fprintf(stderr, | 1262 | fprintf(stderr, |
1238 | "The %s %s%s%s references\n" | 1263 | "The %s %s%s%s references\n" |
1239 | "a %s %s%s%s.\n" | 1264 | "a %s %s%s%s.\n" |
@@ -1243,7 +1268,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | |||
1243 | to, sec2annotation(tosec), tosym, to_p, | 1268 | to, sec2annotation(tosec), tosym, to_p, |
1244 | tosym, fromsym, tosym); | 1269 | tosym, fromsym, tosym); |
1245 | break; | 1270 | break; |
1246 | case INIT_TO_EXIT: | 1271 | case ANY_INIT_TO_ANY_EXIT: |
1247 | fprintf(stderr, | 1272 | fprintf(stderr, |
1248 | "The %s %s%s%s references\n" | 1273 | "The %s %s%s%s references\n" |
1249 | "a %s %s%s%s.\n" | 1274 | "a %s %s%s%s.\n" |
@@ -1256,7 +1281,7 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | |||
1256 | to, sec2annotation(tosec), tosym, to_p, | 1281 | to, sec2annotation(tosec), tosym, to_p, |
1257 | sec2annotation(tosec), tosym, to_p); | 1282 | sec2annotation(tosec), tosym, to_p); |
1258 | break; | 1283 | break; |
1259 | case EXIT_TO_INIT: | 1284 | case ANY_EXIT_TO_ANY_INIT: |
1260 | fprintf(stderr, | 1285 | fprintf(stderr, |
1261 | "The %s %s%s%s references\n" | 1286 | "The %s %s%s%s references\n" |
1262 | "a %s %s%s%s.\n" | 1287 | "a %s %s%s%s.\n" |
@@ -1275,8 +1300,6 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch, | |||
1275 | "Fix this by removing the %sannotation of %s " | 1300 | "Fix this by removing the %sannotation of %s " |
1276 | "or drop the export.\n", | 1301 | "or drop the export.\n", |
1277 | tosym, sec2annotation(tosec), sec2annotation(tosec), tosym); | 1302 | tosym, sec2annotation(tosec), sec2annotation(tosec), tosym); |
1278 | case NO_MISMATCH: | ||
1279 | /* To get warnings on missing members */ | ||
1280 | break; | 1303 | break; |
1281 | } | 1304 | } |
1282 | fprintf(stderr, "\n"); | 1305 | fprintf(stderr, "\n"); |
@@ -1286,11 +1309,11 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf, | |||
1286 | Elf_Rela *r, Elf_Sym *sym, const char *fromsec) | 1309 | Elf_Rela *r, Elf_Sym *sym, const char *fromsec) |
1287 | { | 1310 | { |
1288 | const char *tosec; | 1311 | const char *tosec; |
1289 | enum mismatch mismatch; | 1312 | const struct sectioncheck *mismatch; |
1290 | 1313 | ||
1291 | tosec = sec_name(elf, sym->st_shndx); | 1314 | tosec = sec_name(elf, sym->st_shndx); |
1292 | mismatch = section_mismatch(fromsec, tosec); | 1315 | mismatch = section_mismatch(fromsec, tosec); |
1293 | if (mismatch != NO_MISMATCH) { | 1316 | if (mismatch) { |
1294 | Elf_Sym *to; | 1317 | Elf_Sym *to; |
1295 | Elf_Sym *from; | 1318 | Elf_Sym *from; |
1296 | const char *tosym; | 1319 | const char *tosym; |
@@ -1302,7 +1325,8 @@ static void check_section_mismatch(const char *modname, struct elf_info *elf, | |||
1302 | tosym = sym_name(elf, to); | 1325 | tosym = sym_name(elf, to); |
1303 | 1326 | ||
1304 | /* check whitelist - we may ignore it */ | 1327 | /* check whitelist - we may ignore it */ |
1305 | if (secref_whitelist(fromsec, fromsym, tosec, tosym)) { | 1328 | if (secref_whitelist(mismatch, |
1329 | fromsec, fromsym, tosec, tosym)) { | ||
1306 | report_sec_mismatch(modname, mismatch, | 1330 | report_sec_mismatch(modname, mismatch, |
1307 | fromsec, r->r_offset, fromsym, | 1331 | fromsec, r->r_offset, fromsym, |
1308 | is_function(from), tosec, tosym, | 1332 | is_function(from), tosec, tosym, |
diff --git a/scripts/namespace.pl b/scripts/namespace.pl index c6e88c652c2f..361d0f71184b 100755 --- a/scripts/namespace.pl +++ b/scripts/namespace.pl | |||
@@ -175,12 +175,11 @@ sub do_nm | |||
175 | } | 175 | } |
176 | if (! -e "$source.c" && ! -e "$source.S") { | 176 | if (! -e "$source.c" && ! -e "$source.S") { |
177 | # No obvious source, exclude the object if it is conglomerate | 177 | # No obvious source, exclude the object if it is conglomerate |
178 | if (! open(OBJDUMPDATA, "$objdump $basename|")) { | 178 | open(my $objdumpdata, "$objdump $basename|") |
179 | printf STDERR "$objdump $fullname failed $!\n"; | 179 | or die "$objdump $fullname failed $!\n"; |
180 | return; | 180 | |
181 | } | ||
182 | my $comment; | 181 | my $comment; |
183 | while (<OBJDUMPDATA>) { | 182 | while (<$objdumpdata>) { |
184 | chomp(); | 183 | chomp(); |
185 | if (/^In archive/) { | 184 | if (/^In archive/) { |
186 | # Archives are always conglomerate | 185 | # Archives are always conglomerate |
@@ -190,18 +189,18 @@ sub do_nm | |||
190 | next if (! /^[ 0-9a-f]{5,} /); | 189 | next if (! /^[ 0-9a-f]{5,} /); |
191 | $comment .= substr($_, 43); | 190 | $comment .= substr($_, 43); |
192 | } | 191 | } |
193 | close(OBJDUMPDATA); | 192 | close($objdumpdata); |
193 | |||
194 | if (!defined($comment) || $comment !~ /GCC\:.*GCC\:/m) { | 194 | if (!defined($comment) || $comment !~ /GCC\:.*GCC\:/m) { |
195 | printf STDERR "No source file found for $fullname\n"; | 195 | printf STDERR "No source file found for $fullname\n"; |
196 | } | 196 | } |
197 | return; | 197 | return; |
198 | } | 198 | } |
199 | if (! open(NMDATA, "$nm $basename|")) { | 199 | open (my $nmdata, "$nm $basename|") |
200 | printf STDERR "$nm $fullname failed $!\n"; | 200 | or die "$nm $fullname failed $!\n"; |
201 | return; | 201 | |
202 | } | ||
203 | my @nmdata; | 202 | my @nmdata; |
204 | while (<NMDATA>) { | 203 | while (<$nmdata>) { |
205 | chop; | 204 | chop; |
206 | ($type, $name) = (split(/ +/, $_, 3))[1..2]; | 205 | ($type, $name) = (split(/ +/, $_, 3))[1..2]; |
207 | # Expected types | 206 | # Expected types |
@@ -268,7 +267,8 @@ sub do_nm | |||
268 | } | 267 | } |
269 | } | 268 | } |
270 | } | 269 | } |
271 | close(NMDATA); | 270 | close($nmdata); |
271 | |||
272 | if ($#nmdata < 0) { | 272 | if ($#nmdata < 0) { |
273 | if ( | 273 | if ( |
274 | $fullname ne "lib/brlock.o" | 274 | $fullname ne "lib/brlock.o" |
@@ -316,8 +316,7 @@ sub drop_def | |||
316 | 316 | ||
317 | sub list_multiply_defined | 317 | sub list_multiply_defined |
318 | { | 318 | { |
319 | my ($name, $module); | 319 | foreach my $name (keys(%def)) { |
320 | foreach $name (keys(%def)) { | ||
321 | if ($#{$def{$name}} > 0) { | 320 | if ($#{$def{$name}} > 0) { |
322 | # Special case for cond_syscall | 321 | # Special case for cond_syscall |
323 | if ($#{$def{$name}} == 1 && $name =~ /^sys_/ && | 322 | if ($#{$def{$name}} == 1 && $name =~ /^sys_/ && |
@@ -333,8 +332,9 @@ sub list_multiply_defined | |||
333 | &drop_def("arch/x86/kernel/vsyscall-sysenter_32.o", $name); | 332 | &drop_def("arch/x86/kernel/vsyscall-sysenter_32.o", $name); |
334 | next; | 333 | next; |
335 | } | 334 | } |
335 | |||
336 | printf "$name is multiply defined in :-\n"; | 336 | printf "$name is multiply defined in :-\n"; |
337 | foreach $module (@{$def{$name}}) { | 337 | foreach my $module (@{$def{$name}}) { |
338 | printf "\t$module\n"; | 338 | printf "\t$module\n"; |
339 | } | 339 | } |
340 | } | 340 | } |
@@ -343,12 +343,13 @@ sub list_multiply_defined | |||
343 | 343 | ||
344 | sub resolve_external_references | 344 | sub resolve_external_references |
345 | { | 345 | { |
346 | my ($object, $type, $name, $i, $j, $kstrtab, $ksymtab, $export); | 346 | my ($kstrtab, $ksymtab, $export); |
347 | |||
347 | printf "\n"; | 348 | printf "\n"; |
348 | foreach $object (keys(%nmdata)) { | 349 | foreach my $object (keys(%nmdata)) { |
349 | my $nmdata = $nmdata{$object}; | 350 | my $nmdata = $nmdata{$object}; |
350 | for ($i = 0; $i <= $#{$nmdata}; ++$i) { | 351 | for (my $i = 0; $i <= $#{$nmdata}; ++$i) { |
351 | ($type, $name) = split(' ', $nmdata->[$i], 2); | 352 | my ($type, $name) = split(' ', $nmdata->[$i], 2); |
352 | if ($type eq "U" || $type eq "w") { | 353 | if ($type eq "U" || $type eq "w") { |
353 | if (exists($def{$name}) || exists($ksymtab{$name})) { | 354 | if (exists($def{$name}) || exists($ksymtab{$name})) { |
354 | # add the owning object to the nmdata | 355 | # add the owning object to the nmdata |
@@ -357,7 +358,7 @@ sub resolve_external_references | |||
357 | $kstrtab = "R __kstrtab_$name"; | 358 | $kstrtab = "R __kstrtab_$name"; |
358 | $ksymtab = "R __ksymtab_$name"; | 359 | $ksymtab = "R __ksymtab_$name"; |
359 | $export = 0; | 360 | $export = 0; |
360 | for ($j = 0; $j <= $#{$nmdata}; ++$j) { | 361 | for (my $j = 0; $j <= $#{$nmdata}; ++$j) { |
361 | if ($nmdata->[$j] eq $kstrtab || | 362 | if ($nmdata->[$j] eq $kstrtab || |
362 | $nmdata->[$j] eq $ksymtab) { | 363 | $nmdata->[$j] eq $ksymtab) { |
363 | $export = 1; | 364 | $export = 1; |
@@ -424,11 +425,11 @@ sub resolve_external_references | |||
424 | sub list_extra_externals | 425 | sub list_extra_externals |
425 | { | 426 | { |
426 | my %noref = (); | 427 | my %noref = (); |
427 | my ($name, @module, $module, $export); | 428 | |
428 | foreach $name (keys(%def)) { | 429 | foreach my $name (keys(%def)) { |
429 | if (! exists($ref{$name})) { | 430 | if (! exists($ref{$name})) { |
430 | @module = @{$def{$name}}; | 431 | my @module = @{$def{$name}}; |
431 | foreach $module (@module) { | 432 | foreach my $module (@module) { |
432 | if (! exists($noref{$module})) { | 433 | if (! exists($noref{$module})) { |
433 | $noref{$module} = []; | 434 | $noref{$module} = []; |
434 | } | 435 | } |
@@ -438,16 +439,16 @@ sub list_extra_externals | |||
438 | } | 439 | } |
439 | if (%noref) { | 440 | if (%noref) { |
440 | printf "\nExternally defined symbols with no external references\n"; | 441 | printf "\nExternally defined symbols with no external references\n"; |
441 | foreach $module (sort(keys(%noref))) { | 442 | foreach my $module (sort(keys(%noref))) { |
442 | printf " $module\n"; | 443 | printf " $module\n"; |
443 | foreach (sort(@{$noref{$module}})) { | 444 | foreach (sort(@{$noref{$module}})) { |
444 | if (exists($export{$_})) { | 445 | my $export; |
445 | $export = " (export only)"; | 446 | if (exists($export{$_})) { |
446 | } | 447 | $export = " (export only)"; |
447 | else { | 448 | } else { |
448 | $export = ""; | 449 | $export = ""; |
449 | } | 450 | } |
450 | printf " $_$export\n"; | 451 | printf " $_$export\n"; |
451 | } | 452 | } |
452 | } | 453 | } |
453 | } | 454 | } |
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 8b357b0bd250..07f2fbde2abf 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
@@ -18,6 +18,8 @@ create_package() { | |||
18 | cp debian/copyright "$pdir/usr/share/doc/$pname/" | 18 | cp debian/copyright "$pdir/usr/share/doc/$pname/" |
19 | cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian" | 19 | cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian" |
20 | gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian" | 20 | gzip -9 "$pdir/usr/share/doc/$pname/changelog.Debian" |
21 | sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \ | ||
22 | | xargs -r0 md5sum > DEBIAN/md5sums" | ||
21 | 23 | ||
22 | # Fix ownership and permissions | 24 | # Fix ownership and permissions |
23 | chown -R root:root "$pdir" | 25 | chown -R root:root "$pdir" |
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index fa27f3dac769..15440f55aef6 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -39,7 +39,7 @@ if ! $PREBUILT; then | |||
39 | echo "Source: kernel-$__KERNELRELEASE.tar.gz" | 39 | echo "Source: kernel-$__KERNELRELEASE.tar.gz" |
40 | fi | 40 | fi |
41 | 41 | ||
42 | echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root" | 42 | echo "BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root" |
43 | echo "Provides: $PROVIDES" | 43 | echo "Provides: $PROVIDES" |
44 | echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :" | 44 | echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :" |
45 | echo "%define debug_package %{nil}" | 45 | echo "%define debug_package %{nil}" |
diff --git a/scripts/profile2linkerlist.pl b/scripts/profile2linkerlist.pl index cb4260ebdb91..6943fa7cc95b 100644 --- a/scripts/profile2linkerlist.pl +++ b/scripts/profile2linkerlist.pl | |||
@@ -7,15 +7,13 @@ | |||
7 | # usage: | 7 | # usage: |
8 | # readprofile | sort -rn | perl profile2linkerlist.pl > functionlist | 8 | # readprofile | sort -rn | perl profile2linkerlist.pl > functionlist |
9 | # | 9 | # |
10 | use strict; | ||
10 | 11 | ||
11 | while (<>) { | 12 | while (<>) { |
12 | my $line = $_; | 13 | my $line = $_; |
13 | 14 | ||
14 | $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/; | 15 | $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/; |
15 | 16 | ||
16 | if ( ($line =~ /unknown/) || ($line =~ /total/)) { | 17 | print "*(.text.$1)\n" |
17 | 18 | unless ($line =~ /unknown/) || ($line =~ /total/); | |
18 | } else { | ||
19 | print "*(.text.$1)\n"; | ||
20 | } | ||
21 | } | 19 | } |
diff --git a/scripts/rt-tester/rt-tester.py b/scripts/rt-tester/rt-tester.py index 4c79660793cf..44423b4dcb82 100644 --- a/scripts/rt-tester/rt-tester.py +++ b/scripts/rt-tester/rt-tester.py | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/python |
2 | # | 2 | # |
3 | # rt-mutex tester | 3 | # rt-mutex tester |
4 | # | 4 | # |
diff --git a/scripts/show_delta b/scripts/show_delta index 48a706ab3d0c..17df3051747a 100755 --- a/scripts/show_delta +++ b/scripts/show_delta | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/python |
2 | # | 2 | # |
3 | # show_deltas: Read list of printk messages instrumented with | 3 | # show_deltas: Read list of printk messages instrumented with |
4 | # time data, and format with time deltas. | 4 | # time data, and format with time deltas. |
diff --git a/scripts/tags.sh b/scripts/tags.sh index 1a0c44d7c4a7..8509bb512935 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
@@ -5,7 +5,7 @@ | |||
5 | # mode may be any of: tags, TAGS, cscope | 5 | # mode may be any of: tags, TAGS, cscope |
6 | # | 6 | # |
7 | # Uses the following environment variables: | 7 | # Uses the following environment variables: |
8 | # ARCH, SUBARCH, srctree, src, obj | 8 | # ARCH, SUBARCH, SRCARCH, srctree, src, obj |
9 | 9 | ||
10 | if [ "$KBUILD_VERBOSE" = "1" ]; then | 10 | if [ "$KBUILD_VERBOSE" = "1" ]; then |
11 | set -x | 11 | set -x |
@@ -17,28 +17,48 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \ | |||
17 | -name .git ) \ | 17 | -name .git ) \ |
18 | -prune -o" | 18 | -prune -o" |
19 | 19 | ||
20 | # Do not use full path is we do not use O=.. builds | 20 | # Do not use full path if we do not use O=.. builds |
21 | # Use make O=. {tags|cscope} | ||
22 | # to force full paths for a non-O= build | ||
21 | if [ "${KBUILD_SRC}" = "" ]; then | 23 | if [ "${KBUILD_SRC}" = "" ]; then |
22 | tree= | 24 | tree= |
23 | else | 25 | else |
24 | tree=${srctree}/ | 26 | tree=${srctree}/ |
25 | fi | 27 | fi |
26 | 28 | ||
29 | # Find all available archs | ||
30 | find_all_archs() | ||
31 | { | ||
32 | ALLSOURCE_ARCHS="" | ||
33 | for arch in `ls ${tree}arch`; do | ||
34 | ALLSOURCE_ARCHS="${ALLSOURCE_ARCHS} "${arch##\/} | ||
35 | done | ||
36 | } | ||
37 | |||
27 | # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH | 38 | # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH |
28 | if [ "${ALLSOURCE_ARCHS}" = "" ]; then | 39 | if [ "${ALLSOURCE_ARCHS}" = "" ]; then |
29 | ALLSOURCE_ARCHS=${SRCARCH} | 40 | ALLSOURCE_ARCHS=${SRCARCH} |
41 | elif [ "${ALLSOURCE_ARCHS}" = "all" ]; then | ||
42 | find_all_archs | ||
30 | fi | 43 | fi |
31 | 44 | ||
32 | # find sources in arch/$ARCH | 45 | # find sources in arch/$ARCH |
33 | find_arch_sources() | 46 | find_arch_sources() |
34 | { | 47 | { |
35 | find ${tree}arch/$1 $ignore -name "$2" -print; | 48 | for i in $archincludedir; do |
49 | prune="$prune -wholename $i -prune -o" | ||
50 | done | ||
51 | find ${tree}arch/$1 $ignore $prune -name "$2" -print; | ||
36 | } | 52 | } |
37 | 53 | ||
38 | # find sources in arch/$1/include | 54 | # find sources in arch/$1/include |
39 | find_arch_include_sources() | 55 | find_arch_include_sources() |
40 | { | 56 | { |
41 | find ${tree}arch/$1/include $ignore -name "$2" -print; | 57 | include=$(find ${tree}arch/$1/ -name include -type d); |
58 | if [ -n "$include" ]; then | ||
59 | archincludedir="$archincludedir $include" | ||
60 | find $include $ignore -name "$2" -print; | ||
61 | fi | ||
42 | } | 62 | } |
43 | 63 | ||
44 | # find sources in include/ | 64 | # find sources in include/ |
@@ -63,14 +83,15 @@ find_sources() | |||
63 | 83 | ||
64 | all_sources() | 84 | all_sources() |
65 | { | 85 | { |
66 | for arch in $ALLSOURCE_ARCHS | 86 | find_arch_include_sources ${SRCARCH} '*.[chS]' |
67 | do | ||
68 | find_sources $arch '*.[chS]' | ||
69 | done | ||
70 | if [ ! -z "$archinclude" ]; then | 87 | if [ ! -z "$archinclude" ]; then |
71 | find_arch_include_sources $archinclude '*.[chS]' | 88 | find_arch_include_sources $archinclude '*.[chS]' |
72 | fi | 89 | fi |
73 | find_include_sources '*.[chS]' | 90 | find_include_sources '*.[chS]' |
91 | for arch in $ALLSOURCE_ARCHS | ||
92 | do | ||
93 | find_sources $arch '*.[chS]' | ||
94 | done | ||
74 | find_other_sources '*.[chS]' | 95 | find_other_sources '*.[chS]' |
75 | } | 96 | } |
76 | 97 | ||
@@ -89,13 +110,7 @@ all_defconfigs() | |||
89 | 110 | ||
90 | docscope() | 111 | docscope() |
91 | { | 112 | { |
92 | # always use absolute paths for cscope, as recommended by cscope | 113 | (echo \-k; echo \-q; all_sources) > cscope.files |
93 | # upstream | ||
94 | case "$tree" in | ||
95 | /*) ;; | ||
96 | *) tree=$PWD/$tree ;; | ||
97 | esac | ||
98 | (cd /; echo \-k; echo \-q; all_sources) > cscope.files | ||
99 | cscope -b -f cscope.out | 114 | cscope -b -f cscope.out |
100 | } | 115 | } |
101 | 116 | ||
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index e42ab999d0f2..1df25cf5ce38 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -1913,11 +1913,11 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) | |||
1913 | if (WARN_ONCE(!azx_dev->period_bytes, | 1913 | if (WARN_ONCE(!azx_dev->period_bytes, |
1914 | "hda-intel: zero azx_dev->period_bytes")) | 1914 | "hda-intel: zero azx_dev->period_bytes")) |
1915 | return -1; /* this shouldn't happen! */ | 1915 | return -1; /* this shouldn't happen! */ |
1916 | if (wallclk <= azx_dev->period_wallclk && | 1916 | if (wallclk < (azx_dev->period_wallclk * 5) / 4 && |
1917 | pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) | 1917 | pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) |
1918 | /* NG - it's below the first next period boundary */ | 1918 | /* NG - it's below the first next period boundary */ |
1919 | return bdl_pos_adj[chip->dev_index] ? 0 : -1; | 1919 | return bdl_pos_adj[chip->dev_index] ? 0 : -1; |
1920 | azx_dev->start_wallclk = wallclk; | 1920 | azx_dev->start_wallclk += wallclk; |
1921 | return 1; /* OK, it's fine */ | 1921 | return 1; /* OK, it's fine */ |
1922 | } | 1922 | } |
1923 | 1923 | ||