mbox series

[v5,0/9] Add initial support for the i.MXRTxxxx SoC family starting from i.IMXRT1050 SoC.

Message ID 20211215220538.4180616-1-Mr.Bossman075@gmail.com (mailing list archive)
Headers show
Series Add initial support for the i.MXRTxxxx SoC family starting from i.IMXRT1050 SoC. | expand

Message

Jesse Taube Dec. 15, 2021, 10:05 p.m. UTC
This patchset contains:
- i.MXRT10xx family infrastructure
- i.MXRT1050 pinctrl driver adaption
- i.MXRT1050 clock driver adaption
- i.MXRT1050 sd-card driver adaption
- i.MXRT1050 uart driver adaption
- i.MXRT1050-evk basic support

The i.MXRTxxxx family that could have support by Linux actually spreads
from i.MXRT1020 to i.MXRT1170 with the first one supporting 1 USB OTG &
100M ethernet with a cortex-M7@500Mhz up to the latter with i.MXRT1170
with cortex-M7@1Ghz and cortex-M4@400Mhz, 2MB of internal SRAM, 2D GPU,
2x 1Gb and 1x 100Mb ENET. The i.MXRT family is NXP's answer to
STM32F7XX, as it uses only simple SDRAM, it gives the chance of a 4 or
less layer PCBs. Seeing that these chips are comparable to the
STM32F7XXs which have linux ported to them it seems reasonable to add
support for them.

Giving Linux support to this family should ease the development process,
instead of using a RTOS they could use Embedded Linux allowing for more
portability, ease of design and will broaden the scope of people using
embedded linux.

The EVK has very little SDRAM, generally 32MB starting from
i.MXRT1020(the lowest P/N), although the i.MXRT1160/70 provide instead
64MB of SDRAM for more functionality.

At the moment we do not support XIP for either u-boot or Linux but it
should be done in the future. XIP will also save SDRAM.

Another interesting fact is the amount of internal SRAM, as the P/N
increases the SRAM will reach up to 2MB(some could be for cache and
some would be for video).

Also, some parts have embed flash of 4MB that can be used for
u-boot/Linux, if both correctly sized it will leave the SDRAM free.

External flash can be Quad SPI and HyperFlash, so throughput would be
decent.

The i.MXRT11xx series supports MIPI interface too.

The family in general provide CAN bus, audio I/O, 1 or more
USB(otg/host), 1 or more 100Mb/1Gb ethernet, camera interface, sd-card.

All this can be used for simple GUIs, web-servers, point-of-sale
stations, etc.

Giulio Benetti (4):
  ARM: imx: Add initial support for i.MXRT10xx family
  dt-bindings: imx: Add clock binding for i.MXRT1050
  ARM: dts: imx: Add i.MXRT1050-EVK support
  ARM: imxrt_defconfig: Add i.MXRT family defconfig

Jesse Taube (5):
  ARM: dts: imxrt1050-pinfunc: Add pinctrl binding header
  dt-bindings: clock: imx: Add documentation for i.MXRT1050 clock
  clk: imx: Add initial support for i.MXRT1050 clock driver
  dt-bindings: serial: fsl-lpuart: add i.MXRT1050 compatible
  tty: serial: fsl_lpuart: Add i.MXRT1050 support

 .../bindings/clock/imxrt1050-clock.yaml       |  66 ++
 .../bindings/serial/fsl-lpuart.yaml           |   1 +
 arch/arm/boot/dts/Makefile                    |   2 +
 arch/arm/boot/dts/imxrt1050-evk.dts           |  72 ++
 arch/arm/boot/dts/imxrt1050-pinfunc.h         | 993 ++++++++++++++++++
 arch/arm/boot/dts/imxrt1050.dtsi              | 154 +++
 arch/arm/configs/imxrt_defconfig              |  35 +
 arch/arm/mach-imx/Kconfig                     |   7 +
 arch/arm/mach-imx/Makefile                    |   2 +
 arch/arm/mach-imx/mach-imxrt.c                |  19 +
 drivers/clk/imx/Kconfig                       |   5 +
 drivers/clk/imx/Makefile                      |   1 +
 drivers/clk/imx/clk-imxrt1050.c               | 181 ++++
 drivers/tty/serial/fsl_lpuart.c               |   8 +
 include/dt-bindings/clock/imxrt1050-clock.h   |  73 ++
 15 files changed, 1619 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/imxrt1050-clock.yaml
 create mode 100644 arch/arm/boot/dts/imxrt1050-evk.dts
 create mode 100644 arch/arm/boot/dts/imxrt1050-pinfunc.h
 create mode 100644 arch/arm/boot/dts/imxrt1050.dtsi
 create mode 100644 arch/arm/configs/imxrt_defconfig
 create mode 100644 arch/arm/mach-imx/mach-imxrt.c
 create mode 100644 drivers/clk/imx/clk-imxrt1050.c
 create mode 100644 include/dt-bindings/clock/imxrt1050-clock.h

