Skip to content

Commit

Permalink
montblanc: add udev rules for jtag devices
Browse files Browse the repository at this point in the history
Summary:
Add udev rules to create symlink for JTAG master: user space programs
shall access the JTAG sysfs path using the symlink, because the sysfs
path is changed in the latest linux kernel.

Test Plan:
1) "bitbake montblanc-image" passed.
2) verified /run/devmap/jtag/ASPEED_JTAG was created at bootup time
   successfully:

root@bmc-oob:~# readlink /run/devmap/jtag/ASPEED_JTAG
/sys/devices/platform/ahb/1e6e0000.apb/1e6e4100.jtag
root@bmc-oob:~# ls /run/devmap/jtag/ASPEED_JTAG/
driver                                     of_node                                    tck
driver_override                            power                                      tdi
freq                                       sts                                        tdo
misc                                       subsystem                                  tms
modalias                                   supplier:platform:1e6e2000.syscon:pinctrl  uevent

Reviewed By: Scott8440

Differential Revision: D62366068

fbshipit-source-id: d64ce2062a95a09b6dbcd8385a92542248f81e99
  • Loading branch information
tao-ren authored and facebook-github-bot committed Sep 10, 2024
1 parent 8cdf17d commit de6b2c2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="platform", DEVPATH=="/devices/platform/ahb/*/1e6e4100.jtag", RUN+="/bin/mkdir -p /run/devmap/jtag", RUN+="/bin/ln -sf %S%p /run/devmap/jtag/ASPEED_JTAG"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program in a file named COPYING; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
LOCAL_URI += " \
file://jtag.rules \
"

do_install:append() {
dst=${D}${sysconfdir}/udev/
install -d ${dst}/rules.d

install -m 0644 jtag.rules ${dst}/rules.d/99-jtag.rules
}

FILES:${PN} += "${sysconfdir}"

0 comments on commit de6b2c2

Please sign in to comment.