Page MenuHomeFreeBSD

Add iMX8MQ support
ClosedPublic

Authored by gonzo on Jun 14 2020, 11:40 PM.
Tags
None
Referenced Files
F103129894: D25274.id73934.diff
Thu, Nov 21, 9:45 AM
Unknown Object (File)
Wed, Nov 20, 8:05 AM
Unknown Object (File)
Tue, Nov 19, 9:15 AM
Unknown Object (File)
Mon, Nov 18, 8:05 PM
Unknown Object (File)
Wed, Nov 13, 8:18 PM
Unknown Object (File)
Sun, Nov 10, 12:47 PM
Unknown Object (File)
Sun, Nov 10, 10:57 AM
Unknown Object (File)
Sun, Nov 10, 3:47 AM

Details

Summary

This patch adds basic support for for iMX8:

  • CCM driver and clocks implementations for iMX8
  • GPC driver for iMX8
  • clock tree for iMX8MQ
  • clocks support and new compat strings (if required) for existing iMX6 UART, I2C, and GPIO drivers
  • Enables aarch64-compatible drivers form iMX6 to arm64 GENERIC kernel config
  • dtb/imx8 kernel module with DTBs for Nitrogen8M and iMX8MQ EVK
Test Plan

This patch was tested only for basic functionality:

  • Booted on Nitrogen8M board with NFS root
  • Booted on iMX8MQ EVK board with NFS root
  • watchdog tested with watchdogd -t 33 -e /usr/bin/false --debug
  • I2C tested by scanning the bus and checking that there is device
  • GPIO wasn't tested

Also verified that both GENERIC and IMX6 kernel configs still build
and boot with this patch applied.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Added a few nits but otherwise it's looks great, thanks for working on this !

sys/arm/freescale/imx/imx_wdog.c
170 ↗(On Diff #73120)

I guess this could be commited separatly.

sys/arm64/conf/GENERIC
116 ↗(On Diff #73120)

How different are the IMX8 SoCs ?
Maybe we just need SOC_FREESCALE_IMX8 as I guess all the drivers are more or less the same and only a few clocks/device will be present or not.

sys/arm64/freescale/imx/clk/imx_clk_sscg_pll.c
151 ↗(On Diff #73120)

This can be move above the divr1 = ... line I suppose.

sys/arm64/freescale/imx/imx7gpc.c
5 ↗(On Diff #73120)

Do you want the "all rights reserved" mention ?

9 ↗(On Diff #73120)

Where does that comes from ?

sys/arm64/freescale/imx/imx8mq_ccm.c
56 ↗(On Diff #73120)

It's unfortunately GPLv2 licenced ...
What we did for rockchip is that we redefined those value.
I agree that this file cannot be licenced as it's just name/id representation but ...

61 ↗(On Diff #73120)

Does the dummy clocks represent some unimplemented clocks or is it needed because the parent idx is 2 bits ?

sys/arm64/freescale/imx/imx_ccm_clk.h
5 ↗(On Diff #73120)

Same comment as above for this mention.

sys/modules/dtb/imx8/Makefile
2 ↗(On Diff #73120)

s/imx6/imx8/

gonzo added inline comments.
sys/arm64/conf/GENERIC
116 ↗(On Diff #73120)

Yes, looks like the difference is mostly in set of blocks in the SoC, but overall they're conceptually the same: https://www.nxp.com/docs/en/supporting-information/IMX8LAYERCMPR.pdf

sys/arm64/freescale/imx/imx7gpc.c
9 ↗(On Diff #73120)

I started by using arm/freescale/imx/imx_gpt.c but ended up completely rewriting it, so will remove it.

sys/arm64/freescale/imx/imx8mq_ccm.c
61 ↗(On Diff #73120)

The latter I think. There is dummy clock id in the header file: IMX8MQ_CLK_DUMMY

gonzo marked 3 inline comments as done.

Address manu@ comments

This revision is now accepted and ready to land.Jun 16 2020, 7:43 PM
This revision was automatically updated to reflect the committed changes.