<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="en-TW" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<div id="mail-editor-reference-message-container">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"> On 6/7/23 23:21, Billy Tsai wrote:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > > The code says:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > > In Aspeed AST2600 SoC features 16 TACH controllers, with each<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > > controller capable of supporting up to 1 input.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > > which is a bit different. I guess there are no examples anymore,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > > but I'd really like to see how this looks like in the devicetree file,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > > and how the driver is supposed to distinguish/select the 16 inputs.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > Hi Roeck,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > The node in the devicetree file will looks like following:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > tach0: tach0@1e610008 {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > compatible = "aspeed,ast2600-tach";<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > reg = <0x1e610008 0x8>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > #address-cells = <1>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > #size-cells = <0>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > pinctrl-names = "default";<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > pinctrl-0 = <&pinctrl_tach0_default>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > clocks = <&syscon ASPEED_CLK_AHB>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > resets = <&syscon ASPEED_RESET_PWM>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > status = "disabled";<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > };<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > > <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > Neither reg nor pinctrl is mentioned in the bindings. Maybe that is not needed nowadays,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > but I find it confusing.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > Either case, it is highly unusual that there would be 16 instances of this device<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> > instead of one. Why is this done ? It doesn't really make sense to me.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Having 16 instances of PWM and Tach is more compatible with our hardware design.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">This is because our register layout for PWM and Tach is not continuous.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">PWM0 used 0x0 0x4, Tach0 used 0x8 0xc<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">PWM1 used 0x10 0x14, Tach1 used 0x18 0x1c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Each PWM/Tach instance has its own controller register and is not dependent on others.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Best Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Billy Tsai<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>