summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/kdoc_parser.py
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2025-10-15 11:32:59 +0100
committerMark Brown <broonie@kernel.org>2025-10-15 11:32:59 +0100
commit92a42edd347c3b5a9045bb137a33204c6ddc0803 (patch)
treef988636a4dfbc2e8abf3f6a267bdd760655ede73 /tools/lib/python/kdoc/kdoc_parser.py
parent7d9c2924f61dcabcbc5868bec6054ab4f4de01d1 (diff)
parentfe8cc44dd173cde5788ab4e3730ac61f3d316d9c (diff)
Add target mode support for the DesignWare SPI
Merge series from BenoƮt Monin <benoit.monin@bootlin.com>: The DesignWare SPI controller can act as a host or a target; the choice between the two is set in hardware and cannot be changed by software. When configured in target mode, the controller has a much reduced set of capabilities. It only has a single chip-select input and can only run standard SPI mode (no dual, quad, or octal mode). Despite this, the overall logic of doing an SPI transfer and the register layout is identical between both modes, so implementing the target mode reuses much of the existing code. The first part of this two-patch series renames the spi_controller to ctlr instead of host and also changes the suffix of the related functions to controller. This is done to avoid confusion when referring to the controller in target mode. The second patch implements the target mode support by allocating an SPI controller of the correct type based on the spi-slave property. The controller is then configured differently depending on the mode. For an SPI transfer, the same transfer_one() callback is used, with the difference being in dw_spi_update_config() where only the CTRLR0 register is set. The other registers are not relevant in target mode and are read-only. I am posting this as an RFC because I could only perform partial testing on my setup. I am using an SoC with two DesignWare SPI memory-mapped controllers identified as Synopsys DWC APB SSI v4.03, one in host mode and the other in target mode. On the evaluation board, a microcontroller acts as an SPI relay between the two, but it has some limitations. The number of bits per word is fixed, as are the clock phase and polarity. It also only copies data from the host to the target. With this limited setup, I did test that data can be successfully transferred from the host to the target using spidev_test. I also checked that polling works by temporarily disabling the IRQ, but I cannot test DMA. Therefore, more testing on different devices would be welcome.
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions