1*32002227SRobert Mustacchi.\" 2*32002227SRobert Mustacchi.\" This file and its contents are supplied under the terms of the 3*32002227SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0. 4*32002227SRobert Mustacchi.\" You may only use this file in accordance with the terms of version 5*32002227SRobert Mustacchi.\" 1.0 of the CDDL. 6*32002227SRobert Mustacchi.\" 7*32002227SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this 8*32002227SRobert Mustacchi.\" source. A copy of the CDDL is also available via the Internet at 9*32002227SRobert Mustacchi.\" http://www.illumos.org/license/CDDL. 10*32002227SRobert Mustacchi.\" 11*32002227SRobert Mustacchi.\" 12*32002227SRobert Mustacchi.\" Copyright 2025 Oxide Computer Company 13*32002227SRobert Mustacchi.\" 14*32002227SRobert Mustacchi.Dd October 4, 2025 15*32002227SRobert Mustacchi.Dt I2CADM 8 16*32002227SRobert Mustacchi.Os 17*32002227SRobert Mustacchi.Sh NAME 18*32002227SRobert Mustacchi.Nm i2cadm 19*32002227SRobert Mustacchi.Nd I2C administration 20*32002227SRobert Mustacchi.Sh SYNOPSIS 21*32002227SRobert Mustacchi.Nm 22*32002227SRobert Mustacchi.Cm controller 23*32002227SRobert Mustacchi.Cm list 24*32002227SRobert Mustacchi.Op Fl H 25*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 26*32002227SRobert Mustacchi.Op Ar filter Ns ... 27*32002227SRobert Mustacchi.Nm 28*32002227SRobert Mustacchi.Cm controller 29*32002227SRobert Mustacchi.Cm prop 30*32002227SRobert Mustacchi.Cm get 31*32002227SRobert Mustacchi.Op Fl H 32*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 33*32002227SRobert Mustacchi.Ar controller 34*32002227SRobert Mustacchi.Op Ar filter Ns ... 35*32002227SRobert Mustacchi.Nm 36*32002227SRobert Mustacchi.Cm controller 37*32002227SRobert Mustacchi.Cm prop 38*32002227SRobert Mustacchi.Cm set 39*32002227SRobert Mustacchi.Ar controller 40*32002227SRobert Mustacchi.Ar property Ns = Ns Ar value 41*32002227SRobert Mustacchi.Nm 42*32002227SRobert Mustacchi.Cm device 43*32002227SRobert Mustacchi.Cm list 44*32002227SRobert Mustacchi.Op Fl H 45*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 46*32002227SRobert Mustacchi.Op Ar filter Ns ... 47*32002227SRobert Mustacchi.Nm 48*32002227SRobert Mustacchi.Cm device 49*32002227SRobert Mustacchi.Cm addrs 50*32002227SRobert Mustacchi.Op Fl H 51*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 52*32002227SRobert Mustacchi.Op Ar filter Ns ... 53*32002227SRobert Mustacchi.Nm 54*32002227SRobert Mustacchi.Cm device 55*32002227SRobert Mustacchi.Cm add 56*32002227SRobert Mustacchi.Op Fl c Ar compat 57*32002227SRobert Mustacchi.Ar port 58*32002227SRobert Mustacchi.Ar name 59*32002227SRobert Mustacchi.Ar address 60*32002227SRobert Mustacchi.Nm 61*32002227SRobert Mustacchi.Cm device 62*32002227SRobert Mustacchi.Cm remove 63*32002227SRobert Mustacchi.Ar path 64*32002227SRobert Mustacchi.Nm 65*32002227SRobert Mustacchi.Cm mux 66*32002227SRobert Mustacchi.Cm list 67*32002227SRobert Mustacchi.Op Fl H 68*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 69*32002227SRobert Mustacchi.Op Ar filter Ns ... 70*32002227SRobert Mustacchi.Nm 71*32002227SRobert Mustacchi.Cm port 72*32002227SRobert Mustacchi.Cm list 73*32002227SRobert Mustacchi.Op Fl H 74*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 75*32002227SRobert Mustacchi.Op Ar filter Ns ... 76*32002227SRobert Mustacchi.Nm 77*32002227SRobert Mustacchi.Cm port 78*32002227SRobert Mustacchi.Cm map 79*32002227SRobert Mustacchi.Op Fl H 80*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 81*32002227SRobert Mustacchi.Ar port 82*32002227SRobert Mustacchi.Nm 83*32002227SRobert Mustacchi.Cm io 84*32002227SRobert Mustacchi.Op Fl m Ar mode 85*32002227SRobert Mustacchi.Fl d Ar destination 86*32002227SRobert Mustacchi.Op Fl a Ar address 87*32002227SRobert Mustacchi.Op Fl c Ar command 88*32002227SRobert Mustacchi.Op Fl w Ar wlen 89*32002227SRobert Mustacchi.Op Fl r Ar rlen 90*32002227SRobert Mustacchi.Op Fl o Ar output 91*32002227SRobert Mustacchi.Ar data 92*32002227SRobert Mustacchi.Nm 93*32002227SRobert Mustacchi.Cm scan 94*32002227SRobert Mustacchi.Op Fl d Ar device 95*32002227SRobert Mustacchi.Op Fl H 96*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 97*32002227SRobert Mustacchi.Ar port 98*32002227SRobert Mustacchi.Sh DESCRIPTION 99*32002227SRobert MustacchiThe 100*32002227SRobert Mustacchi.Nm 101*32002227SRobert Mustacchiutility is used to enumerate and manipulate I2C and SMBus controllers, 102*32002227SRobert Mustacchidevices, ports, and multiplexors. 103*32002227SRobert Mustacchi.Pp 104*32002227SRobert MustacchiThere are four top-level objects in 105*32002227SRobert Mustacchi.Nm ; 106*32002227SRobert Mustacchi.Bl -tag -width Ds 107*32002227SRobert Mustacchi.It Controllers 108*32002227SRobert MustacchiThese are hardware device that can perform I2C or SMBus operations that 109*32002227SRobert Mustacchitarget devices on the bus. 110*32002227SRobert Mustacchi.Nm 111*32002227SRobert Mustacchiprovides the ability to list them as well as get and set properties on 112*32002227SRobert Mustacchispecific controllers. 113*32002227SRobert Mustacchi.It Devices 114*32002227SRobert MustacchiDevice represent targets on the I2C bus which provide some functionality 115*32002227SRobert Mustacchiat a given address. 116*32002227SRobert MustacchiDevices run the gamut including functions like EEPROMs, sensors, GPIO 117*32002227SRobert Mustacchicontrollers, voltage regulators, and more. 118*32002227SRobert MustacchiMany devices will have a corresponding device driver that provides 119*32002227SRobert Mustacchifunctionality through a standard system mechanism, but there is no 120*32002227SRobert Mustacchirequirement for a driver. 121*32002227SRobert Mustacchi.It Ports 122*32002227SRobert MustacchiA port is a logical point on an I2C bus under which one or more devices 123*32002227SRobert Mustacchican be found. 124*32002227SRobert MustacchiI2C ports are found directly under controllers and multiplexors. 125*32002227SRobert MustacchiI2C ports under a controller represent the start of a unique I2C bus and 126*32002227SRobert Mustacchiaddresses that are used are specific to that bus. 127*32002227SRobert Mustacchi.Nm 128*32002227SRobert Mustacchiprovides the ability to list ports and print information about the 129*32002227SRobert Mustacchiaddresses that are in use on the port directly or downstream of it. 130*32002227SRobert Mustacchi.It Multiplexors 131*32002227SRobert MustacchiMultiplexors provide a means of isolating segments of an I2C bus from 132*32002227SRobert Mustacchione another, which is generally used to avoid overlapping I2C addresses. 133*32002227SRobert MustacchiA multiplexor provides a fixed number of ports and the system will 134*32002227SRobert Mustacchitransparently activate and deactivate ports based on I/O requests and 135*32002227SRobert Mustacchitheir targets. 136*32002227SRobert MustacchiAt most one port will ever be active on a multiplexor at any given time. 137*32002227SRobert Mustacchi.Nm 138*32002227SRobert Mustacchiprovides the ability to discover and list multiplexors. 139*32002227SRobert Mustacchi.El 140*32002227SRobert Mustacchi.Pp 141*32002227SRobert MustacchiAll listing operations leverage the standard illumos output format 142*32002227SRobert Mustacchilibrary 143*32002227SRobert Mustacchi.Po 144*32002227SRobert Mustacchi.Xr ofmt 3OFMT 145*32002227SRobert Mustacchi.Pc 146*32002227SRobert Mustacchiallowing the selection of specific output fields, the omission of the 147*32002227SRobert Mustacchiheader 148*32002227SRobert Mustacchi.Pq Fl H , 149*32002227SRobert Mustacchiand a parsable mode intended for programmatic consumption 150*32002227SRobert Mustacchi.Pq Fl p . 151*32002227SRobert MustacchiWhen requesting parsable output, the colon 152*32002227SRobert Mustacchi.Po 153*32002227SRobert Mustacchi.Do 154*32002227SRobert Mustacchi: 155*32002227SRobert Mustacchi.Dc 156*32002227SRobert Mustacchi.Pc 157*32002227SRobert Mustacchicharacter is used as a delimiter between fields and any delimiters that 158*32002227SRobert Mustacchiwould appear in an output field will be escaped with a backslash 159*32002227SRobert Mustacchicharacter 160*32002227SRobert Mustacchi.Po 161*32002227SRobert Mustacchi.Do 162*32002227SRobert Mustacchi\e 163*32002227SRobert Mustacchi.Dc 164*32002227SRobert Mustacchi.Pc . 165*32002227SRobert Mustacchi.Pp 166*32002227SRobert MustacchiGetting information about I2C devices, controllers, ports, and muxes 167*32002227SRobert Mustacchirequires that a process have the 168*32002227SRobert Mustacchi.Brq Dv PRIV_SYS_DEVICES 169*32002227SRobert Mustacchiprivilege. 170*32002227SRobert Mustacchi.Ss I2C Paths 171*32002227SRobert MustacchiAll of the different entities that can be found on an I2C bus are 172*32002227SRobert Mustacchidescribed through a path that indicates the route through the bus to get 173*32002227SRobert Mustacchito an entity. 174*32002227SRobert MustacchiConsider the following I2C devices: 175*32002227SRobert Mustacchi.Bd -literal 176*32002227SRobert Mustacchi 177*32002227SRobert Mustacchi 178*32002227SRobert Mustacchi +------------+ 179*32002227SRobert Mustacchi | dwi2c4 | 180*32002227SRobert Mustacchi | 1 port | 181*32002227SRobert Mustacchi | controller | 182*32002227SRobert Mustacchi +------------+ +------+ 183*32002227SRobert Mustacchi | | lm75 | 184*32002227SRobert Mustacchi +---------->| 0x48 | 185*32002227SRobert Mustacchi | +------+ 186*32002227SRobert Mustacchi v 187*32002227SRobert Mustacchi +------------+ 188*32002227SRobert Mustacchi | pca9548 | 189*32002227SRobert Mustacchi | 0x72 | 190*32002227SRobert Mustacchi | 8 port mux | 191*32002227SRobert Mustacchi +------------+ 192*32002227SRobert Mustacchi | 193*32002227SRobert Mustacchi * ... port 0, 1-7 not pictured 194*32002227SRobert Mustacchi | 195*32002227SRobert Mustacchi v 196*32002227SRobert Mustacchi +------------+ 197*32002227SRobert Mustacchi | pca9545 | 198*32002227SRobert Mustacchi | 0x72 | 199*32002227SRobert Mustacchi | 4 port mux | 200*32002227SRobert Mustacchi +------------+ 201*32002227SRobert Mustacchi | 202*32002227SRobert Mustacchi * ... port 2, 0-1,3 not pictured 203*32002227SRobert Mustacchi | 204*32002227SRobert Mustacchi v 205*32002227SRobert Mustacchi +---------+ 206*32002227SRobert Mustacchi | at24c02 | 207*32002227SRobert Mustacchi | 0x57 | 208*32002227SRobert Mustacchi | EEPROM | 209*32002227SRobert Mustacchi +---------+ 210*32002227SRobert Mustacchi.Ed 211*32002227SRobert Mustacchi.Pp 212*32002227SRobert MustacchiThe following are what different paths refer to for this: 213*32002227SRobert Mustacchi.Bl -tag -width Pa 214*32002227SRobert Mustacchi.It Pa dwi2c4 215*32002227SRobert MustacchiThis refers to the controller itself. 216*32002227SRobert Mustacchi.It Pa dwi2c4/0 217*32002227SRobert MustacchiThis refers to the primary port under a controller. 218*32002227SRobert MustacchiThis could be used for performing device scans, I/O, or manually adding 219*32002227SRobert Mustacchior removing devices. 220*32002227SRobert Mustacchi.It Pa dwi2c4/0/0x48 221*32002227SRobert MustacchiThis refers to the LM75 temperature sensor that is directly attached to 222*32002227SRobert Mustacchithe controller's port. 223*32002227SRobert Mustacchi.It Pa dwi2c4/0/0x72 224*32002227SRobert MustacchiThis string refers to the 8-port mux directly under the controller's 225*32002227SRobert Mustacchiport. 226*32002227SRobert Mustacchi.It Pa dwi2c4/0/0x72/0/0x70/2/0x57 227*32002227SRobert MustacchiThis is a complex string that refers to the AT24C02 EEPROM. 228*32002227SRobert MustacchiAlong the way are all of the devices and ports that are used to get to 229*32002227SRobert Mustacchiit. 230*32002227SRobert MustacchiA more verbose form of this path would be 231*32002227SRobert Mustacchi.Pa dwi2c4/0/pca9548@0x72/0/pca9545@0x70/2/at24c02@0x57 . 232*32002227SRobert Mustacchi.El 233*32002227SRobert Mustacchi.Pp 234*32002227SRobert MustacchiWhen constructing paths, controllers are always referred to by their 235*32002227SRobert Mustacchiname and instance. 236*32002227SRobert MustacchiPorts are always referred to by their name, which is usually a number 237*32002227SRobert Mustacchibased upon the datasheet. 238*32002227SRobert MustacchiDevices can be referred to in three ways at their point in the tree. 239*32002227SRobert MustacchiUsing the first mux as an example: 240*32002227SRobert Mustacchi.Bl -enum 241*32002227SRobert Mustacchi.It 242*32002227SRobert MustacchiUsing the device's primary I2C address: 243*32002227SRobert Mustacchi.Ql 0x72 . 244*32002227SRobert Mustacchi.It 245*32002227SRobert MustacchiUsing the device's name and primary address: 246*32002227SRobert Mustacchi.Ql pca9548@0x72 . 247*32002227SRobert Mustacchi.It 248*32002227SRobert MustacchiUsing the device's driver name and instance: 249*32002227SRobert Mustacchi.Ql pca9454x0 . 250*32002227SRobert Mustacchi.El 251*32002227SRobert Mustacchi.Sh SUBCOMMANDS 252*32002227SRobert MustacchiThe following commands are supported by 253*32002227SRobert Mustacchi.Nm : 254*32002227SRobert Mustacchi.Bl -tag -width "" 255*32002227SRobert Mustacchi.It Xo 256*32002227SRobert Mustacchi.Nm 257*32002227SRobert Mustacchi.Cm controller 258*32002227SRobert Mustacchi.Cm list 259*32002227SRobert Mustacchi.Op Fl H 260*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 261*32002227SRobert Mustacchi.Op Ar filter Ns ... 262*32002227SRobert Mustacchi.Xc 263*32002227SRobert MustacchiList all of the I2C controllers in the system and provide basic 264*32002227SRobert Mustacchiinformation about them. 265*32002227SRobert Mustacchi.Pp 266*32002227SRobert MustacchiThe following fields are supported: 267*32002227SRobert Mustacchi.Bl -tag -width PROVIDER 268*32002227SRobert Mustacchi.It Sy NAME 269*32002227SRobert MustacchiThis is the name of the I2C controller in the system. 270*32002227SRobert MustacchiAll I2C paths will start with a controller name. 271*32002227SRobert Mustacchi.It Sy TYPE 272*32002227SRobert MustacchiThis is the primary type of the controller, but is not indicative of all 273*32002227SRobert MustacchiI/O that they can perform. 274*32002227SRobert MustacchiAn SMBus controller may support directly performing I2C. 275*32002227SRobert MustacchiThe valid controller types are: 276*32002227SRobert Mustacchi.Bl -tag -width smbus 277*32002227SRobert Mustacchi.It i2c 278*32002227SRobert MustacchiAn I2C controller. 279*32002227SRobert Mustacchi.It i3c 280*32002227SRobert MustacchiAn I3C controller. 281*32002227SRobert Mustacchi.It smbus 282*32002227SRobert MustacchiAn SMBus controller. 283*32002227SRobert Mustacchi.El 284*32002227SRobert Mustacchi.It Sy SPEED 285*32002227SRobert MustacchiA string that describe the speed that the bus is operating at, along 286*32002227SRobert Mustacchiwith some of the physical capabilities. 287*32002227SRobert MustacchiThe valid speed values are: 288*32002227SRobert Mustacchi.Bl -tag -width fast-plus 289*32002227SRobert Mustacchi.It standard 290*32002227SRobert MustacchiStandard speed operates the bus at 100 kHz. 291*32002227SRobert Mustacchi.It fast 292*32002227SRobert MustacchiFast speed operates the bus at 400 kHz. 293*32002227SRobert Mustacchi.It fast-plus 294*32002227SRobert MustacchiFast-plus speed operates the bus at 1 MHz. 295*32002227SRobert Mustacchi.It high 296*32002227SRobert MustacchiHigh-speed operate the bus at 3.4 MHz. 297*32002227SRobert Mustacchi.It ultra 298*32002227SRobert MustacchiUltra-fast speed operate the bus at 5 MHz. 299*32002227SRobert Mustacchi.El 300*32002227SRobert Mustacchi.It Sy NPORTS 301*32002227SRobert MustacchiThe number of ports that are under the controller. 302*32002227SRobert Mustacchi.It Sy DRIVER 303*32002227SRobert MustacchiThe name of the driver for the controller. 304*32002227SRobert Mustacchi.It Sy INSTANCE 305*32002227SRobert MustacchiThe name of the device driver instance for the controller. 306*32002227SRobert Mustacchi.It Sy PROVIDER 307*32002227SRobert MustacchiThe 308*32002227SRobert Mustacchi.Pa /devices 309*32002227SRobert Mustacchipath to the kernel provider for this controller. 310*32002227SRobert Mustacchi.El 311*32002227SRobert Mustacchi.Pp 312*32002227SRobert MustacchiThe following options are supported: 313*32002227SRobert Mustacchi.Bl -tag -width Fl 314*32002227SRobert Mustacchi.It Fl H 315*32002227SRobert MustacchiOmit the column header when printing output. 316*32002227SRobert Mustacchi.It Fl o Ar field Ns [,...] 317*32002227SRobert MustacchiA comma-delineated list of fields to output, selected from the ones 318*32002227SRobert Mustacchiabove. 319*32002227SRobert Mustacchi.It Fl p 320*32002227SRobert MustacchiDisplays the output in a machine-parsable format. 321*32002227SRobert MustacchiWhen requesting parsable output, the 322*32002227SRobert Mustacchi.Fl o 323*32002227SRobert Mustacchioption is required to specifically control which fields are included. 324*32002227SRobert Mustacchi.El 325*32002227SRobert Mustacchi.Pp 326*32002227SRobert MustacchiThe following operands are supported: 327*32002227SRobert Mustacchi.Bl -tag -width Ar 328*32002227SRobert Mustacchi.It Ar filter 329*32002227SRobert MustacchiOne or more filters may be specified which are used to constrain the 330*32002227SRobert Mustacchilist of controllers that are printed. 331*32002227SRobert MustacchiEach 332*32002227SRobert Mustacchi.Ar filter 333*32002227SRobert Mustacchimay either match the name of a controller or driver. 334*32002227SRobert Mustacchi.Pp 335*32002227SRobert MustacchiIf any filter is specified and does not match, then that is treated as 336*32002227SRobert Mustacchian error. 337*32002227SRobert Mustacchi.Pp 338*32002227SRobert MustacchiBecause these are filters, they do not control the order that items are 339*32002227SRobert Mustacchiprinted out, only what is printed out. 340*32002227SRobert Mustacchi.El 341*32002227SRobert Mustacchi.It Xo 342*32002227SRobert Mustacchi.Nm 343*32002227SRobert Mustacchi.Cm controller 344*32002227SRobert Mustacchi.Cm prop 345*32002227SRobert Mustacchi.Cm get 346*32002227SRobert Mustacchi.Op Fl H 347*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 348*32002227SRobert Mustacchi.Ar controller 349*32002227SRobert Mustacchi.Op Ar filter Ns ... 350*32002227SRobert Mustacchi.Xc 351*32002227SRobert MustacchiList all properties, their values, and corresponding metadata on the 352*32002227SRobert Mustacchispecific controller 353*32002227SRobert Mustacchi.Ar controller . 354*32002227SRobert Mustacchi.Pp 355*32002227SRobert MustacchiThe following fields are supported: 356*32002227SRobert Mustacchi.Bl -tag -width PROPERTY 357*32002227SRobert Mustacchi.It Sy PROPERTY 358*32002227SRobert MustacchiThe name of the property. 359*32002227SRobert Mustacchi.It Sy PERM 360*32002227SRobert MustacchiIndicates whether the property is readable or both readable and 361*32002227SRobert Mustacchiwritable. 362*32002227SRobert Mustacchi.It Sy VALUE 363*32002227SRobert MustacchiThe current value of the property. 364*32002227SRobert Mustacchi.It Sy DEFAULT 365*32002227SRobert MustacchiThe default value for the property on the specific instance of the 366*32002227SRobert Mustacchicontroller. 367*32002227SRobert MustacchiThis is the value the system will start with assuming no tuning has been 368*32002227SRobert Mustacchiperformed. 369*32002227SRobert MustacchiSome properties may not have a default value. 370*32002227SRobert Mustacchi.It Sy POSSIBLE 371*32002227SRobert MustacchiA list of possible values that the property might take. 372*32002227SRobert MustacchiThis may be a series of numeric ranges or a list of specific values. 373*32002227SRobert MustacchiSome properties may not have a set of possible values. 374*32002227SRobert Mustacchi.It Sy TYPE 375*32002227SRobert MustacchiIndicates the type of the property. 376*32002227SRobert MustacchiThe system has the following I2C property types: 377*32002227SRobert Mustacchi.Bl -tag -width bit32 378*32002227SRobert Mustacchi.It Sy u32 379*32002227SRobert MustacchiIndicates that the property is a 32-bit unsigned value. 380*32002227SRobert Mustacchi.It Sy bit32 381*32002227SRobert MustacchiIndicates that the property is a 32-bit unsigned bitfield. 382*32002227SRobert MustacchiThe presence or absence of each bit indicates a specific feature or 383*32002227SRobert Mustacchiproperty. 384*32002227SRobert Mustacchi.El 385*32002227SRobert Mustacchi.It Sy CONTROLLER 386*32002227SRobert MustacchiThe name of the controller the property is being retrieved from. 387*32002227SRobert Mustacchi.It Sy ID 388*32002227SRobert MustacchiThe system's numeric identifier for the property. 389*32002227SRobert Mustacchi.El 390*32002227SRobert Mustacchi.Pp 391*32002227SRobert MustacchiThe following options are supported: 392*32002227SRobert Mustacchi.Bl -tag -width Fl 393*32002227SRobert Mustacchi.It Fl H 394*32002227SRobert MustacchiOmit the column header when printing output. 395*32002227SRobert Mustacchi.It Fl o Ar field Ns [,...] 396*32002227SRobert MustacchiA comma-delineated list of fields to output, selected from the ones 397*32002227SRobert Mustacchiabove. 398*32002227SRobert Mustacchi.It Fl p 399*32002227SRobert MustacchiDisplays the output in a machine-parsable format. 400*32002227SRobert MustacchiWhen requesting parsable output, the 401*32002227SRobert Mustacchi.Fl o 402*32002227SRobert Mustacchioption is required to specifically control which fields are included. 403*32002227SRobert Mustacchi.El 404*32002227SRobert MustacchiThe following operands are supported: 405*32002227SRobert Mustacchi.Bl -tag -width Ar 406*32002227SRobert Mustacchi.It Ar filter 407*32002227SRobert MustacchiOne or more filters may be specified which are used to constrain the 408*32002227SRobert Mustacchilist of properties that are printed. 409*32002227SRobert MustacchiEach 410*32002227SRobert Mustacchi.Ar filter 411*32002227SRobert Mustacchimust match the name of a property. 412*32002227SRobert MustacchiFor a list of properties, see the 413*32002227SRobert Mustacchi.Sx PROPERTIES 414*32002227SRobert Mustacchisection. 415*32002227SRobert Mustacchi.Pp 416*32002227SRobert MustacchiIf any filter is specified and does not match, then that is treated as 417*32002227SRobert Mustacchian error. 418*32002227SRobert Mustacchi.Pp 419*32002227SRobert MustacchiBecause these are filters, they do not control the order that items are 420*32002227SRobert Mustacchiprinted out, only what is printed out. 421*32002227SRobert Mustacchi.El 422*32002227SRobert Mustacchi.It Xo 423*32002227SRobert Mustacchi.Nm 424*32002227SRobert Mustacchi.Cm controller 425*32002227SRobert Mustacchi.Cm prop 426*32002227SRobert Mustacchi.Cm set 427*32002227SRobert Mustacchi.Ar controller 428*32002227SRobert Mustacchi.Ar property Ns = Ns Ar value 429*32002227SRobert Mustacchi.Xc 430*32002227SRobert MustacchiSet the value of a single named 431*32002227SRobert Mustacchi.Ar property 432*32002227SRobert Mustacchion the controller, 433*32002227SRobert Mustacchi.Ar controller , 434*32002227SRobert Mustacchito the indicated 435*32002227SRobert Mustacchi.Ar value. 436*32002227SRobert Mustacchi.Ar value 437*32002227SRobert Mustacchiwill be parsed based upon the specific property and its type. 438*32002227SRobert MustacchiProperties which are translated into strings, can be specified as either 439*32002227SRobert Mustacchian integer value or the corresponding string. 440*32002227SRobert Mustacchi.Pp 441*32002227SRobert MustacchiTo see the list of properties on a controller use 442*32002227SRobert Mustacchi.Nm 443*32002227SRobert Mustacchi.Cm controller 444*32002227SRobert Mustacchi.Cm prop 445*32002227SRobert Mustacchi.Cm get . 446*32002227SRobert MustacchiFor a list of all properties, see the 447*32002227SRobert Mustacchi.Sx PROPERTIES 448*32002227SRobert Mustacchisection. 449*32002227SRobert Mustacchi.It Xo 450*32002227SRobert Mustacchi.Nm 451*32002227SRobert Mustacchi.Cm device 452*32002227SRobert Mustacchi.Cm list 453*32002227SRobert Mustacchi.Op Fl H 454*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 455*32002227SRobert Mustacchi.Op Ar filter Ns ... 456*32002227SRobert Mustacchi.Xc 457*32002227SRobert MustacchiLists basic information about all devices known to the system across all 458*32002227SRobert Mustacchicontrollers. 459*32002227SRobert MustacchiThese are devices that have been discovered through a platform-specific 460*32002227SRobert Mustacchimeans or explicitly added by an administrator through the 461*32002227SRobert Mustacchi.Nm 462*32002227SRobert Mustacchi.Cm device 463*32002227SRobert Mustacchi.Cm add 464*32002227SRobert Mustacchicommand. 465*32002227SRobert Mustacchi.Pp 466*32002227SRobert MustacchiThe following fields are supported: 467*32002227SRobert Mustacchi.Bl -tag -width INSTANCE 468*32002227SRobert Mustacchi.It Sy NAME 469*32002227SRobert MustacchiThe name of the device. 470*32002227SRobert MustacchiThis corresponds to the device tree's node name. 471*32002227SRobert Mustacchi.It Sy ADDR 472*32002227SRobert MustacchiThe primary I2C address that this device has. 473*32002227SRobert MustacchiThis corresponds to the device tree's reg[0] entry. 474*32002227SRobert Mustacchi.It Sy INSTANCE 475*32002227SRobert MustacchiThe driver instance of the device, if any. 476*32002227SRobert Mustacchi.It Sy PATH 477*32002227SRobert MustacchiThe I2C path of the device. 478*32002227SRobert Mustacchi.El 479*32002227SRobert Mustacchi.Pp 480*32002227SRobert MustacchiThe following options are supported: 481*32002227SRobert Mustacchi.Bl -tag -width Fl 482*32002227SRobert Mustacchi.It Fl H 483*32002227SRobert MustacchiOmit the column header when printing output. 484*32002227SRobert Mustacchi.It Fl o Ar field Ns [,...] 485*32002227SRobert MustacchiA comma-delineated list of fields to output, selected from the ones 486*32002227SRobert Mustacchiabove. 487*32002227SRobert Mustacchi.It Fl p 488*32002227SRobert MustacchiDisplays the output in a machine-parsable format. 489*32002227SRobert MustacchiWhen requesting parsable output, the 490*32002227SRobert Mustacchi.Fl o 491*32002227SRobert Mustacchioption is required to specifically control which fields are included. 492*32002227SRobert Mustacchi.El 493*32002227SRobert Mustacchi.Pp 494*32002227SRobert MustacchiThe following operands are supported: 495*32002227SRobert Mustacchi.Bl -tag -width Ar 496*32002227SRobert Mustacchi.It Ar filter 497*32002227SRobert MustacchiOne or more filters may be specified which are used to constrain the 498*32002227SRobert Mustacchilist of properties that are printed. 499*32002227SRobert MustacchiEach 500*32002227SRobert Mustacchi.Ar filter 501*32002227SRobert Mustacchimay match a device's primary address, a device name, a driver name, a 502*32002227SRobert Mustacchidriver instance, or a portion of the device's I2C path. 503*32002227SRobert Mustacchi.Pp 504*32002227SRobert MustacchiIf any filter is specified and does not match, then that is treated as 505*32002227SRobert Mustacchian error. 506*32002227SRobert Mustacchi.Pp 507*32002227SRobert MustacchiBecause these are filters, they do not control the order that items are 508*32002227SRobert Mustacchiprinted out, only what is printed out. 509*32002227SRobert Mustacchi.El 510*32002227SRobert Mustacchi.It Xo 511*32002227SRobert Mustacchi.Nm 512*32002227SRobert Mustacchi.Cm device 513*32002227SRobert Mustacchi.Cm addrs 514*32002227SRobert Mustacchi.Op Fl H 515*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 516*32002227SRobert Mustacchi.Op Ar filter Ns ... 517*32002227SRobert Mustacchi.Xc 518*32002227SRobert MustacchiPrint the I2C addresses and their sources for device's in the system. 519*32002227SRobert MustacchiA device's address may come from the platform or it may be an additional 520*32002227SRobert Mustacchiaddress that the driver itself claims and is either unique to that 521*32002227SRobert Mustacchidevice or shared amongst all instance of a particular driver. 522*32002227SRobert Mustacchi.Pp 523*32002227SRobert MustacchiThe following fields are supported: 524*32002227SRobert Mustacchi.Bl -tag -width SOURCE 525*32002227SRobert Mustacchi.It Sy PATH 526*32002227SRobert MustacchiThe I2C path of the device. 527*32002227SRobert Mustacchi.It Sy TYPE 528*32002227SRobert MustacchiThe type of the address. 529*32002227SRobert MustacchiThis is either 530*32002227SRobert Mustacchi.Sy 7-bit 531*32002227SRobert Mustacchior 532*32002227SRobert Mustacchi.Sy 10-bit . 533*32002227SRobert Mustacchi.It Sy ADDR 534*32002227SRobert MustacchiThe address in question on the device. 535*32002227SRobert Mustacchi.It Sy SOURCE 536*32002227SRobert MustacchiIndicates how the device was assigned the address. 537*32002227SRobert MustacchiOne of the following values: 538*32002227SRobert Mustacchi.Bl -tag -width platform 539*32002227SRobert Mustacchi.It Sy platform 540*32002227SRobert MustacchiThis address came from information provided by the platform. 541*32002227SRobert MustacchiThis includes firmware sources or addresses assigned as part of an 542*32002227SRobert Mustacchioperator calling 543*32002227SRobert Mustacchi.Nm 544*32002227SRobert Mustacchi.Cm device 545*32002227SRobert Mustacchi.Cm add . 546*32002227SRobert Mustacchi.It Sy claimed 547*32002227SRobert MustacchiThis addresses was claimed exclusively by the device driver. 548*32002227SRobert MustacchiFor example, several EEPROMs require multiple I2C addresses to cover 549*32002227SRobert Mustacchitheir entire memory map, but only the base address is often provided by 550*32002227SRobert Mustacchithe platform. 551*32002227SRobert Mustacchi.It Sy shared 552*32002227SRobert MustacchiThis address was claimed by a device driver and is permitted to be used 553*32002227SRobert Mustacchiacross all instances of the device driver. 554*32002227SRobert Mustacchi.El 555*32002227SRobert Mustacchi.El 556*32002227SRobert Mustacchi.Pp 557*32002227SRobert MustacchiThe following options are supported: 558*32002227SRobert Mustacchi.Bl -tag -width Fl 559*32002227SRobert Mustacchi.It Fl H 560*32002227SRobert MustacchiOmit the column header when printing output. 561*32002227SRobert Mustacchi.It Fl o Ar field Ns [,...] 562*32002227SRobert MustacchiA comma-delineated list of fields to output, selected from the ones 563*32002227SRobert Mustacchiabove. 564*32002227SRobert Mustacchi.It Fl p 565*32002227SRobert MustacchiDisplays the output in a machine-parsable format. 566*32002227SRobert MustacchiWhen requesting parsable output, the 567*32002227SRobert Mustacchi.Fl o 568*32002227SRobert Mustacchioption is required to specifically control which fields are included. 569*32002227SRobert Mustacchi.El 570*32002227SRobert MustacchiThe following operands are supported: 571*32002227SRobert Mustacchi.Bl -tag -width Ar 572*32002227SRobert Mustacchi.It Ar filter 573*32002227SRobert MustacchiOne or more filters may be specified which are used to constrain the 574*32002227SRobert Mustacchilist of properties that are printed. 575*32002227SRobert MustacchiEach 576*32002227SRobert Mustacchi.Ar filter 577*32002227SRobert Mustacchimay match a device's particular address, a device name, a driver name, a 578*32002227SRobert Mustacchidriver instance, or a portion of the device's I2C path. 579*32002227SRobert Mustacchi.Pp 580*32002227SRobert MustacchiIf any filter is specified and does not match, then that is treated as 581*32002227SRobert Mustacchian error. 582*32002227SRobert Mustacchi.Pp 583*32002227SRobert MustacchiBecause these are filters, they do not control the order that items are 584*32002227SRobert Mustacchiprinted out, only what is printed out. 585*32002227SRobert Mustacchi.El 586*32002227SRobert Mustacchi.It Xo 587*32002227SRobert Mustacchi.Nm 588*32002227SRobert Mustacchi.Cm device 589*32002227SRobert Mustacchi.Cm add 590*32002227SRobert Mustacchi.Op Fl c Ar compat 591*32002227SRobert Mustacchi.Ar port 592*32002227SRobert Mustacchi.Ar name 593*32002227SRobert Mustacchi.Ar address 594*32002227SRobert Mustacchi.Xc 595*32002227SRobert MustacchiAdd a new device to the system. 596*32002227SRobert MustacchiThe system will attempt to attach a driver to this device; however, even 597*32002227SRobert Mustacchiif there is no driver for the device, it can be created regardless. 598*32002227SRobert Mustacchi.Pp 599*32002227SRobert MustacchiThe following options are supported: 600*32002227SRobert Mustacchi.Bl -tag -width Fl 601*32002227SRobert Mustacchi.It Fl c Ar compat 602*32002227SRobert MustacchiAdd the specified compatibility entry 603*32002227SRobert Mustacchi.Ar compat 604*32002227SRobert Mustacchito the newly created device node's 605*32002227SRobert Mustacchi.Ql compatible 606*32002227SRobert Mustacchiproperty. 607*32002227SRobert MustacchiWhen the system considers device drivers to attach to an I2C device it 608*32002227SRobert Mustacchiwill search for matches against the device's 609*32002227SRobert Mustacchi.Ql compatible 610*32002227SRobert Mustacchiproperty and then attempt to match the device's name. 611*32002227SRobert Mustacchi.Pp 612*32002227SRobert MustacchiThis property may be specified multiple times in order to add multiple 613*32002227SRobert Mustacchientries. 614*32002227SRobert MustacchiThe order is meaningful and will reflect the order specified on the 615*32002227SRobert Mustacchicommand line. 616*32002227SRobert MustacchiThe matching algorithm walks the list in order and terminates on the 617*32002227SRobert Mustacchifirst found match. 618*32002227SRobert MustacchiMore specific entries should be specified first. 619*32002227SRobert Mustacchi.El 620*32002227SRobert Mustacchi.Pp 621*32002227SRobert MustacchiThe following operands are supported: 622*32002227SRobert Mustacchi.Bl -tag -width Ar 623*32002227SRobert Mustacchi.It Ar port 624*32002227SRobert MustacchiSpecifies the I2C path to the port that the device will be created 625*32002227SRobert Mustacchiunder. 626*32002227SRobert MustacchiThis may be either a port on a controller or a port under a multiplexor. 627*32002227SRobert MustacchiDevice's under a mux are allowed to have conflicting addresses with 628*32002227SRobert Mustacchidevices on other ports of a given mux. 629*32002227SRobert MustacchiThe mux will be implicitly activated when performing I/O to the device. 630*32002227SRobert Mustacchi.It Ar name 631*32002227SRobert MustacchiThe name of the new device. 632*32002227SRobert MustacchiThis generally should match something about the device itself such as 633*32002227SRobert Mustacchithe part number. 634*32002227SRobert Mustacchi.Pp 635*32002227SRobert MustacchiDevice name's may be at most 31 characters. 636*32002227SRobert MustacchiThe first character must be an upper or lower case letter. 637*32002227SRobert MustacchiThe remaining characters may be upper or lower case letters, numbers, or 638*32002227SRobert Mustacchione of the following punctuation characters: the comma 639*32002227SRobert Mustacchi.Pq Sq \&, , 640*32002227SRobert Mustacchithe period 641*32002227SRobert Mustacchi.Pq Sq \&. , 642*32002227SRobert Mustacchithe hyphen 643*32002227SRobert Mustacchi.Pq Sq - , 644*32002227SRobert Mustacchithe plus sign 645*32002227SRobert Mustacchi.Pq Sq + , 646*32002227SRobert Mustacchiand the underscore 647*32002227SRobert Mustacchi.Pq Sq _ . 648*32002227SRobert Mustacchi.It Ar address 649*32002227SRobert MustacchiThe address to assign to the device. 650*32002227SRobert MustacchiOnly 7-bit addresses are permitted. 651*32002227SRobert MustacchiThe string will be parsed according to the specified base. 652*32002227SRobert MustacchiIt is recommended to specify addresses in hexadecimal with the leading 653*32002227SRobert Mustacchi.Dq 0x . 654*32002227SRobert Mustacchi.El 655*32002227SRobert Mustacchi.It Xo 656*32002227SRobert Mustacchi.Nm 657*32002227SRobert Mustacchi.Cm device 658*32002227SRobert Mustacchi.Cm remove 659*32002227SRobert Mustacchi.Ar path 660*32002227SRobert Mustacchi.Xc 661*32002227SRobert MustacchiAttempts to remove the specified device indicated by the I2C path 662*32002227SRobert Mustacchi.Ar path . 663*32002227SRobert MustacchiThis may fail if the device is actively being used. 664*32002227SRobert Mustacchi.It Xo 665*32002227SRobert Mustacchi.Nm 666*32002227SRobert Mustacchi.Cm mux 667*32002227SRobert Mustacchi.Cm list 668*32002227SRobert Mustacchi.Op Fl H 669*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 670*32002227SRobert Mustacchi.Op Ar filter Ns ... 671*32002227SRobert Mustacchi.Xc 672*32002227SRobert MustacchiList all multiplexors known to the system. 673*32002227SRobert Mustacchi.Pp 674*32002227SRobert MustacchiThe following fields are supported: 675*32002227SRobert Mustacchi.Bl -tag -width INSTANCE 676*32002227SRobert Mustacchi.It Sy DEVICE 677*32002227SRobert MustacchiThe name of the I2C device that implements the multiplexor. 678*32002227SRobert Mustacchi.It Sy NPORTS 679*32002227SRobert MustacchiThe number of ports on the multiplexor. 680*32002227SRobert Mustacchi.It Sy NAME 681*32002227SRobert MustacchiThe name of the multiplexor itself. 682*32002227SRobert Mustacchi.It Sy INSTANCE 683*32002227SRobert MustacchiThe device driver instance that powers the multiplexor. 684*32002227SRobert Mustacchi.It Sy PATH 685*32002227SRobert MustacchiThe I2C path of the multiplexor. 686*32002227SRobert Mustacchi.El 687*32002227SRobert Mustacchi.Pp 688*32002227SRobert MustacchiThe following options are supported: 689*32002227SRobert Mustacchi.Bl -tag -width Fl 690*32002227SRobert Mustacchi.It Fl H 691*32002227SRobert MustacchiOmit the column header when printing output. 692*32002227SRobert Mustacchi.It Fl o Ar field Ns [,...] 693*32002227SRobert MustacchiA comma-delineated list of fields to output, selected from the ones 694*32002227SRobert Mustacchiabove. 695*32002227SRobert Mustacchi.It Fl p 696*32002227SRobert MustacchiDisplays the output in a machine-parsable format. 697*32002227SRobert MustacchiWhen requesting parsable output, the 698*32002227SRobert Mustacchi.Fl o 699*32002227SRobert Mustacchioption is required to specifically control which fields are included. 700*32002227SRobert Mustacchi.El 701*32002227SRobert Mustacchi.Pp 702*32002227SRobert MustacchiThe following operands are supported: 703*32002227SRobert Mustacchi.Bl -tag -width Ar 704*32002227SRobert Mustacchi.It Ar filter 705*32002227SRobert MustacchiOne or more filters may be specified which are used to constrain the 706*32002227SRobert Mustacchilist of multiplexors that are printed. 707*32002227SRobert MustacchiEach 708*32002227SRobert Mustacchi.Ar filter 709*32002227SRobert Mustacchimay either match the multiplexor name, its device's name, or its 710*32002227SRobert Mustacchidevice's driver. 711*32002227SRobert Mustacchi.Pp 712*32002227SRobert MustacchiIf any filter is specified and does not match, then that is treated as 713*32002227SRobert Mustacchian error. 714*32002227SRobert Mustacchi.Pp 715*32002227SRobert MustacchiBecause these are filters, they do not control the order that items are 716*32002227SRobert Mustacchiprinted out, only what is printed out. 717*32002227SRobert Mustacchi.El 718*32002227SRobert Mustacchi.It Xo 719*32002227SRobert Mustacchi.Nm 720*32002227SRobert Mustacchi.Cm port 721*32002227SRobert Mustacchi.Cm list 722*32002227SRobert Mustacchi.Op Fl H 723*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 724*32002227SRobert Mustacchi.Op Ar filter Ns ... 725*32002227SRobert Mustacchi.Xc 726*32002227SRobert MustacchiList all ports known to the system. 727*32002227SRobert Mustacchi.Pp 728*32002227SRobert MustacchiThe following fields are supported: 729*32002227SRobert Mustacchi.Bl -tag -width PORTNO 730*32002227SRobert Mustacchi.It Sy PATH 731*32002227SRobert MustacchiThe I2C path of the port. 732*32002227SRobert Mustacchi.It Sy TYPE 733*32002227SRobert MustacchiIndicates the type of port. 734*32002227SRobert MustacchiOne of the following values: 735*32002227SRobert Mustacchi.Bl -tag -width multiplexor 736*32002227SRobert Mustacchi.It Sy controller 737*32002227SRobert MustacchiThe port belongs to a controller. 738*32002227SRobert Mustacchi.It Sy multiplexor 739*32002227SRobert MustacchiThe port belongs to a mux. 740*32002227SRobert Mustacchi.El 741*32002227SRobert Mustacchi.It Sy NAME 742*32002227SRobert MustacchiThe name of the port. 743*32002227SRobert MustacchiPort names generally follow the datasheet and are either 0-based or 744*32002227SRobert Mustacchi1-based. 745*32002227SRobert Mustacchi.It Sy PORTNO 746*32002227SRobert MustacchiThe 0-based system assigned ID for this port. 747*32002227SRobert Mustacchi.It Sy NDEVS 748*32002227SRobert MustacchiThe number of devices that are directly under this port. 749*32002227SRobert MustacchiThis does not include devices that are under subsequent ports like a 750*32002227SRobert Mustacchimultiplexor. 751*32002227SRobert Mustacchi.It Sy TDEVS 752*32002227SRobert MustacchiThe total number of devices that are under this port, including all 753*32002227SRobert Mustacchimultiplexors. 754*32002227SRobert Mustacchi.El 755*32002227SRobert Mustacchi.Pp 756*32002227SRobert MustacchiThe following options are supported: 757*32002227SRobert Mustacchi.Bl -tag -width Fl 758*32002227SRobert Mustacchi.It Fl H 759*32002227SRobert MustacchiOmit the column header when printing output. 760*32002227SRobert Mustacchi.It Fl o Ar field Ns [,...] 761*32002227SRobert MustacchiA comma-delineated list of fields to output, selected from the ones 762*32002227SRobert Mustacchiabove. 763*32002227SRobert Mustacchi.It Fl p 764*32002227SRobert MustacchiDisplays the output in a machine-parsable format. 765*32002227SRobert MustacchiWhen requesting parsable output, the 766*32002227SRobert Mustacchi.Fl o 767*32002227SRobert Mustacchioption is required to specifically control which fields are included. 768*32002227SRobert Mustacchi.El 769*32002227SRobert Mustacchi.Pp 770*32002227SRobert MustacchiThe following operands are supported: 771*32002227SRobert Mustacchi.Bl -tag -width Ar 772*32002227SRobert Mustacchi.It Ar filter 773*32002227SRobert MustacchiOne or more filters may be specified which are used to constrain the 774*32002227SRobert Mustacchilist of ports that are printed. 775*32002227SRobert MustacchiEach 776*32002227SRobert Mustacchi.Ar filter 777*32002227SRobert Mustacchimay either match the port's name, its type, or its I2C path. 778*32002227SRobert Mustacchi.Pp 779*32002227SRobert MustacchiIf any filter is specified and does not match, then that is treated as 780*32002227SRobert Mustacchian error. 781*32002227SRobert Mustacchi.Pp 782*32002227SRobert MustacchiBecause these are filters, they do not control the order that items are 783*32002227SRobert Mustacchiprinted out, only what is printed out. 784*32002227SRobert Mustacchi.El 785*32002227SRobert Mustacchi.It Xo 786*32002227SRobert Mustacchi.Nm 787*32002227SRobert Mustacchi.Cm port 788*32002227SRobert Mustacchi.Cm map 789*32002227SRobert Mustacchi.Op Fl H 790*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 791*32002227SRobert Mustacchi.Ar port 792*32002227SRobert Mustacchi.Xc 793*32002227SRobert MustacchiPrints a map of how addresses are used directly under the specified port 794*32002227SRobert Mustacchi.Ar port 795*32002227SRobert Mustacchiby devices known to the system. 796*32002227SRobert MustacchiThis does not perform I/O to scan for addresses that could be used but 797*32002227SRobert Mustacchiare unknown to the system, instead use 798*32002227SRobert Mustacchi.Nm 799*32002227SRobert Mustacchi.Cm scan 800*32002227SRobert Mustacchifor that. 801*32002227SRobert MustacchiBy default, the command will output a human-oriented table organized 802*32002227SRobert Mustacchiinto rows with 16 columns each. 803*32002227SRobert MustacchiFor machine parsable stable, output use the 804*32002227SRobert Mustacchi.Fl p 805*32002227SRobert Mustacchiand 806*32002227SRobert Mustacchi.Fl o 807*32002227SRobert Mustacchioptions. 808*32002227SRobert Mustacchi.Pp 809*32002227SRobert MustacchiThe table will use the following characters to indicate specific cases: 810*32002227SRobert Mustacchi.Bl -tag -width Ds 811*32002227SRobert Mustacchi.It L 812*32002227SRobert MustacchiIndicates that the address corresponds to a device 813*32002227SRobert Mustacchithis port. 814*32002227SRobert Mustacchi.It v 815*32002227SRobert MustacchiIndicates that the address is used downstream of this port by a device 816*32002227SRobert Mustacchiunder a mux port. 817*32002227SRobert MustacchiThe address in question could not be assigned to another device because 818*32002227SRobert Mustacchiof this. 819*32002227SRobert Mustacchi.It S 820*32002227SRobert MustacchiIndicates that this address is being treated as a shared address across 821*32002227SRobert Mustacchimultiple instances of a device driver. 822*32002227SRobert MustacchiA list of shared addresses and the corresponding major numbers and 823*32002227SRobert Mustacchidrivers will be printed following the table. 824*32002227SRobert Mustacchi.It - 825*32002227SRobert MustacchiIndicates that this address is not in use. 826*32002227SRobert Mustacchi.It E 827*32002227SRobert MustacchiAn unexpected error occurred. 828*32002227SRobert Mustacchi.El 829*32002227SRobert Mustacchi.Pp 830*32002227SRobert MustacchiThe following fields are supported: 831*32002227SRobert Mustacchi.Bl -tag -width DRIVER 832*32002227SRobert Mustacchi.It Sy ADDR 833*32002227SRobert MustacchiThe I2C address in question. 834*32002227SRobert MustacchiThe address is printed in decimal. 835*32002227SRobert Mustacchi.It Sy COUNT 836*32002227SRobert MustacchiThe number of devices that are using this address in the port. 837*32002227SRobert Mustacchi.It Sy TYPE 838*32002227SRobert MustacchiThe type of address. 839*32002227SRobert MustacchiOne of the following values: 840*32002227SRobert Mustacchi.Bl -tag -width downstream 841*32002227SRobert Mustacchi.It Sy local 842*32002227SRobert MustacchiIndicates that this address is in use by a device directly on the port. 843*32002227SRobert Mustacchi.It Sy downstream 844*32002227SRobert MustacchiIndicates that this address is in use by a device downstream of the 845*32002227SRobert Mustacchiport. 846*32002227SRobert Mustacchi.It Sy shared 847*32002227SRobert MustacchiIndicates that the address is being actively shared by one or more 848*32002227SRobert Mustacchiinstances of a given device driver. 849*32002227SRobert Mustacchi.It Sy none 850*32002227SRobert MustacchiIndicates that this address is not in use. 851*32002227SRobert Mustacchi.It Sy error 852*32002227SRobert MustacchiIndicates that information about this addrses is not available because 853*32002227SRobert Mustacchian error occurred. 854*32002227SRobert Mustacchi.El 855*32002227SRobert Mustacchi.It Sy MAJOR 856*32002227SRobert MustacchiFor shared addresses, indicates the major number of the driver that is 857*32002227SRobert Mustacchisharing the address. 858*32002227SRobert Mustacchi.It Sy DRIVER 859*32002227SRobert MustacchiFor shared addresses, indicates the name of the device driver that is 860*32002227SRobert Mustacchisharing the address. 861*32002227SRobert Mustacchi.El 862*32002227SRobert Mustacchi.Pp 863*32002227SRobert MustacchiThe following options are supported: 864*32002227SRobert Mustacchi.Bl -tag -width Fl 865*32002227SRobert Mustacchi.It Fl H 866*32002227SRobert MustacchiOmit the column header when printing output. 867*32002227SRobert Mustacchi.It Fl o Ar field Ns [,...] 868*32002227SRobert MustacchiA comma-delineated list of fields to output, selected from the ones 869*32002227SRobert Mustacchiabove. 870*32002227SRobert Mustacchi.It Fl p 871*32002227SRobert MustacchiDisplays the output in a machine-parsable format. 872*32002227SRobert MustacchiWhen requesting parsable output, the 873*32002227SRobert Mustacchi.Fl o 874*32002227SRobert Mustacchioption is required to specifically control which fields are included. 875*32002227SRobert Mustacchi.El 876*32002227SRobert Mustacchi.Pp 877*32002227SRobert MustacchiThe following operands are required: 878*32002227SRobert Mustacchi.Bl -tag -width Ar 879*32002227SRobert Mustacchi.It Ar port 880*32002227SRobert MustacchiThe I2C path of the port to print information about. 881*32002227SRobert Mustacchi.El 882*32002227SRobert Mustacchi.It Xo 883*32002227SRobert Mustacchi.Nm 884*32002227SRobert Mustacchi.Cm io 885*32002227SRobert Mustacchi.Op Fl m Ar mode 886*32002227SRobert Mustacchi.Fl d Ar destination 887*32002227SRobert Mustacchi.Op Fl a Ar address 888*32002227SRobert Mustacchi.Op Fl c Ar command 889*32002227SRobert Mustacchi.Op Fl w Ar wlen 890*32002227SRobert Mustacchi.Op Fl r Ar rlen 891*32002227SRobert Mustacchi.Op Fl o Ar output 892*32002227SRobert Mustacchi.Ar data 893*32002227SRobert Mustacchi.Xc 894*32002227SRobert MustacchiPerform arbitrary I/O to a specific device or address on the I2C bus. 895*32002227SRobert MustacchiThis will perform a single transaction based on the type specified by 896*32002227SRobert Mustacchithe 897*32002227SRobert Mustacchi.Ar mode 898*32002227SRobert Mustacchiargument, which defaults to I2C. 899*32002227SRobert MustacchiTransmitted data will be taken from the positional arguments and 900*32002227SRobert Mustacchireceived data will be output in a hexdump if 901*32002227SRobert Mustacchi.Fl o 902*32002227SRobert Mustacchiis not specified. 903*32002227SRobert Mustacchi.Pp 904*32002227SRobert MustacchiCare should be taken when performing I/O to arbitrary devices. 905*32002227SRobert MustacchiIf a kernel device driver is attached this can potentially confuse the 906*32002227SRobert Mustacchidriver. 907*32002227SRobert MustacchiIf the device is modified, this can potentially lead to an unbootable or 908*32002227SRobert Mustacchiunsable system. 909*32002227SRobert MustacchiFor example, modifying the EERPOM on a DRAM device could lead to DRAM 910*32002227SRobert Mustacchitraining failures. 911*32002227SRobert MustacchiThe following options are supported: 912*32002227SRobert Mustacchi.Bl -tag -width Fl 913*32002227SRobert Mustacchi.It Fl a Ar address 914*32002227SRobert MustacchiA string that indicates the numeric 7-bit address to send the I/O to. 915*32002227SRobert Mustacchi.It Fl c Ar command 916*32002227SRobert MustacchiAn SMBus command to send. 917*32002227SRobert MustacchiThis option is only valid when using an SMBus mode with 918*32002227SRobert Mustacchi.Fl m 919*32002227SRobert Mustacchithat requires a command to be specified. 920*32002227SRobert Mustacchi.It Fl d Ar destination 921*32002227SRobert MustacchiAn I2C path that indicates where the I/O should target. 922*32002227SRobert MustacchiIf this is a port, then an address must be specified with the 923*32002227SRobert Mustacchi.Fl a 924*32002227SRobert Mustacchioption. 925*32002227SRobert MustacchiIf the path includes mux ports, they will be implicitly activated as 926*32002227SRobert Mustacchipart of performing this operation. 927*32002227SRobert MustacchiIf the path ends at a device, the device's primary address 928*32002227SRobert Mustacchi.Pq reg[0] 929*32002227SRobert Mustacchiwill be used. 930*32002227SRobert Mustacchi.It Fl m Ar mode 931*32002227SRobert MustacchiSpecifies the type of I/O request that should be sent. 932*32002227SRobert MustacchiThe following types are supported: 933*32002227SRobert Mustacchi.Bl -tag -width write-block-i2c 934*32002227SRobert Mustacchi.It i2c 935*32002227SRobert MustacchiPerform a general I2C transaction. 936*32002227SRobert MustacchiOne or both of 937*32002227SRobert Mustacchi.Fl r 938*32002227SRobert Mustacchiand 939*32002227SRobert Mustacchi.Fl w 940*32002227SRobert Mustacchimust be used and non-zero. 941*32002227SRobert Mustacchi.It quick-read 942*32002227SRobert MustacchiPerform an SMBus quick read. 943*32002227SRobert MustacchiNo data arguments may be specified or are required. 944*32002227SRobert Mustacchi.It quick-write 945*32002227SRobert MustacchiPerform an SMBus quick write. 946*32002227SRobert MustacchiNo data arguments may be specified or are required. 947*32002227SRobert Mustacchi.It recv-u8 948*32002227SRobert MustacchiReceive a single byte. 949*32002227SRobert MustacchiNo data arguments may be specified or are required. 950*32002227SRobert Mustacchi.It read-u8 951*32002227SRobert MustacchiPerform the SMBus read byte operation. 952*32002227SRobert MustacchiAn SMBus command must be specified with 953*32002227SRobert Mustacchi.Fl c . 954*32002227SRobert Mustacchi.It read-u16 955*32002227SRobert MustacchiPerform the SMBus read word operation. 956*32002227SRobert MustacchiAn SMBus command must be specified with 957*32002227SRobert Mustacchi.Fl c . 958*32002227SRobert Mustacchi.It read-u32 959*32002227SRobert MustacchiPerform the SMBus read u32 operation. 960*32002227SRobert MustacchiAn SMBus command must be specified with 961*32002227SRobert Mustacchi.Fl c . 962*32002227SRobert Mustacchi.It read-u64 963*32002227SRobert MustacchiPerform the SMBus read u64 operation. 964*32002227SRobert MustacchiAn SMBus command must be specified with 965*32002227SRobert Mustacchi.Fl c . 966*32002227SRobert Mustacchi.It read-block-i2c 967*32002227SRobert MustacchiPerform an SMBus I2C block read operation. 968*32002227SRobert MustacchiAn SMBus command must be specified with 969*32002227SRobert Mustacchi.Fl c . 970*32002227SRobert MustacchiA read length must be specified with 971*32002227SRobert Mustacchi.Fl r . 972*32002227SRobert MustacchiIt will not be sent on the wire, unlike a traditional SMBus block read. 973*32002227SRobert Mustacchi.It send-u8 974*32002227SRobert MustacchiTransmit a single byte. 975*32002227SRobert Mustacchi.It write-u8 976*32002227SRobert MustacchiPerform the SMBus write byte operation. 977*32002227SRobert MustacchiAn SMBus command must be specified with 978*32002227SRobert Mustacchi.Fl c 979*32002227SRobert Mustacchiand a single data operand must be specified. 980*32002227SRobert Mustacchi.It write-u16 981*32002227SRobert MustacchiPerform the SMBus write word operation. 982*32002227SRobert MustacchiAn SMBus command must be specified with 983*32002227SRobert Mustacchi.Fl c 984*32002227SRobert Mustacchiand a single data operand must be specified. 985*32002227SRobert Mustacchi.It write-u32 986*32002227SRobert MustacchiPerform the SMBus write u32 operation. 987*32002227SRobert MustacchiAn SMBus command must be specified with 988*32002227SRobert Mustacchi.Fl c 989*32002227SRobert Mustacchiand a single data operand must be specified. 990*32002227SRobert Mustacchi.It write-u64 991*32002227SRobert MustacchiPerform the SMBus write u64 operation. 992*32002227SRobert MustacchiAn SMBus command must be specified with 993*32002227SRobert Mustacchi.Fl c 994*32002227SRobert Mustacchiand a single data operand must be specified. 995*32002227SRobert Mustacchi.It write-block 996*32002227SRobert MustacchiPerform an SMBus write block operation. 997*32002227SRobert MustacchiSMBus block write with command and length 998*32002227SRobert MustacchiAn SMBus command must be specified with 999*32002227SRobert Mustacchi.Fl c 1000*32002227SRobert Mustacchiand the number of byte to write must be specified with 1001*32002227SRobert Mustacchi.Fl w . 1002*32002227SRobert MustacchiBoth the command and the write length will be sent on the wire. 1003*32002227SRobert MustacchiThere must be a single-byte positional argument for each byte indicated 1004*32002227SRobert Mustacchiwith 1005*32002227SRobert Mustacchi.Fl w . 1006*32002227SRobert Mustacchi.It write-block-i2c 1007*32002227SRobert MustacchiOperates as per write-block above, but the byte length is not sent on 1008*32002227SRobert Mustacchithe wire. 1009*32002227SRobert Mustacchi.It call 1010*32002227SRobert MustacchiPerforms the SMBus process call operation. 1011*32002227SRobert MustacchiAn SMBus command must be specified with 1012*32002227SRobert Mustacchi.Fl c 1013*32002227SRobert Mustacchiand a single positional data argument must be specified. 1014*32002227SRobert MustacchiProcess call transmits and then reads a u16. 1015*32002227SRobert Mustacchi.El 1016*32002227SRobert Mustacchi.It Fl o Ar output 1017*32002227SRobert MustacchiSend received binary data to the file 1018*32002227SRobert Mustacchi.Ar output 1019*32002227SRobert Mustacchirather than performing a hexadecimal dump to standard out. 1020*32002227SRobert Mustacchi.It Fl r Ar rlen 1021*32002227SRobert MustacchiSpecifies the number of bytes that should be read from the device. 1022*32002227SRobert Mustacchi.It Fl w Ar wlen 1023*32002227SRobert MustacchiSpecifies the number of bytes that should be transmitted to the device. 1024*32002227SRobert MustacchiThere must be one positional argument for each byte that should be 1025*32002227SRobert Mustacchitransmitted. 1026*32002227SRobert Mustacchi.El 1027*32002227SRobert Mustacchi.It Xo 1028*32002227SRobert Mustacchi.Nm 1029*32002227SRobert Mustacchi.Cm scan 1030*32002227SRobert Mustacchi.Op Fl d Ar device 1031*32002227SRobert Mustacchi.Op Fl H 1032*32002227SRobert Mustacchi.Op Fl o Ar field Ns [,...] Op Fl p 1033*32002227SRobert Mustacchi.Ar port 1034*32002227SRobert Mustacchi.Xc 1035*32002227SRobert MustacchiScan the specified I2C 1036*32002227SRobert Mustacchi.Ar port 1037*32002227SRobert Mustacchifor devices. 1038*32002227SRobert MustacchiThis works by attempting to perform I/O to every non-reserved address on 1039*32002227SRobert Mustacchithe bus. 1040*32002227SRobert MustacchiIf the port belongs to a mux, then all of the appropriate mux segments 1041*32002227SRobert Mustacchiwill be enabled prior to performing the scan. 1042*32002227SRobert MustacchiThe command will output a human-oriented table by default organized into 1043*32002227SRobert Mustacchirows with 16 columns each. 1044*32002227SRobert MustacchiFor machine parsable, stable output use the 1045*32002227SRobert Mustacchi.Fl p 1046*32002227SRobert Mustacchiand 1047*32002227SRobert Mustacchi.Fl o 1048*32002227SRobert Mustacchioptions. 1049*32002227SRobert Mustacchi.Pp 1050*32002227SRobert MustacchiThe table will use the following characters to indicate specific cases: 1051*32002227SRobert Mustacchi.Bl -tag -width Ds 1052*32002227SRobert Mustacchi.It @ 1053*32002227SRobert MustacchiIndicates that a device was found at the address. 1054*32002227SRobert Mustacchi.It - 1055*32002227SRobert MustacchiIndicates that no device was found at the address. 1056*32002227SRobert Mustacchi.It S 1057*32002227SRobert MustacchiIndicates that the address was skipped as the 1058*32002227SRobert Mustacchi.Fl d 1059*32002227SRobert Mustacchioption was used and the address in question wasn't listed. 1060*32002227SRobert Mustacchi.It R 1061*32002227SRobert MustacchiIndicates that the address is considered reserved and therefore was not 1062*32002227SRobert Mustacchiscanned. 1063*32002227SRobert Mustacchi.It X 1064*32002227SRobert MustacchiIndicates that a time out occurred. 1065*32002227SRobert Mustacchi.It Err 1066*32002227SRobert MustacchiIndicates that an error occurred. 1067*32002227SRobert MustacchiFollowing the table, a list of address-specific errors will be printed. 1068*32002227SRobert Mustacchi.El 1069*32002227SRobert Mustacchi.Pp 1070*32002227SRobert MustacchiUnfortunately, the only way to determine if a device is there is by 1071*32002227SRobert Mustacchiattempting to do I/O to it. 1072*32002227SRobert MustacchiThe scan defaults to performing a single byte read. 1073*32002227SRobert MustacchiNote, there is no safe way to scan for devices and it is quite possible 1074*32002227SRobert Mustacchifor system damage to occur from scanning! 1075*32002227SRobert Mustacchi.Pp 1076*32002227SRobert MustacchiThe following fields are supported when using machine parsable output: 1077*32002227SRobert Mustacchi.Bl -tag -width RESULT 1078*32002227SRobert Mustacchi.It Sy ADDR 1079*32002227SRobert MustacchiThe I2C address that was scanned, printed in hexadecimal. 1080*32002227SRobert Mustacchi.It Sy RESULT 1081*32002227SRobert MustacchiA string that describes the result. 1082*32002227SRobert MustacchiValid strings include: 1083*32002227SRobert Mustacchi.Dq found , 1084*32002227SRobert Mustacchi.Dq missing , 1085*32002227SRobert Mustacchi.Dq reserved , 1086*32002227SRobert Mustacchi.Dq timeout , 1087*32002227SRobert Mustacchi.Dq error , 1088*32002227SRobert Mustacchiand 1089*32002227SRobert Mustacchi.Dq skipped . 1090*32002227SRobert Mustacchi.It Sy ERROR 1091*32002227SRobert MustacchiA string that includes information about the error that occurred. 1092*32002227SRobert MustacchiThis is only valid if the 1093*32002227SRobert Mustacchi.Sy RESULT 1094*32002227SRobert Mustacchifield is error. 1095*32002227SRobert Mustacchi.El 1096*32002227SRobert MustacchiThe following options are supported: 1097*32002227SRobert Mustacchi.Bl -tag -width Fl 1098*32002227SRobert Mustacchi.It Fl d Ar device 1099*32002227SRobert MustacchiRestrict the scan to the specified I2C address. 1100*32002227SRobert MustacchiThis may be specified multiple times to only scan a subset of devices. 1101*32002227SRobert Mustacchi.It Fl H 1102*32002227SRobert MustacchiOmit the column header when printing output. 1103*32002227SRobert Mustacchi.It Fl o Ar field Ns [,...] 1104*32002227SRobert MustacchiA comma-delineated list of fields to output, selected from the ones 1105*32002227SRobert Mustacchiabove. 1106*32002227SRobert Mustacchi.It Fl p 1107*32002227SRobert MustacchiDisplays the output in a machine-parsable format. 1108*32002227SRobert MustacchiWhen requesting parsable output, the 1109*32002227SRobert Mustacchi.Fl o 1110*32002227SRobert Mustacchioption is required to specifically control which fields are included. 1111*32002227SRobert Mustacchi.El 1112*32002227SRobert Mustacchi.Pp 1113*32002227SRobert MustacchiThe following operands are required: 1114*32002227SRobert Mustacchi.Bl -tag -width Ar 1115*32002227SRobert Mustacchi.It Ar port 1116*32002227SRobert MustacchiAn I2C path that terminates at a port. 1117*32002227SRobert MustacchiIf the port is downstream of a multiplexor, all of the segments required 1118*32002227SRobert Mustacchito send to that port will be enabled, allowing the results to be 1119*32002227SRobert Mustacchiincluded in the scan. 1120*32002227SRobert MustacchiOtherwise, multiplexors will be disabled during the scan. 1121*32002227SRobert Mustacchi.El 1122*32002227SRobert Mustacchi.El 1123*32002227SRobert Mustacchi.Sh PROPERTIES 1124*32002227SRobert MustacchiThe system supports a number of named I2C properties. 1125*32002227SRobert MustacchiProperties are consider either read-only or read-write. 1126*32002227SRobert MustacchiSome properties may be read-write on one controller and then read-only 1127*32002227SRobert Mustacchior possibly even unsupported on another controller. 1128*32002227SRobert MustacchiWhether a property is supported, is writable, and the valid values a 1129*32002227SRobert Mustacchiproperty can take will vary from one controller to another. 1130*32002227SRobert Mustacchi.Pp 1131*32002227SRobert MustacchiThere are some properties which control timing parameters on the I2C 1132*32002227SRobert Mustacchibus. 1133*32002227SRobert MustacchiThese properties often have a single instance for each speed that the 1134*32002227SRobert MustacchiI2C bus can operate at. 1135*32002227SRobert MustacchiThis allows for one to set the tuning properties to the correct value 1136*32002227SRobert Mustacchibefore changing the speed without impacting the current operation. 1137*32002227SRobert Mustacchi.Pp 1138*32002227SRobert MustacchiProperties have a specific type which is either the 1139*32002227SRobert Mustacchi.Sy u32 1140*32002227SRobert Mustacchior 1141*32002227SRobert Mustacchi.Sy bit32 1142*32002227SRobert Mustacchiwhich are 32-bit integers that represent a single value or a bitfield 1143*32002227SRobert Mustacchiwhere each bit conveys its own meaning respectively. 1144*32002227SRobert MustacchiA few properties such as 1145*32002227SRobert Mustacchi.Em speed , 1146*32002227SRobert Mustacchi.Em type , 1147*32002227SRobert Mustacchiand 1148*32002227SRobert Mustacchi.Em smbus-ops 1149*32002227SRobert Mustacchihave well known string values that correspond to fields. 1150*32002227SRobert MustacchiBy default the tools print the stable human-readable strings for these. 1151*32002227SRobert MustacchiProperties with these are called out in the property table. 1152*32002227SRobert Mustacchi.Pp 1153*32002227SRobert MustacchiThe following properties are supported: 1154*32002227SRobert Mustacchi.Bl -tag -width clock-Thigh-high 1155*32002227SRobert Mustacchi.It speed 1156*32002227SRobert MustacchiDescribes the frequency of the bus. 1157*32002227SRobert MustacchiThis is a 1158*32002227SRobert Mustacchi.Sy u32 1159*32002227SRobert Mustacchithat is translated to the following string values: 1160*32002227SRobert Mustacchi.Bl -tag -width fast-plus 1161*32002227SRobert Mustacchi.It Sy standard 1162*32002227SRobert Mustacchi100 kHz standard operation. 1163*32002227SRobert Mustacchi.It Sy fast 1164*32002227SRobert Mustacchi400 kHz fast-mode operation. 1165*32002227SRobert Mustacchi.It Sy fast-plus 1166*32002227SRobert Mustacchi1 MHz fast-mode plus operation. 1167*32002227SRobert Mustacchi.It Sy high 1168*32002227SRobert Mustacchi3.4 MHz high-speed operation. 1169*32002227SRobert Mustacchi.It Sy ultra 1170*32002227SRobert Mustacchi5 MHz ultra-fast operation. 1171*32002227SRobert Mustacchi.El 1172*32002227SRobert Mustacchi.It ports 1173*32002227SRobert MustacchiA 1174*32002227SRobert Mustacchi.Sy u32 1175*32002227SRobert Mustacchiproperty that indicates the number of ports under the controller. 1176*32002227SRobert MustacchiThis property is always read-only and generally will be 1. 1177*32002227SRobert Mustacchi.It type 1178*32002227SRobert MustacchiDescribes the type of controller. 1179*32002227SRobert MustacchiThis is always read-only 1180*32002227SRobert Mustacchi.Sy u32 1181*32002227SRobert Mustacchiproperty that is translated to the following string values: 1182*32002227SRobert Mustacchi.Bl -tag -width smbus 1183*32002227SRobert Mustacchi.It i2c 1184*32002227SRobert MustacchiIndicates that this is an I2C controller. 1185*32002227SRobert Mustacchi.It i3c 1186*32002227SRobert MustacchiIndicates that this is an I3C controller. 1187*32002227SRobert Mustacchi.It smbus 1188*32002227SRobert MustacchiIndicates that this is an SMBus controller. 1189*32002227SRobert Mustacchi.El 1190*32002227SRobert Mustacchi.Pp 1191*32002227SRobert MustacchiSome controllers can support more than one I/O command request. 1192*32002227SRobert MustacchiFor example, all I3C controllers support operating as an I2C controller. 1193*32002227SRobert MustacchiSimilarly some SMBus controllers support first-class I2C operation. 1194*32002227SRobert MustacchiThis property only indicates the primary mode of the controller. 1195*32002227SRobert Mustacchi.It smbus-ops 1196*32002227SRobert MustacchiDescribes the set of SMBus operations that the controller supports. 1197*32002227SRobert MustacchiThis is a read-only 1198*32002227SRobert Mustacchi.Sy bit32 1199*32002227SRobert Mustacchiproperty that is translated to the following string values: 1200*32002227SRobert Mustacchi.Bl -tag -width write-i2c-block 1201*32002227SRobert Mustacchi.It Sy quick 1202*32002227SRobert MustacchiThe controller supports the SMBus quick read and write operation. 1203*32002227SRobert Mustacchi.It Sy send-byte 1204*32002227SRobert MustacchiThe controller supports the SMBus send byte operation. 1205*32002227SRobert Mustacchi.It Sy recv-byte 1206*32002227SRobert MustacchiThe controller supports the SMBus receive byte operation. 1207*32002227SRobert Mustacchi.It Sy write-byte 1208*32002227SRobert MustacchiThe controller supports the SMBus write byte operation. 1209*32002227SRobert Mustacchi.It Sy read-byte 1210*32002227SRobert MustacchiThe controller supports the SMBus read byte operation. 1211*32002227SRobert Mustacchi.It Sy write-word 1212*32002227SRobert MustacchiThe controller supports the SMBus write word 1213*32002227SRobert Mustacchi.Pq 16-bit 1214*32002227SRobert Mustacchioperation. 1215*32002227SRobert Mustacchi.It Sy read-word 1216*32002227SRobert MustacchiThe controller supports the SMBus read word 1217*32002227SRobert Mustacchi.Pq 16-bit 1218*32002227SRobert Mustacchioperation. 1219*32002227SRobert Mustacchi.It Sy process-call 1220*32002227SRobert MustacchiThe controller supports the SMBus process call operation which transmits 1221*32002227SRobert Mustacchia 16-bit value and then reads back a 16-bit value. 1222*32002227SRobert Mustacchi.It Sy write-block 1223*32002227SRobert MustacchiThe controller supports the SMBus write block operation which transmits 1224*32002227SRobert Mustacchithe SMBus command, the byte length, and all the bytes. 1225*32002227SRobert Mustacchi.It Sy read-block 1226*32002227SRobert MustacchiThe controller supports the SMBus read block operation which reads a 1227*32002227SRobert Mustacchivariable number of bytes that are indicated by the target. 1228*32002227SRobert Mustacchi.It Sy host-notify 1229*32002227SRobert MustacchiThe controller supports sending out the host notification command. 1230*32002227SRobert MustacchiThis is generally only used for SMBus targets and not controllers. 1231*32002227SRobert Mustacchi.It Sy block-call 1232*32002227SRobert MustacchiThe controller supports the SMBus block call operation which transmits 1233*32002227SRobert Mustacchiand then receives a variable number of bytes. 1234*32002227SRobert Mustacchi.It Sy write-u32 1235*32002227SRobert MustacchiThe controller supports the SMBus write 32-bit operation. 1236*32002227SRobert Mustacchi.It Sy read-u32 1237*32002227SRobert MustacchiThe controller supports the SMBus read 32-bit operation. 1238*32002227SRobert Mustacchi.It Sy write-u64 1239*32002227SRobert MustacchiThe controller supports the SMBus write 64-bit operation. 1240*32002227SRobert Mustacchi.It Sy read-u64 1241*32002227SRobert MustacchiThe controller supports the SMBus read 64-bit operation. 1242*32002227SRobert Mustacchi.It Sy write-i2c-block 1243*32002227SRobert MustacchiThe controller supports a variant of the write block operation that is 1244*32002227SRobert Mustacchicompatible with I2C by not transmitting the number of bytes that the 1245*32002227SRobert Mustacchicontroller will send. 1246*32002227SRobert Mustacchi.It Sy read-i2c-block 1247*32002227SRobert MustacchiThe controller supports a variant of the read block operation that is 1248*32002227SRobert Mustacchicompatible with I2C by explicitly reading a fixed number of bytes. 1249*32002227SRobert MustacchiThe number of bytes is not transmitted on the wire. 1250*32002227SRobert Mustacchi.El 1251*32002227SRobert Mustacchi.It i2c-max-read 1252*32002227SRobert MustacchiThis is a read-only 1253*32002227SRobert Mustacchi.Sy u32 1254*32002227SRobert Mustacchiproperty that indicates the largest I2C read the controller can 1255*32002227SRobert Mustacchireceive in one operation. 1256*32002227SRobert Mustacchi.It i2c-max-write 1257*32002227SRobert MustacchiThis is a read-only 1258*32002227SRobert Mustacchi.Sy u32 1259*32002227SRobert Mustacchiproperty that indicates the largest I2C write the controller can 1260*32002227SRobert Mustacchitransmit in one operation. 1261*32002227SRobert Mustacchi.It smbus-max-block 1262*32002227SRobert MustacchiThis is a read-only 1263*32002227SRobert Mustacchi.Sy u32 1264*32002227SRobert Mustacchiproperty that indicates the largest SMBus block operation the controller 1265*32002227SRobert Mustacchican perform. 1266*32002227SRobert Mustacchi.It clock-Thigh-std 1267*32002227SRobert MustacchiThis property indicates the high period of the I2C clock. 1268*32002227SRobert MustacchiIt is a 1269*32002227SRobert Mustacchi.Sy u32 1270*32002227SRobert Mustacchiproperty that is counted in terms of clock cycles. 1271*32002227SRobert MustacchiThis property only applies when the bus is operating at standard speed. 1272*32002227SRobert Mustacchi.It clock-Tlow-std 1273*32002227SRobert MustacchiThis property indicates the low period of the I2C clock. 1274*32002227SRobert MustacchiIt is a 1275*32002227SRobert Mustacchi.Sy u32 1276*32002227SRobert Mustacchiproperty that is counted in terms of clock cycles. 1277*32002227SRobert MustacchiThis property only applies when the bus is operating at standard speed. 1278*32002227SRobert Mustacchi.It clock-Thigh-fast 1279*32002227SRobert MustacchiThis property indicates the high period of the I2C clock. 1280*32002227SRobert MustacchiIt is a 1281*32002227SRobert Mustacchi.Sy u32 1282*32002227SRobert Mustacchiproperty that is counted in terms of clock cycles. 1283*32002227SRobert MustacchiThis property only applies when the bus is operating at fast-mode and 1284*32002227SRobert Mustacchifast-mode plus speeds. 1285*32002227SRobert Mustacchi.It clock-Tlow-fast 1286*32002227SRobert MustacchiThis property indicates the low period of the I2C clock. 1287*32002227SRobert MustacchiIt is a 1288*32002227SRobert Mustacchi.Sy u32 1289*32002227SRobert Mustacchiproperty that is counted in terms of clock cycles. 1290*32002227SRobert MustacchiThis property only applies when the bus is operating at fast-mode and 1291*32002227SRobert Mustacchifast-mode plus speeds. 1292*32002227SRobert Mustacchi.It clock-Thigh-high 1293*32002227SRobert MustacchiThis property indicates the high period of the I2C clock. 1294*32002227SRobert MustacchiIt is a 1295*32002227SRobert Mustacchi.Sy u32 1296*32002227SRobert Mustacchiproperty that is counted in terms of clock cycles. 1297*32002227SRobert MustacchiThis property only applies when the bus is operating at fast-mode and 1298*32002227SRobert Mustacchihigh speed. 1299*32002227SRobert Mustacchi.It clock-Tlow-high 1300*32002227SRobert MustacchiThis property indicates the low period of the I2C clock. 1301*32002227SRobert MustacchiIt is a 1302*32002227SRobert Mustacchi.Sy u32 1303*32002227SRobert Mustacchiproperty that is counted in terms of clock cycles. 1304*32002227SRobert MustacchiThis property only applies when the bus is operating at fast-mode and 1305*32002227SRobert Mustacchihigh speed. 1306*32002227SRobert Mustacchi.El 1307*32002227SRobert Mustacchi.Sh EXIT STATUS 1308*32002227SRobert MustacchiThe 1309*32002227SRobert Mustacchi.Nm 1310*32002227SRobert Mustacchiutility exits 0 on success. 1311*32002227SRobert MustacchiIf an error occurs, it exits 1, and provides additional details about 1312*32002227SRobert Mustacchithe underlying cause of the error. 1313*32002227SRobert MustacchiIf there was an invalid or missing command line options, then 1314*32002227SRobert Mustacchi.Nm 1315*32002227SRobert Mustacchiexits 2. 1316*32002227SRobert Mustacchi.Pp 1317*32002227SRobert MustacchiWhen performing a listing operation, if no items are listed or if a filter 1318*32002227SRobert Mustacchiis specified but is not matched, then these conditions are all treated as 1319*32002227SRobert Mustacchierrors and 1320*32002227SRobert Mustacchi.Nm 1321*32002227SRobert Mustacchiexits 1. 1322*32002227SRobert Mustacchi.Sh EXAMPLES 1323*32002227SRobert Mustacchi.Sy Example 1 1324*32002227SRobert MustacchiListing Controllers 1325*32002227SRobert Mustacchi.Pp 1326*32002227SRobert MustacchiThis example shows how to discover I2C and SMBus controllers in the 1327*32002227SRobert Mustacchisystem. 1328*32002227SRobert Mustacchi.Bd -literal -offset indent 1329*32002227SRobert Mustacchi# i2cadm controller list 1330*32002227SRobert MustacchiNAME TYPE SPEED NPORTS PROVIDER 1331*32002227SRobert Mustacchiismt0 smbus standard 1 /pci@0,0/pci8086,7270@f/i2cnex@ismt0 1332*32002227SRobert Mustacchipchsmbus0 smbus standard 1 /pci@0,0/pci8086,7270@1f, 1333*32002227SRobert Mustacchi 4/i2cnex@pchsmbus0 1334*32002227SRobert Mustacchi.Ed 1335*32002227SRobert Mustacchi.Pp 1336*32002227SRobert MustacchiThe controller information can be changed by requesting specific fields 1337*32002227SRobert Mustacchior adding a filter: 1338*32002227SRobert Mustacchi.Bd -literal -offset indent 1339*32002227SRobert Mustacchi# i2cadm controller list -o name,speed ismt 1340*32002227SRobert MustacchiNAME SPEED 1341*32002227SRobert Mustacchiismt0 standard 1342*32002227SRobert Mustacchi.Ed 1343*32002227SRobert Mustacchi.Pp 1344*32002227SRobert Mustacchi.Sy Example 2 1345*32002227SRobert MustacchiListing Devices 1346*32002227SRobert Mustacchi.Pp 1347*32002227SRobert MustacchiThis example shows how to discover the I2C devices that the system knows 1348*32002227SRobert Mustacchiabout. 1349*32002227SRobert Mustacchi.Bd -literal -offset indent 1350*32002227SRobert Mustacchi# i2cadm device list 1351*32002227SRobert MustacchiNAME ADDR INSTANCE PATH 1352*32002227SRobert Mustacchiat24c32 0x50 at24c0 ismt0/0/0x50 1353*32002227SRobert Mustacchipca9548 0x72 pca954x0 pchsmbus0/0/0x72 1354*32002227SRobert Mustacchipca9548 0x73 pca954x1 pchsmbus0/0/0x73 1355*32002227SRobert Mustacchipca9548 0x74 pca954x2 pchsmbus0/0/0x74 1356*32002227SRobert Mustacchipca9548 0x75 pca954x3 pchsmbus0/0/0x75 1357*32002227SRobert Mustacchipca9548 0x76 pca954x4 pchsmbus0/0/0x76 1358*32002227SRobert Mustacchitmp431 0x4c tmp43x0 pchsmbus0/0/0x72/6/0x4c 1359*32002227SRobert Mustacchilm75 0x48 lm7x0 pchsmbus0/0/0x73/1/0x48 1360*32002227SRobert Mustacchilm75 0x49 lm7x1 pchsmbus0/0/0x73/1/0x49 1361*32002227SRobert Mustacchilm75 0x4a lm7x2 pchsmbus0/0/0x73/1/0x4a 1362*32002227SRobert Mustacchilm75 0x4b lm7x3 pchsmbus0/0/0x73/1/0x4b 1363*32002227SRobert Mustacchilm75 0x4c lm7x4 pchsmbus0/0/0x73/1/0x4c 1364*32002227SRobert Mustacchilm75 0x4d lm7x5 pchsmbus0/0/0x73/1/0x4d 1365*32002227SRobert Mustacchilm75 0x4e lm7x6 pchsmbus0/0/0x73/1/0x4e 1366*32002227SRobert Mustacchilm75 0x4f lm7x7 pchsmbus0/0/0x73/1/0x4f 1367*32002227SRobert Mustacchi.Ed 1368*32002227SRobert Mustacchi.Pp 1369*32002227SRobert MustacchiOne can also print out a subset of devices in a parsable form: 1370*32002227SRobert Mustacchi.Bd -literal -offset indent 1371*32002227SRobert Mustacchi# i2cadm device list -Hpo name,path lm75 1372*32002227SRobert Mustacchilm75:pchsmbus0/0/0x73/1/0x48 1373*32002227SRobert Mustacchilm75:pchsmbus0/0/0x73/1/0x49 1374*32002227SRobert Mustacchilm75:pchsmbus0/0/0x73/1/0x4a 1375*32002227SRobert Mustacchilm75:pchsmbus0/0/0x73/1/0x4b 1376*32002227SRobert Mustacchilm75:pchsmbus0/0/0x73/1/0x4c 1377*32002227SRobert Mustacchilm75:pchsmbus0/0/0x73/1/0x4d 1378*32002227SRobert Mustacchilm75:pchsmbus0/0/0x73/1/0x4e 1379*32002227SRobert Mustacchilm75:pchsmbus0/0/0x73/1/0x4f 1380*32002227SRobert Mustacchi.Ed 1381*32002227SRobert Mustacchi.Pp 1382*32002227SRobert Mustacchi.Sy Example 3 1383*32002227SRobert MustacchiAdding a Device 1384*32002227SRobert Mustacchi.Pp 1385*32002227SRobert MustacchiThis example shows how we would add an AT24C32 EEPROM that is at 1386*32002227SRobert Mustacchiaddress 0x50. 1387*32002227SRobert Mustacchi.Bd -literal -offset indent 1388*32002227SRobert Mustacchi# i2cadm device add ismt0/0 at24c32 0x50 1389*32002227SRobert Mustacchi# i2cadm device list at24c32 1390*32002227SRobert MustacchiNAME ADDR INSTANCE PATH 1391*32002227SRobert Mustacchiat24c32 0x50 at24c0 ismt0/0/0x50 1392*32002227SRobert Mustacchi.Ed 1393*32002227SRobert Mustacchi.Pp 1394*32002227SRobert MustacchiLet's say we now wanted to add a TMP431 with 7-bit address address 0x4c 1395*32002227SRobert Mustacchithat is under port 6 of an 8-port PCA9548 at 0x72: 1396*32002227SRobert Mustacchi.Bd -literal -offset indent 1397*32002227SRobert Mustacchi# i2cadm mux list pca954x0 1398*32002227SRobert MustacchiDEVICE NPORTS NAME INSTANCE PATH 1399*32002227SRobert Mustacchipca9548 8 pca954x0 pca954x0 pchsmbus0/0/0x72 1400*32002227SRobert Mustacchi# i2cadm device add pchsmbus0/0/0x72/6 tmp431 0x4c 1401*32002227SRobert Mustacchi# i2cadm device list tmp431 1402*32002227SRobert MustacchiNAME ADDR INSTANCE PATH 1403*32002227SRobert Mustacchitmp431 0x4c tmp43x0 pchsmbus0/0/0x72/6/0x4c 1404*32002227SRobert Mustacchi.Ed 1405*32002227SRobert Mustacchi.Pp 1406*32002227SRobert Mustacchi.Sy Example 4 1407*32002227SRobert MustacchiScanning an I2C bus 1408*32002227SRobert Mustacchi.Pp 1409*32002227SRobert MustacchiThis shows 1410*32002227SRobert Mustacchi.Bd -literal 1411*32002227SRobert Mustacchi# i2cadm scan pchsmbus0/0 1412*32002227SRobert MustacchiDevice scan on pchsmbus0/0: 1413*32002227SRobert Mustacchi 1414*32002227SRobert Mustacchi - = No Device @ = Device Found 1415*32002227SRobert Mustacchi R = Reserved S = Skipped 1416*32002227SRobert Mustacchi X = Timed Out Err = Error 1417*32002227SRobert Mustacchi 1418*32002227SRobert MustacchiADDR 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 1419*32002227SRobert Mustacchi0x00 R R R R R R R R - - - - - - - - 1420*32002227SRobert Mustacchi0x10 - - - - - - - - - - - - - - - - 1421*32002227SRobert Mustacchi0x20 - - - - - - - - - - - - - - - - 1422*32002227SRobert Mustacchi0x30 - - - - - - - - - - - - - - - - 1423*32002227SRobert Mustacchi0x40 - - - - @ - - - - - - - - - - - 1424*32002227SRobert Mustacchi0x50 - - - - - - - - - - - - - - - - 1425*32002227SRobert Mustacchi0x60 - - - - - - - - @ - - - - - - - 1426*32002227SRobert Mustacchi0x70 - - @ @ @ @ @ - R R R R R R R R 1427*32002227SRobert Mustacchi.Ed 1428*32002227SRobert Mustacchi.Pp 1429*32002227SRobert MustacchiTo instead scan on a port of a given mux, you would change the path to 1430*32002227SRobert Mustacchiindicate that. 1431*32002227SRobert MustacchiFor example: 1432*32002227SRobert Mustacchi.Bd -literal 1433*32002227SRobert Mustacchi# i2cadm scan pchsmbus0/0/0x72/6 1434*32002227SRobert MustacchiDevice scan on pchsmbus0/0/0x72/6: 1435*32002227SRobert Mustacchi 1436*32002227SRobert Mustacchi - = No Device @ = Device Found 1437*32002227SRobert Mustacchi R = Reserved S = Skipped 1438*32002227SRobert Mustacchi X = Timed Out Err = Error 1439*32002227SRobert Mustacchi 1440*32002227SRobert MustacchiADDR 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 1441*32002227SRobert Mustacchi0x00 R R R R R R R R - - - - - - - - 1442*32002227SRobert Mustacchi0x10 - - - - - - - - - - - - - - - - 1443*32002227SRobert Mustacchi0x20 - - - - - - - - - - - - - - - - 1444*32002227SRobert Mustacchi0x30 - - - - - - - - - - - - - - - - 1445*32002227SRobert Mustacchi0x40 - - - - @ - - - - - - - @ - - - 1446*32002227SRobert Mustacchi0x50 - - - - - - - - - - - - - - - - 1447*32002227SRobert Mustacchi0x60 - - - - - - - - @ - - - - - - - 1448*32002227SRobert Mustacchi0x70 - - @ @ @ @ @ - R R R R R R R R 1449*32002227SRobert Mustacchi.Ed 1450*32002227SRobert Mustacchi.Pp 1451*32002227SRobert Mustacchi.Sy Example 5 1452*32002227SRobert MustacchiPrinting a Port Address Map 1453*32002227SRobert Mustacchi.Pp 1454*32002227SRobert MustacchiThe following shows how to see a list of addresses that are in use on a 1455*32002227SRobert Mustacchigiven port according to the system. 1456*32002227SRobert MustacchiThis may not be every device that is present on the bus as the system 1457*32002227SRobert Mustacchimay not have been told about them. 1458*32002227SRobert Mustacchi.Bd -literal 1459*32002227SRobert Mustacchi# i2cadm port map pchsmbus0/0 1460*32002227SRobert MustacchiAddress map for pchsmbus0/0: 1461*32002227SRobert Mustacchi 1462*32002227SRobert Mustacchi - = No Device L = Local Device 1463*32002227SRobert Mustacchi S = Shared v = Downstream 1464*32002227SRobert Mustacchi E = Error 1465*32002227SRobert Mustacchi 1466*32002227SRobert MustacchiADDR 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 1467*32002227SRobert Mustacchi0x00 - - - - - - - - - - - - - - - - 1468*32002227SRobert Mustacchi0x10 - - - - - - - - - - - - - - - - 1469*32002227SRobert Mustacchi0x20 - - - - - - - - - - - - - - - - 1470*32002227SRobert Mustacchi0x30 - - - - - - - - - - - - - - - - 1471*32002227SRobert Mustacchi0x40 - - - - - - - - 1v 1v 1v 1v 2v 1v 1v 1v 1472*32002227SRobert Mustacchi0x50 - - - - - - - - - - - - - - - - 1473*32002227SRobert Mustacchi0x60 - - - - - - - - - - - - - - - - 1474*32002227SRobert Mustacchi0x70 - - L L L L L - - - - - - - - - 1475*32002227SRobert Mustacchi.Ed 1476*32002227SRobert Mustacchi.Pp 1477*32002227SRobert MustacchiIn this case there are a number of downstream devices on this port that 1478*32002227SRobert Mustacchiare below the muxes. 1479*32002227SRobert MustacchiIf we then ask for the map of everything on a given mux port that most 1480*32002227SRobert Mustacchiof those are on we'd instead see: 1481*32002227SRobert Mustacchi.Bd -literal 1482*32002227SRobert Mustacchi# i2cadm port map pchsmbus0/0/0x73/1 1483*32002227SRobert MustacchiAddress map for pchsmbus0/0/0x73/1: 1484*32002227SRobert Mustacchi 1485*32002227SRobert Mustacchi - = No Device L = Local Device 1486*32002227SRobert Mustacchi S = Shared v = Downstream 1487*32002227SRobert Mustacchi E = Error 1488*32002227SRobert Mustacchi 1489*32002227SRobert MustacchiADDR 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 1490*32002227SRobert Mustacchi0x00 - - - - - - - - - - - - - - - - 1491*32002227SRobert Mustacchi0x10 - - - - - - - - - - - - - - - - 1492*32002227SRobert Mustacchi0x20 - - - - - - - - - - - - - - - - 1493*32002227SRobert Mustacchi0x30 - - - - - - - - - - - - - - - - 1494*32002227SRobert Mustacchi0x40 - - - - - - - - L L L L L L L L 1495*32002227SRobert Mustacchi0x50 - - - - - - - - - - - - - - - - 1496*32002227SRobert Mustacchi0x60 - - - - - - - - - - - - - - - - 1497*32002227SRobert Mustacchi0x70 - - - - - - - - - - - - - - - - 1498*32002227SRobert Mustacchi.Ed 1499*32002227SRobert Mustacchi.Sh INTERFACE STABILITY 1500*32002227SRobert MustacchiThe command line interface of 1501*32002227SRobert Mustacchi.Nm 1502*32002227SRobert Mustacchiis 1503*32002227SRobert Mustacchi.Sy Evolving . 1504*32002227SRobert MustacchiThe output of 1505*32002227SRobert Mustacchi.Nm 1506*32002227SRobert Mustacchiis 1507*32002227SRobert Mustacchi.Sy Not-An-Interface 1508*32002227SRobert Mustacchiand may change at any time. 1509*32002227SRobert Mustacchi.Sh SEE ALSO 1510*32002227SRobert Mustacchi.Xr ofmt 3OFMT 1511