Comments

Arnd Bergmann Dec. 16, 2021, 8:26 a.m. UTC | #1
On Wed, Dec 15, 2021 at 11:05 PM Jesse Taube <mr.bossman075@gmail.com> wrote:
>
> This patchset contains:
> - i.MXRT10xx family infrastructure
> - i.MXRT1050 pinctrl driver adaption
> - i.MXRT1050 clock driver adaption
> - i.MXRT1050 sd-card driver adaption
> - i.MXRT1050 uart driver adaption
> - i.MXRT1050-evk basic support
>
> The i.MXRTxxxx family that could have support by Linux actually spreads
> from i.MXRT1020 to i.MXRT1170 with the first one supporting 1 USB OTG &
> 100M ethernet with a cortex-M7@500Mhz up to the latter with i.MXRT1170
> with cortex-M7@1Ghz and cortex-M4@400Mhz, 2MB of internal SRAM, 2D GPU,
> 2x 1Gb and 1x 100Mb ENET. The i.MXRT family is NXP's answer to
> STM32F7XX, as it uses only simple SDRAM, it gives the chance of a 4 or
> less layer PCBs. Seeing that these chips are comparable to the
> STM32F7XXs which have linux ported to them it seems reasonable to add
> support for them.
>
> Giving Linux support to this family should ease the development process,
> instead of using a RTOS they could use Embedded Linux allowing for more
> portability, ease of design and will broaden the scope of people using
> embedded linux.
>
> The EVK has very little SDRAM, generally 32MB starting from
> i.MXRT1020(the lowest P/N), although the i.MXRT1160/70 provide instead
> 64MB of SDRAM for more functionality.
>
> At the moment we do not support XIP for either u-boot or Linux but it
> should be done in the future. XIP will also save SDRAM.
>
> Another interesting fact is the amount of internal SRAM, as the P/N
> increases the SRAM will reach up to 2MB(some could be for cache and
> some would be for video).
>
> Also, some parts have embed flash of 4MB that can be used for
> u-boot/Linux, if both correctly sized it will leave the SDRAM free.
>
> External flash can be Quad SPI and HyperFlash, so throughput would be
> decent.
>
> The i.MXRT11xx series supports MIPI interface too.
>
> The family in general provide CAN bus, audio I/O, 1 or more
> USB(otg/host), 1 or more 100Mb/1Gb ethernet, camera interface, sd-card.
>
> All this can be used for simple GUIs, web-servers, point-of-sale
> stations, etc.

This looks all good to me now, but the drivers need to be reviewed by the
respective subsystem maintainers before we can merge it into the soc
tree. As with other new SoCs, I'm happy to merge the support as a combined
pull request that includes the drivers provided that the driver subsystem
maintainers have reviewed them.

Ideally the i.MX maintainers would pick up your series into a separate
branch and send that to soc@kernel.org the same way as the other topic
branches that are usually split out between DT, drivers, soc code etc.

With the Christmas break coming up, the timing may not be sufficient
before I'm off next week, so it may end up too late for 5.17 but should
be fine for 5.18.

As a more general comment, it's always nice to see newly added SoC
platforms, especially when they are this well implemented and done
by hobbyists. However, I do think you are being overly optimistic
as to how useful this is going to be to other people: interest in NOMMU
ARM platforms has dropped a lot over the past 5 years, and as far as I
can tell, it is only being kept alive for existing stm32 customers
as the economics do not favor Linux on Cortex-M for new products
compare to Linux on Cortex-A or some RTOS on Cortex-M.

The existing users will inevitably stop updating their kernels at some
point, and then it's most likely just you and Vladimir Murzin that care.

       Arnd
Giulio Benetti Dec. 16, 2021, 5:33 p.m. UTC | #2
Hi Arnd, Jesse, All,

sorry for previous HTML e-mail(I was on mobile phone),

