From f6a03a12ecdbe0dd80a55f6df3b7206c5a403a49 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:31 +0400 Subject: xtensa: fix linker script transformation for .text.unlikely Now that binutils generate *.unlikely sections which don't follow documented (info as) literal section naming rules, section name transformation script doesn't work well resulting in the following errors at vmlinux link time: main.c:(.text.unlikely+0x3): dangerous relocation: l32r: literal placed after use: .literal.unlikely Fix section name transformation script by adding specific rule for .text.unlikely sections. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/kernel/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/xtensa/kernel') diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile index 59fc3fe15572..0f9f35fc191a 100644 --- a/arch/xtensa/kernel/Makefile +++ b/arch/xtensa/kernel/Makefile @@ -24,6 +24,7 @@ obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o # Replicate rules in scripts/Makefile.build sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \ + -e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g' \ -e 's/\*(\(\.text\.[a-z]*\))/*(\1.literal \1)/g' quiet_cmd__cpp_lds_S = LDS $@ -- cgit v1.2.1 From 2e6ee5ec88dd9d4d4e934709200259538160039d Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:33 +0400 Subject: xtensa/PCI: fix WT caching attribute Fix caching attributes setup providing correct _PAGE_CA_* names. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/kernel/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/xtensa/kernel') diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c index 69759e9cb3ea..43e9fdce40d6 100644 --- a/arch/xtensa/kernel/pci.c +++ b/arch/xtensa/kernel/pci.c @@ -341,7 +341,7 @@ __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma, int prot = pgprot_val(vma->vm_page_prot); /* Set to write-through */ - prot &= ~_PAGE_NO_CACHE; + prot = (prot & _PAGE_CA_MASK) | _PAGE_CA_WT; #if 0 if (!write_combine) prot |= _PAGE_WRITETHRU; -- cgit v1.2.1 From 33c8213d6930cfa1d09e2912b9e2d59f251c33b7 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:34 +0400 Subject: xtensa: fix xtensa_irq_unmask calls xtensa_irq_disable/xtensa_irq_enable used to call xtensa_irq_unmask with wrong argument. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/kernel/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/xtensa/kernel') diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index 4340ee076bd5..98e77c3ef1c3 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c @@ -84,12 +84,12 @@ static void xtensa_irq_unmask(struct irq_data *d) static void xtensa_irq_enable(struct irq_data *d) { variant_irq_enable(d->irq); - xtensa_irq_unmask(d->irq); + xtensa_irq_unmask(d); } static void xtensa_irq_disable(struct irq_data *d) { - xtensa_irq_mask(d->irq); + xtensa_irq_mask(d); variant_irq_disable(d->irq); } -- cgit v1.2.1 From d38efc1f150f38b7f593ac7e26789c550d4bc183 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:40 +0400 Subject: xtensa: adopt generic io routines Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/kernel/Makefile | 2 +- arch/xtensa/kernel/io.c | 75 --------------------------------------------- 2 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 arch/xtensa/kernel/io.c (limited to 'arch/xtensa/kernel') diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile index 0f9f35fc191a..f36cef5a62ff 100644 --- a/arch/xtensa/kernel/Makefile +++ b/arch/xtensa/kernel/Makefile @@ -6,7 +6,7 @@ extra-y := head.o vmlinux.lds obj-y := align.o entry.o irq.o coprocessor.o process.o ptrace.o \ setup.o signal.o syscall.o time.o traps.o vectors.o platform.o \ - pci-dma.o io.o + pci-dma.o obj-$(CONFIG_KGDB) += xtensa-stub.o obj-$(CONFIG_PCI) += pci.o diff --git a/arch/xtensa/kernel/io.c b/arch/xtensa/kernel/io.c deleted file mode 100644 index 5b65269b1d2f..000000000000 --- a/arch/xtensa/kernel/io.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * arch/xtensa/io.c - * - * IO primitives - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * Copied from sparc. - * - * Chris Zankel - * - */ - -#include -#include - -void outsb(unsigned long addr, const void *src, unsigned long count) { - while (count) { - count -= 1; - writeb(*(const char *)src, addr); - src += 1; - addr += 1; - } -} - -void outsw(unsigned long addr, const void *src, unsigned long count) { - while (count) { - count -= 2; - writew(*(const short *)src, addr); - src += 2; - addr += 2; - } -} - -void outsl(unsigned long addr, const void *src, unsigned long count) { - while (count) { - count -= 4; - writel(*(const long *)src, addr); - src += 4; - addr += 4; - } -} - -void insb(unsigned long addr, void *dst, unsigned long count) { - while (count) { - count -= 1; - *(unsigned char *)dst = readb(addr); - dst += 1; - addr += 1; - } -} - -void insw(unsigned long addr, void *dst, unsigned long count) { - while (count) { - count -= 2; - *(unsigned short *)dst = readw(addr); - dst += 2; - addr += 2; - } -} - -void insl(unsigned long addr, void *dst, unsigned long count) { - while (count) { - count -= 4; - /* - * XXX I am sure we are in for an unaligned trap here. - */ - *(unsigned long *)dst = readl(addr); - dst += 4; - addr += 4; - } -} -- cgit v1.2.1 From fa48cf426926289643b8f35479ba2ff369d4750e Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:43 +0400 Subject: xtensa: change default platform clock frequency to 10MHz Existing simulators show this level of performance. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/kernel/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/xtensa/kernel') diff --git a/arch/xtensa/kernel/platform.c b/arch/xtensa/kernel/platform.c index 1b91a97f1d84..97230e46cbe7 100644 --- a/arch/xtensa/kernel/platform.c +++ b/arch/xtensa/kernel/platform.c @@ -40,8 +40,8 @@ _F(int, pcibios_fixup, (void), { return 0; }); #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT _F(void, calibrate_ccount, (void), { - printk ("ERROR: Cannot calibrate cpu frequency! Assuming 100MHz.\n"); - ccount_per_jiffy = 100 * (1000000UL/HZ); + pr_err("ERROR: Cannot calibrate cpu frequency! Assuming 10MHz.\n"); + ccount_per_jiffy = 10 * (1000000UL/HZ); }); #endif -- cgit v1.2.1 From d3738f407c8ced4fd17dccf6cce729023c735c73 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:56 +0400 Subject: xtensa: add missing symbol exports Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/kernel/pci-dma.c | 4 ++++ arch/xtensa/kernel/xtensa_ksyms.c | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'arch/xtensa/kernel') diff --git a/arch/xtensa/kernel/pci-dma.c b/arch/xtensa/kernel/pci-dma.c index 2783fda76ddc..2d9cc6dbfd78 100644 --- a/arch/xtensa/kernel/pci-dma.c +++ b/arch/xtensa/kernel/pci-dma.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -62,6 +63,7 @@ dma_alloc_coherent(struct device *dev,size_t size,dma_addr_t *handle,gfp_t flag) return (void*)uncached; } +EXPORT_SYMBOL(dma_alloc_coherent); void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) @@ -73,6 +75,7 @@ void dma_free_coherent(struct device *hwdev, size_t size, free_pages(addr, get_order(size)); } +EXPORT_SYMBOL(dma_free_coherent); void consistent_sync(void *vaddr, size_t size, int direction) @@ -92,3 +95,4 @@ void consistent_sync(void *vaddr, size_t size, int direction) break; } } +EXPORT_SYMBOL(consistent_sync); diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c index c9a7c5b74a0d..88fe2f2f376d 100644 --- a/arch/xtensa/kernel/xtensa_ksyms.c +++ b/arch/xtensa/kernel/xtensa_ksyms.c @@ -39,8 +39,12 @@ EXPORT_SYMBOL(memset); EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memmove); +EXPORT_SYMBOL(__strncpy_user); +EXPORT_SYMBOL(clear_page); +EXPORT_SYMBOL(copy_page); EXPORT_SYMBOL(kernel_thread); +EXPORT_SYMBOL(empty_zero_page); /* * gcc internal math functions @@ -56,6 +60,7 @@ extern unsigned int __udivsi3(unsigned int, unsigned int); extern unsigned int __umodsi3(unsigned int, unsigned int); extern unsigned long long __umoddi3(unsigned long long, unsigned long long); extern unsigned long long __udivdi3(unsigned long long, unsigned long long); +extern int __ucmpdi2(int, int); EXPORT_SYMBOL(__ashldi3); EXPORT_SYMBOL(__ashrdi3); @@ -68,11 +73,14 @@ EXPORT_SYMBOL(__udivsi3); EXPORT_SYMBOL(__umodsi3); EXPORT_SYMBOL(__udivdi3); EXPORT_SYMBOL(__umoddi3); +EXPORT_SYMBOL(__ucmpdi2); +EXPORT_SYMBOL(__xtensa_libgcc_window_spill); #ifdef CONFIG_NET /* * Networking support */ +EXPORT_SYMBOL(csum_partial); EXPORT_SYMBOL(csum_partial_copy_generic); #endif /* CONFIG_NET */ -- cgit v1.2.1 From 6907b4564b77cd8a468716ea39dc152e48f03538 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:57 +0400 Subject: xtensa: provide dummy gcc intrinsics __xtensa_libgcc_window_spill is needed for __builtin_return_address(1), but its libgcc implementation cannot be used as it makes a syscall. Atomic intrinsics are used by single staging driver. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/kernel/xtensa_ksyms.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arch/xtensa/kernel') diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c index 88fe2f2f376d..a8b9f1fd1e17 100644 --- a/arch/xtensa/kernel/xtensa_ksyms.c +++ b/arch/xtensa/kernel/xtensa_ksyms.c @@ -74,8 +74,25 @@ EXPORT_SYMBOL(__umodsi3); EXPORT_SYMBOL(__udivdi3); EXPORT_SYMBOL(__umoddi3); EXPORT_SYMBOL(__ucmpdi2); + +void __xtensa_libgcc_window_spill(void) +{ + BUG(); +} EXPORT_SYMBOL(__xtensa_libgcc_window_spill); +unsigned long __sync_fetch_and_and_4(unsigned long *p, unsigned long v) +{ + BUG(); +} +EXPORT_SYMBOL(__sync_fetch_and_and_4); + +unsigned long __sync_fetch_and_or_4(unsigned long *p, unsigned long v) +{ + BUG(); +} +EXPORT_SYMBOL(__sync_fetch_and_or_4); + #ifdef CONFIG_NET /* * Networking support -- cgit v1.2.1 From 9ad79b58510b2845e5ffa77654596d7184a827ab Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 17 Sep 2012 05:44:50 +0400 Subject: xtensa: drop CONFIG_EMBEDDED_RAMDISK Remove Kconfig entries, boot subdirectory, dependencies from other boot-* Makefiles, and sections from ld scripts. Remove stale redboot code that used to pass initrd addresses in a3 and a4 to _start. Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/kernel/setup.c | 12 ------------ arch/xtensa/kernel/vmlinux.lds.S | 5 ----- 2 files changed, 17 deletions(-) (limited to 'arch/xtensa/kernel') diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 17e746f7be60..270360d9806c 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -60,8 +60,6 @@ struct rtc_ops *rtc_ops; #ifdef CONFIG_BLK_DEV_INITRD extern void *initrd_start; extern void *initrd_end; -extern void *__initrd_start; -extern void *__initrd_end; int initrd_is_mapped = 0; extern int initrd_below_start_ok; #endif @@ -79,10 +77,6 @@ static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; sysmem_info_t __initdata sysmem; -#ifdef CONFIG_BLK_DEV_INITRD -int initrd_is_mapped; -#endif - #ifdef CONFIG_MMU extern void init_mmu(void); #else @@ -197,12 +191,6 @@ static int __init parse_bootparam(const bp_tag_t* tag) void __init init_arch(bp_tag_t *bp_start) { - -#ifdef CONFIG_BLK_DEV_INITRD - initrd_start = &__initrd_start; - initrd_end = &__initrd_end; -#endif - sysmem.nr_banks = 0; #ifdef CONFIG_CMDLINE_BOOL diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index ee2e2089483d..255154f820b7 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -222,11 +222,6 @@ SECTIONS . = ALIGN(0x10); .bootstrap : { *(.bootstrap.literal .bootstrap.text .bootstrap.data) } - . = ALIGN(0x1000); - __initrd_start = .; - .initrd : { *(.initrd) } - __initrd_end = .; - .ResetVector.text XCHAL_RESET_VECTOR_VADDR : { *(.ResetVector.text) -- cgit v1.2.1