<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MMC on P2020 QorIQ in PowerQUICC Processors</title>
    <link>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1307534#M3784</link>
    <description>&lt;P&gt;Please refer to the following driver source code in Linux Kernel.&lt;/P&gt;
&lt;P&gt;drivers/mmc/host/sdhci.c&lt;/P&gt;
&lt;P&gt;drivers/mmc/host/sdhci-pltfm.c&lt;/P&gt;
&lt;P&gt;drivers/mmc/host/sdhci-of-esdhc.c&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 08:46:32 GMT</pubDate>
    <dc:creator>yipingwang</dc:creator>
    <dc:date>2021-07-14T08:46:32Z</dc:date>
    <item>
      <title>MMC on P2020 QorIQ</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1305395#M3771</link>
      <description>&lt;P&gt;Hello everybody,&lt;BR /&gt;I am looking for reference C codes (reading and writing from memory) to use MMC with the p2020.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 10:53:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1305395#M3771</guid>
      <dc:creator>notshure</dc:creator>
      <dc:date>2021-07-09T10:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: MMC on P2020 QorIQ</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1306678#M3779</link>
      <description>&lt;P&gt;Please refer to&amp;nbsp;drivers/mmc/card/mmc_test.c in Linux Kernel.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 07:56:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1306678#M3779</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2021-07-13T07:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: MMC on P2020 QorIQ</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1307020#M3782</link>
      <description>&lt;P&gt;i tried to view drivers / mmc / card / mmc_test.c, but it's too generic.&lt;BR /&gt;I'm trying to follow the flows found in the p2020 datasheet&lt;/P&gt;&lt;P&gt;for example this one which implements the function to send a command:&lt;/P&gt;&lt;P&gt;send_command(cmd_index, cmd_arg, other requirements)&lt;BR /&gt;{&lt;BR /&gt;WORD wCmd; // 32-bit integer to make up the data to write into the XFERTYP register, it is&lt;BR /&gt;// recommended to implement in a bit-field manner&lt;BR /&gt;wCmd = (&amp;lt;cmd_index&amp;gt; &amp;amp; 0x3f) &amp;lt;&amp;lt; 24; // set the first 8 bits as '00'+&amp;lt;cmd_index&amp;gt;&lt;BR /&gt;set CMDTYP, DPSEL, CICEN, CCCEN, RSTTYP, and DTDSEL according to the command index;&lt;BR /&gt;// XFERTYP register bits&lt;BR /&gt;if (internal DMA is used) wCmd |= 0x1;&lt;BR /&gt;if (multi-block transfer) {&lt;BR /&gt;set XFERTYP[MSBSEL] bit;&lt;BR /&gt;if (finite block number) {&lt;BR /&gt;set XFERTYP[BCEN] bit;&lt;BR /&gt;if (auto12 command is to use) set XFERTYP[AC12EN] bit;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;write_reg(CMDARG, &amp;lt;cmd_arg&amp;gt;); // configure the command argument&lt;BR /&gt;write_reg(XFERTYP, wCmd); // set XFERTYP register as wCmd value to issue the command&lt;BR /&gt;}&lt;BR /&gt;wait_for_response(cmd_index)&lt;BR /&gt;{&lt;BR /&gt;while (IRQSTAT[CC] is not set); // wait until command complete bit is set&lt;BR /&gt;read IRQSTAT register and check if any error bits about command are set;&lt;BR /&gt;if (any error bits are set) report error;&lt;BR /&gt;write 1 to clear IRQSTAT[CC] and all command error bits;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 13:56:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1307020#M3782</guid>
      <dc:creator>notshure</dc:creator>
      <dc:date>2021-07-13T13:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: MMC on P2020 QorIQ</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1307534#M3784</link>
      <description>&lt;P&gt;Please refer to the following driver source code in Linux Kernel.&lt;/P&gt;
&lt;P&gt;drivers/mmc/host/sdhci.c&lt;/P&gt;
&lt;P&gt;drivers/mmc/host/sdhci-pltfm.c&lt;/P&gt;
&lt;P&gt;drivers/mmc/host/sdhci-of-esdhc.c&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 08:46:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1307534#M3784</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2021-07-14T08:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: MMC on P2020 QorIQ</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1307687#M3785</link>
      <description>&lt;P&gt;Following the example of pseudocode on the datasheet of p2020 I have implemented the function that allows me to send commands.&lt;/P&gt;&lt;P&gt;void send_command(int cmd_index)&lt;BR /&gt;{&lt;BR /&gt;int count;&lt;BR /&gt;unsigned int wCmd;&lt;BR /&gt;unsigned int temp0,temp1;&lt;/P&gt;&lt;P&gt;// cmd_index&lt;BR /&gt;wCmd = (cmd_index &amp;amp; 0x3F) &amp;lt;&amp;lt; 24;&lt;/P&gt;&lt;P&gt;// -No response&lt;BR /&gt;// -Data present&lt;BR /&gt;// -Enable. The eSDHC checks the index field in the response to see if it has the same value as the command index. If it is not, it is reported as a command index error.&lt;BR /&gt;// -Enable. The eSDHC checks the CRC field in the response if it contains the CRC field. If an error is detected, it is reported as a command CRC error.&lt;BR /&gt;// -No response&lt;BR /&gt;// -Write (host to card)&lt;BR /&gt;(*MMC_REG.XFERTYP)= CMDTYP | DPSEL | CICEN | CCCEN | RSPTYP | DTDSEL;&lt;BR /&gt;&lt;BR /&gt;// Command Argument&lt;BR /&gt;(*MMC_REG.CMDARG) = 0x00000000;&lt;/P&gt;&lt;P&gt;// set XFERTYP register as wCmd value to issue the command&lt;BR /&gt;(*MMC_REG.XFERTYP)= wCmd;&lt;/P&gt;&lt;P&gt;// wait_for_response&lt;BR /&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;temp0=(*MMC_REG.IRQSTAT) &amp;amp; 0x00000001;&lt;BR /&gt;temp1 = (*MMC_REG.CMDRSP0);&lt;BR /&gt;printf("%x\n",temp1);&lt;BR /&gt;printf("%x\n",(*MMC_REG.CMDRSP1));&lt;BR /&gt;printf("%x\n",(*MMC_REG.CMDRSP2));&lt;BR /&gt;printf("%x\n",(*MMC_REG.CMDRSP2));&lt;BR /&gt;if ( temp0 == 0x00000001) break;&lt;BR /&gt;}&lt;BR /&gt;// write 1 to clear IRQSTAT[CC] and all command error bits;&lt;BR /&gt;(*MMC_REG.IRQSTAT) = 0x00000001;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set CMDTYP, DPSEL, CICEN, CCCEN, RSTTYP, and DTDSEL according to the command index;&lt;BR /&gt;XFERTYP register bits&lt;/P&gt;&lt;P&gt;i can't understand these two steps.&lt;BR /&gt;How does a status register be able to send the command&lt;/P&gt;&lt;P&gt;write_reg(XFERTYP, wCmd); // set XFERTYP register as wCmd value to issue the command&lt;/P&gt;&lt;P&gt;for now the send command function has been implemented only to send the Zero command, just to verify correct operation&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 12:51:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1307687#M3785</guid>
      <dc:creator>notshure</dc:creator>
      <dc:date>2021-07-14T12:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: MMC on P2020 QorIQ</title>
      <link>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1308059#M3786</link>
      <description>&lt;P&gt;Please refer to the following&amp;nbsp;SendCommand function provided in NetCommSw.&lt;/P&gt;
&lt;P&gt;static e_EsdhcCmdStatus SendCommand(t_Esdhc* p_Esdhc, uint32_t command, uint32_t argument, bool transferCmd)&lt;BR /&gt;{&lt;BR /&gt;uint32_t xfertypeReg = 0, tmp, prsstat;&lt;BR /&gt;e_EsdhcCmdStatus cmdStatus;&lt;BR /&gt;uint32_t timeout;&lt;BR /&gt;&lt;BR /&gt;xfertypeReg |= ((command &amp;lt;&amp;lt; XFERTYPE_CMDINX_SHIFT) &amp;amp; XFERTYPE_CMDINX_MASK);&lt;BR /&gt;&lt;BR /&gt;timeout = p_Esdhc-&amp;gt;timeout + XX_CurrentTime();&lt;BR /&gt;do&lt;BR /&gt;{&lt;BR /&gt;prsstat = GET_UINT32(p_Esdhc-&amp;gt;p_MemMap-&amp;gt;prsstat) &amp;amp; PRSSTAT_CIHB_MASK;&lt;BR /&gt;} while((XX_CurrentTime() &amp;lt; timeout) &amp;amp;&amp;amp; (prsstat));&lt;BR /&gt;&lt;BR /&gt;if (prsstat)&lt;BR /&gt;return e_ESDHC_CANNOT_ISSUE_CMD;&lt;/P&gt;
&lt;P&gt;/* Check if card can issue command using DAT lines */&lt;BR /&gt;if ((glbCmdArgArray[command].dataPresent) &amp;amp;&amp;amp; (command != e_ESDHC_CMD_STOP_TRANS) &amp;amp;&amp;amp; (command != e_ESDHC_CMD_IO_RW_DIRECT))&lt;BR /&gt;{&lt;BR /&gt;if ((GET_UINT32(p_Esdhc-&amp;gt;p_MemMap-&amp;gt;prsstat) &amp;amp; PRSSTAT_CDIHB_MASK))&lt;BR /&gt;return e_ESDHC_CANNOT_ISSUE_CMD;&lt;BR /&gt;&lt;BR /&gt;while ((GET_UINT32(p_Esdhc-&amp;gt;p_MemMap-&amp;gt;prsstat) &amp;amp; PRSSTAT_DLSL31_MASK) != PRSSTAT_DLSL31_MASK){}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/* Switch command*/&lt;BR /&gt;if (e_ESDHC_CMD_SWITCH == command)&lt;BR /&gt;{&lt;BR /&gt;glbCmdArgArray[command] = (e_SDHC_MMC_CARD == p_Esdhc-&amp;gt;cardDetails.cardType) ?&lt;BR /&gt;SwitchCmdArgs[ESDHC_MMC_INDEX] : SwitchCmdArgs[ESDHC_SD_INDEX];&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;xfertypeReg |= (glbCmdArgArray[command].dataPresent &amp;lt;&amp;lt; XFERTYPE_DPSEL_SHIFT);&lt;BR /&gt;xfertypeReg |= (glbCmdArgArray[command].read &amp;lt;&amp;lt; XFERTYPE_DTDSEL_SHIFT);&lt;BR /&gt;&lt;BR /&gt;if (transferCmd)&lt;BR /&gt;{&lt;BR /&gt;if (e_SDHC_TRANS_MODE_INTERNAL_DMA == p_Esdhc-&amp;gt;transferParam.dmaMode)&lt;BR /&gt;xfertypeReg |= XFERTYPE_DMAEN_MASK; /* enable internal DMA */&lt;/P&gt;
&lt;P&gt;if (1 &amp;lt; p_Esdhc-&amp;gt;transferParam.blkNum)&lt;BR /&gt;{&lt;BR /&gt;xfertypeReg |= XFERTYPE_MSBSEL_MASK;&lt;BR /&gt;xfertypeReg |= XFERTYPE_BCEN_MASK;&lt;BR /&gt;xfertypeReg |= XFERTYPE_AC12EN_MASK;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;switch (glbCmdArgArray[command].cmdType) {&lt;BR /&gt;case e_ESDHC_NORMAL_CMD:&lt;BR /&gt;case e_ESDHC_SUSPEND_CMD:&lt;BR /&gt;case e_ESDHC_RESUME_CMD:&lt;BR /&gt;case e_ESDHC_ABORT_CMD:&lt;BR /&gt;xfertypeReg |= (glbCmdArgArray[command].cmdType &amp;lt;&amp;lt; XFERTYPE_CMDTYPE_SHIFT);&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;return e_ESDHC_CMD_INVALID_PARAMS;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;switch (glbCmdArgArray[command].respType) {&lt;BR /&gt;case e_ESDHC_NO_RESP:&lt;BR /&gt;xfertypeReg |= (glbCmdArgArray[command].respType &amp;lt;&amp;lt; XFERTYPE_RSPTYPE_SHIFT);&lt;BR /&gt;break;&lt;BR /&gt;case e_ESDHC_R2_RESP:&lt;BR /&gt;xfertypeReg |= (glbCmdArgArray[command].respType &amp;lt;&amp;lt; XFERTYPE_RSPTYPE_SHIFT);&lt;BR /&gt;xfertypeReg |= XFERTYPE_CCCEN_MASK;&lt;BR /&gt;break;&lt;BR /&gt;case e_ESDHC_R3_RESP:&lt;BR /&gt;xfertypeReg |= (e_ESDHC_R1_RESP &amp;lt;&amp;lt; XFERTYPE_RSPTYPE_SHIFT);&lt;BR /&gt;break;&lt;BR /&gt;case e_ESDHC_R1_RESP:&lt;BR /&gt;case e_ESDHC_R1b_RESP:&lt;BR /&gt;xfertypeReg |= (glbCmdArgArray[command].respType &amp;lt;&amp;lt; XFERTYPE_RSPTYPE_SHIFT);&lt;BR /&gt;xfertypeReg |= XFERTYPE_CCCEN_MASK;&lt;BR /&gt;xfertypeReg |= XFERTYPE_CICEN_MASK;&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;return e_ESDHC_CMD_INVALID_PARAMS;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;WRITE_UINT32(p_Esdhc-&amp;gt;p_MemMap-&amp;gt;cmdarg, argument);&lt;BR /&gt;tmp = GET_UINT32(p_Esdhc-&amp;gt;p_MemMap-&amp;gt;cmdarg);&lt;BR /&gt;&lt;BR /&gt;/* Send the command to the card*/&lt;BR /&gt;WRITE_UINT32(p_Esdhc-&amp;gt;p_MemMap-&amp;gt;xfertyp, xfertypeReg);&lt;/P&gt;
&lt;P&gt;cmdStatus = WaitCmdDone(p_Esdhc);&lt;BR /&gt;&lt;BR /&gt;return cmdStatus;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 02:28:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/PowerQUICC-Processors/MMC-on-P2020-QorIQ/m-p/1308059#M3786</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2021-07-15T02:28:47Z</dc:date>
    </item>
  </channel>
</rss>

