1# Copyright (c) 2022 Schlumberger 2# SPDX-License-Identifier: Apache-2.0 3 4description: INFINEON XMC4XXX SPI controller 5 6compatible: "infineon,xmc4xxx-spi" 7 8include: [spi-controller.yaml, pinctrl-device.yaml] 9 10properties: 11 reg: 12 required: true 13 14 miso-src: 15 description: | 16 Connects the SPI miso line (USIC DX0 input) to a specific GPIO pin. 17 The USIC DX0 input is a multiplexer which connects to different GPIO pins. 18 Refer to the XMC4XXX reference manual for the GPIO pin/mux mappings. DX0G 19 is the loopback input line. 20 type: string 21 required: true 22 enum: 23 - "DX0A" 24 - "DX0B" 25 - "DX0C" 26 - "DX0D" 27 - "DX0E" 28 - "DX0F" 29 - "DX0G" 30 31 interrupts: 32 description: | 33 IRQ number and priority to use for interrupt driven SPI. If DMA is not used (enabled using 34 option CONFIG_SPI_XMC4XXX_DMA) then only one, for receiving, labelled with "rx" needs to be 35 set. When using DMA, two interrupts labelled "tx" and "rx" must be set. 36 Each USIC must use a certain interrupt range: 37 USIC0 = [84, 89] 38 USIC1 = [90, 95] 39 USIC2 = [96, 101] 40 41 dmas: 42 description: | 43 Optional TX & RX dma specifiers. 44 45 The dmas are referenced in the USIC/SPI node using the following syntax: 46 dmas = <&dma1 1 0 XMC4XXX_SET_CONFIG(10,6)>, <&dma1 2 0 XMC4XXX_SET_CONFIG(11,6)>; 47 where the first entry is for the TX, and the second for RX. 48 49 The parameters in the dma entry are: dma device phandle, dma channel, dma priority (0 is 50 lowest and 7 is highest), and an opaque entry for the dma line routing parameters set 51 by the macro XMC4XXX_SET_CONFIG(line, request_source). Use the following steps to properly 52 select parameters line, request_source: 53 1. Select a dma device and a free dma channel. 54 1. Select a free dma line. dma0 device can only connect to lines [0, 7] and 55 dma1 can connect to lines [8, 11]. 56 2. For a given interrupt, calculate the service request (SR) number. Note the following 57 simple mapping: in USIC0 interrupt 84->SR0, interrupt 85->SR1, ... etc. 58 In USIC1, intterupt 90->SR0, 91->SR1, etc. 59 3. Select request_source from Table "DMA Request Source Selection" in XMC4XXX reference 60 manual. 61 62 For example, say we select interrupt 85 on USIC0, dma0, channel 3, priority 4, and line 7. 63 The interrupt would map to SR1. From Table "DMA Request Source Selection", request_source 64 would need to be set to 10 and the dts entry would be: 65 dma = <&dma0 3 4 XMC4XXX_SET_CONFIG(7,10) ... >; 66 67 dma-names: 68 description: | 69 Required if the dmas property exists. Should be set to "tx" and "rx" 70 to match the dmas property. 71 72 For example 73 dma-names = "tx", "rx"; 74 75 pinctrl-0: 76 required: true 77 78 pinctrl-names: 79 required: true 80