1*273b8983SGovindraj RajaDebugFS interface 2*273b8983SGovindraj Raja================= 3*273b8983SGovindraj Raja 4*273b8983SGovindraj RajaThe optional DebugFS interface is accessed through a Vendor specific EL3 service. Refer 5*273b8983SGovindraj Rajato the component documentation for details. 6*273b8983SGovindraj Raja 7*273b8983SGovindraj RajaString parameters are passed through a shared buffer using a specific union: 8*273b8983SGovindraj Raja 9*273b8983SGovindraj Raja.. code:: c 10*273b8983SGovindraj Raja 11*273b8983SGovindraj Raja union debugfs_parms { 12*273b8983SGovindraj Raja struct { 13*273b8983SGovindraj Raja char fname[MAX_PATH_LEN]; 14*273b8983SGovindraj Raja } open; 15*273b8983SGovindraj Raja 16*273b8983SGovindraj Raja struct mount { 17*273b8983SGovindraj Raja char srv[MAX_PATH_LEN]; 18*273b8983SGovindraj Raja char where[MAX_PATH_LEN]; 19*273b8983SGovindraj Raja char spec[MAX_PATH_LEN]; 20*273b8983SGovindraj Raja } mount; 21*273b8983SGovindraj Raja 22*273b8983SGovindraj Raja struct { 23*273b8983SGovindraj Raja char path[MAX_PATH_LEN]; 24*273b8983SGovindraj Raja dir_t dir; 25*273b8983SGovindraj Raja } stat; 26*273b8983SGovindraj Raja 27*273b8983SGovindraj Raja struct { 28*273b8983SGovindraj Raja char oldpath[MAX_PATH_LEN]; 29*273b8983SGovindraj Raja char newpath[MAX_PATH_LEN]; 30*273b8983SGovindraj Raja } bind; 31*273b8983SGovindraj Raja }; 32*273b8983SGovindraj Raja 33*273b8983SGovindraj RajaFormat of the dir_t structure as such: 34*273b8983SGovindraj Raja 35*273b8983SGovindraj Raja.. code:: c 36*273b8983SGovindraj Raja 37*273b8983SGovindraj Raja typedef struct { 38*273b8983SGovindraj Raja char name[NAMELEN]; 39*273b8983SGovindraj Raja long length; 40*273b8983SGovindraj Raja unsigned char mode; 41*273b8983SGovindraj Raja unsigned char index; 42*273b8983SGovindraj Raja unsigned char dev; 43*273b8983SGovindraj Raja qid_t qid; 44*273b8983SGovindraj Raja } dir_t; 45*273b8983SGovindraj Raja 46*273b8983SGovindraj Raja 47*273b8983SGovindraj Raja* Identifiers 48*273b8983SGovindraj Raja 49*273b8983SGovindraj Raja======================== ============================================= 50*273b8983SGovindraj RajaSMC_OK 0 51*273b8983SGovindraj RajaSMC_UNK -1 52*273b8983SGovindraj RajaDEBUGFS_E_INVALID_PARAMS -2 53*273b8983SGovindraj Raja======================== ============================================= 54*273b8983SGovindraj Raja 55*273b8983SGovindraj Raja======================== ============================================= 56*273b8983SGovindraj RajaMOUNT 0 57*273b8983SGovindraj RajaCREATE 1 58*273b8983SGovindraj RajaOPEN 2 59*273b8983SGovindraj RajaCLOSE 3 60*273b8983SGovindraj RajaREAD 4 61*273b8983SGovindraj RajaWRITE 5 62*273b8983SGovindraj RajaSEEK 6 63*273b8983SGovindraj RajaBIND 7 64*273b8983SGovindraj RajaSTAT 8 65*273b8983SGovindraj RajaINIT 10 66*273b8983SGovindraj RajaVERSION 11 67*273b8983SGovindraj Raja======================== ============================================= 68*273b8983SGovindraj Raja 69*273b8983SGovindraj RajaMOUNT 70*273b8983SGovindraj Raja~~~~~ 71*273b8983SGovindraj Raja 72*273b8983SGovindraj RajaDescription 73*273b8983SGovindraj Raja^^^^^^^^^^^ 74*273b8983SGovindraj RajaThis operation mounts a blob of data pointed to by path stored in `src`, at 75*273b8983SGovindraj Rajafilesystem location pointed to by path stored in `where`, using driver pointed 76*273b8983SGovindraj Rajato by path in `spec`. 77*273b8983SGovindraj Raja 78*273b8983SGovindraj RajaParameters 79*273b8983SGovindraj Raja^^^^^^^^^^ 80*273b8983SGovindraj Raja======== ============================================================ 81*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 82*273b8983SGovindraj Rajauint32_t ``MOUNT`` 83*273b8983SGovindraj Raja======== ============================================================ 84*273b8983SGovindraj Raja 85*273b8983SGovindraj RajaReturn values 86*273b8983SGovindraj Raja^^^^^^^^^^^^^ 87*273b8983SGovindraj Raja 88*273b8983SGovindraj Raja=============== ========================================================== 89*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 90*273b8983SGovindraj Raja 91*273b8983SGovindraj Raja w0 == DEBUGFS_E_INVALID_PARAMS if mount operation failed 92*273b8983SGovindraj Raja=============== ========================================================== 93*273b8983SGovindraj Raja 94*273b8983SGovindraj RajaOPEN 95*273b8983SGovindraj Raja~~~~ 96*273b8983SGovindraj Raja 97*273b8983SGovindraj RajaDescription 98*273b8983SGovindraj Raja^^^^^^^^^^^ 99*273b8983SGovindraj RajaThis operation opens the file path pointed to by `fname`. 100*273b8983SGovindraj Raja 101*273b8983SGovindraj RajaParameters 102*273b8983SGovindraj Raja^^^^^^^^^^ 103*273b8983SGovindraj Raja 104*273b8983SGovindraj Raja======== ============================================================ 105*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 106*273b8983SGovindraj Rajauint32_t ``OPEN`` 107*273b8983SGovindraj Rajauint32_t mode 108*273b8983SGovindraj Raja======== ============================================================ 109*273b8983SGovindraj Raja 110*273b8983SGovindraj Rajamode can be one of: 111*273b8983SGovindraj Raja 112*273b8983SGovindraj Raja.. code:: c 113*273b8983SGovindraj Raja 114*273b8983SGovindraj Raja enum mode { 115*273b8983SGovindraj Raja O_READ = 1 << 0, 116*273b8983SGovindraj Raja O_WRITE = 1 << 1, 117*273b8983SGovindraj Raja O_RDWR = 1 << 2, 118*273b8983SGovindraj Raja O_BIND = 1 << 3, 119*273b8983SGovindraj Raja O_DIR = 1 << 4, 120*273b8983SGovindraj Raja O_STAT = 1 << 5 121*273b8983SGovindraj Raja }; 122*273b8983SGovindraj Raja 123*273b8983SGovindraj RajaReturn values 124*273b8983SGovindraj Raja^^^^^^^^^^^^^ 125*273b8983SGovindraj Raja 126*273b8983SGovindraj Raja=============== ========================================================== 127*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 128*273b8983SGovindraj Raja 129*273b8983SGovindraj Raja w0 == DEBUGFS_E_INVALID_PARAMS if open operation failed 130*273b8983SGovindraj Raja 131*273b8983SGovindraj Rajauint32_t w1: file descriptor id on success. 132*273b8983SGovindraj Raja=============== ========================================================== 133*273b8983SGovindraj Raja 134*273b8983SGovindraj RajaCLOSE 135*273b8983SGovindraj Raja~~~~~ 136*273b8983SGovindraj Raja 137*273b8983SGovindraj RajaDescription 138*273b8983SGovindraj Raja^^^^^^^^^^^ 139*273b8983SGovindraj Raja 140*273b8983SGovindraj RajaThis operation closes a file described by a file descriptor obtained by a 141*273b8983SGovindraj Rajaprevious call to OPEN. 142*273b8983SGovindraj Raja 143*273b8983SGovindraj RajaParameters 144*273b8983SGovindraj Raja^^^^^^^^^^ 145*273b8983SGovindraj Raja 146*273b8983SGovindraj Raja======== ============================================================ 147*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 148*273b8983SGovindraj Rajauint32_t ``CLOSE`` 149*273b8983SGovindraj Rajauint32_t File descriptor id returned by OPEN 150*273b8983SGovindraj Raja======== ============================================================ 151*273b8983SGovindraj Raja 152*273b8983SGovindraj RajaReturn values 153*273b8983SGovindraj Raja^^^^^^^^^^^^^ 154*273b8983SGovindraj Raja=============== ========================================================== 155*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 156*273b8983SGovindraj Raja 157*273b8983SGovindraj Raja w0 == DEBUGFS_E_INVALID_PARAMS if close operation failed 158*273b8983SGovindraj Raja=============== ========================================================== 159*273b8983SGovindraj Raja 160*273b8983SGovindraj RajaREAD 161*273b8983SGovindraj Raja~~~~ 162*273b8983SGovindraj Raja 163*273b8983SGovindraj RajaDescription 164*273b8983SGovindraj Raja^^^^^^^^^^^ 165*273b8983SGovindraj Raja 166*273b8983SGovindraj RajaThis operation reads a number of bytes from a file descriptor obtained by 167*273b8983SGovindraj Rajaa previous call to OPEN. 168*273b8983SGovindraj Raja 169*273b8983SGovindraj RajaParameters 170*273b8983SGovindraj Raja^^^^^^^^^^ 171*273b8983SGovindraj Raja 172*273b8983SGovindraj Raja======== ============================================================ 173*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 174*273b8983SGovindraj Rajauint32_t ``READ`` 175*273b8983SGovindraj Rajauint32_t File descriptor id returned by OPEN 176*273b8983SGovindraj Rajauint32_t Number of bytes to read 177*273b8983SGovindraj Raja======== ============================================================ 178*273b8983SGovindraj Raja 179*273b8983SGovindraj RajaReturn values 180*273b8983SGovindraj Raja^^^^^^^^^^^^^ 181*273b8983SGovindraj Raja 182*273b8983SGovindraj RajaOn success, the read data is retrieved from the shared buffer after the 183*273b8983SGovindraj Rajaoperation. 184*273b8983SGovindraj Raja 185*273b8983SGovindraj Raja=============== ========================================================== 186*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 187*273b8983SGovindraj Raja 188*273b8983SGovindraj Raja w0 == DEBUGFS_E_INVALID_PARAMS if read operation failed 189*273b8983SGovindraj Raja 190*273b8983SGovindraj Rajauint32_t w1: number of bytes read on success. 191*273b8983SGovindraj Raja=============== ========================================================== 192*273b8983SGovindraj Raja 193*273b8983SGovindraj RajaSEEK 194*273b8983SGovindraj Raja~~~~ 195*273b8983SGovindraj Raja 196*273b8983SGovindraj RajaDescription 197*273b8983SGovindraj Raja^^^^^^^^^^^ 198*273b8983SGovindraj Raja 199*273b8983SGovindraj RajaMove file pointer for file described by given `file descriptor` of given 200*273b8983SGovindraj Raja`offset` related to `whence`. 201*273b8983SGovindraj Raja 202*273b8983SGovindraj RajaParameters 203*273b8983SGovindraj Raja^^^^^^^^^^ 204*273b8983SGovindraj Raja 205*273b8983SGovindraj Raja======== ============================================================ 206*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 207*273b8983SGovindraj Rajauint32_t ``SEEK`` 208*273b8983SGovindraj Rajauint32_t File descriptor id returned by OPEN 209*273b8983SGovindraj Rajasint32_t offset in the file relative to whence 210*273b8983SGovindraj Rajauint32_t whence 211*273b8983SGovindraj Raja======== ============================================================ 212*273b8983SGovindraj Raja 213*273b8983SGovindraj Rajawhence can be one of: 214*273b8983SGovindraj Raja 215*273b8983SGovindraj Raja========= ============================================================ 216*273b8983SGovindraj RajaKSEEK_SET 0 217*273b8983SGovindraj RajaKSEEK_CUR 1 218*273b8983SGovindraj RajaKSEEK_END 2 219*273b8983SGovindraj Raja========= ============================================================ 220*273b8983SGovindraj Raja 221*273b8983SGovindraj RajaReturn values 222*273b8983SGovindraj Raja^^^^^^^^^^^^^ 223*273b8983SGovindraj Raja 224*273b8983SGovindraj Raja=============== ========================================================== 225*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 226*273b8983SGovindraj Raja 227*273b8983SGovindraj Raja w0 == DEBUGFS_E_INVALID_PARAMS if seek operation failed 228*273b8983SGovindraj Raja=============== ========================================================== 229*273b8983SGovindraj Raja 230*273b8983SGovindraj RajaBIND 231*273b8983SGovindraj Raja~~~~ 232*273b8983SGovindraj Raja 233*273b8983SGovindraj RajaDescription 234*273b8983SGovindraj Raja^^^^^^^^^^^ 235*273b8983SGovindraj Raja 236*273b8983SGovindraj RajaCreate a link from `oldpath` to `newpath`. 237*273b8983SGovindraj Raja 238*273b8983SGovindraj RajaParameters 239*273b8983SGovindraj Raja^^^^^^^^^^ 240*273b8983SGovindraj Raja 241*273b8983SGovindraj Raja======== ============================================================ 242*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 243*273b8983SGovindraj Rajauint32_t ``BIND`` 244*273b8983SGovindraj Raja======== ============================================================ 245*273b8983SGovindraj Raja 246*273b8983SGovindraj RajaReturn values 247*273b8983SGovindraj Raja^^^^^^^^^^^^^ 248*273b8983SGovindraj Raja 249*273b8983SGovindraj Raja=============== ========================================================== 250*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 251*273b8983SGovindraj Raja 252*273b8983SGovindraj Raja w0 == DEBUGFS_E_INVALID_PARAMS if bind operation failed 253*273b8983SGovindraj Raja=============== ========================================================== 254*273b8983SGovindraj Raja 255*273b8983SGovindraj RajaSTAT 256*273b8983SGovindraj Raja~~~~ 257*273b8983SGovindraj Raja 258*273b8983SGovindraj RajaDescription 259*273b8983SGovindraj Raja^^^^^^^^^^^ 260*273b8983SGovindraj Raja 261*273b8983SGovindraj RajaPerform a stat operation on provided file `name` and returns the directory 262*273b8983SGovindraj Rajaentry statistics into `dir`. 263*273b8983SGovindraj Raja 264*273b8983SGovindraj RajaParameters 265*273b8983SGovindraj Raja^^^^^^^^^^ 266*273b8983SGovindraj Raja 267*273b8983SGovindraj Raja======== ============================================================ 268*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 269*273b8983SGovindraj Rajauint32_t ``STAT`` 270*273b8983SGovindraj Raja======== ============================================================ 271*273b8983SGovindraj Raja 272*273b8983SGovindraj RajaReturn values 273*273b8983SGovindraj Raja^^^^^^^^^^^^^ 274*273b8983SGovindraj Raja 275*273b8983SGovindraj Raja=============== ========================================================== 276*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 277*273b8983SGovindraj Raja 278*273b8983SGovindraj Raja w0 == DEBUGFS_E_INVALID_PARAMS if stat operation failed 279*273b8983SGovindraj Raja=============== ========================================================== 280*273b8983SGovindraj Raja 281*273b8983SGovindraj RajaINIT 282*273b8983SGovindraj Raja~~~~ 283*273b8983SGovindraj Raja 284*273b8983SGovindraj RajaDescription 285*273b8983SGovindraj Raja^^^^^^^^^^^ 286*273b8983SGovindraj RajaInitial call to setup the shared exchange buffer. Notice if successful once, 287*273b8983SGovindraj Rajasubsequent calls fail after a first initialization. The caller maps the same 288*273b8983SGovindraj Rajapage frame in its virtual space and uses this buffer to exchange string 289*273b8983SGovindraj Rajaparameters with filesystem primitives. 290*273b8983SGovindraj Raja 291*273b8983SGovindraj RajaParameters 292*273b8983SGovindraj Raja^^^^^^^^^^ 293*273b8983SGovindraj Raja 294*273b8983SGovindraj Raja======== ============================================================ 295*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 296*273b8983SGovindraj Rajauint32_t ``INIT`` 297*273b8983SGovindraj Rajauint64_t Physical address of the shared buffer. 298*273b8983SGovindraj Raja======== ============================================================ 299*273b8983SGovindraj Raja 300*273b8983SGovindraj RajaReturn values 301*273b8983SGovindraj Raja^^^^^^^^^^^^^ 302*273b8983SGovindraj Raja 303*273b8983SGovindraj Raja=============== ====================================================== 304*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 305*273b8983SGovindraj Raja 306*273b8983SGovindraj Raja w0 == DEBUGFS_E_INVALID_PARAMS if already initialized, 307*273b8983SGovindraj Raja or internal error occurred. 308*273b8983SGovindraj Raja=============== ====================================================== 309*273b8983SGovindraj Raja 310*273b8983SGovindraj RajaVERSION 311*273b8983SGovindraj Raja~~~~~~~ 312*273b8983SGovindraj Raja 313*273b8983SGovindraj RajaDescription 314*273b8983SGovindraj Raja^^^^^^^^^^^ 315*273b8983SGovindraj RajaReturns the debugfs interface version if implemented in TF-A. 316*273b8983SGovindraj Raja 317*273b8983SGovindraj RajaParameters 318*273b8983SGovindraj Raja^^^^^^^^^^ 319*273b8983SGovindraj Raja 320*273b8983SGovindraj Raja======== ============================================================ 321*273b8983SGovindraj Rajauint32_t FunctionID (0x87000010 / 0xC7000010) 322*273b8983SGovindraj Rajauint32_t ``VERSION`` 323*273b8983SGovindraj Raja======== ============================================================ 324*273b8983SGovindraj Raja 325*273b8983SGovindraj RajaReturn values 326*273b8983SGovindraj Raja^^^^^^^^^^^^^ 327*273b8983SGovindraj Raja 328*273b8983SGovindraj Raja=============== ====================================================== 329*273b8983SGovindraj Rajaint32_t w0 == SMC_OK on success 330*273b8983SGovindraj Raja 331*273b8983SGovindraj Raja w0 == SMC_UNK if interface is not implemented 332*273b8983SGovindraj Raja 333*273b8983SGovindraj Rajauint32_t w1: On success, debugfs interface version, 32 bits 334*273b8983SGovindraj Raja value with major version number in upper 16 bits and 335*273b8983SGovindraj Raja minor version in lower 16 bits. 336*273b8983SGovindraj Raja=============== ====================================================== 337*273b8983SGovindraj Raja 338*273b8983SGovindraj Raja* CREATE(1) and WRITE (5) command identifiers are unimplemented and 339*273b8983SGovindraj Raja return `SMC_UNK`. 340*273b8983SGovindraj Raja 341*273b8983SGovindraj Raja-------------- 342*273b8983SGovindraj Raja 343*273b8983SGovindraj Raja*Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.* 344