<?xml version="1.0" encoding="utf-8"?> <!--**************************************************************************** * \file sd_host.cypersonality * \version 1.0 * * \brief * SD Host Controller personality description file. * ******************************************************************************** * \copyright * Copyright 2018-2019 Cypress Semiconductor Corporation * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************--> <Personality id="mxs40sdhost" name="SD Host Controller" version="1.0" path="Communications" xmlns="http://cypress.com/xsd/cyhwpersonality_v1"> <Dependencies> <IpBlock name="mxsdhc" /> <Resource name="sdhc" used="true" /> </Dependencies> <ExposedMembers /> <Parameters> <!-- PDL documentation --> <ParamDoc id="pdlDoc" name="Configuration Help" group="Peripheral Documentation" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__sd__host.html" linkText="Open SD Host Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" /> <!-- Timing --> <ParamSignal port="clk_hf[0]" name="Clock" group="Timing" visible="true" desc="Input clock source of the SDHC block." canBeEmpty="false" /> <ParamString id="sourceClock" name="sourceClock" group="General" default="`${getBlockFromSignal("clk_hf[0]")}`" visible="false" editable="false" desc="" /> <ParamRange id="sourceFreq" name="sourceFreq" group="General" default="`${isBlockUsed(sourceClock) ? getExposedMember(sourceClock, "frequency") : 0}`" min="0" max="400000000" resolution="1" visible="false" editable="false" desc="" /> <ParamRange id="sdhcClk" name="Input Clock Frequency (kHz)" group="Timing" default="`${sourceFreq / 1000}`" min="0" max="400000000" resolution="0.001" visible="true" editable="false" desc="Shows the actual input clock frequency of the SDHC block." /> <!-- General --> <ParamChoice id="cardType" name="Card Type" group="General" default="emmc" visible="true" editable="true" desc="Defines if the card is eMMC." > <Entry name="eMMC" value="emmc" visible="true" /> <Entry name="SD/SDIO" value="nonEmmc" visible="true" /> </ParamChoice> <ParamChoice id="dmaType" name="DMA Type" group="General" default="CY_SD_HOST_DMA_SDMA" visible="true" editable="true" desc="Selects the DMA type to be used." > <Entry name="SDMA" value="CY_SD_HOST_DMA_SDMA" visible="true" /> <Entry name="ADMA2" value="CY_SD_HOST_DMA_ADMA2" visible="true" /> <Entry name="ADMA2-ADMA3" value="CY_SD_HOST_DMA_ADMA2_ADMA3" visible="true" /> </ParamChoice> <ParamRange id="InstNumber" name="Instance Number" group="General" default="`${getInstNumber("sdhc")}`" min="0" max="1" resolution="1" visible="false" editable="false" desc="This parameter specifies Instance Number." /> <ParamBool id="enableLedControl" name="LED Control" group="General" default="false" visible="`${(InstNumber eq 1)}`" editable="true" desc="If enabled the SD clock controls one IO which is used to indicate when card is being accessed." /> <ParamChoice id="busWidth" name="Bus Width" group="General" default="CY_SD_HOST_BUS_WIDTH_4_BIT" visible="true" editable="true" desc="The desired bus width." > <Entry name="1-bit" value="CY_SD_HOST_BUS_WIDTH_1_BIT" visible="true" /> <Entry name="4-bit" value="CY_SD_HOST_BUS_WIDTH_4_BIT" visible="true" /> <Entry name="8-bit" value="CY_SD_HOST_BUS_WIDTH_8_BIT" visible="`${(cardType eq emmc) && (InstNumber eq 1)}`" /> </ParamChoice> <ParamBool id="lowVoltageSignaling" name="Enable Low Voltage Signaling" group="General" default="false" visible="true" editable="true" desc="If enabled then the host supports the 1.8V signaling." /> <!--Inputs/Outputs--> <ParamSignal port="clk_card[0]" name="CLK" group="Inputs" visible="true" desc="The card clock pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_cmd[0]" name="CMD" group="Inputs" visible="true" desc="The command/response pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_dat_3to0[0]" name="DAT0" group="Inputs" visible="true" desc="The Data line [Bit 0] pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_dat_3to0[1]" name="DAT1" group="Inputs" visible="`${(busWidth ne CY_SD_HOST_BUS_WIDTH_1_BIT)}`" desc="The Data line [Bit 1] pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_dat_3to0[2]" name="DAT2" group="Inputs" visible="`${(busWidth ne CY_SD_HOST_BUS_WIDTH_1_BIT)}`" desc="The Data line [Bit 2] pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_dat_3to0[3]" name="DAT3" group="Inputs" visible="`${(busWidth ne CY_SD_HOST_BUS_WIDTH_1_BIT)}`" desc="The Data line [Bit 3] pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_dat_7to4[0]" name="DAT4" group="Inputs" visible="`${(cardType eq emmc) && (InstNumber eq 1) && (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT)}`" desc="The Data line [Bit 4] pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_dat_7to4[1]" name="DAT5" group="Inputs" visible="`${(cardType eq emmc) && (InstNumber eq 1) && (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT)}`" desc="The Data line [Bit 5] pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_dat_7to4[2]" name="DAT6" group="Inputs" visible="`${(cardType eq emmc) && (InstNumber eq 1) && (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT)}`" desc="The Data line [Bit 6] pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_dat_7to4[3]" name="DAT7" group="Inputs" visible="`${(cardType eq emmc) && (InstNumber eq 1) && (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT)}`" desc="The Data line [Bit 7] pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_detect_n[0]" name="Card Detect" group="Inputs" visible="true" desc="The card detect pin. Note: You can use any GPIO custom pin for Card Detect. Add the SD Host driver Cy_SD_Host_IsCardConnected() function with the __WEAK type to your code. This function could read the value from any GPIO pin and return true when the card is connected. For more information see the Cy_SD_Host_IsCardConnected() function description." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_HIGHZ" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_HIGHZ" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_emmc_reset_n[0]" name="eMMC Reset" group="Inputs" visible="`${(cardType eq emmc) && (InstNumber eq 1)}`" desc="The eMMC reset pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="led_ctrl[0]" name="Led Control" group="Inputs" visible="`${enableLedControl}`" desc="The LED control pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_mech_write_prot[0]" name="Card Mechanical Write Protect" group="Inputs" visible="true" desc="The card mechanical write protect pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_HIGHZ" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_HIGHZ" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="card_if_pwr_en[0]" name="Card if Power Enabled" group="Inputs" visible="`${hasVisibleOption("card_if_pwr_en[0]")}`" desc="The card if power enabled pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <ParamSignal port="io_volt_sel[0]" name="IO Volt Select" group="Inputs" visible="`${hasVisibleOption("io_volt_sel[0]")}`" desc="The io volt select pin." canBeEmpty="true" > <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="DEFAULT" reason=""> <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> </Parameter> </Constraint> <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> </ParamSignal> <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)." /> </Parameters> <DRCs> <!--Timing DRCs--> <DRC type="INFO" text="To correctly set the bus speed, CLK_HF must be set to 100 MHz if the compatibility with the Capabilities register is required." condition="`${sourceFreq ne 100000000}`" /> <!--busWidth DRCs--> <DRC type="ERROR" text="Only eMMC supports 8 bits bus width." condition="`${(cardType ne emmc) && (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT) ? true : false}`" /> </DRCs> <ConfigFirmware> <ConfigInclude value="cy_sd_host.h" include="true" /> <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" /> <ConfigDefine name="`${INST_NAME . "_HW"}`" value="SDHC`${InstNumber}`" public="true" include="true" /> <ConfigDefine name="`${INST_NAME}`_IRQ" value="sdhc_`${InstNumber}`_interrupt_general_IRQn" public="true" include="true" /> <ConfigVariable name="`${INST_NAME . "_cardCapacity"}`" type="cy_en_sd_host_card_capacity_t" const="false" value="CY_SD_HOST_SDSC" public="true" include="true" /> <ConfigVariable name="`${INST_NAME . "_cardType"}`" type="cy_en_sd_host_card_type_t" const="false" value="`${(cardType eq emmc) ? "CY_SD_HOST_EMMC" : "CY_SD_HOST_NOT_EMMC"}`" public="true" include="true" /> <ConfigVariable name="`${INST_NAME . "_rca"}`" type="uint32_t" const="false" value="0u" public="true" include="true" /> <ConfigStruct name="`${INST_NAME . "_config"}`" type="cy_stc_sd_host_init_config_t" const="`${inFlash}`" public="true" include="true"> <Member name="emmc" value="`${(cardType eq emmc) ? "true" : "false"}`" /> <Member name="dmaType" value="`${dmaType}`" /> <Member name="enableLedControl" value="`${enableLedControl ? "true" : "false"}`" /> </ConfigStruct> <ConfigStruct name="`${INST_NAME . "_card_cfg"}`" type="cy_stc_sd_host_sd_card_config_t" const="false" public="true" include="true"> <Member name="lowVoltageSignaling" value="`${lowVoltageSignaling ? "true" : "false"}`" /> <Member name="busWidth" value="`${busWidth}`" /> <Member name="cardType" value="&`${INST_NAME . "_cardType"}`" /> <Member name="rca" value="&`${INST_NAME . "_rca"}`" /> <Member name="cardCapacity" value="&`${INST_NAME . "_cardCapacity"}`" /> </ConfigStruct> <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)"> <Member name="type" value="CYHAL_RSC_SDHC" /> <Member name="block_num" value="`${getInstNumber("sdhc")}`U" /> <Member name="channel_num" value="0U" /> </ConfigStruct> <ConfigInstruction value="cyhal_hwmgr_reserve(&`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" /> </ConfigFirmware> </Personality>