RZ-G/RZ-G2 BSP Porting OpenWRT: Difference between revisions
Tag: Manual revert |
|||
Line 92: | Line 92: | ||
|Add target system Makefile | |Add target system Makefile | ||
|- | |- | ||
| | |||
include $(TOPDIR)/rules.mk | include $(TOPDIR)/rules.mk | ||
ARCH:=aarch64 | ARCH:=aarch64 |
Revision as of 13:56, 9 January 2024
← Back to RZ-G/RZ-G2_BSP_Porting
SoC: All
Specification
Target OpenWRT OS Version: openwrt-22.03
Target reference board: RZ/G2L,/G2LC,/G2UL SMARC
Host PC Environment: Ubuntu20.04
OpenWRT build system setup bese on Ubuntu20.04
Run below command on Host Ubuntu PC
sudo apt update
sudo apt install build-essential ccache ecj fastjarfileg++gawk\
gettextgitjava-propose-classpath libelf-dev libncurses5-dev\
libncursesw5-dev libssl-dev python python2.7-dev python3unzipwget\
python-distutils-extra python3-setuptools python3-dev rsync subversion\
swigtimexsltproc zlib1g-dev
Download source code
git clone https://git.openwrt.org/openwrt/openwrt.git
The reasion why we need to choise 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 portting renesas's smarc board driver to the kernel.
openwrt23.05 base on kernel version 5.15.134
openwrt22.03 base on kernel version 5.10.116
openwrt21.02 base on kernel version 5.4.194
openwrt19.07 base on kernel version 4.14.275
openwrt18.06 base on kernel version 4.14.206
Check out 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 |
Get current branch's application source code
cd openwrt ./scripts/feeds update -a && ./scripts/feeds install -a
Create project for Renesas RZ/G2L SMARC EVK
Create Renesas's target system.
cd openwrt mkdir target/linux/renesas cd target/linux/renesas
Add target system Makefile |
include $(TOPDIR)/rules.mk ARCH:=aarch64 BOARD:=renesas BOARDNAME:=Renesas RZ/G2 FEATURES:=ext4 audio usb usbgadget display gpio fpu pci pcie rootfs-part boot-part squashfs SUBTARGETS:=r9a07g044 KERNEL_PATCHVER:=5.10 KERNELNAME:=Image dtbs define Target/Description Build firmware image for Renesas SoC devices. endef include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += uboot-envtools partx-utils e2fsprogs mkf2fs $(eval $(call BuildTarget)) |
Prepare kernel source code
Because openwrt22.03 default use kernel version 5.10.xxx come from kernel.org, but this version source code download form kernel.org don't support RZ/G2L SMRAC EVK board build. So, we need to use external kernel code come from Renesas's GitHub.
git clone https://github.com/renesas-rz/rz_linux-cip cd rz_linux_cip git checkout rz-5.10-cip3
cd openwrt make defconfig && make menuconfig
Select red box information
Target System () ---> Renesas
Subtarget ( ) ---> RZ/G2L SMRAC EVK board
Target Profile (smarc rzg2l) ---> smarc rzg2l
Target Images ---> (16) Kernel partition size (in MiB) (NEW)
Change Kernel partition size 16M ==> 64M
Select Advanced configuration options (for developers) (NEW) ---> Use external kernel tree (NEW)
Input your kernel source code path dir:$YOUR_KERNEL_DIR/rz_linux-cip
Select Image configuration ---> Separate feed repositories ---> Enable feef luci
Save all your select and exit menuconfig
Because we use external kernel tree So, we need do kernel menuconfig
make kernel_menuconfig -j8
This command will take a long time. Just wait, No need to select anything just use default config.
Save and exit kernel_menuconfig
Start build the whole system and generate sdcard.img
make -j8 V=99
Use rufus tools to burn sdcard.img Select openwrt-renesas-armv8-smarc_rzg2l-ext4-sdcard.img.gz to be burn.
Boot OpenWRT form SD card 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
Then OpenWRT boot sources like that:
Set password for root login Luci web need this password.
Because RZ/G2L SMARC EVK board has two net interfaces eth0 and eth1, so change eth0 as Lan and eth1 as Wan.
After change the interface Lan, need restart network.
Connect eth0 to your pc by rj45 cable, Then you can login Luci web server by web browser. http://192.168.1.1
You can also ssh to OpenWRT : ssh root@192.168.1.1
Now OpenWRT has been ported and run on RZG2L SMARC EVK board.