요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
TI SoC Ethernet Switch Controller Device Tree Bindings
------------------------------------------------------
Required properties:
- compatible : Should be one of the below:-
"ti,cpsw" for backward compatible
"ti,am335x-cpsw" for AM335x controllers
"ti,am4372-cpsw" for AM437x controllers
"ti,dra7-cpsw" for DRA7x controllers
- reg : physical base address and size of the cpsw
registers map
- interrupts : property with a value describing the interrupt
number
- cpdma_channels : Specifies number of channels in CPDMA
- ale_entries : Specifies No of entries ALE can hold
- bd_ram_size : Specifies internal descriptor RAM size
- mac_control : Specifies Default MAC control register content
for the specific platform
- slaves : Specifies number for slaves
- active_slave : Specifies the slave to use for time stamping,
ethtool and SIOCGMIIPHY
- cpsw-phy-sel : Specifies the phandle to the CPSW phy mode selection
device. See also cpsw-phy-sel.txt for its binding.
Note that in legacy cases cpsw-phy-sel may be
a child device instead of a phandle
(DEPRECATED, use phys property instead).
Optional properties:
- ti,hwmods : Must be "cpgmac0"
- dual_emac : Specifies Switch to act as Dual EMAC
- syscon : Phandle to the system control device node, which is
the control module device of the am33x
- mode-gpios : Should be added if one/multiple gpio lines are
required to be driven so that cpsw data lines
can be connected to the phy via selective mux.
For example in dra72x-evm, pcf gpio has to be
driven low so that cpsw slave 0 and phy data
lines are connected via mux.
- cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
- cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
Mult and shift will be calculated basing on CPTS
rftclk frequency if both cpts_clock_shift and
cpts_clock_mult properties are not provided.
Slave Properties:
Required properties:
- phy-mode : See ethernet.txt file in the same directory
- phys : phandle on phy-gmii-sel PHY (see phy/ti-phy-gmii-sel.txt)
Optional properties:
- dual_emac_res_vlan : Specifies VID to be used to segregate the ports
- phy_id : Specifies slave phy id (deprecated, use phy-handle)
- phy-handle : See ethernet.txt file in the same directory
The MAC address will be determined using the optional properties
defined in ethernet.txt.
Slave sub-nodes:
- fixed-link : See fixed-link.txt file in the same directory
Note: Exactly one of phy_id, phy-handle, or fixed-link must be specified.
Note: "ti,hwmods" field is used to fetch the base address and irq
resources from TI, omap hwmod data base during device registration.
Future plan is to migrate hwmod data base contents into device tree
blob so that, all the required data will be used from device tree dts
file.
Examples:
mac: ethernet@4a100000 {
compatible = "ti,cpsw";
reg = <0x4A100000 0x1000>;
interrupts = <55 0x4>;
interrupt-parent = <&intc>;
cpdma_channels = <8>;
ale_entries = <1024>;
bd_ram_size = <0x2000>;
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
syscon = <&cm>;
cpsw-phy-sel = <&phy_sel>;
cpsw_emac0: slave@0 {
phy_id = <&davinci_mdio>, <0>;
phy-mode = "rgmii-txid";
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
phys = <&phy_gmii_sel 1 0>;
};
cpsw_emac1: slave@1 {
phy_id = <&davinci_mdio>, <1>;
phy-mode = "rgmii-txid";
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
phys = <&phy_gmii_sel 2 0>;
};
};
(or)
mac: ethernet@4a100000 {
compatible = "ti,cpsw";
ti,hwmods = "cpgmac0";
cpdma_channels = <8>;
ale_entries = <1024>;
bd_ram_size = <0x2000>;
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
syscon = <&cm>;
cpsw-phy-sel = <&phy_sel>;
cpsw_emac0: slave@0 {
phy_id = <&davinci_mdio>, <0>;
phy-mode = "rgmii-txid";
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
phys = <&phy_gmii_sel 1 0>;
};
cpsw_emac1: slave@1 {
phy_id = <&davinci_mdio>, <1>;
phy-mode = "rgmii-txid";
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
phys = <&phy_gmii_sel 2 0>;
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
TI SoC CPSW 필수 속성
1-27`compatible`은 이전 버전 호환용 `ti,cpsw`, AM335x controller용 `ti,am335x-cpsw`, AM437x용 `ti,am4372-cpsw`, DRA7x용 `ti,dra7-cpsw` 중 하나입니다.
`reg`는 CPSW register map의 physical base address와 크기이고 `interrupts`는 interrupt number입니다. `cpdma_channels`는 CPDMA channel 수, `ale_entries`는 ALE가 담을 수 있는 entry 수, `bd_ram_size`는 internal descriptor RAM 크기입니다.
`mac_control`은 플랫폼별 default MAC control register 내용입니다. `slaves`는 slave 수, `active_slave`는 time stamping, ethtool과 `SIOCGMIIPHY`에 사용할 slave를 지정합니다.
`cpsw-phy-sel`은 CPSW PHY mode selection device의 phandle이며 binding은 `cpsw-phy-sel.txt`를 참조합니다. Legacy 환경에서는 phandle 대신 child device일 수 있지만 이 방식은 deprecated이며 `phys` 속성을 사용해야 합니다.
선택 속성과 slave node
28-61선택 `ti,hwmods`는 `cpgmac0`이어야 합니다. `dual_emac`은 switch를 Dual EMAC으로 동작시키고 `syscon`은 AM33x control module인 system control device node의 phandle입니다.
`mode-gpios`는 선택 mux를 거쳐 CPSW data line과 PHY data line을 연결하려고 하나 이상의 GPIO를 구동해야 할 때 추가합니다. 예를 들어 DRA72x EVM에서는 CPSW slave 0와 PHY line을 연결하도록 PCF GPIO를 LOW로 구동해야 합니다.
`cpts_clock_mult`는 input clock tick을 nanosecond로 바꾸는 numerator이고 `cpts_clock_shift`는 denominator입니다. 둘 다 없으면 CPTS `rftclk` frequency를 바탕으로 mult와 shift를 계산합니다.
Slave 필수 속성 `phy-mode`는 같은 디렉터리의 `ethernet.txt`를, `phys`는 `phy/ti-phy-gmii-sel.txt`의 `phy-gmii-sel` PHY phandle을 참조합니다.
Slave 선택 `dual_emac_res_vlan`은 port 분리에 사용할 VID입니다. `phy_id`는 slave PHY ID를 지정하는 deprecated 속성이므로 `phy-handle`을 사용하며, `phy-handle`의 정의와 선택적인 MAC address 결정 방법은 `ethernet.txt`를 참조합니다.
Slave sub-node `fixed-link`는 같은 디렉터리의 `fixed-link.txt`를 참조합니다. `phy_id`, `phy-handle`, `fixed-link` 중 정확히 하나만 지정해야 합니다.
각 slave는 세 PHY 연결 방식 중 정확히 하나를 선택합니다.
TI hwmod 이관 메모
62-68`ti,hwmods` field는 device 등록 중 TI OMAP hwmod database에서 base address와 IRQ resource를 가져오는 데 사용합니다. 향후에는 hwmod database 내용을 Device Tree blob으로 옮겨 필요한 모든 데이터를 DTS 파일에서 사용하도록 할 계획입니다.
CPSW 두 등록 방식 예제
69-132첫 예제는 `reg`와 `interrupts`를 직접 제공하고 두 번째는 `ti,hwmods = "cpgmac0"`에서 resource를 가져옵니다. 둘 다 CPDMA channel 8개, ALE entry 1024개, descriptor RAM `0x2000`, RX descriptor 64개와 slave 두 개를 구성합니다.
두 slave는 각각 MDIO PHY 0과 1, `rgmii-txid` mode, U-Boot가 채울 MAC address, GMII selector PHY 1과 2를 사용합니다. CPTS 변환에는 multiplier `0x80000000`과 shift 29를 지정합니다.
mac: ethernet@4a100000 {
compatible = "ti,cpsw";
reg = <0x4A100000 0x1000>;
interrupts = <55 0x4>;
interrupt-parent = <&intc>;
cpdma_channels = <8>;
ale_entries = <1024>;
bd_ram_size = <0x2000>;
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
syscon = <&cm>;
cpsw-phy-sel = <&phy_sel>;
cpsw_emac0: slave@0 {
phy_id = <&davinci_mdio>, <0>;
phy-mode = "rgmii-txid";
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
phys = <&phy_gmii_sel 1 0>;
};
cpsw_emac1: slave@1 {
phy_id = <&davinci_mdio>, <1>;
phy-mode = "rgmii-txid";
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
phys = <&phy_gmii_sel 2 0>;
};
};
(or)
mac: ethernet@4a100000 {
compatible = "ti,cpsw";
ti,hwmods = "cpgmac0";
cpdma_channels = <8>;
ale_entries = <1024>;
bd_ram_size = <0x2000>;
rx_descs = <64>;
mac_control = <0x20>;
slaves = <2>;
active_slave = <0>;
cpts_clock_mult = <0x80000000>;
cpts_clock_shift = <29>;
syscon = <&cm>;
cpsw-phy-sel = <&phy_sel>;
cpsw_emac0: slave@0 {
phy_id = <&davinci_mdio>, <0>;
phy-mode = "rgmii-txid";
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
phys = <&phy_gmii_sel 1 0>;
};
cpsw_emac1: slave@1 {
phy_id = <&davinci_mdio>, <1>;
phy-mode = "rgmii-txid";
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
phys = <&phy_gmii_sel 2 0>;
};
};
요약과 해설
cpsw.txt:1-132직접 resource 등록과 OMAP hwmod 등록 방식, slave별 세 PHY 연결 방식의 제약을 해설합니다.