forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'riscv/for-v5.3-rc1' of git://git.kernel.org/pub/scm/linux/…
…kernel/git/riscv/linux Pull RISC-V updates from Paul Walmsley: - Hugepage support - "Image" header support for RISC-V kernel binaries, compatible with the current ARM64 "Image" header - Initial page table setup now split into two stages - CONFIG_SOC support (starting with SiFive SoCs) - Avoid reserving memory between RAM start and the kernel in setup_bootmem() - Enable high-res timers and dynamic tick in the RV64 defconfig - Remove long-deprecated gate area stubs - MAINTAINERS updates to switch to the newly-created shared RISC-V git tree, and to fix a get_maintainers.pl issue for patches involving SiFive E-mail addresses Also, one integration fix to resolve a build problem introduced during in the v5.3-rc1 merge window: - Fix build break after macro-to-function conversion in asm-generic/cacheflush.h * tag 'riscv/for-v5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: fix build break after macro-to-function conversion in generic cacheflush.h RISC-V: Add an Image header that boot loader can parse. RISC-V: Setup initial page tables in two stages riscv: remove free_initrd_mem riscv: ccache: Remove unused variable riscv: Introduce huge page support for 32/64bit kernel x86, arm64: Move ARCH_WANT_HUGE_PMD_SHARE config in arch/Kconfig RISC-V: Fix memory reservation in setup_bootmem() riscv: defconfig: enable SOC_SIFIVE riscv: select SiFive platform drivers with SOC_SIFIVE arch: riscv: add config option for building SiFive's SoC resource riscv: Remove gate area stubs MAINTAINERS: change the arch/riscv git tree to the new shared tree MAINTAINERS: don't automatically patches involving SiFive to the linux-riscv list RISC-V: defconfig: Enable NO_HZ_IDLE and HIGH_RES_TIMERS
- Loading branch information
Showing
24 changed files
with
620 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Boot image header in RISC-V Linux | ||
============================================= | ||
|
||
Author: Atish Patra <[email protected]> | ||
Date : 20 May 2019 | ||
|
||
This document only describes the boot image header details for RISC-V Linux. | ||
The complete booting guide will be available at Documentation/riscv/booting.txt. | ||
|
||
The following 64-byte header is present in decompressed Linux kernel image. | ||
|
||
u32 code0; /* Executable code */ | ||
u32 code1; /* Executable code */ | ||
u64 text_offset; /* Image load offset, little endian */ | ||
u64 image_size; /* Effective Image size, little endian */ | ||
u64 flags; /* kernel flags, little endian */ | ||
u32 version; /* Version of this header */ | ||
u32 res1 = 0; /* Reserved */ | ||
u64 res2 = 0; /* Reserved */ | ||
u64 magic = 0x5643534952; /* Magic number, little endian, "RISCV" */ | ||
u32 res3; /* Reserved for additional RISC-V specific header */ | ||
u32 res4; /* Reserved for PE COFF offset */ | ||
|
||
This header format is compliant with PE/COFF header and largely inspired from | ||
ARM64 header. Thus, both ARM64 & RISC-V header can be combined into one common | ||
header in future. | ||
|
||
Notes: | ||
- This header can also be reused to support EFI stub for RISC-V in future. EFI | ||
specification needs PE/COFF image header in the beginning of the kernel image | ||
in order to load it as an EFI application. In order to support EFI stub, | ||
code0 should be replaced with "MZ" magic string and res5(at offset 0x3c) should | ||
point to the rest of the PE/COFF header. | ||
|
||
- version field indicate header version number. | ||
Bits 0:15 - Minor version | ||
Bits 16:31 - Major version | ||
|
||
This preserves compatibility across newer and older version of the header. | ||
The current version is defined as 0.1. | ||
|
||
- res3 is reserved for offset to any other additional fields. This makes the | ||
header extendible in future. One example would be to accommodate ISA | ||
extension for RISC-V in future. For current version, it is set to be zero. | ||
|
||
- In current header, the flag field has only one field. | ||
Bit 0: Kernel endianness. 1 if BE, 0 if LE. | ||
|
||
- Image size is mandatory for boot loader to load kernel image. Booting will | ||
fail otherwise. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13720,7 +13720,7 @@ RISC-V ARCHITECTURE | |
M: Palmer Dabbelt <[email protected]> | ||
M: Albert Ou <[email protected]> | ||
L: [email protected] | ||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux.git | ||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git | ||
S: Supported | ||
F: arch/riscv/ | ||
K: riscv | ||
|
@@ -14582,7 +14582,7 @@ M: Paul Walmsley <[email protected]> | |
L: [email protected] | ||
T: git git://github.com/sifive/riscv-linux.git | ||
S: Supported | ||
K: sifive | ||
K: [^@]sifive | ||
N: sifive | ||
|
||
SIFIVE FU540 SYSTEM-ON-CHIP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
menu "SoC selection" | ||
|
||
config SOC_SIFIVE | ||
bool "SiFive SoCs" | ||
select SERIAL_SIFIVE | ||
select SERIAL_SIFIVE_CONSOLE | ||
select CLK_SIFIVE | ||
select CLK_SIFIVE_FU540_PRCI | ||
select SIFIVE_PLIC | ||
help | ||
This enables support for SiFive SoC platform hardware. | ||
|
||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
dtb-y += hifive-unleashed-a00.dtb | ||
dtb-$(CONFIG_SOC_SIFIVE) += hifive-unleashed-a00.dtb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _ASM_RISCV_HUGETLB_H | ||
#define _ASM_RISCV_HUGETLB_H | ||
|
||
#include <asm-generic/hugetlb.h> | ||
#include <asm/page.h> | ||
|
||
static inline int is_hugepage_only_range(struct mm_struct *mm, | ||
unsigned long addr, | ||
unsigned long len) { | ||
return 0; | ||
} | ||
|
||
static inline void arch_clear_hugepage_flags(struct page *page) | ||
{ | ||
} | ||
|
||
#endif /* _ASM_RISCV_HUGETLB_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
|
||
#ifndef __ASM_IMAGE_H | ||
#define __ASM_IMAGE_H | ||
|
||
#define RISCV_IMAGE_MAGIC "RISCV" | ||
|
||
#define RISCV_IMAGE_FLAG_BE_SHIFT 0 | ||
#define RISCV_IMAGE_FLAG_BE_MASK 0x1 | ||
|
||
#define RISCV_IMAGE_FLAG_LE 0 | ||
#define RISCV_IMAGE_FLAG_BE 1 | ||
|
||
#ifdef CONFIG_CPU_BIG_ENDIAN | ||
#error conversion of header fields to LE not yet implemented | ||
#else | ||
#define __HEAD_FLAG_BE RISCV_IMAGE_FLAG_LE | ||
#endif | ||
|
||
#define __HEAD_FLAG(field) (__HEAD_FLAG_##field << \ | ||
RISCV_IMAGE_FLAG_##field##_SHIFT) | ||
|
||
#define __HEAD_FLAGS (__HEAD_FLAG(BE)) | ||
|
||
#define RISCV_HEADER_VERSION_MAJOR 0 | ||
#define RISCV_HEADER_VERSION_MINOR 1 | ||
|
||
#define RISCV_HEADER_VERSION (RISCV_HEADER_VERSION_MAJOR << 16 | \ | ||
RISCV_HEADER_VERSION_MINOR) | ||
|
||
#ifndef __ASSEMBLY__ | ||
/** | ||
* struct riscv_image_header - riscv kernel image header | ||
* @code0: Executable code | ||
* @code1: Executable code | ||
* @text_offset: Image load offset (little endian) | ||
* @image_size: Effective Image size (little endian) | ||
* @flags: kernel flags (little endian) | ||
* @version: version | ||
* @res1: reserved | ||
* @res2: reserved | ||
* @magic: Magic number | ||
* @res3: reserved (will be used for additional RISC-V specific | ||
* header) | ||
* @res4: reserved (will be used for PE COFF offset) | ||
* | ||
* The intention is for this header format to be shared between multiple | ||
* architectures to avoid a proliferation of image header formats. | ||
*/ | ||
|
||
struct riscv_image_header { | ||
u32 code0; | ||
u32 code1; | ||
u64 text_offset; | ||
u64 image_size; | ||
u64 flags; | ||
u32 version; | ||
u32 res1; | ||
u64 res2; | ||
u64 magic; | ||
u32 res3; | ||
u32 res4; | ||
}; | ||
#endif /* __ASSEMBLY__ */ | ||
#endif /* __ASM_IMAGE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.