Closed imago54 closed 1 year ago
Hi.
Seems useful, can you submit a pull request?
Note that there is now a linux tool for configuring sd and mmc cards/chips: https://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git/tree/mmc.c So I am not sure if this program is still very useful.
Sincerely, Bertold
"Requesting a Linux kernel patch that makes a locked sd card visible in the /dev directory": https://github.com/alcooper/mmc-password-utils/issues/3
From SD Specifications: "The password protection feature enables the host to lock a card while providing a password, which later will be used for unlocking the card. The password and its size are kept in a 128-bit PWD and 8-bit PWD_LEN registers, respectively. These registers are non-volatile so that a power cycle will not erase them. Locked cards respond to (and execute) all commands in the "basic" command class (class 0), ACMD41, CMD16 and “lock card” command class. Thus, the host is allowed to reset, initialize, select, query for status, etc., but not to access data on the card. If the password was previously set (the value of PWD_LEN is not 0), the card will be locked automatically after power on. Similar to the existing CSD register write commands, the lock/unlock command is available in "transfer state" only. This means that it does not include an address argument and the card shall be selected before using it. The card lock/unlock command has the structure and bus transaction type of a regular single block write command. The transferred data block includes all the required information of the command (password setting mode, PWD itself, card lock/unlock etc.)."