U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
August 2023
- 227 participants
- 716 discussions

03 Aug '23
From: Jason Kacines <j-kacines(a)ti.com>
Bootloader debug usually tends to be a bit dicey prior to DDR and
serial port getting active in the system. JTAG typically remains the
only practical debug option during the initial bringup.
OpenOCD is one of the most popular environment for providing debug
capability via a GDB compatible interface for developers to work with.
Debugging U-Boot and bootloaders on K3 platform does have a bit of
tribal knowledge that is better documented in our common platform
documentation.
Signed-off-by: Jason Kacines <j-kacines(a)ti.com>
Signed-off-by: Nishanth Menon <nm(a)ti.com>
---
Changes from V3:
* Thank you Heinrich for very detailed comments - I think I have
addressed them here, if there are any misses, will fix.
* Additional change I did was to include relocaddr for symbol load
and refer to doc/README.arm-relocation for details on how to do.
This unfortunately trips a lot more people than I had expected,
but I hope I do some justice here.
* Side note: I am a bit miffed at https://github.com/openocd-org/openocd/commit/cc2d4f015f72d7c30d613b50572eb…
dropping build instructions.. but anyways, it was too
outdated anyways, the libjaylink etc are git submodules that bootstrap
updates and build uses locally unlike debian source build system, but
then we end up in the weeds if we try to add all details, so i added
your suggestion as well.
Diff of changes Vs V3 is here:
https://gist.github.com/nmenon/3487697a1c12c78d4ec34dbe6c4575b6
V3: https://lore.kernel.org/all/20230801174115.1318331-1-nm@ti.com/
V2: https://lore.kernel.org/all/20230729204500.31823-1-nm@ti.com/
V1: https://lore.kernel.org/u-boot/20230721191934.1959003-1-j-kacines@ti.com/
doc/board/ti/am62x_sk.rst | 24 ++
doc/board/ti/am65x_evm.rst | 24 ++
doc/board/ti/img/openocd-overview.svg | 580 ++++++++++++++++++++++++++
doc/board/ti/j7200_evm.rst | 24 ++
doc/board/ti/j721e_evm.rst | 24 ++
doc/board/ti/k3.rst | 514 +++++++++++++++++++++++
6 files changed, 1190 insertions(+)
create mode 100644 doc/board/ti/img/openocd-overview.svg
diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
index 637985cb096e..d720f84df3b0 100644
--- a/doc/board/ti/am62x_sk.rst
+++ b/doc/board/ti/am62x_sk.rst
@@ -246,3 +246,27 @@ https://www.ti.com/lit/pdf/spruiv7 under the `Boot Mode Pins` section.
- 11001010
For SW2 and SW1, the switch state in the "ON" position = 1.
+
+Debugging U-Boot
+----------------
+
+See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
+detailed setup information.
+
+.. warning::
+
+ **OpenOCD support since**: v0.12.0
+
+ If the default package version of OpenOCD in your development
+ environment's distribution needs to be updated, it might be necessary to
+ build OpenOCD from the source.
+
+.. include:: k3.rst
+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
+
+To start OpenOCD and connect to the board
+
+.. code-block:: bash
+
+ openocd -f board/ti_am625evm.cfg
diff --git a/doc/board/ti/am65x_evm.rst b/doc/board/ti/am65x_evm.rst
index 0129235c2b29..26dab3113471 100644
--- a/doc/board/ti/am65x_evm.rst
+++ b/doc/board/ti/am65x_evm.rst
@@ -287,3 +287,27 @@ artifacts needed to the device:
sb --ymodem tispl.bin > $MAIN_DEV < $MAIN_DEV
sleep 1
sb --xmodem u-boot.img > $MAIN_DEV < $MAIN_DEV
+
+Debugging U-Boot
+----------------
+
+See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
+detailed setup information.
+
+.. warning::
+
+ **OpenOCD support since**: v0.12.0
+
+ If the default package version of OpenOCD in your development
+ environment's distribution needs to be updated, it might be necessary to
+ build OpenOCD from the source.
+
+.. include:: k3.rst
+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
+
+To start OpenOCD and connect to the board
+
+.. code-block:: bash
+
+ openocd -f board/ti_am654evm.cfg
diff --git a/doc/board/ti/img/openocd-overview.svg b/doc/board/ti/img/openocd-overview.svg
new file mode 100644
index 000000000000..afb6f7472a4f
--- /dev/null
+++ b/doc/board/ti/img/openocd-overview.svg
@@ -0,0 +1,580 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause-->
+
+<!--Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/-->
+
+<svg
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ width="281px"
+ height="671px"
+ viewBox="-0.5 -0.5 281 671"
+ id="svg128"
+ sodipodi:docname="openocd-overview.svg"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)">
+ <metadata
+ id="metadata132">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="3440"
+ inkscape:window-height="1391"
+ id="namedview130"
+ showgrid="false"
+ inkscape:zoom="1.4068554"
+ inkscape:cx="283.8637"
+ inkscape:cy="385.05999"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg128" />
+ <defs
+ id="defs2" />
+ <g
+ id="g118">
+ <path
+ d="M 0 510 L 0 510 L 280 510 L 280 510"
+ fill="rgb(255, 255, 255)"
+ stroke="#ff0a1b"
+ stroke-miterlimit="10"
+ pointer-events="all"
+ id="path4" />
+ <path
+ d="M 0 510 L 0 670 L 280 670 L 280 510"
+ fill="none"
+ stroke="#ff0a1b"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path6" />
+ <rect
+ x="10"
+ y="590"
+ width="100"
+ height="70"
+ fill="#f8cecc"
+ stroke="#b85450"
+ pointer-events="none"
+ id="rect8" />
+ <path
+ d="M 20 590 L 20 660 M 100 590 L 100 660"
+ fill="none"
+ stroke="#b85450"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path10" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g16">
+ <switch
+ id="switch14">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 625px; margin-left: 21px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Cortex-R</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="60"
+ y="629"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text12">Cortex-R</text>
+ </switch>
+ </g>
+ <rect
+ x="170"
+ y="590"
+ width="100"
+ height="70"
+ fill="#f8cecc"
+ stroke="#b85450"
+ pointer-events="none"
+ id="rect18" />
+ <path
+ d="M 180 590 L 180 660 M 260 590 L 260 660"
+ fill="none"
+ stroke="#b85450"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path20" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g26">
+ <switch
+ id="switch24">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 625px; margin-left: 181px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Cortex-A</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="220"
+ y="629"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text22">Cortex-A</text>
+ </switch>
+ </g>
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g32">
+ <switch
+ id="switch30">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 530px; margin-left: 221px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">K3 SoC</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="250"
+ y="534"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text28">K3 SoC</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 550 L 140 570 L 60 570 L 60 583.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path34" />
+ <path
+ d="M 60 588.88 L 56.5 581.88 L 60 583.63 L 63.5 581.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path36" />
+ <path
+ d="M 140 550 L 140 570 L 220 570 L 220 583.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path38" />
+ <path
+ d="M 220 588.88 L 216.5 581.88 L 220 583.63 L 223.5 581.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path40" />
+ <rect
+ x="90"
+ y="520"
+ width="100"
+ height="30"
+ fill="#f8cecc"
+ stroke="#b85450"
+ pointer-events="none"
+ id="rect42" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g48">
+ <switch
+ id="switch46">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 98px; height: 1px; padding-top: 535px; margin-left: 91px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Debug SS</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="539"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text44">Debug SS</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 470 L 140 503.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path50" />
+ <path
+ d="M 140 508.88 L 136.5 501.88 L 140 503.63 L 143.5 501.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path52" />
+ <rect
+ x="80"
+ y="410"
+ width="120"
+ height="60"
+ rx="9"
+ ry="9"
+ fill="#ffe6cc"
+ stroke="#d79b00"
+ pointer-events="none"
+ id="rect54" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g60">
+ <switch
+ id="switch58">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 440px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Jtag Interface<xhtml:br />
+(XDS110, TUMPA..)</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="444"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text56">Jtag Interface...</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 370 L 140 403.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path62" />
+ <path
+ d="M 140 408.88 L 136.5 401.88 L 140 403.63 L 143.5 401.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path64" />
+ <rect
+ x="80"
+ y="310"
+ width="120"
+ height="60"
+ fill="#f5f5f5"
+ stroke="#666666"
+ pointer-events="none"
+ id="rect66" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g72">
+ <switch
+ id="switch70">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 340px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: #333333; ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">PC</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="344"
+ fill="#333333"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text68">PC</text>
+ </switch>
+ </g>
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g78">
+ <switch
+ id="switch76">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 385px; margin-left: 141px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">USB</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="170"
+ y="389"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text74">USB</text>
+ </switch>
+ </g>
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g84">
+ <switch
+ id="switch82">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 485px; margin-left: 141px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">JTAG</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="170"
+ y="489"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text80">JTAG</text>
+ </switch>
+ </g>
+ <path
+ d="M 100 230 L 180 230 L 200 270 L 180 310 L 100 310 L 80 270 Z"
+ fill="#e1d5e7"
+ stroke="#9673a6"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path86" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g92">
+ <switch
+ id="switch90">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 270px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">OpenOCD</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="274"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text88">OpenOCD</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 200 L 140 220 L 140 210 L 140 223.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path94" />
+ <path
+ d="M 140 228.88 L 136.5 221.88 L 140 223.63 L 143.5 221.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path96" />
+ <path
+ d="M 100 120 L 180 120 L 200 160 L 180 200 L 100 200 L 80 160 Z"
+ fill="#e1d5e7"
+ stroke="#9673a6"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path98" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g104">
+ <switch
+ id="switch102">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 160px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">GDB</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="164"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text100">GDB</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 80 L 140 113.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path106" />
+ <path
+ d="M 140 118.88 L 136.5 111.88 L 140 113.63 L 143.5 111.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path108" />
+ <path
+ d="M 80 0 L 200 0 L 200 68 Q 170 46.4 140 68 Q 110 89.6 80 68 L 80 12 Z"
+ fill="#e1d5e7"
+ stroke="#9673a6"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path110" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g116">
+ <switch
+ id="switch114">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 28px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">IDE debugging code</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="32"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text112">IDE debugging code</text>
+ </switch>
+ </g>
+ </g>
+</svg>
diff --git a/doc/board/ti/j7200_evm.rst b/doc/board/ti/j7200_evm.rst
index 69abc55a93ce..c1c1ec553863 100644
--- a/doc/board/ti/j7200_evm.rst
+++ b/doc/board/ti/j7200_evm.rst
@@ -201,3 +201,27 @@ fat formatted UDA FS as file.
In case of booting from eMMC, write above images into raw or UDA FS.
and set mmc partconf accordingly.
+
+Debugging U-Boot
+----------------
+
+See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
+detailed setup information.
+
+.. warning::
+
+ **OpenOCD support since**: v0.12.0
+
+ If the default package version of OpenOCD in your development
+ environment's distribution needs to be updated, it might be necessary to
+ build OpenOCD from the source.
+
+.. include:: k3.rst
+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
+
+To start OpenOCD and connect to the board
+
+.. code-block:: bash
+
+ openocd -f board/ti_j7200evm.cfg
diff --git a/doc/board/ti/j721e_evm.rst b/doc/board/ti/j721e_evm.rst
index f4b4c192d9da..735a0ce0e77e 100644
--- a/doc/board/ti/j721e_evm.rst
+++ b/doc/board/ti/j721e_evm.rst
@@ -228,3 +228,27 @@ J721E common processor board can be attached to a Ethernet QSGMII card and the
PHY in the card has to be reset before it can be used for data transfer.
"do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to
configure this PHY.
+
+Debugging U-Boot
+----------------
+
+See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
+detailed setup information.
+
+.. warning::
+
+ **OpenOCD support since**: v0.12.0
+
+ If the default package version of OpenOCD in your development
+ environment's distribution needs to be updated, it might be necessary to
+ build OpenOCD from the source.
+
+.. include:: k3.rst
+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
+
+To start OpenOCD and connect to the board
+
+.. code-block:: bash
+
+ openocd -f board/ti_j721eevm.cfg
diff --git a/doc/board/ti/k3.rst b/doc/board/ti/k3.rst
index 2034002af7cb..19a7123d610f 100644
--- a/doc/board/ti/k3.rst
+++ b/doc/board/ti/k3.rst
@@ -468,3 +468,517 @@ filesystem and then imported
=> fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
=> env import -t ${loadaddr} ${filesize}
+
+.. _k3_rst_refer_openocd:
+
+Common Debugging environment - OpenOCD
+--------------------------------------
+
+This section will show you how to connect a board to `OpenOCD
+<https://openocd.org/>`_ and load the SPL symbols for debugging with
+a K3 generation device. To follow this guide, you must build custom
+u-boot binaries, start your board from a boot media such as an SD
+card, and use an OpenOCD environment. This section uses generic
+examples, though you can apply these instructions to any supported K3
+generation device.
+
+The overall structure of this setup is in the following figure.
+
+.. image:: img/openocd-overview.svg
+
+.. note::
+
+ If you find these instructions useful, please consider `donating
+ <https://openocd.org/pages/donations.html>`_ to OpenOCD.
+
+Step 1: Download and install OpenOCD
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To get started, it is more convenient if the distribution you
+use supports OpenOCD by default. Follow the instructions in the
+`getting OpenOCD <https://openocd.org/pages/getting-openocd.html>`_
+documentation to pick the installation steps appropriate to your
+environment. Some references to OpenOCD documentation:
+
+* `OpenOCD User Guide <https://openocd.org/doc/html/index.html>`_
+* `OpenOCD Developer's Guide <https://openocd.org/doc/doxygen/html/index.html>`_
+
+Refer to the release notes corresponding to the `OpenOCD version
+<https://github.com/openocd-org/openocd/releases>`_ to ensure
+
+* Processor support: In general, processor support shouldn't present
+ any difficulties since OpenOCD provides solid support for both ARMv8
+ and ARMv7.
+* SoC support: When working with System-on-a-Chip (SoC), the support
+ usually comes as a TCL config file. It is vital to ensure the correct
+ version of OpenOCD or to use the TCL files from the latest release or
+ the one mentioned.
+* Board or the JTAG adapter support: In most cases, board support is
+ a relatively easy problem if the board has a JTAG pin header. All
+ you need to do is ensure that the adapter you select is compatible
+ with OpenOCD. Some boards come with an onboard JTAG adapter that
+ requires a USB cable to be plugged into the board, in which case, it
+ is vital to ensure that the JTAG adapter is supported. Fortunately,
+ almost all TI K3 SK/EVMs come with TI's XDS110, which has out of the
+ box support by OpenOCD. The board-specific documentation will
+ cover the details and any adapter/dongle recommendations.
+
+.. code-block:: bash
+
+ openocd -v
+
+.. note::
+
+ OpenOCD version 0.12.0 is usually required to connect to most K3
+ devices. If your device is only supported by a newer version than the
+ one provided by your distribution, you may need to build it from the source.
+
+Building OpenOCD from source
+""""""""""""""""""""""""""""
+
+The dependency package installation instructions below are for Debian
+systems, but equivalent instructions should exist for systems with
+other package managers. Please refer to the `OpenOCD Documentation
+<https://openocd.org/>`_ for more recent installation steps.
+
+.. code-block:: bash
+
+ $ # Check the packages to be installed: needs deb-src in sources.list
+ $ sudo apt build-dep openocd
+ $ # The following list is NOT complete - please check the latest
+ $ sudo apt-get install libtool pkg-config texinfo libusb-dev \
+ libusb-1.0.0-dev libftdi-dev libhidapi-dev autoconf automake
+ $ git clone https://github.com/openocd-org/openocd.git openocd
+ $ cd openocd
+ $ git submodule init
+ $ git submodule update
+ $ ./bootstrap
+ $ ./configure --prefix=/usr/local/
+ $ make -j`nproc`
+ $ sudo make install
+
+.. note::
+
+ The example above uses the GitHub mirror site. See
+ `git repo information <https://openocd.org/doc/html/Developers.html#OpenOCD-Git-Repository>`_
+ information to pick the official git repo.
+ If a specific version is desired, select the version using `git checkout tag`.
+
+Installing OpenOCD udev rules
+"""""""""""""""""""""""""""""
+
+The step is not necessary if the distribution supports the OpenOCD, but
+if building from a source, ensure that the udev rules are installed
+correctly to ensure a sane system.
+
+.. code-block:: bash
+
+ # Go to the OpenOCD source directory
+ $ cd openocd
+ # Copy the udev rules to the correct system location
+ $ sudo cp ./contrib/60-openocd.rules \
+ ./src/JTAG/drivers/libjaylink/contrib/99-libjaylink.rules \
+ /etc/udev/rules.d/
+ # Get Udev to load the new rules up
+ $ sudo udevadm control --reload-rules
+ # Use the new rules on existing connected devices
+ $ sudo udevadm trigger
+
+Step 2: Setup GDB
+^^^^^^^^^^^^^^^^^
+
+Most systems come with gdb-multiarch package.
+
+.. code-block:: bash
+
+ # Install gdb-multiarch package
+ $ sudo apt-get install gdb-multiarch
+
+Though using GDB natively is normal, developers with interest in using IDE
+may find a few of these interesting:
+
+* `gdb-dashboard <https://github.com/cyrus-and/gdb-dashboard>`_
+* `gef <https://github.com/hugsy/gef>`_
+* `peda <https://github.com/longld/peda>`_
+* `pwndbg <https://github.com/pwndbg/pwndbg>`_
+* `voltron <https://github.com/snare/voltron>`_
+* `ddd <https://www.gnu.org/software/ddd/>`_
+* `vscode <https://www.justinmklam.com/posts/2017/10/vscode-debugger-setup/>`_
+* `vim conque-gdb <https://github.com/vim-scripts/Conque-GDB>`_
+* `emacs realgud <https://github.com/realgud/realgud/wiki/gdb-notes>`_
+* `Lauterbach IDE <https://www2.lauterbach.com/pdf/backend_gdb.pdf>`_
+
+.. warning::
+ LLDB support for OpenOCD is still a work in progress as of this writing.
+ Using GDB is probably the safest option at this point in time.
+
+Step 3: Connect board to PC
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+There are few patterns of boards in the ecosystem
+
+.. k3_rst_include_start_openocd_connect_XDS110
+
+**Integrated JTAG adapter/dongle**: The board has a micro-USB connector labelled
+XDS110 USB or JTAG. Connect a USB cable to the board to the mentioned port.
+
+.. note::
+
+ There are multiple USB ports on a typical board, So, ensure you have read
+ the user guide for the board and confirmed the silk screen label to ensure
+ connecting to the correct port.
+
+.. k3_rst_include_end_openocd_connect_XDS110
+
+.. k3_rst_include_start_openocd_connect_cti20
+
+**cTI20 connector**: The TI's `cTI20
+<https://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_JTAG_connec…>`_ connector
+is probably the most prevelant on TI platforms. Though many
+TI boards have an onboard XDS110, cTI20 connector is usually
+provided as an alternate scheme to connect alternatives such
+as `Lauterbach <https://www.lauterbach.com/>`_ or `XDS560
+<https://www.ti.com/tool/TMDSEMU560V2STM-U>`_.
+
+To debug on these boards, the following combinations is suggested:
+
+* `TUMPA <https://www.diygadget.com/JTAG-cables-and-microcontroller-programmers/tiao-…>`_
+ or `equivalent dongles supported by OpenOCD. <https://openocd.org/doc/html/Debug-Adapter-Hardware.html#Debug-Adapter-Hard…>`_
+* Cable such as `Tag-connect ribbon cable <https://www.tag-connect.com/product/20-pin-cortex-ribbon-cable-4-length-wit…>`_
+* Adapter to convert cTI20 to ARM20 such as those from
+ `Segger <https://www.segger.com/products/debug-probes/j-link/accessories/adapters/ti…>`_
+ or `Lauterbach LA-3780 <https://www.lauterbach.com/ad3780.html>`_
+ Or optionally, if you have manufacturing capability then you could try
+ `BeagleBone JTAG Adapter <https://github.com/mmorawiec/BeagleBone-Black-JTAG-Adapters>`_
+
+.. warning::
+ XDS560 and Lauterbach are proprietary solutions and is not supported by
+ OpenOCD.
+ When purchasing an off the shelf adapter/dongle, you do want to be careful
+ about the signalling though. Please
+ `read for additional info <https://software-dl.ti.com/ccs/esd/xdsdebugprobes/emu_JTAG_connectors.html>`_.
+
+.. k3_rst_include_end_openocd_connect_cti20
+
+.. k3_rst_include_start_openocd_connect_tag_connect
+
+**Tag-Connect**: `Tag-Connect <https://www.tag-connect.com/>`_
+pads on the boards which require special cable. Please check the documentation
+to `identify <https://www.tag-connect.com/info/legs-or-no-legs>`_ if "legged"
+or "no-leg" version of the cable is appropriate for the board.
+
+To debug on these boards, you will need:
+
+* `TUMPA <https://www.diygadget.com/JTAG-cables-and-microcontroller-programmers/tiao-…>`_
+ or `equivalent dongles supported by OpenOCD <https://openocd.org/doc/html/Debug-Adapter-Hardware.html#Debug-Adapter-Hard…>`_.
+* Tag-Connect cable appropriate to the board such as
+ `TC2050-IDC-NL <https://www.tag-connect.com/product/TC2050-IDC-NL-10-pin-no-legs-cable-with…>`_
+* In case of no-leg, version, a
+ `retaining clip <https://www.tag-connect.com/product/tc2050-clip-3pack-retaining-clip>`_
+* Tag-Connect to ARM20
+ `adapter <https://www.tag-connect.com/product/tc2050-arm2010-arm-20-pin-to-tc2050-ada…>`_
+
+.. note::
+ You can optionally use a 3d printed solution such as
+ `Protective cap <https://www.thingiverse.com/thing:3025584>`_ or
+ `clip <https://www.thingiverse.com/thing:3035278>`_ to replace
+ the retaining clip.
+
+.. warning::
+ With the Tag-Connect to ARM20 adapter, Please solder the "Trst" signal for
+ connection to work.
+
+.. k3_rst_include_end_openocd_connect_tag_connect
+
+Debugging with OpenOCD
+^^^^^^^^^^^^^^^^^^^^^^
+
+Debugging U-Boot is different from debugging regular user space
+applications. The bootloader initialization process involves many boot
+media and hardware configuration operations. For K3 devices, there
+are also interactions with security firmware. While reloading the
+"elf" file works through GDB, developers must be mindful of cascading
+initialization's potential consequences.
+
+Consider the following code change:
+
+.. code-block:: diff
+
+ --- a/file.c 2023-07-29 10:55:29.647928811 -0500
+ +++ b/file.c 2023-07-29 10:55:46.091856816 -0500
+ @@ -1,3 +1,3 @@
+ val = readl(reg);
+ -val |= 0x2;
+ +val |= 0x1;
+ writel(val, reg);
+
+Re-running the elf file with the above change will result in the
+register setting 0x3 instead of the intended 0x1. There are other
+hardware blocks which may not behave very well with a re-initialization
+without proper shutdown.
+
+To help narrow the debug down, it is usually simpler to use the
+standard boot media to get to the bootloader and debug only in the area
+of interest.
+
+In general, to debug u-boot spl/u-boot with OpenOCD there are three steps:
+
+* Modify the code adding a loop to allow the debugger to attach
+ near the point of interest. Boot up normally to stop at the loop.
+* Connect with OpenOCD and step out of the loop.
+* Step through the code to find the root of issue.
+
+Typical debugging involves a few iterations of the above sequence.
+Though most bootloader developers like to use printf to debug,
+debug with JTAG tends to be most efficient since it is possible to
+investigate the code flow and inspect hardware registers without
+repeated iterations.
+
+Code modification
+"""""""""""""""""
+
+* **start.S**: Adding an infinite while loop at the very entry of
+ U-Boot. For this, look for the corresponding start.S entry file.
+ This is usually only required when debugging some core SoC or
+ processor related function. For example: arch/arm/cpu/armv8/start.S or
+ arch/arm/cpu/armv7/start.S
+
+.. code-block:: diff
+
+ diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
+ index 69e281b086..744929e825 100644
+ --- a/arch/arm/cpu/armv7/start.S
+ +++ b/arch/arm/cpu/armv7/start.S
+ @@ -37,6 +37,8 @@
+ #endif
+
+ reset:
+ +dead_loop:
+ + b dead_loop
+ /* Allow the board to save important registers */
+ b save_boot_params
+ save_boot_params_ret:
+
+* **board_init_f**: Adding an infinite while loop at the board entry
+ function. In many cases, it is important to debug the boot process if
+ any changes are made for board-specific applications. Below is a step
+ by step process for debugging the boot SPL or Armv8 SPL:
+
+ To debug the boot process in either domain, we will first
+ add a modification to the code we would like to debug.
+ In this example, we will debug ``board_init_f`` inside
+ ``arch/arm/mach-k3/{soc}_init.c``. Since some sections of U-Boot
+ will be executed multiple times during the bootup process of K3
+ devices, we will need to include either ``CONFIG_CPU_ARM64`` or
+ ``CONFIG_CPU_V7R`` to catch the CPU at the desired place during the
+ bootup process (Main or Wakeup domains). For example, modify the
+ file as follows (depending on need):
+
+.. code-block:: c
+
+ void board_init_f(ulong dummy)
+ {
+ .
+ .
+ /* Code to run on the R5F (Wakeup/Boot Domain) */
+ if (IS_ENABLED(CONFIG_CPU_V7R)) {
+ volatile int x = 1;
+ while(x) {};
+ }
+ ...
+ /* Code to run on the ARMV8 (Main Domain) */
+ if (IS_ENABLED(CONFIG_CPU_ARM64)) {
+ volatile int x = 1;
+ while(x) {};
+ }
+ .
+ .
+ }
+
+Connecting with OpenOCD for a debug session
+"""""""""""""""""""""""""""""""""""""""""""
+
+Startup OpenOCD to debug the platform as follows:
+
+* **Integrated JTAG interface**: If the evm has a debugger such as
+ XDS110 inbuilt, there is typically an evm board support added and a
+ cfg file will be available.
+
+.. k3_rst_include_start_openocd_cfg_XDS110
+
+.. code-block:: bash
+
+ openocd -f board/{board_of_choice}.cfg
+
+.. k3_rst_include_end_openocd_cfg_XDS110
+
+.. k3_rst_include_start_openocd_cfg_external_intro
+
+* **External JTAG adapter/interface**: In other cases, where an
+ adapter/dongle is used, a simple cfg file can be created to integrate the
+ SoC and adapter information. See `supported TI K3 SoCs
+ <https://github.com/openocd-org/openocd/blob/master/tcl/target/ti_k3.cfg#L59>`_
+ to decide if the SoC is supported or not.
+
+.. code-block:: bash
+
+ openocd -f openocd_connect.cfg
+
+.. k3_rst_include_end_openocd_cfg_external_intro
+
+ For example, with BeaglePlay (AM62X platform), the openocd_connect.cfg:
+
+.. code-block:: tcl
+
+ # TUMPA example:
+ # http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual
+ source [find interface/ftdi/tumpa.cfg]
+
+ transport select jtag
+
+ # default JTAG configuration has only SRST and no TRST
+ reset_config srst_only srst_push_pull
+
+ # delay after SRST goes inactive
+ adapter srst delay 20
+
+ if { ![info exists SOC] } {
+ # Set the SoC of interest
+ set SOC am625
+ }
+
+ source [find target/ti_k3.cfg]
+
+ ftdi tdo_sample_edge falling
+
+ # Speeds for FT2232H are in multiples of 2, and 32MHz is tops
+ # max speed we seem to achieve is ~20MHz.. so we pick 16MHz
+ adapter speed 16000
+
+Below is an example of the output of this command:
+
+.. code-block:: console
+
+ Info : Listening on port 6666 for tcl connections
+ Info : Listening on port 4444 for telnet connections
+ Info : XDS110: connected
+ Info : XDS110: vid/pid = 0451/bef3
+ Info : XDS110: firmware version = 3.0.0.20
+ Info : XDS110: hardware version = 0x002f
+ Info : XDS110: connected to target via JTAG
+ Info : XDS110: TCK set to 2500 kHz
+ Info : clock speed 2500 kHz
+ Info : JTAG tap: am625.cpu tap/device found: 0x0bb7e02f (mfg: 0x017 (Texas Instruments), part: 0xbb7e, ver: 0x0)
+ Info : starting gdb server for am625.cpu.sysctrl on 3333
+ Info : Listening on port 3333 for gdb connections
+ Info : starting gdb server for am625.cpu.a53.0 on 3334
+ Info : Listening on port 3334 for gdb connections
+ Info : starting gdb server for am625.cpu.a53.1 on 3335
+ Info : Listening on port 3335 for gdb connections
+ Info : starting gdb server for am625.cpu.a53.2 on 3336
+ Info : Listening on port 3336 for gdb connections
+ Info : starting gdb server for am625.cpu.a53.3 on 3337
+ Info : Listening on port 3337 for gdb connections
+ Info : starting gdb server for am625.cpu.main0_r5.0 on 3338
+ Info : Listening on port 3338 for gdb connections
+ Info : starting gdb server for am625.cpu.gp_mcu on 3339
+ Info : Listening on port 3339 for gdb connections
+
+.. note::
+ Notice the default configuration is non-SMP configuration allowing
+ for each of the core to be attached and debugged simultaneously.
+ ARMv8 SPL/U-Boot starts up on cpu0 of a53/a72.
+
+.. k3_rst_include_start_openocd_cfg_external_gdb
+
+To debug using this server, use GDB directly or your preferred
+GDB-based IDE. To start up GDB in the terminal, run the following
+command.
+
+.. code-block:: bash
+
+ gdb-multiarch
+
+To connect to your desired core, run the following command within GDB:
+
+.. code-block:: bash
+
+ target extended-remote localhost:{port for desired core}
+
+To load symbols:
+
+.. warning::
+
+ SPL and U-Boot does a re-location of address compared to where it
+ is loaded originally. This step takes place after the DDR size is
+ determined from dt parsing. So, debugging can be split into either
+ "before re-location" or "after re-location". Please refer to the
+ file ''doc/README.arm-relocation'' to see how to grab the relocation
+ address.
+
+* Prior to relocation:
+
+.. code-block:: bash
+
+ symbol-file {path to elf file}
+
+* After relocation:
+
+.. code-block:: bash
+
+ # Drop old symbol file
+ symbol-file
+ # Pick up new relocaddr
+ add-symbol-file {path to elf file} {relocaddr}
+
+.. k3_rst_include_end_openocd_cfg_external_gdb
+
+In the above example of AM625,
+
+.. code-block:: bash
+
+ target extended-remote localhost:3338 <- R5F (Wakeup Domain)
+ target extended-remote localhost:3334 <- A53 (Main Domain)
+
+The core can now be debugged directly within GDB using GDB commands or
+if using IDE, as appropriate to the IDE.
+
+Stepping through the code
+"""""""""""""""""""""""""
+
+`GDB TUI Commands
+<https://sourceware.org/gdb/onlinedocs/gdb/TUI-Commands.html>`_ can
+help set up the display more sensible for debug. Provide the name
+of the layout that can be used to debug. For example, use the GDB
+command ``layout src`` after loading the symbols to see the code and
+breakpoints. To exit the debug loop added above, add any breakpoints
+needed and run the following GDB commands to step out of the debug
+loop set in the ``board_init_f`` function.
+
+.. code-block:: bash
+
+ set x = 0
+ continue
+
+The platform has now been successfully setup to debug with OpenOCD
+using GDB commands or a GDB-based IDE. See `OpenOCD documentation for
+GDB <https://openocd.org/doc/html/GDB-and-OpenOCD.html>`_ for further
+information.
+
+.. warning::
+
+ On the K3 family of devices, a watchdog timer within the DMSC is
+ enabled by default by the ROM bootcode with a timeout of 3 minutes.
+ The watchdog timer is serviced by System Firmware (SYSFW) or TI
+ Foundational Security (TIFS) during normal operation. If debugging
+ the SPL before the SYSFW is loaded, the watchdog timer will not get
+ serviced automatically and the debug session will reset after 3
+ minutes. It is recommended to start debugging SPL code only after
+ the startup of SYSFW to avoid running into the watchdog timer reset.
+
+Miscellaneous notes with OpenOCD
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Currently, OpenOCD does not support tracing for K3 platforms. Tracing
+function could be beneficial if the bug in code occurs deep within
+nested function and can optionally save developers major trouble of
+stepping through a large quantity of code.
--
2.40.0
1
0
StarFive VF2 VTI usb-host controller connect to pcie0 RC.
Enable pcie0 first the enable USB function.
patch1 is Get the correct ECAM offset in multiple PCIe RC.
patch2 is enable pcie0 dts node.
patch3 is enable SYS_CACHE_LINE_SIZE
patch4 is Add VF2 USB related configuration.
Minda Chen (4):
pci: plda: Get correct ECAM offset in multiple PCIe RC case
riscv: dts: starfive: Enable pcie0 dts node
riscv: starfive: Add SYS_CACHE_SHIFT_6 to enable SYS_CACHE_LINE_SIZE
configs: riscv: starfive: Add VF2 PCIe XHCI config support
arch/riscv/Kconfig | 1 +
arch/riscv/dts/jh7110-starfive-visionfive-2.dtsi | 2 +-
configs/starfive_visionfive2_defconfig | 5 +++++
drivers/pci/pcie_plda_common.c | 5 +++--
4 files changed, 10 insertions(+), 3 deletions(-)
base-commit: 38dedebc547f795efc3daad17f7c013c515e1285
--
2.17.1
2
6
Hi Tom,
The following changes since commit 7755b2200777f72dca87dd169138e95f011bbcb9:
Merge tag 'x86-pull-20230801' of https://source.denx.de/u-boot/custodians/u-boot-x86 (2023-08-01 11:57:55 -0400)
are available in the Git repository at:
https://source.denx.de/u-boot/custodians/u-boot-riscv.git
for you to fetch changes up to 093bd0354e5b947b0bd634bf5ed4041ba075b57d:
acpi: Add missing RISC-V acpi_table header (2023-08-02 11:02:33 +0800)
CI result shows no issue: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/17177
----------------------------------------------------------------
+ Fix compilation error for CI when enabling RTL8169 driver
+ Fix compilation error for pci_mmc.c by adding acpi_table header file
+ Support StarFive JH7110 PCIe driver
+ Enable PCI on Unmatched board
----------------------------------------------------------------
Heinrich Schuchardt (2):
riscv: sifive: initialize PCI on Unmatched
acpi: Add missing RISC-V acpi_table header
Mason Huo (3):
starfive: pci: Add StarFive JH7110 pcie driver
configs: starfive-jh7110: Add support for PCIe host driver
riscv: dts: starfive: Enable PCIe host controller
Minda Chen (5):
i2c: designware: Add Kconfig for designware_i2c_pci.c
net: rtl8169: Fix compile warning in rtl8169
net: rtl8169: Fix DMA minimal aligned compile warning in RISC-V
net: rtl8169: Add one device ID 0x8161
configs: starfive-jh7110: Add CONFIG_RTL8169
arch/riscv/dts/jh7110-starfive-visionfive-2.dtsi | 11 +++++++
arch/riscv/dts/jh7110.dtsi | 74 +++++++++++++++++++++++++++++++++++++++++
arch/riscv/include/asm/acpi_table.h | 11 +++++++
configs/sifive_unmatched_defconfig | 1 +
configs/starfive_visionfive2_defconfig | 8 +++++
drivers/i2c/Kconfig | 9 +++++
drivers/i2c/Makefile | 4 +--
drivers/net/rtl8169.c | 22 ++++++++-----
drivers/pci/Kconfig | 13 ++++++++
drivers/pci/Makefile | 2 ++
drivers/pci/pcie_plda_common.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/pci/pcie_plda_common.h | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/pci/pcie_starfive_jh7110.c | 317 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13 files changed, 694 insertions(+), 12 deletions(-)
create mode 100644 arch/riscv/include/asm/acpi_table.h
create mode 100644 drivers/pci/pcie_plda_common.c
create mode 100644 drivers/pci/pcie_plda_common.h
create mode 100644 drivers/pci/pcie_starfive_jh7110.c
Best regards,
Leo
3
3

03 Aug '23
Hi all,
I'd like to have some ideas for debugging this conditions.
When compiling with default gnu toolchain. It works great.
When compiling with clang (clang-14 or clang-15),
I'll get hang sometimes.
The following are two boot logs:
1.
U-Boot SPL 2023.10-rc1-00207-g38dedebc54-dirty (Aug 03 2023 - 08:08:00 +0800)
Trying to boot from MMC1
## Checking hash(es) for config config-1 ... OK
## Checking hash(es) for Image atf-1 ... sha256+ OK
## Checking hash(es) for Image u-boot ... sha256+ OK
## Checking hash(es) for Image fdt-1 ... sha256+ OK
## Checking hash(es) for Image atf-2 ... sha256+ OK
## Checking hash(es) for Image atf-3 ... sha256+ OK
## Checking hash(es) for Image atf-4 ... sha256+ OK
spl_load_fit_image: Skip load 'atf-5': image size is 0!
U-Boot 2023.10-rc1-00207-g38dedebc54-dirty (Aug 03 2023 - 08:08:00 +0800)
SoC: Rockchip rk3399
Reset cause: POR
Model: Radxa ROCK Pi 4A
DRAM: initcall sequence 00000000002aeb80 failed at call 00000000002042a8 (err=-
19)
### ERROR ### Please RESET the board ###
2.
U-Boot TPL 2023.04-maybe-dirty (Jan 01 1970 - 00:00:00)
lpddr4_set_rate: change freq to 400MHz 0, 1
Channel 0: LPDDR4, 400MHz
BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 400MHz
BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 Die BW=16 Size=2048MB
256B stride
lpddr4_set_rate: change freq to 800MHz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...
U-Boot SPL 2023.04-maybe-dirty (Jan 01 1970 - 00:00:00 +0000)
Trying to boot from MMC1
fdt_addr: 0x2e9c88
Device tree error at node '__symbols__'
Some drivers failed to bind
initcall sequence 00000000002a95f8 failed at call 0000000000224138 (err=-11)
### ERROR ### Please RESET the board ###
As you can see, the bug happened at difference places. For the difference of 1 and 2, I just turn on
the "fastboot over UDP" function.
Bisect is not working. Because if I keep turn on/off more extra functions (like fastboot over USB)
it can boot sometimes. It seems to me that this could be some alignment or size of code problem
because if I turn on something, the size of the binaries will be different. And some of it works,
some not.
Now I only know that v2023.01 works well. And v2023.04 is unstable. I tried to bisect between them
but found an unrelated commit. Because some bad commit could runs good just because of the probability.
Any ideas on how to debug this further?
I'm building U-boot by.
make O="/tmp/a1" \
CROSS_COMPILE="aarch64-linux-gnu-" \
CC="clang -target aarch64-linux-gnu" \
HOSTCC="clang" \
rock-pi-4-rk3399_defconfig
make O="/tmp/a1" \
CROSS_COMPILE="aarch64-linux-gnu-" \
CC="clang -target aarch64-linux-gnu" \
HOSTCC="clang"
In Debian Trixie.
Yours,
Paul
2
1

03 Aug '23
From: Jason Kacines <j-kacines(a)ti.com>
Bootloader debug usually tends to be a bit dicey prior to DDR and
serial port getting active in the system. JTAG typically remains the
only practical debug option during the initial bringup.
OpenOCD is one of the most popular environment for providing debug
capability via a gdb compatible interface for developers to work with.
Debugging U-boot and bootloaders on K3 platform does have a bit of
tribal knowledge that is better documented in our common platform
documentation.
Signed-off-by: Jason Kacines <j-kacines(a)ti.com>
Signed-off-by: Nishanth Menon <nm(a)ti.com>
---
Changes since V2:
* Review comments and further grammatical fixes
* Added openOCD version supported in each of the board documentation
V2: https://lore.kernel.org/all/20230729204500.31823-1-nm@ti.com/
V1: https://lore.kernel.org/u-boot/20230721191934.1959003-1-j-kacines@ti.com/
doc/board/ti/am62x_sk.rst | 24 ++
doc/board/ti/am65x_evm.rst | 24 ++
doc/board/ti/img/openocd-overview.svg | 580 ++++++++++++++++++++++++++
doc/board/ti/j7200_evm.rst | 24 ++
doc/board/ti/j721e_evm.rst | 24 ++
doc/board/ti/k3.rst | 481 +++++++++++++++++++++
6 files changed, 1157 insertions(+)
create mode 100644 doc/board/ti/img/openocd-overview.svg
diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
index 637985cb096e..9f577fe0f430 100644
--- a/doc/board/ti/am62x_sk.rst
+++ b/doc/board/ti/am62x_sk.rst
@@ -246,3 +246,27 @@ https://www.ti.com/lit/pdf/spruiv7 under the `Boot Mode Pins` section.
- 11001010
For SW2 and SW1, the switch state in the "ON" position = 1.
+
+Debugging U-boot
+----------------
+
+See :ref:`Common Debugging environment - openOCD<k3_rst_refer_openocd>`: for
+detailed setup information.
+
+.. warning::
+
+ **OpenOCD support since**: v0.12.0
+
+ If the default package version of OpenOCD in your development
+ environment's distribution needs to be updated, it might be necessary to
+ build OpenOCD from the source.
+
+.. include:: k3.rst
+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
+
+To start OpenOCD to connect to the board
+
+.. code-block:: bash
+
+ openocd -f board/ti_am625evm.cfg
diff --git a/doc/board/ti/am65x_evm.rst b/doc/board/ti/am65x_evm.rst
index 0129235c2b29..60d18390959f 100644
--- a/doc/board/ti/am65x_evm.rst
+++ b/doc/board/ti/am65x_evm.rst
@@ -287,3 +287,27 @@ artifacts needed to the device:
sb --ymodem tispl.bin > $MAIN_DEV < $MAIN_DEV
sleep 1
sb --xmodem u-boot.img > $MAIN_DEV < $MAIN_DEV
+
+Debugging U-boot
+----------------
+
+See :ref:`Common Debugging environment - openOCD<k3_rst_refer_openocd>`: for
+detailed setup information.
+
+.. warning::
+
+ **OpenOCD support since**: v0.12.0
+
+ If the default package version of OpenOCD in your development
+ environment's distribution needs to be updated, it might be necessary to
+ build OpenOCD from the source.
+
+.. include:: k3.rst
+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
+
+To start OpenOCD to connect to the board
+
+.. code-block:: bash
+
+ openocd -f board/ti_am654evm.cfg
diff --git a/doc/board/ti/img/openocd-overview.svg b/doc/board/ti/img/openocd-overview.svg
new file mode 100644
index 000000000000..13a817132a45
--- /dev/null
+++ b/doc/board/ti/img/openocd-overview.svg
@@ -0,0 +1,580 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause-->
+
+<!--Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/-->
+
+<svg
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ width="281px"
+ height="671px"
+ viewBox="-0.5 -0.5 281 671"
+ id="svg128"
+ sodipodi:docname="openocd-overview.svg"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)">
+ <metadata
+ id="metadata132">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="3440"
+ inkscape:window-height="1391"
+ id="namedview130"
+ showgrid="false"
+ inkscape:zoom="1.4068554"
+ inkscape:cx="283.8637"
+ inkscape:cy="385.05999"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg128" />
+ <defs
+ id="defs2" />
+ <g
+ id="g118">
+ <path
+ d="M 0 510 L 0 510 L 280 510 L 280 510"
+ fill="rgb(255, 255, 255)"
+ stroke="#ff0a1b"
+ stroke-miterlimit="10"
+ pointer-events="all"
+ id="path4" />
+ <path
+ d="M 0 510 L 0 670 L 280 670 L 280 510"
+ fill="none"
+ stroke="#ff0a1b"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path6" />
+ <rect
+ x="10"
+ y="590"
+ width="100"
+ height="70"
+ fill="#f8cecc"
+ stroke="#b85450"
+ pointer-events="none"
+ id="rect8" />
+ <path
+ d="M 20 590 L 20 660 M 100 590 L 100 660"
+ fill="none"
+ stroke="#b85450"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path10" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g16">
+ <switch
+ id="switch14">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 625px; margin-left: 21px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Cortex-R</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="60"
+ y="629"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text12">Cortex-R</text>
+ </switch>
+ </g>
+ <rect
+ x="170"
+ y="590"
+ width="100"
+ height="70"
+ fill="#f8cecc"
+ stroke="#b85450"
+ pointer-events="none"
+ id="rect18" />
+ <path
+ d="M 180 590 L 180 660 M 260 590 L 260 660"
+ fill="none"
+ stroke="#b85450"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path20" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g26">
+ <switch
+ id="switch24">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 625px; margin-left: 181px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Cortex-A</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="220"
+ y="629"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text22">Cortex-A</text>
+ </switch>
+ </g>
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g32">
+ <switch
+ id="switch30">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 530px; margin-left: 221px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">K3 SoC</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="250"
+ y="534"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text28">K3 SoC</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 550 L 140 570 L 60 570 L 60 583.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path34" />
+ <path
+ d="M 60 588.88 L 56.5 581.88 L 60 583.63 L 63.5 581.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path36" />
+ <path
+ d="M 140 550 L 140 570 L 220 570 L 220 583.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path38" />
+ <path
+ d="M 220 588.88 L 216.5 581.88 L 220 583.63 L 223.5 581.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path40" />
+ <rect
+ x="90"
+ y="520"
+ width="100"
+ height="30"
+ fill="#f8cecc"
+ stroke="#b85450"
+ pointer-events="none"
+ id="rect42" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g48">
+ <switch
+ id="switch46">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 98px; height: 1px; padding-top: 535px; margin-left: 91px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Debug SS</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="539"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text44">Debug SS</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 470 L 140 503.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path50" />
+ <path
+ d="M 140 508.88 L 136.5 501.88 L 140 503.63 L 143.5 501.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path52" />
+ <rect
+ x="80"
+ y="410"
+ width="120"
+ height="60"
+ rx="9"
+ ry="9"
+ fill="#ffe6cc"
+ stroke="#d79b00"
+ pointer-events="none"
+ id="rect54" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g60">
+ <switch
+ id="switch58">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 440px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">Jtag Interface<xhtml:br />
+(XDS110, TUMPA..)</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="444"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text56">Jtag Interface...</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 370 L 140 403.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path62" />
+ <path
+ d="M 140 408.88 L 136.5 401.88 L 140 403.63 L 143.5 401.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path64" />
+ <rect
+ x="80"
+ y="310"
+ width="120"
+ height="60"
+ fill="#f5f5f5"
+ stroke="#666666"
+ pointer-events="none"
+ id="rect66" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g72">
+ <switch
+ id="switch70">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 340px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: #333333; ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">PC</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="344"
+ fill="#333333"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text68">PC</text>
+ </switch>
+ </g>
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g78">
+ <switch
+ id="switch76">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 385px; margin-left: 141px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">USB</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="170"
+ y="389"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text74">USB</text>
+ </switch>
+ </g>
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g84">
+ <switch
+ id="switch82">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 485px; margin-left: 141px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">JTAG</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="170"
+ y="489"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text80">JTAG</text>
+ </switch>
+ </g>
+ <path
+ d="M 100 230 L 180 230 L 200 270 L 180 310 L 100 310 L 80 270 Z"
+ fill="#e1d5e7"
+ stroke="#9673a6"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path86" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g92">
+ <switch
+ id="switch90">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 270px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">OpenOCD</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="274"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text88">OpenOCD</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 200 L 140 220 L 140 210 L 140 223.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path94" />
+ <path
+ d="M 140 228.88 L 136.5 221.88 L 140 223.63 L 143.5 221.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path96" />
+ <path
+ d="M 100 120 L 180 120 L 200 160 L 180 200 L 100 200 L 80 160 Z"
+ fill="#e1d5e7"
+ stroke="#9673a6"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path98" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g104">
+ <switch
+ id="switch102">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 160px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">gdb</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="164"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text100">gdb</text>
+ </switch>
+ </g>
+ <path
+ d="M 140 80 L 140 113.63"
+ fill="none"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path106" />
+ <path
+ d="M 140 118.88 L 136.5 111.88 L 140 113.63 L 143.5 111.88 Z"
+ fill="rgb(0, 0, 0)"
+ stroke="rgb(0, 0, 0)"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path108" />
+ <path
+ d="M 80 0 L 200 0 L 200 68 Q 170 46.4 140 68 Q 110 89.6 80 68 L 80 12 Z"
+ fill="#e1d5e7"
+ stroke="#9673a6"
+ stroke-miterlimit="10"
+ pointer-events="none"
+ id="path110" />
+ <g
+ transform="translate(-0.5 -0.5)"
+ id="g116">
+ <switch
+ id="switch114">
+ <foreignObject
+ style="overflow: visible; text-align: left;"
+ pointer-events="none"
+ width="100%"
+ height="100%"
+ requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
+ <xhtml:div
+ style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 28px; margin-left: 81px;">
+ <xhtml:div
+ style="box-sizing: border-box; font-size: 0px; text-align: center;"
+ data-drawio-colors="color: rgb(0, 0, 0); ">
+ <xhtml:div
+ style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: none; white-space: normal; overflow-wrap: normal;">IDE debugging code</xhtml:div>
+ </xhtml:div>
+ </xhtml:div>
+ </foreignObject>
+ <text
+ x="140"
+ y="32"
+ fill="rgb(0, 0, 0)"
+ font-family="Helvetica"
+ font-size="12px"
+ text-anchor="middle"
+ id="text112">IDE debugging code</text>
+ </switch>
+ </g>
+ </g>
+</svg>
diff --git a/doc/board/ti/j7200_evm.rst b/doc/board/ti/j7200_evm.rst
index 69abc55a93ce..d5d5c10b2870 100644
--- a/doc/board/ti/j7200_evm.rst
+++ b/doc/board/ti/j7200_evm.rst
@@ -201,3 +201,27 @@ fat formatted UDA FS as file.
In case of booting from eMMC, write above images into raw or UDA FS.
and set mmc partconf accordingly.
+
+Debugging U-boot
+----------------
+
+See :ref:`Common Debugging environment - openOCD<k3_rst_refer_openocd>`: for
+detailed setup information.
+
+.. warning::
+
+ **OpenOCD support since**: v0.12.0
+
+ If the default package version of OpenOCD in your development
+ environment's distribution needs to be updated, it might be necessary to
+ build OpenOCD from the source.
+
+.. include:: k3.rst
+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
+
+To start OpenOCD to connect to the board
+
+.. code-block:: bash
+
+ openocd -f board/ti_j7200evm.cfg
diff --git a/doc/board/ti/j721e_evm.rst b/doc/board/ti/j721e_evm.rst
index f4b4c192d9da..a9f441087938 100644
--- a/doc/board/ti/j721e_evm.rst
+++ b/doc/board/ti/j721e_evm.rst
@@ -228,3 +228,27 @@ J721E common processor board can be attached to a Ethernet QSGMII card and the
PHY in the card has to be reset before it can be used for data transfer.
"do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to
configure this PHY.
+
+Debugging U-boot
+----------------
+
+See :ref:`Common Debugging environment - openOCD<k3_rst_refer_openocd>`: for
+detailed setup information.
+
+.. warning::
+
+ **OpenOCD support since**: v0.12.0
+
+ If the default package version of OpenOCD in your development
+ environment's distribution needs to be updated, it might be necessary to
+ build OpenOCD from the source.
+
+.. include:: k3.rst
+ :start-after: .. k3_rst_include_start_openocd_connect_XDS110
+ :end-before: .. k3_rst_include_end_openocd_connect_XDS110
+
+To start OpenOCD to connect to the board
+
+.. code-block:: bash
+
+ openocd -f board/ti_j721eevm.cfg
diff --git a/doc/board/ti/k3.rst b/doc/board/ti/k3.rst
index 2034002af7cb..ea96fe502f35 100644
--- a/doc/board/ti/k3.rst
+++ b/doc/board/ti/k3.rst
@@ -468,3 +468,484 @@ filesystem and then imported
=> fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
=> env import -t ${loadaddr} ${filesize}
+
+.. _k3_rst_refer_openocd:
+
+Common Debugging environment - OpenOCD
+--------------------------------------
+
+This section will show you how to connect a board to `OpenOCD
+<https://openocd.org/>`_ and load the SPL symbols for debugging with
+a K3 generation device. To follow this guide, you must build custom
+u-boot binaries, start your board from a boot media such as an SD
+card, and use an OpenOCD environment. This section uses generic
+examples, though you can apply these instructions to any supported K3
+generation device.
+
+Overall structure of this setup is in the following figure.
+
+.. image:: img/openocd-overview.svg
+
+.. note::
+
+ If you find these instructions useful, please consider `donating
+ <https://openocd.org/pages/donations.html>`_ to OpenOCD.
+
+Step 1: Download and install OpenOCD
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To get started, it is more convenient if the distribution you
+use supports OpenOCD by default. Follow the instructions in the
+`getting OpenOCD <https://openocd.org/pages/getting-openocd.html>`_
+documentation to pick the installation steps appropriate to your
+environment. Some references to OpenOCD documentation:
+
+* `OpenOCD User Guide <https://openocd.org/doc/html/index.html>`_
+* `OpenOCD Developer's Guide <https://openocd.org/doc/doxygen/html/index.html>`_
+
+Refer to the release notes corresponding to the `OpenOCD version
+<https://github.com/openocd-org/openocd/releases>`_ to ensure that:
+
+* Processor support: In general, processor support shouldn't present
+ any difficulties since OpenOCD provides solid support for both armv8
+ and armv7.
+* SoC support: When working with System-on-a-Chip (SoC), the support
+ usually comes as a tcl config file. It is vital to ensure the correct
+ version of OpenOCD or to use the tcl files from the latest release or
+ the one mentioned.
+* Board or the JTAG adapter support: In most cases, board support is
+ a relatively easy problem if the board has a JTAG pin header. All
+ you need to do is ensure that the adapter you select is compatible
+ with OpenOCD. Some boards do come with an onboard JTAG adapter that
+ requires a USB cable to be plugged into the board, in which case, it
+ is vital to ensure that the JTAG adapter is supported. Fortunately,
+ almost all TI K3 SK/EVMs come with TI's XDS110, which has support
+ out of the box with OpenOCD. The board-specific documentation will
+ cover the details and any adapter recommendations.
+
+.. code-block:: bash
+
+ openocd -v
+
+.. note::
+
+ OpenOCD version 0.12.0 is usually required to connect to most K3
+ devices. If the support is on a newer version than what is in your
+ distribution, you may need to build it from the source.
+
+Building OpenOCD from source
+""""""""""""""""""""""""""""
+
+Dependency package installation instructions are for Debian
+systems, but equivalent instructions should exist on systems with
+other package managers. Please refer to `OpenOCD Documentation
+<https://openocd.org/>`_ for more recent installation steps.
+
+.. code-block:: bash
+
+ $ sudo apt-get install libtool pkg-config texinfo libusb-dev \
+ libusb-1.0.0-dev libftdi-dev libhidapi-dev autoconf automake
+ $ git clone https://github.com/openocd-org/openocd.git openocd
+ $ cd openocd
+ $ git submodule init
+ $ git submodule update
+ $ ./bootstrap
+ $ ./configure --prefix=/usr/local/
+ $ make -j`nproc`
+ $ sudo make install
+
+.. note::
+
+ The example above uses the GitHub mirror site. See
+ `git repo information <https://openocd.org/doc/html/Developers.html#OpenOCD-Git-Repository>`_
+ information to pick the official git repo.
+ If a specific version is desired, select the version using `git checkout tag`.
+
+Installing OpenOCD udev rules
+"""""""""""""""""""""""""""""
+
+The step is unnecessary if the distribution supports the OpenOCD, but
+if building from a source, ensure that the udev rules are installed
+correctly to ensure a sane system.
+
+.. code-block:: bash
+
+ # Go to the OpenOCD source directory
+ $ cd openocd
+ # Copy the udev rules to the correct system location
+ $ sudo cp ./contrib/60-openocd.rules \
+ ./src/JTAG/drivers/libjaylink/contrib/99-libjaylink.rules \
+ /etc/udev/rules.d/
+ # Get Udev to load the new rules up
+ $ sudo udevadm control --reload-rules
+ # Use the new rules on existing connected devices
+ $ sudo udevadm trigger
+
+Step 2: Setup gdb
+^^^^^^^^^^^^^^^^^
+
+Most systems come with gdb-multiarch package.
+
+.. code-block:: bash
+
+ # Install gdb-multiarch package
+ $ sudo apt-get install gdb-multiarch
+
+Though using gdb natively is normal, developers with interest in using IDE
+will find few of these interesting:
+
+* `gdb-dashboard <https://github.com/cyrus-and/gdb-dashboard>`_
+* `gef <https://github.com/hugsy/gef>`_
+* `peda <https://github.com/longld/peda>`_
+* `pwndbg <https://github.com/pwndbg/pwndbg>`_
+* `voltron <https://github.com/snare/voltron>`_
+* `ddd <https://www.gnu.org/software/ddd/>`_
+* `vscode <https://www.justinmklam.com/posts/2017/10/vscode-debugger-setup/>`_
+* `vim conque-gdb <https://github.com/vim-scripts/Conque-GDB>`_
+* `emacs realgud <https://github.com/realgud/realgud/wiki/gdb-notes>`_
+* `Lauterbach IDE <https://www2.lauterbach.com/pdf/backend_gdb.pdf>`_
+
+.. warning::
+ lldb support for OpenOCD is still a work in progress as of this writing.
+ Using gdb is probably the safest option at this point in time.
+
+Step 3: Setup of board to PC
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+There are few patterns of boards in the ecosystem
+
+.. k3_rst_include_start_openocd_connect_XDS110
+
+**Integrated JTAG adapter/dongle**: The board has a micro-USB connector labelled
+XDS110 USB or JTAG. Connect a USB cable to the board to the mentioned port.
+
+.. note::
+
+ There are multiple USB ports on a typical board, So, ensure you have read
+ the user guide for the board and confirm the silk screen label to ensure
+ connecting to the correct port.
+
+.. k3_rst_include_end_openocd_connect_XDS110
+
+.. k3_rst_include_start_openocd_connect_cti20
+
+**cTI20 connector**: The TI's `cTI20
+<https://software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_JTAG_connec…>`_ connector
+is probably the most prevelant on TI platforms. Though many
+TI boards do have onboard XDS110, cTI20 connector is usually
+provided as an alternate scheme to connect alternatives such
+as `Lauterbach <https://www.lauterbach.com/>`_ or `XDS560
+<https://www.ti.com/tool/TMDSEMU560V2STM-U>`_.
+
+To debug on these boards, the following combinations is suggested:
+
+* `TUMPA <https://www.diygadget.com/JTAG-cables-and-microcontroller-programmers/tiao-…>`_
+ or `equivalent dongles supported by OpenOCD. <https://openocd.org/doc/html/Debug-Adapter-Hardware.html#Debug-Adapter-Hard…>`_
+* Cable such as `Tag-connect ribbon cable <https://www.tag-connect.com/product/20-pin-cortex-ribbon-cable-4-length-wit…>`_
+* Adapter to convert cTI20 to ARM20 such as those from
+ `Segger <https://www.segger.com/products/debug-probes/j-link/accessories/adapters/ti…>`_
+ or `Lauterbach LA-3780 <https://www.lauterbach.com/ad3780.html>`_
+ Or optionally, if you have manufacturing capability then you could try
+ `BeagleBone JTAG Adapter <https://github.com/mmorawiec/BeagleBone-Black-JTAG-Adapters>`_
+
+.. warning::
+ XDS560 and Lauterbach are proprietary solutions and is not supported by
+ OpenOCD.
+ When purchasing off the shelf adapter/dongle, you do want to be careful
+ about the signalling though. Please
+ `read for additional info <https://software-dl.ti.com/ccs/esd/xdsdebugprobes/emu_JTAG_connectors.html>`_.
+
+.. k3_rst_include_end_openocd_connect_cti20
+
+.. k3_rst_include_start_openocd_connect_tag_connect
+
+**Tag-Connect**: `Tag-Connect <https://www.tag-connect.com/>`_
+pads on the boards which require special cable. Please check the documentation
+to `identify <https://www.tag-connect.com/info/legs-or-no-legs>`_ if "legged"
+or "no-leg" version of the cable is appropriate for the board.
+
+To debug on these boards, you will need:
+
+* `TUMPA <https://www.diygadget.com/JTAG-cables-and-microcontroller-programmers/tiao-…>`_
+ or `equivalent dongles supported by OpenOCD <https://openocd.org/doc/html/Debug-Adapter-Hardware.html#Debug-Adapter-Hard…>`_.
+* Tag-Connect cable appropriate to the board such as
+ `TC2050-IDC-NL <https://www.tag-connect.com/product/TC2050-IDC-NL-10-pin-no-legs-cable-with…>`_
+* In case of no-leg, version, a
+ `retaining clip <https://www.tag-connect.com/product/tc2050-clip-3pack-retaining-clip>`_
+* Tag-Connect to ARM20
+ `adapter <https://www.tag-connect.com/product/tc2050-arm2010-arm-20-pin-to-tc2050-ada…>`_
+
+.. note::
+ You can optionally use a 3d printed solution such as
+ `Protective cap <https://www.thingiverse.com/thing:3025584>`_ or
+ `clip <https://www.thingiverse.com/thing:3035278>`_ to replace
+ the retaining clip.
+
+.. warning::
+ With the Tag-Connect to ARM20 adapter, Please solder the "Trst" signal for
+ connection to work.
+
+.. k3_rst_include_end_openocd_connect_tag_connect
+
+Debugging with OpenOCD
+^^^^^^^^^^^^^^^^^^^^^^
+
+Debugging U-boot is different from debugging regular user space
+applications. The bootloader initialization process involves many boot
+media and hardware configuration operations. For K3 devices, there
+are also interactions with security firmware. While reloading the
+"elf" file works through gdb, developers must be mindful of cascading
+initialization's potential consequences.
+
+Consider the following code change:
+
+.. code-block:: diff
+
+ --- a/file.c 2023-07-29 10:55:29.647928811 -0500
+ +++ b/file.c 2023-07-29 10:55:46.091856816 -0500
+ @@ -1,3 +1,3 @@
+ val = readl(reg);
+ -val |= 0x2;
+ +val |= 0x1;
+ writel(val, reg);
+
+Re-running the elf file with the above change will result in the
+register setting 0x3 instead of the intended 0x1. There are other
+hardware blocks which may not behave very well with re-initialization
+sequence without proper shutdown.
+
+To help narrow the debug down, it is usually more simpler to use the
+standard boot media to get to the bootloader and debug only in the area
+of interest.
+
+In general, to debug u-boot spl/u-boot with OpenOCD there are three steps:
+
+* Modify the code to put a loop to allow debugger to attach near the point
+ of interest. Boot up normally to stop at the loop.
+* Connect with OpenOCD and step out of the loop
+* Step through code to find the root of issue
+
+Typical debug involves a few iterations of the above sequence. Though
+most bootloader developers like to use printf to debug, debug with
+JTAG tends to be most efficient since it is possible to investigate
+code flow and inspect hardware registers without repeated iterations.
+
+Code modification
+"""""""""""""""""
+
+* **start.S**: Adding an infinite while loop at the very entry of
+ U-Boot. For this, look for the corresponding start.S entry file.
+ This is usually only required when debugging some core SoC or
+ processor related function. For example: arch/arm/cpu/armv8/start.S or
+ arch/arm/cpu/armv7/start.S
+
+.. code-block:: diff
+
+ diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
+ index 69e281b086..744929e825 100644
+ --- a/arch/arm/cpu/armv7/start.S
+ +++ b/arch/arm/cpu/armv7/start.S
+ @@ -37,6 +37,8 @@
+ #endif
+
+ reset:
+ +dead_loop:
+ + b dead_loop
+ /* Allow the board to save important registers */
+ b save_boot_params
+ save_boot_params_ret:
+
+* **board_init_f**: Adding an infinite while loop at the board entry
+ function. In many cases, it is important to debug the boot process if
+ any changes are made for board-specific applications. Below is a step
+ by step process for debugging the boot SPL or Armv8 SPL:
+
+ To debug the boot process in either domain, we will first
+ add a modification in the code we would like to debug.
+ In this example, we will debug ``board_init_f`` inside
+ ``arch/arm/mach-k3/{soc}_init.c``. Since some sections of U-Boot
+ will be executed multiple times during the bootup process of K3
+ devices, we will need to include either ``CONFIG_CPU_ARM64`` or
+ ``CONFIG_CPU_V7R`` to catch the CPU at the desired place during the
+ bootup process (Main or Wakeup domains). For example, modify the
+ file as follows (depending on need):
+
+.. code-block:: c
+
+ void board_init_f(ulong dummy)
+ {
+ .
+ .
+ /* Code to run on the R5F (Wakeup/Boot Domain) */
+ if (IS_ENABLED(CONFIG_CPU_V7R)) {
+ volatile int x = 1;
+ while(x) {};
+ }
+ ...
+ /* Code to run on the ARMV8 (Main Domain) */
+ if (IS_ENABLED(CONFIG_CPU_ARM64)) {
+ volatile int x = 1;
+ while(x) {};
+ }
+ .
+ .
+ }
+
+Connecting with OpenOCD for debug session
+"""""""""""""""""""""""""""""""""""""""""
+
+Startup openocd to debug the platform as follows:
+
+* **Integrated JTAG interface**: If the evm has a debugger such as
+ XDS110 inbuilt, there is typically an evm board support added and a
+ cfg file will be available.
+
+.. k3_rst_include_start_openocd_cfg_XDS110
+
+.. code-block:: bash
+
+ openocd -f board/{board_of_choice}.cfg
+
+.. k3_rst_include_end_openocd_cfg_XDS110
+
+.. k3_rst_include_start_openocd_cfg_external_intro
+
+* **External JTAG adapter/interface**: In other cases, where an
+ adapter/dongle is used, a simple cfg file can be created to integrate the
+ SoC and adapter information. See `supported TI K3 SoCs
+ <https://github.com/openocd-org/openocd/blob/master/tcl/target/ti_k3.cfg#L59>`_
+ to decide if the SoC is supported or not.
+
+.. code-block:: bash
+
+ openocd -f openocd_connect.cfg
+
+.. k3_rst_include_end_openocd_cfg_external_intro
+
+ For example, with BeaglePlay (AM62X platform), the openocd_connect.cfg:
+
+.. code-block:: tcl
+
+ # TUMPA example:
+ # http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual
+ source [find interface/ftdi/tumpa.cfg]
+
+ transport select jtag
+
+ # default JTAG configuration has only SRST and no TRST
+ reset_config srst_only srst_push_pull
+
+ # delay after SRST goes inactive
+ adapter srst delay 20
+
+ if { ![info exists SOC] } {
+ # Set the SoC of interest
+ set SOC am625
+ }
+
+ source [find target/ti_k3.cfg]
+
+ ftdi tdo_sample_edge falling
+
+ # Speeds for FT2232H are in multiples of 2, and 32MHz is tops
+ # max speed we seem to achieve is ~20MHz.. so we pick 16MHz
+ adapter speed 16000
+
+Below is an example of the output of this command:
+
+.. code-block:: console
+
+ Info : Listening on port 6666 for tcl connections
+ Info : Listening on port 4444 for telnet connections
+ Info : XDS110: connected
+ Info : XDS110: vid/pid = 0451/bef3
+ Info : XDS110: firmware version = 3.0.0.20
+ Info : XDS110: hardware version = 0x002f
+ Info : XDS110: connected to target via JTAG
+ Info : XDS110: TCK set to 2500 kHz
+ Info : clock speed 2500 kHz
+ Info : JTAG tap: am625.cpu tap/device found: 0x0bb7e02f (mfg: 0x017 (Texas Instruments), part: 0xbb7e, ver: 0x0)
+ Info : starting gdb server for am625.cpu.sysctrl on 3333
+ Info : Listening on port 3333 for gdb connections
+ Info : starting gdb server for am625.cpu.a53.0 on 3334
+ Info : Listening on port 3334 for gdb connections
+ Info : starting gdb server for am625.cpu.a53.1 on 3335
+ Info : Listening on port 3335 for gdb connections
+ Info : starting gdb server for am625.cpu.a53.2 on 3336
+ Info : Listening on port 3336 for gdb connections
+ Info : starting gdb server for am625.cpu.a53.3 on 3337
+ Info : Listening on port 3337 for gdb connections
+ Info : starting gdb server for am625.cpu.main0_r5.0 on 3338
+ Info : Listening on port 3338 for gdb connections
+ Info : starting gdb server for am625.cpu.gp_mcu on 3339
+ Info : Listening on port 3339 for gdb connections
+
+.. note::
+ Notice the default configuration is non-SMP configuration allowing
+ for each of the core to be attached and debugged simultaneously.
+ armv8 SPL/U-boot starts up on cpu0 of a53/a72.
+
+.. k3_rst_include_start_openocd_cfg_external_gdb
+
+To debug using this server, use gdb directly or your preferred
+gdb-based IDE. To start up gdb in the terminal, run the following
+command.
+
+.. code-block:: bash
+
+ gdb-multiarch
+
+To connect to your desired core, run the following command within gdb
+and load the symbols from the corresponding elf file.
+
+.. code-block:: bash
+
+ target extended-remote localhost:{port for desired core}
+ symbol-file {path to elf file}
+
+.. k3_rst_include_end_openocd_cfg_external_gdb
+
+In the above example of AM625,
+
+.. code-block:: bash
+
+ target extended-remote localhost:3338 <- R5F (Wakeup Domain)
+ target extended-remote localhost:3334 <- A53 (Main Domain)
+
+The core can now be debugged directly within gdb using gdb commands or
+if using IDE, as appropriate to the IDE.
+
+Stepping through the code
+"""""""""""""""""""""""""
+
+Use the gdb command ``lay next`` after loading the symbols to see the
+code and breakpoints. To exit the debug loop added above, add any
+breakpoints needed and run the following gdb commands.
+
+.. code-block:: bash
+
+ set x = 0
+ continue
+
+The platform has now been successfully setup to debug with OpenOCD
+using gdb commands or a gdb-based IDE. See `OpenOCD documentation for
+gdb <https://openocd.org/doc/html/GDB-and-OpenOCD.html>`_ for further
+information.
+
+.. warning::
+
+ On the K3 family of devices, a watchdog timer within the DMSC is
+ enabled by default by the ROM bootcode with a timeout of 3 minutes.
+ The watchdog timer is serviced by System Firmware (SYSFW) or TI
+ Foundational Security (TIFS) during normal operation. If debugging
+ the SPL before the SYSFW is loaded, the watchdog timer will not get
+ serviced automatically and the debug session will reset after 3
+ minutes. It is recommended to start debugging SPL code only after
+ the startup of SYSFW to avoid running into the watchdog timer reset.
+
+Misc notes with openOCD
+^^^^^^^^^^^^^^^^^^^^^^^
+
+At this time, OpenOCD does not support tracing for K3 platforms.
+Tracing function could be beneficial if the bug in code occurs deep
+within nested function and can optionally save developers major
+trouble of stepping through a large quantity of code.
--
2.40.0
2
1
Check the uuid_str_to_bin return value, skip the node
if the image-type-id property is wrong format.
Addresses-Coverity-ID: 463145 ("Error handling issues")
Signed-off-by: Masahisa Kojima <masahisa.kojima(a)linaro.org>
---
lib/efi_loader/efi_firmware.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index b557738370..9abb29f1df 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -159,7 +159,7 @@ static void efi_firmware_get_lsv_from_dtb(u8 image_index,
const fdt32_t *val;
const char *guid_str;
int len, offset, index;
- int parent;
+ int parent, ret;
*lsv = 0;
@@ -173,7 +173,11 @@ static void efi_firmware_get_lsv_from_dtb(u8 image_index,
guid_str = fdt_getprop(fdt, offset, "image-type-id", &len);
if (!guid_str)
continue;
- uuid_str_to_bin(guid_str, guid.b, UUID_STR_FORMAT_GUID);
+ ret = uuid_str_to_bin(guid_str, guid.b, UUID_STR_FORMAT_GUID);
+ if (ret < 0) {
+ log_warning("Wrong image-type-id format.\n");
+ continue;
+ }
val = fdt_getprop(fdt, offset, "image-index", &len);
if (!val)
--
2.34.1
2
1
Add TPM2_GetTestResult command support and change the command file and the
help accordingly. Add Python tests and sandbox driver functionality.
The TPM2_GetTestResult command is performed after the TPM2_SelfTest command
and returns manufacturer-specific information regarding the results of the
self-test and an indication of the test status.
Signed-off-by: Julia Daxenberger <julia.daxenberger(a)infineon.com>
---
cmd/tpm-v2.c | 60 +++++++++++++++++++++++++
drivers/tpm/tpm2_tis_sandbox.c | 47 ++++++++++++++++++-
include/tpm-v2.h | 23 ++++++++++
lib/tpm-v2.c | 82 ++++++++++++++++++++++++++++++++++
test/py/tests/test_tpm2.py | 50 +++++++++++++++++++++
5 files changed, 261 insertions(+), 1 deletion(-)
diff --git a/cmd/tpm-v2.c b/cmd/tpm-v2.c
index d93b83ada9..c6bec7387a 100644
--- a/cmd/tpm-v2.c
+++ b/cmd/tpm-v2.c
@@ -2,6 +2,7 @@
/*
* Copyright (c) 2018 Bootlin
* Author: Miquel Raynal <miquel.raynal(a)bootlin.com>
+ * Copyright (C) 2023 Infineon Technologies AG
*/
#include <common.h>
@@ -13,6 +14,8 @@
#include <tpm-v2.h>
#include "tpm-user-utils.h"
+#define TEST_RESULT_DATA_BUFFER_SIZE 256
+
static int do_tpm2_startup(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
@@ -356,6 +359,57 @@ static int do_tpm_pcr_setauthvalue(struct cmd_tbl *cmdtp, int flag,
key, key_sz));
}
+static int do_tpm2_get_test_result(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ struct udevice *dev;
+ int ret;
+ u8 data[TEST_RESULT_DATA_BUFFER_SIZE];
+ size_t data_len = TEST_RESULT_DATA_BUFFER_SIZE;
+ u32 test_result;
+ u32 rc;
+
+ ret = get_tpm(&dev);
+ if (ret)
+ return ret;
+
+ if (argc != 1)
+ return CMD_RET_USAGE;
+
+ rc = tpm2_get_test_result(dev, data, &data_len, &test_result);
+ if (rc)
+ goto out;
+
+ printf("Test Result:\n\t0x%08X", test_result);
+ switch (test_result) {
+ case 0x0000:
+ printf("\tTPM2_RC_SUCCESS\n");
+ break;
+ case 0x0101:
+ printf("\tTPM2_RC_FAILURE\n");
+ break;
+ case 0x0153:
+ printf("\tTPM2_RC_NEEDS_TEST\n");
+ break;
+ case 0x090A:
+ printf("\tTPM2_RC_TESTING\n");
+ break;
+ }
+
+ if (!data_len) {
+ printf("No Test Result Data available\n");
+ goto out;
+ }
+
+ printf("Test Result Data of Self Test:\n\t0x");
+ for (int i = 0; i < data_len; i++)
+ printf("%02X", data[i]);
+ printf("\n");
+
+out:
+ return report_return_code(rc);
+}
+
static struct cmd_tbl tpm2_commands[] = {
U_BOOT_CMD_MKENT(device, 0, 1, do_tpm_device, "", ""),
U_BOOT_CMD_MKENT(info, 0, 1, do_tpm_info, "", ""),
@@ -374,6 +428,8 @@ static struct cmd_tbl tpm2_commands[] = {
do_tpm_pcr_setauthpolicy, "", ""),
U_BOOT_CMD_MKENT(pcr_setauthvalue, 0, 1,
do_tpm_pcr_setauthvalue, "", ""),
+ U_BOOT_CMD_MKENT(get_test_result, 0, 1,
+ do_tpm2_get_test_result, "", ""),
};
struct cmd_tbl *get_tpm2_commands(unsigned int *size)
@@ -447,4 +503,8 @@ U_BOOT_CMD(tpm2, CONFIG_SYS_MAXARGS, 1, do_tpm, "Issue a TPMv2.x command",
" <pcr>: index of the PCR\n"
" <key>: secret to protect the access of PCR #<pcr>\n"
" <password>: optional password of the PLATFORM hierarchy\n"
+"get_test_result\n"
+" Show manufacturer-specific information regarding the results of a\n"
+" self-test and an indication of the test status.\n"
+
);
diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c
index e4004cfcca..17979cd33a 100644
--- a/drivers/tpm/tpm2_tis_sandbox.c
+++ b/drivers/tpm/tpm2_tis_sandbox.c
@@ -2,6 +2,7 @@
/*
* Copyright (c) 2018, Bootlin
* Author: Miquel Raynal <miquel.raynal(a)bootlin.com>
+ * Copyright (C) 2023 Infineon Technologies AG
*/
#include <common.h>
@@ -231,6 +232,7 @@ static int sandbox_tpm2_check_session(struct udevice *dev, u32 command, u16 tag,
case TPM2_CC_SELF_TEST:
case TPM2_CC_GET_CAPABILITY:
case TPM2_CC_PCR_READ:
+ case TPM2_CC_GET_TEST_RESULT:
if (tag != TPM2_ST_NO_SESSIONS) {
printf("No session required for command 0x%x\n",
command);
@@ -364,6 +366,13 @@ static int sandbox_tpm2_check_readyness(struct udevice *dev, int command)
if (!tpm->startup_done)
return TPM2_RC_INITIALIZE;
+ break;
+ case TPM2_CC_GET_TEST_RESULT:
+ if (!tpm->init_done || !tpm->startup_done)
+ return TPM2_RC_INITIALIZE;
+ if (!tpm->tests_done)
+ return TPM2_RC_NEEDS_TEST;
+
break;
default:
/* Skip this, since the startup may have happened in SPL
@@ -458,7 +467,7 @@ static int sandbox_tpm2_xfer(struct udevice *dev, const u8 *sendbuf,
command = get_unaligned_be32(sent);
sent += sizeof(command);
rc = sandbox_tpm2_check_readyness(dev, command);
- if (rc) {
+ if (rc && rc != TPM2_RC_NEEDS_TEST) {
sandbox_tpm2_fill_buf(recv, recv_len, tag, rc);
return 0;
}
@@ -778,6 +787,42 @@ static int sandbox_tpm2_xfer(struct udevice *dev, const u8 *sendbuf,
*recv_len = 12;
memset(recvbuf, '\0', *recv_len);
break;
+
+ case TPM2_CC_GET_TEST_RESULT: {
+ u32 testresult = 0;
+ u8 data[10] = { 0 };
+
+ /* Check readiness */
+ testresult = sandbox_tpm2_check_readyness(dev, command);
+
+ /* Write tag */
+ put_unaligned_be16(tag, recv);
+ recv += sizeof(tag);
+
+ /* Ignore length for now */
+ recv += sizeof(u32);
+
+ /* Write return code */
+ put_unaligned_be32(rc, recv);
+ recv += sizeof(rc);
+
+ /* Write manufacturer-specific test result data */
+ memcpy(recv, data, sizeof(data));
+ recv += sizeof(data);
+
+ /* Write test result */
+ put_unaligned_be32(testresult, recv);
+ recv += sizeof(testresult);
+
+ /* Add trailing \0 */
+ *recv = '\0';
+
+ /* Write response length */
+ *recv_len = recv - recvbuf;
+ put_unaligned_be32(*recv_len, recvbuf + sizeof(tag));
+
+ break;
+ }
default:
printf("TPM2 command %02x unknown in Sandbox\n", command);
rc = TPM2_RC_COMMAND_CODE;
diff --git a/include/tpm-v2.h b/include/tpm-v2.h
index 2b6980e441..f6ec430316 100644
--- a/include/tpm-v2.h
+++ b/include/tpm-v2.h
@@ -3,6 +3,7 @@
* Defines APIs and structures that allow software to interact with a
* TPM2 device
*
+ * Copyright (C) 2023 Infineon Technologies AG
* Copyright (c) 2020 Linaro
* Copyright (c) 2018 Bootlin
*
@@ -276,6 +277,7 @@ enum tpm2_handles {
* @TPM2_CC_DAM_PARAMETERS: TPM2_DictionaryAttackParameters().
* @TPM2_CC_GET_CAPABILITY: TPM2_GetCapibility().
* @TPM2_CC_GET_RANDOM: TPM2_GetRandom().
+ * @TPM2_CC_GET_TEST_RESULT: TPM2_GetTestResult().
* @TPM2_CC_PCR_READ: TPM2_PCR_Read().
* @TPM2_CC_PCR_EXTEND: TPM2_PCR_Extend().
* @TPM2_CC_PCR_SETAUTHVAL: TPM2_PCR_SetAuthValue().
@@ -296,6 +298,7 @@ enum tpm2_command_codes {
TPM2_CC_NV_READ = 0x014E,
TPM2_CC_GET_CAPABILITY = 0x017A,
TPM2_CC_GET_RANDOM = 0x017B,
+ TPM2_CC_GET_TEST_RESULT = 0x017C,
TPM2_CC_PCR_READ = 0x017E,
TPM2_CC_PCR_EXTEND = 0x0182,
TPM2_CC_PCR_SETAUTHVAL = 0x0183,
@@ -706,4 +709,24 @@ u32 tpm2_enable_nvcommits(struct udevice *dev, uint vendor_cmd,
*/
u32 tpm2_auto_start(struct udevice *dev);
+/**
+ * Issue a TPM2_GetTestResult command.
+ *
+ * @dev TPM device
+ * @data output buffer for manufacturer-specific test result data
+ * @data_len input/output parameter
+ * input: size of data buffer, output: size of test result data
+ * @test_result output parameter: test result response code:
+ * TPM2_RC_NEEDS_TEST, if TPM2 self-test has not been executed and
+ * a testable function has not been tested
+ * TPM2_RC_TESTING, if TPM2 self-test is in progress.
+ * TPM2_RC_SUCCESS, if testing of all functions is complete without
+ * functional failures.
+ * TPM2_RC_FAILURE, if any test failed.
+ *
+ * Return: code of the operation
+ */
+u32 tpm2_get_test_result(struct udevice *dev, void *data, size_t *data_len,
+ u32 *test_result);
+
#endif /* __TPM_V2_H */
diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c
index 9ab5b46df1..a3a29048e3 100644
--- a/lib/tpm-v2.c
+++ b/lib/tpm-v2.c
@@ -2,12 +2,14 @@
/*
* Copyright (c) 2018 Bootlin
* Author: Miquel Raynal <miquel.raynal(a)bootlin.com>
+ * Copyright (C) 2023 Infineon Technologies AG
*/
#include <common.h>
#include <dm.h>
#include <tpm-common.h>
#include <tpm-v2.h>
+#include <asm/unaligned.h>
#include <linux/bitops.h>
#include "tpm-utils.h"
@@ -742,3 +744,83 @@ u32 tpm2_enable_nvcommits(struct udevice *dev, uint vendor_cmd,
return 0;
}
+
+u32 tpm2_get_test_result(struct udevice *dev, void *data,
+ size_t *data_len, u32 *test_result)
+{
+ const u8 command_v2[COMMAND_BUFFER_SIZE] = {
+ /* header 10 bytes */
+ tpm_u16(TPM2_ST_NO_SESSIONS), /* TAG */
+ tpm_u32(10), /* Length */
+ tpm_u32(TPM2_CC_GET_TEST_RESULT), /* Command code */
+ };
+
+ int ret;
+ u8 response[COMMAND_BUFFER_SIZE];
+ size_t response_len = COMMAND_BUFFER_SIZE;
+ u32 response_size; /* Size of response bytestream */
+ unsigned int response_size_off;
+ unsigned int data_off;
+ unsigned int test_result_off;
+ size_t data_buff_len;
+
+ ret = tpm_sendrecv_command(dev, command_v2, response, &response_len);
+
+ if (ret) {
+ log_debug("Returned on: ret = tpm_sendrecv_command()\n");
+ return ret;
+ }
+
+ /*
+ * Get responseSize from return bytestream, switch endianness: big->little
+ * In the response buffer, the responseSize is located after:
+ * tag (u16)
+ */
+ response_size_off = sizeof(u16);
+ response_size = get_unaligned_be32(response + response_size_off);
+
+ if (response_len < 10) {
+ log_debug
+ ("Returned on plausibility check: response_len < 10\n");
+ return -EINVAL;
+ }
+
+ if (response_size > response_len) {
+ log_debug
+ ("Returned on plausibility check: response_size > response_len\n\t"
+ "Response Size: %d\n\tResponse Length: %ld\n",
+ response_size, response_len);
+ return -E2BIG;
+ }
+
+ /*
+ * Copy the test result data to buffer, transfer data_len
+ * In the response buffer, the test result data is located after:
+ * tag (u16), response size (u32), response code (u32).
+ */
+ data_off = sizeof(u16) + sizeof(u32) + sizeof(u32);
+ data_buff_len = *data_len;
+ *data_len = response_size - data_off - sizeof(u32);
+
+ /* Checks, if the reserved data buffer size is insufficient */
+ if (*data_len > data_buff_len) {
+ log_debug
+ ("Returned on plausibility check: data_len > data_buff_len\n\t"
+ "Data Length: %ld\n\tData Buffer Length: %ld\n\t",
+ *data_len, data_buff_len);
+ return -E2BIG;
+ }
+
+ memcpy(data, &response[data_off], *data_len);
+
+ /*
+ * Get testResult from return bytestream, switch endianness: big->little
+ * In the response buffer, the test result is located after:
+ * tag (u16), response size (u32), response code (u32),
+ * test result data (*data_len).
+ */
+ test_result_off = data_off + *data_len;
+ *test_result = get_unaligned_be32(response + test_result_off);
+
+ return 0;
+}
diff --git a/test/py/tests/test_tpm2.py b/test/py/tests/test_tpm2.py
index d2ad6f9e73..aad1d7a55b 100644
--- a/test/py/tests/test_tpm2.py
+++ b/test/py/tests/test_tpm2.py
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2018, Bootlin
# Author: Miquel Raynal <miquel.raynal(a)bootlin.com>
+# Copyright (C) 2023 Infineon Technologies AG
import os.path
import pytest
@@ -316,3 +317,52 @@ def test_tpm2_cleanup(u_boot_console):
"""Ensure the TPM is cleared from password or test related configuration."""
force_init(u_boot_console, True)
+
+(a)pytest.mark.buildconfigspec('cmd_tpm_v2')
+def test_tpm2_get_test_result(u_boot_console):
+ """Execute a TPM_GetTestResult command.
+
+ Ask the TPM to get the test result of the self test.
+ Display the Test Result and Test Result Data.
+
+ Expected default return value of tpm2_get_test_result, if the TPM has not been initialized:
+ - TPM2_RC_INITIALIZE = TPM2_RC_VER1 + 0x0000 = 0x00000100.
+
+ Expected default value for test_result:
+ - TPM_RC_NEEDS_TEST = 0x00000153, if tpm2 self_test has not been executed.
+ - TPM_RC_SUCCESS = 0x00000000, if testing is complete without functional failures.
+
+ There is no expected default value for the test result data because it would depend on the chip
+ used. The test result data is therefore not tested.
+ """
+ if is_sandbox(u_boot_console):
+ u_boot_console.restart_uboot()
+
+ skip_test = u_boot_console.config.env.get('env__tpm_device_test_skip', False)
+ if skip_test:
+ pytest.skip('skip TPM device test')
+
+ read_res = u_boot_console.run_command('tpm2 get_test_result')
+ output = u_boot_console.run_command('echo $?')
+ assert 'Error: 256' in read_res
+
+ u_boot_console.run_command('tpm2 init')
+ read_res = u_boot_console.run_command('tpm2 get_test_result')
+ output = u_boot_console.run_command('echo $?')
+ assert 'Error: 256' in read_res
+
+ u_boot_console.run_command('tpm2 startup TPM2_SU_CLEAR')
+ read_res = u_boot_console.run_command('tpm2 get_test_result')
+ output = u_boot_console.run_command('echo $?')
+ assert output.endswith('0')
+ assert 'Test Result:\r\r\n\t0x00000153\tTPM2_RC_NEEDS_TEST' in read_res
+ """ Assert console output. Test Result Data can not be tested, as it is vendor specific"""
+ assert 'Test Result Data of Self Test:\r\r\n\t0x' in read_res
+
+ u_boot_console.run_command('tpm2 self_test full')
+ read_res = u_boot_console.run_command('tpm2 get_test_result')
+ output = u_boot_console.run_command('echo $?')
+ assert output.endswith('0')
+ assert 'Test Result:\r\r\n\t0x00000000\tTPM2_RC_SUCCESS' in read_res
+ """ Assert console output. Test Result Data can not be tested, as it is vendor specific"""
+ assert 'Test Result Data of Self Test:\r\r\n\t0x' in read_res
--
2.34.1
3
6
Support for NPort 6600 Series RS-232/422/485 secure terminal servers.
Technical specifications:
FA526 ARMv4 CPU, 64 MB of RAM, 16 MB NOR flash, 100 Mbit/s Ethernet,
optional expansion modules, up to 32 RS-232/422/485 ports.
Signed-off-by: Sergei Antonov <saproj(a)gmail.com>
---
arch/arm/Kconfig | 9 +++
arch/arm/dts/nport6600.dts | 134 +++++++++++++++++++++++++++++++
board/moxa/nport6600/Kconfig | 15 ++++
board/moxa/nport6600/MAINTAINERS | 7 ++
board/moxa/nport6600/Makefile | 3 +
board/moxa/nport6600/nport6600.c | 78 ++++++++++++++++++
configs/nport6600_defconfig | 129 +++++++++++++++++++++++++++++
include/configs/nport6600.h | 13 +++
8 files changed, 388 insertions(+)
create mode 100644 arch/arm/dts/nport6600.dts
create mode 100644 board/moxa/nport6600/Kconfig
create mode 100644 board/moxa/nport6600/MAINTAINERS
create mode 100644 board/moxa/nport6600/Makefile
create mode 100644 board/moxa/nport6600/nport6600.c
create mode 100644 configs/nport6600_defconfig
create mode 100644 include/configs/nport6600.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 97c25b4f146d..de5b746b93c9 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -705,6 +705,14 @@ config TARGET_BCMNS3
ARMv8 Cortex-A72 processors targeting a broad range of networking
applications.
+config TARGET_NPORT6600
+ bool "Support NPort 6600"
+ select CPU_ARM720T
+ help
+ Support for NPort 6600 Series RS-232/422/485 secure terminal servers.
+ FA526 ARMv4 CPU, 64 MB of RAM, 16 MB NOR flash, 100 Mbit/s Ethernet,
+ optional expansion modules, up to 32 RS-232/422/485 ports.
+
config ARCH_EXYNOS
bool "Samsung EXYNOS"
select DM
@@ -2312,6 +2320,7 @@ source "board/hisilicon/hikey960/Kconfig"
source "board/hisilicon/poplar/Kconfig"
source "board/isee/igep003x/Kconfig"
source "board/kontron/sl28/Kconfig"
+source "board/moxa/nport6600/Kconfig"
source "board/myir/mys_6ulx/Kconfig"
source "board/samsung/common/Kconfig"
source "board/siemens/common/Kconfig"
diff --git a/arch/arm/dts/nport6600.dts b/arch/arm/dts/nport6600.dts
new file mode 100644
index 000000000000..ea268ed16d9b
--- /dev/null
+++ b/arch/arm/dts/nport6600.dts
@@ -0,0 +1,134 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ model = "MOXA NPort 6600 Series";
+ compatible = "moxa,nport6600";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x4000000>;
+ };
+
+ ahb {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ device_type = "soc";
+ ranges;
+ bootph-all;
+
+ apb {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+ bootph-all;
+
+ uart1: serial@98200020 {
+ compatible = "ns16550a";
+ reg = <0x98200020 0x20>;
+ reg-io-width = <4>;
+ reg-shift = <2>;
+ clock-frequency = <14745600>;
+ no-loopback-test;
+ bootph-all;
+ status = "okay";
+ };
+
+ timer: timer@98400000 {
+ compatible = "faraday,fttmr010-timer";
+ reg = <0x98400000 0x40>;
+ clock-frequency = <12000000>;
+ };
+
+ wdt: wdt@98500000 {
+ compatible = "faraday,ftwdt010";
+ reg = <0x98500000 0x20>;
+ };
+
+ gpio: gpio@98700000 {
+ compatible = "faraday,ftgpio010";
+ reg = <0x98700000 0x20>;
+ nr-gpios = <32>;
+ #gpio-cells = <2>;
+ };
+
+ rtc {
+ compatible = "holtek,ht1380";
+ rst-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+ clk-gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
+ dat-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
+ };
+
+ mmc0: mmc@98e00000 {
+ compatible = "andestech,atfsdc010";
+ bus-width = <4>;
+ max-frequency = <25000000>;
+ reg = <0x98e00000 0x1000>;
+ cap-sd-highspeed;
+ };
+ };
+
+ nor@80000000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "cfi-flash";
+ reg = <0x80000000 0x0>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ mtd1 {
+ label = "moxa";
+ reg = <0x0 0x40000>;
+ read-only;
+ };
+ mtd2 {
+ label = "env";
+ reg = <0x40000 0x100000>;
+ read-only;
+ };
+ mtd3 {
+ label = "uboot";
+ reg = <0x140000 0xc0000>;
+ };
+ mtd4 {
+ label = "mfs";
+ reg = <0x200000 0x20000>;
+ read-only;
+ };
+ mtd5 {
+ label = "ubi";
+ reg = <0x220000 0xde0000>;
+ };
+ };
+ };
+
+ mac@92000000 {
+ compatible = "andestech,atmac100";
+ reg = <0x92000000 0x90>;
+ };
+
+ pci0@90c00000 {
+ compatible = "faraday,ftpci100";
+ device_type = "pci";
+ reg = <0x90c00000 0x30>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ bus-range = <0x0 0xff>;
+ ranges = <0x01000000 0 0x90c00000 0x90c00000 0 0x00100000 /* I/O */
+ 0x02000000 0 0xa0000000 0xa0000000 0 0x02000000 /* MEM */>;
+
+ status = "okay";
+ };
+ };
+};
diff --git a/board/moxa/nport6600/Kconfig b/board/moxa/nport6600/Kconfig
new file mode 100644
index 000000000000..3094b380c0fd
--- /dev/null
+++ b/board/moxa/nport6600/Kconfig
@@ -0,0 +1,15 @@
+if TARGET_NPORT6600
+
+config SYS_BOARD
+ default "nport6600"
+
+config SYS_VENDOR
+ default "moxa"
+
+config SYS_SOC
+ default "moxa"
+
+config SYS_CONFIG_NAME
+ default "nport6600"
+
+endif
diff --git a/board/moxa/nport6600/MAINTAINERS b/board/moxa/nport6600/MAINTAINERS
new file mode 100644
index 000000000000..fca3d9d0dbfa
--- /dev/null
+++ b/board/moxa/nport6600/MAINTAINERS
@@ -0,0 +1,7 @@
+NPORT6600 BOARD
+M: Sergei Antonov <saproj(a)gmail.com>
+S: Maintained
+F: board/moxa/nport6600/
+F: arch/arm/dts/nport6600.dts
+F: include/configs/nport6600.h
+F: configs/nport6600_defconfig
diff --git a/board/moxa/nport6600/Makefile b/board/moxa/nport6600/Makefile
new file mode 100644
index 000000000000..8d853eaa1a57
--- /dev/null
+++ b/board/moxa/nport6600/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+obj-y := nport6600.o
diff --git a/board/moxa/nport6600/nport6600.c b/board/moxa/nport6600/nport6600.c
new file mode 100644
index 000000000000..88fa98c315fd
--- /dev/null
+++ b/board/moxa/nport6600/nport6600.c
@@ -0,0 +1,78 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include <common.h>
+#include <init.h>
+#include <env.h>
+#include <cpu_func.h>
+#include <string.h>
+
+int dram_init(void)
+{
+ return fdtdec_setup_mem_size_base();
+}
+
+int board_init(void)
+{
+ return 0;
+}
+
+int show_board_info(void)
+{
+ const u8 *NPORT_EXPANSION_MODULE = (const u8 *)0x8c0000c0;
+ const unsigned int module_id = *NPORT_EXPANSION_MODULE;
+ static const char * const modules[] = {
+ NULL,
+ "NM-TX01",
+ "NM-FX01-M-SC",
+ "NM-FX01-S-SC",
+ NULL,
+ "NM-FX02-M-SC",
+ "NM-FX02-S-SC",
+ "NM_GPRS",
+ "NM-TX02",
+ };
+
+ /* Check for Module */
+ if (module_id < ARRAY_SIZE(modules) && modules[module_id])
+ printf("Expansion module %s detected\n", modules[module_id]);
+
+ return 0;
+}
+
+static int read_net_params(void)
+{
+ const u8 *MAC_ADDR = (const u8 *)0x80000050;
+
+ if (eth_env_set_enetaddr("ethaddr", MAC_ADDR))
+ return -1;
+
+ return 0;
+}
+
+int misc_init_r(void)
+{
+ const char *SERIAL_STR = (const char *)0x80000034;
+ const unsigned int SERIAL_LEN = 12;
+ char str[SERIAL_LEN + 1];
+
+ if (*SERIAL_STR) {
+ memcpy(str, SERIAL_STR, SERIAL_LEN);
+ str[SERIAL_LEN] = 0;
+ } else {
+ /* No serial string. Resort to a 2-byte serial number. */
+ const u16 *SERIAL_NO = (const u16 *)0x8000004c;
+
+ sprintf(str, "%05u", *SERIAL_NO);
+ }
+
+ if (env_set("serial#", str))
+ return -1;
+
+ return read_net_params();
+}
+
+void enable_caches(void)
+{
+ icache_enable();
+ dcache_enable();
+}
diff --git a/configs/nport6600_defconfig b/configs/nport6600_defconfig
new file mode 100644
index 000000000000..47db1ca20ae6
--- /dev/null
+++ b/configs/nport6600_defconfig
@@ -0,0 +1,129 @@
+CONFIG_ARM=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="echo Serial number: ${serial#}"
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND=""
+CONFIG_BOOTDELAY=1
+# CONFIG_BOOTSTD is not set
+CONFIG_DISPLAY_BOARDINFO=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_LTO=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_CLS=y
+CONFIG_CMD_CRC32=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_LOG=y
+CONFIG_CMD_MD5SUM=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_NET=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_UBI=y
+CONFIG_CRC32_VERIFY=y
+CONFIG_DM=y
+CONFIG_ENV_SUPPORT=y
+CONFIG_FTMAC100=y
+CONFIG_HUSH_PARSER=y
+CONFIG_LOG_CONSOLE=y
+CONFIG_LOG_MAX_LEVEL=8
+CONFIG_LOG_DEFAULT_LEVEL=6
+CONFIG_LOGLEVEL=7
+CONFIG_LOG=y
+CONFIG_MISC_INIT_R=y
+CONFIG_OF_LIBFDT=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_SYS_CBSIZE=256
+CONFIG_SYS_DCACHE_OFF=y
+CONFIG_SYS_LONGHELP=y
+CONFIG_SYS_MEMTEST_END=0x3F00000
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_NS16550=y
+CONFIG_NS16550_DYNAMIC=y
+CONFIG_SYS_PBSIZE=280
+CONFIG_SYS_PROMPT="MOXA NPort 6600 # "
+CONFIG_TEXT_BASE=0x80140020
+CONFIG_TARGET_NPORT6600=y
+CONFIG_FS_EXT4=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_FS_FAT=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_SHA1SUM=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_UNLZ4=y
+CONFIG_CMD_UNZIP=y
+CONFIG_CMD_SETEXPR=y
+CONFIG_CMD_SETEXPR_FMT=y
+CONFIG_CMD_READ=y
+CONFIG_CMD_GETTIME=y
+CONFIG_CMD_TIMER=y
+CONFIG_CMD_UBI_RENAME=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEM_SEARCH=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_EXPORTENV=y
+CONFIG_CMD_IMPORTENV=y
+CONFIG_CMD_EDITENV=y
+CONFIG_CMD_GREPENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_ENV_EXISTS=y
+CONFIG_CMD_ENV_CALLBACK=y
+CONFIG_CMD_ENV_FLAGS=y
+CONFIG_SYS_LOAD_ADDR=0x100000
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MBR=y
+CONFIG_CMD_PART=y
+CONFIG_CMD_WGET=y
+CONFIG_DM_STATS=y
+CONFIG_CMD_HASH=y
+CONFIG_HASH_VERIFY=y
+CONFIG_CMD_DHCP=y
+CONFIG_BAUDRATE=115200
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_FLASH_CFI_MTD=y
+CONFIG_CFI_FLASH=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_SYS_FLASH_CFI=y
+CONFIG_SYS_FLASH_CFI_WIDTH_16BIT=y
+CONFIG_SYS_FLASH_EMPTY_INFO=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="nport6600"
+CONFIG_SYS_CLK_FREQ=48000000
+CONFIG_TIMER=y
+CONFIG_FTTMR010_TIMER=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_ETH=y
+CONFIG_MMC=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_VERBOSE=y
+CONFIG_CMD_MMC=y
+CONFIG_FTSDC010=y
+CONFIG_WDT_FTWDT010=y
+CONFIG_WDT=y
+CONFIG_CMD_WDT=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_SYSRESET_WATCHDOG_AUTO=y
+CONFIG_CMD_GPIO=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_HT1380=y
+CONFIG_CMD_RTC=y
+CONFIG_CMD_DATE=y
+CONFIG_FTGPIO010=y
+CONFIG_CMD_MII=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200n8"
+CONFIG_IPV6=y
+CONFIG_PCI=y
+CONFIG_CMD_PCI=y
+CONFIG_PCI_FTPCI100=y
diff --git a/include/configs/nport6600.h b/include/configs/nport6600.h
new file mode 100644
index 000000000000..c70cc7e1ac72
--- /dev/null
+++ b/include/configs/nport6600.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef _CONFIG_NPORT6600_H
+#define _CONFIG_NPORT6600_H
+
+#include <linux/sizes.h>
+
+#define CFG_SYS_INIT_RAM_ADDR 0
+#define CFG_SYS_INIT_RAM_SIZE SZ_64M
+
+#define __io
+
+#endif /* _CONFIG_NPORT6600_H */
--
2.37.2
3
6
Hi,
This series syncs AM64 DT files from Linux v6.5-rc1.
NOTE: I have only boot tested this on AM64-GP-EVM.
I would appreciate a tested-by for AM64-sk EVM. Thanks.
cheers,
-roger
Changelog:
v2:
- Sync with v6.5-rc1
- Rebase on latest uboot/master
- CPSW node cleanup
- Timer node cleanup
Roger Quadros (2):
board: ti: am64x: Recognize AM64-HSEVM
arm: dts: k3-am64: Sync DT with Linux v6.5-rc1
arch/arm/dts/k3-am64-main.dtsi | 171 +++++++++++++++++++++++--
arch/arm/dts/k3-am64-mcu.dtsi | 53 +++++++-
arch/arm/dts/k3-am64-thermal.dtsi | 33 +++++
arch/arm/dts/k3-am64.dtsi | 22 +---
arch/arm/dts/k3-am642-evm-u-boot.dtsi | 42 ++-----
arch/arm/dts/k3-am642-evm.dts | 173 ++++++++++++++++++++------
arch/arm/dts/k3-am642-r5-evm.dts | 26 +++-
arch/arm/dts/k3-am642-r5-sk.dts | 31 ++++-
arch/arm/dts/k3-am642-sk-u-boot.dtsi | 43 ++-----
arch/arm/dts/k3-am642-sk.dts | 166 +++++++++++++++++-------
arch/arm/dts/k3-am642.dtsi | 1 +
board/ti/am64x/evm.c | 3 +-
12 files changed, 589 insertions(+), 175 deletions(-)
create mode 100644 arch/arm/dts/k3-am64-thermal.dtsi
--
2.34.1
3
9
Hi Tom,
The following changes since commit 7755b2200777f72dca87dd169138e95f011bbcb9:
Merge tag 'x86-pull-20230801' of https://source.denx.de/u-boot/custodians/u-boot-x86 (2023-08-01 11:57:55 -0400)
are available in the Git repository at:
https://source.denx.de/u-boot/custodians/u-boot-riscv.git
for you to fetch changes up to 02be57caf730e2213bc844bf1dbe58bedd2c3734:
riscv: qemu: Enable usb keyboard as an input device (2023-08-02 16:32:44 +0800)
CI result shows no issue: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/17179
----------------------------------------------------------------
+ Fix compilation error for CI when enabling RTL8169 driver
+ Fix compilation error for pci_mmc.c by adding acpi_table header file
+ Support video console and usb keyboard on RISC-V QEMU virt machine
+ Support StarFive JH7110 PCIe driver
+ Enable PCI on Unmatched board
----------------------------------------------------------------
Bin Meng (8):
riscv: qemu: Enable Bochs video support
console: kconfig: Drop the redundant VIDEO dependency
console: Make stdio_print_current_devices() static
console: Refactor stdio_print_current_devices() a little bit
console: Print out complete stdio device list
riscv: qemu: Enable PRE_CONSOLE_BUFFER
riscv: qemu: Remove out-of-date "riscv, kernel-start" handling
riscv: qemu: Enable usb keyboard as an input device
Heinrich Schuchardt (2):
riscv: sifive: initialize PCI on Unmatched
acpi: Add missing RISC-V acpi_table header
Mason Huo (3):
starfive: pci: Add StarFive JH7110 pcie driver
configs: starfive-jh7110: Add support for PCIe host driver
riscv: dts: starfive: Enable PCIe host controller
Minda Chen (5):
i2c: designware: Add Kconfig for designware_i2c_pci.c
net: rtl8169: Fix compile warning in rtl8169
net: rtl8169: Fix DMA minimal aligned compile warning in RISC-V
net: rtl8169: Add one device ID 0x8161
configs: starfive-jh7110: Add CONFIG_RTL8169
arch/riscv/dts/jh7110-starfive-visionfive-2.dtsi | 11 +
arch/riscv/dts/jh7110.dtsi | 74 ++++++
arch/riscv/include/asm/acpi_table.h | 11 +
board/emulation/qemu-riscv/Kconfig | 13 +
board/emulation/qemu-riscv/qemu-riscv.c | 27 +-
common/Kconfig | 2 +-
common/console.c | 44 ++--
configs/sifive_unmatched_defconfig | 1 +
configs/starfive_visionfive2_defconfig | 8 +
doc/board/emulation/qemu-riscv.rst | 10 +
drivers/i2c/Kconfig | 9 +
drivers/i2c/Makefile | 4 +-
drivers/net/rtl8169.c | 22 +-
drivers/pci/Kconfig | 13 +
drivers/pci/Makefile | 2 +
drivers/pci/pcie_plda_common.c | 116 +++++++++
drivers/pci/pcie_plda_common.h | 118 +++++++++
drivers/pci/pcie_starfive_jh7110.c | 317 +++++++++++++++++++++++
include/configs/qemu-riscv.h | 15 +-
include/stdio_dev.h | 2 -
20 files changed, 755 insertions(+), 64 deletions(-)
create mode 100644 arch/riscv/include/asm/acpi_table.h
create mode 100644 drivers/pci/pcie_plda_common.c
create mode 100644 drivers/pci/pcie_plda_common.h
create mode 100644 drivers/pci/pcie_starfive_jh7110.c
Best regards,
Leo
2
1