1*0725058aSWyon Bi /* SPDX-License-Identifier: GPL-2.0 */ 2*0725058aSWyon Bi /* 3*0725058aSWyon Bi * Copyright (C) 2018 Cadence Design Systems Inc. 4*0725058aSWyon Bi */ 5*0725058aSWyon Bi 6*0725058aSWyon Bi #ifndef __PHY_MIPI_DPHY_H_ 7*0725058aSWyon Bi #define __PHY_MIPI_DPHY_H_ 8*0725058aSWyon Bi 9*0725058aSWyon Bi /** 10*0725058aSWyon Bi * struct phy_configure_opts_mipi_dphy - MIPI D-PHY configuration set 11*0725058aSWyon Bi * 12*0725058aSWyon Bi * This structure is used to represent the configuration state of a 13*0725058aSWyon Bi * MIPI D-PHY phy. 14*0725058aSWyon Bi */ 15*0725058aSWyon Bi struct phy_configure_opts_mipi_dphy { 16*0725058aSWyon Bi /** 17*0725058aSWyon Bi * @clk_miss: 18*0725058aSWyon Bi * 19*0725058aSWyon Bi * Timeout, in picoseconds, for receiver to detect absence of 20*0725058aSWyon Bi * Clock transitions and disable the Clock Lane HS-RX. 21*0725058aSWyon Bi * 22*0725058aSWyon Bi * Maximum value: 60000 ps 23*0725058aSWyon Bi */ 24*0725058aSWyon Bi unsigned int clk_miss; 25*0725058aSWyon Bi 26*0725058aSWyon Bi /** 27*0725058aSWyon Bi * @clk_post: 28*0725058aSWyon Bi * 29*0725058aSWyon Bi * Time, in picoseconds, that the transmitter continues to 30*0725058aSWyon Bi * send HS clock after the last associated Data Lane has 31*0725058aSWyon Bi * transitioned to LP Mode. Interval is defined as the period 32*0725058aSWyon Bi * from the end of @hs_trail to the beginning of @clk_trail. 33*0725058aSWyon Bi * 34*0725058aSWyon Bi * Minimum value: 60000 ps + 52 * @hs_clk_rate period in ps 35*0725058aSWyon Bi */ 36*0725058aSWyon Bi unsigned int clk_post; 37*0725058aSWyon Bi 38*0725058aSWyon Bi /** 39*0725058aSWyon Bi * @clk_pre: 40*0725058aSWyon Bi * 41*0725058aSWyon Bi * Time, in UI, that the HS clock shall be driven by 42*0725058aSWyon Bi * the transmitter prior to any associated Data Lane beginning 43*0725058aSWyon Bi * the transition from LP to HS mode. 44*0725058aSWyon Bi * 45*0725058aSWyon Bi * Minimum value: 8 UI 46*0725058aSWyon Bi */ 47*0725058aSWyon Bi unsigned int clk_pre; 48*0725058aSWyon Bi 49*0725058aSWyon Bi /** 50*0725058aSWyon Bi * @clk_prepare: 51*0725058aSWyon Bi * 52*0725058aSWyon Bi * Time, in picoseconds, that the transmitter drives the Clock 53*0725058aSWyon Bi * Lane LP-00 Line state immediately before the HS-0 Line 54*0725058aSWyon Bi * state starting the HS transmission. 55*0725058aSWyon Bi * 56*0725058aSWyon Bi * Minimum value: 38000 ps 57*0725058aSWyon Bi * Maximum value: 95000 ps 58*0725058aSWyon Bi */ 59*0725058aSWyon Bi unsigned int clk_prepare; 60*0725058aSWyon Bi 61*0725058aSWyon Bi /** 62*0725058aSWyon Bi * @clk_settle: 63*0725058aSWyon Bi * 64*0725058aSWyon Bi * Time interval, in picoseconds, during which the HS receiver 65*0725058aSWyon Bi * should ignore any Clock Lane HS transitions, starting from 66*0725058aSWyon Bi * the beginning of @clk_prepare. 67*0725058aSWyon Bi * 68*0725058aSWyon Bi * Minimum value: 95000 ps 69*0725058aSWyon Bi * Maximum value: 300000 ps 70*0725058aSWyon Bi */ 71*0725058aSWyon Bi unsigned int clk_settle; 72*0725058aSWyon Bi 73*0725058aSWyon Bi /** 74*0725058aSWyon Bi * @clk_term_en: 75*0725058aSWyon Bi * 76*0725058aSWyon Bi * Time, in picoseconds, for the Clock Lane receiver to enable 77*0725058aSWyon Bi * the HS line termination. 78*0725058aSWyon Bi * 79*0725058aSWyon Bi * Maximum value: 38000 ps 80*0725058aSWyon Bi */ 81*0725058aSWyon Bi unsigned int clk_term_en; 82*0725058aSWyon Bi 83*0725058aSWyon Bi /** 84*0725058aSWyon Bi * @clk_trail: 85*0725058aSWyon Bi * 86*0725058aSWyon Bi * Time, in picoseconds, that the transmitter drives the HS-0 87*0725058aSWyon Bi * state after the last payload clock bit of a HS transmission 88*0725058aSWyon Bi * burst. 89*0725058aSWyon Bi * 90*0725058aSWyon Bi * Minimum value: 60000 ps 91*0725058aSWyon Bi */ 92*0725058aSWyon Bi unsigned int clk_trail; 93*0725058aSWyon Bi 94*0725058aSWyon Bi /** 95*0725058aSWyon Bi * @clk_zero: 96*0725058aSWyon Bi * 97*0725058aSWyon Bi * Time, in picoseconds, that the transmitter drives the HS-0 98*0725058aSWyon Bi * state prior to starting the Clock. 99*0725058aSWyon Bi */ 100*0725058aSWyon Bi unsigned int clk_zero; 101*0725058aSWyon Bi 102*0725058aSWyon Bi /** 103*0725058aSWyon Bi * @d_term_en: 104*0725058aSWyon Bi * 105*0725058aSWyon Bi * Time, in picoseconds, for the Data Lane receiver to enable 106*0725058aSWyon Bi * the HS line termination. 107*0725058aSWyon Bi * 108*0725058aSWyon Bi * Maximum value: 35000 ps + 4 * @hs_clk_rate period in ps 109*0725058aSWyon Bi */ 110*0725058aSWyon Bi unsigned int d_term_en; 111*0725058aSWyon Bi 112*0725058aSWyon Bi /** 113*0725058aSWyon Bi * @eot: 114*0725058aSWyon Bi * 115*0725058aSWyon Bi * Transmitted time interval, in picoseconds, from the start 116*0725058aSWyon Bi * of @hs_trail or @clk_trail, to the start of the LP- 11 117*0725058aSWyon Bi * state following a HS burst. 118*0725058aSWyon Bi * 119*0725058aSWyon Bi * Maximum value: 105000 ps + 12 * @hs_clk_rate period in ps 120*0725058aSWyon Bi */ 121*0725058aSWyon Bi unsigned int eot; 122*0725058aSWyon Bi 123*0725058aSWyon Bi /** 124*0725058aSWyon Bi * @hs_exit: 125*0725058aSWyon Bi * 126*0725058aSWyon Bi * Time, in picoseconds, that the transmitter drives LP-11 127*0725058aSWyon Bi * following a HS burst. 128*0725058aSWyon Bi * 129*0725058aSWyon Bi * Minimum value: 100000 ps 130*0725058aSWyon Bi */ 131*0725058aSWyon Bi unsigned int hs_exit; 132*0725058aSWyon Bi 133*0725058aSWyon Bi /** 134*0725058aSWyon Bi * @hs_prepare: 135*0725058aSWyon Bi * 136*0725058aSWyon Bi * Time, in picoseconds, that the transmitter drives the Data 137*0725058aSWyon Bi * Lane LP-00 Line state immediately before the HS-0 Line 138*0725058aSWyon Bi * state starting the HS transmission. 139*0725058aSWyon Bi * 140*0725058aSWyon Bi * Minimum value: 40000 ps + 4 * @hs_clk_rate period in ps 141*0725058aSWyon Bi * Maximum value: 85000 ps + 6 * @hs_clk_rate period in ps 142*0725058aSWyon Bi */ 143*0725058aSWyon Bi unsigned int hs_prepare; 144*0725058aSWyon Bi 145*0725058aSWyon Bi /** 146*0725058aSWyon Bi * @hs_settle: 147*0725058aSWyon Bi * 148*0725058aSWyon Bi * Time interval, in picoseconds, during which the HS receiver 149*0725058aSWyon Bi * shall ignore any Data Lane HS transitions, starting from 150*0725058aSWyon Bi * the beginning of @hs_prepare. 151*0725058aSWyon Bi * 152*0725058aSWyon Bi * Minimum value: 85000 ps + 6 * @hs_clk_rate period in ps 153*0725058aSWyon Bi * Maximum value: 145000 ps + 10 * @hs_clk_rate period in ps 154*0725058aSWyon Bi */ 155*0725058aSWyon Bi unsigned int hs_settle; 156*0725058aSWyon Bi 157*0725058aSWyon Bi /** 158*0725058aSWyon Bi * @hs_skip: 159*0725058aSWyon Bi * 160*0725058aSWyon Bi * Time interval, in picoseconds, during which the HS-RX 161*0725058aSWyon Bi * should ignore any transitions on the Data Lane, following a 162*0725058aSWyon Bi * HS burst. The end point of the interval is defined as the 163*0725058aSWyon Bi * beginning of the LP-11 state following the HS burst. 164*0725058aSWyon Bi * 165*0725058aSWyon Bi * Minimum value: 40000 ps 166*0725058aSWyon Bi * Maximum value: 55000 ps + 4 * @hs_clk_rate period in ps 167*0725058aSWyon Bi */ 168*0725058aSWyon Bi unsigned int hs_skip; 169*0725058aSWyon Bi 170*0725058aSWyon Bi /** 171*0725058aSWyon Bi * @hs_trail: 172*0725058aSWyon Bi * 173*0725058aSWyon Bi * Time, in picoseconds, that the transmitter drives the 174*0725058aSWyon Bi * flipped differential state after last payload data bit of a 175*0725058aSWyon Bi * HS transmission burst 176*0725058aSWyon Bi * 177*0725058aSWyon Bi * Minimum value: max(8 * @hs_clk_rate period in ps, 178*0725058aSWyon Bi * 60000 ps + 4 * @hs_clk_rate period in ps) 179*0725058aSWyon Bi */ 180*0725058aSWyon Bi unsigned int hs_trail; 181*0725058aSWyon Bi 182*0725058aSWyon Bi /** 183*0725058aSWyon Bi * @hs_zero: 184*0725058aSWyon Bi * 185*0725058aSWyon Bi * Time, in picoseconds, that the transmitter drives the HS-0 186*0725058aSWyon Bi * state prior to transmitting the Sync sequence. 187*0725058aSWyon Bi */ 188*0725058aSWyon Bi unsigned int hs_zero; 189*0725058aSWyon Bi 190*0725058aSWyon Bi /** 191*0725058aSWyon Bi * @init: 192*0725058aSWyon Bi * 193*0725058aSWyon Bi * Time, in picoseconds for the initialization period to 194*0725058aSWyon Bi * complete. 195*0725058aSWyon Bi * 196*0725058aSWyon Bi * Minimum value: 100000000 ps 197*0725058aSWyon Bi */ 198*0725058aSWyon Bi unsigned int init; 199*0725058aSWyon Bi 200*0725058aSWyon Bi /** 201*0725058aSWyon Bi * @lpx: 202*0725058aSWyon Bi * 203*0725058aSWyon Bi * Transmitted length, in picoseconds, of any Low-Power state 204*0725058aSWyon Bi * period. 205*0725058aSWyon Bi * 206*0725058aSWyon Bi * Minimum value: 50000 ps 207*0725058aSWyon Bi */ 208*0725058aSWyon Bi unsigned int lpx; 209*0725058aSWyon Bi 210*0725058aSWyon Bi /** 211*0725058aSWyon Bi * @ta_get: 212*0725058aSWyon Bi * 213*0725058aSWyon Bi * Time, in picoseconds, that the new transmitter drives the 214*0725058aSWyon Bi * Bridge state (LP-00) after accepting control during a Link 215*0725058aSWyon Bi * Turnaround. 216*0725058aSWyon Bi * 217*0725058aSWyon Bi * Value: 5 * @lpx 218*0725058aSWyon Bi */ 219*0725058aSWyon Bi unsigned int ta_get; 220*0725058aSWyon Bi 221*0725058aSWyon Bi /** 222*0725058aSWyon Bi * @ta_go: 223*0725058aSWyon Bi * 224*0725058aSWyon Bi * Time, in picoseconds, that the transmitter drives the 225*0725058aSWyon Bi * Bridge state (LP-00) before releasing control during a Link 226*0725058aSWyon Bi * Turnaround. 227*0725058aSWyon Bi * 228*0725058aSWyon Bi * Value: 4 * @lpx 229*0725058aSWyon Bi */ 230*0725058aSWyon Bi unsigned int ta_go; 231*0725058aSWyon Bi 232*0725058aSWyon Bi /** 233*0725058aSWyon Bi * @ta_sure: 234*0725058aSWyon Bi * 235*0725058aSWyon Bi * Time, in picoseconds, that the new transmitter waits after 236*0725058aSWyon Bi * the LP-10 state before transmitting the Bridge state 237*0725058aSWyon Bi * (LP-00) during a Link Turnaround. 238*0725058aSWyon Bi * 239*0725058aSWyon Bi * Minimum value: @lpx 240*0725058aSWyon Bi * Maximum value: 2 * @lpx 241*0725058aSWyon Bi */ 242*0725058aSWyon Bi unsigned int ta_sure; 243*0725058aSWyon Bi 244*0725058aSWyon Bi /** 245*0725058aSWyon Bi * @wakeup: 246*0725058aSWyon Bi * 247*0725058aSWyon Bi * Time, in picoseconds, that a transmitter drives a Mark-1 248*0725058aSWyon Bi * state prior to a Stop state in order to initiate an exit 249*0725058aSWyon Bi * from ULPS. 250*0725058aSWyon Bi * 251*0725058aSWyon Bi * Minimum value: 1000000000 ps 252*0725058aSWyon Bi */ 253*0725058aSWyon Bi unsigned int wakeup; 254*0725058aSWyon Bi 255*0725058aSWyon Bi /** 256*0725058aSWyon Bi * @hs_clk_rate: 257*0725058aSWyon Bi * 258*0725058aSWyon Bi * Clock rate, in Hertz, of the high-speed clock. 259*0725058aSWyon Bi */ 260*0725058aSWyon Bi unsigned long hs_clk_rate; 261*0725058aSWyon Bi 262*0725058aSWyon Bi /** 263*0725058aSWyon Bi * @lp_clk_rate: 264*0725058aSWyon Bi * 265*0725058aSWyon Bi * Clock rate, in Hertz, of the low-power clock. 266*0725058aSWyon Bi */ 267*0725058aSWyon Bi unsigned long lp_clk_rate; 268*0725058aSWyon Bi 269*0725058aSWyon Bi /** 270*0725058aSWyon Bi * @lanes: 271*0725058aSWyon Bi * 272*0725058aSWyon Bi * Number of active data lanes used for the transmissions. 273*0725058aSWyon Bi */ 274*0725058aSWyon Bi unsigned char lanes; 275*0725058aSWyon Bi }; 276*0725058aSWyon Bi 277*0725058aSWyon Bi #endif /* __PHY_MIPI_DPHY_H_ */ 278