On 16/12/21 09:26, Arnd Bergmann wrote:
> On Wed, Dec 15, 2021 at 11:05 PM Jesse Taube <mr.bossman075@gmail.com> wrote:
>>
>> This patchset contains:
>> - i.MXRT10xx family infrastructure
>> - i.MXRT1050 pinctrl driver adaption
>> - i.MXRT1050 clock driver adaption
>> - i.MXRT1050 sd-card driver adaption
>> - i.MXRT1050 uart driver adaption
>> - i.MXRT1050-evk basic support
>>
>> The i.MXRTxxxx family that could have support by Linux actually spreads
>> from i.MXRT1020 to i.MXRT1170 with the first one supporting 1 USB OTG &
>> 100M ethernet with a cortex-M7@500Mhz up to the latter with i.MXRT1170
>> with cortex-M7@1Ghz and cortex-M4@400Mhz, 2MB of internal SRAM, 2D GPU,
>> 2x 1Gb and 1x 100Mb ENET. The i.MXRT family is NXP's answer to
>> STM32F7XX, as it uses only simple SDRAM, it gives the chance of a 4 or
>> less layer PCBs. Seeing that these chips are comparable to the
>> STM32F7XXs which have linux ported to them it seems reasonable to add
>> support for them.
>>
>> Giving Linux support to this family should ease the development process,
>> instead of using a RTOS they could use Embedded Linux allowing for more
>> portability, ease of design and will broaden the scope of people using
>> embedded linux.
>>
>> The EVK has very little SDRAM, generally 32MB starting from
>> i.MXRT1020(the lowest P/N), although the i.MXRT1160/70 provide instead
>> 64MB of SDRAM for more functionality.
>>
>> At the moment we do not support XIP for either u-boot or Linux but it
>> should be done in the future. XIP will also save SDRAM.
>>
>> Another interesting fact is the amount of internal SRAM, as the P/N
>> increases the SRAM will reach up to 2MB(some could be for cache and
>> some would be for video).
>>
>> Also, some parts have embed flash of 4MB that can be used for
>> u-boot/Linux, if both correctly sized it will leave the SDRAM free.
>>
>> External flash can be Quad SPI and HyperFlash, so throughput would be
>> decent.
>>
>> The i.MXRT11xx series supports MIPI interface too.
>>
>> The family in general provide CAN bus, audio I/O, 1 or more
>> USB(otg/host), 1 or more 100Mb/1Gb ethernet, camera interface, sd-card.
>>
>> All this can be used for simple GUIs, web-servers, point-of-sale
>> stations, etc.
> 
> This looks all good to me now, but the drivers need to be reviewed by the
> respective subsystem maintainers before we can merge it into the soc
> tree. As with other new SoCs, I'm happy to merge the support as a combined
> pull request that includes the drivers provided that the driver subsystem
> maintainers have reviewed them.
> 
> Ideally the i.MX maintainers would pick up your series into a separate
> branch and send that to soc@kernel.org the same way as the other topic
> branches that are usually split out between DT, drivers, soc code etc.
> 
> With the Christmas break coming up, the timing may not be sufficient
> before I'm off next week, so it may end up too late for 5.17 but should
> be fine for 5.18.
> 
> As a more general comment, it's always nice to see newly added SoC
> platforms, especially when they are this well implemented and done
> by hobbyists. However, I do think you are being overly optimistic
> as to how useful this is going to be to other people: interest in NOMMU
> ARM platforms has dropped a lot over the past 5 years, and as far as I
> can tell, it is only being kept alive for existing stm32 customers
> as the economics do not favor Linux on Cortex-M for new products
> compare to Linux on Cortex-A or some RTOS on Cortex-M.
> 
> The existing users will inevitably stop updating their kernels at some
> point, and then it's most likely just you and Vladimir Murzin that care.


About this will you accept support for the other SoCs in the family?
We would like to add in the near future:
- i.MXRT1020(uboot support is already upstreamed)
- i.MXRT1024(almost equal to 1020)
- i.MXRT1060(almost equal to 1050)
- i.MXRT1064(almost equal to 1060)
And
- i.MXRT1160/70 new family with faster core clock(1Ghz) and a cortex M4

We need to add missing lcd(uboot upstreamed), usb(uboot upstreamed), 
ethernet(wip) supports for i.MXRT10xx family.

This is to organize with Jesse also about buying evaluation boards and 
timing.

We’ve meant this porting also as an exercise to deal with Linux deeper 
for us and for the other newbies.

We’ve been also asked about a possible support for s32s(quad cortex-R52) 
on initial emails but it has no mmu too.
While I’m seeing that some cortex-R is landing inside Linux.
Would it be interesting anyway?

