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

+278 -343
+51 -7
arch/microblaze/configs/mmu_defconfig
··· 1 1 # 2 2 # 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 5 5 # 6 6 CONFIG_MICROBLAZE=y 7 7 # CONFIG_SWAP is not set ··· 22 22 CONFIG_STACKTRACE_SUPPORT=y 23 23 CONFIG_LOCKDEP_SUPPORT=y 24 24 CONFIG_HAVE_LATENCYTOP_SUPPORT=y 25 - # CONFIG_PCI is not set 26 - CONFIG_NO_DMA=y 27 25 CONFIG_DTC=y 28 26 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 29 27 CONFIG_CONSTRUCTORS=y ··· 54 56 CONFIG_IKCONFIG=y 55 57 CONFIG_IKCONFIG_PROC=y 56 58 CONFIG_LOG_BUF_SHIFT=17 57 - # CONFIG_GROUP_SCHED is not set 58 59 # CONFIG_CGROUPS is not set 59 60 CONFIG_SYSFS_DEPRECATED=y 60 61 CONFIG_SYSFS_DEPRECATED_V2=y ··· 103 106 # CONFIG_SLOB is not set 104 107 # CONFIG_PROFILING is not set 105 108 CONFIG_HAVE_OPROFILE=y 109 + CONFIG_HAVE_DMA_ATTRS=y 110 + CONFIG_HAVE_DMA_API_DEBUG=y 106 111 107 112 # 108 113 # GCOV-based kernel profiling ··· 244 245 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 245 246 # CONFIG_HAVE_AOUT is not set 246 247 # CONFIG_BINFMT_MISC is not set 248 + 249 + # 250 + # Bus Options 251 + # 252 + # CONFIG_PCI is not set 253 + # CONFIG_PCI_DOMAINS is not set 254 + # CONFIG_PCI_SYSCALL is not set 255 + # CONFIG_ARCH_SUPPORTS_MSI is not set 247 256 CONFIG_NET=y 248 257 249 258 # 250 259 # Networking options 251 260 # 252 261 CONFIG_PACKET=y 253 - # CONFIG_PACKET_MMAP is not set 254 262 CONFIG_UNIX=y 255 263 CONFIG_XFRM=y 256 264 # CONFIG_XFRM_USER is not set ··· 347 341 # CONFIG_SYS_HYPERVISOR is not set 348 342 # CONFIG_CONNECTOR is not set 349 343 # CONFIG_MTD is not set 344 + CONFIG_OF_FLATTREE=y 350 345 CONFIG_OF_DEVICE=y 346 + CONFIG_OF_MDIO=y 351 347 # CONFIG_PARPORT is not set 352 348 CONFIG_BLK_DEV=y 353 349 # CONFIG_BLK_DEV_COW_COMMON is not set ··· 378 370 # 379 371 # SCSI device support 380 372 # 373 + CONFIG_SCSI_MOD=y 381 374 # CONFIG_RAID_ATTRS is not set 382 375 # CONFIG_SCSI is not set 383 376 # CONFIG_SCSI_DMA is not set ··· 392 383 # CONFIG_EQUALIZER is not set 393 384 # CONFIG_TUN is not set 394 385 # CONFIG_VETH is not set 395 - # CONFIG_PHYLIB is not set 386 + CONFIG_PHYLIB=y 387 + 388 + # 389 + # MII PHY device drivers 390 + # 391 + # CONFIG_MARVELL_PHY is not set 392 + # CONFIG_DAVICOM_PHY is not set 393 + # CONFIG_QSEMI_PHY is not set 394 + # CONFIG_LXT_PHY is not set 395 + # CONFIG_CICADA_PHY is not set 396 + # CONFIG_VITESSE_PHY is not set 397 + # CONFIG_SMSC_PHY is not set 398 + # CONFIG_BROADCOM_PHY is not set 399 + # CONFIG_ICPLUS_PHY is not set 400 + # CONFIG_REALTEK_PHY is not set 401 + # CONFIG_NATIONAL_PHY is not set 402 + # CONFIG_STE10XP is not set 403 + # CONFIG_LSI_ET1011C_PHY is not set 404 + # CONFIG_MICREL_PHY is not set 405 + # CONFIG_FIXED_PHY is not set 406 + # CONFIG_MDIO_BITBANG is not set 396 407 CONFIG_NET_ETHERNET=y 397 408 # CONFIG_MII is not set 409 + # CONFIG_ETHOC is not set 398 410 # CONFIG_DNET is not set 399 411 # CONFIG_IBM_NEW_EMAC_ZMII is not set 400 412 # CONFIG_IBM_NEW_EMAC_RGMII is not set ··· 424 394 # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 425 395 # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 426 396 # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 397 + # CONFIG_B44 is not set 427 398 # CONFIG_KS8842 is not set 428 399 # CONFIG_KS8851_MLL is not set 429 400 CONFIG_XILINX_EMACLITE=y ··· 475 444 CONFIG_SERIAL_UARTLITE_CONSOLE=y 476 445 CONFIG_SERIAL_CORE=y 477 446 CONFIG_SERIAL_CORE_CONSOLE=y 447 + # CONFIG_SERIAL_TIMBERDALE is not set 478 448 # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set 479 449 CONFIG_UNIX98_PTYS=y 480 450 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set ··· 503 471 # CONFIG_HWMON is not set 504 472 # CONFIG_THERMAL is not set 505 473 # CONFIG_WATCHDOG is not set 474 + CONFIG_SSB_POSSIBLE=y 475 + 476 + # 477 + # Sonics Silicon Backplane 478 + # 479 + # CONFIG_SSB is not set 506 480 507 481 # 508 482 # Multifunction device drivers ··· 540 502 # CONFIG_NEW_LEDS is not set 541 503 # CONFIG_ACCESSIBILITY is not set 542 504 # CONFIG_RTC_CLASS is not set 505 + # CONFIG_DMADEVICES is not set 543 506 # CONFIG_AUXDISPLAY is not set 544 507 # CONFIG_UIO is not set 545 508 ··· 611 572 # CONFIG_BEFS_FS is not set 612 573 # CONFIG_BFS_FS is not set 613 574 # CONFIG_EFS_FS is not set 575 + # CONFIG_LOGFS is not set 614 576 # CONFIG_CRAMFS is not set 615 577 # CONFIG_SQUASHFS is not set 616 578 # CONFIG_VXFS_FS is not set ··· 635 595 # CONFIG_RPCSEC_GSS_KRB5 is not set 636 596 # CONFIG_RPCSEC_GSS_SPKM3 is not set 637 597 # CONFIG_SMB_FS is not set 598 + # CONFIG_CEPH_FS is not set 638 599 CONFIG_CIFS=y 639 600 CONFIG_CIFS_STATS=y 640 601 CONFIG_CIFS_STATS2=y ··· 737 696 # CONFIG_DEBUG_OBJECTS is not set 738 697 CONFIG_DEBUG_SLAB=y 739 698 # CONFIG_DEBUG_SLAB_LEAK is not set 699 + # CONFIG_DEBUG_KMEMLEAK is not set 740 700 CONFIG_DEBUG_SPINLOCK=y 741 701 # CONFIG_DEBUG_MUTEXES is not set 742 702 # CONFIG_DEBUG_LOCK_ALLOC is not set ··· 783 741 # CONFIG_KMEMTRACE is not set 784 742 # CONFIG_WORKQUEUE_TRACER is not set 785 743 # CONFIG_BLK_DEV_IO_TRACE is not set 744 + # CONFIG_DMA_API_DEBUG is not set 786 745 # CONFIG_SAMPLES is not set 787 746 CONFIG_EARLY_PRINTK=y 788 747 # CONFIG_HEART_BEAT is not set ··· 905 862 CONFIG_DECOMPRESS_GZIP=y 906 863 CONFIG_HAS_IOMEM=y 907 864 CONFIG_HAS_IOPORT=y 865 + CONFIG_HAS_DMA=y 908 866 CONFIG_HAVE_LMB=y 909 867 CONFIG_NLATTR=y
+33 -6
arch/microblaze/configs/nommu_defconfig
··· 1 1 # 2 2 # 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 5 5 # 6 6 CONFIG_MICROBLAZE=y 7 7 # CONFIG_SWAP is not set ··· 22 22 CONFIG_STACKTRACE_SUPPORT=y 23 23 CONFIG_LOCKDEP_SUPPORT=y 24 24 CONFIG_HAVE_LATENCYTOP_SUPPORT=y 25 - # CONFIG_PCI is not set 26 - CONFIG_NO_DMA=y 27 25 CONFIG_DTC=y 28 26 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 29 27 CONFIG_CONSTRUCTORS=y ··· 56 58 CONFIG_IKCONFIG=y 57 59 CONFIG_IKCONFIG_PROC=y 58 60 CONFIG_LOG_BUF_SHIFT=17 59 - # CONFIG_GROUP_SCHED is not set 60 61 # CONFIG_CGROUPS is not set 61 62 CONFIG_SYSFS_DEPRECATED=y 62 63 CONFIG_SYSFS_DEPRECATED_V2=y ··· 93 96 # CONFIG_MMAP_ALLOW_UNINITIALIZED is not set 94 97 # CONFIG_PROFILING is not set 95 98 CONFIG_HAVE_OPROFILE=y 99 + CONFIG_HAVE_DMA_ATTRS=y 100 + CONFIG_HAVE_DMA_API_DEBUG=y 96 101 97 102 # 98 103 # GCOV-based kernel profiling ··· 208 209 # 209 210 # Advanced setup 210 211 # 212 + # CONFIG_ADVANCED_OPTIONS is not set 211 213 212 214 # 213 215 # Default settings for advanced configuration options are used 214 216 # 217 + CONFIG_LOWMEM_SIZE=0x30000000 215 218 CONFIG_KERNEL_START=0x90000000 219 + CONFIG_TASK_SIZE=0x80000000 216 220 CONFIG_SELECT_MEMORY_MODEL=y 217 221 CONFIG_FLATMEM_MANUAL=y 218 222 # CONFIG_DISCONTIGMEM_MANUAL is not set ··· 237 235 # CONFIG_BINFMT_SHARED_FLAT is not set 238 236 # CONFIG_HAVE_AOUT is not set 239 237 # CONFIG_BINFMT_MISC is not set 238 + 239 + # 240 + # Bus Options 241 + # 242 + # CONFIG_PCI is not set 243 + # CONFIG_PCI_DOMAINS is not set 244 + # CONFIG_PCI_SYSCALL is not set 245 + # CONFIG_ARCH_SUPPORTS_MSI is not set 240 246 CONFIG_NET=y 241 247 242 248 # 243 249 # Networking options 244 250 # 245 251 CONFIG_PACKET=y 246 - # CONFIG_PACKET_MMAP is not set 247 252 CONFIG_UNIX=y 248 253 CONFIG_XFRM=y 249 254 # CONFIG_XFRM_USER is not set ··· 422 413 # UBI - Unsorted block images 423 414 # 424 415 # CONFIG_MTD_UBI is not set 416 + CONFIG_OF_FLATTREE=y 425 417 CONFIG_OF_DEVICE=y 426 418 # CONFIG_PARPORT is not set 427 419 CONFIG_BLK_DEV=y ··· 452 442 # 453 443 # SCSI device support 454 444 # 445 + CONFIG_SCSI_MOD=y 455 446 # CONFIG_RAID_ATTRS is not set 456 447 # CONFIG_SCSI is not set 457 448 # CONFIG_SCSI_DMA is not set ··· 469 458 # CONFIG_PHYLIB is not set 470 459 CONFIG_NET_ETHERNET=y 471 460 # CONFIG_MII is not set 461 + # CONFIG_ETHOC is not set 472 462 # CONFIG_DNET is not set 473 463 # CONFIG_IBM_NEW_EMAC_ZMII is not set 474 464 # CONFIG_IBM_NEW_EMAC_RGMII is not set ··· 478 466 # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 479 467 # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 480 468 # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 469 + # CONFIG_B44 is not set 481 470 # CONFIG_KS8842 is not set 482 471 # CONFIG_KS8851_MLL is not set 483 472 # CONFIG_XILINX_EMACLITE is not set ··· 529 516 CONFIG_SERIAL_UARTLITE_CONSOLE=y 530 517 CONFIG_SERIAL_CORE=y 531 518 CONFIG_SERIAL_CORE_CONSOLE=y 519 + # CONFIG_SERIAL_TIMBERDALE is not set 532 520 # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set 533 521 CONFIG_UNIX98_PTYS=y 534 522 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set ··· 558 544 # CONFIG_HWMON is not set 559 545 # CONFIG_THERMAL is not set 560 546 # CONFIG_WATCHDOG is not set 547 + CONFIG_SSB_POSSIBLE=y 548 + 549 + # 550 + # Sonics Silicon Backplane 551 + # 552 + # CONFIG_SSB is not set 561 553 562 554 # 563 555 # Multifunction device drivers ··· 613 593 # CONFIG_NEW_LEDS is not set 614 594 # CONFIG_ACCESSIBILITY is not set 615 595 # CONFIG_RTC_CLASS is not set 596 + # CONFIG_DMADEVICES is not set 616 597 # CONFIG_AUXDISPLAY is not set 617 598 # CONFIG_UIO is not set 618 599 ··· 682 661 # CONFIG_BFS_FS is not set 683 662 # CONFIG_EFS_FS is not set 684 663 # CONFIG_JFFS2_FS is not set 664 + # CONFIG_LOGFS is not set 685 665 CONFIG_CRAMFS=y 686 666 # CONFIG_SQUASHFS is not set 687 667 # CONFIG_VXFS_FS is not set ··· 711 689 # CONFIG_RPCSEC_GSS_KRB5 is not set 712 690 # CONFIG_RPCSEC_GSS_SPKM3 is not set 713 691 # CONFIG_SMB_FS is not set 692 + # CONFIG_CEPH_FS is not set 714 693 # CONFIG_CIFS is not set 715 694 # CONFIG_NCP_FS is not set 716 695 # CONFIG_CODA_FS is not set ··· 756 733 # CONFIG_DEBUG_OBJECTS_WORK is not set 757 734 CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1 758 735 # CONFIG_DEBUG_SLAB is not set 736 + # CONFIG_DEBUG_KMEMLEAK is not set 759 737 # CONFIG_DEBUG_RT_MUTEXES is not set 760 738 # CONFIG_RT_MUTEX_TESTER is not set 761 739 # CONFIG_DEBUG_SPINLOCK is not set ··· 782 758 # CONFIG_BACKTRACE_SELF_TEST is not set 783 759 # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 784 760 # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set 761 + # CONFIG_LKDTM is not set 785 762 # CONFIG_FAULT_INJECTION is not set 786 763 # CONFIG_LATENCYTOP is not set 787 764 CONFIG_SYSCTL_SYSCALL_CHECK=y ··· 807 782 # CONFIG_WORKQUEUE_TRACER is not set 808 783 # CONFIG_BLK_DEV_IO_TRACE is not set 809 784 # CONFIG_DYNAMIC_DEBUG is not set 785 + # CONFIG_DMA_API_DEBUG is not set 810 786 # CONFIG_SAMPLES is not set 811 787 CONFIG_EARLY_PRINTK=y 812 788 # CONFIG_HEART_BEAT is not set ··· 927 901 CONFIG_ZLIB_INFLATE=y 928 902 CONFIG_HAS_IOMEM=y 929 903 CONFIG_HAS_IOPORT=y 904 + CONFIG_HAS_DMA=y 930 905 CONFIG_HAVE_LMB=y 931 906 CONFIG_NLATTR=y
+1 -1
arch/microblaze/include/asm/cache.h
··· 15 15 16 16 #include <asm/registers.h> 17 17 18 - #define L1_CACHE_SHIFT 2 18 + #define L1_CACHE_SHIFT 5 19 19 /* word-granular cache in microblaze */ 20 20 #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 21 21
+6
arch/microblaze/include/asm/dma.h
··· 18 18 #define MAX_DMA_ADDRESS (CONFIG_KERNEL_START + memory_size - 1) 19 19 #endif 20 20 21 + #ifdef CONFIG_PCI 22 + extern int isa_dma_bridge_buggy; 23 + #else 24 + #define isa_dma_bridge_buggy (0) 25 + #endif 26 + 21 27 #endif /* _ASM_MICROBLAZE_DMA_H */
-6
arch/microblaze/include/asm/exceptions.h
··· 64 64 void die(const char *str, struct pt_regs *fp, long err); 65 65 void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); 66 66 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 - 73 67 #if defined(CONFIG_KGDB) 74 68 void (*debugger)(struct pt_regs *regs); 75 69 int (*debugger_bpt)(struct pt_regs *regs);
-2
arch/microblaze/include/asm/io.h
··· 139 139 140 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 142 #define phys_to_virt(addr) ((void *)__phys_to_virt(addr)) 145 143 #define virt_to_phys(addr) ((unsigned long)__virt_to_phys(addr)) 146 144 #define virt_to_bus(addr) ((unsigned long)__virt_to_phys(addr))
+4 -8
arch/microblaze/include/asm/page.h
··· 31 31 32 32 #ifndef __ASSEMBLY__ 33 33 34 + /* MS be sure that SLAB allocates aligned objects */ 35 + #define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES 36 + 34 37 #define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) 35 38 #define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1))) 36 39 ··· 73 70 74 71 #endif /* CONFIG_MMU */ 75 72 76 - # ifndef CONFIG_MMU 77 - # define copy_page(to, from) memcpy((to), (from), PAGE_SIZE) 78 - # define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 79 - # define free_user_page(page, addr) free_page(addr) 80 - # else /* CONFIG_MMU */ 81 - extern void copy_page(void *to, void *from); 82 - # endif /* CONFIG_MMU */ 83 - 73 + # define copy_page(to, from) memcpy((to), (from), PAGE_SIZE) 84 74 # define clear_page(pgaddr) memset((pgaddr), 0, PAGE_SIZE) 85 75 86 76 # define clear_user_page(pgaddr, vaddr, page) memset((pgaddr), 0, PAGE_SIZE)
-8
arch/microblaze/include/asm/pci.h
··· 94 94 95 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 97 /* The PCI address space does equal the physical memory 106 98 * address space (no IOMMU). The IDE and SCSI device layers use 107 99 * this boolean for bounce buffer decisions.
+1 -15
arch/microblaze/include/asm/pgalloc.h
··· 108 108 #define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); }) 109 109 #define pmd_alloc_one(mm, address) ({ BUG(); ((pmd_t *)2); }) 110 110 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); 126 112 127 113 static inline struct page *pte_alloc_one(struct mm_struct *mm, 128 114 unsigned long address)
+1 -34
arch/microblaze/include/asm/pgtable.h
··· 512 512 extern 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 - */ 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 - 523 - /* 524 515 * Encode and decode a swap entry. 525 516 * Note that the bits we use in a PTE for representing a swap entry 526 517 * must not include the _PAGE_PRESENT bit, or the _PAGE_HASHPTE bit ··· 524 533 #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) >> 2 }) 525 534 #define __swp_entry_to_pte(x) ((pte_t) { (x).val << 2 }) 526 535 527 - 528 - /* CONFIG_APUS */ 529 - /* For virtual address to physical address conversion */ 530 - extern void cache_clear(__u32 addr, int length); 531 - extern void cache_push(__u32 addr, int length); 532 - extern int mm_end_of_chunk(unsigned long addr, int len); 533 536 extern unsigned long iopa(unsigned long addr); 534 - /* extern unsigned long mm_ptov(unsigned long addr) \ 535 - __attribute__ ((const)); TBD */ 536 537 537 538 /* Values for nocacheflag and cmode */ 538 539 /* These are not used by the APUS kernel_map, but prevents ··· 534 551 #define IOMAP_NOCACHE_SER 1 535 552 #define IOMAP_NOCACHE_NONSER 2 536 553 #define IOMAP_NO_COPYBACK 3 537 - 538 - /* 539 - * Map some physical address range into the kernel address space. 540 - */ 541 - extern unsigned long kernel_map(unsigned long paddr, unsigned long size, 542 - int nocacheflag, unsigned long *memavailp); 543 - 544 - /* 545 - * Set cache mode of (kernel space) address range. 546 - */ 547 - extern void kernel_set_cachemode(unsigned long address, unsigned long size, 548 - unsigned int cmode); 549 554 550 555 /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ 551 556 #define kern_addr_valid(addr) (1) ··· 548 577 void do_page_fault(struct pt_regs *regs, unsigned long address, 549 578 unsigned long error_code); 550 579 551 - void __init io_block_mapping(unsigned long virt, phys_addr_t phys, 552 - unsigned int size, int flags); 553 - 554 - void __init adjust_total_lowmem(void); 555 580 void mapin_ram(void); 556 581 int map_page(unsigned long va, phys_addr_t pa, int flags); 557 582 ··· 568 601 extern unsigned long ioremap_bot, ioremap_base; 569 602 570 603 void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle); 571 - void consistent_free(void *vaddr); 604 + void consistent_free(size_t size, void *vaddr); 572 605 void consistent_sync(void *vaddr, size_t size, int direction); 573 606 void consistent_sync_page(struct page *page, unsigned long offset, 574 607 size_t size, int direction);
+1
arch/microblaze/kernel/asm-offsets.c
··· 16 16 #include <linux/hardirq.h> 17 17 #include <linux/thread_info.h> 18 18 #include <linux/kbuild.h> 19 + #include <asm/cpuinfo.h> 19 20 20 21 int main(int argc, char *argv[]) 21 22 {
+40 -32
arch/microblaze/kernel/cpu/cache.c
··· 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 104 #define CACHE_LOOP_LIMITS(start, end, cache_line_length, cache_size) \ 101 105 do { \ 102 106 int align = ~(cache_line_length - 1); \ 103 107 end = min(start + cache_size, end); \ 104 108 start &= align; \ 105 - end = ((end & align) + cache_line_length); \ 106 109 } while (0); 107 110 108 111 /* ··· 114 111 */ 115 112 #define CACHE_ALL_LOOP(cache_size, line_length, op) \ 116 113 do { \ 117 - unsigned int len = cache_size; \ 114 + unsigned int len = cache_size - line_length; \ 118 115 int step = -line_length; \ 119 - BUG_ON(step >= 0); \ 116 + WARN_ON(step >= 0); \ 120 117 \ 121 118 __asm__ __volatile__ (" 1: " #op " %0, r0; \ 122 119 bgtid %0, 1b; \ ··· 125 122 : "memory"); \ 126 123 } while (0); 127 124 128 - 129 - #define CACHE_ALL_LOOP2(cache_size, line_length, op) \ 130 - do { \ 131 - unsigned int len = cache_size; \ 132 - int step = -line_length; \ 133 - BUG_ON(step >= 0); \ 134 - \ 135 - __asm__ __volatile__ (" 1: " #op " r0, %0; \ 136 - bgtid %0, 1b; \ 137 - addk %0, %0, %1; \ 138 - " : : "r" (len), "r" (step) \ 139 - : "memory"); \ 140 - } while (0); 141 - 142 - /* for wdc.flush/clear */ 125 + /* Used for wdc.flush/clear which can use rB for offset which is not possible 126 + * to use for simple wdc or wic. 127 + * 128 + * start address is cache aligned 129 + * end address is not aligned, if end is aligned then I have to substract 130 + * cacheline length because I can't flush/invalidate the next cacheline. 131 + * If is not, I align it because I will flush/invalidate whole line. 132 + */ 143 133 #define CACHE_RANGE_LOOP_2(start, end, line_length, op) \ 144 134 do { \ 145 135 int step = -line_length; \ 136 + int align = ~(line_length - 1); \ 137 + end = ((end & align) == end) ? end - line_length : end & align; \ 146 138 int count = end - start; \ 147 - BUG_ON(count <= 0); \ 139 + WARN_ON(count < 0); \ 148 140 \ 149 141 __asm__ __volatile__ (" 1: " #op " %0, %1; \ 150 142 bgtid %1, 1b; \ ··· 152 154 #define CACHE_RANGE_LOOP_1(start, end, line_length, op) \ 153 155 do { \ 154 156 int volatile temp; \ 155 - BUG_ON(end - start <= 0); \ 157 + int align = ~(line_length - 1); \ 158 + end = ((end & align) == end) ? end - line_length : end & align; \ 159 + WARN_ON(end - start < 0); \ 156 160 \ 157 161 __asm__ __volatile__ (" 1: " #op " %1, r0; \ 158 162 cmpu %0, %1, %2; \ ··· 360 360 #endif 361 361 } 362 362 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 + */ 365 369 static void __invalidate_dcache_all_wb(void) 366 370 { 367 371 #ifndef ASM_LOOP ··· 373 369 #endif 374 370 pr_debug("%s\n", __func__); 375 371 #ifdef ASM_LOOP 376 - CACHE_ALL_LOOP2(cpuinfo.dcache_size, cpuinfo.dcache_line_length, 377 - wdc.clear) 372 + CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length, 373 + wdc) 378 374 #else 379 375 for (i = 0; i < cpuinfo.dcache_size; 380 376 i += cpuinfo.dcache_line_length) 381 - __asm__ __volatile__ ("wdc.clear %0, r0;" \ 377 + __asm__ __volatile__ ("wdc %0, r0;" \ 382 378 : : "r" (i)); 383 379 #endif 384 380 } ··· 397 393 #ifdef ASM_LOOP 398 394 CACHE_RANGE_LOOP_2(start, end, cpuinfo.dcache_line_length, wdc.clear); 399 395 #else 400 - for (i = start; i < end; i += cpuinfo.icache_line_length) 396 + for (i = start; i < end; i += cpuinfo.dcache_line_length) 401 397 __asm__ __volatile__ ("wdc.clear %0, r0;" \ 402 398 : : "r" (i)); 403 399 #endif ··· 417 413 #ifdef ASM_LOOP 418 414 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc); 419 415 #else 420 - for (i = start; i < end; i += cpuinfo.icache_line_length) 416 + for (i = start; i < end; i += cpuinfo.dcache_line_length) 421 417 __asm__ __volatile__ ("wdc %0, r0;" \ 422 418 : : "r" (i)); 423 419 #endif ··· 441 437 #ifdef ASM_LOOP 442 438 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc); 443 439 #else 444 - for (i = start; i < end; i += cpuinfo.icache_line_length) 440 + for (i = start; i < end; i += cpuinfo.dcache_line_length) 445 441 __asm__ __volatile__ ("wdc %0, r0;" \ 446 442 : : "r" (i)); 447 443 #endif ··· 469 465 #ifdef ASM_LOOP 470 466 CACHE_RANGE_LOOP_1(start, end, cpuinfo.dcache_line_length, wdc); 471 467 #else 472 - for (i = start; i < end; i += cpuinfo.icache_line_length) 468 + for (i = start; i < end; i += cpuinfo.dcache_line_length) 473 469 __asm__ __volatile__ ("wdc %0, r0;" \ 474 470 : : "r" (i)); 475 471 #endif ··· 508 504 #ifdef ASM_LOOP 509 505 CACHE_RANGE_LOOP_2(start, end, cpuinfo.dcache_line_length, wdc.flush); 510 506 #else 511 - for (i = start; i < end; i += cpuinfo.icache_line_length) 507 + for (i = start; i < end; i += cpuinfo.dcache_line_length) 512 508 __asm__ __volatile__ ("wdc.flush %0, r0;" \ 513 509 : : "r" (i)); 514 510 #endif ··· 654 650 } 655 651 } 656 652 } 657 - invalidate_dcache(); 653 + /* FIXME Invalidation is done in U-BOOT 654 + * WT cache: Data is already written to main memory 655 + * WB cache: Discard data on noMMU which caused that kernel doesn't boot 656 + */ 657 + /* invalidate_dcache(); */ 658 658 enable_dcache(); 659 659 660 660 invalidate_icache();
+6 -4
arch/microblaze/kernel/cpu/mb.c
··· 98 98 99 99 if (cpuinfo.use_icache) 100 100 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); 103 104 else 104 105 count += seq_printf(m, "Icache:\t\tno\n"); 105 106 106 107 if (cpuinfo.use_dcache) { 107 108 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); 110 112 if (cpuinfo.dcache_wb) 111 113 count += seq_printf(m, "\t\twrite-back\n"); 112 114 else
+1 -1
arch/microblaze/kernel/dma.c
··· 74 74 void *vaddr, dma_addr_t dma_handle) 75 75 { 76 76 #ifdef NOT_COHERENT_CACHE 77 - consistent_free(vaddr); 77 + consistent_free(size, vaddr); 78 78 #else 79 79 free_pages((unsigned long)vaddr, get_order(size)); 80 80 #endif
+1 -1
arch/microblaze/kernel/exceptions.c
··· 121 121 } 122 122 printk(KERN_WARNING "Divide by zero exception " \ 123 123 "in kernel mode.\n"); 124 - die("Divide by exception", regs, SIGBUS); 124 + die("Divide by zero exception", regs, SIGBUS); 125 125 break; 126 126 case MICROBLAZE_FPU_EXCEPTION: 127 127 pr_debug(KERN_WARNING "FPU exception\n");
+2 -1
arch/microblaze/kernel/head.S
··· 28 28 * for more details. 29 29 */ 30 30 31 + #include <linux/init.h> 31 32 #include <linux/linkage.h> 32 33 #include <asm/thread_info.h> 33 34 #include <asm/page.h> ··· 50 49 51 50 #endif /* CONFIG_MMU */ 52 51 53 - .text 52 + __HEAD 54 53 ENTRY(_start) 55 54 #if CONFIG_KERNEL_BASE_ADDR == 0 56 55 brai TOPHYS(real_start)
+2 -1
arch/microblaze/kernel/irq.c
··· 9 9 */ 10 10 11 11 #include <linux/init.h> 12 + #include <linux/ftrace.h> 12 13 #include <linux/kernel.h> 13 14 #include <linux/hardirq.h> 14 15 #include <linux/interrupt.h> ··· 33 32 34 33 static u32 concurrent_irq; 35 34 36 - void do_IRQ(struct pt_regs *regs) 35 + void __irq_entry do_IRQ(struct pt_regs *regs) 37 36 { 38 37 unsigned int irq; 39 38 struct pt_regs *old_regs = set_irq_regs(regs);
-36
arch/microblaze/kernel/misc.S
··· 93 93 nop 94 94 95 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; 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
-34
arch/microblaze/kernel/traps.c
··· 95 95 show_stack(NULL, NULL); 96 96 } 97 97 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
+2 -1
arch/microblaze/kernel/vmlinux.lds.S
··· 24 24 .text : AT(ADDR(.text) - LOAD_OFFSET) { 25 25 _text = . ; 26 26 _stext = . ; 27 - *(.text .text.*) 27 + HEAD_TEXT 28 + TEXT_TEXT 28 29 *(.fixup) 29 30 EXIT_TEXT 30 31 EXIT_CALL
+99 -91
arch/microblaze/mm/consistent.c
··· 42 42 #include <linux/uaccess.h> 43 43 #include <asm/pgtable.h> 44 44 #include <asm/cpuinfo.h> 45 + #include <asm/tlbflush.h> 45 46 46 47 #ifndef CONFIG_MMU 47 - 48 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 53 * Consistent memory allocators. Used for DMA devices that want to ··· 61 60 */ 62 61 void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) 63 62 { 64 - struct page *page, *end, *free; 65 - unsigned long order; 66 - void *ret, *virt; 63 + unsigned long order, vaddr; 64 + void *ret; 65 + unsigned int i, err = 0; 66 + struct page *page, *end; 67 67 68 - if (in_interrupt()) 69 - BUG(); 70 - 71 - size = PAGE_ALIGN(size); 72 - order = get_order(size); 73 - 74 - page = alloc_pages(gfp, order); 75 - if (!page) 76 - goto no_page; 77 - 78 - /* We could do with a page_to_phys and page_to_bus here. */ 79 - virt = page_address(page); 80 - ret = ioremap(virt_to_phys(virt), size); 81 - if (!ret) 82 - goto no_remap; 83 - 84 - /* 85 - * Here's the magic! Note if the uncached shadow is not implemented, 86 - * it's up to the calling code to also test that condition and make 87 - * other arranegments, such as manually flushing the cache and so on. 88 - */ 89 - #ifdef CONFIG_XILINX_UNCACHED_SHADOW 90 - ret = (void *)((unsigned) ret | UNCACHED_SHADOW_MASK); 91 - #endif 92 - /* dma_handle is same as physical (shadowed) address */ 93 - *dma_handle = (dma_addr_t)ret; 94 - 95 - /* 96 - * free wasted pages. We skip the first page since we know 97 - * that it will have count = 1 and won't require freeing. 98 - * We also mark the pages in use as reserved so that 99 - * remap_page_range works. 100 - */ 101 - page = virt_to_page(virt); 102 - free = page + (size >> PAGE_SHIFT); 103 - end = page + (1 << order); 104 - 105 - for (; page < end; page++) { 106 - init_page_count(page); 107 - if (page >= free) 108 - __free_page(page); 109 - else 110 - SetPageReserved(page); 111 - } 112 - 113 - return ret; 114 - no_remap: 115 - __free_pages(page, order); 116 - no_page: 117 - return NULL; 118 - } 119 - 120 - #else 121 - 122 - void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle) 123 - { 124 - int order, err, i; 125 - unsigned long page, va, flags; 68 + #ifdef CONFIG_MMU 126 69 phys_addr_t pa; 127 70 struct vm_struct *area; 128 - void *ret; 71 + unsigned long va; 72 + #endif 129 73 130 74 if (in_interrupt()) 131 75 BUG(); ··· 79 133 size = PAGE_ALIGN(size); 80 134 order = get_order(size); 81 135 82 - page = __get_free_pages(gfp, order); 83 - if (!page) { 84 - BUG(); 136 + vaddr = __get_free_pages(gfp, order); 137 + if (!vaddr) 85 138 return NULL; 86 - } 87 139 88 140 /* 89 141 * we need to ensure that there are no cachelines in use, 90 142 * or worse dirty in this area. 91 143 */ 92 - flush_dcache_range(virt_to_phys(page), virt_to_phys(page) + size); 144 + flush_dcache_range(virt_to_phys((void *)vaddr), 145 + virt_to_phys((void *)vaddr) + size); 93 146 147 + #ifndef CONFIG_MMU 148 + ret = (void *)vaddr; 149 + /* 150 + * Here's the magic! Note if the uncached shadow is not implemented, 151 + * it's up to the calling code to also test that condition and make 152 + * other arranegments, such as manually flushing the cache and so on. 153 + */ 154 + # ifdef CONFIG_XILINX_UNCACHED_SHADOW 155 + ret = (void *)((unsigned) ret | UNCACHED_SHADOW_MASK); 156 + # endif 157 + if ((unsigned int)ret > cpuinfo.dcache_base && 158 + (unsigned int)ret < cpuinfo.dcache_high) 159 + printk(KERN_WARNING 160 + "ERROR: Your cache coherent area is CACHED!!!\n"); 161 + 162 + /* dma_handle is same as physical (shadowed) address */ 163 + *dma_handle = (dma_addr_t)ret; 164 + #else 94 165 /* Allocate some common virtual space to map the new pages. */ 95 166 area = get_vm_area(size, VM_ALLOC); 96 - if (area == NULL) { 97 - free_pages(page, order); 167 + if (!area) { 168 + free_pages(vaddr, order); 98 169 return NULL; 99 170 } 100 171 va = (unsigned long) area->addr; 101 172 ret = (void *)va; 102 173 103 174 /* This gives us the real physical address of the first page. */ 104 - *dma_handle = pa = virt_to_bus((void *)page); 105 - 106 - /* MS: This is the whole magic - use cache inhibit pages */ 107 - flags = _PAGE_KERNEL | _PAGE_NO_CACHE; 175 + *dma_handle = pa = virt_to_bus((void *)vaddr); 176 + #endif 108 177 109 178 /* 110 - * Set refcount=1 on all pages in an order>0 111 - * allocation so that vfree() will actually 112 - * free all pages that were allocated. 179 + * free wasted pages. We skip the first page since we know 180 + * that it will have count = 1 and won't require freeing. 181 + * We also mark the pages in use as reserved so that 182 + * remap_page_range works. 113 183 */ 114 - if (order > 0) { 115 - struct page *rpage = virt_to_page(page); 116 - for (i = 1; i < (1 << order); i++) 117 - init_page_count(rpage+i); 184 + page = virt_to_page(vaddr); 185 + end = page + (1 << order); 186 + 187 + split_page(page, order); 188 + 189 + for (i = 0; i < size && err == 0; i += PAGE_SIZE) { 190 + #ifdef CONFIG_MMU 191 + /* MS: This is the whole magic - use cache inhibit pages */ 192 + err = map_page(va + i, pa + i, _PAGE_KERNEL | _PAGE_NO_CACHE); 193 + #endif 194 + 195 + SetPageReserved(page); 196 + page++; 118 197 } 119 198 120 - err = 0; 121 - for (i = 0; i < size && err == 0; i += PAGE_SIZE) 122 - err = map_page(va+i, pa+i, flags); 199 + /* Free the otherwise unused pages. */ 200 + while (page < end) { 201 + __free_page(page); 202 + page++; 203 + } 123 204 124 205 if (err) { 125 - vfree((void *)va); 206 + free_pages(vaddr, order); 126 207 return NULL; 127 208 } 128 209 129 210 return ret; 130 211 } 131 - #endif /* CONFIG_MMU */ 132 212 EXPORT_SYMBOL(consistent_alloc); 133 213 134 214 /* 135 215 * free page(s) as defined by the above mapping. 136 216 */ 137 - void consistent_free(void *vaddr) 217 + void consistent_free(size_t size, void *vaddr) 138 218 { 219 + struct page *page; 220 + 139 221 if (in_interrupt()) 140 222 BUG(); 141 223 224 + size = PAGE_ALIGN(size); 225 + 226 + #ifndef CONFIG_MMU 142 227 /* Clear SHADOW_MASK bit in address, and free as per usual */ 143 - #ifdef CONFIG_XILINX_UNCACHED_SHADOW 228 + # ifdef CONFIG_XILINX_UNCACHED_SHADOW 144 229 vaddr = (void *)((unsigned)vaddr & ~UNCACHED_SHADOW_MASK); 230 + # endif 231 + page = virt_to_page(vaddr); 232 + 233 + do { 234 + ClearPageReserved(page); 235 + __free_page(page); 236 + page++; 237 + } while (size -= PAGE_SIZE); 238 + #else 239 + do { 240 + pte_t *ptep; 241 + unsigned long pfn; 242 + 243 + ptep = pte_offset_kernel(pmd_offset(pgd_offset_k( 244 + (unsigned int)vaddr), 245 + (unsigned int)vaddr), 246 + (unsigned int)vaddr); 247 + if (!pte_none(*ptep) && pte_present(*ptep)) { 248 + pfn = pte_pfn(*ptep); 249 + pte_clear(&init_mm, (unsigned int)vaddr, ptep); 250 + if (pfn_valid(pfn)) { 251 + page = pfn_to_page(pfn); 252 + 253 + ClearPageReserved(page); 254 + __free_page(page); 255 + } 256 + } 257 + vaddr += PAGE_SIZE; 258 + } while (size -= PAGE_SIZE); 259 + 260 + /* flush tlb */ 261 + flush_tlb_all(); 145 262 #endif 146 - vfree(vaddr); 147 263 } 148 264 EXPORT_SYMBOL(consistent_free); 149 265 ··· 229 221 case PCI_DMA_NONE: 230 222 BUG(); 231 223 case PCI_DMA_FROMDEVICE: /* invalidate only */ 232 - flush_dcache_range(start, end); 224 + invalidate_dcache_range(start, end); 233 225 break; 234 226 case PCI_DMA_TODEVICE: /* writeback only */ 235 227 flush_dcache_range(start, end);
+4 -9
arch/microblaze/mm/fault.c
··· 273 273 * us unable to handle the page fault gracefully. 274 274 */ 275 275 out_of_memory: 276 - if (current->pid == 1) { 277 - yield(); 278 - down_read(&mm->mmap_sem); 279 - goto survive; 280 - } 281 276 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(); 286 281 return; 287 282 288 283 do_sigbus:
+15 -36
arch/microblaze/mm/pgtable.c
··· 161 161 return err; 162 162 } 163 163 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 - 182 164 /* 183 165 * Map in all of physical memory starting at CONFIG_KERNEL_START. 184 166 */ ··· 187 205 188 206 /* is x a power of 2? */ 189 207 #define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) 190 - 191 - /* 192 - * Set up a mapping for a block of I/O. 193 - * virt, phys, size must all be page-aligned. 194 - * This should only be called before ioremap is called. 195 - */ 196 - void __init io_block_mapping(unsigned long virt, phys_addr_t phys, 197 - unsigned int size, int flags) 198 - { 199 - int i; 200 - 201 - if (virt > CONFIG_KERNEL_START && virt < ioremap_bot) 202 - ioremap_bot = ioremap_base = virt; 203 - 204 - /* Put it in the page tables. */ 205 - for (i = 0; i < size; i += PAGE_SIZE) 206 - map_page(virt + i, phys + i, flags); 207 - } 208 208 209 209 /* Scan the real Linux page tables and return a PTE pointer for 210 210 * a virtual address in a context. ··· 237 273 pa = (pte_val(*pte) & PAGE_MASK) | (addr & ~PAGE_MASK); 238 274 239 275 return pa; 276 + } 277 + 278 + __init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, 279 + unsigned long address) 280 + { 281 + pte_t *pte; 282 + if (mem_init_done) { 283 + pte = (pte_t *)__get_free_page(GFP_KERNEL | 284 + __GFP_REPEAT | __GFP_ZERO); 285 + } else { 286 + pte = (pte_t *)early_get_page(); 287 + if (pte) 288 + clear_page(pte); 289 + } 290 + return pte; 240 291 }
+8 -9
arch/microblaze/pci/pci-common.c
··· 1025 1025 1026 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 1029 res = bus->resource[i]; 1030 1030 if (!res) 1031 1031 continue; ··· 1131 1131 * but we want to try to avoid allocating at 0x2900-0x2bff 1132 1132 * which might have be mirrored at 0x0100-0x03ff.. 1133 1133 */ 1134 - void pcibios_align_resource(void *data, struct resource *res, 1134 + resource_size_t pcibios_align_resource(void *data, const struct resource *res, 1135 1135 resource_size_t size, resource_size_t align) 1136 1136 { 1137 1137 struct pci_dev *dev = data; 1138 + resource_size_t start = res->start; 1138 1139 1139 1140 if (res->flags & IORESOURCE_IO) { 1140 - resource_size_t start = res->start; 1141 - 1142 1141 if (skip_isa_ioresource_align(dev)) 1143 - return; 1144 - if (start & 0x300) { 1142 + return start; 1143 + if (start & 0x300) 1145 1144 start = (start + 0x3ff) & ~0x3ff; 1146 - res->start = start; 1147 - } 1148 1145 } 1146 + 1147 + return start; 1149 1148 } 1150 1149 EXPORT_SYMBOL(pcibios_align_resource); 1151 1150 ··· 1227 1228 pr_debug("PCI: Allocating bus resources for %04x:%02x...\n", 1228 1229 pci_domain_nr(bus), bus->number); 1229 1230 1230 - for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { 1231 + pci_bus_for_each_resource(bus, res, i) { 1231 1232 res = bus->resource[i]; 1232 1233 if (!res || !res->flags 1233 1234 || res->start > res->end || res->parent)