요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* Device tree bindings for Texas instruments AEMIF controller
The Async External Memory Interface (EMIF16/AEMIF) controller is intended to
provide a glue-less interface to a variety of asynchronous memory devices like
ASRA M, NOR and NAND memory. A total of 256M bytes of any of these memories
can be accessed at any given time via four chip selects with 64M byte access
per chip select. Synchronous memories such as DDR1 SD RAM, SDR SDRAM
and Mobile SDR are not supported.
Documentation:
Davinci DM646x - http://www.ti.com/lit/ug/sprueq7c/sprueq7c.pdf
OMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
Kestone - http://www.ti.com/lit/ug/sprugz3a/sprugz3a.pdf
Required properties:
- compatible: "ti,davinci-aemif"
"ti,keystone-aemif"
"ti,da850-aemif"
- reg: contains offset/length value for AEMIF control registers
space.
- #address-cells: Must be 2. The partition number has to be encoded in the
first address cell and it may accept values 0..N-1
(N - total number of partitions). It's recommended to
assign N-1 number for the control partition. The second
cell is the offset into the partition.
- #size-cells: Must be set to 1.
- ranges: Contains memory regions. There are two types of
ranges/partitions:
- CS-specific partition/range. If continuous, must be
set up to reflect the memory layout for 4 chipselects,
if not then additional range/partition can be added and
child device can select the proper one.
- control partition which is common for all CS
interfaces.
- clocks: the clock feeding the controller clock. Required only
if clock tree data present in device tree.
See clock-bindings.txt
- clock-names: clock name. It has to be "aemif". Required only if clock
tree data present in device tree, in another case don't
use it.
See clock-bindings.txt
- clock-ranges: Empty property indicating that child nodes can inherit
named clocks. Required only if clock tree data present
in device tree.
See clock-bindings.txt
Child chip-select (cs) nodes contain the memory devices nodes connected to
such as NOR (e.g. cfi-flash) and NAND (ti,davinci-nand, see davinci-nand.txt).
There might be board specific devices like FPGAs.
Required child cs node properties:
- #address-cells: Must be 2.
- #size-cells: Must be 1.
- ranges: Empty property indicating that child nodes can inherit
memory layout.
- clock-ranges: Empty property indicating that child nodes can inherit
named clocks. Required only if clock tree data present
in device tree.
- ti,cs-chipselect: number of chipselect. Indicates on the aemif driver
which chipselect is used for accessing the memory. For
compatibles "ti,davinci-aemif" and "ti,keystone-aemif"
it can be in range [0-3]. For compatible
"ti,da850-aemif" range is [2-5].
Optional child cs node properties:
- ti,cs-bus-width: width of the asynchronous device's data bus
8 or 16 if not preset 8
- ti,cs-select-strobe-mode: enable/disable select strobe mode
In select strobe mode chip select behaves as
the strobe and is active only during the strobe
period. If present then enable.
- ti,cs-extended-wait-mode: enable/disable extended wait mode
if set, the controller monitors the EMIFWAIT pin
mapped to that chip select to determine if the
device wants to extend the strobe period. If
present then enable.
- ti,cs-min-turnaround-ns: minimum turn around time, ns
Time between the end of one asynchronous memory
access and the start of another asynchronous
memory access. This delay is not incurred
between a read followed by read or a write
followed by a write to same chip select.
- ti,cs-read-setup-ns: read setup width, ns
Time between the beginning of a memory cycle
and the activation of read strobe.
Minimum value is 1 (0 treated as 1).
- ti,cs-read-strobe-ns: read strobe width, ns
Time between the activation and deactivation of
the read strobe.
Minimum value is 1 (0 treated as 1).
- ti,cs-read-hold-ns: read hold width, ns
Time between the deactivation of the read
strobe and the end of the cycle (which may be
either an address change or the deactivation of
the chip select signal.
Minimum value is 1 (0 treated as 1).
- ti,cs-write-setup-ns: write setup width, ns
Time between the beginning of a memory cycle
and the activation of write strobe.
Minimum value is 1 (0 treated as 1).
- ti,cs-write-strobe-ns: write strobe width, ns
Time between the activation and deactivation of
the write strobe.
Minimum value is 1 (0 treated as 1).
- ti,cs-write-hold-ns: write hold width, ns
Time between the deactivation of the write
strobe and the end of the cycle (which may be
either an address change or the deactivation of
the chip select signal.
Minimum value is 1 (0 treated as 1).
If any of the above parameters are absent, current parameter value will be taken
from the corresponding HW reg.
Example for aemif, davinci nand and nor flash chip select shown below.
memory-controller@21000a00 {
compatible = "ti,davinci-aemif";
#address-cells = <2>;
#size-cells = <1>;
clocks = <&clkaemif 0>;
clock-names = "aemif";
clock-ranges;
reg = <0x21000A00 0x00000100>;
ranges = <0 0 0x70000000 0x10000000
1 0 0x21000A00 0x00000100>;
/*
* Partition0: CS-specific memory range which is
* implemented as continuous physical memory region
* Partition1: control memory range
*/
nand:cs2 {
#address-cells = <2>;
#size-cells = <1>;
clock-ranges;
ranges;
ti,cs-chipselect = <2>;
/* all timings in nanoseconds */
ti,cs-min-turnaround-ns = <0>;
ti,cs-read-hold-ns = <7>;
ti,cs-read-strobe-ns = <42>;
ti,cs-read-setup-ns = <14>;
ti,cs-write-hold-ns = <7>;
ti,cs-write-strobe-ns = <42>;
ti,cs-write-setup-ns = <14>;
nand@0,0x8000000 {
compatible = "ti,davinci-nand";
reg = <0 0x8000000 0x4000000
1 0x0000000 0x0000100>;
/*
* Partition0, offset 0x8000000, size 0x4000000
* Partition1, offset 0x0000000, size 0x0000100
*/
.. see davinci-nand.txt
};
};
nor:cs0 {
#address-cells = <2>;
#size-cells = <1>;
clock-ranges;
ranges;
ti,cs-chipselect = <0>;
/* all timings in nanoseconds */
ti,cs-min-turnaround-ns = <0>;
ti,cs-read-hold-ns = <8>;
ti,cs-read-strobe-ns = <40>;
ti,cs-read-setup-ns = <14>;
ti,cs-write-hold-ns = <7>;
ti,cs-write-strobe-ns = <40>;
ti,cs-write-setup-ns = <14>;
ti,cs-bus-width = <16>;
flash@0,0x0000000 {
compatible = "cfi-flash";
reg = <0 0x0000000 0x4000000>;
...
};
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
TI Async External Memory Interface
1-9Async External Memory Interface(EMIF16/AEMIF)는 비동기 SRAM, NOR, NAND 같은 여러 비동기 메모리에 별도 glue logic 없이 연결하는 컨트롤러입니다. chip select 네 개가 각각 64MiB를 제공하므로 한 시점에 총 256MiB를 접근할 수 있습니다.
DDR1 SDRAM, SDR SDRAM, Mobile SDR 같은 동기 메모리는 지원하지 않습니다.
네 chip-select의 비동기 메모리 창과 모든 CS에 공통인 control partition을 별도 partition 번호로 표현합니다.
하드웨어 참고 문서
10-14하드웨어 설명은 DaVinci DM646x의 `http://www.ti.com/lit/ug/sprueq7c/sprueq7c.pdf`, OMAP-L138(DA850)의 `http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf`, Keystone의 `http://www.ti.com/lit/ug/sprugz3a/sprugz3a.pdf`를 참조합니다. 원문의 `Kestone` 표기는 Keystone을 가리킵니다.
컨트롤러 필수 속성
15-55`compatible`은 `ti,davinci-aemif`, `ti,keystone-aemif`, `ti,da850-aemif` 중 하나입니다. `reg`는 AEMIF control register 공간의 offset과 length를 담습니다.
`#address-cells`는 2여야 합니다. 첫 address cell에는 0부터 N-1까지의 partition 번호를 인코딩하고 N은 전체 partition 수입니다. control partition에는 N-1을 배정하는 것이 권장됩니다. 둘째 cell은 partition 안의 offset입니다. `#size-cells`는 1입니다.
`ranges`에는 두 종류의 메모리 영역이 있습니다. CS별 partition/range가 연속이면 네 chip-select의 메모리 배치를 반영해야 합니다. 연속되지 않으면 range/partition을 더 추가하고 자식 장치가 알맞은 것을 선택할 수 있습니다. 다른 하나는 모든 CS 인터페이스가 공유하는 control partition입니다.
장치 트리에 clock tree 데이터가 있을 때만 `clocks`, `clock-names`, `clock-ranges`가 필요합니다. `clocks`는 컨트롤러 클록, `clock-names`는 반드시 `aemif`, 빈 `clock-ranges`는 자식 노드가 이름 있는 클록을 상속할 수 있음을 나타냅니다. clock tree 데이터가 없으면 `clock-names`를 사용하지 않습니다. 형식은 `clock-bindings.txt`를 따릅니다.
chip-select 자식 장치
56-59chip-select(CS) 자식 노드에는 CFI flash 같은 NOR, `ti,davinci-nand` NAND 또는 보드별 FPGA 장치 노드를 둡니다. DaVinci NAND의 자세한 내용은 `davinci-nand.txt`를 봅니다.
CS 자식의 필수 속성
60-78CS 자식의 `#address-cells`는 2, `#size-cells`는 1이어야 합니다. 빈 `ranges`는 자식이 메모리 배치를 상속함을 뜻합니다. clock tree 데이터가 있을 때는 빈 `clock-ranges`도 두어 이름 있는 클록을 상속하게 합니다.
`ti,cs-chipselect`는 메모리 접근에 사용할 chip-select 번호입니다. `ti,davinci-aemif`와 `ti,keystone-aemif`에서는 0~3, `ti,da850-aemif`에서는 2~5 범위입니다.
CS 버스와 strobe 선택 속성
79-94`ti,cs-bus-width`는 비동기 장치 데이터 버스 폭으로 8 또는 16이며 생략하면 8입니다. `ti,cs-select-strobe-mode`가 있으면 select strobe mode를 활성화합니다. 이 모드에서 chip select는 strobe처럼 동작해 strobe 기간에만 active입니다.
`ti,cs-extended-wait-mode`가 있으면 extended wait mode를 활성화합니다. 컨트롤러는 해당 chip-select에 매핑된 EMIFWAIT 핀을 감시해 장치가 strobe 기간 연장을 요구하는지 판단합니다.
나노초 단위 CS timing
95-138`ti,cs-min-turnaround-ns`는 한 비동기 메모리 접근 종료와 다음 접근 시작 사이의 최소 turnaround 시간입니다. 같은 chip-select에서 read 다음 read 또는 write 다음 write가 이어질 때는 이 지연을 적용하지 않습니다.
`ti,cs-read-setup-ns`는 memory cycle 시작부터 read strobe 활성화까지, `ti,cs-read-strobe-ns`는 read strobe 활성화부터 비활성화까지, `ti,cs-read-hold-ns`는 read strobe 비활성화부터 주소 변경 또는 chip-select 비활성화로 cycle이 끝날 때까지의 시간입니다.
`ti,cs-write-setup-ns`, `ti,cs-write-strobe-ns`, `ti,cs-write-hold-ns`는 각각 write cycle의 동일한 setup, active strobe, hold 구간입니다. read/write setup·strobe·hold 값의 최솟값은 1ns이며 0은 1로 처리됩니다.
메모리 cycle에서 read와 write strobe 전후의 나노초 구간을 대응시켰습니다.
위 매개변수 중 생략된 것이 있으면 해당 hardware register에 현재 들어 있는 값을 사용합니다.
DaVinci NAND와 NOR 예제
139-210예제 컨트롤러는 `ti,davinci-aemif`이며 partition 0을 `0x70000000`의 연속 CS 메모리 영역에, partition 1을 `0x21000A00`의 control register 영역에 매핑합니다. AEMIF 클록과 클록 상속도 설정합니다.
NAND는 chip-select 2를 사용하고 partition 0의 offset `0x8000000`에서 64MiB, partition 1의 offset 0에서 256바이트를 요청합니다. NOR는 chip-select 0, 16비트 버스와 partition 0의 64MiB 영역을 사용합니다. 두 CS의 timing은 모두 나노초 단위이며 원문의 `.. see davinci-nand.txt`와 `...` 생략 표기를 그대로 보존합니다.
memory-controller@21000a00 {
compatible = "ti,davinci-aemif";
#address-cells = <2>;
#size-cells = <1>;
clocks = <&clkaemif 0>;
clock-names = "aemif";
clock-ranges;
reg = <0x21000A00 0x00000100>;
ranges = <0 0 0x70000000 0x10000000
1 0 0x21000A00 0x00000100>;
/*
* Partition0: CS-specific memory range which is
* implemented as continuous physical memory region
* Partition1: control memory range
*/
nand:cs2 {
#address-cells = <2>;
#size-cells = <1>;
clock-ranges;
ranges;
ti,cs-chipselect = <2>;
/* all timings in nanoseconds */
ti,cs-min-turnaround-ns = <0>;
ti,cs-read-hold-ns = <7>;
ti,cs-read-strobe-ns = <42>;
ti,cs-read-setup-ns = <14>;
ti,cs-write-hold-ns = <7>;
ti,cs-write-strobe-ns = <42>;
ti,cs-write-setup-ns = <14>;
nand@0,0x8000000 {
compatible = "ti,davinci-nand";
reg = <0 0x8000000 0x4000000
1 0x0000000 0x0000100>;
/*
* Partition0, offset 0x8000000, size 0x4000000
* Partition1, offset 0x0000000, size 0x0000100
*/
.. see davinci-nand.txt
};
};
nor:cs0 {
#address-cells = <2>;
#size-cells = <1>;
clock-ranges;
ranges;
ti,cs-chipselect = <0>;
/* all timings in nanoseconds */
ti,cs-min-turnaround-ns = <0>;
ti,cs-read-hold-ns = <8>;
ti,cs-read-strobe-ns = <40>;
ti,cs-read-setup-ns = <14>;
ti,cs-write-hold-ns = <7>;
ti,cs-write-strobe-ns = <40>;
ti,cs-write-setup-ns = <14>;
ti,cs-bus-width = <16>;
flash@0,0x0000000 {
compatible = "cfi-flash";
reg = <0 0x0000000 0x4000000>;
...
};
};
};
요약과 해설
ti-aemif.txt:1-210CS별 메모리와 공통 control partition, NAND·NOR 예제를 설명합니다.