Coder Social home page Coder Social logo

linux-am33xbot's Introduction

linux-am33xbot

Arch Linux ARM Kernel with botic patches (for Beaglebone Black / Wireless). Please refer to DiyAudio thread for more information on the driver and its development and checkout Cronus and Hermes-BBB from Twistedpearaudio for the background on the required cape for the Beaglebone board. Credit for the development of the cape and driver to Russ White from TPA and Miero.

Installation instructions

Follow these steps to build a boticized kernel for recent Arch Linux ARM:

  1. Make sure you have either a VM or a native install of Arch Linux (x86-64) and that you are able to build packages: pacman -S --needed base-devel
  2. Install the cross-compiler required to build the kernel for the armv7h architecture (AUR: arm-linux-gnueabihf-gcc-linaro-bin)
  3. Clone this repository, enter the created folder and delete the .githidden folder created by the git tool (otherwise some of the patches will not apply)
  4. Run CARCH=armv7h makepkg -A in the created folder to build the package
  5. Copy the created package (pkg.tar.xz file) to the BBB / BBBW
  6. Uninstall the standard kernel package (pacman -R linux-am33x). ATTENTION: You need to install the new kernel before rebooting / power off
  7. Install the package with pacman -U

Before rebooting ensure that Arch Linux ARM is configured to load the required botic overlay and edit /boot/boot.txt accordingly, see following example (which disables also the onboard oscillator):

# After modifying, run ./mkscr

if test -n ${distro_bootpart}; then setenv bootpart ${distro_bootpart}; else setenv bootpart 1; fi
part uuid ${devtype} ${devnum}:${bootpart} uuid

setenv bootargs "console=tty0 console=${console} root=PARTUUID=${uuid} rw rootwait"

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
  gpio set 54
  echo fdt: ${fdtfile}
  if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
    gpio set 55

    fdt addr ${fdt_addr_r}
    # Remove the internal clock as well as the original mcasp pinctrl bindings
    fdt rm /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/mcasp0_pins
    fdt rm /clk_mcasp0_fixed
    fdt rm /clk_mcasp0
    
    # Enable Botic overlay
    # Use below line only if you have ES9018 DAC connected to the I2C header of the Hermes-BBB module:
    #load ${devtype} ${devnum}:${bootpart} 0x88060000 /lib/firmware/BOTIC-SABRE32-00A0.dtbo
    
    # In case you want to use ES9018K2M based DAC, you can use the following overlay line:
    #load ${devtype} ${devnum}:${bootpart} 0x88060000 /lib/firmware/BOTIC-ES9018K2M-00A0.dtbo
    
    # For some generic I2S/DSD DAC connected to the Cronus board you can use the following dummy codec overlay.
    # You can still use I2C directly from the isolated headers of the Cronus board to control the DAC if necessary.
    load ${devtype} ${devnum}:${bootpart} 0x88060000 /lib/firmware/BOTIC-00A0.dtbo
    
    fdt resize ${filesize}
    fdt apply 0x88060000
    
    if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
      gpio set 56
      bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
    else
      gpio set 56
      bootz ${kernel_addr_r} - ${fdt_addr_r};
    fi;
  fi;
fi

Afterwards run ./mkscr in the /boot directory and reboot. Enjoy the boticized kernel and listen to some good music!

Instructions in case of non-default clock frequencies

Note that the above instructions only work in case of standard default clock frequencies for the Cronus clock module: 48kHz multiples are assumed to run using a 49152000Hz clock and 44.1kHz multiples are assumed to run using a 45158400Hz clock.

If you have mounted clocks with frequencies different from the above you have to manually edit the dts source file of the overlay you want to use.

Instead of step 4 above, perform the following:

  • Run CARCH=armv7h makepkg -oA to extract the sources and enter the src/bb.org-overlays/src/arm directory
  • Edit the BOTIC-XXX.dts file to change the frequencies of the two clock definitions clk48 and clk44
  • Go back to the root folder of the repository (linux-am33xbot) and run CARCH=armv7h makepkg -eA to build the package without extracting the sources again.

linux-am33xbot's People

Contributors

coroner21 avatar

Stargazers

 avatar

Watchers

 avatar

linux-am33xbot's Issues

