xref: /linux/Documentation/ABI/testing/debugfs-driver-habanalabs (revision a9ecddb9e30af1485c8f41afb0264ec53ae6f5ed)
1c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/addr
2c2164773SOded GabbayDate:           Jan 2019
3c2164773SOded GabbayKernelVersion:  5.1
42f8db5a1SOded GabbayContact:        ogabbay@kernel.org
5c2164773SOded GabbayDescription:    Sets the device address to be used for read or write through
64a0ce776STomer Tayar                PCI bar, or the device VA of a host mapped memory to be read or
74a0ce776STomer Tayar                written directly from the host. The latter option is allowed
84a0ce776STomer Tayar                only when the IOMMU is disabled.
94a0ce776STomer Tayar                The acceptable value is a string that starts with "0x"
10c2164773SOded Gabbay
11ca62433fSOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/clk_gate
12ca62433fSOded GabbayDate:           May 2020
13ca62433fSOded GabbayKernelVersion:  5.8
142f8db5a1SOded GabbayContact:        ogabbay@kernel.org
15ca62433fSOded GabbayDescription:    Allow the root user to disable/enable in runtime the clock
16ca62433fSOded Gabbay                gating mechanism in Gaudi. Due to how Gaudi is built, the
17ca62433fSOded Gabbay                clock gating needs to be disabled in order to access the
18ca62433fSOded Gabbay                registers of the TPC and MME engines. This is sometimes needed
19e38bfd30SOded Gabbay                during debug by the user and hence the user needs this option.
20e38bfd30SOded Gabbay                The user can supply a bitmask value, each bit represents
21e38bfd30SOded Gabbay                a different engine to disable/enable its clock gating feature.
22e38bfd30SOded Gabbay                The bitmask is composed of 20 bits:
2354a19b4dSMauro Carvalho Chehab
2454a19b4dSMauro Carvalho Chehab                =======   ============
2554a19b4dSMauro Carvalho Chehab                0  -  7   DMA channels
2654a19b4dSMauro Carvalho Chehab                8  - 11   MME engines
2754a19b4dSMauro Carvalho Chehab                12 - 19   TPC engines
2854a19b4dSMauro Carvalho Chehab                =======   ============
2954a19b4dSMauro Carvalho Chehab
30e38bfd30SOded Gabbay                The bit's location of a specific engine can be determined
31e38bfd30SOded Gabbay                using (1 << GAUDI_ENGINE_ID_*). GAUDI_ENGINE_ID_* values
32e38bfd30SOded Gabbay                are defined in uapi habanalabs.h file in enum gaudi_engine_id
33ca62433fSOded Gabbay
34c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/command_buffers
35c2164773SOded GabbayDate:           Jan 2019
36c2164773SOded GabbayKernelVersion:  5.1
372f8db5a1SOded GabbayContact:        ogabbay@kernel.org
38c2164773SOded GabbayDescription:    Displays a list with information about the currently allocated
39c2164773SOded Gabbay                command buffers
40c2164773SOded Gabbay
41c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/command_submission
42c2164773SOded GabbayDate:           Jan 2019
43c2164773SOded GabbayKernelVersion:  5.1
442f8db5a1SOded GabbayContact:        ogabbay@kernel.org
45c2164773SOded GabbayDescription:    Displays a list with information about the currently active
46c2164773SOded Gabbay                command submissions
47c2164773SOded Gabbay
48c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/command_submission_jobs
49c2164773SOded GabbayDate:           Jan 2019
50c2164773SOded GabbayKernelVersion:  5.1
512f8db5a1SOded GabbayContact:        ogabbay@kernel.org
52c2164773SOded GabbayDescription:    Displays a list with detailed information about each JOB (CB) of
53c2164773SOded Gabbay                each active command submission
54c2164773SOded Gabbay
55c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/data32
56c2164773SOded GabbayDate:           Jan 2019
57c2164773SOded GabbayKernelVersion:  5.1
582f8db5a1SOded GabbayContact:        ogabbay@kernel.org
59c2164773SOded GabbayDescription:    Allows the root user to read or write directly through the
60c2164773SOded Gabbay                device's PCI bar. Writing to this file generates a write
61c2164773SOded Gabbay                transaction while reading from the file generates a read
624a0ce776STomer Tayar                transaction. This custom interface is needed (instead of using
63c2164773SOded Gabbay                the generic Linux user-space PCI mapping) because the DDR bar
64c2164773SOded Gabbay                is very small compared to the DDR memory and only the driver can
654a0ce776STomer Tayar                move the bar before and after the transaction.
6654a19b4dSMauro Carvalho Chehab
674a0ce776STomer Tayar                If the IOMMU is disabled, it also allows the root user to read
684a0ce776STomer Tayar                or write from the host a device VA of a host mapped memory
69c2164773SOded Gabbay
705cce5146SMoti HaimovskiWhat:           /sys/kernel/debug/habanalabs/hl<n>/data64
715cce5146SMoti HaimovskiDate:           Jan 2020
725cce5146SMoti HaimovskiKernelVersion:  5.6
732f8db5a1SOded GabbayContact:        ogabbay@kernel.org
745cce5146SMoti HaimovskiDescription:    Allows the root user to read or write 64 bit data directly
755cce5146SMoti Haimovski                through the device's PCI bar. Writing to this file generates a
765cce5146SMoti Haimovski                write transaction while reading from the file generates a read
775cce5146SMoti Haimovski                transaction. This custom interface is needed (instead of using
785cce5146SMoti Haimovski                the generic Linux user-space PCI mapping) because the DDR bar
795cce5146SMoti Haimovski                is very small compared to the DDR memory and only the driver can
805cce5146SMoti Haimovski                move the bar before and after the transaction.
8154a19b4dSMauro Carvalho Chehab
825cce5146SMoti Haimovski                If the IOMMU is disabled, it also allows the root user to read
835cce5146SMoti Haimovski                or write from the host a device VA of a host mapped memory
845cce5146SMoti Haimovski
85639781dcSOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/data_dma
86639781dcSOded GabbayDate:           Apr 2021
87639781dcSOded GabbayKernelVersion:  5.13
88639781dcSOded GabbayContact:        ogabbay@kernel.org
89639781dcSOded GabbayDescription:    Allows the root user to read from the device's internal
90639781dcSOded Gabbay                memory (DRAM/SRAM) through a DMA engine.
91639781dcSOded Gabbay                This property is a binary blob that contains the result of the
92639781dcSOded Gabbay                DMA transfer.
93639781dcSOded Gabbay                This custom interface is needed (instead of using the generic
94639781dcSOded Gabbay                Linux user-space PCI mapping) because the amount of internal
95639781dcSOded Gabbay                memory is huge (>32GB) and reading it via the PCI bar will take
96639781dcSOded Gabbay                a very long time.
97639781dcSOded Gabbay                This interface doesn't support concurrency in the same device.
98639781dcSOded Gabbay                In GAUDI and GOYA, this action can cause undefined behavior
99639781dcSOded Gabbay                in case the it is done while the device is executing user
100639781dcSOded Gabbay                workloads.
101639781dcSOded Gabbay                Only supported on GAUDI at this stage.
102639781dcSOded Gabbay
103c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/device
104c2164773SOded GabbayDate:           Jan 2019
105c2164773SOded GabbayKernelVersion:  5.1
1062f8db5a1SOded GabbayContact:        ogabbay@kernel.org
107c2164773SOded GabbayDescription:    Enables the root user to set the device to specific state.
108c2164773SOded Gabbay                Valid values are "disable", "enable", "suspend", "resume".
109c2164773SOded Gabbay                User can read this property to see the valid values
110c2164773SOded Gabbay
111639781dcSOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/dma_size
112639781dcSOded GabbayDate:           Apr 2021
113639781dcSOded GabbayKernelVersion:  5.13
114639781dcSOded GabbayContact:        ogabbay@kernel.org
115639781dcSOded GabbayDescription:    Specify the size of the DMA transaction when using DMA to read
116639781dcSOded Gabbay                from the device's internal memory. The value can not be larger
117639781dcSOded Gabbay                than 128MB. Writing to this value initiates the DMA transfer.
118639781dcSOded Gabbay                When the write is finished, the user can read the "data_dma"
119639781dcSOded Gabbay                blob
120639781dcSOded Gabbay
121639781dcSOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/dump_security_violations
122639781dcSOded GabbayDate:           Jan 2021
123639781dcSOded GabbayKernelVersion:  5.12
124639781dcSOded GabbayContact:        ogabbay@kernel.org
125639781dcSOded GabbayDescription:    Dumps all security violations to dmesg. This will also ack
126639781dcSOded Gabbay                all security violations meanings those violations will not be
127639781dcSOded Gabbay                dumped next time user calls this API
128639781dcSOded Gabbay
12906deb86aSTomer TayarWhat:           /sys/kernel/debug/habanalabs/hl<n>/engines
13006deb86aSTomer TayarDate:           Jul 2019
13106deb86aSTomer TayarKernelVersion:  5.3
1322f8db5a1SOded GabbayContact:        ogabbay@kernel.org
13306deb86aSTomer TayarDescription:    Displays the status registers values of the device engines and
13406deb86aSTomer Tayar                their derived idle status
13506deb86aSTomer Tayar
136c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/i2c_addr
137c2164773SOded GabbayDate:           Jan 2019
138c2164773SOded GabbayKernelVersion:  5.1
1392f8db5a1SOded GabbayContact:        ogabbay@kernel.org
140c2164773SOded GabbayDescription:    Sets I2C device address for I2C transaction that is generated
141c2164773SOded Gabbay                by the device's CPU
142c2164773SOded Gabbay
143c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/i2c_bus
144c2164773SOded GabbayDate:           Jan 2019
145c2164773SOded GabbayKernelVersion:  5.1
1462f8db5a1SOded GabbayContact:        ogabbay@kernel.org
147c2164773SOded GabbayDescription:    Sets I2C bus address for I2C transaction that is generated by
148c2164773SOded Gabbay                the device's CPU
149c2164773SOded Gabbay
150c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/i2c_data
151c2164773SOded GabbayDate:           Jan 2019
152c2164773SOded GabbayKernelVersion:  5.1
1532f8db5a1SOded GabbayContact:        ogabbay@kernel.org
154c2164773SOded GabbayDescription:    Triggers an I2C transaction that is generated by the device's
155c2164773SOded Gabbay                CPU. Writing to this file generates a write transaction while
1563e42d1deSCarlos Bilbao                reading from the file generates a read transaction
157c2164773SOded Gabbay
1583eb7754fSOfir BittonWhat:           /sys/kernel/debug/habanalabs/hl<n>/i2c_len
1593eb7754fSOfir BittonDate:           Dec 2021
1603eb7754fSOfir BittonKernelVersion:  5.17
1613eb7754fSOfir BittonContact:        obitton@habana.ai
1623eb7754fSOfir BittonDescription:    Sets I2C length in bytes for I2C transaction that is generated by
1633eb7754fSOfir Bitton                the device's CPU
1643eb7754fSOfir Bitton
165c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/i2c_reg
166c2164773SOded GabbayDate:           Jan 2019
167c2164773SOded GabbayKernelVersion:  5.1
1682f8db5a1SOded GabbayContact:        ogabbay@kernel.org
169c2164773SOded GabbayDescription:    Sets I2C register id for I2C transaction that is generated by
170c2164773SOded Gabbay                the device's CPU
171c2164773SOded Gabbay
172c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/led0
173c2164773SOded GabbayDate:           Jan 2019
174c2164773SOded GabbayKernelVersion:  5.1
1752f8db5a1SOded GabbayContact:        ogabbay@kernel.org
176c2164773SOded GabbayDescription:    Sets the state of the first S/W led on the device
177c2164773SOded Gabbay
178c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/led1
179c2164773SOded GabbayDate:           Jan 2019
180c2164773SOded GabbayKernelVersion:  5.1
1812f8db5a1SOded GabbayContact:        ogabbay@kernel.org
182c2164773SOded GabbayDescription:    Sets the state of the second S/W led on the device
183c2164773SOded Gabbay
184c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/led2
185c2164773SOded GabbayDate:           Jan 2019
186c2164773SOded GabbayKernelVersion:  5.1
1872f8db5a1SOded GabbayContact:        ogabbay@kernel.org
188c2164773SOded GabbayDescription:    Sets the state of the third S/W led on the device
189c2164773SOded Gabbay
190c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/mmu
191c2164773SOded GabbayDate:           Jan 2019
192c2164773SOded GabbayKernelVersion:  5.1
1932f8db5a1SOded GabbayContact:        ogabbay@kernel.org
194c2164773SOded GabbayDescription:    Displays the hop values and physical address for a given ASID
195c2164773SOded Gabbay                and virtual address. The user should write the ASID and VA into
196c2164773SOded Gabbay                the file and then read the file to get the result.
197c2164773SOded Gabbay                e.g. to display info about VA 0x1000 for ASID 1 you need to do:
198c2164773SOded Gabbay                echo "1 0x1000" > /sys/kernel/debug/habanalabs/hl0/mmu
199c2164773SOded Gabbay
200639781dcSOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/mmu_error
201639781dcSOded GabbayDate:           Mar 2021
202639781dcSOded GabbayKernelVersion:  5.12
203639781dcSOded GabbayContact:        fkassabri@habana.ai
204639781dcSOded GabbayDescription:    Check and display page fault or access violation mmu errors for
205639781dcSOded Gabbay                all MMUs specified in mmu_cap_mask.
206639781dcSOded Gabbay                e.g. to display error info for MMU hw cap bit 9, you need to do:
207639781dcSOded Gabbay                echo "0x200" > /sys/kernel/debug/habanalabs/hl0/mmu_error
208639781dcSOded Gabbay                cat /sys/kernel/debug/habanalabs/hl0/mmu_error
209639781dcSOded Gabbay
210c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/set_power_state
211c2164773SOded GabbayDate:           Jan 2019
212c2164773SOded GabbayKernelVersion:  5.1
2132f8db5a1SOded GabbayContact:        ogabbay@kernel.org
214c2164773SOded GabbayDescription:    Sets the PCI power state. Valid values are "1" for D0 and "2"
215c2164773SOded Gabbay                for D3Hot
216c2164773SOded Gabbay
2174d041216SYuri NudelmanWhat:           /sys/kernel/debug/habanalabs/hl<n>/skip_reset_on_timeout
2184d041216SYuri NudelmanDate:           Jun 2021
2194d041216SYuri NudelmanKernelVersion:  5.13
2204d041216SYuri NudelmanContact:        ynudelman@habana.ai
2214d041216SYuri NudelmanDescription:    Sets the skip reset on timeout option for the device. Value of
2224d041216SYuri Nudelman                "0" means device will be reset in case some CS has timed out,
2234d041216SYuri Nudelman                otherwise it will not be reset.
2244d041216SYuri Nudelman
225938b793fSYuri NudelmanWhat:           /sys/kernel/debug/habanalabs/hl<n>/state_dump
226938b793fSYuri NudelmanDate:           Oct 2021
227938b793fSYuri NudelmanKernelVersion:  5.15
228938b793fSYuri NudelmanContact:        ynudelman@habana.ai
229938b793fSYuri NudelmanDescription:    Gets the state dump occurring on a CS timeout or failure.
230938b793fSYuri Nudelman                State dump is used for debug and is created each time in case of
231938b793fSYuri Nudelman                a problem in a CS execution, before reset.
232938b793fSYuri Nudelman                Reading from the node returns the newest state dump available.
233938b793fSYuri Nudelman                Writing an integer X discards X state dumps, so that the
234938b793fSYuri Nudelman                next read would return X+1-st newest state dump.
235938b793fSYuri Nudelman
236639781dcSOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/stop_on_err
237639781dcSOded GabbayDate:           Mar 2020
238639781dcSOded GabbayKernelVersion:  5.6
239639781dcSOded GabbayContact:        ogabbay@kernel.org
240639781dcSOded GabbayDescription:    Sets the stop-on_error option for the device engines. Value of
241639781dcSOded Gabbay                "0" is for disable, otherwise enable.
242639781dcSOded Gabbay
243*a9ecddb9STomer TayarWhat:           /sys/kernel/debug/habanalabs/hl<n>/timeout_locked
244*a9ecddb9STomer TayarDate:           Sep 2021
245*a9ecddb9STomer TayarKernelVersion:  5.16
246*a9ecddb9STomer TayarContact:        obitton@habana.ai
247*a9ecddb9STomer TayarDescription:    Sets the command submission timeout value in seconds.
248*a9ecddb9STomer Tayar
249c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/userptr
250c2164773SOded GabbayDate:           Jan 2019
251c2164773SOded GabbayKernelVersion:  5.1
2522f8db5a1SOded GabbayContact:        ogabbay@kernel.org
253c2164773SOded GabbayDescription:    Displays a list with information about the currently user
254c2164773SOded Gabbay                pointers (user virtual addresses) that are pinned and mapped
255c2164773SOded Gabbay                to DMA addresses
256c2164773SOded Gabbay
25789b21365SYuri NudelmanWhat:           /sys/kernel/debug/habanalabs/hl<n>/userptr_lookup
25889b21365SYuri NudelmanDate:           Aug 2021
25989b21365SYuri NudelmanKernelVersion:  5.15
26089b21365SYuri NudelmanContact:        ogabbay@kernel.org
26189b21365SYuri NudelmanDescription:    Allows to search for specific user pointers (user virtual
26289b21365SYuri Nudelman                addresses) that are pinned and mapped to DMA addresses, and see
26389b21365SYuri Nudelman                their resolution to the specific dma address.
26489b21365SYuri Nudelman
265c2164773SOded GabbayWhat:           /sys/kernel/debug/habanalabs/hl<n>/vm
266c2164773SOded GabbayDate:           Jan 2019
267c2164773SOded GabbayKernelVersion:  5.1
2682f8db5a1SOded GabbayContact:        ogabbay@kernel.org
269c2164773SOded GabbayDescription:    Displays a list with information about all the active virtual
270a4371c1aSSagiv Ozeri                address mappings per ASID and all user mappings of HW blocks
271