요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Device tree bindings for NVIDIA Tegra Generic Memory Interface bus
The Generic Memory Interface bus enables memory transfers between internal and
external memory. Can be used to attach various high speed devices such as
synchronous/asynchronous NOR, FPGA, UARTS and more.
The actual devices are instantiated from the child nodes of a GMI node.
Required properties:
- compatible : Should contain one of the following:
For Tegra20 must contain "nvidia,tegra20-gmi".
For Tegra30 must contain "nvidia,tegra30-gmi".
- reg: Should contain GMI controller registers location and length.
- clocks: Must contain an entry for each entry in clock-names.
- clock-names: Must include the following entries: "gmi"
- resets : Must contain an entry for each entry in reset-names.
- reset-names : Must include the following entries: "gmi"
- #address-cells: The number of cells used to represent physical base
addresses in the GMI address space. Should be 2.
- #size-cells: The number of cells used to represent the size of an address
range in the GMI address space. Should be 1.
- ranges: Must be set up to reflect the memory layout with three integer values
for each chip-select line in use (only one entry is supported, see below
comments):
<cs-number> <offset> <physical address of mapping> <size>
Note that the GMI controller does not have any internal chip-select address
decoding, because of that chip-selects either need to be managed via software
or by employing external chip-select decoding logic.
If external chip-select logic is used to support multiple devices it is assumed
that the devices use the same timing and so are probably the same type. It also
assumes that they can fit in the 256MB address range. In this case only one
child device is supported which represents the active chip-select line, see
examples for more insight.
The chip-select number is decoded from the child nodes second address cell of
'ranges' property, if 'ranges' property is not present or empty chip-select will
then be decoded from the first cell of the 'reg' property.
Optional child cs node properties:
- nvidia,snor-data-width-32bit: Use 32bit data-bus, default is 16bit.
- nvidia,snor-mux-mode: Enable address/data MUX mode.
- nvidia,snor-rdy-active-before-data: Assert RDY signal one cycle before data.
If omitted it will be asserted with data.
- nvidia,snor-rdy-active-high: RDY signal is active high
- nvidia,snor-adv-active-high: ADV signal is active high
- nvidia,snor-oe-active-high: WE/OE signal is active high
- nvidia,snor-cs-active-high: CS signal is active high
Note that there is some special handling for the timing values.
From Tegra TRM:
Programming 0 means 1 clock cycle: actual cycle = programmed cycle + 1
- nvidia,snor-muxed-width: Number of cycles MUX address/data asserted on the
bus. Valid values are 0-15, default is 1
- nvidia,snor-hold-width: Number of cycles CE stays asserted after the
de-assertion of WR_N (in case of SLAVE/MASTER Request) or OE_N
(in case of MASTER Request). Valid values are 0-15, default is 1
- nvidia,snor-adv-width: Number of cycles during which ADV stays asserted.
Valid values are 0-15, default is 1.
- nvidia,snor-ce-width: Number of cycles before CE is asserted.
Valid values are 0-15, default is 4
- nvidia,snor-we-width: Number of cycles during which WE stays asserted.
Valid values are 0-15, default is 1
- nvidia,snor-oe-width: Number of cycles during which OE stays asserted.
Valid values are 0-255, default is 1
- nvidia,snor-wait-width: Number of cycles before READY is asserted.
Valid values are 0-255, default is 3
Example with two SJA1000 CAN controllers connected to the GMI bus. We wrap the
controllers with a simple-bus node since they are all connected to the same
chip-select (CS4), in this example external address decoding is provided:
gmi@70009000 {
compatible = "nvidia,tegra20-gmi";
reg = <0x70009000 0x1000>;
#address-cells = <2>;
#size-cells = <1>;
clocks = <&tegra_car TEGRA20_CLK_NOR>;
clock-names = "gmi";
resets = <&tegra_car 42>;
reset-names = "gmi";
ranges = <4 0 0xd0000000 0xfffffff>;
bus@4,0 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 4 0 0x40100>;
nvidia,snor-mux-mode;
nvidia,snor-adv-active-high;
can@0 {
reg = <0 0x100>;
...
};
can@40000 {
reg = <0x40000 0x100>;
...
};
};
};
Example with one SJA1000 CAN controller connected to the GMI bus
on CS4:
gmi@70009000 {
compatible = "nvidia,tegra20-gmi";
reg = <0x70009000 0x1000>;
#address-cells = <2>;
#size-cells = <1>;
clocks = <&tegra_car TEGRA20_CLK_NOR>;
clock-names = "gmi";
resets = <&tegra_car 42>;
reset-names = "gmi";
ranges = <4 0 0xd0000000 0xfffffff>;
can@4,0 {
reg = <4 0 0x100>;
nvidia,snor-mux-mode;
nvidia,snor-adv-active-high;
...
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Tegra GMI bus와 chip-select 주소
1-40NVIDIA Tegra Generic Memory Interface bus Device Tree 바인딩
Generic Memory Interface bus는 internal memory와 external memory 사이의 전송을 지원합니다. synchronous/asynchronous NOR, FPGA, UART 등 여러 고속 장치를 연결할 수 있습니다.
실제 장치는 GMI 노드의 child node에서 인스턴스화됩니다.
필수 `compatible`은 Tegra20의 `nvidia,tegra20-gmi` 또는 Tegra30의 `nvidia,tegra30-gmi`입니다. `reg`에는 GMI controller register의 위치와 길이를 지정합니다.
`clocks`와 `resets`에는 각각 `clock-names`와 `reset-names`의 각 entry에 해당하는 항목이 있어야 합니다. 두 이름 목록은 모두 `gmi`를 포함해야 합니다.
GMI 주소 공간의 physical base address를 나타내는 `#address-cells`는 2여야 하며 address range 크기를 나타내는 `#size-cells`는 1이어야 합니다.
`ranges`는 사용하는 각 chip-select line의 memory layout을 반영해야 합니다. 현재 한 entry만 지원하며 형식은 `<cs-number> <offset> <physical address of mapping> <size>`입니다.
GMI controller에는 내부 chip-select 주소 decoding 기능이 없습니다. 따라서 chip-select는 software로 관리하거나 외부 chip-select decoding logic을 사용해야 합니다.
여러 장치를 지원하는 외부 chip-select logic을 사용한다면 장치들이 같은 timing을 사용하며 대개 같은 유형이라고 가정합니다. 또한 모든 장치가 256 MB 주소 범위 안에 들어간다고 가정합니다. 이 경우 active chip-select line을 나타내는 child device 하나만 지원합니다.
chip-select 번호는 `ranges`의 child address 두 번째 cell에서 decoding합니다. `ranges`가 없거나 비어 있으면 `reg`의 첫 번째 cell에서 decoding합니다.
Child 주소에서 chip-select를 선택하고 외부 memory에 매핑하는 흐름입니다.
SNOR 신호와 timing 속성
41-71선택적 child chip-select 속성 `nvidia,snor-data-width-32bit`는 기본 16-bit 대신 32-bit data bus를 사용합니다. `nvidia,snor-mux-mode`는 address/data MUX mode를 활성화합니다.
`nvidia,snor-rdy-active-before-data`는 data보다 한 cycle 먼저 RDY를 assert하며 생략하면 data와 함께 assert합니다. `nvidia,snor-rdy-active-high`, `nvidia,snor-adv-active-high`, `nvidia,snor-oe-active-high`, `nvidia,snor-cs-active-high`는 각각 RDY, ADV, WE/OE, CS 신호를 active-high로 설정합니다.
Timing 값에는 특별한 해석이 있습니다. Tegra TRM에 따르면 0을 program하면 1 clock cycle이 되므로 실제 cycle 수는 programmed cycle + 1입니다.
`nvidia,snor-muxed-width`는 MUX address/data가 bus에 assert되는 cycle 수로 범위는 0-15, 기본값은 1입니다.
`nvidia,snor-hold-width`는 SLAVE/MASTER request에서 WR_N, MASTER request에서 OE_N이 deassert된 뒤 CE가 계속 assert되는 cycle 수입니다. 범위는 0-15, 기본값은 1입니다.
`nvidia,snor-adv-width`는 ADV가 assert되는 cycle 수로 0-15, 기본값 1입니다. `nvidia,snor-ce-width`는 CE가 assert되기 전 cycle 수로 0-15, 기본값 4입니다.
`nvidia,snor-we-width`는 WE가 assert되는 cycle 수로 0-15, 기본값 1입니다. `nvidia,snor-oe-width`는 OE가 assert되는 cycle 수로 0-255, 기본값 1입니다. `nvidia,snor-wait-width`는 READY가 assert되기 전 cycle 수로 0-255, 기본값 3입니다.
각 timing 속성의 범위와 기본값을 정리합니다. 실제 cycle은 programmed value + 1입니다.
외부 decoding을 사용하는 두 CAN controller 예
72-107두 SJA1000 CAN controller가 GMI bus의 같은 chip-select CS4에 연결된 예입니다. 외부 주소 decoding을 사용하므로 두 controller를 `simple-bus` 노드로 감쌉니다.
gmi@70009000 {
compatible = "nvidia,tegra20-gmi";
reg = <0x70009000 0x1000>;
#address-cells = <2>;
#size-cells = <1>;
clocks = <&tegra_car TEGRA20_CLK_NOR>;
clock-names = "gmi";
resets = <&tegra_car 42>;
reset-names = "gmi";
ranges = <4 0 0xd0000000 0xfffffff>;
bus@4,0 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 4 0 0x40100>;
nvidia,snor-mux-mode;
nvidia,snor-adv-active-high;
can@0 {
reg = <0 0x100>;
...
};
can@40000 {
reg = <0x40000 0x100>;
...
};
};
};
하나의 active chip-select 아래 두 CAN controller를 offset으로 구분합니다.
단일 CAN controller 예
108-128다음 예는 GMI bus의 CS4에 SJA1000 CAN controller 하나를 직접 연결하고 `reg = <4 0 0x100>`에서 chip-select와 offset을 지정합니다.
gmi@70009000 {
compatible = "nvidia,tegra20-gmi";
reg = <0x70009000 0x1000>;
#address-cells = <2>;
#size-cells = <1>;
clocks = <&tegra_car TEGRA20_CLK_NOR>;
clock-names = "gmi";
resets = <&tegra_car 42>;
reset-names = "gmi";
ranges = <4 0 0xd0000000 0xfffffff>;
can@4,0 {
reg = <4 0 0x100>;
nvidia,snor-mux-mode;
nvidia,snor-adv-active-high;
...
};
};
요약과 해설
nvidia,tegra20-gmi.txt:1-128NOR, FPGA, UART 같은 외부 장치를 GMI 주소 공간에 매핑하고 단일 또는 외부 decoding된 여러 장치를 구성합니다.