History

Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze

* 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: Defconfig update microblaze: Optimize CACHE_LOOP_LIMITS and CACHE_RANGE_LOOP macros microblaze: Fix consistent-sync code microblaze: Define correct L1_CACHE_SHIFT value microblaze: cpuinfo shows cache line length microblaze: Fix kmalloc alignment on non-coherent DMA platforms microblaze: Fix typo fault in cache code microblaze: Fix consistent code microblaze: pci-dma: use include/linux/dma-mapping.h microblaze: page.h: Remove get_user_page and free_user_page microblaze: Remove "cache" optimized copy_page function microblaze: invoke oom-killer from page fault microblaze: fix divide by zero exception message microblaze: Add isa_dma_bridge_buggy to dma.h microblaze: Remove ancient code microblaze: Quiet section mismatch warnings for MMU version microblaze: Quiet section mismatch warnings microblaze: Fix IRQ entry/exit ftracing microblaze: resource/PCI: align functions now return start of resource microblaze: PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs

Linus Torvalds committed 16 years ago

Commit e8e8fad2 parents 325ce9e 651341224 files · +278 −343Browse files

Unified · Split

24 files
  1. arch/microblaze/configs/mmu_defconfig +51 −7
  2. arch/microblaze/configs/nommu_defconfig +33 −6
  3. arch/microblaze/include/asm/cache.h +1 −1
  4. arch/microblaze/include/asm/dma.h +6 −0
  5. arch/microblaze/include/asm/exceptions.h +0 −6
  6. arch/microblaze/include/asm/io.h +0 −2
  7. arch/microblaze/include/asm/page.h +4 −8
  8. arch/microblaze/include/asm/pci.h +0 −8
  9. arch/microblaze/include/asm/pgalloc.h +1 −15
  10. arch/microblaze/include/asm/pgtable.h +1 −34
  11. arch/microblaze/kernel/asm-offsets.c +1 −0
  12. arch/microblaze/kernel/cpu/cache.c +40 −32
  13. arch/microblaze/kernel/cpu/mb.c +6 −4
  14. arch/microblaze/kernel/dma.c +1 −1
  15. arch/microblaze/kernel/exceptions.c +1 −1
  16. arch/microblaze/kernel/head.S +2 −1
  17. arch/microblaze/kernel/irq.c +2 −1
  18. arch/microblaze/kernel/misc.S +0 −36
  19. arch/microblaze/kernel/traps.c +0 −34
  20. arch/microblaze/kernel/vmlinux.lds.S +2 −1
  21. arch/microblaze/mm/consistent.c +99 −91
  22. arch/microblaze/mm/fault.c +4 −9
  23. arch/microblaze/mm/pgtable.c +15 −36
  24. arch/microblaze/pci/pci-common.c +8 −9
