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