← Documents Documentation/devicetree/bindings/hwmon/npcm750-pwm-fan.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

Nuvoton NPCM PWM and Fan Tacho

NPCM7XX/8XX PWM output, fan tach와 cooling child 바인딩입니다.

Source pathDocumentation/devicetree/bindings/hwmon/npcm750-pwm-fan.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

npcm750-pwm-fan.txt:1-88

PWM/Fan 자원과 fan별 tach channel 예제를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 Nuvoton NPCM PWM and Fan Tacho controller device
2
3 The Nuvoton BMC NPCM7XX supports 8 Pulse-width modulation (PWM)
4 controller outputs and 16 Fan tachometer controller inputs.
5
6 The Nuvoton BMC NPCM8XX supports 12 Pulse-width modulation (PWM)
7 controller outputs and 16 Fan tachometer controller inputs.
8
9 Required properties for pwm-fan node
10 - #address-cells : should be 1.
11 - #size-cells : should be 0.
12 - compatible : "nuvoton,npcm750-pwm-fan" for Poleg NPCM7XX.
13 : "nuvoton,npcm845-pwm-fan" for Arbel NPCM8XX.
14 - reg : specifies physical base address and size of the registers.
15 - reg-names : must contain:
16 * "pwm" for the PWM registers.
17 * "fan" for the Fan registers.
18 - clocks : phandle of reference clocks.
19 - clock-names : must contain
20 * "pwm" for PWM controller operating clock.
21 * "fan" for Fan controller operating clock.
22 - interrupts : contain the Fan interrupts with flags for falling edge.
23 - pinctrl-names : a pinctrl state named "default" must be defined.
24 - pinctrl-0 : phandle referencing pin configuration of the PWM and Fan
25 controller ports.
26
27 fan subnode format:
28 ===================
29 Under fan subnode can be upto 8 child nodes, each child node representing a fan.
30 Each fan subnode must have one PWM channel and at least one Fan tach channel.
31
32 For PWM channel can be configured cooling-levels to create cooling device.
33 Cooling device could be bound to a thermal zone for the thermal control.
34
35 Required properties for each child node:
36 - reg : specify the PWM output channel.
37 integer value in the range 0 through 7, that represent
38 the PWM channel number that used.
39
40 - fan-tach-ch : specify the Fan tach input channel.
41 integer value in the range 0 through 15, that represent
42 the fan tach channel number that used.
43
44 At least one Fan tach input channel is required
45
46 Optional property for each child node:
47 - cooling-levels: PWM duty cycle values in a range from 0 to 255
48 which correspond to thermal cooling states.
49
50 Examples:
51
52 pwm_fan:pwm-fan-controller@103000 {
53 #address-cells = <1>;
54 #size-cells = <0>;
55 compatible = "nuvoton,npcm750-pwm-fan";
56 reg = <0x103000 0x2000>,
57 <0x180000 0x8000>;
58 reg-names = "pwm", "fan";
59 clocks = <&clk NPCM7XX_CLK_APB3>,
60 <&clk NPCM7XX_CLK_APB4>;
61 clock-names = "pwm","fan";
62 interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
63 <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
64 <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
65 <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
66 <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
67 <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
68 <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
69 <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
70 pinctrl-names = "default";
71 pinctrl-0 = <&pwm0_pins &pwm1_pins &pwm2_pins
72 &fanin0_pins &fanin1_pins &fanin2_pins
73 &fanin3_pins &fanin4_pins>;
74 fan@0 {
75 reg = <0x00>;
76 fan-tach-ch = /bits/ 8 <0x00 0x01>;
77 cooling-levels = <127 255>;
78 };
79 fan@1 {
80 reg = <0x01>;
81 fan-tach-ch = /bits/ 8 <0x02 0x03>;
82 };
83 fan@2 {
84 reg = <0x02>;
85 fan-tach-ch = /bits/ 8 <0x04>;
86 };
87
88 };
89

3. 한국어 전문 번역

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

Nuvoton NPCM PWM/Fan controller

1-26

Nuvoton BMC NPCM7XX는 PWM output 8개와 fan tachometer input 16개를, NPCM8XX는 PWM output 12개와 fan tachometer input 16개를 지원합니다.

Controller node의 `#address-cells`는 1, `#size-cells`는 0입니다. `compatible`은 Poleg NPCM7XX에서 `nuvoton,npcm750-pwm-fan`, Arbel NPCM8XX에서 `nuvoton,npcm845-pwm-fan`입니다. `reg`는 register의 physical base와 size이며 `reg-names`에는 PWM register용 `pwm`, fan register용 `fan`을 넣습니다.

`clocks`는 reference clock phandle이고 `clock-names`에는 PWM controller operating clock용 `pwm`, fan controller operating clock용 `fan`을 넣습니다. `interrupts`는 falling-edge flag를 가진 fan interrupt입니다. `pinctrl-names`에는 `default` state가 필요하고 `pinctrl-0`은 PWM/Fan port pin configuration을 참조합니다.

NPCM PWM/Fan resource split
PWM registers + clock8 또는 12 output
Fan child regPWM channel 0..7
Fan tach registers + clock16 tach inputs
Fan interruptsTach event handling

별도 PWM/Fan register와 clock이 fan child의 drive 및 tach feedback을 제공하는 구조입니다.

NPCM fan child node

27-49

Fan subnode 아래에 fan child를 최대 8개 둘 수 있습니다. 각 fan은 PWM channel 하나와 fan tach channel 적어도 하나를 가져야 합니다. `cooling-levels`를 설정하면 cooling device를 만들어 thermal zone에 bind할 수 있습니다.

각 child의 필수 `reg`는 사용할 PWM output channel 0~7입니다. `fan-tach-ch`는 fan tach input channel 0~15이며 적어도 하나가 필요합니다. 선택 `cooling-levels`는 thermal cooling state에 대응하는 0~255 PWM duty cycle 값입니다.

NPCM750 PWM/Fan 예제

50-88

예제 NPCM750 controller는 PWM/Fan register, APB3/APB4 clock, GIC SPI 96~103과 PWM/fan pinctrl을 사용합니다. Fan0은 PWM0과 tach0/1, cooling level 127/255, fan1은 PWM1과 tach2/3, fan2는 PWM2와 tach4를 사용합니다.

pwm_fan:pwm-fan-controller@103000 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "nuvoton,npcm750-pwm-fan";
        reg = <0x103000 0x2000>,
                <0x180000 0x8000>;
        reg-names = "pwm", "fan";
        clocks = <&clk NPCM7XX_CLK_APB3>,
                <&clk NPCM7XX_CLK_APB4>;
        clock-names = "pwm","fan";
        interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
                        <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&pwm0_pins &pwm1_pins &pwm2_pins
                        &fanin0_pins &fanin1_pins &fanin2_pins
                        &fanin3_pins &fanin4_pins>;
        fan@0 {
                reg = <0x00>;
                fan-tach-ch = /bits/ 8 <0x00 0x01>;
                cooling-levels = <127 255>;
        };
        fan@1 {
                reg = <0x01>;
                fan-tach-ch = /bits/ 8 <0x02 0x03>;
        };
        fan@2 {
                reg = <0x02>;
                fan-tach-ch = /bits/ 8 <0x04>;
        };

};