Documentation/driver-api/mmc/mmc-dev-attrs.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

SD and MMC Device Attributes

SD/MMC block 및 card attribute의 전문 번역입니다.

Source pathDocumentation/driver-api/mmc/mmc-dev-attrs.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

mmc-dev-attrs.rst:1-91

Block의 `force_ro`, card identification, erase 단위, RPMB 크기 계산을 설명합니다.

문서 구성
원문 줄내용
1-13Block 속성
14-44Card 속성
45-84Erase size
85-91RPMB multiplier

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ==================================
2 SD and MMC Block Device Attributes
3 ==================================
4
5 These attributes are defined for the block devices associated with the
6 SD or MMC device.
7
8 The following attributes are read/write.
9
10 ======== ===============================================
11 force_ro Enforce read-only access even if write protect switch is off.
12 ======== ===============================================
13
14 SD and MMC Device Attributes
15 ============================
16
17 All attributes are read-only.
18
19 ====================== ===============================================
20 cid Card Identification Register
21 csd Card Specific Data Register
22 scr SD Card Configuration Register (SD only)
23 date Manufacturing Date (from CID Register)
24 fwrev Firmware/Product Revision (from CID Register)
25 (SD and MMCv1 only)
26 hwrev Hardware/Product Revision (from CID Register)
27 (SD and MMCv1 only)
28 manfid Manufacturer ID (from CID Register)
29 name Product Name (from CID Register)
30 oemid OEM/Application ID (from CID Register)
31 prv Product Revision (from CID Register)
32 (SD and MMCv4 only)
33 serial Product Serial Number (from CID Register)
34 erase_size Erase group size
35 preferred_erase_size Preferred erase size
36 raw_rpmb_size_mult RPMB partition size
37 rel_sectors Reliable write sector count
38 ocr Operation Conditions Register
39 dsr Driver Stage Register
40 cmdq_en Command Queue enabled:
41
42 1 => enabled, 0 => not enabled
43 ====================== ===============================================
44
45 Note on Erase Size and Preferred Erase Size:
46
47 "erase_size" is the minimum size, in bytes, of an erase
48 operation. For MMC, "erase_size" is the erase group size
49 reported by the card. Note that "erase_size" does not apply
50 to trim or secure trim operations where the minimum size is
51 always one 512 byte sector. For SD, "erase_size" is 512
52 if the card is block-addressed, 0 otherwise.
53
54 SD/MMC cards can erase an arbitrarily large area up to and
55 including the whole card. When erasing a large area it may
56 be desirable to do it in smaller chunks for three reasons:
57
58 1. A single erase command will make all other I/O on
59 the card wait. This is not a problem if the whole card
60 is being erased, but erasing one partition will make
61 I/O for another partition on the same card wait for the
62 duration of the erase - which could be a several
63 minutes.
64 2. To be able to inform the user of erase progress.
65 3. The erase timeout becomes too large to be very
66 useful. Because the erase timeout contains a margin
67 which is multiplied by the size of the erase area,
68 the value can end up being several minutes for large
69 areas.
70
71 "erase_size" is not the most efficient unit to erase
72 (especially for SD where it is just one sector),
73 hence "preferred_erase_size" provides a good chunk
74 size for erasing large areas.
75
76 For MMC, "preferred_erase_size" is the high-capacity
77 erase size if a card specifies one, otherwise it is
78 based on the capacity of the card.
79
80 For SD, "preferred_erase_size" is the allocation unit
81 size specified by the card.
82
83 "preferred_erase_size" is in bytes.
84
85 Note on raw_rpmb_size_mult:
86
87 "raw_rpmb_size_mult" is a multiple of 128kB block.
88
89 RPMB size in byte is calculated by using the following equation:
90
91 RPMB partition size = 128kB x raw_rpmb_size_mult
92

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Block device 속성

1-13

이 속성은 SD 또는 MMC 장치에 연결된 block device에 정의됩니다.

Read/write 속성 `force_ro`는 물리적 write-protect switch가 꺼져 있어도 장치를 강제로 read-only로 사용하게 합니다.

Block 속성
속성접근의미
`force_ro`read/write강제 read-only access

==================================
SD and MMC Block Device Attributes
==================================

These attributes are defined for the block devices associated with the
SD or MMC device.

The following attributes are read/write.

        ========                ===============================================
        force_ro                Enforce read-only access even if write protect                                         switch is off.
        ========                ===============================================

SD/MMC card 속성

14-44

SD와 MMC device attribute는 모두 read-only입니다.

Card identification과 동작 속성
속성의미
`cid`Card Identification Register
`csd`Card Specific Data Register
`scr`SD Card Configuration Register, SD 전용
`date`CID의 제조일
`fwrev`Firmware/Product revision, SD와 MMCv1 전용
`hwrev`Hardware/Product revision, SD와 MMCv1 전용
`manfid`CID의 manufacturer ID
`name`CID의 product name
`oemid`CID의 OEM/Application ID
`prv`CID의 product revision, SD와 MMCv4 전용
`serial`CID의 product serial number
`erase_size`Erase group size
`preferred_erase_size`권장 erase size
`raw_rpmb_size_mult`RPMB partition size multiplier
`rel_sectors`Reliable write sector count
`ocr`Operation Conditions Register
`dsr`Driver Stage Register
`cmdq_en`Command Queue 상태, 1은 enabled, 0은 disabled

