229 lines · plain
1Micrel KSZ9021/KSZ9031/KSZ9131 Gigabit Ethernet PHY2 3Some boards require special tuning values, particularly when it comes4to clock delays. You can specify clock delay values in the PHY OF5device node. Deprecated, but still supported, these properties can6also be added to an Ethernet OF device node.7 8Note that these settings are applied after any phy-specific fixup from9phy_fixup_list (see phy_init_hw() from drivers/net/phy/phy_device.c),10and therefore may overwrite them.11 12KSZ9021:13 14 All skew control options are specified in picoseconds. The minimum15 value is 0, the maximum value is 3000, and it can be specified in 200ps16 steps, *but* these values are in not fact what you get because this chip's17 skew values actually increase in 120ps steps, starting from -840ps. The18 incorrect values came from an error in the original KSZ9021 datasheet19 before it was corrected in revision 1.2 (Feb 2014), but it is too late to20 change the driver now because of the many existing device trees that have21 been created using values that go up in increments of 200.22 23 The following table shows the actual skew delay you will get for each of the24 possible devicetree values, and the number that will be programmed into the25 corresponding pad skew register:26 27 Device Tree Value Delay Pad Skew Register Value28 -----------------------------------------------------29 0 -840ps 000030 200 -720ps 000131 400 -600ps 001032 600 -480ps 001133 800 -360ps 010034 1000 -240ps 010135 1200 -120ps 011036 1400 0ps 011137 1600 120ps 100038 1800 240ps 100139 2000 360ps 101040 2200 480ps 101141 2400 600ps 110042 2600 720ps 110143 2800 840ps 111044 3000 960ps 111145 46 Optional properties:47 48 - rxc-skew-ps : Skew control of RXC pad49 - rxdv-skew-ps : Skew control of RX CTL pad50 - txc-skew-ps : Skew control of TXC pad51 - txen-skew-ps : Skew control of TX CTL pad52 - rxd0-skew-ps : Skew control of RX data 0 pad53 - rxd1-skew-ps : Skew control of RX data 1 pad54 - rxd2-skew-ps : Skew control of RX data 2 pad55 - rxd3-skew-ps : Skew control of RX data 3 pad56 - txd0-skew-ps : Skew control of TX data 0 pad57 - txd1-skew-ps : Skew control of TX data 1 pad58 - txd2-skew-ps : Skew control of TX data 2 pad59 - txd3-skew-ps : Skew control of TX data 3 pad60 61KSZ9031:62 63 All skew control options are specified in picoseconds. The minimum64 value is 0, and the maximum is property-dependent. The increment65 step is 60ps. The default value is the neutral setting, so setting66 rxc-skew-ps=<0> actually results in -900 picoseconds adjustment.67 68 The KSZ9031 hardware supports a range of skew values from negative to69 positive, where the specific range is property dependent. All values70 specified in the devicetree are offset by the minimum value so they71 can be represented as positive integers in the devicetree since it's72 difficult to represent a negative number in the devictree.73 74 The following 5-bit values table apply to rxc-skew-ps and txc-skew-ps.75 76 Pad Skew Value Delay (ps) Devicetree Value77 ------------------------------------------------------78 0_0000 -900ps 079 0_0001 -840ps 6080 0_0010 -780ps 12081 0_0011 -720ps 18082 0_0100 -660ps 24083 0_0101 -600ps 30084 0_0110 -540ps 36085 0_0111 -480ps 42086 0_1000 -420ps 48087 0_1001 -360ps 54088 0_1010 -300ps 60089 0_1011 -240ps 66090 0_1100 -180ps 72091 0_1101 -120ps 78092 0_1110 -60ps 84093 0_1111 0ps 90094 1_0000 60ps 96095 1_0001 120ps 102096 1_0010 180ps 108097 1_0011 240ps 114098 1_0100 300ps 120099 1_0101 360ps 1260100 1_0110 420ps 1320101 1_0111 480ps 1380102 1_1000 540ps 1440103 1_1001 600ps 1500104 1_1010 660ps 1560105 1_1011 720ps 1620106 1_1100 780ps 1680107 1_1101 840ps 1740108 1_1110 900ps 1800109 1_1111 960ps 1860110 111 The following 4-bit values table apply to the txdX-skew-ps, rxdX-skew-ps112 data pads, and the rxdv-skew-ps, txen-skew-ps control pads.113 114 Pad Skew Value Delay (ps) Devicetree Value115 ------------------------------------------------------116 0000 -420ps 0117 0001 -360ps 60118 0010 -300ps 120119 0011 -240ps 180120 0100 -180ps 240121 0101 -120ps 300122 0110 -60ps 360123 0111 0ps 420124 1000 60ps 480125 1001 120ps 540126 1010 180ps 600127 1011 240ps 660128 1100 300ps 720129 1101 360ps 780130 1110 420ps 840131 1111 480ps 900132 133 Optional properties:134 135 Maximum value of 1860, default value 900:136 137 - rxc-skew-ps : Skew control of RX clock pad138 - txc-skew-ps : Skew control of TX clock pad139 140 Maximum value of 900, default value 420:141 142 - rxdv-skew-ps : Skew control of RX CTL pad143 - txen-skew-ps : Skew control of TX CTL pad144 - rxd0-skew-ps : Skew control of RX data 0 pad145 - rxd1-skew-ps : Skew control of RX data 1 pad146 - rxd2-skew-ps : Skew control of RX data 2 pad147 - rxd3-skew-ps : Skew control of RX data 3 pad148 - txd0-skew-ps : Skew control of TX data 0 pad149 - txd1-skew-ps : Skew control of TX data 1 pad150 - txd2-skew-ps : Skew control of TX data 2 pad151 - txd3-skew-ps : Skew control of TX data 3 pad152 153 - micrel,force-master:154 Boolean, force phy to master mode. Only set this option if the phy155 reference clock provided at CLK125_NDO pin is used as MAC reference156 clock because the clock jitter in slave mode is to high (errata#2).157 Attention: The link partner must be configurable as slave otherwise158 no link will be established.159 160KSZ9131:161LAN8841:162 163 All skew control options are specified in picoseconds. The increment164 step is 100ps. Unlike KSZ9031, the values represent picoseccond delays.165 A negative value can be assigned as rxc-skew-psec = <(-100)>;.166 167 Optional properties:168 169 Range of the value -700 to 2400, default value 0:170 171 - rxc-skew-psec : Skew control of RX clock pad172 - txc-skew-psec : Skew control of TX clock pad173 174 Range of the value -700 to 800, default value 0:175 176 - rxdv-skew-psec : Skew control of RX CTL pad177 - txen-skew-psec : Skew control of TX CTL pad178 - rxd0-skew-psec : Skew control of RX data 0 pad179 - rxd1-skew-psec : Skew control of RX data 1 pad180 - rxd2-skew-psec : Skew control of RX data 2 pad181 - rxd3-skew-psec : Skew control of RX data 3 pad182 - txd0-skew-psec : Skew control of TX data 0 pad183 - txd1-skew-psec : Skew control of TX data 1 pad184 - txd2-skew-psec : Skew control of TX data 2 pad185 - txd3-skew-psec : Skew control of TX data 3 pad186 187Examples:188 189 /* Attach to an Ethernet device with autodetected PHY */190 &enet {191 rxc-skew-ps = <1800>;192 rxdv-skew-ps = <0>;193 txc-skew-ps = <1800>;194 txen-skew-ps = <0>;195 status = "okay";196 };197 198 /* Attach to an explicitly-specified PHY */199 mdio {200 phy0: ethernet-phy@0 {201 rxc-skew-ps = <1800>;202 rxdv-skew-ps = <0>;203 txc-skew-ps = <1800>;204 txen-skew-ps = <0>;205 reg = <0>;206 };207 };208 ethernet@70000 {209 phy = <&phy0>;210 phy-mode = "rgmii-id";211 };212 213References214 215 Micrel ksz9021rl/rn Data Sheet, Revision 1.2. Dated 2/13/2014.216 http://www.micrel.com/_PDF/Ethernet/datasheets/ksz9021rl-rn_ds.pdf217 218 Micrel ksz9031rnx Data Sheet, Revision 2.1. Dated 11/20/2014.219 http://www.micrel.com/_PDF/Ethernet/datasheets/KSZ9031RNX.pdf220 221Notes:222 223 Note that a previous version of the Micrel ksz9021rl/rn Data Sheet224 was missing extended register 106 (transmit data pad skews), and225 incorrectly specified the ps per step as 200ps/step instead of226 120ps/step. The latest update to this document reflects the latest227 revision of the Micrel specification even though usage in the kernel228 still reflects that incorrect document.229