You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "gneworld (via GitHub)" <gi...@apache.org> on 2023/09/22 14:44:42 UTC
[GitHub] [nuttx] gneworld opened a new pull request, #10778: emmc: add get emmc cid register interface.
gneworld opened a new pull request, #10778:
URL: https://github.com/apache/nuttx/pull/10778
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 merged pull request #10778: emmc: add get emmc cid register interface.
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #10778:
URL: https://github.com/apache/nuttx/pull/10778
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] gneworld commented on pull request #10778: emmc: add get emmc cid register interface.
Posted by "gneworld (via GitHub)" <gi...@apache.org>.
gneworld commented on PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#issuecomment-1733475120
@alivexiaoluo Please provide your test report
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] alivexiaoluo commented on a diff in pull request #10778: emmc: add get emmc cid register interface.
Posted by "alivexiaoluo (via GitHub)" <gi...@apache.org>.
alivexiaoluo commented on code in PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#discussion_r1335311975
##########
drivers/mmcsd/mmcsd_sdio.c:
##########
@@ -3161,46 +3161,52 @@ static int mmcsd_general_cmd_read(FAR struct mmcsd_state_s *priv,
static int mmcsd_iocmd(FAR struct mmcsd_state_s *priv,
FAR struct mmc_ioc_cmd *ic_ptr)
{
+ uint32_t opcode;
int ret;
DEBUGASSERT(priv != NULL && ic_ptr != NULL);
- if (!ic_ptr->is_acmd)
Review Comment:
> So we don't need this check anymore? Could you briefly describe why as it is hard to understand with an empty PR description
Yes, we do not need this check. is_acmd is to determine a flag that precedes CMD55. In order to simplify the code and be compatible with CMD2, we will no longer check this flag. If you have any concerns, please let me know, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] acassis commented on pull request #10778: emmc: add get emmc cid register interface.
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#issuecomment-1732699083
@gneworld please don't remove the Summary template! Please explain why we don't need to check if it is application specific command anymore, as Petro asked.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] alivexiaoluo commented on a diff in pull request #10778: emmc: add get emmc cid register interface.
Posted by "alivexiaoluo (via GitHub)" <gi...@apache.org>.
alivexiaoluo commented on code in PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#discussion_r1335310462
##########
drivers/mmcsd/mmcsd_sdio.c:
##########
@@ -3161,46 +3161,52 @@ static int mmcsd_general_cmd_read(FAR struct mmcsd_state_s *priv,
static int mmcsd_iocmd(FAR struct mmcsd_state_s *priv,
FAR struct mmc_ioc_cmd *ic_ptr)
{
+ uint32_t opcode;
int ret;
DEBUGASSERT(priv != NULL && ic_ptr != NULL);
- if (!ic_ptr->is_acmd)
Review Comment:
Yes,is_acmd is to determine a flag that precedes CMD55. In order to simplify the code and be compatible with CMD2, we will no longer check this flag.
##########
drivers/mmcsd/mmcsd_sdio.c:
##########
@@ -3161,46 +3161,52 @@ static int mmcsd_general_cmd_read(FAR struct mmcsd_state_s *priv,
static int mmcsd_iocmd(FAR struct mmcsd_state_s *priv,
FAR struct mmc_ioc_cmd *ic_ptr)
{
+ uint32_t opcode;
int ret;
DEBUGASSERT(priv != NULL && ic_ptr != NULL);
- if (!ic_ptr->is_acmd)
Review Comment:
Yes,is_acmd is to determine a flag that precedes CMD55. In order to simplify the code and be compatible with CMD2, we will no longer check this flag.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] alivexiaoluo commented on pull request #10778: emmc: add get emmc cid register interface.
Posted by "alivexiaoluo (via GitHub)" <gi...@apache.org>.
alivexiaoluo commented on PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#issuecomment-1733612892
> @gneworld I cannot see this coming in without any test information for real HW
hi,davids5, I have already tested it on our hardware platform,it works fine.
Show you a part of test source code and log below
code:
‘
62 uint8_t buf[512] = {0};
63 uint32_t cid_t[4] = {0};
64 int ret = 0;
65 struct mmc_ioc_cmd idata;
81 int fd = open(dev_path, O_RDONLY);
82 if (fd <= 0) {
83 syslog(1, "ERROR: open %s failed.\n", dev_path);
84 return -1;
85 }
86
87 idata.write_flag = 0;
88 idata.arg = 0;
89 idata.opcode = MMCSD_CMD2;
90 idata.is_acmd = 0;
91 mmc_ioc_cmd_set_data(idata, buf);
92 ret = ioctl(fd, MMC_IOC_CMD, &idata);
93 if (ret != 0) {
94 syslog(1, "get cid register failed.\n");
95 goto _end;
96 }
97
98 cid_t[0] = (buf[3]<<24)|(buf[2]<<16)|(buf[1]<<8)|(buf[0]<<0);
99 cid_t[1] = (buf[7]<<24)|(buf[6]<<16)|(buf[5]<<8)|(buf[4]<<0);
100 cid_t[2] = (buf[11]<<24)|(buf[10]<<16)|(buf[9]<<8)|(buf[8]<<0);
101 cid_t[3] = (buf[15]<<24)|(buf[14]<<16)|(buf[13]<<8)|(buf[12]<<0);
102
103 mmcsd_decode_cid_extern(cid_t);
976 void mmcsd_decode_cid_extern(uint32_t cid[4])
977 {
978 struct mmcsd_cid_s decoded;
979
980 /* Word 1: Bits 127-96:
981 * mid - 127-120 8-bit Manufacturer ID
982 * oid - 119-104 16-bit OEM/Application ID (ascii)
983 * pnm - 103-64 40-bit Product Name (ascii) + null terminator
984 * pnm[0] 103:96
985 */
986
987 decoded.mid = cid[0] >> 24;
988 decoded.oid = (cid[0] >> 8) & 0xffff;
989 decoded.pnm[0] = cid[0] & 0xff;
990
991 /* Word 2: Bits 64:95
992 * pnm - 103-64 40-bit Product Name (ascii) + null terminator
993 * pnm[1] 95:88
994 * pnm[2] 87:80
995 * pnm[3] 79:72
996 * pnm[4] 71:64
997 */
998
999 decoded.pnm[1] = cid[1] >> 24;
1000 decoded.pnm[2] = (cid[1] >> 16) & 0xff;
1001 decoded.pnm[3] = (cid[1] >> 8) & 0xff;
1002 decoded.pnm[4] = cid[1] & 0xff;
1003 decoded.pnm[5] = '\0';
1004
1005 /* Word 3: Bits 32-63
1006 * prv - 63-56 8-bit Product revision
1007 * psn - 55-24 32-bit Product serial number
1008 */
1009
1010 decoded.prv = cid[2] >> 24;
1011 decoded.psn = cid[2] << 8;
1012
1013 /* Word 4: Bits 0-31
1014 * psn - 55-24 32-bit Product serial number
1015 * 23-20 4-bit (reserved)
1016 * mdt - 19:8 12-bit Manufacturing date
1017 * crc - 7:1 7-bit CRC7
1018 */
1019
1020 decoded.psn |= cid[3] >> 24;
1021 decoded.mdt = (cid[3] >> 8) & 0x0fff;
1022 decoded.crc = (cid[3] >> 1) & 0x7f;
1023
1024 syslog(0,"mid: %02x oid: %04x pnm: %s prv: %d psn: %lu mdt: %02x crc: %02x\n",
1025 decoded.mid, decoded.oid, decoded.pnm, decoded.prv,
1026 (unsigned long)decoded.psn, decoded.mdt, decoded.crc);
1027 }’
log:
[12/31 00:00:01] [ 3] [ap] mid: XX oid: 2d00 pnm: XXXXX prv: 49 psn: 312606724 mdt: a7a crc: 00
Ps.
XX is manufacture id.
XXXXX is product name.
For the sake of confidentiality, we use X instead.
thanks for your reply.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] alivexiaoluo commented on pull request #10778: emmc: add get emmc cid register interface.
Posted by "alivexiaoluo (via GitHub)" <gi...@apache.org>.
alivexiaoluo commented on PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#issuecomment-1732798147
> @gneworld please don't remove the Summary template! Please explain why we don't need to check if it is application specific command anymore, as Petro asked.
hi,acassis,is_acmd is to determine a flag that precedes CMD55. In order to simplify the code and be compatible with CMD2, we will no longer check this flag.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] gneworld closed pull request #10778: emmc: add get emmc cid register interface.
Posted by "gneworld (via GitHub)" <gi...@apache.org>.
gneworld closed pull request #10778: emmc: add get emmc cid register interface.
URL: https://github.com/apache/nuttx/pull/10778
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] alivexiaoluo commented on a diff in pull request #10778: emmc: add get emmc cid register interface.
Posted by "alivexiaoluo (via GitHub)" <gi...@apache.org>.
alivexiaoluo commented on code in PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#discussion_r1335311975
##########
drivers/mmcsd/mmcsd_sdio.c:
##########
@@ -3161,46 +3161,52 @@ static int mmcsd_general_cmd_read(FAR struct mmcsd_state_s *priv,
static int mmcsd_iocmd(FAR struct mmcsd_state_s *priv,
FAR struct mmc_ioc_cmd *ic_ptr)
{
+ uint32_t opcode;
int ret;
DEBUGASSERT(priv != NULL && ic_ptr != NULL);
- if (!ic_ptr->is_acmd)
Review Comment:
> So we don't need this check anymore? Could you briefly describe why as it is hard to understand with an empty PR description
Yes, we do not need this check. is_acmd is to determine a flag that precedes CMD55. In order to simplify the code and be compatible with CMD2, we will no longer check this flag.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] alivexiaoluo commented on a diff in pull request #10778: emmc: add get emmc cid register interface.
Posted by "alivexiaoluo (via GitHub)" <gi...@apache.org>.
alivexiaoluo commented on code in PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#discussion_r1335310462
##########
drivers/mmcsd/mmcsd_sdio.c:
##########
@@ -3161,46 +3161,52 @@ static int mmcsd_general_cmd_read(FAR struct mmcsd_state_s *priv,
static int mmcsd_iocmd(FAR struct mmcsd_state_s *priv,
FAR struct mmc_ioc_cmd *ic_ptr)
{
+ uint32_t opcode;
int ret;
DEBUGASSERT(priv != NULL && ic_ptr != NULL);
- if (!ic_ptr->is_acmd)
Review Comment:
Yes,is_acmd is to determine a flag that precedes CMD55. In order to simplify the code and be compatible with CMD2, we will no longer check this flag.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #10778: emmc: add get emmc cid register interface.
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #10778:
URL: https://github.com/apache/nuttx/pull/10778#discussion_r1334637139
##########
drivers/mmcsd/mmcsd_sdio.c:
##########
@@ -3161,46 +3161,52 @@ static int mmcsd_general_cmd_read(FAR struct mmcsd_state_s *priv,
static int mmcsd_iocmd(FAR struct mmcsd_state_s *priv,
FAR struct mmc_ioc_cmd *ic_ptr)
{
+ uint32_t opcode;
int ret;
DEBUGASSERT(priv != NULL && ic_ptr != NULL);
- if (!ic_ptr->is_acmd)
Review Comment:
So we don't need this check anymore? Could you briefly describe why as it is hard to understand with an empty PR description
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org