Best regards
—-
Giulio Benetti
Benetti Engineering sas
Arnd Bergmann Dec. 16, 2021, 9:13 p.m. UTC | #3
On Thu, Dec 16, 2021 at 6:33 PM Giulio Benetti
<giulio.benetti@benettiengineering.com> wrote:
> On 16/12/21 09:26, Arnd Bergmann wrote:
> > On Wed, Dec 15, 2021 at 11:05 PM Jesse Taube <mr.bossman075@gmail.com> wrote:

> > As a more general comment, it's always nice to see newly added SoC
> > platforms, especially when they are this well implemented and done
> > by hobbyists. However, I do think you are being overly optimistic
> > as to how useful this is going to be to other people: interest in NOMMU
> > ARM platforms has dropped a lot over the past 5 years, and as far as I
> > can tell, it is only being kept alive for existing stm32 customers
> > as the economics do not favor Linux on Cortex-M for new products
> > compare to Linux on Cortex-A or some RTOS on Cortex-M.
> >
> > The existing users will inevitably stop updating their kernels at some
> > point, and then it's most likely just you and Vladimir Murzin that care.
>
>
> About this will you accept support for the other SoCs in the family?
> We would like to add in the near future:
> - i.MXRT1020(uboot support is already upstreamed)
> - i.MXRT1024(almost equal to 1020)
> - i.MXRT1060(almost equal to 1050)
> - i.MXRT1064(almost equal to 1060)
> And
> - i.MXRT1160/70 new family with faster core clock(1Ghz) and a cortex M4
>
> We need to add missing lcd(uboot upstreamed), usb(uboot upstreamed),
> ethernet(wip) supports for i.MXRT10xx family.

Sure, anything you want to work on supporting can be added to the kernel,
the important bit is that it's well written and can be maintained going forward.

My best guess is that we'll end up ripping out all NOMMU support in
a few years, when we get to a point when both of these things happen:

- the number of actual users that still update their kernels becomes
  really low

- There is some treewide refactoring that isn't easily supportable without an
   MMU unless someone puts extra work into it.

At the moment, we still support NOMMU kernels on a bunch of architectures
(Arm, riscv/k210, sh/j2, m68k/coldfire, xtensa and h8300). Out of these,
Arm is by far the most active, and if Arm NOMMU support was to go away
for some reason, the others would likely follow.

> This is to organize with Jesse also about buying evaluation boards and
> timing.
>
> We’ve meant this porting also as an exercise to deal with Linux deeper
> for us and for the other newbies.
>
> We’ve been also asked about a possible support for s32s(quad cortex-R52)
> on initial emails but it has no mmu too.
> While I’m seeing that some cortex-R is landing inside Linux.
> Would it be interesting anyway?

I brought that up during the initial review, but I think this is even
less interesting
than Cortex-M support from the perspective of potential use cases. While
Cortex-M MCUs have some advantages over larger SoCs in terms of
power consumption and cost, this is generally not true for running Linux
on Cortex-R. The Cortex-R and Cortex-A cores are closely related, so
they tend have similar power/performance/area characteristics, but
the lack of an MMU makes the Cortex-R much less useful. If there was
an advantage to running with the MMU disabled, you could actually do that
on a Cortex-A as well, but clearly nobody does that either.

Vladimir has put some work into making Cortex-R work in the kernel, and
he may have some other thoughts on this question.

          Arnd
Giulio Benetti Dec. 17, 2021, 9:54 a.m. UTC | #4
Hi Arnd,

On 16/12/21 22:13, Arnd Bergmann wrote:
> On Thu, Dec 16, 2021 at 6:33 PM Giulio Benetti
> <giulio.benetti@benettiengineering.com> wrote:
>> On 16/12/21 09:26, Arnd Bergmann wrote:
>>> On Wed, Dec 15, 2021 at 11:05 PM Jesse Taube <mr.bossman075@gmail.com> wrote:
> 
>>> As a more general comment, it's always nice to see newly added SoC
>>> platforms, especially when they are this well implemented and done
>>> by hobbyists. However, I do think you are being overly optimistic
>>> as to how useful this is going to be to other people: interest in NOMMU
>>> ARM platforms has dropped a lot over the past 5 years, and as far as I
>>> can tell, it is only being kept alive for existing stm32 customers
>>> as the economics do not favor Linux on Cortex-M for new products
>>> compare to Linux on Cortex-A or some RTOS on Cortex-M.
>>>
>>> The existing users will inevitably stop updating their kernels at some
>>> point, and then it's most likely just you and Vladimir Murzin that care.
>>
>>
>> About this will you accept support for the other SoCs in the family?
>> We would like to add in the near future:
>> - i.MXRT1020(uboot support is already upstreamed)
>> - i.MXRT1024(almost equal to 1020)
>> - i.MXRT1060(almost equal to 1050)
>> - i.MXRT1064(almost equal to 1060)
>> And
>> - i.MXRT1160/70 new family with faster core clock(1Ghz) and a cortex M4
>>
>> We need to add missing lcd(uboot upstreamed), usb(uboot upstreamed),
>> ethernet(wip) supports for i.MXRT10xx family.
> 
> Sure, anything you want to work on supporting can be added to the kernel,
> the important bit is that it's well written and can be maintained going forward.
> 
> My best guess is that we'll end up ripping out all NOMMU support in
> a few years, when we get to a point when both of these things happen:
> 
> - the number of actual users that still update their kernels becomes
>    really low
> 
> - There is some treewide refactoring that isn't easily supportable without an
>     MMU unless someone puts extra work into it.
> 
> At the moment, we still support NOMMU kernels on a bunch of architectures
> (Arm, riscv/k210, sh/j2, m68k/coldfire, xtensa and h8300). Out of these,
> Arm is by far the most active, and if Arm NOMMU support was to go away
> for some reason, the others would likely follow.

