...
Implementation details
The following implementation is based off of PD16.1.0. The changes described below have been included in PD17.1.0. However, if you are using an older BSP release (ex. PD16.1.0) or want to add another SPI interface the below steps can be used as a reference.
Configuring the device tree
To enable the SPI1 interface, modifications to the device tree will be required. The following instructions show how to modify the files specific for the phyCORE-AM57x Rapid Development kit to multiplex the signals and enable the interface. The device tree files that will need to be modified are located in this directory:
No Format |
---|
/opt/PHYTEC_BSPs/yocto_ti/build/arago-tmp-external-linaro-toolchain/work/am57xx_phycore_rdk-linux-gnueabi/linux-phytec-ti/4.4.12+git_v4.4.12-phy1_mcspi1-r7a/git/arch/arm/boot/dts |
Note |
---|
Note: The path to the Linux source above may differ depending on the release used. |
Multiplex the signals for the SPI1 interface by adding the following to "dra7_pmx_core" in am57xx-phycore-som.dtsi:
Code Block language cpp mcspi1_pins_default: mcspi1_pins_default { pinctrl-single,pins = < 0x3a4 (PIN_INPUT | MUX_MODE0) /* spi1_sclk */ 0x3a8 (PIN_INPUT | MUX_MODE0) /* spi1_d1 */ 0x3ac (PIN_INPUT | MUX_MODE0) /* spi1_d0 */ 0x3b0 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* spi1_cs0 */ 0x3b4 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* spi1_cs1 */ >; };
Configure the pins for the SPI1 interface by adding the following to am57xx-phycore-som.dtsi:
Code Block language cpp &mcspi1 { status = "disabled"; pinctrl-names = "default"; pinctrl-0 = <&mcspi1_pins_default>; ti,pindir-d0-out-d1-in; };
Configure the SPI interface by adding the following to am57xx-pcm-948.dtsi:
Code Block language cpp &mcspi1 { spidev1_0: spidev1@0 { compatible = "linux,spidev"; reg = <0>; spi-max-frequency = <48000000>; }; };
Enable the SPI device by adding the following to am57xx-phycore-rdk.dts:
Code Block language cpp &mcspi1 { status = "okay"; };
...