diff --git a/.spelling b/.spelling index 440311f..d0cbb5b 100644 --- a/.spelling +++ b/.spelling @@ -88,11 +88,26 @@ update_defconfig init gpios submodule +multimediacard +ums +debian +yocto +kirkstone +mickledore +rockdev - source/vaaman-linux/linux-development-guide/u-boot.md build-u-boot idbloader.img rk3399_loader_v1.xx.xxx.bin flash-u-boot +mainline-u-boot-important +7zip +mmcblk +mmcblkX +rm +resizepart +dd +u-boot-rockchip - source/vaaman-linux/linux-development-guide/linux-kernel.md modules_install INSTALL_MOD_DIR @@ -112,6 +127,31 @@ wipe_all-misc rockchip_rk3399_recovery userdata.img u +debian-bullseye-v1 +ubuntu-focal-v1 +ubuntu-jammy-v1 +yocto-kirkstone-v1 +yocto-mickledore-v1 +buildroot-v1 +android-12 +1-v1 +RK_ROOTFS_SYSTEM +RK_UBUNTU_VERSION +xfce +UBUNTU_FLAVOR +VICHARKA_BOOT_ENABLE_OVERLAYS +packbuild.shdevice +mkRK_UBUNTU_VERSIONjammydevice +RK_DEBIAN_VERSION +lxde +DEBIAN_FLAVOR +linaro-rootfs +bitbake +core-image-sato +core-image-weston +wayland +extboot +updateimg - source/vaaman-linux/linux-configuration-guide/change-uboot-logo.md logo.h - source/vaaman-linux/linux-usage-guide/linux-start-guide.md @@ -213,5 +253,9 @@ GPIO_66 GPIO_62 RX29_CLK2_N 1500000bps +40-pin +40-FPGA - source/vaaman-linux/linux-usage-guide/custom-linux-kernel.md dd + - source/vaaman-linux/linux-usage-guide/u-boot-ums.md +u-boot-ums-mode diff --git a/source/_static/css/custom.css b/source/_static/css/custom.css index b041913..47ceb09 100644 --- a/source/_static/css/custom.css +++ b/source/_static/css/custom.css @@ -1,5 +1,5 @@ body { - font-family: "Inter", "Manrope", sans-serif !important; + font-family: "Geist", "Inter", sans-serif !important; } .contents .caption, diff --git a/source/_static/css/fonts.css b/source/_static/css/fonts.css index bc26204..4d96e1a 100644 --- a/source/_static/css/fonts.css +++ b/source/_static/css/fonts.css @@ -1,51 +1,65 @@ @font-face { - font-family: "Manrope"; + font-family: "Geist"; + font-style: normal; + font-display: auto; + font-weight: 100; + src: url("../fonts/Geist-UltraLight.woff2") format("woff2"); +} +@font-face { + font-family: "Geist"; font-style: normal; font-display: auto; font-weight: 200; - src: url("../fonts/Manrope-ExtraLight.woff2") format("woff2"); + src: url("../fonts/Geist-Thin.woff2") format("woff2"); } @font-face { - font-family: "Manrope"; + font-family: "Geist"; font-style: normal; font-display: auto; font-weight: 300; - src: url("../fonts/Manrope-Light.woff2") format("woff2"); + src: url("../fonts/Geist-Light.woff2") format("woff2"); } @font-face { - font-family: "Manrope"; + font-family: "Geist"; font-style: normal; font-display: auto; font-weight: 400; - src: url("../fonts/Manrope-Regular.woff2") format("woff2"); + src: url("../fonts/Geist-Regular.woff2") format("woff2"); } @font-face { - font-family: "Manrope"; + font-family: "Geist"; font-style: normal; font-display: auto; font-weight: 500; - src: url("../fonts/Manrope-Medium.woff2") format("woff2"); + src: url("../fonts/Geist-Medium.woff2") format("woff2"); } @font-face { - font-family: "Manrope"; + font-family: "Geist"; font-style: normal; font-display: auto; font-weight: 600; - src: url("../fonts/Manrope-SemiBold.woff2") format("woff2"); + src: url("../fonts/Geist-SemiBold.woff2") format("woff2"); } @font-face { - font-family: "Manrope"; + font-family: "Geist"; font-style: normal; font-display: auto; font-weight: 700; - src: url("../fonts/Manrope-Bold.woff2") format("woff2"); + src: url("../fonts/Geist-Bold.woff2") format("woff2"); } @font-face { - font-family: "Manrope"; + font-family: "Geist"; font-style: normal; font-display: auto; font-weight: 800; - src: url("../fonts/Manrope-ExtraBold.woff2") format("woff2"); + src: url("../fonts/Geist-Black.woff2") format("woff2"); +} +@font-face { + font-family: "Geist"; + font-style: normal; + font-display: auto; + font-weight: 1000; + src: url("../fonts/Geist-UltraBlack.woff2") format("woff2"); } @font-face { diff --git a/source/_static/fonts/Geist-Black.woff2 b/source/_static/fonts/Geist-Black.woff2 new file mode 100644 index 0000000..6b6f14a Binary files /dev/null and b/source/_static/fonts/Geist-Black.woff2 differ diff --git a/source/_static/fonts/Geist-Bold.woff2 b/source/_static/fonts/Geist-Bold.woff2 new file mode 100644 index 0000000..92a4ed5 Binary files /dev/null and b/source/_static/fonts/Geist-Bold.woff2 differ diff --git a/source/_static/fonts/Geist-Light.woff2 b/source/_static/fonts/Geist-Light.woff2 new file mode 100644 index 0000000..3fb925b Binary files /dev/null and b/source/_static/fonts/Geist-Light.woff2 differ diff --git a/source/_static/fonts/Geist-Medium.woff2 b/source/_static/fonts/Geist-Medium.woff2 new file mode 100644 index 0000000..f6ee691 Binary files /dev/null and b/source/_static/fonts/Geist-Medium.woff2 differ diff --git a/source/_static/fonts/Geist-Regular.woff2 b/source/_static/fonts/Geist-Regular.woff2 new file mode 100644 index 0000000..9867e87 Binary files /dev/null and b/source/_static/fonts/Geist-Regular.woff2 differ diff --git a/source/_static/fonts/Geist-SemiBold.woff2 b/source/_static/fonts/Geist-SemiBold.woff2 new file mode 100644 index 0000000..416789f Binary files /dev/null and b/source/_static/fonts/Geist-SemiBold.woff2 differ diff --git a/source/_static/fonts/Geist-Thin.woff2 b/source/_static/fonts/Geist-Thin.woff2 new file mode 100644 index 0000000..b85f14f Binary files /dev/null and b/source/_static/fonts/Geist-Thin.woff2 differ diff --git a/source/_static/fonts/Geist-UltraBlack.woff2 b/source/_static/fonts/Geist-UltraBlack.woff2 new file mode 100644 index 0000000..262fcc8 Binary files /dev/null and b/source/_static/fonts/Geist-UltraBlack.woff2 differ diff --git a/source/_static/fonts/Geist-UltraLight.woff2 b/source/_static/fonts/Geist-UltraLight.woff2 new file mode 100644 index 0000000..97c00ce Binary files /dev/null and b/source/_static/fonts/Geist-UltraLight.woff2 differ diff --git a/source/_static/fonts/Manrope-Bold.woff2 b/source/_static/fonts/Manrope-Bold.woff2 deleted file mode 100644 index b304805..0000000 Binary files a/source/_static/fonts/Manrope-Bold.woff2 and /dev/null differ diff --git a/source/_static/fonts/Manrope-ExtraBold.woff2 b/source/_static/fonts/Manrope-ExtraBold.woff2 deleted file mode 100644 index 73c579e..0000000 Binary files a/source/_static/fonts/Manrope-ExtraBold.woff2 and /dev/null differ diff --git a/source/_static/fonts/Manrope-ExtraLight.woff2 b/source/_static/fonts/Manrope-ExtraLight.woff2 deleted file mode 100644 index 6f824d0..0000000 Binary files a/source/_static/fonts/Manrope-ExtraLight.woff2 and /dev/null differ diff --git a/source/_static/fonts/Manrope-Light.woff2 b/source/_static/fonts/Manrope-Light.woff2 deleted file mode 100644 index 1dc6c79..0000000 Binary files a/source/_static/fonts/Manrope-Light.woff2 and /dev/null differ diff --git a/source/_static/fonts/Manrope-Medium.woff2 b/source/_static/fonts/Manrope-Medium.woff2 deleted file mode 100644 index 5e8861c..0000000 Binary files a/source/_static/fonts/Manrope-Medium.woff2 and /dev/null differ diff --git a/source/_static/fonts/Manrope-Regular.woff2 b/source/_static/fonts/Manrope-Regular.woff2 deleted file mode 100644 index 9400703..0000000 Binary files a/source/_static/fonts/Manrope-Regular.woff2 and /dev/null differ diff --git a/source/_static/fonts/Manrope-SemiBold.woff2 b/source/_static/fonts/Manrope-SemiBold.woff2 deleted file mode 100644 index cb1e346..0000000 Binary files a/source/_static/fonts/Manrope-SemiBold.woff2 and /dev/null differ diff --git a/source/conf.py b/source/conf.py index 58f8fe3..54d3d5f 100644 --- a/source/conf.py +++ b/source/conf.py @@ -88,12 +88,18 @@ "logo_light": "_static/images/vicharak-logo-light.svg", "logo_dark": "_static/images/vicharak-logo-dark.svg", "show_breadcrumbs": True, + "show_prev_next": True, } # HTML favicon html_favicon = "_static/images/favicon.ico" # HTML Permalinks icon html_permalinks_icon = Icons.permalinks_icon +html_baseurl = "https://docs.vicharak.in/" +html_sidebars = { + "**": ["sidebar_main_nav_links.html", "sidebar_toc.html"] +} + favicons = [ "images/android-chrome-192x192.png", "images/android-chrome-512x512.png", diff --git a/source/contributing.rst b/source/contributing.rst index c198fad..9f42b4a 100644 --- a/source/contributing.rst +++ b/source/contributing.rst @@ -1,7 +1,7 @@ -.. _contributing: - :orphan: +.. _contributing: + ############## Contribution ############## diff --git a/source/drm_fpga_write_api.rst b/source/drm_fpga_write_api.rst index 6050ccf..9e739d3 100644 --- a/source/drm_fpga_write_api.rst +++ b/source/drm_fpga_write_api.rst @@ -1,7 +1,7 @@ -.. _drm_fpga_write_api: - :orphan: +.. _drm_fpga_write_api: + .. toctree:: :glob: diff --git a/source/index.rst b/source/index.rst index 178ef1c..15daa58 100644 --- a/source/index.rst +++ b/source/index.rst @@ -6,6 +6,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. +.. rst-class:: lead + #################################### Welcome to Vaaman's documentation! #################################### @@ -27,8 +29,8 @@ that require both processing power and hardware customization. .. toctree:: :glob: - :maxdepth: 1 :caption: Contents + :titlesonly: Overview Getting Started @@ -38,18 +40,18 @@ that require both processing power and hardware customization. Vaaman Linux Documentation Vaaman FPGA Programming Documentation Vaaman Remote Upload Documentation - + .. toctree:: :glob: - :maxdepth: 1 + :titlesonly: :caption: Downloads downloads .. toctree:: :glob: - :maxdepth: 1 :caption: Accessories + :titlesonly: accessories diff --git a/source/nvme-boot.rst b/source/nvme-boot.rst index 4e6b7ea..283916f 100644 --- a/source/nvme-boot.rst +++ b/source/nvme-boot.rst @@ -1,7 +1,7 @@ -.. _booting-from-nvme: - :orphan: +.. _booting-from-nvme: + ######################### Booting from NVMe drive ######################### diff --git a/source/sdcard-boot.rst b/source/sdcard-boot.rst index 7964859..4802fa0 100644 --- a/source/sdcard-boot.rst +++ b/source/sdcard-boot.rst @@ -1,7 +1,7 @@ -.. _booting-from-sd-card: - :orphan: +.. _booting-from-sd-card: + Booting from SD-card ==================== diff --git a/source/vaaman-linux/index.rst b/source/vaaman-linux/index.rst index 1e0b767..cbbb4ad 100644 --- a/source/vaaman-linux/index.rst +++ b/source/vaaman-linux/index.rst @@ -4,13 +4,13 @@ | | This documentation pertains to the specific documentation for - Vicharak Vaaman Linux. + Linux on the Vaaman board. | It encompasses information about the development, configuration, - and usage of the Vaaman Linux Operating System. + and usage of the Linux Operating System on Vaaman. .. toctree:: - :maxdepth: 2 :caption: List of Guides + :titlesonly: linux-development-guide/index linux-configuration-guide/index diff --git a/source/vaaman-linux/linux-configuration-guide/index.rst b/source/vaaman-linux/linux-configuration-guide/index.rst index 9998a43..de9d168 100644 --- a/source/vaaman-linux/linux-configuration-guide/index.rst +++ b/source/vaaman-linux/linux-configuration-guide/index.rst @@ -7,8 +7,8 @@ Operating System. It covers the tools and scripts used to configure elements such as the bootloader, kernel, and rootfs. .. toctree:: - :maxdepth: 2 :caption: Configuration Guides + :titlesonly: Vicharak Linux Configuration Utility Change U-Boot Logo diff --git a/source/vaaman-linux/linux-development-guide/index.rst b/source/vaaman-linux/linux-development-guide/index.rst index 2421a7d..96f96ae 100644 --- a/source/vaaman-linux/linux-development-guide/index.rst +++ b/source/vaaman-linux/linux-development-guide/index.rst @@ -8,8 +8,8 @@ kernel, and rootfs. U-Boot (Universal Bootloader) ------------------------------ -U-Boot, or the Universal Bootloader, plays a crucial role in booting the -Linux kernel on your target hardware. It provides essential features for +U-Boot, or the Universal Bootloader, plays an important role in booting the +Linux kernel on your Vicharak board. It provides essential features for initializing hardware and loading the kernel. Linux Kernel @@ -26,8 +26,8 @@ and cross-compiling software for your embedded system. We will demonstrate how to build your own Debian, Ubuntu, Yocto or Android system. .. toctree:: - :maxdepth: 2 :caption: Development Guide + :titlesonly: U-Boot Linux Kernel diff --git a/source/vaaman-linux/linux-development-guide/linux-kernel.md b/source/vaaman-linux/linux-development-guide/linux-kernel.md index 65f1fa9..bf1977c 100644 --- a/source/vaaman-linux/linux-development-guide/linux-kernel.md +++ b/source/vaaman-linux/linux-development-guide/linux-kernel.md @@ -6,8 +6,47 @@ Vicharak provides multiple revisions of Linux kernels for Vaaman board. There are several differences across the revisions, mostly bug fixes and upstream improvements. But, the hardware functionality is the same. -:::{admonition} Please Refer to the types of kernels available for -[Vaaman for more information](#available-custom-kernel-types) +## Types of kernels available for Vaaman + +Vicharak offers four version of linux kernels for Vaaman board. +Each kernel is based on a different version of the Linux kernel. + +These kernel revisions are based on the sources of Rockchip RK3399 SoC with +necessary changes and optimizations for Vaaman. + +Rockchip is responsible for updating the `RK3399` SoC support in the +Linux kernel. They have provided support for Linux Kernel **4.4, 4.19 and 5.10**. +Additionally Vicharak has introduced the support for the Mainline Linux Kernel. + +```{list-table} +:header-rows: 1 +:class: feature-table + +* - Kernel version + - Status + - Git Link + +* - Kernel 4.4 + - Stable but deprecated + - https://github.com/vicharak-in/linux-kernel/tree/vaaman-4.4 + +* - Kernel 4.19 + - Stable but deprecated + - https://github.com/vicharak-in/linux-kernel/tree/vaaman-4.19 + +* - Kernel 5.10 + - Stable (Recommended) + - https://github.com/vicharak-in/linux-kernel/tree/vicharak-5.10 + +* - Kernel Mainline + - Experimental + - https://github.com/vicharak-in/linux-kernel/tree/vicharak-mainline +``` + +:::{warning} +Some of the kernel versions might not contain all the features supported or required by Vaaman. +Please take a look at the [Vaaman Kernel Status](vaaman-kernel-status) table +for the status of the different kernels available for Vaaman. ::: ## Build Linux Kernel @@ -141,7 +180,9 @@ to compile and test the kernel with ease. ## Compiling Kernel Modules +```bash make O=out ARCH=arm64 modules_install INSTALL_MOD_DIR=out/modules -j$(nproc --all) +``` **Confirm the modules files in `out/modules/lib` folder** diff --git a/source/vaaman-linux/linux-development-guide/linux-sdk.md b/source/vaaman-linux/linux-development-guide/linux-sdk.md index 9fc1fbc..29b1e09 100644 --- a/source/vaaman-linux/linux-development-guide/linux-sdk.md +++ b/source/vaaman-linux/linux-development-guide/linux-sdk.md @@ -1,31 +1,75 @@ -# Build Linux SDK from source +# Linux SDK -Vicharak Linux SDK is based on Rockchip Linux SDK. -It is a collection of tools and scripts to build Linux rootfs image for Vicharak boards. +Working with Vicharak computer boards is very easy as we provide all the +necessary source, tools and scripts required to build your own Linux systems. -Vicharak provides two different sources for Linux rootfs images. +## Build Linux SDK from source -1. Debian bullseye (11) -2. Ubuntu Jammy (20.04) +The Vicharak Linux SDK is based on SDK provided by Rockchip hence, it follows +the conditions and criteria of Rockchip. -These sources are available at [Vicharak GitHub](https://github.com/vicharak-in) +Vicharak provides multiple different sources for building your own Linux images. +Take a look at the table below: -## Build Vaaman Linux SDK +:::{list-table} +:header-rows: 1 +:class: feature-table -### Installing the package dependencies for environment setup +* - Linux distribution + - Version + +* - Debian + - Bullseye (11) + +* - Ubuntu + - Focal (20.04) + +* - Ubuntu + - Jammy (22.04) + +* - Yocto + - Kirkstone (4.0) + +* - Yocto + - Mickledore (4.2) + +* - Buildroot + - None + +* - Android + - 12.1 + +::: -```{admonition} Prerequisites -:class: warning +These sources are available at [Vicharak GitHub](https://github.com/vicharak-in) -You host system needs to be either Debian bullseye (11) or Ubuntu Jammy (20.04) to build the rootfs image. +### Installing the package dependencies for environment setup + +```{warning} +It is recommended to either use **Debian bullseye (11)** or +**Ubuntu focal (20.04)** to build the rootfs image. ``` +#### Install source control tools + +Building Vicharak linux systems requires both **Git** (For source code management) +and **Repo** (Google-built repository management tool). + +Please take a look at [Android's source controls tools setup](https://source.android.com/docs/setup/download) +as we follow the same for building Vicharak's Linux systems. + +#### Install package dependencies + +:::{important} +Make sure you have properly installed `repo` tool before proceeding. +::: + **The following packages are required to build the rootfs image.** ```bash -sudo apt-get update +sudo apt-get update -y -asciidoc autotools-dev bash bc binutils bison build-essential bzip2 chrpath cpio curl \ +sudo apt install -y asciidoc autotools-dev bash bc binutils bison build-essential bzip2 chrpath cpio curl \ cvs dblatex default-jre device-tree-compiler diffstat expect-dev fakeroot file flex g++ gawk gcc \ gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf g+conf genext2fs git git-core git-gui \ gitk graphviz gzip intltool lib32stdc++6 libdrm-dev libglade2-dev libglib2.0-dev @@ -34,19 +78,96 @@ libusb-1.0-0-dev m4 make mercurial mtools openssh-client parted patch patchutils qemu-user-static rsync sed subversion swig tar texinfo u-boot-tools unzip w3m wget ``` -**Installing Google's repo tool** +:::{note} +The above packages might not be available to install on your system. Please +try to find the alternatives or solution from the internet. -**repo** tool is required to sync the manifests for cloning entire `linux SDK` on your local computer. +If you still are unable to install the packages, please contact us through [issues section](#) +::: + +### Getting the sources + +We have structured our Linux development source code in the same way as the +official Android sources. i.e. we have various manifests with different +branches for different releases of our supported Linux distributions and products. +**repo** tool will take care of the source code syncing and updating. + +Take a look at the following table to get the latest sources. + + +| Manifest | Tag | URL | +|-------------------|-----------------|----------------------------------------------------| +| Debian bullseye | debian-bullseye-v1.1.1 | https://github.com/vicharak-in/linux-manifests/tree/debian-bullseye | +| Ubuntu Focal | ubuntu-focal-v1.1.1 | https://github.com/vicharak-in/linux-manifests/tree/ubuntu-focal | +| Ubuntu Jammy | ubuntu-jammy-v1.1.1 | https://github.com/vicharak-in/linux-manifests/tree/ubuntu-jammy | +| Yocto Kirkstone | yocto-kirkstone-v1.0.0 | https://github.com/vicharak-in/linux-manifests/tree/yocto-kirkstone | +| Yocto Mickledore | yocto-mickledore-v1.0.0 | https://github.com/vicharak-in/linux-manifests/tree/yocto-mickledore | +| Buildroot | buildroot-v1.0.0 | https://github.com/vicharak-in/linux-manifests/tree/buildroot | +| Android 12.1 | android-12.1-v1.0.0 | https://github.com/vicharak-in/linux-manifests/tree/android-12.1 | + +#### Cloning the source + +To clone the latest sources, use the following command. + +::::{tab-set} + +:::{tab-item} Debian bullseye (11) ```bash -curl https://storage.googleapis.com/git-repo-downloads/repo > repo -chmod a+rx repo -sudo mv repo /usr/local/bin +repo init --no-tags --no-clone-bundle -u https://github.com/vicharak-in/linux-manifests -b debian-bullseye -m rk3399-vaaman.xml ``` -### Getting the sources +::: + +:::{tab-item} Ubuntu Focal (20.04) + +```bash +repo init --no-tags --no-clone-bundle -u https://github.com/vicharak-in/linux-manifests -b ubuntu-focal -m rk3399-vaaman.xml +``` + +::: -repo init --no-tags --no-clone-bundle -u -b -m +:::{tab-item} Ubuntu Jammy (22.04) + +```bash +repo init --no-tags --no-clone-bundle -u https://github.com/vicharak-in/linux-manifests -b ubuntu-jammy -m rk3399-vaaman.xml +``` + +::: + +:::{tab-item} Yocto Kirkstone (4.0) + +```bash +repo init --no-tags --no-clone-bundle -u https://github.com/vicharak-in/linux-manifests -b yocto-kirkstone -m rk3399-vaaman.xml +``` + +::: + +:::{tab-item} Yocto Mickledore (4.2) + +```bash +repo init --no-tags --no-clone-bundle -u https://github.com/vicharak-in/linux-manifests -b yocto-mickledore -m rk3399-vaaman.xml +``` + +::: + +:::{tab-item} Buildroot + +```bash +repo init --no-tags --no-clone-bundle -u https://github.com/vicharak-in/linux-manifests -b buildroot -m rk3399-vaaman.xml +``` + +::: + +:::{tab-item} Android 12.1 + +```bash +repo init --no-tags --no-clone-bundle -u https://github.com/vicharak-in/linux-manifests -b android-12.1 -m rk3399-vaaman.xml +``` + +::: + +:::: :::{tip} You can also shallow clone entire SDK using `--depth=1` option. @@ -55,40 +176,48 @@ Use the following command to sync the source with shallow history: ```bash repo init --depth=1 --no-tags --no-clone-bundle -u -b -m ``` - ::: -### Syncing the source +#### Syncing the source + +To download the code sources from the repositories to your local machine, use the following command. ```bash -repo sync --no-tags --no-clone-bundle -j$(nproc) +repo sync -j$(nproc) ``` -### Compile Linux SDK +### Building the Linux SDK ::::{tab-set} -:::{tab-item} Vaaman Ubuntu Jammy (20.04) +:::{tab-item} Ubuntu Focal (20.04) :selected: -The configuration file for Vaaman Ubuntu Jammy (20.04) is located at `device/rockchip/rk3399/vaaman-rk3399-ubuntu.mk` +After successful syncing of the source, you are now ready to build the Linux SDK. + +Enter the SDK source directory, and confirm that your have a `build.sh` file in the current directory. #### Source the Ubuntu configuration file +The configuration file for Ubuntu Focal (20.04) is located at `device/rockchip/rk3399/vaaman-rk3399-ubuntu.mk` + ```bash ./build.sh device/rockchip/rk3399/vaaman-rk3399-ubuntu.mk ``` -To ensure successful configuration, `the device/rockchip/.BoardConfig.mk` will be linked to the effective configuration file. -It is recommended to verify the file to confirm the success of the configuration. +To ensure successful configuration, the `device/rockchip/.BoardConfig.mk` will +be linked to the effective configuration file. It is recommended to verify +the file to confirm the success of the configuration. -Please note that `rk3399-vaaman-ubuntu.mk` is the configuration file obtained after compiling the Ubuntu firmware. -Users can also create new configuration files based on this reference to customize the firmware according to their requirements. +Please note that `rk3399-vaaman-ubuntu.mk` is the configuration file created by +Vicharak for reference. Users can also create their own new configuration files +based on this reference to customize the firmware according to their requirements. ````{admonition} Important configuration details: :class: tip -(If you intend to create your own firmware, you might need to modify the following configuration information.) +(If you intend to create your own firmware, you might need to modify the +following configuration information.) #### Compile the uboot configuration file @@ -118,21 +247,38 @@ export RK_KERNEL_DTS=rk3399-vaaman-linux export RK_PARAMETER=parameter-vaaman-debian.txt ``` -#### Package file for make update image +#### Package file for generting eMMC update image ```bash # packagefile for make update image export RK_PACKAGE_FILE=rk3399-ubuntu-package-file ``` -#### The root file system image path +```bash +# Rootfs linux distribution +export RK_ROOTFS_SYSTEM=ubuntu +``` + +```bash +# Ubuntu version (focal or jammy) +export RK_UBUNTU_VERSION=focal +``` + +```bash +# Default desktop environment for Ubuntu (xfce, gnome, mate, base) +export UBUNTU_FLAVOR=xfce +``` ```bash # rootfs image path -export RK_ROOTFS_IMG=xxxx/xxxx.img +export RK_ROOTFS_IMG=ubuntu/ubuntu-focal.img ``` +```bash +# DTBO overlays to enable on boot +export VICHARKA_BOOT_ENABLE_OVERLAYS="" ``` + ```` #### Building the Ubuntu firmware @@ -143,26 +289,134 @@ After the configuration is complete, you can start compiling the firmware. ./build.sh ``` -The compiled firmware will be located in the `rockdev` directory. +The compiled firmware will be located in the `rockdev/pack` directory. ::: -:::{tab-item} Vaaman Debian bullseye (11) +:::{tab-item} Ubuntu Jammy (22.04) -The configuration file for Vaaman Debian bullseye (11) is located at `device/rockchip/rk3399/vaaman-rk3399-debian.mk` +After successful syncing of the source, you are now ready to build the Linux SDK. + +Enter the sdk source directory, and confirm that your have a `build.sh` file in the current directory. + +#### Source the Ubuntu configuration file + +The configuration file for Ubuntu Jammy (22.04) is located at `device/rockchip/rk3399/vaaman-rk3399-ubuntu.mk` + +Open the configuration file and change the `RK_UBUNTU_VERSION` to `jammy` + +```bash +./build.sh device/rockchip/rk3399/vaaman-rk3399-ubuntu.mk +``` + +To ensure successful configuration, the `device/rockchip/.BoardConfig.mk` will +be linked to the effective configuration file. It is recommended to verify +the file to confirm the success of the configuration. + +Please note that `rk3399-vaaman-ubuntu.mk` is the configuration file created by +Vicharak for reference. Users can also create their own new configuration files +based on this reference to customize the firmware according to their requirements. + +````{admonition} Important configuration details: +:class: tip + +(If you intend to create your own firmware, you might need to modify the +following configuration information.) + +#### Compile the uboot configuration file + +```bash +# U-boot defconfig +export RK_UBOOT_DEFCONFIG=rk3399-vaaman +``` + +#### Compile the kernel configuration file + +```bash +# Kernel defconfig +export RK_KERNEL_DEFCONFIG=rockchip_linux_defconfig +``` + +#### Compile the kernel DTS used by kernel + +```bash +# Kernel DTS +export RK_KERNEL_DTS=rk3399-vaaman-linux +``` + +#### Partitioning information (very important) + +```bash +# parameter for GPT table +export RK_PARAMETER=parameter-vaaman-debian.txt +``` + +#### Package file for generting eMMC update image + +```bash +# packagefile for make update image +export RK_PACKAGE_FILE=rk3399-ubuntu-package-file +``` + +```bash +# Rootfs linux distribution +export RK_ROOTFS_SYSTEM=ubuntu +``` + +```bash +# Ubuntu version (focal or jammy) +export RK_UBUNTU_VERSION=jammy +``` + +```bash +# Default desktop environment for Ubuntu (xfce, gnome, mate, base) +export UBUNTU_FLAVOR=xfce +``` + +```bash +# rootfs image path +export RK_ROOTFS_IMG=ubuntu/ubuntu-jammy.img +``` + +```bash +# DTBO overlays to enable on boot +export VICHARKA_BOOT_ENABLE_OVERLAYS="" +``` + +```` + +#### Building the Ubuntu firmware + +After the configuration is complete, you can start compiling the firmware. + +```bash +./build.sh +``` + +The compiled firmware will be located in the `rockdev/pack` directory. + +::: + +:::{tab-item} Debian bullseye (11) + +After successful syncing of the source, you are now ready to build the Linux SDK. + +Enter the SDK source directory, and confirm that your have a `build.sh` file in the current directory. #### Source the Debian configuration file +The configuration file for Vaaman Debian bullseye (11) is located at `device/rockchip/rk3399/vaaman-rk3399-debian.mk` + ```bash ./build.sh device/rockchip/rk3399/vaaman-rk3399-debian.mk ``` -To ensure successful configuration, `the device/rockchip/.BoardConfig.mk` will be linked to the effective configuration file. +To ensure successful configuration, the `device/rockchip/.BoardConfig.mk` will be linked to the effective configuration file. It is recommended to verify the file to confirm the success of the configuration. -Please note that `rk3399-vaaman-debian.mk` is the configuration file obtained after compiling the Debian firmware. - -Users can also create new configuration files based on this reference to customize the firmware according to their requirements. +Please note that `rk3399-vaaman-debian.mk` is the configuration file created by +Vicharak for reference. Users can also create their own new configuration files +based on this reference to customize the firmware according to their requirements. ````{admonition} Important configuration details: :class: tip @@ -204,13 +458,29 @@ export RK_PARAMETER=parameter-vaaman-debian.txt export RK_PACKAGE_FILE=rk3399-debian-package-file ``` -#### The root file system image path +```bash +# Rootfs linux distribution +export RK_ROOTFS_SYSTEM=debian +``` + +```bash +# Debian version (bullseye) +export RK_DEBIAN_VERSION=bullseye +``` + +```bash +# Default desktop environment for Debian (lxde, xfce, gnome, mate, base) +export DEBIAN_FLAVOR=lxde +``` ```bash # rootfs image path -export RK_ROOTFS_IMG=xxxx/xxxx.img +export RK_ROOTFS_IMG=debian/linaro-rootfs.img ``` +```bash +# DTBO overlays to enable on boot +export VICHARKA_BOOT_ENABLE_OVERLAYS="" ``` ```` @@ -222,13 +492,204 @@ After the configuration is complete, you can start compiling the firmware. ./build.sh ``` -The compiled firmware will be located in the `rockdev` directory. +The compiled firmware will be located in the `rockdev/pack` directory. +::: + +:::{tab-item} Buildroot + +After successful syncing of the source, you are now ready to build the Linux SDK. + +Enter the sdk source directory, and confirm that your have a `build.sh` file in the current directory. + +### Source the Buildroot configuration file + +The configuration file for Buildroot is located at `device/rockchip/rk3399/vaaman-rk3399-buildroot.mk` + +```bash +./build.sh device/rockchip/rk3399/vaaman-rk3399-buildroot.mk +``` + +To ensure successful configuration, the `device/rockchip/.BoardConfig.mk` will +be linked to the effective configuration file. It is recommended to verify +the file to confirm the success of the configuration. + +Please note that `rk3399-vaaman-buildroot.mk` is the configuration file created by +Vicharak for reference. Users can also create their own new configuration files +based on this reference to customize the firmware according to their requirements. + +````{admonition} Important configuration details: +:class: tip + +(If you intend to create your own firmware, you might need to modify the following configuration information.) + +#### Compile the uboot configuration file + +```bash +# U-boot defconfig +export RK_UBOOT_DEFCONFIG=rk3399-vaaman +``` + +#### Compile the kernel configuration file + +```bash +# Kernel defconfig +export RK_KERNEL_DEFCONFIG=rockchip_linux_defconfig +``` + +#### Compile the kernel DTS used by kernel + +```bash +# Kernel DTS +export RK_KERNEL_DTS=rk3399-vaaman-linux +``` + +#### Partitioning information (very important) + +```bash +# parameter for GPT table +export RK_PARAMETER=parameter-vaaman-debian.txt +``` + +#### Package file for make update image + +```bash +# packagefile for make update image +export RK_PACKAGE_FILE=rk3399-debian-package-file +``` + +```bash +# Rootfs linux distribution +export RK_ROOTFS_SYSTEM=buildroot +``` + +```bash +# rootfs image path +export RK_ROOTFS_IMG=buildroot/rootfs.img +``` + +```bash +# DTBO overlays to enable on boot +export VICHARKA_BOOT_ENABLE_OVERLAYS="" +``` + +```` + +#### Building the Buildroot firmware + +After the configuration is complete, you can start compiling the firmware. + +```bash +./build.sh +``` + +The compiled firmware will be located in the `rockdev/pack` directory. + +::: + +:::{tab-item} Android 12.1 + +After successful syncing of the source, you are now ready to build the Linux SDK. + +Enter the SDK source directory, and confirm that your have a `build.sh` file in the current directory. + +### Source the Android 12.1 environment setup + +```bash +source build/envsetup.sh +``` + +The device specific configuration file for Android 12.1 is located at `device/rockchip/rk3399/vaaman.mk` + +#### Lunch the device configuration + +```bash +lunch vaaman-userdebug +``` + +### Building the Android 12.1 firmware + +After the configuration is complete, you can start compiling the firmware. + +```bash +./build.sh -UACKup +``` + +```{note} +`build.sh` is the firmware build script that can be used to interactively build the firmware. +It can accept command line arguments to customize the build process. + +- -U -> Build U-Boot +- -A -> Build Android +- -C -> Build kernel using clang compiler +- -K -> Build kernel +- -u -> Build rockchip update image +- -p -> Pack the firmware + +``` + +After the firmware is compiled, you can find an `update.img` file inside `rockdev/pack` + +::: + +:::{tab-item} Yocto (Kirkstone/Mickledore) + +After successful syncing of the source, you are now ready to build the Linux SDK. + +Enter the SDK source directory, and confirm that your have a `build.sh` file +in the current directory. + +### Source the Yocto environment setup + +Use the following command to source the Yocto environment for bitbake to work. + +```bash +source oe-init-build-env +``` + +### Building the Yocto firmware + +After the configuration is complete, you can start compiling the firmware. + +```bash +bitbake core-image-minimal +``` + +````{tip} + +As of this moment there are multiple different recipes available for building +the Yocto firmware. + +```{list-table} +:header-rows: 1 +:class: feature-table + +* - Recipe + - Description + +* - core-image-minimal + - Build the minimal server image + +* - core-image-sato + - Build a minimal X11 image + +* - core-image-full + - Build a full server image + +* - core-image-weston + - Build a minimal wayland image +``` +```` + ::: :::: ### Partial compilation feature +:::{warning} +This feature is only supported on Vicharak Debian, Ubuntu and Buildroot systems. +::: + If you only need to compile a certain part of the firmware. Use the following command to compile the corresponding part of the firmware. @@ -238,6 +699,17 @@ Use the following command to compile the corresponding part of the firmware. ./build.sh kernel ``` +:::{tip} +There are multiple ways to build kernel on Vicharak build system. + +* Extlinux based boot image + - `./build.sh extboot` + +* Linux kernel as debian package + - `./build.sh kerneldeb` + +::: + #### U-boot ```bash @@ -263,7 +735,7 @@ Use the following command to compile the corresponding part of the firmware. Before packing the firmware, you need to make sure that the firmware has been compiled successfully. -``` +```text ls -l ├── boot.img -> ~/vicharak/linux_sdk/kernel/boot.img @@ -272,9 +744,9 @@ ls -l ├── misc.img -> ~/vicharak/linux_sdk/device/rockchip/rockimg/wipe_all-misc.img ├── parameter.txt -> ~/vicharak/linux_sdk/device/rockchip/RK3399/parameter-ubuntu.txt ├── recovery.img -> ~/vicharak/linux_sdk/buildroot/output/rockchip_rk3399_recovery/images/recovery.img -├── rootfs.img -> ~/vicharak/linux_sdk/ubuntu/ubuntu-focal.img +├── rootfs.img -> ~/vicharak/linux_sdk/ubuntu/ubuntu-focal.img # or ubuntu-jammy.img or linaro-rootfs.img ├── trust.img -> ~/vicharak/linux_sdk/u-boot/trust.img -├── uboot.img -> ~/vicharak/linux_sdk/u-boot:/uboot.img +├── uboot.img -> ~/vicharak/linux_sdk/u-boot/uboot.img └── userdata.img ``` ```` @@ -315,12 +787,12 @@ and can be used to flash the firmware to the eMMC of the development board or an --- -### Vicharak RAW Image +### Vicharak RAW (GPT) Image Vicharak provides another method to pack the firmware into a single image. -This script uses the RAW image format, -and can be used to flash the firmware to the eMMC of the development board or any SD-card using -the `dd` command or using `Balena Etcher` tool. +This script uses the GPT image format, and can be used to flash the firmware to +any supported storage media (SD-Card, eMMC or NVMe) using the basic linux +utility such as `dd` or even using `Balena Etcher` tool. ```{seealso} [How to use Balena Etcher](#how-to-use-balena-etcher) diff --git a/source/vaaman-linux/linux-development-guide/u-boot.md b/source/vaaman-linux/linux-development-guide/u-boot.md index 44f076e..b56cf39 100644 --- a/source/vaaman-linux/linux-development-guide/u-boot.md +++ b/source/vaaman-linux/linux-development-guide/u-boot.md @@ -10,58 +10,106 @@ It is the Universal Boot Loader project and is actually used to boot the Linux kernel in your Vicharak board. :::{note} -More information can be found [here](https://en.wikipedia.org/wiki/Das_U-Boot). +More information on u-boot can be found on [u-boot Wikipedia](https://en.wikipedia.org/wiki/Das_U-Boot). ::: -## Build Vicharak Vaaman U-Boot from source +(mainline-u-boot-important)= -:::{note} -Vicharak provides two different source for u-boot: +:::{important} +Vicharak provides two different sources of u-boot for the Vaaman board. + +**1. Vendor specific u-boot** + - Vendor specific u-boot is a fork of u-boot provided by Rockchip with + additional features including Vaaman board support. -1. Vendor specific u-boot source. -2. Mainline u-boot source. +**2. Mainline u-boot** + - Mainline u-boot is the upstream u-boot maintained by Open-source + developers. It contains the bleeding edge features, SoC improvements and bug fixes. There are separate methods to compile and flash u-boot for these above sources. ::: -## Build Vendor specific u-boot +:::{tip} +It is generally not recommended to use **mainline u-boot** with your Vicharak linux +images. Because those images follows [Rockchip's boot flow](#rockchip-boot-flow). +And things may break due to incompatible changes in mainline u-boot. + +You can use mainline u-boot for your own custom images or community images such +as _Manjaro ARM, Armbian_, etc. +::: + +## Build Vicharak Vaaman u-boot from source + +## 1. Build Vendor specific u-boot + +:::{warning} +It is recommended to use **Ubuntu 20.04** and Higher or **Debian 11** +and Higher environment for building. +::: ### Installing the system dependencies ```bash -sudo apt-get install build-essential python libssl-dev git-core \ - gcc-arm-linux-gnueabihf u-boot-tools device-tree-compiler \ - gcc-aarch64-linux-gnu mtools parted pv +sudo apt update -y + +sudo apt-get install -y build-essential python libssl-dev git-core \ + gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf u-boot-tools \ + device-tree-compiler gcc-aarch64-linux-gnu mtools parted pv ``` ### Getting the source -The source code for u-boot has been published to our -[GitHub organisation](https://github.com/vicharak-in). +The source code for the u-boot has been published to our +[GitHub organisation](https://github.com/vicharak-in/u-boot-vicharak). + +You can either clone the repository or download the source code from GitHub. + +:::{tip} +We recommend that you use `git clone` method to clone the repository as it is +easier to maintain. +::: #### Clone the repository using git ```bash -git clone https://github.com/vicharak/u-boot-vicharak +git clone https://github.com/vicharak-in/u-boot-vicharak -b master ``` :::{tip} Use `git clone --depth=1` to shallow clone the repository ::: -#### Download the source code from GitHub +#### Download the source code archive from GitHub ![vicharak-uboot-github](../../_static/images/vicharak-uboot-github.webp) -**Follow the steps in above image or else try downloading from terminal.** +**Follow the steps in above image.** + +1. Open the GitHub repository and click on the code section on the top right + corner. + +2. Click on the "Download ZIP" button. + +3. After successful download, unpack the archive using any archiver tool (7zip, unzip, etc). + +--- + +**Alternatively you can use your terminal to directly download the source code.** + +Use the following command to download the source code ```bash wget https://github.com/vicharak-in/u-boot-vicharak/archive/refs/heads/master.zip -unzip u-boot-vicharak-master.zip +unzip master.zip ``` -### Compiling u-boot +### Compiling vendor specific u-boot + +There are two methods to compile vendor specific u-boot. + +1. Rockchip u-boot build script +2. Vicharak u-boot build script #### Enter the u-boot directory @@ -69,15 +117,16 @@ unzip u-boot-vicharak-master.zip cd ``` -#### Compile using Rockchip u-boot script +::::{tab-set} + +:::{tab-item} Compile using Rockchip u-boot script ```bash ./make.sh rk3399-vaaman ``` +::: -or - -#### Compile using Vicharak u-boot script +:::{tab-item} Compile using Vicharak u-boot script ```bash git submodule update --init @@ -86,7 +135,7 @@ git submodule update --init ./vicharak/build.sh -b ``` -:::{tip} +````{tip} Vicharak u-boot script is recommended for ease of use The script is located in `vicharak/build.sh` and basic operations are as follows: @@ -107,18 +156,19 @@ The script is located in `vicharak/build.sh` and basic operations are as follows help | -h : Display this usage guide ───────────────────────────────────────────────────────────────────── ``` +```` ::: +:::: + Output files will be inside current folder. -Make sure `idbloader`, `u-boot` and `trust` images are there. +Make sure `idblock.bin`, `uboot.img` and `trust.img` images are there. :::{card} Confirm these files in the current directory idblock.bin -idbloader.img - uboot.img trust.img @@ -129,13 +179,16 @@ rk3399_loader_v1.xx.xxx.bin :::{tip} For Vendor u-boot source there is an option to build debian package as well. -Use the following command to build a debian package of the uboot. + +If you are using Vicharak build script then, use the following command to build +a debian package of the uboot. ```bash ./vicharak/build.sh -B ``` -or +or if you are using Rockchip build script then use the following command to build +a debian package of the uboot. ```bash dpkg-buildpackage -b -rfakeroot -us -uc -a arm64 @@ -143,174 +196,261 @@ dpkg-buildpackage -b -rfakeroot -us -uc -a arm64 ::: -### Compile Mainline u-boot +(flash-u-boot)= -#### Installing the required system dependencies +## How to flash or upgrade u-boot + +(rockchip-boot-flow)= + +:::{note} Rockchip's boot flow + +```text ++--------+----------------+----------+-------------+---------+ +| Boot | Terminology #1 | Actual | Rockchip | Image | +| stage | | program | Image | Location| +| number | | name | Name | (sector)| ++--------+----------------+----------+-------------+---------+ +| 1 | Primary | ROM code | BootRom | | +| | Program | | | | +| | Loader | | | | +| | | | | | +| 2 | Secondary | U-Boot |idbloader.img| 0x40 | pre-loader +| | Program | TPL/SPL |idblock.bin | | +| | Loader (SPL) | | | | +| | | | | | +| 3 | - | U-Boot | u-boot.itb | 0x4000 | including u-boot and atf +| | | | uboot.img | | only used with miniloader +| | | | | | +| | | ATF/TEE | trust.img | 0x6000 | only used with miniloader +| | | | | | +| 4 | - | kernel | boot.img | 0x8000 | +| | | | | | +| 5 | - | rootfs | rootfs.img | 0x40000 | ++--------+----------------+----------+-------------+---------+ -```bash -sudo apt-get install build-essential python libssl-dev git-core \ - libgnutls28-dev gcc-arm-linux-gnueabihf u-boot-tools device-tree-compiler \ - gcc-aarch64-linux-gnu mtools parted pv ``` +Read more information on [Rockchip's boot option](http://opensource.rock-chips.com/wiki_Boot_option) +::: -#### Getting the Mainline u-boot source -The source code for u-boot has been published to our -[GitHub organisation](https://github.com/vicharka-in/u-boot-vicharak/tree/vicharak-mainline). +Once you have successfully compiled the u-boot. You are now ready to flash it on your vaaman board. -#### Clone the repository using git +**Secondary Program Loader (SPL)** + +For Vicharak eMMC builds you can follow the `Linux Upgrade Tool` guide +:::{admonition} Refer to +[Flash u-boot to eMMC using upgrade_tool](../linux-usage-guide/rockchip-upgrade-tool-misc.rst) +::: + +or ```bash -git clone https://github.com/vicharak-in/u-boot-vicharak -b vicharak-mainline +sudo dd if=idblock.bin of=/dev/mmcblk1 seek=64; sync ``` -#### Compile ARM trusted firmware and u-boot +:::{warning} +The block device `/dev/mmcblk1` may be different as per the board's storage configuration. + +Confirm the block device using `parted /dev/mmcblk`. +::: -Clone the ARM trusted firmware source code from -[GitHub](https://github.com/arm-trusted-firmware/arm-trusted-firmware) and compile it. +**U-boot proper (uboot)** ```bash -cd arm-trusted-firmware -make realclean -make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31 +sudo dd if=uboot.img of=/dev/mmcblk1p1; sync ``` -Copy the compiled `bl31.elf` file to the u-boot directory. +**Trust image (trust)** ```bash -cp build/rk3399/release/bl31/bl31.elf +sudo dd if=trust.img of=/dev/mmcblk1p2; sync ``` -Enter the u-boot directory and compile the u-boot. +Finally reboot the board. ```bash -export BL31=bl31.elf -export ARCH=arm -export CROSS_COMPILE=aaarch64-linux-gnu- +sudo reboot +``` -make vaaman-rk3399_defconfig +## Verify the u-boot version -make -j$(nproc --all) -``` +### Enter the u-boot shell or command prompt -Output files will be inside current directory. Make sure `idbloader.img`, `u-boot.itb` and `u-boot.img` images are there. +Vaaman's u-boot is configured for development purpose. +It will allow you 3 seconds to enter the u-boot shell before booting the kernel. -(flash-u-boot)= +Press **CTRL+c** to enter the u-boot shell. -## How to flash or upgrade u-boot +```{tip} +Set `CONFIG_BOOTDELAY` to `0` in `configs/rk3399-vaaman_defconfig` to disable the delay. -Once you have successfully compiled the u-boot. You are now ready to flash it on your vaaman board. +And recompile the u-boot. +``` -For Vicharak eMMC builds you can follow the `Linux Upgrade Tool` guide -:::{admonition} Refer to -[Flash u-boot to eMMC using upgrade_tool](../linux-usage-guide/rockchip-upgrade-tool-misc.rst) -::: +you can verify the u-boot version by using `version` command. -or +```bash +version +``` -You can manually flash the images using UNIX `dd` utility. +or you can just see the serial console output. -**Secondary loader (SPL)** +There will be a version string printed on the console during boot up. -For Vicharak eMMC builds you can follow the `Linux Upgrade Tool` guide -:::{admonition} Refer to -[Flash u-boot to eMMC using upgrade_tool](../linux-usage-guide/rockchip-upgrade-tool-misc.rst) -::: +```text +U-Boot 2017.09-ge629234bf25-230427 #vicharak (Jul 11 2023 - 16:43:11 +0530) +``` -or +## 2. Build Mainline u-boot from source + +#### Installing the required system dependencies ```bash -sudo dd if=idblock.bin of=/dev/mmcblk1 seek=64; sync +sudo apt-get update -y + +sudo apt-get install -y build-essential python libssl-dev git-core \ + libgnutls28-dev gcc-arm-linux-gnueabihf u-boot-tools device-tree-compiler \ + gcc-aarch64-linux-gnu mtools parted pv ``` -:::{warning} -The block device `/dev/mmcblk1` may be different as per the board's storage configuration. +#### Getting the Mainline u-boot source -Confirm the block device using `parted /dev/mmcblk`. -::: +The source code for the mainline u-boot has been published to our +[GitHub organisation](https://github.com/vicharak-in/u-boot-vicharak/tree/vicharak-mainline). -**U-boot proper (uboot)** +##### Clone the repository using git ```bash -sudo dd if=uboot.img of=/dev/mmcblk1p1; sync +git clone https://github.com/vicharak-in/u-boot-vicharak -b vicharak-mainline ``` -**Trust image (trust)** +#### Compile ARM trusted firmware + +Clone the ARM trusted firmware source code from [ARM's git server](https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git) and compile it. ```bash -sudo dd if=trust.img of=/dev/mmcblk1p2; sync +git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a -b master --depth=1 + +cd trusted-firmware-a ``` -Finally reboot the board. +Compile the ARM trusted firmware. ```bash -sudo reboot +make realclean -j$(nproc --all) +make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 -j$(nproc --all) ``` -### Flashing Mainline u-boot +Upon successful compilation, the `build/` directory will be created. -For Vicharak eMMC builds you need to merge partition 1 and 2 into one partition. - -**Delete the trust partition** +Now, copy the compiled `bl31.elf` file to the u-boot directory. ```bash -sudo parted /dev/mmcblk1 rm 2 +cp build/rk3399/release/bl31/bl31.elf ``` -**Resize the u-boot partition** +#### Compile Mainline u-boot +Enter the u-boot directory and compile the u-boot. ```bash -sudo parted /dev/mmcblk1 resizepart 1 100% +export BL31=bl31.elf + +make rk3399-vaaman_defconfig +make CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc --all) ``` -**Flash the SPL and u-boot** +:::{card} Confirm these files in the current directory -```bash -sudo dd if=idbloader.img of=/dev/mmcblk1 seek=64; sync +idbloader.img -sudo dd if=u-boot.itb of=/dev/mmcblk1; sync -``` +u-boot.itb -Finally reboot the board. +u-boot-rockchip.bin +::: + +### Flashing Mainline u-boot + +:::{important} +Please read the [Mainline u-boot note](#mainline-u-boot-important) +::: + +::::{tab-set} + +:::{tab-item} Flashing on SD-Cards + +Vicharak's mainline u-boot supports a single boot image using binman called +`u-boot-rockchip.bin` which combines the `idbloader.img` and `u-boot.itb` images. + +To write this image to a SD card, use the following commands. +(Assuming the SD card is at `/dev/sdX`.) ```bash -sudo reboot +sudo dd if=u-boot-rockchip.bin of=/dev/sdX seek=64; sync ``` +::: -:::{tip} -It is preferred not to use mainline u-boot for Vicharak images. As it follows rockchip's boot flow. -And things may break in future. +:::{tab-item} Flashing on eMMC -You can use mainline u-boot for your own custom images or community images such as Manjaro ARM, Armbian, etc. -::: +Vicharak's mainline u-boot supports a single boot image using binman called +`u-boot-rockchip.bin` which combines the `idbloader.img` and `u-boot.itb` images. -## Verify the u-boot version +````{note} +Follow the [u-boot USB Mass Storage (UMS) mode](../linux-usage-guide/u-boot-ums.md) +for using eMMC as a USB storage device on your Host computer and for flashing. +```` -After rebooting the board, you can verify the u-boot version using `version` command. +To write this image to an eMMC, use the following commands. +(Assuming the eMMC is at `/dev/sdX`.) ```bash -version +sudo dd if=u-boot-rockchip.bin of=/dev/sdX seek=64; sync ``` -or +````{tip} +For Vicharak provided eMMC/SD-Card builds you need to merge partition 1 and 2 +into one partition. -There will be a version string printed on the console during boot up. +**Delete the trust partition** ```bash -U-Boot 2017.09-ge629234bf25-230427 #vicharak (Jul 11 2023 - 16:43:11 +0530) +sudo parted /dev/mmcblkX rm 2 ``` -### Enter the u-boot shell or command prompt +**Resize the u-boot partition** -Vaaman's u-boot is configured for development purpose. -It will allow you 3 seconds to enter the u-boot shell before booting the kernel. +```bash +sudo parted /dev/mmcblkX resizepart 1 100% +``` -Press **CTRL+C** to enter the u-boot shell. +**Flash the TPL/SPL combined image** -```{tip} -Set `CONFIG_BOOTDELAY` to `0` in `configs/rk3399-vaaman_defconfig` to disable the delay. +```bash +sudo dd if=u-boot-rockchip.bin of=/dev/mmcblkX seek=64; sync +``` +```` -And recompile the u-boot. +::: + +:::{tab-item} Flashing on NVMe + +Vicharak's mainline u-boot supports a single boot image using binman called +`u-boot-rockchip.bin` which combines the `idbloader.img` and `u-boot.itb` images. + +To write this image to an NVMe, use the following commands. +(Assuming the NVMe is at `/dev/nvmeX`.) + +```bash +sudo dd if=u-boot-rockchip.bin of=/dev/nvmeX seek=64; sync +``` + +::: + +:::: + +Finally reboot the board. + +```bash +sudo reboot ``` :::{seealso} diff --git a/source/vaaman-linux/linux-usage-guide/custom-linux-kernel.md b/source/vaaman-linux/linux-usage-guide/custom-linux-kernel.md index d9c9553..ab2c779 100644 --- a/source/vaaman-linux/linux-usage-guide/custom-linux-kernel.md +++ b/source/vaaman-linux/linux-usage-guide/custom-linux-kernel.md @@ -1,27 +1,7 @@ # How to use custom linux kernel -(available-custom-kernel-types)= - -## Types of kernels available for Vaaman - -Vicharak offers four version of linux kernels for Vaaman board. -Each kernel is based on a different version of the Linux kernel. - -These kernel revisions are based on the sources of Rockchip RK3399 SoC with -necessary changes and optimizations for Vaaman. - -Rockchip is responsible for updating the `RK3399` SoC support in the -Linux kernel. It has provided support for Linux Kernel **4.4, 4.19 and 5.10**. -Additionally Vicharak also supports the Mainline Linux Kernel as well. - -:::{warning} -Some of the kernel versions might not contain all the features supported or required by Vaaman. -Please take a look at the [Vaaman Kernel Status](vaaman-kernel-status) table -for the status of the different kernels available for Vaaman. -::: - -:::{admonition} Refer to -[How to build linux kernel from source guide](../linux-development-guide/linux-kernel.md) +:::{important} +[Read the linux development guide first](#build-linux-kernel) ::: (flash-custom-kernel)= diff --git a/source/vaaman-linux/linux-usage-guide/index.rst b/source/vaaman-linux/linux-usage-guide/index.rst index c2834e2..67612a5 100644 --- a/source/vaaman-linux/linux-usage-guide/index.rst +++ b/source/vaaman-linux/linux-usage-guide/index.rst @@ -10,8 +10,8 @@ the Vaaman Linux Operating System on your device, how to configure it, and how to use it. .. toctree:: - :maxdepth: 2 :caption: User Guides + :titlesonly: Vicharak Linux Start Guide Rockchip MaskROM mode Guide <../../vaaman-maskrom-mode> diff --git a/source/vaaman-linux/linux-usage-guide/vaaman-linux-kernel-status.md b/source/vaaman-linux/linux-usage-guide/vaaman-linux-kernel-status.md index 6b872ac..4f53624 100644 --- a/source/vaaman-linux/linux-usage-guide/vaaman-linux-kernel-status.md +++ b/source/vaaman-linux/linux-usage-guide/vaaman-linux-kernel-status.md @@ -44,6 +44,12 @@ orphan: true - Working - Working +* - LEDs + - Working + - Working + - Working + - Working + * - USB2 - Working - Working @@ -66,7 +72,7 @@ orphan: true - Working - Working - Working - - Not Working + - Not Tested * - SD-card (SDMMC) - Working @@ -209,6 +215,6 @@ orphan: true * - FPGA (MIPI RX-TX Communication) - Working - Working - - Partially Working (SPI rockchip issues) + - Working - Not Working ```