Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-build:generic:raspberrypi [15 May 2019 16:01] – add dt Alexandru Ardeleanresources:tools-software:linux-build:generic:raspberrypi [10 Mar 2022 10:13] (current) – [Building for Raspberry PI] Michael Hennerich
Line 10: Line 10:
 The Raspberry PI branches are: The Raspberry PI branches are:
    * [[https://github.com/analogdevicesinc/linux/tree/rpi-4.9.y|rpi-4.9.y]] - this is an older branch, when Raspberry PI's default kernel version was at 4.9 ; it's kept around for some older boards/setups    * [[https://github.com/analogdevicesinc/linux/tree/rpi-4.9.y|rpi-4.9.y]] - this is an older branch, when Raspberry PI's default kernel version was at 4.9 ; it's kept around for some older boards/setups
-   * [[https://github.com/analogdevicesinc/linux/tree/rpi-4.14.y|rpi-4.14.y]] - the current default Raspberry PI branch, also the official version of Raspbian at this point in time+   * [[https://github.com/analogdevicesinc/linux/tree/rpi-5.10.y|rpi-5.10.y]] - the current default Raspberry PI branch, also the official version of Raspbian at this point in time
    * There maybe be a few other branches that start with **rpi-xxx** ; these should not be used, they will be removed in the future, and were used to test things sometime in the past.    * There maybe be a few other branches that start with **rpi-xxx** ; these should not be used, they will be removed in the future, and were used to test things sometime in the past.
  
Line 31: Line 31:
 ===== Building the ADI kernel - manual cross-compiling ===== ===== Building the ADI kernel - manual cross-compiling =====
  
-Get an ARM compiler for cross-compiling.+Get a toolchain for cross-compiling. 
 + 
 +<code> 
 +git clone https://github.com/raspberrypi/tools 
 +</code> 
 + 
 +Get an ARM compiler for cross-compiling for Pi 3.
  
 <code> <code>
 ARCH=arm make adi_bcm2709_defconfig ARCH=arm make adi_bcm2709_defconfig
 +ARCH=arm CROSS_COMPILE=<path-to-arm-toolchain> make
 +</code>
 +
 +For Pi 4.
 +<code>
 +ARCH=arm make adi_bcm2711_defconfig
 +ARCH=arm CROSS_COMPILE=<path-to-arm-toolchain> make
 +</code>
 +
 +For Pi Zero, Pi Zero 2.
 +<code>
 +ARCH=arm make adi_bcmrpi_defconfig
 ARCH=arm CROSS_COMPILE=<path-to-arm-toolchain> make ARCH=arm CROSS_COMPILE=<path-to-arm-toolchain> make
 </code> </code>
Line 54: Line 72:
 First backup the **kernel7.img** file on the SD-card. First backup the **kernel7.img** file on the SD-card.
  
-The generated **arch/arm/boot/zImage** file should be copied to the /boot to overwrite the **kernel7.img**.+The generated **arch/arm/boot/zImage** file should be copied to the /boot to overwrite the **kernel7.img** (or kernel7l.img for Pi4+, kernel.img for Pi Zero/Pi Zero 2). 
 + 
 +Any drivers built as modules must be installed onto the rootfs: 
 +<code> 
 +make ARM=arm CROSS_COMPILE=<toolchain> INSTALL_MOD_PATH=< path to SD card rootfs> modules_install 
 +</code>
  
 <note important>Always remember to run **sudo sync** or un-mount the SD-card safely so that whatever is copied on it, actually gets flushed to it.</note> <note important>Always remember to run **sudo sync** or un-mount the SD-card safely so that whatever is copied on it, actually gets flushed to it.</note>
Line 71: Line 94:
 https://github.com/analogdevicesinc/linux/commits/rpi-4.14.y/arch/arm/boot/dts/overlays https://github.com/analogdevicesinc/linux/commits/rpi-4.14.y/arch/arm/boot/dts/overlays
  
 +Copy built overlays (usually name <def config name>.dtbo) to the overlays folder onto the boot partition and reference the overlay in config.txt. For example:
 +<code>
 +[all]
 +dtoverlay=rpi-adar1000
 +</code>
resources/tools-software/linux-build/generic/raspberrypi.1557928912.txt.gz · Last modified: 15 May 2019 16:01 by Alexandru Ardelean