Skip to contentSkip to conversation

can: m_can: Add PCI glue driver for Intel Elkhart Lake

PATCH In review Jarkko Nikula 2 participants 4 messages Nov 17, 2020 – Nov 19, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: m_can: Add PCI glue driver for Intel Elkhart Lake

Add support for M_CAN controller on Intel Elkhart Lake attached to the PCI bus. It integrates the Bosch M_CAN controller with Message RAM and the wrapper IP block with additional registers which all of them are within the same MMIO range.

Currently only interrupt control register from wrapper IP is used and the MRAM configuration is expected to come from the firmware via "bosch,mram-cfg" device property and parsed by m_can.c core.

Initial implementation is done by Felipe Balbi while he was working at Intel with later changes from Raymond Tan and me.

---
This has soft dependency to patches sent earlier by Patrik Flykt and me:
https://www.spinics.net/lists/linux-can/msg04936.html
https://www.spinics.net/lists/linux-can/msg04182.html
Soft dependency since this can be applied without them but will see the issues fixed by those patches.

---
 drivers/net/can/m_can/Kconfig     |   8 ++
 drivers/net/can/m_can/Makefile    |   1 +
 drivers/net/can/m_can/m_can_pci.c | 186 ++++++++++++++++++++++++++++++
 3 files changed, 195 insertions(+)
 create mode 100644 drivers/net/can/m_can/m_can_pci.c
drivers/net/can/m_can/Kconfig +8 -0
index 5f9f8192dd0b..aa6044c6bbac 100644
@@ -14,6 +14,14 @@ config CAN_M_CAN_PLATFORM
 	  This support is for devices that have the Bosch M_CAN controller
 	  IP embedded into the device and the IP is IO Mapped to the processor.
 
+config CAN_M_CAN_PCI
+	tristate "Generic PCI Bus based M_CAN driver"
+	depends on PCI
+	depends on CAN_M_CAN
+	help
+	   Say Y here if you want to support Bosch M_CAN controller connected
+	   to the pci bus.
+
 config CAN_M_CAN_TCAN4X5X
 	depends on CAN_M_CAN
 	depends on SPI
drivers/net/can/m_can/Makefile +1 -0
index 52a4a6fbe527..227e67390c4e 100644
@@ -5,4 +5,5 @@
 
 obj-$(CONFIG_CAN_M_CAN) += m_can.o
 obj-$(CONFIG_CAN_M_CAN_PLATFORM) += m_can_platform.o
+obj-$(CONFIG_CAN_M_CAN_PCI) += m_can_pci.o
 obj-$(CONFIG_CAN_M_CAN_TCAN4X5X) += tcan4x5x.o
drivers/net/can/m_can/m_can_pci.c new file +186 -0

186 lines not on this page · raw message

Signature · 1 line
2.29.2
#1 lore raw
Quoted 17 lines · Jarkko Nikula

Add support for M_CAN controller on Intel Elkhart Lake attached to the PCI bus. It integrates the Bosch M_CAN controller with Message RAM and the wrapper IP block with additional registers which all of them are within the same MMIO range.

Currently only interrupt control register from wrapper IP is used and the MRAM configuration is expected to come from the firmware via "bosch,mram-cfg" device property and parsed by m_can.c core.

Initial implementation is done by Felipe Balbi while he was working at Intel with later changes from Raymond Tan and me.

Quoted 6 lines

---
This has soft dependency to patches sent earlier by Patrik Flykt and me:
https://www.spinics.net/lists/linux-can/msg04936.html
https://www.spinics.net/lists/linux-can/msg04182.html
Soft dependency since this can be applied without them but will see the issues fixed by those patches.

I've applied the patches to linux-can-next/m_can, which is available here

https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/commit/?h=m_can

Can you please test that branch. This will go into next, once the net/master is merged to net-next/master.

regards,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
#2 lore raw
Quoted 7 lines · Marc Kleine-Budde

I've applied the patches to linux-can-next/m_can, which is available here

https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/commit/?h=m_can

Can you please test that branch. This will go into next, once the net/master is merged to net-next/master.

Thanks, works fine at quick test. I had the patch from top of linux-next tag next-20201117 so it wasn't very far away from you branch. Will send fixes if we'll notice and hopefully ours don't cause any :-)

Jarkko

#3 lore raw
Quoted 11 lines · Jarkko Nikula
Quoted 7 lines · Marc Kleine-Budde

I've applied the patches to linux-can-next/m_can, which is available here

https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/commit/?h=m_can

Can you please test that branch. This will go into next, once the net/master is merged to net-next/master.

Thanks, works fine at quick test. I had the patch from top of linux-next tag next-20201117 so it wasn't very far away from you branch. Will send fixes if we'll notice and hopefully ours don't cause any :-)

...but that branch doesn't contain the other m_can patches that are on my m_can branch.

Thanks for testing,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |