{"id":1605,"date":"2012-10-09T21:45:15","date_gmt":"2012-10-09T21:45:15","guid":{"rendered":"http:\/\/www.chalk-elec.com\/?p=1605"},"modified":"2012-10-28T16:36:08","modified_gmt":"2012-10-28T16:36:08","slug":"how-to-build-kernel-for-beaglebone-for-custom-cape-support","status":"publish","type":"post","link":"https:\/\/www.chalk-elec.com\/?p=1605","title":{"rendered":"How to build kernel for Beaglebone for custom cape support"},"content":{"rendered":"<p>In this How-to we will try to build kernel for Beaglebone that will support our LVDS cape.<\/p>\n<p>Download and install all required sources: <\/p>\n<pre>\r\nsudo apt-get install gcc-arm-linux-gnueabi git ccache libncurses5-dev u-boot-tools lzma\r\ncd ~\r\ngit clone git:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/stable\/linux-stable.git\r\ngit clone git:\/\/github.com\/RobertCNelson\/linux-dev.git\r\ncd linux-dev\r\ngit checkout origin\/am33x-v3.2 -b am33x-v3.2\r\ncp system.sh.sample system.sh\r\n<\/pre>\n<p>Then make the following changes in system.sh:<br \/>\n&#8211; uncomment line CC=arm-linux-gnueabi-<br \/>\n&#8211; uncomment line LINUX_GIT=~\/linux-stable\/<br \/>\n&#8211; uncomment line ZRELADDR=0x80008000<br \/>\n&#8211; uncomment line BUILD_UIMAGE=1<br \/>\n&#8211; uncomment and change line MMC=\/dev\/sde to your SD card system name (mine is \/dev\/sdb)<\/p>\n<p>Next commands:<\/p>\n<pre>\r\n.\/build_kernel.sh\r\n<\/pre>\n<p>will bring you directly to kernel config GUI, and then will assemble it.<\/p>\n<p>After kernel is compiled, please make changes to file <b>~\/linux-dev\/KERNEL\/arch\/arm\/mach-omap2\/board-am335xevm.c<\/b> (see below), then recompile kernel again (command &#8220;tools\/rebuild.sh&#8221;). Once the build had completed there will be a uImage file in <b>~\/linux-dev\/deploy<\/b>. You can install this to your SD card with:<\/p>\n<pre>\r\n.\/tools\/load_uImage.sh\r\n<\/pre>\n<p>Built kernel modules are located in <b>~\/linux-dev\/deploy\/mod\/lib<\/b><\/p>\n<p>To add support for our LVDS cape you need to patch file <b>board-am335xevm.c<\/b> located in <b>\/kernel\/arch\/arm\/mach-omap2<\/b>. You should find function <b>beaglebone_cape_setup(struct<br \/>\nmemory_accessor *mem_acc, void *context)<\/b> in this file and change it to always invoke function <b>dvi_init(0,0)<\/b>. The easiest way is to put<br \/>\nthe following lines:<\/p>\n<pre>\r\npr_info(\"BeagleBone cape: initializing DVI cape\\n\");\r\ndvi_init(0,0);\r\nreturn;\r\n<\/pre>\n<p>at the beginning of function.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this How-to we will try to build kernel for Beaglebone that will support our LVDS cape. Download and install all required sources: Then make the following changes in system.sh: &#8211; uncomment line CC=arm-linux-gnueabi- &#8211; uncomment line LINUX_GIT=~\/linux-stable\/ &#8211; uncomment line ZRELADDR=0x80008000 &#8211; uncomment line BUILD_UIMAGE=1 &#8211; uncomment and change line MMC=\/dev\/sde to your SD [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1605","post","type-post","status-publish","format-standard","hentry","category-howto"],"_links":{"self":[{"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/posts\/1605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1605"}],"version-history":[{"count":6,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/posts\/1605\/revisions"}],"predecessor-version":[{"id":1610,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=\/wp\/v2\/posts\/1605\/revisions\/1610"}],"wp:attachment":[{"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chalk-elec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}