hal: microchip: sam: add the three SPI aliases the D5x/E5x pack lacks - #75
Open
TheArkadiuszGrzelka wants to merge 1 commit into
Open
hal: microchip: sam: add the three SPI aliases the D5x/E5x pack lacks#75TheArkadiuszGrzelka wants to merge 1 commit into
TheArkadiuszGrzelka wants to merge 1 commit into
Conversation
sercom_samd5xe5x.h maps the generic SERCOM_SPI_ names onto this pack's SERCOM_SPIM_ ones, some forty of them, and three are missing: CTRLA_SWRST, SYNCBUSY_SWRST and CTRLC_ICSPACE. Nothing noticed, because the SPI driver reached past the mapping and used the SPIM spelling directly in exactly those four places. That direct use is what keeps the driver from building on PIC32CM SG/GC, whose pack has one SPI register block and no SPIM prefix at all. The driver is being moved onto the generic names, and this pack is the one family where the CTRLC line is compiled at all: SPI_MCHP_INTER_CHARACTER_SPACE depends on SOC_FAMILY_MICROCHIP_SAM_D5X_E5X. The three definitions are the same one-line form as the forty already in the file, and sam_e54_xpro is the in-tree board that needs them. Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moving the SPI driver onto the generic SERCOM_SPI_ names needs three aliases the D5x/E5x pack never defined, and this is the one family whose Kconfig compiles the CTRLC line at all.
Three names missing from forty
sercom_samd5xe5x.hmaps the genericSERCOM_SPI_names onto this pack'sSERCOM_SPIM_ones, some forty of them, and three are absent:CTRLA_SWRST,SYNCBUSY_SWRSTandCTRLC_ICSPACE.Nothing noticed, because
spi_mchp_sercom_g1.creached past the mapping andused the
SPIMspelling directly in exactly those four places. That directuse is what stops the driver building on PIC32CM SG/GC, which has one
SPIblock and no
SPIMprefix at all.The family where the third name matters
SPI_MCHP_INTER_CHARACTER_SPACEisdepends on SOC_FAMILY_MICROCHIP_SAM_D5X_E5X, so theCTRLCwrite is compiled here andnowhere else. On PIC32CM JH the same three-name gap exists for the two
SWRSTnames only: that pack has noSPIMCTRLCregister at all, and theKconfig can never select it, so aliasing
CTRLC_ICSPACEthere would be adefinition pointing at a name that does not exist.
sam_e54_xprois the in-tree board that carries this pack and amicrochip,sercom-g1-spinode.Scope
Six lines in one header, all of the same one-line form as the forty already
in it. Nothing that compiles today changes meaning: on this pack each new
generic name resolves to the
SPIMdefinition the driver used before.Testing
samples/hello_worldonsam_e54_xprowithCONFIG_SPI=yandCONFIG_SPI_MCHP_INTER_CHARACTER_SPACE=1, with the Zephyr generic-nameschange in the tree.
spi_mchp_sercom_g1.c.objis built, and the generatedautoconf.hcarriesCONFIG_SPI_MCHP_INTER_CHARACTER_SPACE 1, so theCTRLCline inside the#ifdefis compiled rather than skipped - which isthe only way this pack's third alias gets exercised at all.
No D5x/E5x board is on this bench, so L3 is
UNVERIFIED.Verification
Built in the project's dev container, whose west workspace applies this
change as a module patch. This is one of the consumer-side pairs of
zephyrproject-rtos/zephyr'sspi-mchp-sercom-g1-generic-names; the otheris
sercom-jh-spi-aliases, and all three have to land in the same window.