{"id":4526,"date":"2019-12-15T11:09:56","date_gmt":"2019-12-15T19:09:56","guid":{"rendered":"https:\/\/www.flamingspork.com\/blog\/?p=4526"},"modified":"2019-12-15T11:09:56","modified_gmt":"2019-12-15T19:09:56","slug":"are-you-fans-of-the-blackbird-speak-up-i-cant-hear-you-over-the-fan","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2019\/12\/15\/are-you-fans-of-the-blackbird-speak-up-i-cant-hear-you-over-the-fan\/","title":{"rendered":"Are you Fans of the Blackbird? Speak up, I can&#8217;t hear you over the fan."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">So, as of yesterday, I started running a pretty-close-to-upstream <a href=\"https:\/\/github.com\/open-power\/op-build\/\">op-build<\/a> host firmware stack on my Blackbird. Notable yak-shaving has included:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/github.com\/open-power\/op-build\/pull\/3338\">Update README.md for Fedora 31 build-deps<\/a> because READMEs are important<\/li><li><a href=\"https:\/\/github.com\/open-power\/op-build\/pull\/3339\">Support Python3 as default \/usr\/bin\/python<\/a> (so I could compile it at all on Fedora 31)<\/li><li><a href=\"https:\/\/github.com\/open-power\/op-build\/pull\/3341\">RaptorCS Blackbird support<\/a> the actual minimal firmware port<\/li><li><a href=\"https:\/\/github.com\/open-power\/op-build\/pull\/3340\">Linux v5.4.3-openpower1<\/a> because 5.3.7 in the current op-build repo has an NVME driver bug that means it didn&#8217;t recognize my Intel NVME drive, and thus prevented me from actually booting an OS.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Apart from that, I was all happy as Larry. Except then I went into the room with the Blackbird in it an went &#8220;huh, that&#8217;s loud&#8221;, and since it was bedtime, I decided it could all wait until the morning.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is now the morning. Checking fan speeds over IPMI, one fan stood out (fan2, sitting at 4300RPM). This was a bit of a surprise as what&#8217;s silkscreened on the board is that the rear case fan is hooked up to &#8216;fan2&#8243;, and if we had a &#8220;start from 0\/1&#8221; mix up, it&#8217;d be the front case fan. I had just assumed it&#8217;d be maybe OCC firmware dying or something, but this wasn&#8217;t the case (I checked &#8211; thanks <a href=\"https:\/\/github.com\/open-power\/occ\/blob\/master\/src\/tools\/occtoolp9\">occtoolp9<\/a>!)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After a bit of digging around, I worked out this mapping:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>IPMI fan0<\/td><td>Rear Case Fan<\/td><td>Motherboard Fan 2<\/td><\/tr><tr><td>IPMI fan1<\/td><td>Front Case Fan<\/td><td>Motherboard Fan 3<\/td><\/tr><tr><td>IPMI fan2<\/td><td>CPU Fan<\/td><td>Motherboard Fan 1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Which is about as surprising and confusing as you&#8217;d think.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After a bunch of digging around the Raptor ports of OpenBMC and Hostboot, it seems that the IPL Observer which is custom to Raptor controls if the BMC decides to do fan control or not.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can get its view of the world from the BMC via the (incredibly user friendly) poking at DBus:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>busctl get-property org.openbmc.status.IPL \/org\/openbmc\/status\/IPL org.openbmc.status.IPL current_status; busctl get-property org.openbmc.status.IPL \/org\/openbmc\/status\/IPL org.openbmc.status.IPL current_istep\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Which if you just have the Hostboot patch in (like I first did) you end up with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>s \"IPL_RUNNING\"\ns \"21,3\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Which is where Hostboot exits the IPL process (as you see on the screen) and hands over to skiboot. But if you start digging through their <strong>op-build<\/strong> tree, you find that there&#8217;s a signal_linux_start_complete script which calls <strong>pnv-lpc<\/strong> to write two values to LPC ports 0x81 and 0x82. The pnv-lpc utility is the external\/lpc\/ binary from skiboot, and these two ports are the &#8220;extended lpc port 80h&#8221; state.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, to get back fan control? First, build the lpc utility:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone git@github.com:open-power\/skiboot.git\ncd skiboot\/external\/lpc\nmake<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and then poke the magic values of &#8220;IPL complete and linux running&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo .\/lpc io 0x81.b=254\n&#91;io] W 0x00000081.b=0xfe\n$ sudo .\/lpc io 0x82.b=254\n&#91;io] W 0x00000082.b=0xfe\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You get a friendly beep, and then your fans return to sanity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, for that to work you need to have debugfs mounted, as this pokes OPAL debugfs to do direct LPC operations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next up: think of a smarter way to trigger that than &#8220;stewart runs it on the command line&#8221;. Also next up: work out the better way to determine that fan control should be on and patch the BMC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, as of yesterday, I started running a pretty-close-to-upstream op-build host firmware stack on my Blackbird. Notable yak-shaving has included: Update README.md for Fedora 31 build-deps because READMEs are important Support Python3 as default \/usr\/bin\/python (so I could compile it &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2019\/12\/15\/are-you-fans-of-the-blackbird-speak-up-i-cant-hear-you-over-the-fan\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[5,588,615],"tags":[740,742,656,587,741],"class_list":["post-4526","post","type-post","status-publish","format-standard","hentry","category-cool-gadgets","category-opal","category-powerpc","tag-blackbird","tag-fan-control","tag-openbmc","tag-openpower","tag-raptorcs"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-1b0","jetpack-related-posts":[{"id":4599,"url":"https:\/\/www.flamingspork.com\/blog\/2020\/05\/13\/a-op-build-v2-5-rc1-based-raptor-blackbird-build\/","url_meta":{"origin":4526,"position":0},"title":"A op-build v2.5-rc1 based Raptor Blackbird Build","author":"Stewart Smith","date":"2020-05-13","format":false,"excerpt":"I have done a few builds of firmware for the Raptor Blackbird since I got mine, each of them based on upstream op-build plus a few patches. The previous one was Yet another near-upstream Raptor Blackbird firmware build that I built a couple of months ago. This new build is\u2026","rel":"","context":"In &quot;cool gadgets&quot;","block_context":{"text":"cool gadgets","link":"https:\/\/www.flamingspork.com\/blog\/category\/cool-gadgets\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4528,"url":"https:\/\/www.flamingspork.com\/blog\/2019\/12\/16\/a-close-to-upstream-firmware-build-for-the-raptor-blackbird\/","url_meta":{"origin":4526,"position":1},"title":"A close-to-upstream firmware build for the Raptor Blackbird","author":"Stewart Smith","date":"2019-12-16","format":false,"excerpt":"UPDATE: A newer version is available here It goes without saying that using this build is a At Your Own Risk and I make zero warranty. AFAIK it can't physically destroy your system. My GitHub op-build branch stewart-blackbird-v1 has all the changes built into this build (the VERSION displayed in\u2026","rel":"","context":"In &quot;cool gadgets&quot;","block_context":{"text":"cool gadgets","link":"https:\/\/www.flamingspork.com\/blog\/category\/cool-gadgets\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4607,"url":"https:\/\/www.flamingspork.com\/blog\/2020\/05\/16\/raptor-blackbird-support-all-upstream-in-op-build\/","url_meta":{"origin":4526,"position":2},"title":"Raptor Blackbird support: all upstream in op-build","author":"Stewart Smith","date":"2020-05-16","format":false,"excerpt":"Thanks to my most recent PR being merged, op-build v2.5 will have full support for the Raptor Blackbird! This includes support for the \"IPL Monitor\" that's required to get fan control going. Note that if you're running Fedora 32 then you need some patches to buildroot to have it build,\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4522,"url":"https:\/\/www.flamingspork.com\/blog\/2019\/12\/14\/booting-temporary-firmware-on-the-raptor-blackbird\/","url_meta":{"origin":4526,"position":3},"title":"Booting temporary firmware on the Raptor Blackbird","author":"Stewart Smith","date":"2019-12-14","format":false,"excerpt":"In a future post, I'll detail how to build my ported-to-upstream Blackbird firmware. Here though, we'll explore booting some firmware temporarily to experiment. Step 1: Copy your new PNOR image over to the BMC.Step 2: ...Step 3: Profit! Okay, not really, once you've copied over your image, ensure the computer\u2026","rel":"","context":"In &quot;cool gadgets&quot;","block_context":{"text":"cool gadgets","link":"https:\/\/www.flamingspork.com\/blog\/category\/cool-gadgets\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-14-09-59-38.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-14-09-59-38.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-14-09-59-38.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":4617,"url":"https:\/\/www.flamingspork.com\/blog\/2020\/05\/25\/op-build-v2-5-firmware-for-the-raptor-blackbird\/","url_meta":{"origin":4526,"position":4},"title":"op-build v2.5 firmware for the Raptor Blackbird","author":"Stewart Smith","date":"2020-05-25","format":false,"excerpt":"Well, following on from my post where I excitedly pointed out that Raptor Blackbird support: all upstream in op-build v2.5, that means I can do another in my series of (close to) upstream Blackbird firmware builds. This time, the only difference from straight upstream op-build v2.5 is my fixes for\u2026","rel":"","context":"In &quot;powerpc&quot;","block_context":{"text":"powerpc","link":"https:\/\/www.flamingspork.com\/blog\/category\/powerpc\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4515,"url":"https:\/\/www.flamingspork.com\/blog\/2019\/12\/13\/upstreaming-blackbird-firmware-step-1-skiboot\/","url_meta":{"origin":4526,"position":5},"title":"Upstreaming Blackbird firmware (step 1: skiboot)","author":"Stewart Smith","date":"2019-12-13","format":false,"excerpt":"Now that I can actually boot the machine, I could test and send my patch upstream for Blackbird support in skiboot. One thing I noticed with the current firmware from Raptor is that the PCIe slot names were wrong. While a pretty minor point, it's a bit funny that there's\u2026","rel":"","context":"In &quot;cool gadgets&quot;","block_context":{"text":"cool gadgets","link":"https:\/\/www.flamingspork.com\/blog\/category\/cool-gadgets\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/4526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=4526"}],"version-history":[{"count":1,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/4526\/revisions"}],"predecessor-version":[{"id":4527,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/4526\/revisions\/4527"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=4526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=4526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=4526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}