]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'master' into devel
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sat, 28 Mar 2009 20:30:18 +0000 (20:30 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 28 Mar 2009 20:30:18 +0000 (20:30 +0000)
Conflicts:
arch/arm/include/asm/elf.h
arch/arm/kernel/module.c

1  2 
arch/arm/include/asm/elf.h
arch/arm/kernel/module.c
arch/arm/mm/mmu.c
drivers/scsi/arm/cumana_2.c

index def8eac6e89d42dbb55078e463d1dc8c07a6bf07,ce3b36e9df81afffb6be14412d59dcbfd49abc7d..d7da19bcf9287f325816dbda4d80083dbf0a7374
@@@ -50,7 -50,7 +50,8 @@@ typedef struct user_fp elf_fpregset_t
  #define R_ARM_ABS32   2
  #define R_ARM_CALL    28
  #define R_ARM_JUMP24  29
+ #define R_ARM_V4BX    40
 +#define R_ARM_PREL31  42
  
  /*
   * These are used to set parameters in the core dumps.
diff --combined arch/arm/kernel/module.c
index 13dbd5bf5cc2e25be8441fb05f0f9150a19400df,9f509fd00fda40fab3888c6f6865e843052aedfe..d1731e39b496cc436a79fbb0631f181e166580e7
@@@ -22,7 -22,6 +22,7 @@@
  
  #include <asm/pgtable.h>
  #include <asm/sections.h>
 +#include <asm/unwind.h>
  
  #ifdef CONFIG_XIP_KERNEL
  /*
@@@ -67,24 -66,6 +67,24 @@@ int module_frob_arch_sections(Elf_Ehdr 
                              char *secstrings,
                              struct module *mod)
  {
 +#ifdef CONFIG_ARM_UNWIND
 +      Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum;
 +
 +      for (s = sechdrs; s < sechdrs_end; s++) {
 +              if (strcmp(".ARM.exidx.init.text", secstrings + s->sh_name) == 0)
 +                      mod->arch.unw_sec_init = s;
 +              else if (strcmp(".ARM.exidx.devinit.text", secstrings + s->sh_name) == 0)
 +                      mod->arch.unw_sec_devinit = s;
 +              else if (strcmp(".ARM.exidx", secstrings + s->sh_name) == 0)
 +                      mod->arch.unw_sec_core = s;
 +              else if (strcmp(".init.text", secstrings + s->sh_name) == 0)
 +                      mod->arch.sec_init_text = s;
 +              else if (strcmp(".devinit.text", secstrings + s->sh_name) == 0)
 +                      mod->arch.sec_devinit_text = s;
 +              else if (strcmp(".text", secstrings + s->sh_name) == 0)
 +                      mod->arch.sec_core_text = s;
 +      }
 +#endif
        return 0;
  }
  
@@@ -123,10 -104,6 +123,10 @@@ apply_relocate(Elf32_Shdr *sechdrs, con
                loc = dstsec->sh_addr + rel->r_offset;
  
                switch (ELF32_R_TYPE(rel->r_info)) {
 +              case R_ARM_NONE:
 +                      /* ignore */
 +                      break;
 +
                case R_ARM_ABS32:
                        *(u32 *)loc += sym->st_value;
                        break;
                        *(u32 *)loc |= offset & 0x00ffffff;
                        break;
  
+              case R_ARM_V4BX:
+                      /* Preserve Rm and the condition code. Alter
+                       * other bits to re-code instruction as
+                       * MOV PC,Rm.
+                       */
+                      *(u32 *)loc &= 0xf000000f;
+                      *(u32 *)loc |= 0x01a0f000;
+                      break;
 +              case R_ARM_PREL31:
 +                      offset = *(u32 *)loc + sym->st_value - loc;
 +                      *(u32 *)loc = offset & 0x7fffffff;
 +                      break;
 +
                default:
                        printk(KERN_ERR "%s: unknown relocation: %u\n",
                               module->name, ELF32_R_TYPE(rel->r_info));
@@@ -178,50 -159,14 +187,50 @@@ apply_relocate_add(Elf32_Shdr *sechdrs
        return -ENOEXEC;
  }
  
 +#ifdef CONFIG_ARM_UNWIND
 +static void register_unwind_tables(struct module *mod)
 +{
 +      if (mod->arch.unw_sec_init && mod->arch.sec_init_text)
 +              mod->arch.unwind_init =
 +                      unwind_table_add(mod->arch.unw_sec_init->sh_addr,
 +                                       mod->arch.unw_sec_init->sh_size,
 +                                       mod->arch.sec_init_text->sh_addr,
 +                                       mod->arch.sec_init_text->sh_size);
 +      if (mod->arch.unw_sec_devinit && mod->arch.sec_devinit_text)
 +              mod->arch.unwind_devinit =
 +                      unwind_table_add(mod->arch.unw_sec_devinit->sh_addr,
 +                                       mod->arch.unw_sec_devinit->sh_size,
 +                                       mod->arch.sec_devinit_text->sh_addr,
 +                                       mod->arch.sec_devinit_text->sh_size);
 +      if (mod->arch.unw_sec_core && mod->arch.sec_core_text)
 +              mod->arch.unwind_core =
 +                      unwind_table_add(mod->arch.unw_sec_core->sh_addr,
 +                                       mod->arch.unw_sec_core->sh_size,
 +                                       mod->arch.sec_core_text->sh_addr,
 +                                       mod->arch.sec_core_text->sh_size);
 +}
 +
 +static void unregister_unwind_tables(struct module *mod)
 +{
 +      unwind_table_del(mod->arch.unwind_init);
 +      unwind_table_del(mod->arch.unwind_devinit);
 +      unwind_table_del(mod->arch.unwind_core);
 +}
 +#else
 +static inline void register_unwind_tables(struct module *mod) { }
 +static inline void unregister_unwind_tables(struct module *mod) { }
 +#endif
 +
  int
  module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
                struct module *module)
  {
 +      register_unwind_tables(module);
        return 0;
  }
  
  void
  module_arch_cleanup(struct module *mod)
  {
 +      unregister_unwind_tables(mod);
  }