arch/microblaze/configs/mmu_defconfig+51−7
@@ -1,7 +1,7 @@
11 #
22 # Automatically generated make config: don't edit
3−# Linux kernel version: 2.6.33-rc6
4−# Wed Feb 3 10:02:59 2010
3+# Linux kernel version: 2.6.34-rc6
4+# Thu May 6 11:22:14 2010
55 #
66 CONFIG_MICROBLAZE=y
77 # CONFIG_SWAP is not set
@@ -22,8 +22,6 @@ CONFIG_GENERIC_CSUM=y · 14 unmodified lines
2222 CONFIG_STACKTRACE_SUPPORT=y
2323 CONFIG_LOCKDEP_SUPPORT=y
2424 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
25−# CONFIG_PCI is not set
26−CONFIG_NO_DMA=y
2725 CONFIG_DTC=y
2826 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
2927 CONFIG_CONSTRUCTORS=y
@@ -56,7 +54,6 @@ CONFIG_RCU_FANOUT=32 · 26 unmodified lines
5654 CONFIG_IKCONFIG=y
5755 CONFIG_IKCONFIG_PROC=y
5856 CONFIG_LOG_BUF_SHIFT=17
59−# CONFIG_GROUP_SCHED is not set
6057 # CONFIG_CGROUPS is not set
6158 CONFIG_SYSFS_DEPRECATED=y
6259 CONFIG_SYSFS_DEPRECATED_V2=y
@@ -106,6 +103,8 @@ CONFIG_SLAB=y · 43 unmodified lines
106103 # CONFIG_SLOB is not set
107104 # CONFIG_PROFILING is not set
108105 CONFIG_HAVE_OPROFILE=y
106+CONFIG_HAVE_DMA_ATTRS=y
107+CONFIG_HAVE_DMA_API_DEBUG=y
109108
110109 #
111110 # GCOV-based kernel profiling
@@ -245,13 +244,20 @@ CONFIG_BINFMT_ELF=y · 133 unmodified lines
245244 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
246245 # CONFIG_HAVE_AOUT is not set
247246 # 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
248255 CONFIG_NET=y
249256
250257 #
251258 # Networking options
252259 #
253260 CONFIG_PACKET=y
254−# CONFIG_PACKET_MMAP is not set
255261 CONFIG_UNIX=y
256262 CONFIG_XFRM=y
257263 # CONFIG_XFRM_USER is not set
@@ -341,7 +347,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y · 83 unmodified lines
341347 # CONFIG_SYS_HYPERVISOR is not set
342348 # CONFIG_CONNECTOR is not set
343349 # CONFIG_MTD is not set
350+CONFIG_OF_FLATTREE=y
344351 CONFIG_OF_DEVICE=y
352+CONFIG_OF_MDIO=y
345353 # CONFIG_PARPORT is not set
346354 CONFIG_BLK_DEV=y
347355 # CONFIG_BLK_DEV_COW_COMMON is not set
@@ -370,6 +378,7 @@ CONFIG_MISC_DEVICES=y · 22 unmodified lines
370378 #
371379 # SCSI device support
372380 #
381+CONFIG_SCSI_MOD=y
373382 # CONFIG_RAID_ATTRS is not set
374383 # CONFIG_SCSI is not set
375384 # CONFIG_SCSI_DMA is not set
@@ -383,9 +392,30 @@ CONFIG_NETDEVICES=y · 7 unmodified lines
383392 # CONFIG_EQUALIZER is not set
384393 # CONFIG_TUN is not set
385394 # CONFIG_VETH is not set
386−# CONFIG_PHYLIB is not set
395+CONFIG_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
387416 CONFIG_NET_ETHERNET=y
388417 # CONFIG_MII is not set
418+# CONFIG_ETHOC is not set
389419 # CONFIG_DNET is not set
390420 # CONFIG_IBM_NEW_EMAC_ZMII is not set
391421 # CONFIG_IBM_NEW_EMAC_RGMII is not set
@@ -394,6 +424,7 @@ CONFIG_NET_ETHERNET=y · 2 unmodified lines
394424 # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
395425 # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
396426 # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
427+# CONFIG_B44 is not set
397428 # CONFIG_KS8842 is not set
398429 # CONFIG_KS8851_MLL is not set
399430 CONFIG_XILINX_EMACLITE=y
@@ -444,6 +475,7 @@ CONFIG_SERIAL_UARTLITE=y · 44 unmodified lines
444475 CONFIG_SERIAL_UARTLITE_CONSOLE=y
445476 CONFIG_SERIAL_CORE=y
446477 CONFIG_SERIAL_CORE_CONSOLE=y
478+# CONFIG_SERIAL_TIMBERDALE is not set
447479 # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set
448480 CONFIG_UNIX98_PTYS=y
449481 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
@@ -471,6 +503,12 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y · 21 unmodified lines
471503 # CONFIG_HWMON is not set
472504 # CONFIG_THERMAL is not set
473505 # CONFIG_WATCHDOG is not set
506+CONFIG_SSB_POSSIBLE=y
507+
508+#
509+# Sonics Silicon Backplane
510+#
511+# CONFIG_SSB is not set
474512
475513 #
476514 # Multifunction device drivers
@@ -502,6 +540,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y · 25 unmodified lines
502540 # CONFIG_NEW_LEDS is not set
503541 # CONFIG_ACCESSIBILITY is not set
504542 # CONFIG_RTC_CLASS is not set
543+# CONFIG_DMADEVICES is not set
505544 # CONFIG_AUXDISPLAY is not set
506545 # CONFIG_UIO is not set
507546
@@ -572,6 +611,7 @@ CONFIG_MISC_FILESYSTEMS=y · 64 unmodified lines
572611 # CONFIG_BEFS_FS is not set
573612 # CONFIG_BFS_FS is not set
574613 # CONFIG_EFS_FS is not set
614+# CONFIG_LOGFS is not set
575615 # CONFIG_CRAMFS is not set
576616 # CONFIG_SQUASHFS is not set
577617 # CONFIG_VXFS_FS is not set
@@ -595,6 +635,7 @@ CONFIG_SUNRPC=y · 17 unmodified lines
595635 # CONFIG_RPCSEC_GSS_KRB5 is not set
596636 # CONFIG_RPCSEC_GSS_SPKM3 is not set
597637 # CONFIG_SMB_FS is not set
638+# CONFIG_CEPH_FS is not set
598639 CONFIG_CIFS=y
599640 CONFIG_CIFS_STATS=y
600641 CONFIG_CIFS_STATS2=y
@@ -696,6 +737,7 @@ CONFIG_SCHED_DEBUG=y · 95 unmodified lines
696737 # CONFIG_DEBUG_OBJECTS is not set
697738 CONFIG_DEBUG_SLAB=y
698739 # CONFIG_DEBUG_SLAB_LEAK is not set
740+# CONFIG_DEBUG_KMEMLEAK is not set
699741 CONFIG_DEBUG_SPINLOCK=y
700742 # CONFIG_DEBUG_MUTEXES is not set
701743 # CONFIG_DEBUG_LOCK_ALLOC is not set
@@ -741,6 +783,7 @@ CONFIG_BRANCH_PROFILE_NONE=y · 39 unmodified lines
741783 # CONFIG_KMEMTRACE is not set
742784 # CONFIG_WORKQUEUE_TRACER is not set
743785 # CONFIG_BLK_DEV_IO_TRACE is not set
786+# CONFIG_DMA_API_DEBUG is not set
744787 # CONFIG_SAMPLES is not set
745788 CONFIG_EARLY_PRINTK=y
746789 # CONFIG_HEART_BEAT is not set
@@ -862,5 +905,6 @@ CONFIG_ZLIB_INFLATE=y · 115 unmodified lines
862905 CONFIG_DECOMPRESS_GZIP=y
863906 CONFIG_HAS_IOMEM=y
864907 CONFIG_HAS_IOPORT=y
908+CONFIG_HAS_DMA=y
865909 CONFIG_HAVE_LMB=y
866910 CONFIG_NLATTR=y
arch/microblaze/configs/nommu_defconfig+33−6
@@ -1,7 +1,7 @@
11 #
22 # Automatically generated make config: don't edit
3−# Linux kernel version: 2.6.33-rc6
4−# Wed Feb 3 10:03:21 2010
3+# Linux kernel version: 2.6.34-rc6
4+# Thu May 6 11:25:12 2010
55 #
66 CONFIG_MICROBLAZE=y
77 # CONFIG_SWAP is not set
@@ -22,8 +22,6 @@ CONFIG_GENERIC_CSUM=y · 14 unmodified lines
2222 CONFIG_STACKTRACE_SUPPORT=y
2323 CONFIG_LOCKDEP_SUPPORT=y
2424 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
25−# CONFIG_PCI is not set
26−CONFIG_NO_DMA=y
2725 CONFIG_DTC=y
2826 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
2927 CONFIG_CONSTRUCTORS=y
@@ -58,7 +56,6 @@ CONFIG_RCU_FANOUT=32 · 28 unmodified lines
5856 CONFIG_IKCONFIG=y
5957 CONFIG_IKCONFIG_PROC=y
6058 CONFIG_LOG_BUF_SHIFT=17
61−# CONFIG_GROUP_SCHED is not set
6259 # CONFIG_CGROUPS is not set
6360 CONFIG_SYSFS_DEPRECATED=y
6461 CONFIG_SYSFS_DEPRECATED_V2=y
@@ -96,6 +93,8 @@ CONFIG_SLAB=y · 31 unmodified lines
9693 # CONFIG_MMAP_ALLOW_UNINITIALIZED is not set
9794 # CONFIG_PROFILING is not set
9895 CONFIG_HAVE_OPROFILE=y
96+CONFIG_HAVE_DMA_ATTRS=y
97+CONFIG_HAVE_DMA_API_DEBUG=y
9998
10099 #
101100 # GCOV-based kernel profiling
@@ -209,11 +208,14 @@ CONFIG_PROC_DEVICETREE=y · 107 unmodified lines
209208 #
210209 # Advanced setup
211210 #
211+# CONFIG_ADVANCED_OPTIONS is not set
212212
213213 #
214214 # Default settings for advanced configuration options are used
215215 #
216+CONFIG_LOWMEM_SIZE=0x30000000
216217 CONFIG_KERNEL_START=0x90000000
218+CONFIG_TASK_SIZE=0x80000000
217219 CONFIG_SELECT_MEMORY_MODEL=y
218220 CONFIG_FLATMEM_MANUAL=y
219221 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -235,13 +237,20 @@ CONFIG_BINFMT_FLAT=y · 15 unmodified lines
235237 # CONFIG_BINFMT_SHARED_FLAT is not set
236238 # CONFIG_HAVE_AOUT is not set
237239 # 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
238248 CONFIG_NET=y
239249
240250 #
241251 # Networking options
242252 #
243253 CONFIG_PACKET=y
244−# CONFIG_PACKET_MMAP is not set
245254 CONFIG_UNIX=y
246255 CONFIG_XFRM=y
247256 # CONFIG_XFRM_USER is not set
@@ -413,6 +422,7 @@ CONFIG_MTD_UCLINUX=y · 165 unmodified lines
413422 # UBI - Unsorted block images
414423 #
415424 # CONFIG_MTD_UBI is not set
425+CONFIG_OF_FLATTREE=y
416426 CONFIG_OF_DEVICE=y
417427 # CONFIG_PARPORT is not set
418428 CONFIG_BLK_DEV=y
@@ -442,6 +452,7 @@ CONFIG_MISC_DEVICES=y · 23 unmodified lines
442452 #
443453 # SCSI device support
444454 #
455+CONFIG_SCSI_MOD=y
445456 # CONFIG_RAID_ATTRS is not set
446457 # CONFIG_SCSI is not set
447458 # CONFIG_SCSI_DMA is not set
@@ -458,6 +469,7 @@ CONFIG_NETDEVICES=y · 10 unmodified lines
458469 # CONFIG_PHYLIB is not set
459470 CONFIG_NET_ETHERNET=y
460471 # CONFIG_MII is not set
472+# CONFIG_ETHOC is not set
461473 # CONFIG_DNET is not set
462474 # CONFIG_IBM_NEW_EMAC_ZMII is not set
463475 # CONFIG_IBM_NEW_EMAC_RGMII is not set
@@ -466,6 +478,7 @@ CONFIG_NET_ETHERNET=y · 2 unmodified lines
466478 # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
467479 # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
468480 # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
481+# CONFIG_B44 is not set
469482 # CONFIG_KS8842 is not set
470483 # CONFIG_KS8851_MLL is not set
471484 # CONFIG_XILINX_EMACLITE is not set
@@ -516,6 +529,7 @@ CONFIG_SERIAL_UARTLITE=y · 44 unmodified lines
516529 CONFIG_SERIAL_UARTLITE_CONSOLE=y
517530 CONFIG_SERIAL_CORE=y
518531 CONFIG_SERIAL_CORE_CONSOLE=y
532+# CONFIG_SERIAL_TIMBERDALE is not set
519533 # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set
520534 CONFIG_UNIX98_PTYS=y
521535 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
@@ -544,6 +558,12 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y · 22 unmodified lines
544558 # CONFIG_HWMON is not set
545559 # CONFIG_THERMAL is not set
546560 # CONFIG_WATCHDOG is not set
561+CONFIG_SSB_POSSIBLE=y
562+
563+#
564+# Sonics Silicon Backplane
565+#
566+# CONFIG_SSB is not set
547567
548568 #
549569 # Multifunction device drivers
@@ -593,6 +613,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y · 43 unmodified lines
593613 # CONFIG_NEW_LEDS is not set
594614 # CONFIG_ACCESSIBILITY is not set
595615 # CONFIG_RTC_CLASS is not set
616+# CONFIG_DMADEVICES is not set
596617 # CONFIG_AUXDISPLAY is not set
597618 # CONFIG_UIO is not set
598619
@@ -661,6 +682,7 @@ CONFIG_MISC_FILESYSTEMS=y · 62 unmodified lines
661682 # CONFIG_BFS_FS is not set
662683 # CONFIG_EFS_FS is not set
663684 # CONFIG_JFFS2_FS is not set
685+# CONFIG_LOGFS is not set
664686 CONFIG_CRAMFS=y
665687 # CONFIG_SQUASHFS is not set
666688 # CONFIG_VXFS_FS is not set
@@ -689,6 +711,7 @@ CONFIG_SUNRPC=y · 22 unmodified lines
689711 # CONFIG_RPCSEC_GSS_KRB5 is not set
690712 # CONFIG_RPCSEC_GSS_SPKM3 is not set
691713 # CONFIG_SMB_FS is not set
714+# CONFIG_CEPH_FS is not set
692715 # CONFIG_CIFS is not set
693716 # CONFIG_NCP_FS is not set
694717 # CONFIG_CODA_FS is not set
@@ -733,6 +756,7 @@ CONFIG_DEBUG_OBJECTS_TIMERS=y · 38 unmodified lines
733756 # CONFIG_DEBUG_OBJECTS_WORK is not set
734757 CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
735758 # CONFIG_DEBUG_SLAB is not set
759+# CONFIG_DEBUG_KMEMLEAK is not set
736760 # CONFIG_DEBUG_RT_MUTEXES is not set
737761 # CONFIG_RT_MUTEX_TESTER is not set
738762 # CONFIG_DEBUG_SPINLOCK is not set
@@ -758,6 +782,7 @@ CONFIG_DEBUG_SG=y · 19 unmodified lines
758782 # CONFIG_BACKTRACE_SELF_TEST is not set
759783 # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
760784 # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
785+# CONFIG_LKDTM is not set
761786 # CONFIG_FAULT_INJECTION is not set
762787 # CONFIG_LATENCYTOP is not set
763788 CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -782,6 +807,7 @@ CONFIG_BRANCH_PROFILE_NONE=y · 18 unmodified lines
782807 # CONFIG_WORKQUEUE_TRACER is not set
783808 # CONFIG_BLK_DEV_IO_TRACE is not set
784809 # CONFIG_DYNAMIC_DEBUG is not set
810+# CONFIG_DMA_API_DEBUG is not set
785811 # CONFIG_SAMPLES is not set
786812 CONFIG_EARLY_PRINTK=y
787813 # CONFIG_HEART_BEAT is not set
@@ -901,5 +927,6 @@ CONFIG_GENERIC_FIND_LAST_BIT=y · 113 unmodified lines
901927 CONFIG_ZLIB_INFLATE=y
902928 CONFIG_HAS_IOMEM=y
903929 CONFIG_HAS_IOPORT=y
930+CONFIG_HAS_DMA=y
904931 CONFIG_HAVE_LMB=y
905932 CONFIG_NLATTR=y
arch/microblaze/include/asm/cache.h+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515
1616 #include <asm/registers.h>
1717
18−#define L1_CACHE_SHIFT 2
18+#define L1_CACHE_SHIFT 5
1919 /* word-granular cache in microblaze */
2020 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
2121
arch/microblaze/include/asm/dma.h+6−0
@@ -18,4 +18,10 @@ · 17 unmodified lines
1818 #define MAX_DMA_ADDRESS (CONFIG_KERNEL_START + memory_size - 1)
1919 #endif
2020
21+#ifdef CONFIG_PCI
22+extern int isa_dma_bridge_buggy;
23+#else
24+#define isa_dma_bridge_buggy (0)
25+#endif
26+
2127 #endif /* _ASM_MICROBLAZE_DMA_H */
arch/microblaze/include/asm/exceptions.h+0−6
@@ -64,12 +64,6 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, · 63 unmodified lines
6464 void die(const char *str, struct pt_regs *fp, long err);
6565 void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
6666
67−#ifdef CONFIG_MMU
68−void __bug(const char *file, int line, void *data);
69−int bad_trap(int trap_num, struct pt_regs *regs);
70−int debug_trap(struct pt_regs *regs);
71−#endif /* CONFIG_MMU */
72−
7367 #if defined(CONFIG_KGDB)
7468 void (*debugger)(struct pt_regs *regs);
7569 int (*debugger_bpt)(struct pt_regs *regs);
arch/microblaze/include/asm/io.h+0−2
@@ -139,8 +139,6 @@ static inline void writel(unsigned int v, volatile void __iomem *addr) · 138 unmodified lines
139139
140140 #ifdef CONFIG_MMU
141141
142−#define mm_ptov(addr) ((void *)__phys_to_virt(addr))
143−#define mm_vtop(addr) ((unsigned long)__virt_to_phys(addr))
144142 #define phys_to_virt(addr) ((void *)__phys_to_virt(addr))
145143 #define virt_to_phys(addr) ((unsigned long)__virt_to_phys(addr))
146144 #define virt_to_bus(addr) ((unsigned long)__virt_to_phys(addr))
arch/microblaze/include/asm/page.h+4−8
@@ -31,6 +31,9 @@ · 30 unmodified lines
3131
3232 #ifndef __ASSEMBLY__
3333
34+/* MS be sure that SLAB allocates aligned objects */
35+#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
36+
3437 #define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1)))
3538 #define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1)))
3639
@@ -70,14 +73,7 @@ typedef unsigned long pte_basic_t; · 33 unmodified lines
7073
7174 #endif /* CONFIG_MMU */
7275
73−# ifndef CONFIG_MMU
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 */
78−extern void copy_page(void *to, void *from);
79−# endif /* CONFIG_MMU */
80−
76+# define copy_page(to, from) memcpy((to), (from), PAGE_SIZE)
8177 # define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE)
8278
8379 # define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE)
arch/microblaze/include/asm/pci.h+0−8
@@ -94,14 +94,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus, · 93 unmodified lines
9494
9595 #define HAVE_PCI_LEGACY 1
9696
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−
10597 /* The PCI address space does equal the physical memory
10698 * address space (no IOMMU). The IDE and SCSI device layers use
10799 * this boolean for bounce buffer decisions.
arch/microblaze/include/asm/pgalloc.h+1−15
@@ -108,21 +108,7 @@ extern inline void free_pgd_slow(pgd_t *pgd) · 107 unmodified lines
108108 #define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); })
109109 #define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); })
110110
111−static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
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−}
111+extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
126112
127113 static inline struct page *pte_alloc_one(struct mm_struct *mm,
128114 unsigned long address)
arch/microblaze/include/asm/pgtable.h+1−34
@@ -511,15 +511,6 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address) · 510 unmodified lines
511511
512512 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
513513
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− */
518−extern int flush_hash_page(unsigned context, unsigned long va, pte_t *ptep);
519−
520−/* Add an HPTE to the hash table */
521−extern void add_hash_page(unsigned context, unsigned long va, pte_t *ptep);
522−
523514 /*
524515 * Encode and decode a swap entry.
525516 * Note that the bits we use in a PTE for representing a swap entry
@@ -533,15 +524,7 @@ extern void add_hash_page(unsigned context, unsigned long va, pte_t *ptep); · 7 unmodified lines
533524 #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 2 })
534525 #define __swp_entry_to_pte(x) ((pte_t) { (x).val << 2 })
535526
536−
537−/* CONFIG_APUS */
538−/* For virtual address to physical address conversion */
539−extern void cache_clear(__u32 addr, int length);
540−extern void cache_push(__u32 addr, int length);
541−extern int mm_end_of_chunk(unsigned long addr, int len);
542527 extern unsigned long iopa(unsigned long addr);
543−/* extern unsigned long mm_ptov(unsigned long addr) \
544− __attribute__ ((const)); TBD */
545528
546529 /* Values for nocacheflag and cmode */
547530 /* These are not used by the APUS kernel_map, but prevents
@@ -552,18 +535,6 @@ extern unsigned long iopa(unsigned long addr); · 4 unmodified lines
552535 #define IOMAP_NOCACHE_NONSER 2
553536 #define IOMAP_NO_COPYBACK 3
554537
555−/*
556− * Map some physical address range into the kernel address space.
557− */
558−extern 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− */
564−extern void kernel_set_cachemode(unsigned long address, unsigned long size,
565− unsigned int cmode);
566−
567538 /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
568539 #define kern_addr_valid(addr) (1)
569540
@@ -577,10 +548,6 @@ extern void kernel_set_cachemode(unsigned long address, unsigned long size, · 7 unmodified lines
577548 void do_page_fault(struct pt_regs *regs, unsigned long address,
578549 unsigned long error_code);
579550
580−void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
581− unsigned int size, int flags);
582−
583−void __init adjust_total_lowmem(void);
584551 void mapin_ram(void);
585552 int map_page(unsigned long va, phys_addr_t pa, int flags);
586553
@@ -601,7 +568,7 @@ void __init *early_get_page(void); · 14 unmodified lines
601568 extern unsigned long ioremap_bot, ioremap_base;
602569
603570 void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle);
604−void consistent_free(void *vaddr);
571+void consistent_free(size_t size, void *vaddr);
605572 void consistent_sync(void *vaddr, size_t size, int direction);
606573 void consistent_sync_page(struct page *page, unsigned long offset,
607574 size_t size, int direction);
arch/microblaze/kernel/asm-offsets.c+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/hardirq.h>
1717 #include <linux/thread_info.h>
1818 #include <linux/kbuild.h>
19+#include <asm/cpuinfo.h>
1920
2021 int main(int argc, char *argv[])
2122 {
arch/microblaze/kernel/cpu/cache.c+40−32
@@ -96,13 +96,16 @@ static inline void __disable_dcache_nomsr(void) · 95 unmodified lines
9696 }
9797
9898
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+ */
100104 #define CACHE_LOOP_LIMITS(start, end, cache_line_length, cache_size) \
101105 do { \
102106 int align = ~(cache_line_length - 1); \
103107 end = min(start + cache_size, end); \
104108 start &= align; \
105− end = ((end & align) + cache_line_length); \
106109 } while (0);
107110
108111 /*
@@ -111,9 +114,9 @@ do { \ · 2 unmodified lines
111114 */
112115 #define CACHE_ALL_LOOP(cache_size, line_length, op) \
113116 do { \
114− unsigned int len = cache_size; \
117+ unsigned int len = cache_size - line_length; \
115118 int step = -line_length; \
116− BUG_ON(step >= 0); \
119+ WARN_ON(step >= 0); \
117120 \
118121 __asm__ __volatile__ (" 1: " #op " %0, r0; \
119122 bgtid %0, 1b; \
@@ -122,26 +125,21 @@ do { \ · 2 unmodified lines
122125 : "memory"); \
123126 } while (0);
124127
125−
126−#define CACHE_ALL_LOOP2(cache_size, line_length, op) \
127−do { \
128− unsigned int len = cache_size; \
129− int step = -line_length; \
130− BUG_ON(step >= 0); \
131− \
132− __asm__ __volatile__ (" 1: " #op " r0, %0; \
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 */
128+/* Used for wdc.flush/clear which can use rB for offset which is not possible
129+ * to use for simple wdc or wic.
130+ *
131+ * start address is cache aligned
132+ * end address is not aligned, if end is aligned then I have to substract
133+ * cacheline length because I can't flush/invalidate the next cacheline.
134+ * If is not, I align it because I will flush/invalidate whole line.
135+ */
140136 #define CACHE_RANGE_LOOP_2(start, end, line_length, op) \
141137 do { \
142138 int step = -line_length; \
139+ int align = ~(line_length - 1); \
140+ end = ((end & align) == end) ? end - line_length : end & align; \
143141 int count = end - start; \
144− BUG_ON(count <= 0); \
142+ WARN_ON(count < 0); \
145143 \
146144 __asm__ __volatile__ (" 1: " #op " %0, %1; \
147145 bgtid %1, 1b; \
@@ -154,7 +152,9 @@ do { \ · 6 unmodified lines
154152 #define CACHE_RANGE_LOOP_1(start, end, line_length, op) \
155153 do { \
156154 int volatile temp; \
157− BUG_ON(end - start <= 0); \
155+ int align = ~(line_length - 1); \
156+ end = ((end & align) == end) ? end - line_length : end & align; \
157+ WARN_ON(end - start < 0); \
158158 \
159159 __asm__ __volatile__ (" 1: " #op " %1, r0; \
160160 cmpu %0, %1, %2; \
@@ -360,8 +360,12 @@ static void __invalidate_dcache_all_noirq_wt(void) · 199 unmodified lines
360360 #endif
361361 }
362362
363−/* FIXME this is weird - should be only wdc but not work
364− * MS: I am getting bus errors and other weird things */
363+/* FIXME It is blindly invalidation as is expected
364+ * but can't be called on noMMU in microblaze_cache_init below
365+ *
366+ * MS: noMMU kernel won't boot if simple wdc is used
367+ * The reason should be that there are discared data which kernel needs
368+ */
365369 static void __invalidate_dcache_all_wb(void)
366370 {
367371 #ifndef ASM_LOOP
@@ -369,12 +373,12 @@ static void __invalidate_dcache_all_wb(void) · 1 unmodified line
369373 #endif
370374 pr_debug("%s\n", __func__);
371375 #ifdef ASM_LOOP
372− CACHE_ALL_LOOP2(cpuinfo.dcache_size, cpuinfo.dcache_line_length,
373− wdc.clear)
376+ CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length,
377+ wdc)
374378 #else
375379 for (i = 0; i < cpuinfo.dcache_size;
376380 i += cpuinfo.dcache_line_length)
377− __asm__ __volatile__ ("wdc.clear %0, r0;" \
381+ __asm__ __volatile__ ("wdc %0, r0;" \
378382 : : "r" (i));
379383 #endif
380384 }
@@ -393,7 +397,7 @@ static void __invalidate_dcache_range_wb(unsigned long start, · 12 unmodified lines
393397 #ifdef ASM_LOOP
394398 CACHE_RANGE_LOOP_2(start, end, cpuinfo.dcache_line_length, wdc.clear);
395399 #else
396− for (i = start; i < end; i += cpuinfo.icache_line_length)
400+ for (i = start; i < end; i += cpuinfo.dcache_line_length)
397401 __asm__ __volatile__ ("wdc.clear %0, r0;" \
398402 : : "r" (i));
399403 #endif
@@ -413,7 +417,7 @@ static void __invalidate_dcache_range_nomsr_wt(unsigned long start, · 13 unmodified lines
413417 #ifdef ASM_LOOP
414418 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc);
415419 #else
416− for (i = start; i < end; i += cpuinfo.icache_line_length)
420+ for (i = start; i < end; i += cpuinfo.dcache_line_length)
417421 __asm__ __volatile__ ("wdc %0, r0;" \
418422 : : "r" (i));
419423 #endif
@@ -437,7 +441,7 @@ static void __invalidate_dcache_range_msr_irq_wt(unsigned long start, · 17 unmodified lines
437441 #ifdef ASM_LOOP
438442 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc);
439443 #else
440− for (i = start; i < end; i += cpuinfo.icache_line_length)
444+ for (i = start; i < end; i += cpuinfo.dcache_line_length)
441445 __asm__ __volatile__ ("wdc %0, r0;" \
442446 : : "r" (i));
443447 #endif
@@ -465,7 +469,7 @@ static void __invalidate_dcache_range_nomsr_irq(unsigned long start, · 21 unmodified lines
465469 #ifdef ASM_LOOP
466470 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc);
467471 #else
468− for (i = start; i < end; i += cpuinfo.icache_line_length)
472+ for (i = start; i < end; i += cpuinfo.dcache_line_length)
469473 __asm__ __volatile__ ("wdc %0, r0;" \
470474 : : "r" (i));
471475 #endif
@@ -504,7 +508,7 @@ static void __flush_dcache_range_wb(unsigned long start, unsigned long end) · 32 unmodified lines
504508 #ifdef ASM_LOOP
505509 CACHE_RANGE_LOOP_2(start, end, cpuinfo.dcache_line_length, wdc.flush);
506510 #else
507− for (i = start; i < end; i += cpuinfo.icache_line_length)
511+ for (i = start; i < end; i += cpuinfo.dcache_line_length)
508512 __asm__ __volatile__ ("wdc.flush %0, r0;" \
509513 : : "r" (i));
510514 #endif
@@ -650,7 +654,11 @@ void microblaze_cache_init(void) · 139 unmodified lines
650654 }
651655 }
652656 }
653− invalidate_dcache();
657+/* FIXME Invalidation is done in U-BOOT
658+ * WT cache: Data is already written to main memory
659+ * WB cache: Discard data on noMMU which caused that kernel doesn't boot
660+ */
661+ /* invalidate_dcache(); */
654662 enable_dcache();
655663
656664 invalidate_icache();
arch/microblaze/kernel/cpu/mb.c+6−4
@@ -98,15 +98,17 @@ static int show_cpuinfo(struct seq_file *m, void *v) · 97 unmodified lines
9898
9999 if (cpuinfo.use_icache)
100100 count += seq_printf(m,
101− "Icache:\t\t%ukB\n",
102− cpuinfo.icache_size >> 10);
101+ "Icache:\t\t%ukB\tline length:\t%dB\n",
102+ cpuinfo.icache_size >> 10,
103+ cpuinfo.icache_line_length);
103104 else
104105 count += seq_printf(m, "Icache:\t\tno\n");
105106
106107 if (cpuinfo.use_dcache) {
107108 count += seq_printf(m,
108− "Dcache:\t\t%ukB\n",
109− cpuinfo.dcache_size >> 10);
109+ "Dcache:\t\t%ukB\tline length:\t%dB\n",
110+ cpuinfo.dcache_size >> 10,
111+ cpuinfo.dcache_line_length);
110112 if (cpuinfo.dcache_wb)
111113 count += seq_printf(m, "\t\twrite-back\n");
112114 else
arch/microblaze/kernel/dma.c+1−1
@@ -74,7 +74,7 @@ static void dma_direct_free_coherent(struct device *dev, size_t size, · 73 unmodified lines
7474 void *vaddr, dma_addr_t dma_handle)
7575 {
7676 #ifdef NOT_COHERENT_CACHE
77− consistent_free(vaddr);
77+ consistent_free(size, vaddr);
7878 #else
7979 free_pages((unsigned long)vaddr, get_order(size));
8080 #endif
arch/microblaze/kernel/exceptions.c+1−1
@@ -121,7 +121,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, · 120 unmodified lines
121121 }
122122 printk(KERN_WARNING "Divide by zero exception " \
123123 "in kernel mode.\n");
124− die("Divide by exception", regs, SIGBUS);
124+ die("Divide by zero exception", regs, SIGBUS);
125125 break;
126126 case MICROBLAZE_FPU_EXCEPTION:
127127 pr_debug(KERN_WARNING "FPU exception\n");
arch/microblaze/kernel/head.S+2−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 * for more details.
2929 */
3030
31+#include <linux/init.h>
3132 #include <linux/linkage.h>
3233 #include <asm/thread_info.h>
3334 #include <asm/page.h>
@@ -49,7 +50,7 @@ swapper_pg_dir: · 15 unmodified lines
4950
5051 #endif /* CONFIG_MMU */
5152
52− .text
53+ __HEAD
5354 ENTRY(_start)
5455 #if CONFIG_KERNEL_BASE_ADDR == 0
5556 brai TOPHYS(real_start)
arch/microblaze/kernel/irq.c+2−1
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 */
1010
1111 #include <linux/init.h>
12+#include <linux/ftrace.h>
1213 #include <linux/kernel.h>
1314 #include <linux/hardirq.h>
1415 #include <linux/interrupt.h>
@@ -32,7 +33,7 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map); · 17 unmodified lines
3233
3334 static u32 concurrent_irq;
3435
35−void do_IRQ(struct pt_regs *regs)
36+void __irq_entry do_IRQ(struct pt_regs *regs)
3637 {
3738 unsigned int irq;
3839 struct pt_regs *old_regs = set_irq_regs(regs);
arch/microblaze/kernel/misc.S+0−36
@@ -93,39 +93,3 @@ early_console_reg_tlb_alloc: · 92 unmodified lines
9393 nop
9494
9595 .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;
117−copy_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
arch/microblaze/kernel/traps.c+0−34
@@ -95,37 +95,3 @@ void dump_stack(void) · 94 unmodified lines
9595 show_stack(NULL, NULL);
9696 }
9797 EXPORT_SYMBOL(dump_stack);
98−
99−#ifdef CONFIG_MMU
100−void __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−
111−int 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−
119−int 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
arch/microblaze/kernel/vmlinux.lds.S+2−1
@@ -24,7 +24,8 @@ SECTIONS { · 23 unmodified lines
2424 .text : AT(ADDR(.text) - LOAD_OFFSET) {
2525 _text = . ;
2626 _stext = . ;
27− *(.text .text.*)
27+ HEAD_TEXT
28+ TEXT_TEXT
2829 *(.fixup)
2930 EXIT_TEXT
3031 EXIT_CALL
arch/microblaze/mm/consistent.c+99−91
@@ -42,11 +42,12 @@ · 41 unmodified lines
4242 #include <linux/uaccess.h>
4343 #include <asm/pgtable.h>
4444 #include <asm/cpuinfo.h>
45+#include <asm/tlbflush.h>
4546
4647 #ifndef CONFIG_MMU
47−
4848 /* 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
5051
5152 /*
5253 * Consistent memory allocators. Used for DMA devices that want to
@@ -60,71 +61,16 @@ · 7 unmodified lines
6061 */
6162 void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
6263 {
63− struct page *page, *end, *free;
64− unsigned long order;
65− void *ret, *virt;
66−
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;
113−no_remap:
114− __free_pages(page, order);
115−no_page:
116− return NULL;
117−}
118−
119−#else
64+ unsigned long order, vaddr;
65+ void *ret;
66+ unsigned int i, err = 0;
67+ struct page *page, *end;
12068
121−void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
122−{
123− int order, err, i;
124− unsigned long page, va, flags;
69+#ifdef CONFIG_MMU
12570 phys_addr_t pa;
12671 struct vm_struct *area;
127− void *ret;
72+ unsigned long va;
73+#endif
12874
12975 if (in_interrupt())
13076 BUG();
@@ -133,71 +79,133 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) · 2 unmodified lines
13379 size = PAGE_ALIGN(size);
13480 order = get_order(size);
13581
136− page = __get_free_pages(gfp, order);
137− if (!page) {
138− BUG();
82+ vaddr = __get_free_pages(gfp, order);
83+ if (!vaddr)
13984 return NULL;
140− }
14185
14286 /*
14387 * we need to ensure that there are no cachelines in use,
14488 * or worse dirty in this area.
14589 */
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);
14792
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
148111 /* Allocate some common virtual space to map the new pages. */
149112 area = get_vm_area(size, VM_ALLOC);
150− if (area == NULL) {
151− free_pages(page, order);
113+ if (!area) {
114+ free_pages(vaddr, order);
152115 return NULL;
153116 }
154117 va = (unsigned long) area->addr;
155118 ret = (void *)va;
156119
157120 /* This gives us the real physical address of the first page. */
158− *dma_handle = pa = virt_to_bus((void *)page);
159−
160− /* MS: This is the whole magic - use cache inhibit pages */
161− flags = _PAGE_KERNEL | _PAGE_NO_CACHE;
121+ *dma_handle = pa = virt_to_bus((void *)vaddr);
122+#endif
162123
163124 /*
164− * Set refcount=1 on all pages in an order>0
165− * allocation so that vfree() will actually
166− * free all pages that were allocated.
125+ * free wasted pages. We skip the first page since we know
126+ * that it will have count = 1 and won't require freeing.
127+ * We also mark the pages in use as reserved so that
128+ * remap_page_range works.
167129 */
168− if (order > 0) {
169− struct page *rpage = virt_to_page(page);
170− for (i = 1; i < (1 << order); i++)
171− init_page_count(rpage+i);
130+ page = virt_to_page(vaddr);
131+ end = page + (1 << order);
132+
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++;
172143 }
173144
174− err = 0;
175− for (i = 0; i < size && err == 0; i += PAGE_SIZE)
176− err = map_page(va+i, pa+i, flags);
145+ /* Free the otherwise unused pages. */
146+ while (page < end) {
147+ __free_page(page);
148+ page++;
149+ }
177150
178151 if (err) {
179− vfree((void *)va);
152+ free_pages(vaddr, order);
180153 return NULL;
181154 }
182155
183156 return ret;
184157 }
185−#endif /* CONFIG_MMU */
186158 EXPORT_SYMBOL(consistent_alloc);
187159
188160 /*
189161 * free page(s) as defined by the above mapping.
190162 */
191−void consistent_free(void *vaddr)
163+void consistent_free(size_t size, void *vaddr)
192164 {
165+ struct page *page;
166+
193167 if (in_interrupt())
194168 BUG();
195169
170+ size = PAGE_ALIGN(size);
171+
172+#ifndef CONFIG_MMU
196173 /* Clear SHADOW_MASK bit in address, and free as per usual */
197−#ifdef CONFIG_XILINX_UNCACHED_SHADOW
174+# ifdef CONFIG_XILINX_UNCACHED_SHADOW
198175 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();
199208 #endif
200− vfree(vaddr);
201209 }
202210 EXPORT_SYMBOL(consistent_free);
203211
@@ -221,7 +229,7 @@ void consistent_sync(void *vaddr, size_t size, int direction) · 17 unmodified lines
221229 case PCI_DMA_NONE:
222230 BUG();
223231 case PCI_DMA_FROMDEVICE: /* invalidate only */
224− flush_dcache_range(start, end);
232+ invalidate_dcache_range(start, end);
225233 break;
226234 case PCI_DMA_TODEVICE: /* writeback only */
227235 flush_dcache_range(start, end);
arch/microblaze/mm/fault.c+4−9
@@ -273,16 +273,11 @@ bad_area_nosemaphore: · 272 unmodified lines
273273 * us unable to handle the page fault gracefully.
274274 */
275275 out_of_memory:
276− if (current->pid == 1) {
277− yield();
278− down_read(&mm->mmap_sem);
279− goto survive;
280− }
281276 up_read(&mm->mmap_sem);
282− printk(KERN_WARNING "VM: killing process %s\n", current->comm);
283− if (user_mode(regs))
284− do_exit(SIGKILL);
285− bad_page_fault(regs, address, SIGKILL);
277+ if (!user_mode(regs))
278+ bad_page_fault(regs, address, SIGKILL);
279+ else
280+ pagefault_out_of_memory();
286281 return;
287282
288283 do_sigbus:
arch/microblaze/mm/pgtable.c+15−36
@@ -161,24 +161,6 @@ int map_page(unsigned long va, phys_addr_t pa, int flags) · 160 unmodified lines
161161 return err;
162162 }
163163
164−void __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−
182164 /*
183165 * Map in all of physical memory starting at CONFIG_KERNEL_START.
184166 */
@@ -206,24 +188,6 @@ void __init mapin_ram(void) · 21 unmodified lines
206188 /* is x a power of 2? */
207189 #define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0))
208190
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− */
214−void __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−
227191 /* Scan the real Linux page tables and return a PTE pointer for
228192 * a virtual address in a context.
229193 * Returns true (1) if PTE was found, zero otherwise. The pointer to
@@ -274,3 +238,18 @@ unsigned long iopa(unsigned long addr) · 44 unmodified lines
274238
275239 return pa;
276240 }
241+
242+__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
243+ unsigned long address)
244+{
245+ pte_t *pte;
246+ if (mem_init_done) {
247+ pte = (pte_t *)__get_free_page(GFP_KERNEL |
248+ __GFP_REPEAT | __GFP_ZERO);
249+ } else {
250+ pte = (pte_t *)early_get_page();
251+ if (pte)
252+ clear_page(pte);
253+ }
254+ return pte;
255+}
arch/microblaze/pci/pci-common.c+8−9
@@ -1025,7 +1025,7 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus) · 1024 unmodified lines
10251025
10261026 struct pci_dev *dev = bus->self;
10271027
1028− for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
1028+ pci_bus_for_each_resource(bus, res, i) {
10291029 res = bus->resource[i];
10301030 if (!res)
10311031 continue;
@@ -1131,21 +1131,20 @@ static int skip_isa_ioresource_align(struct pci_dev *dev) · 99 unmodified lines
11311131 * but we want to try to avoid allocating at 0x2900-0x2bff
11321132 * which might have be mirrored at 0x0100-0x03ff..
11331133 */
1134−void pcibios_align_resource(void *data, struct resource *res,
1134+resource_size_t pcibios_align_resource(void *data, const struct resource *res,
11351135 resource_size_t size, resource_size_t align)
11361136 {
11371137 struct pci_dev *dev = data;
1138+ resource_size_t start = res->start;
11381139
11391140 if (res->flags & IORESOURCE_IO) {
1140− resource_size_t start = res->start;
1141−
11421141 if (skip_isa_ioresource_align(dev))
1143− return;
1144− if (start & 0x300) {
1142+ return start;
1143+ if (start & 0x300)
11451144 start = (start + 0x3ff) & ~0x3ff;
1146− res->start = start;
1147− }
11481145 }
1146+
1147+ return start;
11491148 }
11501149 EXPORT_SYMBOL(pcibios_align_resource);
11511150
@@ -1228,7 +1227,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus) · 76 unmodified lines
12281227 pr_debug("PCI: Allocating bus resources for %04x:%02x...\n",
12291228 pci_domain_nr(bus), bus->number);
12301229
1231− for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
1230+ pci_bus_for_each_resource(bus, res, i) {
12321231 res = bus->resource[i];
12331232 if (!res || !res->flags
12341233 || res->start > res->end || res->parent)