SD and MMC Device Attributes
============================

All attributes are read-only.

        ======================        ===============================================
        cid                        Card Identification Register
        csd                        Card Specific Data Register
        scr                        SD Card Configuration Register (SD only)
        date                        Manufacturing Date (from CID Register)
        fwrev                        Firmware/Product Revision (from CID Register)
                                (SD and MMCv1 only)
        hwrev                        Hardware/Product Revision (from CID Register)
                                (SD and MMCv1 only)
        manfid                        Manufacturer ID (from CID Register)
        name                        Product Name (from CID Register)
        oemid                        OEM/Application ID (from CID Register)
        prv                        Product Revision (from CID Register)
                                (SD and MMCv4 only)
        serial                        Product Serial Number (from CID Register)
        erase_size                Erase group size
        preferred_erase_size        Preferred erase size
        raw_rpmb_size_mult        RPMB partition size
        rel_sectors                Reliable write sector count
        ocr                         Operation Conditions Register
        dsr                        Driver Stage Register
        cmdq_en                        Command Queue enabled:

                                        1 => enabled, 0 => not enabled
        ======================        ===============================================

Erase size와 preferred erase size

45-84

`erase_size`는 erase operation의 최소 byte 크기입니다. MMC에서는 card가 보고한 erase group size입니다. Trim과 secure trim의 최소 단위는 항상 512-byte sector 하나이므로 이 값이 적용되지 않습니다. Block-addressed SD에서는 512이고 그 외 SD에서는 0입니다.

SD/MMC card는 card 전체까지 임의로 큰 영역을 지울 수 있지만, 큰 erase는 작은 chunk로 나누는 편이 좋습니다.

이유는 세 가지입니다. 단일 erase command가 다른 모든 I/O를 오래 막을 수 있고, 사용자에게 진행률을 알릴 수 있어야 하며, erase area 크기에 margin이 곱해져 timeout이 수 분까지 커질 수 있기 때문입니다.

`erase_size`는 가장 효율적인 erase 단위가 아닐 수 있으므로 `preferred_erase_size`가 큰 영역을 나눌 적절한 chunk size를 제공합니다.

MMC에서는 card가 high-capacity erase size를 지정하면 그 값을 사용하고, 아니면 card capacity에 따라 계산합니다. SD에서는 card가 지정한 allocation unit size를 사용합니다. 단위는 byte입니다.

Erase 단위
속성MMCSD
`erase_size`Card erase groupBlock-addressed 512, 그 외 0
`preferred_erase_size`High-capacity erase size 또는 capacity 기반Allocation unit size

Note on Erase Size and Preferred Erase Size:

        "erase_size" is the  minimum size, in bytes, of an erase
        operation.  For MMC, "erase_size" is the erase group size
        reported by the card.  Note that "erase_size" does not apply
        to trim or secure trim operations where the minimum size is
        always one 512 byte sector.  For SD, "erase_size" is 512
        if the card is block-addressed, 0 otherwise.

        SD/MMC cards can erase an arbitrarily large area up to and
        including the whole card.  When erasing a large area it may
        be desirable to do it in smaller chunks for three reasons:

             1. A single erase command will make all other I/O on
                the card wait.  This is not a problem if the whole card
                is being erased, but erasing one partition will make
                I/O for another partition on the same card wait for the
                duration of the erase - which could be a several
                minutes.
             2. To be able to inform the user of erase progress.
             3. The erase timeout becomes too large to be very
                useful.  Because the erase timeout contains a margin
                which is multiplied by the size of the erase area,
                the value can end up being several minutes for large
                areas.

        "erase_size" is not the most efficient unit to erase
        (especially for SD where it is just one sector),
        hence "preferred_erase_size" provides a good chunk
        size for erasing large areas.

        For MMC, "preferred_erase_size" is the high-capacity
        erase size if a card specifies one, otherwise it is
        based on the capacity of the card.

        For SD, "preferred_erase_size" is the allocation unit
        size specified by the card.

        "preferred_erase_size" is in bytes.

RPMB 크기 multiplier

85-91

`raw_rpmb_size_mult`는 128 KiB block의 배수입니다.

RPMB partition의 byte 크기는 `128 KiB x raw_rpmb_size_mult`로 계산합니다.

RPMB 크기
입력계산
`raw_rpmb_size_mult``128 KiB x multiplier`

Note on raw_rpmb_size_mult:

        "raw_rpmb_size_mult" is a multiple of 128kB block.

        RPMB size in byte is calculated by using the following equation:

                RPMB partition size = 128kB x raw_rpmb_size_mult