SoC: All
Target OpenWRT OS Version:Â openwrt-22.03
Target reference board:Â RZ/G2L-LC-UL SMARC EVK
Host PC Environment:Â Ubuntu20.04
...
Run below command on Host Ubuntu PC
sudo apt update
sudo apt install build-essential ccache ecj fastjar file g++ gawk \
gettext git java-propose-classpath libelf-dev libncurses5-dev \
libncursesw5-dev libssl-dev python python2.7-dev python3 unzip wget \
python-distutils-extra python3-setuptools python3-dev rsync subversion \
swig time xsltproc zlib1g-dev
git
...
...
reason why we need to
...
choose 22.03 branch is because openwrt-22.03 use the same kernel version linux-5.10.xxx with RZ/G2L VLP3.0.x yocto
...
SDK, so we can reduce the hard difficulty when
...
porting Renesas's
...
SMARC board driver to the kernel.
openwrt23.05 base on kernel version 5.15.xxx
openwrt22.03 base on kernel version 5.10.xxx
openwrt21.02 base on kernel version 5.4.xxx
openwrt19.07 base on kernel version 4.14.xxx
openwrt18.06 base on kernel version 4.14.xxx
Check out openwrt-22.03 branch code |
cd openwrt git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/lede-17.01
remotes/origin/main
remotes/origin/master
remotes/origin/openwrt-18.06
remotes/origin/openwrt-19.07
remotes/origin/openwrt-21.02
remotes/origin/openwrt-22.03
remotes/origin/openwrt-23.05
git checkout openwrt-22.03
Branch 'openwrt-22.03' set up to track remote branch 'openwrt-22.03' from 'origin'. Switched to a new branch 'openwrt-22.03' git branch -a
master
* openwrt-22.03
remotes/origin/HEAD -> origin/master
remotes/origin/lede-17.01
remotes/origin/master
remotes/origin/openwrt-18.06
remotes/origin/openwrt-19.07
remotes/origin/openwrt-21.02
remotes/origin/openwrt-22.03
remotes/origin/openwrt-23.05 |
cd openwrt
./scripts/feeds update -a && ./scripts/feeds install -a
...
cd openwrt
mkdir target/linux/renesas
cd target/linux/renesas
Add target project Makefile |
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright 2023 Renesas
include $(TOPDIR)/rules.mk
BOARD:=renesas
BOARDNAME:=Renesas RZ MPU
FEATURES:=ext4 rootfs-part boot-part squashfs
SUBTARGETS:=r9a07g044
KERNEL_PATCHVER:=5.10
KERNELNAME:=Image dtbs
define Target/Description
Build firmware image for Renesas RZ MPU SoC devices.
endef
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += uboot-envtools partx-utils e2fsprogs mkf2fs
$(eval $(call BuildTarget)) |
mkdir r9a07g044
cd r9a07g044
Add target.mk |
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright 2023 Renesas
ARCH:=aarch64
SUBTARGET:=r9a07g044
BOARDNAME:=RZ/G2L-LC-UL SMARC EVK board
define Target/Description
Build firmware image for Renesas RZ/G2L-LC-UL SMARC EVK board.
endef |
|
cd ..
mkdir image
cd image
Add Makefile |
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright 2023 Renesas
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
define Build/Compile
$(CP) $(LINUX_DIR)/COPYING $(KDIR)/COPYING.linux
endef
### Image scripts ###
define Build/boot-common
# This creates a new folder copies the dtb
# and the kernel image (as Image)
rm -fR $@.boot
mkdir -p $@.boot
$(CP) $(DTS_DIR)/$(DEVICE_DTS).dtb $@.boot
$(CP) $(KDIR)/$(DEVICE_KERNEL) $@.boot
endef
define Build/boot-image
# Creates the final SD/eMMC images,
# combining boot partition, root partition.
PADDING=1 $(SCRIPT_DIR)/gen_image_generic.sh \
$@ \
$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
32768
endef
define Device/Default
PROFILESÂ := Default
IMAGESÂ := sdcard.img.gz
DEVICE_KERNELÂ := Image
KERNELÂ := kernel-bin
endef
include $(SUBTARGET).mk
$(eval $(call BuildImage))
|
Add r9a07g044.mk |
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright 2023 Renesas
define Device/smarc_rzg2l
DEVICE_VENDORÂ := smarc
DEVICE_MODELÂ := rzg2l
SOCÂ := r9a07g044l2
IMAGE/sdcard.img.gz := boot-common | boot-image | gzip | append-metadata
DEVICE_DTS = renesas/$$(SOC)-$$(DEVICE_VENDOR)
endef
TARGET_DEVICES += smarc_rzg2l
define Device/smarc_rzg2lc
DEVICE_VENDORÂ := smarc
DEVICE_MODELÂ := rzg2lc
SOCÂ := r9a07g044c2
IMAGE/sdcard.img.gz := boot-common | boot-image | gzip | append-metadata
DEVICE_DTS = renesas/$$(SOC)-$$(DEVICE_VENDOR)
endef
TARGET_DEVICES += smarc_rzg2lc
define Device/smarc_rzg2ul
DEVICE_VENDORÂ := smarc
DEVICE_MODELÂ := rzg2ul
SOCÂ := r9a07g043u11
IMAGE/sdcard.img.gz := boot-common | boot-image | gzip | append-metadata
DEVICE_DTS = renesas/$$(SOC)-$$(DEVICE_VENDOR)
endef
TARGET_DEVICES += smarc_rzg2ul |
cd openwrt
make defconfig && make menuconfig
Target System () ---> Renesas RZ MPU
Subtarget ( ) ---> RZ/G2L-LC-UL SMRAC EVK board
Target Profile (smarc rzg2l) ---> smarc rzg2l
...
Image Added
Because openwrt20.03 use kernel version 5.10.xxx come from kernel.org, but this version kernel source download form kernel.org don't support RZ/G2L SMARC EVK board build.
So, we need to use external kernel code come from Renesas's GitHub.
Enable Advanced configuration options (for developers) (NEW) ---> Enter git repository to clone
...
Image Added
Select Advanced configuration options (for developers) (NEW) ---> input Renesas's rz_linux_cip git repository (https://github.com/renesas-rz/rz_linux-cip) && branch what you want, such as (rz-5.10-cip3), all 5.10.xxx kernel can be select.Â
...
Image Added
Due to Renesas's CIP kernel compiled size is about 17MByte, default kernel partition capacity 16MByte sizes have not enough space to store Image and dtb.
Target Images ---> (16) Kernel partition size (in MiB) (NEW)
Change Kernel partition size 16M ==> 64M
Â
...
Image Added
Select LuCI ---> 1. Collections ---> <*> luci................... LuCI interface with Uhttpd as Webserver (default)Â
Image Removed
...
Image Added
Because cip kernel's defconfig come fome VLP3.0.x default don't support ppp moudle. So, if we don't modify kernel config, we need to remove ppp daemon service.Â
...
Image Added
...
Image Added
Start build the whole system and generate sdcard.img
make -j$(nproc)
If you want to output more message you can use
make -j$(nproc) V=s
Select openwrt-renesas-r9a07g044-smarc_rzg2l-ext4-sdcard.img.gz to be burn.
Â
...
Image Added
...
Insert SD card and set u-boot boot parameter:
setenv boot_openwrt 'mmc dev 1; ext4load mmc 1:1 0x48080000 Image; ext4load mmc 1:1 0x48000000 r9a07g044l2-smarc.dtb; setenv bootargs rootwait root=/dev/mmcblk1p2; booti 0x48080000 - 0x48000000'
setenv bootcmd 'run boot_openwrt'
saveenv
boot
...
Image Added
Then OpenWRT boot success like that:
Â
...
Image Added
Set password for root login Luci web need this password.
Â
...
Image Added
Because RZ/G2L SMARC EVK board has two net interfaces eth0 and eth1, so change eth0 as Lan and eth1 as Wan.Â
...
Image Added
After change the interface Lan, need restart network.
Â
...
Image Added
Connect eth0 to your pc by rj45 cable, Then you can login Luci web server by web browser. http://192.168.1.1
...
Â
Image Added
You can also ssh to OpenWRTÂ : ssh root@192.168.1.1
Now OpenWRT has been ported and run on RZG2L SMARC EVK board.
...
1. Kernel here completely uses CIP Linux of VLP3.0.x.
2. Kernel can be compiled separately outside of openwrt.
3. Bootloader of RZ MPU also comes from VLP3.0.x, it should be build outside of openwrt.
4. Why we use VLP’s CIP linux kernel? Because the 5.10 kernel of the open source community used by openwrt default does not support the compilation of RZ/G2L-LC-UL SMRAC EVK board, So CIP kernel of VLP is used, but the rootfs is switched to openwrt.
5. In addition, the CIP kernel does not support bridges and ppp by default, Some openwrt features can't be fully supported.
Table of Contents |
---|