OpenCores
URL https://opencores.org/ocsvn/sdhc-sc-core/sdhc-sc-core/trunk

Subversion Repositories sdhc-sc-core

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 103 to Rev 104
    Reverse comparison

Rev 103 → Rev 104

/sdhc-sc-core/trunk/src/grpSd/unitSdCardModel/src/SdCardModel.sv
202,8 → 202,25
data[511-400] = 1;
data[511-376] = 1;
sddata.send(ICmd, data);
 
// expect CMD6 with set
recv();
assert(recvcmd.id == cSdCmdSwitchFuntion);
assert(recvcmd.arg == 'h80FFFFF1);
response.send(ICmd);
 
// send status data structure
data = {};
for (int i = 0; i < 512; i++)
data.push_back(0);
 
data[511-400] = 1;
data[511-376] = 1;
sddata.send(ICmd, data);
 
// switch to 50MHz
 
-> InitDone;
 
endtask
/sdhc-sc-core/trunk/src/grpSd/pkgSd/src/Sd-p.vhdl
249,9 → 249,10
-- 23:8 function group 6 - 3
-- 7:4 group 2 for command system
-- 3:0 group 1 for access mode
constant cSdCmdCheckSpeedSupport : aSdCmdArg := X"00FFFFF1";
constant cSdHighSpeedFunctionSupportBit : natural := 400;
constant cSdHighSpeedFunctionGroupLow : natural := 376;
constant cSdCmdCheckSpeedSupport : aSdCmdArg := X"00FFFFF1";
constant cSdCmdSwitchSpeed : aSdCmdArg := X"80FFFFF1";
constant cSdHighSpeedFunctionSupportBit : natural := 400;
constant cSdHighSpeedFunctionGroupLow : natural := 376;
 
end package Sd;
 
/sdhc-sc-core/trunk/src/grpSd/unitSdController/src/SdController-Rtl-a.vhdl
383,21 → 383,20
end if;
 
when CheckSpeed =>
oLedBank(4) <= cActivated;
NextR.ToSdData.DataMode <= widewidth;
NextR.ToSdData.DataMode <= widewidth;
NextR.ToSdData.ExpectBits <= SwitchFunctionBits;
 
case R.Region is
when send =>
NextR.ToSdCmd.Content.id <= cSdCmdSwitchFunction;
NextR.ToSdCmd.Content.id <= cSdCmdSwitchFunction;
NextR.ToSdCmd.Content.arg <= cSdCmdCheckSpeedSupport;
NextRegion := response;
NextRegion := response;
 
when response =>
if (iSdCmd.Valid = cActivated) then
if (iSdCmd.Content.id = cSdCmdSwitchFunction) then
NextR.CardStatus <= iSdCmd.Content.arg;
NextR.Region <= receivedata;
NextR.Region <= receivedata;
else
NextR.State <= invalidCard;
416,7 → 415,6
if (iSdData.DataBlock(cSdHighSpeedFunctionSupportBit) = cActivated and
iSdData.DataBlock(cSdHighSpeedFunctionGroupLow+3 downto cSdHighSpeedFunctionGroupLow) = X"1") then
NextCmdRegion := ChangeSpeed;
NextRegion := idle;
 
else
NextState := idle;
425,12 → 423,53
 
 
when others =>
report "Unhandled region";
report "Unhandled region" severity error;
end case;
 
when ChangeSpeed =>
oLedBank(1) <= cActivated;
case R.Region is
when send =>
NextR.ToSdCmd.Content.id <= cSdCmdSwitchFunction;
NextR.ToSdCmd.Content.arg <= cSdCmdSwitchSpeed;
NextRegion := response;
 
when response =>
if (iSdCmd.Valid = cActivated) then
if (iSdCmd.Content.id = cSdCmdSwitchFunction) then
NextR.CardStatus <= iSdCmd.Content.arg;
NextR.Region <= receivedata;
else
NextR.State <= invalidCard;
end if;
elsif (Timeout = cActivated) then
NextR.State <= invalidCard;
end if;
 
when receivedata =>
null;
when waitstatedata =>
NextRegion := send;
 
if (NextCmdTimeout = cActivated) then
if (iSdData.DataBlock(cSdHighSpeedFunctionSupportBit) = cActivated and
iSdData.DataBlock(cSdHighSpeedFunctionGroupLow+3 downto cSdHighSpeedFunctionGroupLow) = X"1") then
NextState := idle;
NextRegion := idle;
 
else
NextState := invalidCard;
end if;
end if;
 
 
when others =>
report "Unhandled region" severity error;
end case;
 
when others =>
report "Unhandled CmdRegion" severity error;
end case;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.