blob: 198ab8d1f344d8411333bfa91696eba44362e731 [file] [log] [blame]
Dylan Reid2470f8c2018-04-25 09:48:39 -07001#!/bin/bash
2
Pan Xiuli792bd412018-06-10 15:32:25 +08003SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl)
4if [ "$#" -eq 0 ]
5then
6 PLATFORMS=${SUPPORTED_PLATFORMS[@]}
7else
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
31fi
32
33
34# now build the firmware (depends on rimage)
35rm -fr src/arch/xtensa/*.ri
36
Liam Girdwood58a99d62017-06-06 10:45:07 +010037# fail on any errors
38set -e
39
40# run autogen.sh
41./autogen.sh
42
Liam Girdwood8855ce52016-10-18 17:18:16 +010043pwd=`pwd`
44
Pan Xiuli792bd412018-06-10 15:32:25 +080045
Pierre-Louis Bossartb9880a52018-04-03 12:57:53 -050046# make sure rimage is built and aligned with code
Pan Xiuli792bd412018-06-10 15:32:25 +080047if [[ "x$BUILD_LOCAL" == "x" ]]
Ranjani Sridharanb5ca5c42018-02-26 09:17:32 -080048then
Pan Xiuli792bd412018-06-10 15:32:25 +080049 ./configure --enable-rimage
50 make
51 sudo make install
Ranjani Sridharanb5ca5c42018-02-26 09:17:32 -080052else
Pan Xiuli792bd412018-06-10 15:32:25 +080053 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 Sridharanb5ca5c42018-02-26 09:17:32 -080059fi
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010060
Pan Xiuli792bd412018-06-10 15:32:25 +080061# build platform
62for j in ${PLATFORMS[@]}
Ranjani Sridharanb5ca5c42018-02-26 09:17:32 -080063do
Pan Xiuli792bd412018-06-10 15:32:25 +080064 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 Sridharanb5ca5c42018-02-26 09:17:32 -080099done
Liam Girdwoodf198ad92018-01-21 23:48:35 +0000100
Liam Girdwood8855ce52016-10-18 17:18:16 +0100101# list all the images
102ls -l src/arch/xtensa/*.ri