162306a36Sopenharmony_ciASPEED AST2400/AST2500 PWM and Fan Tacho controller device driver 262306a36Sopenharmony_ci 362306a36Sopenharmony_ciThe ASPEED PWM controller can support upto 8 PWM outputs. The ASPEED Fan Tacho 462306a36Sopenharmony_cicontroller can support upto 16 Fan tachometer inputs. 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciThere can be upto 8 fans supported. Each fan can have one PWM output and 762306a36Sopenharmony_cione/two Fan tach inputs. 862306a36Sopenharmony_ci 962306a36Sopenharmony_ciRequired properties for pwm-tacho node: 1062306a36Sopenharmony_ci- #address-cells : should be 1. 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci- #size-cells : should be 1. 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci- #cooling-cells: should be 2. 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci- reg : address and length of the register set for the device. 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci- pinctrl-names : a pinctrl state named "default" must be defined. 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci- pinctrl-0 : phandle referencing pin configuration of the PWM ports. 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci- compatible : should be "aspeed,ast2400-pwm-tacho" for AST2400 and 2362306a36Sopenharmony_ci "aspeed,ast2500-pwm-tacho" for AST2500. 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci- clocks : phandle to clock provider with the clock number in the second cell 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci- resets : phandle to reset controller with the reset number in the second cell 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_cifan subnode format: 3062306a36Sopenharmony_ci=================== 3162306a36Sopenharmony_ciUnder fan subnode there can upto 8 child nodes, with each child node 3262306a36Sopenharmony_cirepresenting a fan. If there are 8 fans each fan can have one PWM port and 3362306a36Sopenharmony_cione/two Fan tach inputs. 3462306a36Sopenharmony_ciFor PWM port can be configured cooling-levels to create cooling device. 3562306a36Sopenharmony_ciCooling device could be bound to a thermal zone for the thermal control. 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ciRequired properties for each child node: 3862306a36Sopenharmony_ci- reg : should specify PWM source port. 3962306a36Sopenharmony_ci integer value in the range 0 to 7 with 0 indicating PWM port A and 4062306a36Sopenharmony_ci 7 indicating PWM port H. 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci- cooling-levels: PWM duty cycle values in a range from 0 to 255 4362306a36Sopenharmony_ci which correspond to thermal cooling states. 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci- aspeed,fan-tach-ch : should specify the Fan tach input channel. 4662306a36Sopenharmony_ci integer value in the range 0 through 15, with 0 indicating 4762306a36Sopenharmony_ci Fan tach channel 0 and 15 indicating Fan tach channel 15. 4862306a36Sopenharmony_ci At least one Fan tach input channel is required. 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ciExamples: 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_cipwm_tacho: pwmtachocontroller@1e786000 { 5362306a36Sopenharmony_ci #address-cells = <1>; 5462306a36Sopenharmony_ci #size-cells = <1>; 5562306a36Sopenharmony_ci #cooling-cells = <2>; 5662306a36Sopenharmony_ci reg = <0x1E786000 0x1000>; 5762306a36Sopenharmony_ci compatible = "aspeed,ast2500-pwm-tacho"; 5862306a36Sopenharmony_ci clocks = <&syscon ASPEED_CLK_APB>; 5962306a36Sopenharmony_ci resets = <&syscon ASPEED_RESET_PWM>; 6062306a36Sopenharmony_ci pinctrl-names = "default"; 6162306a36Sopenharmony_ci pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>; 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ci fan@0 { 6462306a36Sopenharmony_ci reg = <0x00>; 6562306a36Sopenharmony_ci cooling-levels = /bits/ 8 <125 151 177 203 229 255>; 6662306a36Sopenharmony_ci aspeed,fan-tach-ch = /bits/ 8 <0x00>; 6762306a36Sopenharmony_ci }; 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci fan@1 { 7062306a36Sopenharmony_ci reg = <0x01>; 7162306a36Sopenharmony_ci aspeed,fan-tach-ch = /bits/ 8 <0x01 0x02>; 7262306a36Sopenharmony_ci }; 7362306a36Sopenharmony_ci}; 74