building kernel on BBB Arch linux machine

HI,
I'm trying to build patched botic kernel using newest Arch linux on my BBB.
Unfortunately I receive an error:

[alarm@alarm linux-am33xbot]$ CARCH=armv7h makepkg -AC
==> Making package: linux-am33xbot 5.1.15-1 (Sat Aug 17 20:53:29 2019)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found linux-5.1.tar.xz
  -> Found patch-5.1.15.xz
  -> Found patch-5.1.15-bone11.diff.gz
  -> Updating bb.org-overlays git repo...
Fetching origin
  -> Found 0001-add-lcd-cape-for-chiliboard.patch
  -> Found config
  -> Found linux.preset
  -> Found 99-linux.hook
  -> Found mcasp-dsd.patch
  -> Found mcasp-inactive-serializers.patch
  -> Found botic-card.patch
  -> Found botic-codec.patch
  -> Found sabre32-codec.patch
  -> Found es9018k2m-codec.patch
==> Validating source files with md5sums...
    linux-5.1.tar.xz ... Passed
    patch-5.1.15.xz ... Passed
    patch-5.1.15-bone11.diff.gz ... Passed
    bb.org-overlays ... Skipped
    0001-add-lcd-cape-for-chiliboard.patch ... Passed
    config ... Passed
    linux.preset ... Passed
    99-linux.hook ... Passed
    mcasp-dsd.patch ... Passed
    mcasp-inactive-serializers.patch ... Passed
    botic-card.patch ... Passed
    botic-codec.patch ... Passed
    sabre32-codec.patch ... Passed
    es9018k2m-codec.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting linux-5.1.tar.xz with bsdtar
  -> Extracting patch-5.1.15.xz with xz
  -> Extracting patch-5.1.15-bone11.diff.gz with gzip
  -> Creating working copy of bb.org-overlays git repo...
Cloning into 'bb.org-overlays'...
done.
==> Starting prepare()...
patching file sound/soc/ti/davinci-mcasp.c
Hunk #1 succeeded at 812 (offset 2 lines).
Hunk #2 succeeded at 924 (offset 2 lines).
Hunk #3 succeeded at 970 (offset 2 lines).
Hunk #4 succeeded at 995 (offset 2 lines).
Hunk #5 succeeded at 1158 (offset 2 lines).
Hunk #6 succeeded at 1204 (offset 2 lines).
Hunk #7 succeeded at 1212 (offset 2 lines).
Hunk #8 succeeded at 1243 (offset 2 lines).
Hunk #9 succeeded at 1295 (offset 2 lines).
Hunk #10 succeeded at 1528 (offset 2 lines).
Hunk #11 succeeded at 1539 (offset 2 lines).
patching file sound/soc/ti/davinci-mcasp.c
Hunk #1 succeeded at 847 (offset 2 lines).
patching file sound/soc/codecs/botic-codec.c
patching file sound/soc/codecs/Kconfig
patching file sound/soc/codecs/Makefile
patching file sound/soc/generic/botic-card.c
patching file sound/soc/generic/Kconfig
patching file sound/soc/generic/Makefile
patching file sound/soc/codecs/es9018k2m.c
patching file sound/soc/codecs/es9018k2m.h
patching file sound/soc/codecs/Kconfig
Hunk #1 succeeded at 85 (offset 3 lines).
Hunk #2 succeeded at 667 (offset 41 lines).
patching file sound/soc/codecs/Makefile
Hunk #1 succeeded at 81 (offset 3 lines).
Hunk #2 succeeded at 356 (offset 9 lines).
patching file sound/soc/codecs/Kconfig
patching file sound/soc/codecs/Makefile
patching file sound/soc/codecs/sabre32.c
==> Removing existing $pkgdir/ directory...
==> Starting build()...
make: arm-linux-gnueabihf-gcc: Command not found
/bin/sh: arm-linux-gnueabihf-gcc: command not found
  HOSTCC  scripts/basic/fixdep
