element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Kernel compilation walk-through
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 24 replies
  • Subscribers 675 subscribers
  • Views 3131 views
  • Users 0 members are here
  • compilation
  • kernel
Related

Kernel compilation walk-through

timg73
timg73 over 10 years ago

There have been a few comments recently about compilation of the "Cirrus-Logic" Linux kernel, so I thought I'd post my recipe.  This is for native compilation running on a fresh installation of Rasbian 2014-12-24 (2014-12-24-wheezy-raspbian.zip).  It takes about 10 hours so let it run overnight.  The comments are minimal, but the process is well described in the Debian documentation.

NB this will compile the v3.12 kernel, which only works on the original Raspberry Pi series.  It will not work on an Raspberry Pi 2.

 

# How to recompile the Raspberry-Pi kernel

# see http://elinux.org/Raspberry_Pi_Kernel_Compilation

 

### PREREQUISITES : install compiler (~2MB of disk space)

 

sudo apt-get update

sudo apt-get -y dist-upgrade

sudo apt-get -y install gcc make bc screen ncurses-dev

 

### get source for alternative kernel

 

mkdir ~/tmp

cd ~/tmp

git init

 

git clone --depth 1 https://github.com/CirrusLogic/wiki-content.git # download audio-card config scripts

mv wiki-content/scripts ~/

rm -rf wiki-content

 

git clone -b rpi-3.12.y --depth 1 https://github.com/CirrusLogic/rpi-linux.git # download kernel source

tar -czvf rpi-kernel-3-12-33-cirrus.tgz rpi-linux # save source as tar for next time

#tar -xzvf rpi-kernel-3-12-33-cirrus.tgz # extract source from saved tar instead of re-downloading

cd rpi-linux

 

### configure & compile kernel

 

make mrproper         # clean up build directory

make bcmrpi_defconfig # create config for Cirrus Logic audio card (same as official instructions)

make oldconfig        # ensure config is up to date

make menuconfig       # give kernel unique suffix : General Setup -> Local version

#zcat /proc/config.gz | diff - .config # compare with running config

uname -a              # running kernel version

make kernelversion    # new kernel version

make kernelrelease

nohup make &          # compile (about 10 hours)

 

### compile and install kernel and modules

 

make KBUILD_DEBARCH=armhf deb-pkg # create packages

ver=$(make kernelrelease)         # get release string

sudo dpkg -i ../linux-image-${ver}_${ver}-1_armhf.deb

sudo mv /boot/vmlinuz-${ver} /boot/kernel_new.img

sudo rm /boot/*${ver}

 

### configure bootloader and modules

 

sudo perl -i.original -pe 's/^\s*(kernel=.+)$/\#${1}/' /boot/config.txt

echo -e "\n#Use new kernel\nkernel=kernel_new.img" | sudo tee -a /boot/config.txt

 

sudo perl -i.original -pe 's/^(snd-bcm2835)/\#${1}/' /etc/modules # disable onboard sound

echo 'snd-soc-rpi-wsp' | sudo tee -a /etc/modules # enable Cirrus sound

 

sudo perl -i.original -pe 's/^(.+-bcm2708)/\#${1}/' /etc/modprobe.d/raspi-blacklist.conf # enable spi and i2c

echo 'softdep arizona-spi pre: arizona-ldo1

blacklist snd-soc-pcm512x

#blacklist snd-soc-wm8804

' | sudo tee -a /etc/modprobe.d/raspi-blacklist.conf

 

### configure alsa

 

echo 'pcm.!default {

        type hw

        card sndrpiwsp

}

 

ctl.!default {

        type hw

        card sndrpiwsp

}' > ~/.asoundrc

 

# power off, connect Cirrus Audio Card & reboot

sudo halt

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 10 years ago

    Hi,

     

    what I do need to change if I would like to compile 3.12.x    Cirrus Audio Code against the RPI 3.18.x  Kernel?  If I follow the Script it automatically selects teh 3.12 code stream.

     

    Did anybody try this already and did it work out? I would like to geht the Audio Card running onto the RPI 2.

     

    kind regards,

     

    --thomas

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 10 years ago

    Hi,

     

    what I do need to change if I would like to compile 3.12.x    Cirrus Audio Code against the RPI 3.18.x  Kernel?  If I follow the Script it automatically selects teh 3.12 code stream.

     

    Did anybody try this already and did it work out? I would like to geht the Audio Card running onto the RPI 2.

     

    kind regards,

     

    --thomas

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • timg73
    timg73 over 10 years ago in reply to Former Member

    The CLAC patches for the 3.12 kernel cannot be applied directly to the 3.18 kernel.  Thus the CL audio card is not (currently) compatible with the RPi 2.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube