<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style="--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>
GitLab
</title>

<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>

<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: hsla(0,0%,100%,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style="font-size: inherit; -webkit-text-shadow: hsla(0,0%,100%,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";">
<div class="content">

<p class="details" style="font-style: italic; color: #626168;">
<a href="https://gitlab.rtems.org/ppisa">Pavel Pisa</a> created a merge request: <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1578">!1578</a>
</p>
<div class="branch">
Project:Branches: ppisa/rtems:i386-pc386-pci-can to rtems/rtos/rtems:main
</div>
<div>
Author: Pavel Pisa
</div>

<div class="md gl-mt-5" style="position: relative; z-index: 1; color: #3a383f; word-wrap: break-word; margin-top: 1rem;">
<h2 id="user-content-summary" dir="auto" style="margin-top: 0px; margin-bottom: 10px;" align="initial">Summary<a href="#summary" aria-label="Link to heading 'Summary'" data-heading-content="Summary" class="anchor" style="margin-top: 0px;"></a>
</h2>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">bsps/i386/pc386: add probe for Kvaser PCICan4,2,1 and CTU CA FD CAN CAN controllers</p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">This is draft for discussion. The PCI support in core RTEMS usable
without LibBSD is minimal. I/O and memory mapped registers portable
access primitives are missing and mechanism, how to properly specify that
application requests to pull PCI CAN controller scans into linking
from the library should be discussed. May it be something like
<code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0px; font-weight: inherit; overflow-wrap: break-word; white-space: break-spaces; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: keep-all; padding: 0.125rem 0.25rem;">RTEMS_LINKER_ROSET_ITEM_REFERENCE</code> can be used in some macros like <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; overflow-wrap: break-word; white-space: break-spaces; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: keep-all; padding: 0.125rem 0.25rem;">CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER</code>.</p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">The unconditional <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0px; font-weight: inherit; overflow-wrap: break-word; white-space: break-spaces; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: keep-all; padding: 0.125rem 0.25rem;">RTEMS_SYSINIT_ITEM</code> in pc386 <code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; font-weight: inherit; overflow-wrap: break-word; white-space: break-spaces; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: keep-all; padding: 0.125rem 0.25rem;">bspstart.c</code> is used
to enforce probe for PCI device. The probe code uses loops which
attempt to register can channels under next available "/dev/canX"
node. The symbols used to pull object file with scan functions
should be declared in some headers files, for example:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0px 0px 1rem; padding: 0;">
<li style="margin-top: 0px; line-height: 1.6em; margin-left: 25px; padding-left: 3px;"><code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0px; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 0.125rem 0.25rem;">bsps/include/dev/can/ctucanfd_pci.h</code></li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;"><code style="font-size: 90%; color: #18171d; word-wrap: break-word; background-color: #ececef; border-radius: .25rem; margin-top: 0px; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 0.125rem 0.25rem;">bsps/include/dev/can/sja1000_kvpcican.h</code></li>
</ul>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">may it be together with some macros to request pull of the library
archive member to the final linking.</p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">So the code is dirty at this form and does not meet criteria
for merge. It intended as the base for discussion what is
proper and preferred approach.</p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">But on the other hand, this experiment finishes loop started by
Jin Yang's 2013 GSoC "Porting CAN driver, LinCAN, to RTEMS" which
has been altered to provide CAN test environment available to everybody
by extending QEMU (see <a href="https://www.qemu.org/docs/master/system/devices/can.html" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0px;">CAN Bus Emulation Support</a>).
This work has grownup and is used by multiple RTOSes and for
GNU/Linux development. We have added CTU CAN FD to original basic SJA1000
support, AMD/XilinX has added <a href="https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/863043713/Using+CAN+CAN+FD+with+AMD+QEMU" rel="nofollow noreferrer noopener" target="_blank">Zynq UltraScale+ MPSoC and Versal CAN FD emulation</a>, Matyáš Bobek's <a href="https://dspace.cvut.cz/bitstream/handle/10467/122654/F3-BP-2025-Bobek-Matyas-BP_Bobek_FlexCAN_final_4.pdf" rel="nofollow noreferrer noopener" target="_blank">theis</a>
added FlexCAN (non-FD for now) emulation.</p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">The <a href="https://docs.rtems.org/docs/main/bsp-howto/can.html" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0px;">CAN/CAN FD subsystem</a> based on original LinCAN ideas is part of RTEMS now.</p>
<p dir="auto" style="color: #3a383f; margin: 0px 0px 1rem;" align="initial">When these PCI mapping are included in mainline RTEMS, then the RTEMS CAN/CAN FD subsystem can be tested by every developer without requirement of specific physical hardware.</p>
<h2 id="user-content-generative-ai" dir="auto" style="margin-top: 20px; margin-bottom: 10px;" align="initial">Generative AI<a href="#generative-ai" aria-label="Link to heading 'Generative AI'" data-heading-content="Generative AI" class="anchor" style="margin-top: 0px;"></a>
</h2>
<p dir="auto" style="color: #3a383f; margin: 0px;" align="initial">Only my head, hands and git clang-format has been used.</p>
</div>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #626168;">
—
<br>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1578">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.rtems.org">gitlab.rtems.org</a>. <a href="https://gitlab.rtems.org/-/namespace/49/sent_notifications/6-b1ty6zdmx5889iz9n6mffot4g-1d/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.rtems.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.rtems.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<span style="color: transparent; font-size: 0; display: none; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0;">
Notification message regarding https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1578 at 1794440742
</span>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1578"}}</script>


</p>
</div>
</body>
</html>