요약·해설, 영어 원문, 전체 번역을 구분해 실었습니다. API 이름, 코드 심벌, 소스 경로는 원문 표기를 유지합니다.
1. 요약·해설
원문의 핵심 내용을 정리하고 커널 프로그래밍에 필요한 설명을 덧붙였습니다. 아래의 전체 번역과는 별도로 작성한 해설입니다.
2. 영어 원문 전체
번역에 사용한 Linux v6.18.37 원문입니다. 줄 번호는 해당 버전의 소스 파일을 기준으로 합니다.
원문 전체 펼치기
Devicetree binding for regmap
Optional properties:
little-endian,
big-endian,
native-endian: See common-properties.txt for a definition
Note:
Regmap defaults to little-endian register access on MMIO based
devices, this is by far the most common setting. On CPU
architectures that typically run big-endian operating systems
(e.g. PowerPC), registers can be defined as big-endian and must
be marked that way in the devicetree.
On SoCs that can be operated in both big-endian and little-endian
modes, with a single hardware switch controlling both the endianness
of the CPU and a byteswap for MMIO registers (e.g. many Broadcom MIPS
chips), "native-endian" is used to allow using the same device tree
blob in both cases.
Examples:
Scenario 1 : a register set in big-endian mode.
dev: dev@40031000 {
compatible = "syscon";
reg = <0x40031000 0x1000>;
big-endian;
...
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미에 맞춰 전체 내용을 번역했습니다. 코드, 함수명, 코드 심벌, URL은 원문 표기를 유지합니다.
Regmap endian property
1-8Regmap binding의 선택 property는 `little-endian`, `big-endian`, `native-endian`입니다. 각 정의는 `common-properties.txt`를 참조합니다.
MMIO byte order 선택
9-21MMIO 기반 device의 regmap은 가장 흔한 설정인 little-endian register access를 기본값으로 사용합니다. PowerPC처럼 보통 big-endian 운영체제를 실행하는 CPU architecture에서는 big-endian register를 device tree에 그렇게 표시해야 합니다.
CPU endianness와 MMIO register byteswap을 하나의 hardware switch로 함께 바꾸는 Broadcom MIPS 계열 같은 SoC에서는 `native-endian`을 사용합니다. 그러면 big-endian과 little-endian mode가 같은 device tree blob을 공유할 수 있습니다.
Big-endian regmap 예제
22-29예제의 syscon register set은 `big-endian` boolean property로 access byte order를 지정합니다.
dev: dev@40031000 {
compatible = "syscon";
reg = <0x40031000 0x1000>;
big-endian;
...
};
요약과 해설
regmap.txt:1-29필수·선택 property의 의미와 원문의 실제 선언 예제를 함께 읽을 수 있습니다.