1. 03 Apr, 2020 2 commits
    • Damien Le Moal's avatar
      riscv: Add SOC early init support · 335b1390
      Damien Le Moal authored
      Add a mechanism for early SoC initialization for platforms that need
      additional hardware initialization not possible through the regular
      device tree and drivers mechanism. With this, a SoC specific
      initialization function can be called very early, before DTB parsing
      is done by parse_dtb() in Linux RISC-V kernel setup code.
      
      This can be very useful for early hardware initialization for No-MMU
      kernels booted directly in M-mode because it is quite likely that no
      other booting stage exist prior to the No-MMU kernel.
      
      Example use of a SoC early initialization is as follows:
      
      static void vendor_abc_early_init(const void *fdt)
      {
      	/*
      	 * some early init code here that can use simple matches
      	 * against the flat device tree file.
      	 */
      }
      SOC_EARLY_INIT_DECLARE("vendor,abc", abc_early_init);
      
      This early initialization function is executed only if the flat device
      tree for the board has a 'compatible = "vendor,abc"' entry;
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      335b1390
    • Damien Le Moal's avatar
      riscv: Unaligned load/store handling for M_MODE · 956d705d
      Damien Le Moal authored
      Add handlers for unaligned load and store traps that may be generated
      by applications. Code heavily inspired from the OpenSBI project.
      Handling of the unaligned access traps is suitable for applications
      compiled with or without compressed instructions and is independent of
      the kernel CONFIG_RISCV_ISA_C option value.
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      956d705d
  2. 31 Mar, 2020 11 commits
  3. 26 Mar, 2020 11 commits
  4. 06 Mar, 2020 1 commit
    • Atish Patra's avatar
      RISC-V: Move all address space definition macros to one place · 9f40b6e7
      Atish Patra authored
      If both CONFIG_KASAN and CONFIG_SPARSEMEM_VMEMMAP are set, we get the
      following compilation error.
      
      ---------------------------------------------------------------
      ./arch/riscv/include/asm/pgtable-64.h: In function ‘pud_page’:
      ./include/asm-generic/memory_model.h:54:29: error: ‘vmemmap’ undeclared
      (first use in this function); did you mean ‘mem_map’?
       #define __pfn_to_page(pfn) (vmemmap + (pfn))
                                   ^~~~~~~
      ./include/asm-generic/memory_model.h:82:21: note: in expansion of
      macro ‘__pfn_to_page’
      
       #define pfn_to_page __pfn_to_page
                           ^~~~~~~~~~~~~
      ./arch/riscv/include/asm/pgtable-64.h:70:9: note: in expansion of macro
      ‘pfn_to_page’
        return pfn_to_page(pud_val(pud) >> _PAGE_PFN_SHIFT);
      ---------------------------------------------------------------
      
      Fix the compliation errors by moving all the address space definition
      macros before including pgtable-64.h.
      
      Fixes: 8ad8b727 (riscv: Add KASAN support)
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      9f40b6e7
  5. 05 Mar, 2020 1 commit
  6. 03 Mar, 2020 7 commits
  7. 01 Mar, 2020 5 commits
  8. 29 Feb, 2020 2 commits