Ok, I understad now.

>> This is to organize with Jesse also about buying evaluation boards and
>> timing.
>>
>> We’ve meant this porting also as an exercise to deal with Linux deeper
>> for us and for the other newbies.
>>
>> We’ve been also asked about a possible support for s32s(quad cortex-R52)
>> on initial emails but it has no mmu too.
>> While I’m seeing that some cortex-R is landing inside Linux.
>> Would it be interesting anyway?
> 
> I brought that up during the initial review, but I think this is even
> less interesting
> than Cortex-M support from the perspective of potential use cases. While
> Cortex-M MCUs have some advantages over larger SoCs in terms of
> power consumption and cost, this is generally not true for running Linux
> on Cortex-R. The Cortex-R and Cortex-A cores are closely related, so
> they tend have similar power/performance/area characteristics, but
> the lack of an MMU makes the Cortex-R much less useful. If there was
> an advantage to running with the MMU disabled, you could actually do that
> on a Cortex-A as well, but clearly nobody does that either.

Yes

Thank you for the answer

> Vladimir has put some work into making Cortex-R work in the kernel, and
> he may have some other thoughts on this question.

I'm curious if he has something specific to Cortex-R to tell.

I've found that Cortex-R82 has a MMU:
https://www.arm.com/products/silicon-ip-cpu/cortex-r/cortex-r82
but I can't find any SoC that uses it. Also, I don't know how many 
people could use it honestly.

Best regards
Arnd Bergmann Dec. 17, 2021, 10:28 a.m. UTC | #5
On Fri, Dec 17, 2021 at 10:54 AM Giulio Benetti
<giulio.benetti@benettiengineering.com> wrote:
> On 16/12/21 22:13, Arnd Bergmann wrote:
>
> > Vladimir has put some work into making Cortex-R work in the kernel, and
> > he may have some other thoughts on this question.
>
> I'm curious if he has something specific to Cortex-R to tell.
>
> I've found that Cortex-R82 has a MMU:
> https://www.arm.com/products/silicon-ip-cpu/cortex-r/cortex-r82
> but I can't find any SoC that uses it. Also, I don't know how many
> people could use it honestly.

R82 is fairly new, but I expect that we will see support in Linux in the
future. Aside from having an MMU, it also 64-bit-only, so we'd treat
it like a normal ARMv8-A core in arch/arm64.

        Arnd
Giulio Benetti Dec. 17, 2021, 11:54 a.m. UTC | #6
On 17/12/21 11:28, Arnd Bergmann wrote:
> On Fri, Dec 17, 2021 at 10:54 AM Giulio Benetti
> <giulio.benetti@benettiengineering.com> wrote:
>> On 16/12/21 22:13, Arnd Bergmann wrote:
>>
>>> Vladimir has put some work into making Cortex-R work in the kernel, and
>>> he may have some other thoughts on this question.
>>
>> I'm curious if he has something specific to Cortex-R to tell.
>>
>> I've found that Cortex-R82 has a MMU:
>> https://www.arm.com/products/silicon-ip-cpu/cortex-r/cortex-r82
>> but I can't find any SoC that uses it. Also, I don't know how many
>> people could use it honestly.
> 
> R82 is fairly new, but I expect that we will see support in Linux in the
> future. Aside from having an MMU, it also 64-bit-only, so we'd treat
> it like a normal ARMv8-A core in arch/arm64.

Ah yes, that's fine. So let's wait for the future, in the meanwhile we 
focus con i.MXRT :-)

Thank you
Best regards