view scripts/config-headers-new.sh @ 629:3231dd9b38c1

armio.c: make GPIOs 8 & 13 outputs driving 1 on all "classic" targets Calypso GPIOs 8 & 13 are pinmuxed with MCUEN1 & MCUEN2, respectively, and on powerup these pins are MCUEN, i.e., outputs driving 1. TI's code for C-Sample and earlier turns them into GPIOs configured as outputs also driving 1 - so far, so good - but TI's code for BOARD 41 (which covers D-Sample, Leonardo and all real world Calypso devices derived from the latter) switches them from MCUEN to GPIOs, but then leaves them as inputs. Given that the hardware powerup state of these two pins is outputs driving 1, every Calypso board design MUST be compatible with such driving; typically these GPIO signals will be either unused and unconnected or connected as outputs driving some peripheral. Turning these pins into GPIO inputs will result in floating inputs on every reasonably-wired board, thus I am convinced that this configuration is nothing but a bug on the part of whoever wrote this code at TI. This floating input bug had already been fixed earlier for GTA modem and FCDEV3B targets; the present change makes the fix unconditional for all "classic" targets. The newly affected targets are D-Sample, Leonardo, Tango and GTM900.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 02 Jan 2020 05:38:26 +0000
parents 92dbfa906f66
children 8cf3029429f3
line wrap: on
line source

#!/bin/sh

if [ -z "$TARGET" ]
then
	echo "Error: TARGET= must be passed via environment" 1>&2
	exit 1
fi

if [ -z "$BUILD_DIR" ]
then
	echo "Error: BUILD_DIR= must be passed via environment" 1>&2
	exit 1
fi

# The following vars will already be set when this script is invoked
# from configure.sh in a production build, but the following defaulting logic
# helps with manual invokation during development.

if [ -z "$CHIPSET" ]
then
	CHIPSET=10
fi
export CHIPSET

if [ -z "$DSP" ]
then
	DSP=36
fi
export DSP

if [ -z "$RF" ]
then
	RF=12
fi
export RF

if [ -z "$AMR" ]
then
	AMR=1
fi
export AMR

if [ -z "$L1_DYN_DSP_DWNLD" ]
then
	L1_DYN_DSP_DWNLD=1
fi
export L1_DYN_DSP_DWNLD

if [ -z "$L1_VOICE_MEMO_AMR" ]
then
	L1_VOICE_MEMO_AMR=1
fi
export L1_VOICE_MEMO_AMR

if [ -z "$MELODY_E2" ]
then
	MELODY_E2=1
fi
export MELODY_E2

if [ -z "$SPEECH_RECO" ]
then
	SPEECH_RECO=1
fi
export SPEECH_RECO

if [ -z "$GPRS" ]
then
	GPRS=1
fi
export GPRS

if [ -z "$SRVC" ]
then
	SRVC=1
fi
export SRVC

if [ -z "$ATP_STATE" ]
then
	ATP_STATE=0
fi
export ATP_STATE

if [ -z "$FCHG_STATE" ]
then
	FCHG_STATE=1
fi
export FCHG_STATE

if [ -z "$LCC_STATE" ]
then
	LCC_STATE=0
fi
export LCC_STATE

if [ -z "$MKS_STATE" ]
then
	MKS_STATE=0
fi
export MKS_STATE

if [ -z "$PWR_STATE" ]
then
	PWR_STATE=0
fi
export PWR_STATE

if [ -z "$R2D_STATE" ]
then
	R2D_STATE=1
fi
export R2D_STATE

if [ -z "$DSAMPLE_FULL_COLOR" ]
then
	DSAMPLE_FULL_COLOR=1
fi
export DSAMPLE_FULL_COLOR

if [ -z "$TR_BAUD_CONFIG" ]
then
	TR_BAUD_CONFIG=TR_BAUD_115200
fi
export TR_BAUD_CONFIG

# Derived settings only for the generation of *.cfg headers

case "$RF" in
	10)
		RF_FAM=10
		RF_PA=0
		RF_PG=0
		;;
	12)
		RF_FAM=12
		RF_PA=2
		RF_PG=2
		;;
	*)
		echo "Error: RF=$RF setting not understood" 1>&2
		exit 1
esac
export RF_FAM RF_PA RF_PG

case "$GPRS" in
	0)
		L1_GPRS=0
		PMODE=1
		;;
	1)
		L1_GPRS=1
		PMODE=2
		;;
	*)
		echo "Error: GPRS=$GPRS setting not understood" 1>&2
		exit 1
esac
export L1_GPRS PMODE

if [ "$SRVC" != 0 ]
then
	IDS=1
else
	IDS=0
fi
export IDS

# do it!

set -e

rm -rf $BUILD_DIR/config
mkdir $BUILD_DIR/config
helpers/cfg-hdr-gen scripts/cfg-template $BUILD_DIR/config
scripts/make-rv-swe-hdr.sh > $BUILD_DIR/config/rv_swe.h
cp targets/$TARGET.h $BUILD_DIR/config/fc-target.h