Difference between revisions of "R-Car/Boards/Yocto-Gen3-CommonFAQ/How to use upstream kernel on R-Car Gen3 Starter Kit."

From eLinux.org
Jump to: navigation, search
(Add categories)
(separate renesas repository from this page)
 
Line 4: Line 4:
  
 
# Preparing aarch64 cross-compiler
 
# Preparing aarch64 cross-compiler
#: ex.) Build Yocto SDK and install it.
+
#: It is enough to execute one of the following:
#: Steps from here is based on using yocto SDK.
+
## Using gcc-aarch64-linux-gnu
#: Please refer to the [[R-Car/Boards/Yocto-Gen3#Build_SDK]]
+
##: <syntaxhighlight lang=bash>
# How to build kernel of Stable/Development's repository
+
sudo apt install g++-aarch64-linux-gnu
#:<syntaxhighlight lang=bash>
+
export CROSS_COMPILE=aarch64-linux-gnu-
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux
+
export ARCH=arm64
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux
+
</syntaxhighlight>
 +
## Using Yocto SDK
 +
##: Please refer to the [[R-Car/Boards/Yocto-Gen3##Build_SDK]] to install SDK.
 +
##: <syntaxhighlight lang=bash>
 +
source /opt/poky/x.y.z/environment-setup-aarch64-poky-linux
 +
</syntaxhighlight>
 +
## Using other cross compiler(ex. [https://releases.linaro.org/components/toolchain/binaries/ linaro], [https://mirrors.edge.kernel.org/pub/tools/crosstool/ kernel.org] and so on)
 +
##: Set environment variable "CROSS_COMPILE" and "ARCH":
 +
##: <syntaxhighlight lang=bash>
 +
export CROSS_COMPILE=<path/to/compiler>/<compiler_prefix>
 +
export ARCH=arm64
 +
</syntaxhighlight>
 +
# Build kernel
 +
## Build kernel of linus's repository
 +
##: <syntaxhighlight lang=bash>
 +
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 
cd linux
 
cd linux
source /opt/poky/x.y.z/environment-setup-aarch64-poky-linux
+
make defconfig
make ARCH=arm64 defconfig
+
make
make ARCH=arm64
 
 
</syntaxhighlight>
 
</syntaxhighlight>
# How to build kernel of renesas's repository
+
## Build linux stable kernel
#:<syntaxhighlight lang=bash>
+
##: <syntaxhighlight lang=bash>
git clone git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git linux-renesas
+
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git linux-renesas
+
cd renesas-devel
cd linux-renesas
+
git checkout -b tmp <branch name> # ex.) linux-5.8.y, linux-4.19.y and so on.
source /opt/poky/x.y.z/environment-setup-aarch64-poky-linux
+
make renesas_defconfig
make ARCH=arm64 renesas_defconfig
+
make
make ARCH=arm64
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Latest revision as of 03:32, 18 September 2020

How to use upstream kernel on R-Car Gen3 Starter Kit.

By replacing with upstream kernel/dtb, it 's enabled to boot it on Starter Kit.
Below is how to build upstream kernel.

  1. Preparing aarch64 cross-compiler
    It is enough to execute one of the following:
    1. Using gcc-aarch64-linux-gnu
      sudo apt install g++-aarch64-linux-gnu
      export CROSS_COMPILE=aarch64-linux-gnu-
      export ARCH=arm64
      
    2. Using Yocto SDK
      Please refer to the R-Car/Boards/Yocto-Gen3##Build_SDK to install SDK.
      source /opt/poky/x.y.z/environment-setup-aarch64-poky-linux
      
    3. Using other cross compiler(ex. linaro, kernel.org and so on)
      Set environment variable "CROSS_COMPILE" and "ARCH":
      export CROSS_COMPILE=<path/to/compiler>/<compiler_prefix>
      export ARCH=arm64
      
  2. Build kernel
    1. Build kernel of linus's repository
      git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
      cd linux
      make defconfig
      make
      
    2. Build linux stable kernel
      git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
      cd renesas-devel
      git checkout -b tmp <branch name> # ex.) linux-5.8.y, linux-4.19.y and so on.
      make renesas_defconfig
      make
      

See also: