Skip to content

Commit c2d38a7

Browse files
pefechcarlescufi
authored andcommitted
boards: arm: phyboard_polis: configure spi and can
Configures ECSPI devices in devicetree including connected mcp2518 (CAN FD). Configures pinctrl for board. Enables spi support in board files. Signed-off-by: Peter Fecher <[email protected]>
1 parent 6560128 commit c2d38a7

File tree

3 files changed

+79
-3
lines changed

3 files changed

+79
-3
lines changed

boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis-pinctrl.dtsi

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 PHYTEC Messtechnik GmbH
2+
* Copyright (c) 2022-2024 PHYTEC Messtechnik GmbH
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -46,4 +46,43 @@
4646
drive-strength = "x6";
4747
};
4848
};
49+
50+
ecspi1_default: ecspi1_default {
51+
group1 {
52+
pinmux = <&iomuxc_ecspi1_miso_ecspi_miso_ecspi1_miso>,
53+
<&iomuxc_ecspi1_mosi_ecspi_mosi_ecspi1_mosi>,
54+
<&iomuxc_ecspi1_sclk_ecspi_sclk_ecspi1_sclk>;
55+
slew-rate = "fast";
56+
drive-strength = "x6";
57+
};
58+
group2 {
59+
pinmux = <&iomuxc_ecspi1_ss0_gpio_io_gpio5_io09>;
60+
slew-rate = "fast";
61+
drive-strength = "x6";
62+
bias-pull-up;
63+
};
64+
group3 {
65+
pinmux = <&iomuxc_sd2_wp_gpio_io_gpio2_io20>;
66+
slew-rate = "fast";
67+
drive-strength = "x6";
68+
bias-pull-up;
69+
};
70+
};
71+
72+
ecspi2_default: ecspi2_default {
73+
group1 {
74+
pinmux = <&iomuxc_ecspi2_miso_ecspi_miso_ecspi2_miso>,
75+
<&iomuxc_ecspi2_mosi_ecspi_mosi_ecspi2_mosi>,
76+
<&iomuxc_ecspi2_sclk_ecspi_sclk_ecspi2_sclk>;
77+
slew-rate = "fast";
78+
drive-strength = "x6";
79+
bias-pull-up;
80+
};
81+
group2 {
82+
pinmux = <&iomuxc_ecspi2_ss0_gpio_io_gpio5_io13>;
83+
slew-rate = "fast";
84+
drive-strength = "x6";
85+
bias-pull-up;
86+
};
87+
};
4988
};

boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4.dts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 PHYTEC Messtechnik GmbH
2+
* Copyright (c) 2022-2024 PHYTEC Messtechnik GmbH
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -26,6 +26,7 @@
2626
zephyr,sram = &tcmu_sys;
2727
zephyr,console = &uart4;
2828
zephyr,shell-uart = &uart4;
29+
zephyr,canbus = &mcp2518;
2930
};
3031

3132
leds {
@@ -46,6 +47,37 @@
4647

4748
};
4849

50+
&ecspi1 {
51+
status = "disabled";
52+
pinctrl-0 = <&ecspi1_default>;
53+
pinctrl-names = "default";
54+
/* first cs is for on board MCP2518, the second for SPI on expansion header */
55+
cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>,
56+
<&gpio2 20 GPIO_ACTIVE_LOW>;
57+
58+
/* CAN FD */
59+
mcp2518: mcp2518@0 {
60+
compatible = "microchip,mcp251xfd";
61+
reg = <0>;
62+
spi-max-frequency = <20000000>;
63+
int-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
64+
supply-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
65+
osc-freq = <40000000>;
66+
status = "disabled";
67+
};
68+
};
69+
70+
/*
71+
* TPM Module TI SLB9670
72+
* Currently there is no driver for the used module
73+
*/
74+
&ecspi2 {
75+
status = "disabled";
76+
pinctrl-0 = <&ecspi2_default>;
77+
pinctrl-names = "default";
78+
cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
79+
};
80+
4981
/* RS232 / RS485 pinheader on the board */
5082
&uart1 {
5183
status = "disabled";

boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020 PHYTEC Messtechnik GmbH
2+
# Copyright (c) 2020-2024 PHYTEC Messtechnik GmbH
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
@@ -18,4 +18,9 @@ testing:
1818
ignore_tags:
1919
- net
2020
- bluetooth
21+
supported:
22+
- uart
23+
- spi
24+
- gpio
25+
- can
2126
vendor: nxp

0 commit comments

Comments
 (0)