diff --combined arch/arm/mm/mmu.c
index 1585814f841491f5aba1a18db80172c35dcb4b81,5a89e57e342dc72a512d5cefef51d85349cd32e8..b438fc4fb77b7bc0fcd838697ef5bef8c75661de
  #include <asm/cputype.h>
  #include <asm/mach-types.h>
  #include <asm/sections.h>
 +#include <asm/cachetype.h>
  #include <asm/setup.h>
  #include <asm/sizes.h>
  #include <asm/tlb.h>
 +#include <asm/highmem.h>
  
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
@@@ -245,10 -243,6 +245,10 @@@ static struct mem_type mem_types[] = 
                .prot_sect = PMD_TYPE_SECT,
                .domain    = DOMAIN_KERNEL,
        },
 +      [MT_MEMORY_NONCACHED] = {
 +              .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
 +              .domain    = DOMAIN_KERNEL,
 +      },
  };
  
  const struct mem_type *get_mem_type(unsigned int type)
@@@ -412,28 -406,9 +412,28 @@@ static void __init build_mem_type_table
                kern_pgprot |= L_PTE_SHARED;
                vecs_pgprot |= L_PTE_SHARED;
                mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
 +              mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
  #endif
        }
  
 +      /*
 +       * Non-cacheable Normal - intended for memory areas that must
 +       * not cause dirty cache line writebacks when used
 +       */
 +      if (cpu_arch >= CPU_ARCH_ARMv6) {
 +              if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
 +                      /* Non-cacheable Normal is XCB = 001 */
 +                      mem_types[MT_MEMORY_NONCACHED].prot_sect |=
 +                              PMD_SECT_BUFFERED;
 +              } else {
 +                      /* For both ARMv6 and non-TEX-remapping ARMv7 */
 +                      mem_types[MT_MEMORY_NONCACHED].prot_sect |=
 +                              PMD_SECT_TEX(1);
 +              }
 +      } else {
 +              mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE;
 +      }
 +
        for (i = 0; i < 16; i++) {
                unsigned long v = pgprot_val(protection_map[i]);
                protection_map[i] = __pgprot(v | user_pgprot);
@@@ -702,10 -677,6 +702,10 @@@ static void __init sanity_check_meminfo
                        if (meminfo.nr_banks >= NR_BANKS) {
                                printk(KERN_CRIT "NR_BANKS too low, "
                                                 "ignoring high memory\n");
 +                      } else if (cache_is_vipt_aliasing()) {
 +                              printk(KERN_CRIT "HIGHMEM is not yet supported "
 +                                               "with VIPT aliasing cache, "
 +                                               "ignoring high memory\n");
                        } else {
                                memmove(bank + 1, bank,
                                        (meminfo.nr_banks - i) * sizeof(*bank));
                 * the vmalloc area.
                 */
                if (__va(bank->start) >= VMALLOC_MIN ||
-                   __va(bank->start) < PAGE_OFFSET) {
+                   __va(bank->start) < (void *)PAGE_OFFSET) {
                        printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx "
                               "(vmalloc region overlap).\n",
                               bank->start, bank->start + bank->size - 1);
@@@ -924,17 -895,6 +924,17 @@@ static void __init devicemaps_init(stru
        flush_cache_all();
  }
  
 +static void __init kmap_init(void)
 +{
 +#ifdef CONFIG_HIGHMEM
 +      pmd_t *pmd = pmd_off_k(PKMAP_BASE);
 +      pte_t *pte = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * sizeof(pte_t));
 +      BUG_ON(!pmd_none(*pmd) || !pte);
 +      __pmd_populate(pmd, __pa(pte) | _PAGE_KERNEL_TABLE);
 +      pkmap_page_table = pte + PTRS_PER_PTE;
 +#endif
 +}
 +
  /*
   * paging_init() sets up the page tables, initialises the zone memory
   * maps, and sets up the zero page, bad page and bad page tables.
@@@ -948,7 -908,6 +948,7 @@@ void __init paging_init(struct machine_
        prepare_page_table();
        bootmem_init();
        devicemaps_init(mdesc);
 +      kmap_init();
  
        top_pmd = pmd_off_k(0xffff0000);
  
index 8ee01b907332fe3fb829243f127ae3c44e708014,ed502b7412d69f8bc8adbc3d62ca99678cb83eb0..c9902b5c1f2b3b788119c9e46a270696eb5abee4
@@@ -318,7 -318,7 +318,7 @@@ cumanascsi_2_set_proc_info(struct Scsi_
  {
        int ret = length;
  
-       if (length >= 11 && strcmp(buffer, "CUMANASCSI2") == 0) {
+       if (length >= 11 && strncmp(buffer, "CUMANASCSI2", 11) == 0) {
                buffer += 11;
                length -= 11;
  
@@@ -390,8 -390,7 +390,8 @@@ static struct scsi_host_template cumana
        .eh_abort_handler               = fas216_eh_abort,
        .can_queue                      = 1,
        .this_id                        = 7,
 -      .sg_tablesize                   = SG_ALL,
 +      .sg_tablesize                   = SCSI_MAX_SG_CHAIN_SEGMENTS,
 +      .dma_boundary                   = IOMD_DMA_BOUNDARY,
        .cmd_per_lun                    = 1,
        .use_clustering                 = DISABLE_CLUSTERING,
        .proc_name                      = "cumanascsi2",