-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfigure
executable file
·93 lines (87 loc) · 2.17 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#! /bin/sh
# Configures build environment for appropriate target architecture
# Definitions
BUILD_DIR="build"
BUILD_TYPE=""
CONFIG_CAL_PLL="true"
CONFIG_CAL_ZQCAL="true"
CONFIG_CAL_SA="true"
CONFIG_DRAM_TRAIN="true"
CONFIG_CAL_PERIODIC="true"
# Common build prep function
init_build_common() {
mkdir -p ${BUILD_DIR}
}
init_lpddr() {
cd ${BUILD_DIR}
cmake .. -DCMAKE_TOOLCHAIN_FILE="../rtos/toolchain/riscv.toolchain" \
-DCONFIG_SRC_ARCH="riscv" \
-DCONFIG_TARGET_ARCH="riscv32" \
-DCONFIG_TARGET_BOARD="wavious-mcu" \
-DCONFIG_CALIBRATE_PLL=${CONFIG_CAL_PLL} \
-DCONFIG_CALIBRATE_ZQCAL=${CONFIG_CAL_ZQCAL} \
-DCONFIG_CALIBRATE_SA=${CONFIG_CAL_SA} \
-DCONFIG_DRAM_TRAIN=${CONFIG_DRAM_TRAIN} \
-DCONFIG_CAL_PERIODIC=${CONFIG_CAL_PERIODIC} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
cd ..
}
print_help() {
echo "Usage: configure [OPTIONS]\n"
echo "This program configures CMAKE for wavious lpddr project\n"
echo "Options:"
echo "-t, --build_type <Debug | Release>"
echo "--no-pll-cal (disables PLL calibration)"
echo "--no-zqcal-cal (disables ZQCAL calibration)"
echo "--no-sa-cal (disables SA calibration)"
echo "--dram-train (enables DRAM training at boot)"
echo "--periodic-cal (enables periodic calibration)"
}
PARAMS=""
while [ $# -gt 0 ]; do
case "$1" in
-t | --build_type)
BUILD_TYPE=$2
shift 2
;;
--no-pll-cal)
CONFIG_CAL_PLL="false"
shift 1
;;
--no-zqcal-cal)
CONFIG_CAL_ZQCAL="false"
shift 1
;;
--no-sa-cal)
CONFIG_CAL_SA="false"
shift 1
;;
--dram-train)
CONFIG_DRAM_TRAIN="true"
;;
--periodic-cal)
CONFIG_CAL_PERIODIC="true"
shift 1
;;
-h | --help)
print_help
exit
;;
--) # end argument parsing
shift
break
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done
# set positional arguments in their proper place
eval set -- "$PARAMS"
init_build_common
init_lpddr