1<?xml version="1.0" encoding="utf-8"?> 2 3 4<!--**************************************************************************** 5* \file smif_v2.cypersonality 6* \version 1.0 7* 8* \brief 9* Quad Serial Peripheral Interface (QSPI) personality description file. 10* 11******************************************************************************** 12* \copyright 13* Copyright 2022 Cypress Semiconductor Corporation 14* SPDX-License-Identifier: Apache-2.0 15* 16* Licensed under the Apache License, Version 2.0 (the "License"); 17* you may not use this file except in compliance with the License. 18* You may obtain a copy of the License at 19* 20* http://www.apache.org/licenses/LICENSE-2.0 21* 22* Unless required by applicable law or agreed to in writing, software 23* distributed under the License is distributed on an "AS IS" BASIS, 24* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25* See the License for the specific language governing permissions and 26* limitations under the License. 27*****************************************************************************--> 28 29<Personality id="mxs40smif_ver2" name="Quad Serial Peripheral Interface (QSPI)" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7"> 30 <Dependencies> 31 <IpBlock name="mxsmif,mxsmif_ver2_s40e"> 32 <Version major="3" /> 33 <Version major="2" /> 34 </IpBlock> 35 <Resource name="smif" /> 36 </Dependencies> 37 <ExposedMembers> 38 <ExposedMember key="inFlash" paramId="inFlash" /> 39 </ExposedMembers> 40 <Parameters> 41 <!-- PDL documentation --> 42 <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__smif.html" linkText="Open SMIF Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" /> 43 <!-- Clocks --> 44 <ParamSignal port="clk_if[0]" name="Interface Clock" group="Clocks" visible="true" desc="Transmission interface clock. Divides HF clock supplied internally by 2" canBeEmpty="false" /> 45 <ParamSignal port="spihb_clk[0]" name="SPI Clock" group="Clocks" visible="true" desc="The Serial Clock (SCLK) to the slave devices" canBeEmpty="false"> 46 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 47 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 48 <Fixed value="CY_GPIO_DM_STRONG" /> 49 </Parameter> 50 </Constraint> 51 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 52 </ParamSignal> 53 <ParamString id="smifIfSource" name="smifIfSource" group="Internal" default="`${getBlockFromSignal("clk_if[0]")}`" visible="false" editable="false" desc="Interface Source Clock Resource" /> 54 <ParamRange id="smifIfClkHz" name="smifIfClkHz" group="Internal" default="`${getExposedMember(smifIfSource, "frequency")}`" min="1" max="200000000" resolution="1" visible="false" editable="false" desc="SMIF IF clock frequency in Hz." /> 55 56 <!-- External tools --> 57 <ParamString id="cfgFileName" name="cfgFileName" group="External Tools" default="design.cyqspi" visible="false" editable="false" desc="" /> 58 <ParamString id="cfgFilePath" name="cfgFilePath" group="External Tools" default="`${cy_design_path() . "/" . cfgFileName}`" visible="false" editable="false" desc="" /> 59 60 <ParamCustom id="configurator" name="QSPI Configurator" group="External Tools" default="0" path="`${cy_tools_path("qspi-configurator") . "/qspi-configurator"}`" modal="false" visible="true" editable="true" desc="Launch QSPI Configurator tool"> 61 <Arg value="`${"--config=" . cfgFilePath}`" /> 62 <Arg value="`${"--output-dir=" . cy_codegen_path()}`" /> 63 <Arg value="`${"--library=" . cy_libs_file()}`" /> 64 </ParamCustom> 65 66 67 <!-- SPI Data --> 68 <ParamSignal port="spihb_data0[0]" name="SPI Data[0]" group="Data" visible="`${hasVisibleOption("spihb_data0[0]")}`" desc="Data line 0 to be used by the QSPI block, must be used in conjunction with Data line 1" canBeEmpty="true"> 69 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 70 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 71 <Fixed value="CY_GPIO_DM_STRONG" /> 72 </Parameter> 73 </Constraint> 74 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 75 </ParamSignal> 76 <ParamSignal port="spihb_data1[0]" name="SPI Data[1]" group="Data" visible="`${hasVisibleOption("spihb_data1[0]")}`" desc="Data line 1 to be used by the QSPI block, must be used in conjunction with Data line 0" canBeEmpty="true"> 77 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 78 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 79 <Fixed value="CY_GPIO_DM_STRONG" /> 80 </Parameter> 81 </Constraint> 82 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 83 </ParamSignal> 84 <ParamSignal port="spihb_data2[0]" name="SPI Data[2]" group="Data" visible="`${hasVisibleOption("spihb_data2[0]")}`" desc="Data line 2 to be used by the QSPI block, must be used in conjunction with Data line 3" canBeEmpty="true"> 85 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 86 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 87 <Fixed value="CY_GPIO_DM_STRONG" /> 88 </Parameter> 89 </Constraint> 90 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 91 </ParamSignal> 92 <ParamSignal port="spihb_data3[0]" name="SPI Data[3]" group="Data" visible="`${hasVisibleOption("spihb_data3[0]")}`" desc="Data line 3 to be used by the QSPI block, must be used in conjunction with Data line 2" canBeEmpty="true"> 93 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 94 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 95 <Fixed value="CY_GPIO_DM_STRONG" /> 96 </Parameter> 97 </Constraint> 98 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 99 </ParamSignal> 100 <ParamSignal port="spihb_data4[0]" name="SPI Data[4]" group="Data" visible="`${(CHIP_TOP.DATA8_PRESENT == 1) && hasVisibleOption("spihb_data4[0]")}`" desc="Data line 4 to be used by the QSPI block, must be used in conjunction with Data line 5" canBeEmpty="true"> 101 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 102 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 103 <Fixed value="CY_GPIO_DM_STRONG" /> 104 </Parameter> 105 </Constraint> 106 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 107 </ParamSignal> 108 <ParamSignal port="spihb_data5[0]" name="SPI Data[5]" group="Data" visible="`${(CHIP_TOP.DATA8_PRESENT == 1) && hasVisibleOption("spihb_data5[0]")}`" desc="Data line 5 to be used by the QSPI block, must be used in conjunction with Data line 4" canBeEmpty="true"> 109 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 110 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 111 <Fixed value="CY_GPIO_DM_STRONG" /> 112 </Parameter> 113 </Constraint> 114 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 115 </ParamSignal> 116 <ParamSignal port="spihb_data6[0]" name="SPI Data[6]" group="Data" visible="`${(CHIP_TOP.DATA8_PRESENT == 1) && hasVisibleOption("spihb_data6[0]")}`" desc="Data line 6 to be used by the QSPI block, must be used in conjunction with Data line 7" canBeEmpty="true"> 117 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 118 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 119 <Fixed value="CY_GPIO_DM_STRONG" /> 120 </Parameter> 121 </Constraint> 122 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 123 </ParamSignal> 124 <ParamSignal port="spihb_data7[0]" name="SPI Data[7]" group="Data" visible="`${(CHIP_TOP.DATA8_PRESENT == 1) && hasVisibleOption("spihb_data7[0]")}`" desc="Data line 7 to be used by the QSPI block, must be used in conjunction with Data line 6" canBeEmpty="true"> 125 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 126 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer on'."> 127 <Fixed value="CY_GPIO_DM_STRONG" /> 128 </Parameter> 129 </Constraint> 130 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 131 </ParamSignal> 132 <!-- SPI Select --> 133 <ParamSignal port="spihb_select0[0]" name="SPI Slave Select 0" group="Slave Select" visible="`${hasVisibleOption("spihb_select0[0]")}`" desc="Select signal 0 to specifiy which memory device to communicate with" canBeEmpty="true"> 134 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 135 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer off'."> 136 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 137 </Parameter> 138 </Constraint> 139 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 140 </ParamSignal> 141 <ParamSignal port="spihb_select1[0]" name="SPI Slave Select 1" group="Slave Select" visible="`${hasVisibleOption("spihb_select1[0]")}`" desc="Select signal 1 to specifiy which memory device to communicate with" canBeEmpty="true"> 142 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 143 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer off'."> 144 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 145 </Parameter> 146 </Constraint> 147 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 148 </ParamSignal> 149 <ParamSignal port="spihb_select2[0]" name="SPI Slave Select 2" group="Slave Select" visible="`${hasVisibleOption("spihb_select2[0]")}`" desc="Select signal 2 to specifiy which memory device to communicate with" canBeEmpty="true"> 150 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 151 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer off'."> 152 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 153 </Parameter> 154 </Constraint> 155 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 156 </ParamSignal> 157 <ParamSignal port="spihb_select3[0]" name="SPI Slave Select 3" group="Slave Select" visible="`${hasVisibleOption("spihb_select3[0]")}`" desc="Select signal 3 to specifiy which memory device to communicate with" canBeEmpty="true"> 158 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 159 <Parameter id="DriveModes" severity="ERROR" reason="Drive Mode must be set to 'Strong Drive. Input buffer off'."> 160 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 161 </Parameter> 162 </Constraint> 163 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 164 </ParamSignal> 165 <!-- Interrupt --> 166 <ParamBool id="isrAlignment" name="Memory Mode Alignment Error" group="Interrupt" default="false" visible="true" editable="true" desc="An alignment error in the memory mode (XIP mode) is set as an interrupt cause" /> 167 <ParamBool id="isrUnderflow" name="RX Data FIFO Underflow" group="Interrupt" default="false" visible="true" editable="true" desc="The Rx Data FIFO underflow condition is set as an interrupt cause" /> 168 <ParamBool id="isrCmdOverflow" name="TX Command FIFO Overflow" group="Interrupt" default="false" visible="true" editable="true" desc="The TX command FIFO overflow condition is set as an interrupt cause" /> 169 <ParamBool id="isrDataOverflow" name="TX Data FIFO Overflow" group="Interrupt" default="false" visible="true" editable="true" desc="The TX data FIFO overflow condition is set as an interrupt cause" /> 170 171 <!-- DMA --> 172 <ParamSignal port="tr_rx_req[0]" name="RX Trigger Output" group="DMA Triggers" visible="true" desc="Enables the RX trigger output terminal (tr_rx_req)" canBeEmpty="true" /> 173 <ParamRange id="rxTriggerLevel" name="RX FIFO Trigger Level" group="DMA Triggers" default="0" min="0" max="7" resolution="1" visible="true" editable="true" desc="The level that can trigger the RX FIFO to trigger an interrupt or a DMA request" /> 174 <ParamSignal port="tr_tx_req[0]" name="TX Trigger Output" group="DMA Triggers" visible="true" desc="enables the TX trigger output terminal (tr_tx_req)" canBeEmpty="true" /> 175 <ParamRange id="txTriggerLevel" name="TX FIFO Trigger Level" group="DMA Triggers" default="0" min="0" max="7" resolution="1" visible="true" editable="true" desc="The level that can trigger the TX FIFO to trigger an interrupt or a DMA request" /> 176 177 <!-- SMIF instance number --> 178 <ParamString id="InstNumber" name="InstNumber" group="Internal" default="`${getInstNumber("smif")}`" visible="false" editable="false" desc="SMIF Instance name number." /> 179 180 <!-- Other --> 181 <ParamBool id="inFlash" name="Store Config in Flash" group="Advanced" default="true" visible="true" editable="true" desc="Controls whether the configuration structure is stored in flash (const, true) or SRAM (not const, false)." /> 182 183 <!-- Helpers --> 184 <Repeat count="8"> 185 <ParamBool id="hasConnection$idx" name="" group="Hidden" default="`${hasConnection("spihb_data$idx", 0)}`" visible="false" editable="false" desc="" /> 186 </Repeat> 187 <Repeat count="4"> 188 <ParamBool id="hasSelect$idx" name="" group="Hidden" default="`${hasConnection("spihb_select$idx", 0)}`" visible="false" editable="false" desc="" /> 189 </Repeat> 190 <ParamBool id="allDataConnected" name="" group="Hidden" default="`${hasConnection0 && hasConnection2 && hasConnection4 && hasConnection6}`" visible="false" editable="false" desc="" /> 191 <ParamBool id="requireMultipleSelects" name="" group="Hidden" default="`${!allDataConnected && ((hasConnection0 && hasConnection4) || (hasConnection0 && hasConnection6) || (hasConnection2 && hasConnection4) || (hasConnection2 && hasConnection6))}`" visible="false" editable="false" desc="" /> 192 </Parameters> 193 194 <DRCs> 195 <DRC type="ERROR" text="SPI Data[0] and SPI Data[1] must be used together" condition="`${hasConnection0 != hasConnection1 && hasConnection0}`" paramId="spihb_data1[0]" /> 196 <DRC type="ERROR" text="SPI Data[0] and SPI Data[1] must be used together" condition="`${hasConnection0 != hasConnection1 && hasConnection1}`" paramId="spihb_data0[0]" /> 197 <DRC type="ERROR" text="SPI Data[2] and SPI Data[3] must be used together" condition="`${hasConnection2 != hasConnection3 && hasConnection2}`" paramId="spihb_data3[0]" /> 198 <DRC type="ERROR" text="SPI Data[2] and SPI Data[3] must be used together" condition="`${hasConnection2 != hasConnection3 && hasConnection3}`" paramId="spihb_data2[0]" /> 199 <DRC type="ERROR" text="SPI Data[4] and SPI Data[5] must be used together" condition="`${hasConnection4 != hasConnection5 && hasConnection4}`" paramId="spihb_data5[0]" /> 200 <DRC type="ERROR" text="SPI Data[4] and SPI Data[5] must be used together" condition="`${hasConnection4 != hasConnection5 && hasConnection5}`" paramId="spihb_data4[0]" /> 201 <DRC type="ERROR" text="SPI Data[6] and SPI Data[7] must be used together" condition="`${hasConnection6 != hasConnection7 && hasConnection6}`" paramId="spihb_data6[0]" /> 202 <DRC type="ERROR" text="SPI Data[6] and SPI Data[7] must be used together" condition="`${hasConnection6 != hasConnection7 && hasConnection7}`" paramId="spihb_data5[0]" /> 203 <DRC type="ERROR" text="At least two SPI Data signal must be connected" condition="`${!(hasConnection0 || hasConnection2 || hasConnection4 || hasConnection6)}`" paramId="spihb_data0[0]" /> 204 <DRC type="ERROR" text="At least two SPI Data signal must be connected" condition="`${!(hasConnection1 || hasConnection3 || hasConnection5 || hasConnection7)}`" paramId="spihb_data1[0]" /> 205 <DRC type="ERROR" text="At least one SPI Select signal must be connected" condition="`${!(requireMultipleSelects || hasSelect0 || hasSelect1 || hasSelect2 || hasSelect3)}`" paramId="spihb_select0[0]" /> 206 <DRC type="ERROR" text="At least two SPI Select signal must be connected" condition="`${requireMultipleSelects && !((hasSelect0 && hasSelect1) || (hasSelect0 && hasSelect2) || (hasSelect0 && hasSelect3) || (hasSelect1 && hasSelect2) || (hasSelect1 && hasSelect3) || (hasSelect2 && hasSelect3))}`" paramId="spihb_select0[0]"/> 207 </DRCs> 208 209 <ConfigFirmware> 210 <!-- External tools --> 211 <ConfigTool value="`${cy_tools_path("qspi-configurator") . "/qspi-configurator-cli"}`" include="true"> 212 <Arg value="`${"--config=" . cfgFilePath}`" /> 213 <Arg value="`${"--output-dir=" . cy_codegen_path()}`" /> 214 <Arg value="`${"--library=" . cy_libs_file()}`" /> 215 </ConfigTool> 216 217 <ConfigInclude value="cy_smif.h" include="true" /> 218 <ConfigInclude value="cycfg_qspi_memslot.h" include="true" /> 219 <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" /> 220 221 <ConfigDefine name="`${INST_NAME}`_HW" value="SMIF`${InstNumber}`" public="true" include="true" /> 222 <ConfigDefine name="`${INST_NAME}`_IRQ" value="smif_interrupt_normal_IRQn" public="true" include="true" /> 223 <ConfigDefine name="`${INST_NAME}`_MEMORY_MODE_ALIGMENT_ERROR" value="`${isrAlignment ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 224 <ConfigDefine name="`${INST_NAME}`_RX_DATA_FIFO_UNDERFLOW" value="`${isrUnderflow ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 225 <ConfigDefine name="`${INST_NAME}`_TX_COMMAND_FIFO_OVERFLOW" value="`${isrCmdOverflow ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 226 <ConfigDefine name="`${INST_NAME}`_TX_DATA_FIFO_OVERFLOW" value="`${isrDataOverflow ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 227 228 <ConfigDefine name="`${INST_NAME}`_RX_FIFO_TRIGEER_LEVEL" value="(`${rxTriggerLevel}`UL)" public="true" include="true" /> 229 <ConfigDefine name="`${INST_NAME}`_TX_FIFO_TRIGEER_LEVEL" value="(`${txTriggerLevel}`UL)" public="true" include="true" /> 230 231 <ConfigDefine name="`${INST_NAME}`_DATALINES0_1" value="`${hasConnection0 ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 232 <ConfigDefine name="`${INST_NAME}`_DATALINES2_3" value="`${hasConnection2 ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 233 <ConfigDefine name="`${INST_NAME}`_DATALINES4_5" value="`${hasConnection4 ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 234 <ConfigDefine name="`${INST_NAME}`_DATALINES6_7" value="`${hasConnection6 ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 235 236 <ConfigDefine name="`${INST_NAME}`_SS0" value="`${hasSelect0 ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 237 <ConfigDefine name="`${INST_NAME}`_SS1" value="`${hasSelect1 ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 238 <ConfigDefine name="`${INST_NAME}`_SS2" value="`${hasSelect2 ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 239 <ConfigDefine name="`${INST_NAME}`_SS3" value="`${hasSelect3 ? "(1UL)" : "(0UL)"}`" public="true" include="true" /> 240 241 <ConfigDefine name="`${INST_NAME}`_DESELECT_DELAY" value="7" public="true" include="true" /> 242 243 <ConfigStruct name="`${INST_NAME . "_config"}`" type="cy_stc_smif_config_t" const="`${inFlash}`" public="true" include="true" > 244 <Member name="mode" value="(uint32_t)CY_SMIF_NORMAL" /> 245 <Member name="deselectDelay" value="`${INST_NAME}`_DESELECT_DELAY" /> 246 <Member name="rxClockSel" value="(uint32_t)CY_SMIF_SEL_INVERTED_FEEDBACK_CLK" /> 247 <Member name="blockEvent" value="(uint32_t)CY_SMIF_BUS_ERROR" /> 248 </ConfigStruct> 249 250 <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)"> 251 <Member name="type" value="CYHAL_RSC_SMIF" /> 252 <Member name="block_num" value="`${getInstNumber("smif")}`U" /> 253 <Member name="channel_num" value="0U" /> 254 </ConfigStruct> 255 256 <ConfigInstruction value="cyhal_hwmgr_reserve(&`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" /> 257 </ConfigFirmware> 258</Personality> 259