{"id":323,"date":"2018-08-23T22:28:50","date_gmt":"2018-08-23T20:28:50","guid":{"rendered":"https:\/\/netbsd.name\/?p=323"},"modified":"2018-08-23T22:28:50","modified_gmt":"2018-08-23T20:28:50","slug":"enable-padlock-and-viadrm-on-netbsd","status":"publish","type":"post","link":"https:\/\/netbsd.name\/?p=323","title":{"rendered":"Enable padlock and viadrm on NetBSD"},"content":{"rendered":"<p>In case you have a board with VIA CPU supporting <a href=\"https:\/\/www.cryptopp.com\/wiki\/VIA_Padlock\">padlock<\/a> security engine and VIA (Chrome) integrated graphics,\u00a0 NetBSD generic kernel doesn&#8217;t support them by default. Because of this, I was building the custom NetBSD kernel manually for many years by uncommenting one of these lines in GENERIC configuration:<\/p>\n<p>#padlock0 at cpu0 # VIA PadLock<br \/>\n&#8230;<br \/>\n# DRMUMS drivers<br \/>\n#viadrmums* at drm?<br \/>\nor<br \/>\n#viadrm* at drm? # VIA DRM driver<\/p>\n<p style=\"padding-left: 30px;\">* viadrmums driver is preferred over viadrm one, because it is newer and more stable\u00a0 compared to viadrm.\u00a0 Actually viadrm is already removed from the current branch, however it still available in NetBSD 8 release, thus may still confuse unaware users&#8230;<\/p>\n<p>There is an easier option to load them though. Starting NetBSD 6 dynamic kernel <a href=\"http:\/\/netbsd.gw.com\/cgi-bin\/man-cgi?module+7+NetBSD-current\">modules<\/a> were introduced in the system. This <a href=\"https:\/\/www.slideshare.net\/masaruoki9\/modern-net-bsd-kernel-module\">presentation<\/a> has a nice introduction on how to use and develop them. Both padlock and viadrmums modules are already provided by the NetBSD. In order to load them these lines need to be added to \/boot.cfg file:<\/p>\n<p># load padlock module<br \/>\nload=padlock<br \/>\n# load VIA DRM UMS driver and required dependencies<br \/>\nload=drmkms_linux<br \/>\nload=drmkms<br \/>\nload=drmkms_pci<br \/>\nload=viadrmums<\/p>\n<p>If everything went OK, these (or similar) lines should be present\u00a0 in system&#8217;s <a href=\"http:\/\/netbsd.gw.com\/cgi-bin\/man-cgi?dmesg+8+NetBSD-current\">dmesg<\/a>\u00a0after reboot:<\/p>\n<p>padlock0 at cpu0: VIA PadLock<br \/>\npadlock0: RNG ACE<br \/>\n&#8230;<br \/>\nviadrmums0 at vga0drm: Supports vblank timestamp caching Rev 2 (21.10.2013).<\/p>\n<p>There is one small caveat though, prior NetBSD 8 release above configuration would still likely end up with &#8220;<span class=\"il\">bootinfo<\/span> <span class=\"il\">too<\/span> <span class=\"il\">big&#8221; error during the boot process (if all mentioned modules are enabled at the same time and rndseed \/var\/db\/entropy-file is used, which is default behavior). This was solved with the following <a href=\"https:\/\/github.com\/NetBSD\/src\/commit\/ddd15d6644c9221a853ad6dfbd3273a5d086cc89\">commit<\/a> (bootloader needs to be updated),\u00a0 NetBSD 8 successfully loads all modules and boot process doesn&#8217;t fail. Custom kernel is not required anymore, it just takes few additional lines in the boot configuration file.<br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In case you have a board with VIA CPU supporting padlock security engine and VIA (Chrome) integrated graphics,\u00a0 NetBSD generic kernel doesn&#8217;t support them by default. Because of this, I was building the custom NetBSD kernel manually for many years by uncommenting one of these lines in GENERIC configuration: #padlock0 at cpu0 # VIA PadLock &hellip; <a href=\"https:\/\/netbsd.name\/?p=323\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Enable padlock and viadrm on NetBSD<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-323","post","type-post","status-publish","format-standard","hentry","category-netbsd"],"_links":{"self":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323"}],"version-history":[{"count":5,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/323\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/323\/revisions\/328"}],"wp:attachment":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}