/bin/sh: arm-linux-gnueabihf-gcc: command not found
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.h
  HOSTCC  scripts/kconfig/lexer.lex.o
  YACC    scripts/kconfig/parser.tab.c
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
./scripts/gcc-version.sh: line 17: arm-linux-gnueabihf-gcc: command not found
./scripts/gcc-version.sh: line 18: arm-linux-gnueabihf-gcc: command not found
./scripts/gcc-version.sh: line 19: arm-linux-gnueabihf-gcc: command not found
./scripts/gcc-version.sh: line 17: arm-linux-gnueabihf-gcc: command not found
./scripts/gcc-version.sh: line 18: arm-linux-gnueabihf-gcc: command not found
./scripts/gcc-version.sh: line 19: arm-linux-gnueabihf-gcc: command not found
./scripts/clang-version.sh: line 11: arm-linux-gnueabihf-gcc: command not found
./scripts/gcc-plugin.sh: line 11: arm-linux-gnueabihf-gcc: command not found
init/Kconfig:16:warning: 'GCC_VERSION': number is invalid
/bin/sh: arm-linux-gnueabihf-gcc: command not found
make: arm-linux-gnueabihf-gcc: Command not found
  SYSHDR  arch/arm/include/generated/uapi/asm/unistd-common.h
  SYSHDR  arch/arm/include/generated/uapi/asm/unistd-oabi.h
  SYSHDR  arch/arm/include/generated/uapi/asm/unistd-eabi.h
  UPD     include/config/kernel.release
  WRAP    arch/arm/include/generated/uapi/asm/kvm_para.h
  WRAP    arch/arm/include/generated/uapi/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/uapi/asm/bpf_perf_event.h
  WRAP    arch/arm/include/generated/uapi/asm/errno.h
  WRAP    arch/arm/include/generated/uapi/asm/ioctl.h
  WRAP    arch/arm/include/generated/uapi/asm/ipcbuf.h
  WRAP    arch/arm/include/generated/uapi/asm/msgbuf.h
  WRAP    arch/arm/include/generated/uapi/asm/param.h
  WRAP    arch/arm/include/generated/uapi/asm/poll.h
  WRAP    arch/arm/include/generated/uapi/asm/resource.h
  WRAP    arch/arm/include/generated/uapi/asm/sembuf.h
  WRAP    arch/arm/include/generated/uapi/asm/shmbuf.h
  WRAP    arch/arm/include/generated/uapi/asm/siginfo.h
  WRAP    arch/arm/include/generated/uapi/asm/socket.h
  WRAP    arch/arm/include/generated/uapi/asm/sockios.h
  WRAP    arch/arm/include/generated/uapi/asm/termbits.h
  WRAP    arch/arm/include/generated/uapi/asm/termios.h
  WRAP    arch/arm/include/generated/asm/compat.h
  WRAP    arch/arm/include/generated/asm/current.h
  WRAP    arch/arm/include/generated/asm/early_ioremap.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/exec.h
  WRAP    arch/arm/include/generated/asm/extable.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm/include/generated/asm/msi.h
  WRAP    arch/arm/include/generated/asm/parport.h
  WRAP    arch/arm/include/generated/asm/preempt.h
  WRAP    arch/arm/include/generated/asm/rwsem.h
  WRAP    arch/arm/include/generated/asm/seccomp.h
  WRAP    arch/arm/include/generated/asm/segment.h
  WRAP    arch/arm/include/generated/asm/serial.h
  WRAP    arch/arm/include/generated/asm/simd.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  WRAP    arch/arm/include/generated/asm/trace_clock.h
  UPD     include/generated/uapi/linux/version.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.h
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  YACC    scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/bin2c
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/recordmcount
  HOSTCC  scripts/sortextable
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/extract-cert
  SYSNR   arch/arm/include/generated/asm/unistd-nr.h
  GEN     arch/arm/include/generated/asm/mach-types.h
  SYSTBL  arch/arm/include/generated/calls-oabi.S
  SYSTBL  arch/arm/include/generated/calls-eabi.S
  CC      scripts/mod/empty.o
/bin/sh: arm-linux-gnueabihf-gcc: command not found
make[1]: *** [scripts/Makefile.build:276: scripts/mod/empty.o] Error 127
make: *** [Makefile:1095: prepare0] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
[alarm@alarm linux-am33xbot]$ 

Do I really need arm-linux-gnueabihf-gcc on armv7h machine (eg BBB)?
Or maybe I need udjust build command?
Regrds,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.