Dylan Reid | 2470f8c | 2018-04-25 09:48:39 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
Liam Girdwood | 58a99d6 | 2017-06-06 10:45:07 +0100 | [diff] [blame] | 3 | # fail on any errors |
| 4 | set -e |
| 5 | |
| 6 | # run autogen.sh |
| 7 | ./autogen.sh |
| 8 | |
Liam Girdwood | 8855ce5 | 2016-10-18 17:18:16 +0100 | [diff] [blame] | 9 | pwd=`pwd` |
| 10 | |
Pierre-Louis Bossart | b9880a5 | 2018-04-03 12:57:53 -0500 | [diff] [blame] | 11 | # make sure rimage is built and aligned with code |
| 12 | ./configure --enable-rimage |
| 13 | make |
| 14 | sudo make install |
| 15 | |
| 16 | # now build the firmware (depends on rimage) |
Liam Girdwood | 8855ce5 | 2016-10-18 17:18:16 +0100 | [diff] [blame] | 17 | rm -fr src/arch/xtensa/*.ri |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 18 | |
Ranjani Sridharan | b5ca5c4 | 2018-02-26 09:17:32 -0800 | [diff] [blame] | 19 | SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 20 | |
Ranjani Sridharan | b5ca5c4 | 2018-02-26 09:17:32 -0800 | [diff] [blame] | 21 | # build all images for chosen targets |
| 22 | if [ "$#" -eq 0 ] |
| 23 | then |
| 24 | PLATFORMS=${SUPPORTED_PLATFORMS[@]} |
| 25 | else |
| 26 | PLATFORMS=$@ |
| 27 | fi |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 28 | |
Ranjani Sridharan | b5ca5c4 | 2018-02-26 09:17:32 -0800 | [diff] [blame] | 29 | for i in ${PLATFORMS[@]} |
| 30 | do |
| 31 | for j in ${SUPPORTED_PLATFORMS[@]} |
| 32 | do |
| 33 | if [ $j == $i ] |
| 34 | then |
| 35 | if [ $j == "byt" ] |
| 36 | then |
| 37 | PLATFORM="baytrail" |
| 38 | ROOT="xtensa-byt-elf" |
| 39 | fi |
| 40 | if [ $j == "cht" ] |
| 41 | then |
| 42 | PLATFORM="cherrytrail" |
| 43 | ROOT="xtensa-byt-elf" |
| 44 | fi |
| 45 | if [ $j == "bdw" ] |
| 46 | then |
| 47 | PLATFORM="broadwell" |
| 48 | ROOT="xtensa-hsw-elf" |
| 49 | fi |
| 50 | if [ $j == "hsw" ] |
| 51 | then |
| 52 | PLATFORM="haswell" |
| 53 | ROOT="xtensa-hsw-elf" |
| 54 | fi |
| 55 | if [ $j == "apl" ] |
| 56 | then |
| 57 | PLATFORM="apollolake" |
| 58 | ROOT="xtensa-bxt-elf" |
| 59 | fi |
| 60 | if [ $j == "cnl" ] |
| 61 | then |
| 62 | PLATFORM="cannonlake" |
| 63 | ROOT="xtensa-cnl-elf" |
| 64 | fi |
Pierre-Louis Bossart | f7471ab | 2018-04-03 08:57:16 -0500 | [diff] [blame] | 65 | PATH=$pwd/../xtensa-root/$ROOT/bin:$PATH |
Ranjani Sridharan | b5ca5c4 | 2018-02-26 09:17:32 -0800 | [diff] [blame] | 66 | ./configure --with-arch=xtensa --with-platform=$PLATFORM --with-root-dir=$pwd/../xtensa-root/$ROOT --host=$ROOT |
| 67 | make clean |
| 68 | make |
| 69 | make bin |
| 70 | fi |
| 71 | done |
| 72 | done |
Liam Girdwood | f198ad9 | 2018-01-21 23:48:35 +0000 | [diff] [blame] | 73 | |
Liam Girdwood | 8855ce5 | 2016-10-18 17:18:16 +0100 | [diff] [blame] | 74 | # list all the images |
| 75 | ls -l src/arch/xtensa/*.ri |