view nuc-fw/cfgmagic/post-target @ 107:8b44e806b6e1

loadtools/README: documentation for loadtools should now be complete
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Fri, 13 Sep 2013 16:47:09 +0000
parents 45911ad957fd
children 3b2e941043d8
line wrap: on
line source

# This shell script fragment is sourced after the selected target.
# Here we'll put code that logically goes with the target hw-related
# stuff, but which we wish to avoid duplicating in every target.*
# fragment.

# The per-target fragment must have defined CONFIG_IRAM_SIZE, CONFIG_XRAM_SIZE
# and CONFIG_FWFLASH_SIZE.
if [ -z "$CONFIG_IRAM_SIZE" ]
then
	echo "Error: target.$TARGET failed to define CONFIG_IRAM_SIZE" 1>&2
	exit 1
fi

if [ -z "$CONFIG_XRAM_SIZE" ]
then
	echo "Error: target.$TARGET failed to define CONFIG_XRAM_SIZE" 1>&2
	exit 1
fi

if [ -z "$CONFIG_FWFLASH_SIZE" ]
then
	echo "Error: target.$TARGET failed to define CONFIG_FWFLASH_SIZE" 1>&2
	exit 1
fi

# export them to C and to the m4-based ld script generation logic
export_to_c	CONFIG_IRAM_SIZE
export_to_m4	CONFIG_IRAM_SIZE
export_to_c	CONFIG_XRAM_SIZE
export_to_m4	CONFIG_XRAM_SIZE
export_to_c	CONFIG_FWFLASH_SIZE
export_to_m4	CONFIG_FWFLASH_SIZE

# Because we'll be using a lot of TI's code that is very liberally sprinkled
# with conditionals on their voodoo numbers for CHIPSET etc, we really have
# no choice but to continue using these nasty numbers, at least where
# possible.

if [ -z "$DBB_type" ]
then
	echo "Error: target.$TARGET failed to define DBB_type" 1>&2
	exit 1
fi

case "$DBB_type" in
	751992*)
		# This is the only Calypso variant we currently work with,
		# and we have no authoritative knowledge of the correct
		# CHIPSET number - only a current best guess.
		CHIPSET=10
		# let's hope for the best
		;;
	*)
		echo "Error: unknown DBB_type=$DBB_type" 1>&2
		exit 1
		;;
esac
export_to_c	CHIPSET

if [ -z "$ABB_type" ]
then
	echo "Error: target.$TARGET failed to define ABB_type" 1>&2
	exit 1
fi

case "$ABB_type" in
	Iota*)
		ANALOG=2
		;;
	Syren*)
		ANALOG=3
		;;
	*)
		echo "Error: unknown ABB_type=$ABB_type" 1>&2
		exit 1
		;;
esac
export_to_c	ANALOG

# Ensure that device_class is set - various feature configurations
# will certainly depend on it.
if [ -z "$device_class" ]
then
	echo "Error: target.$TARGET failed to define device_class" 1>&2
	exit 1
fi