[PATCH] imx: add imx8 support

Tim Harvey tharvey at gateworks.com
Thu Mar 9 12:19:24 PST 2023


On Thu, Mar 9, 2023 at 3:37 AM Petr Štetiar <ynezz at true.cz> wrote:
>
> Tim Harvey <tharvey at gateworks.com> [2023-03-08 16:20:31]:
>
> Hi Tim,
>

Petr,

Thanks for the quick review!

> > Add imx8 support:
> >  - add a cortexa53 subtarget
> >  - move ARCH, KERNELNAME, and some FEATURES to cortexa7/cortexa9 subtargets
> >  - add a small series of backports from 6.2 to fix hang on USB init and
> >    add PCIe support
>
> mark those patches clearly as such v6.2 backports, for example:
>
>  0001-v6.2-soc-imx-gpcv2-allow-to-disable-individual-power-doma.patch

Will do.

Is there any reason to move them into
target/linux/generic/backport-5.15? These patches are all backports
only relevant to imx8.

>
> > No device-specific targets or firmware images are created yet.
>
> Fine with me, but for the time being we should probably mark this subtarget as
> source-only, so we don't waste time on the buildbots as there is not much
> usable result yet.

Ok, I will add FEATURES+=source-only

>
> > The resulting openwrt-imx-cortexa53-vmlinux-initramfs has been booted on
> > Gateworks Venice boards and the imx8mm-evk using dtb's from $LINUX_DIR
> > and verifying usb, pci, mmc, and fec networking work.
>
> Nice, so it boots just fine without any additional post processing/blobs
> needed?

Yes, assuming you already have boot firmware on the target board. I'm
booting from U-Boot with:

setenv serverip 192.168.1.146
setenv ipaddr 192.168.1.1
tftpboot $fdt_addr_r venice/imx8mm-evk.dtb && tftpboot $kernel_addr_r
venice/Image && booti $kernel_addr_r - $fdt_addr_r

>
> As you're not adding bootloader, can add some information about the working
> combination in the commit message as well? Simply anything which would help
> anyone reproducing the result is welcome.

I'm assuming you mean just add details above on how I'm booting in the
commit message?

I couldn't find any doc dir in OpenWrt to add board level
documentation. I was hoping that something had been created like
U-Boot has with rst docs in doc/board/<mfg>/<board>. Where does the
documentation at
https://openwrt.org/docs/guide-user/installation/installation_methods/x86_installation
for example come from?

The reason right now that I'm avoiding boot firmware is:
1. There was pushback regarding the firmware-imx-8.15.bin license
required to build boot firmware (see
http://lists.openwrt.org/pipermail/openwrt-devel/2022-August/039247.html)
2. The various IMX8 SoC's have incompatible binary boot firmware but
the kernel+rootfs is compatible among all the SoC's so it is nice to
have a single OS distribution that avoids boot firmware
3. I'm contemplating moving our boot firmware to emmc boot0/boot1
leaving emmc user SoC agnostic which greatly simplifies things

>
> > -FEATURES:=audio display fpu gpio pcie rtc usb usbgadget squashfs targz nand ubifs boot-part rootfs-part
> > +FEATURES:=audio display fpu gpio pcie rtc usb usbgadget squashfs targz boot-part rootfs-part
>
> Is there any specific reason to not have NAND feature available for a53
> subtarget? `imx8 NAND` yields bunch of search results, so I'm wondering why
> are you bothering with removing this feature, seems like we would likely add
> it back in the near future anyway.

I removed 'nand ubifs' because it causes a build failure where OpenWrt
assumes root.ubifs is present:
cp /usr/src/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-imx_cortexa53/root.ubifs
/usr/src/openwrt/openwrt/bin/targets/imx/cortexa53/openwrt-imx-cortexa53-u
bifs.img
cp: cannot stat
'/usr/src/openwrt/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-imx_cortexa53/root.ubifs':
No such file or directory

This is due FEATURES having ubifs causing USES_UBIFS and
TARGET_ROOTFS_UBIFS getting set but because

Because the arguments to mkfs.ubifs and ubinize are very FLASH device
geometry specific I feel that this should be a device-specific FEATURE
and not target specific or subtarget specific.

>
> > diff --git a/target/linux/imx/cortexa53/target.mk b/target/linux/imx/cortexa53/target.mk
> > new file mode 100644
> > index 000000000000..b9b32d182905
> > --- /dev/null
> > +++ b/target/linux/imx/cortexa53/target.mk
> > @@ -0,0 +1,8 @@
> > +ARCH:=aarch64
> > +BOARDNAME:=NXP i.MX with Cortex-A53 (ARM64)
> > +CPU_TYPE:=cortex-a53
> > +KERNELNAME:=Image dtbs
>
>  FEATURES+=source-only
>

Thanks,

Tim



More information about the openwrt-devel mailing list