# HG changeset patch # User Mychaela Falconia # Date 1446347106 0 # Node ID 042c178ebac51fe93340a1e2c7f6530a13dec5c9 # Parent 6b0b2f6dbb2031103e43da71591857876c5e94d1 gsm-fw/cfgmagic: logic for target-dependent features streamlined a little diff -r 6b0b2f6dbb20 -r 042c178ebac5 gsm-fw/cfgmagic/feature.at-modem --- a/gsm-fw/cfgmagic/feature.at-modem Sun Nov 01 00:07:09 2015 +0000 +++ b/gsm-fw/cfgmagic/feature.at-modem Sun Nov 01 03:05:06 2015 +0000 @@ -1,11 +1,4 @@ -case $TARGET in - gtamodem) - ;; - *) - echo "Error: feature at-modem not supported on this target" 1>&2 - exit 1 - ;; -esac +check_target_feature "$1" CONFIG_FDMODEM=1 export_to_c CONFIG_FDMODEM diff -r 6b0b2f6dbb20 -r 042c178ebac5 gsm-fw/cfgmagic/feature.mokoffs --- a/gsm-fw/cfgmagic/feature.mokoffs Sun Nov 01 00:07:09 2015 +0000 +++ b/gsm-fw/cfgmagic/feature.mokoffs Sun Nov 01 03:05:06 2015 +0000 @@ -9,11 +9,7 @@ # feature mokoffs ro -- use MokoFFS in flash, but disable flash write ops # feature mokoffs copy -- copy MokoFFS into RAM on boot, then R/W in RAM only -if [ $TARGET != gtamodem ] -then - echo "Error: feature mokoffs is applicable only to target gtamodem" 1>&2 - exit 1 -fi +check_target_feature "$1" CONFIG_MOKOFFS=1 export_to_c CONFIG_MOKOFFS diff -r 6b0b2f6dbb20 -r 042c178ebac5 gsm-fw/cfgmagic/feature.pirhack-ffs --- a/gsm-fw/cfgmagic/feature.pirhack-ffs Sun Nov 01 00:07:09 2015 +0000 +++ b/gsm-fw/cfgmagic/feature.pirhack-ffs Sun Nov 01 03:05:06 2015 +0000 @@ -29,12 +29,7 @@ # as the original, but attempting to reuse the original FFS without reformatting # is NOT recommended or supported. -if [ $TARGET != pirelli ] -then - echo \ - "Error: feature pirhack-ffs is applicable only to target pirelli" 1>&2 - exit 1 -fi +check_target_feature "$1" if [ $# != 3 ] then diff -r 6b0b2f6dbb20 -r 042c178ebac5 gsm-fw/cfgmagic/functions --- a/gsm-fw/cfgmagic/functions Sun Nov 01 00:07:09 2015 +0000 +++ b/gsm-fw/cfgmagic/functions Sun Nov 01 03:05:06 2015 +0000 @@ -40,6 +40,35 @@ . "cfgmagic/feature.$1" } +allow_target_feature() { + while [ $# != 0 ] + do + case "$target_feature_list" in + *" $1 "* | *" $1") + ;; + *) + target_feature_list="$target_feature_list $1" + ;; + esac + shift + done +} + +check_target_feature() { + while [ $# != 0 ] + do + case "$target_feature_list" in + *" $1 "* | *" $1" | *" OVERRIDE "* | *" OVERRIDE") + ;; + *) + echo "Error: feature $1 not supported on target $TARGET" 1>&2 + exit 1 + ;; + esac + shift + done +} + export_to_c() { while [ $# != 0 ] do diff -r 6b0b2f6dbb20 -r 042c178ebac5 gsm-fw/cfgmagic/processconf.sh --- a/gsm-fw/cfgmagic/processconf.sh Sun Nov 01 00:07:09 2015 +0000 +++ b/gsm-fw/cfgmagic/processconf.sh Sun Nov 01 03:05:06 2015 +0000 @@ -14,6 +14,7 @@ c_export_list= mk_export_list= m4_export_list= +target_feature_list= # some defaults FFS_IN_RAM=1 diff -r 6b0b2f6dbb20 -r 042c178ebac5 gsm-fw/cfgmagic/target.gtamodem --- a/gsm-fw/cfgmagic/target.gtamodem Sun Nov 01 00:07:09 2015 +0000 +++ b/gsm-fw/cfgmagic/target.gtamodem Sun Nov 01 03:05:06 2015 +0000 @@ -21,3 +21,6 @@ # For the RF PA we have to set TI's voodoo number directly. :-( RF_PA=2 # We know this setting is correct for the RF3166 PA thanks to the Sotovik find. + +allow_target_feature at-modem +allow_target_feature mokoffs diff -r 6b0b2f6dbb20 -r 042c178ebac5 gsm-fw/cfgmagic/target.pirelli --- a/gsm-fw/cfgmagic/target.pirelli Sun Nov 01 00:07:09 2015 +0000 +++ b/gsm-fw/cfgmagic/target.pirelli Sun Nov 01 03:05:06 2015 +0000 @@ -27,3 +27,5 @@ # even have a number for these Skyworks parts. :-( # The best we can do for now is lie and pretend to be Leonardo/Openmoko. RF_PA=2 + +allow_target_feature pirhack-ffs