File: rshim.8

package info (click to toggle)
rshim-user-space 2.2.2%2Bdebian-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 504 kB
  • sloc: ansic: 7,730; sh: 622; perl: 62; makefile: 43
file content (184 lines) | stat: -rw-r--r-- 5,616 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
.\" Manpage for rshim.
.TH man 8 "18 Dec 2019" "2.0" "rshim man page"
.SH NAME
rshim \- user-space rshim driver for BlueField SoC
.SH SYNOPSIS
rshim [options]
.SH DESCRIPTION
rshim is the user-space rshim driver for BlueField SoC. It provides ways to access the rshim resources on the BlueField target via USB or PCIe from external host machine. The current version implements virtual console, virtual network interface, boot stream push, register access and some utility commands.

This driver will probe the rshim backend and create directory /dev/rshim<N> for each of them with the following device files.

.SS /dev/rshim<N>/boot
Boot device file used to push boot stream to the target, for example,

.in +4n
.nf
cat install.bfb > /dev/rshim<N>/boot

.SS /dev/rshim<N>/console
Console device file, which can be used by console tools to connect to the target, such as

.in +4n
.nf
screen /dev/rshim<N>/console

.SS /dev/rshim<N>/rshim
Device file used to access rshim register space. When reading/writing to this file, the offset is encoded as "((rshim_channel << 16) | register_offset)". This file can be used by tools like openocd to do CoreSight debugging.

.SS /dev/rshim<N>/misc
Key/Value pairs used to read/write misc information. For example

Display the output

.in +4n
.nf
cat /dev/rshim0/misc
    DISPLAY_LEVEL   0 (0:basic, 1:advanced, 2:log)
    BF_MODE         DPU mode
    BOOT_MODE       1 (0:rshim, 1:emmc, 2:emmc-boot-swap)
    BOOT_TIMEOUT    150 (seconds)
    USB_TIMEOUT     20 (seconds)
    DROP_MODE       0 (0:normal, 1:drop)
    SW_RESET        0 (1: reset)
    DEV_NAME        usb-1.1
    DEV_INFO        BlueField-2(Rev 1)
    OPN_STR         N/A
    FORCE_CMD       0 (1: send Force command)
.fi

Values for BF_MODE could be "Unknown", "DPU mode", "NIC mode", or, "Reserved"

.in

Initiate SW reset

.in +4n
.nf
echo "SW_RESET 1" > /dev/rshim<N>/misc
.fi
.in

Send a Force command to request the other rshim driver to release the rshim
device

.in +4n
.nf
echo "FORCE_CMD 1" > /dev/rshim<N>/misc
.fi
.in

Enable the advanced options

.in +4n
.nf
echo "DISPLAY_LEVEL 1" > /dev/rshim<N>/misc

cat /dev/rshim0/misc
    DISPLAY_LEVEL   1 (0:basic, 1:advanced, 2:log)
    BF_MODE         DPU mode
    BOOT_MODE       1 (0:rshim, 1:emmc, 2:emmc-boot-swap)
    BOOT_TIMEOUT    100 (seconds)
    SW_RESET        0 (1: reset)
    DEV_NAME        pcie-04:00.2
    DEV_INFO        BlueField-1(Rev 0)
    PEER_MAC        00:1a:ca:ff:ff:01 (rw)
    PXE_ID          0x00000000 (rw)
    VLAN_ID         0 0 (rw)
.fi
.in
.SH OPTIONS
-b, --backend
.in +4n
Specify the backend to attach, which can be one of usb, pcie or pcie_lf. If not specified, the driver will scan all rshim backends unless the '-d' option is given with a device name specified.
.in

-c, --cmdmode
.in +4n
Run rshim as command line rather than as driver. The following sub-commands are supported (only for USB backend).

    -g, --get-debug
    Get the current debug setting.

    -s, set-debug <0 | 1>
    Set the debug setting.
.in

-d, --device
.in +4n
Specify the device name to attach with the format below. The backend driver can be deduced from the device name, thus the '-b' option is not needed.

    PCIe backend:
        pcie-<bus>:<device>.<function>. Example: pcie-04:00.2
        Devices can be found with command 'lspci -n'.

    PCIe backend in livefish mode:
        pcie-lf-<bus>:<device>.<function>. Example: pcie-04:00.2
        Devices can be found with command 'lspci -n'.

    USB backend:
        usb-<bus>-xx.xx. Example: usb-2-1.7
        Devices can be found under /sys/bus/usb/devices/.
.in

-f, --foreground
.in +4n
Run in forground.
.in

-F, --force
.in +4n
Put rshim driver in ownership-forceable mode (aka. force mode). In this mode,
the driver will be put rshim driver in ownership-forceable mode (aka, Force
Mode):

1. It also always enables "/dev/rshim<N>/" creation even when rshim is not
attached, allowing user to manually send a ownership request to
"/dev/rshim<N>/misc" interface at any time.

2. It will send a one time ownership request command to the other rshim backend
upon start-up if the rshim interface is already attached by another backend.
This one-time request is for each rshim device present (one request for rshim0,
one for rshim1, etc) and will not be repeated until the next driver restart.

For example, if the current rshim driver is running from host via PCIe, but the
rshim device is already in use by the other rshim driver running from BMC via
USB, then the user can use this option to try to force the other rshim driver to
release the rshim device. The success of this operation depends on the other
rshim driver's implementation and behavior.

This option is equivalent to setting "FORCE_MODE" to 1 in rshim.conf.
.in

-i, --index
.in +4n
Specify the index to create device path /dev/rshim<index>. It's also used to create network interface name tmfifo_net<index>. This option is needed when multiple rshim instances are running.
.in

-l, --log-level
.in +4n
Log level (0:none, 1:error, 2:warning, 3:notice, 4:debug)
Log messages will be printed to standard output when running in foreground, or in syslog when running as a daemon.
.in

-v, --version
.in +4n
Display version
.in
.SH CONFIGURATION FILE
Rshim configuration file (/etc/rshim.conf) can be used to specify the static mapping between rshim devices and rshim names. It can also be used to ignore some rshim devices.

Example:
.in +4n
# Map usb-2-1.7 to rshim0
.br
rshim0       usb-2-1.7

# Map pcie-0000:04:00.2 to rshim1
.br
rshim1       pcie-0000:04:00.2

# Ignore usb-1-1.4
.br
none         usb-1-1.4
.in