aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
commitcf9b59e9d3e008591d1f54830f570982bb307a0d (patch)
tree113478ce8fd8c832ba726ffdf59b82cb46356476 /arch/microblaze
parent44504b2bebf8b5823c59484e73096a7d6574471d (diff)
parentf4b87dee923342505e1ddba8d34ce9de33e75050 (diff)
Merge remote branch 'origin' into secretlab/next-devicetree
Merging in current state of Linus' tree to deal with merge conflicts and build failures in vio.c after merge. Conflicts: drivers/i2c/busses/i2c-cpm.c drivers/i2c/busses/i2c-mpc.c drivers/net/gianfar.c Also fixed up one line in arch/powerpc/kernel/vio.c to use the correct node pointer. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/configs/mmu_defconfig58
-rw-r--r--arch/microblaze/configs/nommu_defconfig39
-rw-r--r--arch/microblaze/include/asm/cache.h2
-rw-r--r--arch/microblaze/include/asm/dma.h6
-rw-r--r--arch/microblaze/include/asm/exceptions.h6
-rw-r--r--arch/microblaze/include/asm/io.h2
-rw-r--r--arch/microblaze/include/asm/page.h12
-rw-r--r--arch/microblaze/include/asm/pci.h8
-rw-r--r--arch/microblaze/include/asm/pgalloc.h16
-rw-r--r--arch/microblaze/include/asm/pgtable.h35
-rw-r--r--arch/microblaze/include/asm/system.h11
-rw-r--r--arch/microblaze/include/asm/thread_info.h2
-rw-r--r--arch/microblaze/include/asm/uaccess.h87
-rw-r--r--arch/microblaze/kernel/asm-offsets.c1
-rw-r--r--arch/microblaze/kernel/cpu/cache.c75
-rw-r--r--arch/microblaze/kernel/cpu/mb.c10
-rw-r--r--arch/microblaze/kernel/dma.c2
-rw-r--r--arch/microblaze/kernel/entry-nommu.S2
-rw-r--r--arch/microblaze/kernel/exceptions.c2
-rw-r--r--arch/microblaze/kernel/head.S3
-rw-r--r--arch/microblaze/kernel/irq.c3
-rw-r--r--arch/microblaze/kernel/microblaze_ksyms.c11
-rw-r--r--arch/microblaze/kernel/misc.S36
-rw-r--r--arch/microblaze/kernel/module.c2
-rw-r--r--arch/microblaze/kernel/traps.c34
-rw-r--r--arch/microblaze/kernel/vmlinux.lds.S3
-rw-r--r--arch/microblaze/mm/consistent.c190
-rw-r--r--arch/microblaze/mm/fault.c13
-rw-r--r--arch/microblaze/mm/init.c1
-rw-r--r--arch/microblaze/mm/pgtable.c52
-rw-r--r--arch/microblaze/pci/pci-common.c19
31 files changed, 379 insertions, 364 deletions
diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig
index 6fced1fe3bf0..3c91cf6192c6 100644
--- a/arch/microblaze/configs/mmu_defconfig
+++ b/arch/microblaze/configs/mmu_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc6 3# Linux kernel version: 2.6.34-rc6
4# Wed Feb 3 10:02:59 2010 4# Thu May 6 11:22:14 2010
5# 5#
6CONFIG_MICROBLAZE=y 6CONFIG_MICROBLAZE=y
7# CONFIG_SWAP is not set 7# CONFIG_SWAP is not set
@@ -22,8 +22,6 @@ CONFIG_GENERIC_CSUM=y
22CONFIG_STACKTRACE_SUPPORT=y 22CONFIG_STACKTRACE_SUPPORT=y
23CONFIG_LOCKDEP_SUPPORT=y 23CONFIG_LOCKDEP_SUPPORT=y
24CONFIG_HAVE_LATENCYTOP_SUPPORT=y 24CONFIG_HAVE_LATENCYTOP_SUPPORT=y
25# CONFIG_PCI is not set
26CONFIG_NO_DMA=y
27CONFIG_DTC=y 25CONFIG_DTC=y
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29CONFIG_CONSTRUCTORS=y 27CONFIG_CONSTRUCTORS=y
@@ -56,7 +54,6 @@ CONFIG_RCU_FANOUT=32
56CONFIG_IKCONFIG=y 54CONFIG_IKCONFIG=y
57CONFIG_IKCONFIG_PROC=y 55CONFIG_IKCONFIG_PROC=y
58CONFIG_LOG_BUF_SHIFT=17 56CONFIG_LOG_BUF_SHIFT=17
59# CONFIG_GROUP_SCHED is not set
60# CONFIG_CGROUPS is not set 57# CONFIG_CGROUPS is not set
61CONFIG_SYSFS_DEPRECATED=y 58CONFIG_SYSFS_DEPRECATED=y
62CONFIG_SYSFS_DEPRECATED_V2=y 59CONFIG_SYSFS_DEPRECATED_V2=y
@@ -106,6 +103,8 @@ CONFIG_SLAB=y
106# CONFIG_SLOB is not set 103# CONFIG_SLOB is not set
107# CONFIG_PROFILING is not set 104# CONFIG_PROFILING is not set
108CONFIG_HAVE_OPROFILE=y 105CONFIG_HAVE_OPROFILE=y
106CONFIG_HAVE_DMA_ATTRS=y
107CONFIG_HAVE_DMA_API_DEBUG=y
109 108
110# 109#
111# GCOV-based kernel profiling 110# GCOV-based kernel profiling
@@ -245,13 +244,20 @@ CONFIG_BINFMT_ELF=y
245# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 244# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
246# CONFIG_HAVE_AOUT is not set 245# CONFIG_HAVE_AOUT is not set
247# CONFIG_BINFMT_MISC is not set 246# CONFIG_BINFMT_MISC is not set
247
248#
249# Bus Options
250#
251# CONFIG_PCI is not set
252# CONFIG_PCI_DOMAINS is not set
253# CONFIG_PCI_SYSCALL is not set
254# CONFIG_ARCH_SUPPORTS_MSI is not set
248CONFIG_NET=y 255CONFIG_NET=y
249 256
250# 257#
251# Networking options 258# Networking options
252# 259#
253CONFIG_PACKET=y 260CONFIG_PACKET=y
254# CONFIG_PACKET_MMAP is not set
255CONFIG_UNIX=y 261CONFIG_UNIX=y
256CONFIG_XFRM=y 262CONFIG_XFRM=y
257# CONFIG_XFRM_USER is not set 263# CONFIG_XFRM_USER is not set
@@ -341,7 +347,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
341# CONFIG_SYS_HYPERVISOR is not set 347# CONFIG_SYS_HYPERVISOR is not set
342# CONFIG_CONNECTOR is not set 348# CONFIG_CONNECTOR is not set
343# CONFIG_MTD is not set 349# CONFIG_MTD is not set
350CONFIG_OF_FLATTREE=y
344CONFIG_OF_DEVICE=y 351CONFIG_OF_DEVICE=y
352CONFIG_OF_MDIO=y
345# CONFIG_PARPORT is not set 353# CONFIG_PARPORT is not set
346CONFIG_BLK_DEV=y 354CONFIG_BLK_DEV=y
347# CONFIG_BLK_DEV_COW_COMMON is not set 355# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -370,6 +378,7 @@ CONFIG_MISC_DEVICES=y
370# 378#
371# SCSI device support 379# SCSI device support
372# 380#
381CONFIG_SCSI_MOD=y
373# CONFIG_RAID_ATTRS is not set 382# CONFIG_RAID_ATTRS is not set
374# CONFIG_SCSI is not set 383# CONFIG_SCSI is not set
375# CONFIG_SCSI_DMA is not set 384# CONFIG_SCSI_DMA is not set
@@ -383,9 +392,30 @@ CONFIG_NETDEVICES=y
383# CONFIG_EQUALIZER is not set 392# CONFIG_EQUALIZER is not set
384# CONFIG_TUN is not set 393# CONFIG_TUN is not set
385# CONFIG_VETH is not set 394# CONFIG_VETH is not set
386# CONFIG_PHYLIB is not set 395CONFIG_PHYLIB=y
396
397#
398# MII PHY device drivers
399#
400# CONFIG_MARVELL_PHY is not set
401# CONFIG_DAVICOM_PHY is not set
402# CONFIG_QSEMI_PHY is not set
403# CONFIG_LXT_PHY is not set
404# CONFIG_CICADA_PHY is not set
405# CONFIG_VITESSE_PHY is not set
406# CONFIG_SMSC_PHY is not set
407# CONFIG_BROADCOM_PHY is not set
408# CONFIG_ICPLUS_PHY is not set
409# CONFIG_REALTEK_PHY is not set
410# CONFIG_NATIONAL_PHY is not set
411# CONFIG_STE10XP is not set
412# CONFIG_LSI_ET1011C_PHY is not set
413# CONFIG_MICREL_PHY is not set
414# CONFIG_FIXED_PHY is not set
415# CONFIG_MDIO_BITBANG is not set
387CONFIG_NET_ETHERNET=y 416CONFIG_NET_ETHERNET=y
388# CONFIG_MII is not set 417# CONFIG_MII is not set
418# CONFIG_ETHOC is not set
389# CONFIG_DNET is not set 419# CONFIG_DNET is not set
390# CONFIG_IBM_NEW_EMAC_ZMII is not set 420# CONFIG_IBM_NEW_EMAC_ZMII is not set
391# CONFIG_IBM_NEW_EMAC_RGMII is not set 421# CONFIG_IBM_NEW_EMAC_RGMII is not set
@@ -394,6 +424,7 @@ CONFIG_NET_ETHERNET=y
394# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 424# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
395# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 425# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
396# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 426# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
427# CONFIG_B44 is not set
397# CONFIG_KS8842 is not set 428# CONFIG_KS8842 is not set
398# CONFIG_KS8851_MLL is not set 429# CONFIG_KS8851_MLL is not set
399CONFIG_XILINX_EMACLITE=y 430CONFIG_XILINX_EMACLITE=y
@@ -444,6 +475,7 @@ CONFIG_SERIAL_UARTLITE=y
444CONFIG_SERIAL_UARTLITE_CONSOLE=y 475CONFIG_SERIAL_UARTLITE_CONSOLE=y
445CONFIG_SERIAL_CORE=y 476CONFIG_SERIAL_CORE=y
446CONFIG_SERIAL_CORE_CONSOLE=y 477CONFIG_SERIAL_CORE_CONSOLE=y
478# CONFIG_SERIAL_TIMBERDALE is not set
447# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set 479# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set
448CONFIG_UNIX98_PTYS=y 480CONFIG_UNIX98_PTYS=y
449# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set 481# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
@@ -471,6 +503,12 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
471# CONFIG_HWMON is not set 503# CONFIG_HWMON is not set
472# CONFIG_THERMAL is not set 504# CONFIG_THERMAL is not set
473# CONFIG_WATCHDOG is not set 505# CONFIG_WATCHDOG is not set
506CONFIG_SSB_POSSIBLE=y
507
508#
509# Sonics Silicon Backplane
510#
511# CONFIG_SSB is not set
474 512
475# 513#
476# Multifunction device drivers 514# Multifunction device drivers
@@ -502,6 +540,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
502# CONFIG_NEW_LEDS is not set 540# CONFIG_NEW_LEDS is not set
503# CONFIG_ACCESSIBILITY is not set 541# CONFIG_ACCESSIBILITY is not set
504# CONFIG_RTC_CLASS is not set 542# CONFIG_RTC_CLASS is not set
543# CONFIG_DMADEVICES is not set
505# CONFIG_AUXDISPLAY is not set 544# CONFIG_AUXDISPLAY is not set
506# CONFIG_UIO is not set 545# CONFIG_UIO is not set
507 546
@@ -572,6 +611,7 @@ CONFIG_MISC_FILESYSTEMS=y
572# CONFIG_BEFS_FS is not set 611# CONFIG_BEFS_FS is not set
573# CONFIG_BFS_FS is not set 612# CONFIG_BFS_FS is not set
574# CONFIG_EFS_FS is not set 613# CONFIG_EFS_FS is not set
614# CONFIG_LOGFS is not set
575# CONFIG_CRAMFS is not set 615# CONFIG_CRAMFS is not set
576# CONFIG_SQUASHFS is not set 616# CONFIG_SQUASHFS is not set
577# CONFIG_VXFS_FS is not set 617# CONFIG_VXFS_FS is not set
@@ -595,6 +635,7 @@ CONFIG_SUNRPC=y
595# CONFIG_RPCSEC_GSS_KRB5 is not set 635# CONFIG_RPCSEC_GSS_KRB5 is not set
596# CONFIG_RPCSEC_GSS_SPKM3 is not set 636# CONFIG_RPCSEC_GSS_SPKM3 is not set
597# CONFIG_SMB_FS is not set 637# CONFIG_SMB_FS is not set
638# CONFIG_CEPH_FS is not set
598CONFIG_CIFS=y 639CONFIG_CIFS=y
599CONFIG_CIFS_STATS=y 640CONFIG_CIFS_STATS=y
600CONFIG_CIFS_STATS2=y 641CONFIG_CIFS_STATS2=y
@@ -696,6 +737,7 @@ CONFIG_SCHED_DEBUG=y
696# CONFIG_DEBUG_OBJECTS is not set 737# CONFIG_DEBUG_OBJECTS is not set
697CONFIG_DEBUG_SLAB=y 738CONFIG_DEBUG_SLAB=y
698# CONFIG_DEBUG_SLAB_LEAK is not set 739# CONFIG_DEBUG_SLAB_LEAK is not set
740# CONFIG_DEBUG_KMEMLEAK is not set
699CONFIG_DEBUG_SPINLOCK=y 741CONFIG_DEBUG_SPINLOCK=y
700# CONFIG_DEBUG_MUTEXES is not set 742# CONFIG_DEBUG_MUTEXES is not set
701# CONFIG_DEBUG_LOCK_ALLOC is not set 743# CONFIG_DEBUG_LOCK_ALLOC is not set
@@ -741,6 +783,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
741# CONFIG_KMEMTRACE is not set 783# CONFIG_KMEMTRACE is not set
742# CONFIG_WORKQUEUE_TRACER is not set 784# CONFIG_WORKQUEUE_TRACER is not set
743# CONFIG_BLK_DEV_IO_TRACE is not set 785# CONFIG_BLK_DEV_IO_TRACE is not set
786# CONFIG_DMA_API_DEBUG is not set
744# CONFIG_SAMPLES is not set 787# CONFIG_SAMPLES is not set
745CONFIG_EARLY_PRINTK=y 788CONFIG_EARLY_PRINTK=y
746# CONFIG_HEART_BEAT is not set 789# CONFIG_HEART_BEAT is not set
@@ -862,5 +905,6 @@ CONFIG_ZLIB_INFLATE=y
862CONFIG_DECOMPRESS_GZIP=y 905CONFIG_DECOMPRESS_GZIP=y
863CONFIG_HAS_IOMEM=y 906CONFIG_HAS_IOMEM=y
864CONFIG_HAS_IOPORT=y 907CONFIG_HAS_IOPORT=y
908CONFIG_HAS_DMA=y
865CONFIG_HAVE_LMB=y 909CONFIG_HAVE_LMB=y
866CONFIG_NLATTR=y 910CONFIG_NLATTR=y
diff --git a/arch/microblaze/configs/nommu_defconfig b/arch/microblaze/configs/nommu_defconfig
index ce2da535246a..dd3a494257f4 100644
--- a/arch/microblaze/configs/nommu_defconfig
+++ b/arch/microblaze/configs/nommu_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc6 3# Linux kernel version: 2.6.34-rc6
4# Wed Feb 3 10:03:21 2010 4# Thu May 6 11:25:12 2010
5# 5#
6CONFIG_MICROBLAZE=y 6CONFIG_MICROBLAZE=y
7# CONFIG_SWAP is not set 7# CONFIG_SWAP is not set
@@ -22,8 +22,6 @@ CONFIG_GENERIC_CSUM=y
22CONFIG_STACKTRACE_SUPPORT=y 22CONFIG_STACKTRACE_SUPPORT=y
23CONFIG_LOCKDEP_SUPPORT=y 23CONFIG_LOCKDEP_SUPPORT=y
24CONFIG_HAVE_LATENCYTOP_SUPPORT=y 24CONFIG_HAVE_LATENCYTOP_SUPPORT=y
25# CONFIG_PCI is not set
26CONFIG_NO_DMA=y
27CONFIG_DTC=y 25CONFIG_DTC=y
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29CONFIG_CONSTRUCTORS=y 27CONFIG_CONSTRUCTORS=y
@@ -58,7 +56,6 @@ CONFIG_RCU_FANOUT=32
58CONFIG_IKCONFIG=y 56CONFIG_IKCONFIG=y
59CONFIG_IKCONFIG_PROC=y 57CONFIG_IKCONFIG_PROC=y
60CONFIG_LOG_BUF_SHIFT=17 58CONFIG_LOG_BUF_SHIFT=17
61# CONFIG_GROUP_SCHED is not set
62# CONFIG_CGROUPS is not set 59# CONFIG_CGROUPS is not set
63CONFIG_SYSFS_DEPRECATED=y 60CONFIG_SYSFS_DEPRECATED=y
64CONFIG_SYSFS_DEPRECATED_V2=y 61CONFIG_SYSFS_DEPRECATED_V2=y
@@ -96,6 +93,8 @@ CONFIG_SLAB=y
96# CONFIG_MMAP_ALLOW_UNINITIALIZED is not set 93# CONFIG_MMAP_ALLOW_UNINITIALIZED is not set
97# CONFIG_PROFILING is not set 94# CONFIG_PROFILING is not set
98CONFIG_HAVE_OPROFILE=y 95CONFIG_HAVE_OPROFILE=y
96CONFIG_HAVE_DMA_ATTRS=y
97CONFIG_HAVE_DMA_API_DEBUG=y
99 98
100# 99#
101# GCOV-based kernel profiling 100# GCOV-based kernel profiling
@@ -209,11 +208,14 @@ CONFIG_PROC_DEVICETREE=y
209# 208#
210# Advanced setup 209# Advanced setup
211# 210#
211# CONFIG_ADVANCED_OPTIONS is not set
212 212
213# 213#
214# Default settings for advanced configuration options are used 214# Default settings for advanced configuration options are used
215# 215#
216CONFIG_LOWMEM_SIZE=0x30000000
216CONFIG_KERNEL_START=0x90000000 217CONFIG_KERNEL_START=0x90000000
218CONFIG_TASK_SIZE=0x80000000
217CONFIG_SELECT_MEMORY_MODEL=y 219CONFIG_SELECT_MEMORY_MODEL=y
218CONFIG_FLATMEM_MANUAL=y 220CONFIG_FLATMEM_MANUAL=y
219# CONFIG_DISCONTIGMEM_MANUAL is not set 221# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -235,13 +237,20 @@ CONFIG_BINFMT_FLAT=y
235# CONFIG_BINFMT_SHARED_FLAT is not set 237# CONFIG_BINFMT_SHARED_FLAT is not set
236# CONFIG_HAVE_AOUT is not set 238# CONFIG_HAVE_AOUT is not set
237# CONFIG_BINFMT_MISC is not set 239# CONFIG_BINFMT_MISC is not set
240
241#
242# Bus Options
243#
244# CONFIG_PCI is not set
245# CONFIG_PCI_DOMAINS is not set
246# CONFIG_PCI_SYSCALL is not set
247# CONFIG_ARCH_SUPPORTS_MSI is not set
238CONFIG_NET=y 248CONFIG_NET=y
239 249
240# 250#
241# Networking options 251# Networking options
242# 252#
243CONFIG_PACKET=y 253CONFIG_PACKET=y
244# CONFIG_PACKET_MMAP is not set
245CONFIG_UNIX=y 254CONFIG_UNIX=y
246CONFIG_XFRM=y 255CONFIG_XFRM=y
247# CONFIG_XFRM_USER is not set 256# CONFIG_XFRM_USER is not set
@@ -413,6 +422,7 @@ CONFIG_MTD_UCLINUX=y
413# UBI - Unsorted block images 422# UBI - Unsorted block images
414# 423#
415# CONFIG_MTD_UBI is not set 424# CONFIG_MTD_UBI is not set
425CONFIG_OF_FLATTREE=y
416CONFIG_OF_DEVICE=y 426CONFIG_OF_DEVICE=y
417# CONFIG_PARPORT is not set 427# CONFIG_PARPORT is not set
418CONFIG_BLK_DEV=y 428CONFIG_BLK_DEV=y
@@ -442,6 +452,7 @@ CONFIG_MISC_DEVICES=y
442# 452#
443# SCSI device support 453# SCSI device support
444# 454#
455CONFIG_SCSI_MOD=y
445# CONFIG_RAID_ATTRS is not set 456# CONFIG_RAID_ATTRS is not set
446# CONFIG_SCSI is not set 457# CONFIG_SCSI is not set
447# CONFIG_SCSI_DMA is not set 458# CONFIG_SCSI_DMA is not set
@@ -458,6 +469,7 @@ CONFIG_NETDEVICES=y
458# CONFIG_PHYLIB is not set 469# CONFIG_PHYLIB is not set
459CONFIG_NET_ETHERNET=y 470CONFIG_NET_ETHERNET=y
460# CONFIG_MII is not set 471# CONFIG_MII is not set
472# CONFIG_ETHOC is not set
461# CONFIG_DNET is not set 473# CONFIG_DNET is not set
462# CONFIG_IBM_NEW_EMAC_ZMII is not set 474# CONFIG_IBM_NEW_EMAC_ZMII is not set
463# CONFIG_IBM_NEW_EMAC_RGMII is not set 475# CONFIG_IBM_NEW_EMAC_RGMII is not set
@@ -466,6 +478,7 @@ CONFIG_NET_ETHERNET=y
466# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 478# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
467# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 479# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
468# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 480# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
481# CONFIG_B44 is not set
469# CONFIG_KS8842 is not set 482# CONFIG_KS8842 is not set
470# CONFIG_KS8851_MLL is not set 483# CONFIG_KS8851_MLL is not set
471# CONFIG_XILINX_EMACLITE is not set 484# CONFIG_XILINX_EMACLITE is not set
@@ -516,6 +529,7 @@ CONFIG_SERIAL_UARTLITE=y
516CONFIG_SERIAL_UARTLITE_CONSOLE=y 529CONFIG_SERIAL_UARTLITE_CONSOLE=y
517CONFIG_SERIAL_CORE=y 530CONFIG_SERIAL_CORE=y
518CONFIG_SERIAL_CORE_CONSOLE=y 531CONFIG_SERIAL_CORE_CONSOLE=y
532# CONFIG_SERIAL_TIMBERDALE is not set
519# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set 533# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set
520CONFIG_UNIX98_PTYS=y 534CONFIG_UNIX98_PTYS=y
521# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set 535# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
@@ -544,6 +558,12 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
544# CONFIG_HWMON is not set 558# CONFIG_HWMON is not set
545# CONFIG_THERMAL is not set 559# CONFIG_THERMAL is not set
546# CONFIG_WATCHDOG is not set 560# CONFIG_WATCHDOG is not set
561CONFIG_SSB_POSSIBLE=y
562
563#
564# Sonics Silicon Backplane
565#
566# CONFIG_SSB is not set
547 567
548# 568#
549# Multifunction device drivers 569# Multifunction device drivers
@@ -593,6 +613,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
593# CONFIG_NEW_LEDS is not set 613# CONFIG_NEW_LEDS is not set
594# CONFIG_ACCESSIBILITY is not set 614# CONFIG_ACCESSIBILITY is not set
595# CONFIG_RTC_CLASS is not set 615# CONFIG_RTC_CLASS is not set
616# CONFIG_DMADEVICES is not set
596# CONFIG_AUXDISPLAY is not set 617# CONFIG_AUXDISPLAY is not set
597# CONFIG_UIO is not set 618# CONFIG_UIO is not set
598 619
@@ -661,6 +682,7 @@ CONFIG_MISC_FILESYSTEMS=y
661# CONFIG_BFS_FS is not set 682# CONFIG_BFS_FS is not set
662# CONFIG_EFS_FS is not set 683# CONFIG_EFS_FS is not set
663# CONFIG_JFFS2_FS is not set 684# CONFIG_JFFS2_FS is not set
685# CONFIG_LOGFS is not set
664CONFIG_CRAMFS=y 686CONFIG_CRAMFS=y
665# CONFIG_SQUASHFS is not set 687# CONFIG_SQUASHFS is not set
666# CONFIG_VXFS_FS is not set 688# CONFIG_VXFS_FS is not set
@@ -689,6 +711,7 @@ CONFIG_SUNRPC=y
689# CONFIG_RPCSEC_GSS_KRB5 is not set 711# CONFIG_RPCSEC_GSS_KRB5 is not set
690# CONFIG_RPCSEC_GSS_SPKM3 is not set 712# CONFIG_RPCSEC_GSS_SPKM3 is not set
691# CONFIG_SMB_FS is not set 713# CONFIG_SMB_FS is not set
714# CONFIG_CEPH_FS is not set
692# CONFIG_CIFS is not set 715# CONFIG_CIFS is not set
693# CONFIG_NCP_FS is not set 716# CONFIG_NCP_FS is not set
694# CONFIG_CODA_FS is not set 717# CONFIG_CODA_FS is not set
@@ -733,6 +756,7 @@ CONFIG_DEBUG_OBJECTS_TIMERS=y
733# CONFIG_DEBUG_OBJECTS_WORK is not set 756# CONFIG_DEBUG_OBJECTS_WORK is not set
734CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1 757CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
735# CONFIG_DEBUG_SLAB is not set 758# CONFIG_DEBUG_SLAB is not set
759# CONFIG_DEBUG_KMEMLEAK is not set
736# CONFIG_DEBUG_RT_MUTEXES is not set 760# CONFIG_DEBUG_RT_MUTEXES is not set
737# CONFIG_RT_MUTEX_TESTER is not set 761# CONFIG_RT_MUTEX_TESTER is not set
738# CONFIG_DEBUG_SPINLOCK is not set 762# CONFIG_DEBUG_SPINLOCK is not set
@@ -758,6 +782,7 @@ CONFIG_DEBUG_SG=y
758# CONFIG_BACKTRACE_SELF_TEST is not set 782# CONFIG_BACKTRACE_SELF_TEST is not set
759# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 783# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
760# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set 784# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
785# CONFIG_LKDTM is not set
761# CONFIG_FAULT_INJECTION is not set 786# CONFIG_FAULT_INJECTION is not set
762# CONFIG_LATENCYTOP is not set 787# CONFIG_LATENCYTOP is not set
763CONFIG_SYSCTL_SYSCALL_CHECK=y 788CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -782,6 +807,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
782# CONFIG_WORKQUEUE_TRACER is not set 807# CONFIG_WORKQUEUE_TRACER is not set
783# CONFIG_BLK_DEV_IO_TRACE is not set 808# CONFIG_BLK_DEV_IO_TRACE is not set
784# CONFIG_DYNAMIC_DEBUG is not set 809# CONFIG_DYNAMIC_DEBUG is not set
810# CONFIG_DMA_API_DEBUG is not set
785# CONFIG_SAMPLES is not set 811# CONFIG_SAMPLES is not set
786CONFIG_EARLY_PRINTK=y 812CONFIG_EARLY_PRINTK=y
787# CONFIG_HEART_BEAT is not set 813# CONFIG_HEART_BEAT is not set
@@ -901,5 +927,6 @@ CONFIG_GENERIC_FIND_LAST_BIT=y
901CONFIG_ZLIB_INFLATE=y 927CONFIG_ZLIB_INFLATE=y
902CONFIG_HAS_IOMEM=y 928CONFIG_HAS_IOMEM=y
903CONFIG_HAS_IOPORT=y 929CONFIG_HAS_IOPORT=y
930CONFIG_HAS_DMA=y
904CONFIG_HAVE_LMB=y 931CONFIG_HAVE_LMB=y
905CONFIG_NLATTR=y 932CONFIG_NLATTR=y
diff --git a/arch/microblaze/include/asm/cache.h b/arch/microblaze/include/asm/cache.h
index e52210891d78..4efe96a036f7 100644
--- a/arch/microblaze/include/asm/cache.h
+++ b/arch/microblaze/include/asm/cache.h
@@ -15,7 +15,7 @@
15 15
16#include <asm/registers.h> 16#include <asm/registers.h>
17 17
18#define L1_CACHE_SHIFT 2 18#define L1_CACHE_SHIFT 5
19/* word-granular cache in microblaze */ 19/* word-granular cache in microblaze */
20#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 20#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
21 21
diff --git a/arch/microblaze/include/asm/dma.h b/arch/microblaze/include/asm/dma.h
index 08c073badf19..0d73d0c6de37 100644
--- a/arch/microblaze/include/asm/dma.h
+++ b/arch/microblaze/include/asm/dma.h
@@ -18,4 +18,10 @@
18#define MAX_DMA_ADDRESS (CONFIG_KERNEL_START + memory_size - 1) 18#define MAX_DMA_ADDRESS (CONFIG_KERNEL_START + memory_size - 1)
19#endif 19#endif
20 20
21#ifdef CONFIG_PCI
22extern int isa_dma_bridge_buggy;
23#else
24#define isa_dma_bridge_buggy (0)
25#endif
26
21#endif /* _ASM_MICROBLAZE_DMA_H */ 27#endif /* _ASM_MICROBLAZE_DMA_H */
diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h
index 90731df9e574..4c7b5d037c88 100644
--- a/arch/microblaze/include/asm/exceptions.h
+++ b/arch/microblaze/include/asm/exceptions.h
@@ -64,12 +64,6 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
64void die(const char *str, struct pt_regs *fp, long err); 64void die(const char *str, struct pt_regs *fp, long err);
65void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); 65void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
66 66
67#ifdef CONFIG_MMU
68void __bug(const char *file, int line, void *data);
69int bad_trap(int trap_num, struct pt_regs *regs);
70int debug_trap(struct pt_regs *regs);
71#endif /* CONFIG_MMU */
72
73#if defined(CONFIG_KGDB) 67#if defined(CONFIG_KGDB)
74void (*debugger)(struct pt_regs *regs); 68void (*debugger)(struct pt_regs *regs);
75int (*debugger_bpt)(struct pt_regs *regs); 69int (*debugger_bpt)(struct pt_regs *regs);
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index e45a6eea92e0..00b5398d08c7 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -139,8 +139,6 @@ static inline void writel(unsigned int v, volatile void __iomem *addr)
139 139
140#ifdef CONFIG_MMU 140#ifdef CONFIG_MMU
141 141
142#define mm_ptov(addr) ((void *)__phys_to_virt(addr))
143#define mm_vtop(addr) ((unsigned long)__virt_to_phys(addr))
144#define phys_to_virt(addr) ((void *)__phys_to_virt(addr)) 142#define phys_to_virt(addr) ((void *)__phys_to_virt(addr))
145#define virt_to_phys(addr) ((unsigned long)__virt_to_phys(addr)) 143#define virt_to_phys(addr) ((unsigned long)__virt_to_phys(addr))
146#define virt_to_bus(addr) ((unsigned long)__virt_to_phys(addr)) 144#define virt_to_bus(addr) ((unsigned long)__virt_to_phys(addr))
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
index 2dd1d04129e0..de493f86d28f 100644
--- a/arch/microblaze/include/asm/page.h
+++ b/arch/microblaze/include/asm/page.h
@@ -31,6 +31,9 @@
31 31
32#ifndef __ASSEMBLY__ 32#ifndef __ASSEMBLY__
33 33
34/* MS be sure that SLAB allocates aligned objects */
35#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
36
34#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) 37#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
35#define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1))) 38#define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1)))
36 39
@@ -70,14 +73,7 @@ typedef unsigned long pte_basic_t;
70 73
71#endif /* CONFIG_MMU */ 74#endif /* CONFIG_MMU */
72 75
73# ifndef CONFIG_MMU 76# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
74# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
75# define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
76# define free_user_page(page, addr) free_page(addr)
77# else /* CONFIG_MMU */
78extern void copy_page(void *to, void *from);
79# endif /* CONFIG_MMU */
80
81# define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE) 77# define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE)
82 78
83# define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE) 79# define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE)
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h
index bdd65aaee30d..5a388eeeb28f 100644
--- a/arch/microblaze/include/asm/pci.h
+++ b/arch/microblaze/include/asm/pci.h
@@ -94,14 +94,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
94 94
95#define HAVE_PCI_LEGACY 1 95#define HAVE_PCI_LEGACY 1
96 96
97/* pci_unmap_{page,single} is a nop so... */
98#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
99#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
100#define pci_unmap_addr(PTR, ADDR_NAME) (0)
101#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
102#define pci_unmap_len(PTR, LEN_NAME) (0)
103#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
104
105/* The PCI address space does equal the physical memory 97/* The PCI address space does equal the physical memory
106 * address space (no IOMMU). The IDE and SCSI device layers use 98 * address space (no IOMMU). The IDE and SCSI device layers use
107 * this boolean for bounce buffer decisions. 99 * this boolean for bounce buffer decisions.
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h
index f44b0d696fe2..c614a893f8a3 100644
--- a/arch/microblaze/include/asm/pgalloc.h
+++ b/arch/microblaze/include/asm/pgalloc.h
@@ -108,21 +108,7 @@ extern inline void free_pgd_slow(pgd_t *pgd)
108#define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); }) 108#define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); })
109#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); }) 109#define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
110 110
111static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 111extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
112 unsigned long address)
113{
114 pte_t *pte;
115 extern void *early_get_page(void);
116 if (mem_init_done) {
117 pte = (pte_t *)__get_free_page(GFP_KERNEL |
118 __GFP_REPEAT | __GFP_ZERO);
119 } else {
120 pte = (pte_t *)early_get_page();
121 if (pte)
122 clear_page(pte);
123 }
124 return pte;
125}
126 112
127static inline struct page *pte_alloc_one(struct mm_struct *mm, 113static inline struct page *pte_alloc_one(struct mm_struct *mm,
128 unsigned long address) 114 unsigned long address)
diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h
index dd2bb60651c7..ca2d92871545 100644
--- a/arch/microblaze/include/asm/pgtable.h
+++ b/arch/microblaze/include/asm/pgtable.h
@@ -512,15 +512,6 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
512extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 512extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
513 513
514/* 514/*
515 * When flushing the tlb entry for a page, we also need to flush the hash
516 * table entry. flush_hash_page is assembler (for speed) in hashtable.S.
517 */
518extern int flush_hash_page(unsigned context, unsigned long va, pte_t *ptep);
519
520/* Add an HPTE to the hash table */
521extern void add_hash_page(unsigned context, unsigned long va, pte_t *ptep);
522
523/*
524 * Encode and decode a swap entry. 515 * Encode and decode a swap entry.
525 * Note that the bits we use in a PTE for representing a swap entry 516 * Note that the bits we use in a PTE for representing a swap entry
526 * must not include the _PAGE_PRESENT bit, or the _PAGE_HASHPTE bit 517 * must not include the _PAGE_PRESENT bit, or the _PAGE_HASHPTE bit
@@ -533,15 +524,7 @@ extern void add_hash_page(unsigned context, unsigned long va, pte_t *ptep);
533#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 2 }) 524#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 2 })
534#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 2 }) 525#define __swp_entry_to_pte(x) ((pte_t) { (x).val << 2 })
535 526
536
537/* CONFIG_APUS */
538/* For virtual address to physical address conversion */
539extern void cache_clear(__u32 addr, int length);
540extern void cache_push(__u32 addr, int length);
541extern int mm_end_of_chunk(unsigned long addr, int len);
542extern unsigned long iopa(unsigned long addr); 527extern unsigned long iopa(unsigned long addr);
543/* extern unsigned long mm_ptov(unsigned long addr) \
544 __attribute__ ((const)); TBD */
545 528
546/* Values for nocacheflag and cmode */ 529/* Values for nocacheflag and cmode */
547/* These are not used by the APUS kernel_map, but prevents 530/* These are not used by the APUS kernel_map, but prevents
@@ -552,18 +535,6 @@ extern unsigned long iopa(unsigned long addr);
552#define IOMAP_NOCACHE_NONSER 2 535#define IOMAP_NOCACHE_NONSER 2
553#define IOMAP_NO_COPYBACK 3 536#define IOMAP_NO_COPYBACK 3
554 537
555/*
556 * Map some physical address range into the kernel address space.
557 */
558extern unsigned long kernel_map(unsigned long paddr, unsigned long size,
559 int nocacheflag, unsigned long *memavailp);
560
561/*
562 * Set cache mode of (kernel space) address range.
563 */
564extern void kernel_set_cachemode(unsigned long address, unsigned long size,
565 unsigned int cmode);
566
567/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ 538/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
568#define kern_addr_valid(addr) (1) 539#define kern_addr_valid(addr) (1)
569 540
@@ -577,10 +548,6 @@ extern void kernel_set_cachemode(unsigned long address, unsigned long size,
577void do_page_fault(struct pt_regs *regs, unsigned long address, 548void do_page_fault(struct pt_regs *regs, unsigned long address,
578 unsigned long error_code); 549 unsigned long error_code);
579 550
580void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
581 unsigned int size, int flags);
582
583void __init adjust_total_lowmem(void);
584void mapin_ram(void); 551void mapin_ram(void);
585int map_page(unsigned long va, phys_addr_t pa, int flags); 552int map_page(unsigned long va, phys_addr_t pa, int flags);
586 553
@@ -601,7 +568,7 @@ void __init *early_get_page(void);
601extern unsigned long ioremap_bot, ioremap_base; 568extern unsigned long ioremap_bot, ioremap_base;
602 569
603void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle); 570void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle);
604void consistent_free(void *vaddr); 571void consistent_free(size_t size, void *vaddr);
605void consistent_sync(void *vaddr, size_t size, int direction); 572void consistent_sync(void *vaddr, size_t size, int direction);
606void consistent_sync_page(struct page *page, unsigned long offset, 573void consistent_sync_page(struct page *page, unsigned long offset,
607 size_t size, int direction); 574 size_t size, int direction);
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
index 59efb3fef957..48c4f0335e3f 100644
--- a/arch/microblaze/include/asm/system.h
+++ b/arch/microblaze/include/asm/system.h
@@ -12,6 +12,7 @@
12#include <asm/registers.h> 12#include <asm/registers.h>
13#include <asm/setup.h> 13#include <asm/setup.h>
14#include <asm/irqflags.h> 14#include <asm/irqflags.h>
15#include <asm/cache.h>
15 16
16#include <asm-generic/cmpxchg.h> 17#include <asm-generic/cmpxchg.h>
17#include <asm-generic/cmpxchg-local.h> 18#include <asm-generic/cmpxchg-local.h>
@@ -96,4 +97,14 @@ extern struct dentry *of_debugfs_root;
96 97
97#define arch_align_stack(x) (x) 98#define arch_align_stack(x) (x)
98 99
100/*
101 * MicroBlaze doesn't handle unaligned accesses in hardware.
102 *
103 * Based on this we force the IP header alignment in network drivers.
104 * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining
105 * cacheline alignment of buffers.
106 */
107#define NET_IP_ALIGN 2
108#define NET_SKB_PAD L1_CACHE_BYTES
109
99#endif /* _ASM_MICROBLAZE_SYSTEM_H */ 110#endif /* _ASM_MICROBLAZE_SYSTEM_H */
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index b2ca80f64640..8a8e9fc6e0c0 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -122,7 +122,7 @@ static inline struct thread_info *current_thread_info(void)
122/* restore singlestep on return to user mode */ 122/* restore singlestep on return to user mode */
123#define TIF_SINGLESTEP 4 123#define TIF_SINGLESTEP 4
124#define TIF_IRET 5 /* return with iret */ 124#define TIF_IRET 5 /* return with iret */
125#define TIF_MEMDIE 6 125#define TIF_MEMDIE 6 /* is terminating due to OOM killer */
126#define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */ 126#define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */
127#define TIF_SECCOMP 10 /* secure computing */ 127#define TIF_SECCOMP 10 /* secure computing */
128#define TIF_FREEZE 14 /* Freezing for suspend */ 128#define TIF_FREEZE 14 /* Freezing for suspend */
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index 446bec29b142..26460d15b338 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -182,6 +182,39 @@ extern long __user_bad(void);
182 * Returns zero on success, or -EFAULT on error. 182 * Returns zero on success, or -EFAULT on error.
183 * On error, the variable @x is set to zero. 183 * On error, the variable @x is set to zero.
184 */ 184 */
185#define get_user(x, ptr) \
186 __get_user_check((x), (ptr), sizeof(*(ptr)))
187
188#define __get_user_check(x, ptr, size) \
189({ \
190 unsigned long __gu_val = 0; \
191 const typeof(*(ptr)) __user *__gu_addr = (ptr); \
192 int __gu_err = 0; \
193 \
194 if (access_ok(VERIFY_READ, __gu_addr, size)) { \
195 switch (size) { \
196 case 1: \
197 __get_user_asm("lbu", __gu_addr, __gu_val, \
198 __gu_err); \
199 break; \
200 case 2: \
201 __get_user_asm("lhu", __gu_addr, __gu_val, \
202 __gu_err); \
203 break; \
204 case 4: \
205 __get_user_asm("lw", __gu_addr, __gu_val, \
206 __gu_err); \
207 break; \
208 default: \
209 __gu_err = __user_bad(); \
210 break; \
211 } \
212 } else { \
213 __gu_err = -EFAULT; \
214 } \
215 x = (typeof(*(ptr)))__gu_val; \
216 __gu_err; \
217})
185 218
186#define __get_user(x, ptr) \ 219#define __get_user(x, ptr) \
187({ \ 220({ \
@@ -206,12 +239,6 @@ extern long __user_bad(void);
206}) 239})
207 240
208 241
209#define get_user(x, ptr) \
210({ \
211 access_ok(VERIFY_READ, (ptr), sizeof(*(ptr))) \
212 ? __get_user((x), (ptr)) : -EFAULT; \
213})
214
215#define __put_user_asm(insn, __gu_ptr, __gu_val, __gu_err) \ 242#define __put_user_asm(insn, __gu_ptr, __gu_val, __gu_err) \
216({ \ 243({ \
217 __asm__ __volatile__ ( \ 244 __asm__ __volatile__ ( \
@@ -266,6 +293,42 @@ extern long __user_bad(void);
266 * 293 *
267 * Returns zero on success, or -EFAULT on error. 294 * Returns zero on success, or -EFAULT on error.
268 */ 295 */
296#define put_user(x, ptr) \
297 __put_user_check((x), (ptr), sizeof(*(ptr)))
298
299#define __put_user_check(x, ptr, size) \
300({ \
301 typeof(*(ptr)) __pu_val; \
302 typeof(*(ptr)) __user *__pu_addr = (ptr); \
303 int __pu_err = 0; \
304 \
305 __pu_val = (x); \
306 if (access_ok(VERIFY_WRITE, __pu_addr, size)) { \
307 switch (size) { \
308 case 1: \
309 __put_user_asm("sb", __pu_addr, __pu_val, \
310 __pu_err); \
311 break; \
312 case 2: \
313 __put_user_asm("sh", __pu_addr, __pu_val, \
314 __pu_err); \
315 break; \
316 case 4: \
317 __put_user_asm("sw", __pu_addr, __pu_val, \
318 __pu_err); \
319 break; \
320 case 8: \
321 __put_user_asm_8(__pu_addr, __pu_val, __pu_err);\
322 break; \
323 default: \
324 __pu_err = __user_bad(); \
325 break; \
326 } \
327 } else { \
328 __pu_err = -EFAULT; \
329 } \
330 __pu_err; \
331})
269 332
270#define __put_user(x, ptr) \ 333#define __put_user(x, ptr) \
271({ \ 334({ \
@@ -290,18 +353,6 @@ extern long __user_bad(void);
290 __gu_err; \ 353 __gu_err; \
291}) 354})
292 355
293#ifndef CONFIG_MMU
294
295#define put_user(x, ptr) __put_user((x), (ptr))
296
297#else /* CONFIG_MMU */
298
299#define put_user(x, ptr) \
300({ \
301 access_ok(VERIFY_WRITE, (ptr), sizeof(*(ptr))) \
302 ? __put_user((x), (ptr)) : -EFAULT; \
303})
304#endif /* CONFIG_MMU */
305 356
306/* copy_to_from_user */ 357/* copy_to_from_user */
307#define __copy_from_user(to, from, n) \ 358#define __copy_from_user(to, from, n) \
diff --git a/arch/microblaze/kernel/asm-offsets.c b/arch/microblaze/kernel/asm-offsets.c
index 0071260a672c..c1b459c97571 100644
--- a/arch/microblaze/kernel/asm-offsets.c
+++ b/arch/microblaze/kernel/asm-offsets.c
@@ -16,6 +16,7 @@
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/thread_info.h> 17#include <linux/thread_info.h>
18#include <linux/kbuild.h> 18#include <linux/kbuild.h>
19#include <asm/cpuinfo.h>
19 20
20int main(int argc, char *argv[]) 21int main(int argc, char *argv[])
21{ 22{
diff --git a/arch/microblaze/kernel/cpu/cache.c b/arch/microblaze/kernel/cpu/cache.c
index f04d8a86dead..109876e8d643 100644
--- a/arch/microblaze/kernel/cpu/cache.c
+++ b/arch/microblaze/kernel/cpu/cache.c
@@ -96,13 +96,16 @@ static inline void __disable_dcache_nomsr(void)
96} 96}
97 97
98 98
99/* Helper macro for computing the limits of cache range loops */ 99/* Helper macro for computing the limits of cache range loops
100 *
101 * End address can be unaligned which is OK for C implementation.
102 * ASM implementation align it in ASM macros
103 */
100#define CACHE_LOOP_LIMITS(start, end, cache_line_length, cache_size) \ 104#define CACHE_LOOP_LIMITS(start, end, cache_line_length, cache_size) \
101do { \ 105do { \
102 int align = ~(cache_line_length - 1); \ 106 int align = ~(cache_line_length - 1); \
103 end = min(start + cache_size, end); \ 107 end = min(start + cache_size, end); \
104 start &= align; \ 108 start &= align; \
105 end = ((end & align) + cache_line_length); \
106} while (0); 109} while (0);
107 110
108/* 111/*
@@ -111,9 +114,9 @@ do { \
111 */ 114 */
112#define CACHE_ALL_LOOP(cache_size, line_length, op) \ 115#define CACHE_ALL_LOOP(cache_size, line_length, op) \
113do { \ 116do { \
114 unsigned int len = cache_size; \ 117 unsigned int len = cache_size - line_length; \
115 int step = -line_length; \ 118 int step = -line_length; \
116 BUG_ON(step >= 0); \ 119 WARN_ON(step >= 0); \
117 \ 120 \
118 __asm__ __volatile__ (" 1: " #op " %0, r0; \ 121 __asm__ __volatile__ (" 1: " #op " %0, r0; \
119 bgtid %0, 1b; \ 122 bgtid %0, 1b; \
@@ -122,26 +125,22 @@ do { \
122 : "memory"); \ 125 : "memory"); \
123} while (0); 126} while (0);
124 127
125 128/* Used for wdc.flush/clear which can use rB for offset which is not possible
126#define CACHE_ALL_LOOP2(cache_size, line_length, op) \ 129 * to use for simple wdc or wic.
127do { \ 130 *
128 unsigned int len = cache_size; \ 131 * start address is cache aligned
129 int step = -line_length; \ 132 * end address is not aligned, if end is aligned then I have to substract
130 BUG_ON(step >= 0); \ 133 * cacheline length because I can't flush/invalidate the next cacheline.
131 \ 134 * If is not, I align it because I will flush/invalidate whole line.
132 __asm__ __volatile__ (" 1: " #op " r0, %0; \ 135 */
133 bgtid %0, 1b; \
134 addk %0, %0, %1; \
135 " : : "r" (len), "r" (step) \
136 : "memory"); \
137} while (0);
138
139/* for wdc.flush/clear */
140#define CACHE_RANGE_LOOP_2(start, end, line_length, op) \ 136#define CACHE_RANGE_LOOP_2(start, end, line_length, op) \
141do { \ 137do { \
142 int step = -line_length; \ 138 int step = -line_length; \
143 int count = end - start; \ 139 int align = ~(line_length - 1); \
144 BUG_ON(count <= 0); \ 140 int count; \
141 end = ((end & align) == end) ? end - line_length : end & align; \
142 count = end - start; \
143 WARN_ON(count < 0); \
145 \ 144 \
146 __asm__ __volatile__ (" 1: " #op " %0, %1; \ 145 __asm__ __volatile__ (" 1: " #op " %0, %1; \
147 bgtid %1, 1b; \ 146 bgtid %1, 1b; \
@@ -154,7 +153,9 @@ do { \
154#define CACHE_RANGE_LOOP_1(start, end, line_length, op) \ 153#define CACHE_RANGE_LOOP_1(start, end, line_length, op) \
155do { \ 154do { \
156 int volatile temp; \ 155 int volatile temp; \
157 BUG_ON(end - start <= 0); \ 156 int align = ~(line_length - 1); \
157 end = ((end & align) == end) ? end - line_length : end & align; \
158 WARN_ON(end - start < 0); \
158 \ 159 \
159 __asm__ __volatile__ (" 1: " #op " %1, r0; \ 160 __asm__ __volatile__ (" 1: " #op " %1, r0; \
160 cmpu %0, %1, %2; \ 161 cmpu %0, %1, %2; \
@@ -360,8 +361,12 @@ static void __invalidate_dcache_all_noirq_wt(void)
360#endif 361#endif
361} 362}
362 363
363/* FIXME this is weird - should be only wdc but not work 364/* FIXME It is blindly invalidation as is expected
364 * MS: I am getting bus errors and other weird things */ 365 * but can't be called on noMMU in microblaze_cache_init below
366 *
367 * MS: noMMU kernel won't boot if simple wdc is used
368 * The reason should be that there are discared data which kernel needs
369 */
365static void __invalidate_dcache_all_wb(void) 370static void __invalidate_dcache_all_wb(void)
366{ 371{
367#ifndef ASM_LOOP 372#ifndef ASM_LOOP
@@ -369,12 +374,12 @@ static void __invalidate_dcache_all_wb(void)
369#endif 374#endif
370 pr_debug("%s\n", __func__); 375 pr_debug("%s\n", __func__);
371#ifdef ASM_LOOP 376#ifdef ASM_LOOP
372 CACHE_ALL_LOOP2(cpuinfo.dcache_size, cpuinfo.dcache_line_length, 377 CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length,
373 wdc.clear) 378 wdc)
374#else 379#else
375 for (i = 0; i < cpuinfo.dcache_size; 380 for (i = 0; i < cpuinfo.dcache_size;
376 i += cpuinfo.dcache_line_length) 381 i += cpuinfo.dcache_line_length)
377 __asm__ __volatile__ ("wdc.clear %0, r0;" \ 382 __asm__ __volatile__ ("wdc %0, r0;" \
378 : : "r" (i)); 383 : : "r" (i));
379#endif 384#endif
380} 385}
@@ -393,7 +398,7 @@ static void __invalidate_dcache_range_wb(unsigned long start,
393#ifdef ASM_LOOP 398#ifdef ASM_LOOP
394 CACHE_RANGE_LOOP_2(start, end, cpuinfo.dcache_line_length, wdc.clear); 399 CACHE_RANGE_LOOP_2(start, end, cpuinfo.dcache_line_length, wdc.clear);
395#else 400#else
396 for (i = start; i < end; i += cpuinfo.icache_line_length) 401 for (i = start; i < end; i += cpuinfo.dcache_line_length)
397 __asm__ __volatile__ ("wdc.clear %0, r0;" \ 402 __asm__ __volatile__ ("wdc.clear %0, r0;" \
398 : : "r" (i)); 403 : : "r" (i));
399#endif 404#endif
@@ -413,7 +418,7 @@ static void __invalidate_dcache_range_nomsr_wt(unsigned long start,
413#ifdef ASM_LOOP 418#ifdef ASM_LOOP
414 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc); 419 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc);
415#else 420#else
416 for (i = start; i < end; i += cpuinfo.icache_line_length) 421 for (i = start; i < end; i += cpuinfo.dcache_line_length)
417 __asm__ __volatile__ ("wdc %0, r0;" \ 422 __asm__ __volatile__ ("wdc %0, r0;" \
418 : : "r" (i)); 423 : : "r" (i));
419#endif 424#endif
@@ -437,7 +442,7 @@ static void __invalidate_dcache_range_msr_irq_wt(unsigned long start,
437#ifdef ASM_LOOP 442#ifdef ASM_LOOP
438 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc); 443 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc);
439#else 444#else
440 for (i = start; i < end; i += cpuinfo.icache_line_length) 445 for (i = start; i < end; i += cpuinfo.dcache_line_length)
441 __asm__ __volatile__ ("wdc %0, r0;" \ 446 __asm__ __volatile__ ("wdc %0, r0;" \
442 : : "r" (i)); 447 : : "r" (i));
443#endif 448#endif
@@ -465,7 +470,7 @@ static void __invalidate_dcache_range_nomsr_irq(unsigned long start,
465#ifdef ASM_LOOP 470#ifdef ASM_LOOP
466 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc); 471 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc);
467#else 472#else
468 for (i = start; i < end; i += cpuinfo.icache_line_length) 473 for (i = start; i < end; i += cpuinfo.dcache_line_length)
469 __asm__ __volatile__ ("wdc %0, r0;" \ 474 __asm__ __volatile__ ("wdc %0, r0;" \
470 : : "r" (i)); 475 : : "r" (i));
471#endif 476#endif
@@ -504,7 +509,7 @@ static void __flush_dcache_range_wb(unsigned long start, unsigned long end)
504#ifdef ASM_LOOP 509#ifdef ASM_LOOP
505 CACHE_RANGE_LOOP_2(start, end, cpuinfo.dcache_line_length, wdc.flush); 510 CACHE_RANGE_LOOP_2(start, end, cpuinfo.dcache_line_length, wdc.flush);
506#else 511#else
507 for (i = start; i < end; i += cpuinfo.icache_line_length) 512 for (i = start; i < end; i += cpuinfo.dcache_line_length)
508 __asm__ __volatile__ ("wdc.flush %0, r0;" \ 513 __asm__ __volatile__ ("wdc.flush %0, r0;" \
509 : : "r" (i)); 514 : : "r" (i));
510#endif 515#endif
@@ -650,7 +655,11 @@ void microblaze_cache_init(void)
650 } 655 }
651 } 656 }
652 } 657 }
653 invalidate_dcache(); 658/* FIXME Invalidation is done in U-BOOT
659 * WT cache: Data is already written to main memory
660 * WB cache: Discard data on noMMU which caused that kernel doesn't boot
661 */
662 /* invalidate_dcache(); */
654 enable_dcache(); 663 enable_dcache();
655 664
656 invalidate_icache(); 665 invalidate_icache();
diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c
index 0c912b2a8e03..4216eb1eaa32 100644
--- a/arch/microblaze/kernel/cpu/mb.c
+++ b/arch/microblaze/kernel/cpu/mb.c
@@ -98,15 +98,17 @@ static int show_cpuinfo(struct seq_file *m, void *v)
98 98
99 if (cpuinfo.use_icache) 99 if (cpuinfo.use_icache)
100 count += seq_printf(m, 100 count += seq_printf(m,
101 "Icache:\t\t%ukB\n", 101 "Icache:\t\t%ukB\tline length:\t%dB\n",
102 cpuinfo.icache_size >> 10); 102 cpuinfo.icache_size >> 10,
103 cpuinfo.icache_line_length);
103 else 104 else
104 count += seq_printf(m, "Icache:\t\tno\n"); 105 count += seq_printf(m, "Icache:\t\tno\n");
105 106
106 if (cpuinfo.use_dcache) { 107 if (cpuinfo.use_dcache) {
107 count += seq_printf(m, 108 count += seq_printf(m,
108 "Dcache:\t\t%ukB\n", 109 "Dcache:\t\t%ukB\tline length:\t%dB\n",
109 cpuinfo.dcache_size >> 10); 110 cpuinfo.dcache_size >> 10,
111 cpuinfo.dcache_line_length);
110 if (cpuinfo.dcache_wb) 112 if (cpuinfo.dcache_wb)
111 count += seq_printf(m, "\t\twrite-back\n"); 113 count += seq_printf(m, "\t\twrite-back\n");
112 else 114 else
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c
index ce72dd4967cf..9dcd90b5df55 100644
--- a/arch/microblaze/kernel/dma.c
+++ b/arch/microblaze/kernel/dma.c
@@ -74,7 +74,7 @@ static void dma_direct_free_coherent(struct device *dev, size_t size,
74 void *vaddr, dma_addr_t dma_handle) 74 void *vaddr, dma_addr_t dma_handle)
75{ 75{
76#ifdef NOT_COHERENT_CACHE 76#ifdef NOT_COHERENT_CACHE
77 consistent_free(vaddr); 77 consistent_free(size, vaddr);
78#else 78#else
79 free_pages((unsigned long)vaddr, get_order(size)); 79 free_pages((unsigned long)vaddr, get_order(size));
80#endif 80#endif
diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S
index 391d6197fc3b..8cc18cd2cce6 100644
--- a/arch/microblaze/kernel/entry-nommu.S
+++ b/arch/microblaze/kernel/entry-nommu.S
@@ -476,6 +476,8 @@ ENTRY(ret_from_fork)
476 nop 476 nop
477 477
478work_pending: 478work_pending:
479 enable_irq
480
479 andi r11, r19, _TIF_NEED_RESCHED 481 andi r11, r19, _TIF_NEED_RESCHED
480 beqi r11, 1f 482 beqi r11, 1f
481 bralid r15, schedule 483 bralid r15, schedule
diff --git a/arch/microblaze/kernel/exceptions.c b/arch/microblaze/kernel/exceptions.c
index d9f70f83097f..02cbdfe5aa8d 100644
--- a/arch/microblaze/kernel/exceptions.c
+++ b/arch/microblaze/kernel/exceptions.c
@@ -121,7 +121,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
121 } 121 }
122 printk(KERN_WARNING "Divide by zero exception " \ 122 printk(KERN_WARNING "Divide by zero exception " \
123 "in kernel mode.\n"); 123 "in kernel mode.\n");
124 die("Divide by exception", regs, SIGBUS); 124 die("Divide by zero exception", regs, SIGBUS);
125 break; 125 break;
126 case MICROBLAZE_FPU_EXCEPTION: 126 case MICROBLAZE_FPU_EXCEPTION:
127 pr_debug(KERN_WARNING "FPU exception\n"); 127 pr_debug(KERN_WARNING "FPU exception\n");
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
index da6a5f5dc766..1bf739888260 100644
--- a/arch/microblaze/kernel/head.S
+++ b/arch/microblaze/kernel/head.S
@@ -28,6 +28,7 @@
28 * for more details. 28 * for more details.
29 */ 29 */
30 30
31#include <linux/init.h>
31#include <linux/linkage.h> 32#include <linux/linkage.h>
32#include <asm/thread_info.h> 33#include <asm/thread_info.h>
33#include <asm/page.h> 34#include <asm/page.h>
@@ -49,7 +50,7 @@ swapper_pg_dir:
49 50
50#endif /* CONFIG_MMU */ 51#endif /* CONFIG_MMU */
51 52
52 .text 53 __HEAD
53ENTRY(_start) 54ENTRY(_start)
54#if CONFIG_KERNEL_BASE_ADDR == 0 55#if CONFIG_KERNEL_BASE_ADDR == 0
55 brai TOPHYS(real_start) 56 brai TOPHYS(real_start)
diff --git a/arch/microblaze/kernel/irq.c b/arch/microblaze/kernel/irq.c
index 6f39e2c001f3..8f120aca123d 100644
--- a/arch/microblaze/kernel/irq.c
+++ b/arch/microblaze/kernel/irq.c
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/ftrace.h>
12#include <linux/kernel.h> 13#include <linux/kernel.h>
13#include <linux/hardirq.h> 14#include <linux/hardirq.h>
14#include <linux/interrupt.h> 15#include <linux/interrupt.h>
@@ -32,7 +33,7 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
32 33
33static u32 concurrent_irq; 34static u32 concurrent_irq;
34 35
35void do_IRQ(struct pt_regs *regs) 36void __irq_entry do_IRQ(struct pt_regs *regs)
36{ 37{
37 unsigned int irq; 38 unsigned int irq;
38 struct pt_regs *old_regs = set_irq_regs(regs); 39 struct pt_regs *old_regs = set_irq_regs(regs);
diff --git a/arch/microblaze/kernel/microblaze_ksyms.c b/arch/microblaze/kernel/microblaze_ksyms.c
index bc4dcb7d3861..ff85f7718035 100644
--- a/arch/microblaze/kernel/microblaze_ksyms.c
+++ b/arch/microblaze/kernel/microblaze_ksyms.c
@@ -52,3 +52,14 @@ EXPORT_SYMBOL_GPL(_ebss);
52extern void _mcount(void); 52extern void _mcount(void);
53EXPORT_SYMBOL(_mcount); 53EXPORT_SYMBOL(_mcount);
54#endif 54#endif
55
56/*
57 * Assembly functions that may be used (directly or indirectly) by modules
58 */
59EXPORT_SYMBOL(__copy_tofrom_user);
60EXPORT_SYMBOL(__strncpy_user);
61
62#ifdef CONFIG_OPT_LIB_ASM
63EXPORT_SYMBOL(memcpy);
64EXPORT_SYMBOL(memmove);
65#endif
diff --git a/arch/microblaze/kernel/misc.S b/arch/microblaze/kernel/misc.S
index 7cf86498326c..0fb5fc6c1fc2 100644
--- a/arch/microblaze/kernel/misc.S
+++ b/arch/microblaze/kernel/misc.S
@@ -93,39 +93,3 @@ early_console_reg_tlb_alloc:
93 nop 93 nop
94 94
95 .size early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc 95 .size early_console_reg_tlb_alloc, . - early_console_reg_tlb_alloc
96
97/*
98 * Copy a whole page (4096 bytes).
99 */
100#define COPY_16_BYTES \
101 lwi r7, r6, 0; \
102 lwi r8, r6, 4; \
103 lwi r9, r6, 8; \
104 lwi r10, r6, 12; \
105 swi r7, r5, 0; \
106 swi r8, r5, 4; \
107 swi r9, r5, 8; \
108 swi r10, r5, 12
109
110
111/* FIXME DCACHE_LINE_BYTES (CONFIG_XILINX_MICROBLAZE0_DCACHE_LINE_LEN * 4)*/
112#define DCACHE_LINE_BYTES (4 * 4)
113
114.globl copy_page;
115.type copy_page, @function
116.align 4;
117copy_page:
118 ori r11, r0, (PAGE_SIZE/DCACHE_LINE_BYTES) - 1
119_copy_page_loop:
120 COPY_16_BYTES
121#if DCACHE_LINE_BYTES >= 32
122 COPY_16_BYTES
123#endif
124 addik r6, r6, DCACHE_LINE_BYTES
125 addik r5, r5, DCACHE_LINE_BYTES
126 bneid r11, _copy_page_loop
127 addik r11, r11, -1
128 rtsd r15, 8
129 nop
130
131 .size copy_page, . - copy_page
diff --git a/arch/microblaze/kernel/module.c b/arch/microblaze/kernel/module.c
index cbecf110dc30..0e73f6606547 100644
--- a/arch/microblaze/kernel/module.c
+++ b/arch/microblaze/kernel/module.c
@@ -16,6 +16,7 @@
16#include <linux/string.h> 16#include <linux/string.h>
17 17
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/cacheflush.h>
19 20
20void *module_alloc(unsigned long size) 21void *module_alloc(unsigned long size)
21{ 22{
@@ -151,6 +152,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
151int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, 152int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
152 struct module *module) 153 struct module *module)
153{ 154{
155 flush_dcache();
154 return 0; 156 return 0;
155} 157}
156 158
diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c
index 5e4570ef515c..75e49202a5ed 100644
--- a/arch/microblaze/kernel/traps.c
+++ b/arch/microblaze/kernel/traps.c
@@ -95,37 +95,3 @@ void dump_stack(void)
95 show_stack(NULL, NULL); 95 show_stack(NULL, NULL);
96} 96}
97EXPORT_SYMBOL(dump_stack); 97EXPORT_SYMBOL(dump_stack);
98
99#ifdef CONFIG_MMU
100void __bug(const char *file, int line, void *data)
101{
102 if (data)
103 printk(KERN_CRIT "kernel BUG at %s:%d (data = %p)!\n",
104 file, line, data);
105 else
106 printk(KERN_CRIT "kernel BUG at %s:%d!\n", file, line);
107
108 machine_halt();
109}
110
111int bad_trap(int trap_num, struct pt_regs *regs)
112{
113 printk(KERN_CRIT
114 "unimplemented trap %d called at 0x%08lx, pid %d!\n",
115 trap_num, regs->pc, current->pid);
116 return -ENOSYS;
117}
118
119int debug_trap(struct pt_regs *regs)
120{
121 int i;
122 printk(KERN_CRIT "debug trap\n");
123 for (i = 0; i < 32; i++) {
124 /* printk("r%i:%08X\t",i,regs->gpr[i]); */
125 if ((i % 4) == 3)
126 printk(KERN_CRIT "\n");
127 }
128 printk(KERN_CRIT "pc:%08lX\tmsr:%08lX\n", regs->pc, regs->msr);
129 return -ENOSYS;
130}
131#endif
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index 5ef619aad634..db72d7124602 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -24,7 +24,8 @@ SECTIONS {
24 .text : AT(ADDR(.text) - LOAD_OFFSET) { 24 .text : AT(ADDR(.text) - LOAD_OFFSET) {
25 _text = . ; 25 _text = . ;
26 _stext = . ; 26 _stext = . ;
27 *(.text .text.*) 27 HEAD_TEXT
28 TEXT_TEXT
28 *(.fixup) 29 *(.fixup)
29 EXIT_TEXT 30 EXIT_TEXT
30 EXIT_CALL 31 EXIT_CALL
diff --git a/arch/microblaze/mm/consistent.c b/arch/microblaze/mm/consistent.c
index f956e24fe49c..5a59dad62bd2 100644
--- a/arch/microblaze/mm/consistent.c
+++ b/arch/microblaze/mm/consistent.c
@@ -42,11 +42,12 @@
42#include <linux/uaccess.h> 42#include <linux/uaccess.h>
43#include <asm/pgtable.h> 43#include <asm/pgtable.h>
44#include <asm/cpuinfo.h> 44#include <asm/cpuinfo.h>
45#include <asm/tlbflush.h>
45 46
46#ifndef CONFIG_MMU 47#ifndef CONFIG_MMU
47
48/* I have to use dcache values because I can't relate on ram size */ 48/* I have to use dcache values because I can't relate on ram size */
49#define UNCACHED_SHADOW_MASK (cpuinfo.dcache_high - cpuinfo.dcache_base + 1) 49# define UNCACHED_SHADOW_MASK (cpuinfo.dcache_high - cpuinfo.dcache_base + 1)
50#endif
50 51
51/* 52/*
52 * Consistent memory allocators. Used for DMA devices that want to 53 * Consistent memory allocators. Used for DMA devices that want to
@@ -60,71 +61,16 @@
60 */ 61 */
61void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) 62void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
62{ 63{
63 struct page *page, *end, *free; 64 unsigned long order, vaddr;
64 unsigned long order; 65 void *ret;
65 void *ret, *virt; 66 unsigned int i, err = 0;
66 67 struct page *page, *end;
67 if (in_interrupt())
68 BUG();
69
70 size = PAGE_ALIGN(size);
71 order = get_order(size);
72
73 page = alloc_pages(gfp, order);
74 if (!page)
75 goto no_page;
76
77 /* We could do with a page_to_phys and page_to_bus here. */
78 virt = page_address(page);
79 ret = ioremap(virt_to_phys(virt), size);
80 if (!ret)
81 goto no_remap;
82
83 /*
84 * Here's the magic! Note if the uncached shadow is not implemented,
85 * it's up to the calling code to also test that condition and make
86 * other arranegments, such as manually flushing the cache and so on.
87 */
88#ifdef CONFIG_XILINX_UNCACHED_SHADOW
89 ret = (void *)((unsigned) ret | UNCACHED_SHADOW_MASK);
90#endif
91 /* dma_handle is same as physical (shadowed) address */
92 *dma_handle = (dma_addr_t)ret;
93
94 /*
95 * free wasted pages. We skip the first page since we know
96 * that it will have count = 1 and won't require freeing.
97 * We also mark the pages in use as reserved so that
98 * remap_page_range works.
99 */
100 page = virt_to_page(virt);
101 free = page + (size >> PAGE_SHIFT);
102 end = page + (1 << order);
103
104 for (; page < end; page++) {
105 init_page_count(page);
106 if (page >= free)
107 __free_page(page);
108 else
109 SetPageReserved(page);
110 }
111
112 return ret;
113no_remap:
114 __free_pages(page, order);
115no_page:
116 return NULL;
117}
118
119#else
120 68
121void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) 69#ifdef CONFIG_MMU
122{
123 int order, err, i;
124 unsigned long page, va, flags;
125 phys_addr_t pa; 70 phys_addr_t pa;
126 struct vm_struct *area; 71 struct vm_struct *area;
127 void *ret; 72 unsigned long va;
73#endif
128 74
129 if (in_interrupt()) 75 if (in_interrupt())
130 BUG(); 76 BUG();
@@ -133,71 +79,133 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
133 size = PAGE_ALIGN(size); 79 size = PAGE_ALIGN(size);
134 order = get_order(size); 80 order = get_order(size);
135 81
136 page = __get_free_pages(gfp, order); 82 vaddr = __get_free_pages(gfp, order);
137 if (!page) { 83 if (!vaddr)
138 BUG();
139 return NULL; 84 return NULL;
140 }
141 85
142 /* 86 /*
143 * we need to ensure that there are no cachelines in use, 87 * we need to ensure that there are no cachelines in use,
144 * or worse dirty in this area. 88 * or worse dirty in this area.
145 */ 89 */
146 flush_dcache_range(virt_to_phys(page), virt_to_phys(page) + size); 90 flush_dcache_range(virt_to_phys((void *)vaddr),
91 virt_to_phys((void *)vaddr) + size);
147 92
93#ifndef CONFIG_MMU
94 ret = (void *)vaddr;
95 /*
96 * Here's the magic! Note if the uncached shadow is not implemented,
97 * it's up to the calling code to also test that condition and make
98 * other arranegments, such as manually flushing the cache and so on.
99 */
100# ifdef CONFIG_XILINX_UNCACHED_SHADOW
101 ret = (void *)((unsigned) ret | UNCACHED_SHADOW_MASK);
102# endif
103 if ((unsigned int)ret > cpuinfo.dcache_base &&
104 (unsigned int)ret < cpuinfo.dcache_high)
105 printk(KERN_WARNING
106 "ERROR: Your cache coherent area is CACHED!!!\n");
107
108 /* dma_handle is same as physical (shadowed) address */
109 *dma_handle = (dma_addr_t)ret;
110#else
148 /* Allocate some common virtual space to map the new pages. */ 111 /* Allocate some common virtual space to map the new pages. */
149 area = get_vm_area(size, VM_ALLOC); 112 area = get_vm_area(size, VM_ALLOC);
150 if (area == NULL) { 113 if (!area) {
151 free_pages(page, order); 114 free_pages(vaddr, order);
152 return NULL; 115 return NULL;
153 } 116 }
154 va = (unsigned long) area->addr; 117 va = (unsigned long) area->addr;
155 ret = (void *)va; 118 ret = (void *)va;
156 119
157 /* This gives us the real physical address of the first page. */ 120 /* This gives us the real physical address of the first page. */
158 *dma_handle = pa = virt_to_bus((void *)page); 121 *dma_handle = pa = virt_to_bus((void *)vaddr);
159 122#endif
160 /* MS: This is the whole magic - use cache inhibit pages */
161 flags = _PAGE_KERNEL | _PAGE_NO_CACHE;
162 123
163 /* 124 /*
164 * Set refcount=1 on all pages in an order>0 125 * free wasted pages. We skip the first page since we know
165 * allocation so that vfree() will actually 126 * that it will have count = 1 and won't require freeing.
166 * free all pages that were allocated. 127 * We also mark the pages in use as reserved so that
128 * remap_page_range works.
167 */ 129 */
168 if (order > 0) { 130 page = virt_to_page(vaddr);
169 struct page *rpage = virt_to_page(page); 131 end = page + (1 << order);
170 for (i = 1; i < (1 << order); i++) 132
171 init_page_count(rpage+i); 133 split_page(page, order);
134
135 for (i = 0; i < size && err == 0; i += PAGE_SIZE) {
136#ifdef CONFIG_MMU
137 /* MS: This is the whole magic - use cache inhibit pages */
138 err = map_page(va + i, pa + i, _PAGE_KERNEL | _PAGE_NO_CACHE);
139#endif
140
141 SetPageReserved(page);
142 page++;
172 } 143 }
173 144
174 err = 0; 145 /* Free the otherwise unused pages. */
175 for (i = 0; i < size && err == 0; i += PAGE_SIZE) 146 while (page < end) {
176 err = map_page(va+i, pa+i, flags); 147 __free_page(page);
148 page++;
149 }
177 150
178 if (err) { 151 if (err) {
179 vfree((void *)va); 152 free_pages(vaddr, order);
180 return NULL; 153 return NULL;
181 } 154 }
182 155
183 return ret; 156 return ret;
184} 157}
185#endif /* CONFIG_MMU */
186EXPORT_SYMBOL(consistent_alloc); 158EXPORT_SYMBOL(consistent_alloc);
187 159
188/* 160/*
189 * free page(s) as defined by the above mapping. 161 * free page(s) as defined by the above mapping.
190 */ 162 */
191void consistent_free(void *vaddr) 163void consistent_free(size_t size, void *vaddr)
192{ 164{
165 struct page *page;
166
193 if (in_interrupt()) 167 if (in_interrupt())
194 BUG(); 168 BUG();
195 169
170 size = PAGE_ALIGN(size);
171
172#ifndef CONFIG_MMU
196 /* Clear SHADOW_MASK bit in address, and free as per usual */ 173 /* Clear SHADOW_MASK bit in address, and free as per usual */
197#ifdef CONFIG_XILINX_UNCACHED_SHADOW 174# ifdef CONFIG_XILINX_UNCACHED_SHADOW
198 vaddr = (void *)((unsigned)vaddr & ~UNCACHED_SHADOW_MASK); 175 vaddr = (void *)((unsigned)vaddr & ~UNCACHED_SHADOW_MASK);
176# endif
177 page = virt_to_page(vaddr);
178
179 do {
180 ClearPageReserved(page);
181 __free_page(page);
182 page++;
183 } while (size -= PAGE_SIZE);
184#else
185 do {
186 pte_t *ptep;
187 unsigned long pfn;
188
189 ptep = pte_offset_kernel(pmd_offset(pgd_offset_k(
190 (unsigned int)vaddr),
191 (unsigned int)vaddr),
192 (unsigned int)vaddr);
193 if (!pte_none(*ptep) && pte_present(*ptep)) {
194 pfn = pte_pfn(*ptep);
195 pte_clear(&init_mm, (unsigned int)vaddr, ptep);
196 if (pfn_valid(pfn)) {
197 page = pfn_to_page(pfn);
198
199 ClearPageReserved(page);
200 __free_page(page);
201 }
202 }
203 vaddr += PAGE_SIZE;
204 } while (size -= PAGE_SIZE);
205
206 /* flush tlb */
207 flush_tlb_all();
199#endif 208#endif
200 vfree(vaddr);
201} 209}
202EXPORT_SYMBOL(consistent_free); 210EXPORT_SYMBOL(consistent_free);
203 211
@@ -221,7 +229,7 @@ void consistent_sync(void *vaddr, size_t size, int direction)
221 case PCI_DMA_NONE: 229 case PCI_DMA_NONE:
222 BUG(); 230 BUG();
223 case PCI_DMA_FROMDEVICE: /* invalidate only */ 231 case PCI_DMA_FROMDEVICE: /* invalidate only */
224 flush_dcache_range(start, end); 232 invalidate_dcache_range(start, end);
225 break; 233 break;
226 case PCI_DMA_TODEVICE: /* writeback only */ 234 case PCI_DMA_TODEVICE: /* writeback only */
227 flush_dcache_range(start, end); 235 flush_dcache_range(start, end);
diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c
index 7af87f4b2c2c..bab922993185 100644
--- a/arch/microblaze/mm/fault.c
+++ b/arch/microblaze/mm/fault.c
@@ -273,16 +273,11 @@ bad_area_nosemaphore:
273 * us unable to handle the page fault gracefully. 273 * us unable to handle the page fault gracefully.
274 */ 274 */
275out_of_memory: 275out_of_memory:
276 if (current->pid == 1) {
277 yield();
278 down_read(&mm->mmap_sem);
279 goto survive;
280 }
281 up_read(&mm->mmap_sem); 276 up_read(&mm->mmap_sem);
282 printk(KERN_WARNING "VM: killing process %s\n", current->comm); 277 if (!user_mode(regs))
283 if (user_mode(regs)) 278 bad_page_fault(regs, address, SIGKILL);
284 do_exit(SIGKILL); 279 else
285 bad_page_fault(regs, address, SIGKILL); 280 pagefault_out_of_memory();
286 return; 281 return;
287 282
288do_sigbus: 283do_sigbus:
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index f42c2dde8b1c..cca3579d4268 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -47,6 +47,7 @@ unsigned long memory_start;
47EXPORT_SYMBOL(memory_start); 47EXPORT_SYMBOL(memory_start);
48unsigned long memory_end; /* due to mm/nommu.c */ 48unsigned long memory_end; /* due to mm/nommu.c */
49unsigned long memory_size; 49unsigned long memory_size;
50EXPORT_SYMBOL(memory_size);
50 51
51/* 52/*
52 * paging_init() sets up the page tables - in fact we've already done this. 53 * paging_init() sets up the page tables - in fact we've already done this.
diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c
index d31312cde6ea..59bf2335a4ce 100644
--- a/arch/microblaze/mm/pgtable.c
+++ b/arch/microblaze/mm/pgtable.c
@@ -42,6 +42,7 @@
42 42
43unsigned long ioremap_base; 43unsigned long ioremap_base;
44unsigned long ioremap_bot; 44unsigned long ioremap_bot;
45EXPORT_SYMBOL(ioremap_bot);
45 46
46/* The maximum lowmem defaults to 768Mb, but this can be configured to 47/* The maximum lowmem defaults to 768Mb, but this can be configured to
47 * another value. 48 * another value.
@@ -161,24 +162,6 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
161 return err; 162 return err;
162} 163}
163 164
164void __init adjust_total_lowmem(void)
165{
166/* TBD */
167#if 0
168 unsigned long max_low_mem = MAX_LOW_MEM;
169
170 if (total_lowmem > max_low_mem) {
171 total_lowmem = max_low_mem;
172#ifndef CONFIG_HIGHMEM
173 printk(KERN_INFO "Warning, memory limited to %ld Mb, use "
174 "CONFIG_HIGHMEM to reach %ld Mb\n",
175 max_low_mem >> 20, total_memory >> 20);
176 total_memory = total_lowmem;
177#endif /* CONFIG_HIGHMEM */
178 }
179#endif
180}
181
182/* 165/*
183 * Map in all of physical memory starting at CONFIG_KERNEL_START. 166 * Map in all of physical memory starting at CONFIG_KERNEL_START.
184 */ 167 */
@@ -206,24 +189,6 @@ void __init mapin_ram(void)
206/* is x a power of 2? */ 189/* is x a power of 2? */
207#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) 190#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0))
208 191
209/*
210 * Set up a mapping for a block of I/O.
211 * virt, phys, size must all be page-aligned.
212 * This should only be called before ioremap is called.
213 */
214void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
215 unsigned int size, int flags)
216{
217 int i;
218
219 if (virt > CONFIG_KERNEL_START && virt < ioremap_bot)
220 ioremap_bot = ioremap_base = virt;
221
222 /* Put it in the page tables. */
223 for (i = 0; i < size; i += PAGE_SIZE)
224 map_page(virt + i, phys + i, flags);
225}
226
227/* Scan the real Linux page tables and return a PTE pointer for 192/* Scan the real Linux page tables and return a PTE pointer for
228 * a virtual address in a context. 193 * a virtual address in a context.
229 * Returns true (1) if PTE was found, zero otherwise. The pointer to 194 * Returns true (1) if PTE was found, zero otherwise. The pointer to
@@ -274,3 +239,18 @@ unsigned long iopa(unsigned long addr)
274 239
275 return pa; 240 return pa;
276} 241}
242
243__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
244 unsigned long address)
245{
246 pte_t *pte;
247 if (mem_init_done) {
248 pte = (pte_t *)__get_free_page(GFP_KERNEL |
249 __GFP_REPEAT | __GFP_ZERO);
250 } else {
251 pte = (pte_t *)early_get_page();
252 if (pte)
253 clear_page(pte);
254 }
255 return pte;
256}
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index 740bb32ec57e..9cb782b8e036 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -1025,7 +1025,7 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
1025 1025
1026 struct pci_dev *dev = bus->self; 1026 struct pci_dev *dev = bus->self;
1027 1027
1028 for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { 1028 pci_bus_for_each_resource(bus, res, i) {
1029 res = bus->resource[i]; 1029 res = bus->resource[i];
1030 if (!res) 1030 if (!res)
1031 continue; 1031 continue;
@@ -1131,21 +1131,20 @@ static int skip_isa_ioresource_align(struct pci_dev *dev)
1131 * but we want to try to avoid allocating at 0x2900-0x2bff 1131 * but we want to try to avoid allocating at 0x2900-0x2bff
1132 * which might have be mirrored at 0x0100-0x03ff.. 1132 * which might have be mirrored at 0x0100-0x03ff..
1133 */ 1133 */
1134void pcibios_align_resource(void *data, struct resource *res, 1134resource_size_t pcibios_align_resource(void *data, const struct resource *res,
1135 resource_size_t size, resource_size_t align) 1135 resource_size_t size, resource_size_t align)
1136{ 1136{
1137 struct pci_dev *dev = data; 1137 struct pci_dev *dev = data;
1138 resource_size_t start = res->start;
1138 1139
1139 if (res->flags & IORESOURCE_IO) { 1140 if (res->flags & IORESOURCE_IO) {
1140 resource_size_t start = res->start;
1141
1142 if (skip_isa_ioresource_align(dev)) 1141 if (skip_isa_ioresource_align(dev))
1143 return; 1142 return start;
1144 if (start & 0x300) { 1143 if (start & 0x300)
1145 start = (start + 0x3ff) & ~0x3ff; 1144 start = (start + 0x3ff) & ~0x3ff;
1146 res->start = start;
1147 }
1148 } 1145 }
1146
1147 return start;
1149} 1148}
1150EXPORT_SYMBOL(pcibios_align_resource); 1149EXPORT_SYMBOL(pcibios_align_resource);
1151 1150
@@ -1228,7 +1227,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
1228 pr_debug("PCI: Allocating bus resources for %04x:%02x...\n", 1227 pr_debug("PCI: Allocating bus resources for %04x:%02x...\n",
1229 pci_domain_nr(bus), bus->number); 1228 pci_domain_nr(bus), bus->number);
1230 1229
1231 for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { 1230 pci_bus_for_each_resource(bus, res, i) {
1232 res = bus->resource[i]; 1231 res = bus->resource[i];
1233 if (!res || !res->flags 1232 if (!res || !res->flags
1234 || res->start > res->end || res->parent) 1233 || res->start > res->end || res->parent)
@@ -1508,7 +1507,7 @@ void pcibios_finish_adding_to_bus(struct pci_bus *bus)
1508 pci_bus_add_devices(bus); 1507 pci_bus_add_devices(bus);
1509 1508
1510 /* Fixup EEH */ 1509 /* Fixup EEH */
1511 eeh_add_device_tree_late(bus); 1510 /* eeh_add_device_tree_late(bus); */
1512} 1511}
1513EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus); 1512EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus);
1514 1513