changeset 38:24eb59e61b44

implemented feature fcfam-ffs for fcdev3b target
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 03 May 2017 03:38:22 +0000
parents 5487db285025
children f385e4d87bad
files cfgmagic/feature.fcfam-ffs cfgmagic/target.fcdev3b
diffstat 2 files changed, 52 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cfgmagic/feature.fcfam-ffs	Wed May 03 03:38:22 2017 +0000
@@ -0,0 +1,51 @@
+# This feature is specific to FreeCalypso family targets, i.e., hardware
+# designed and built within the FreeCalypso family of projects rather than
+# pre-existing Calypso devices.  FC family devices starting with FCDEV3B
+# use the 16 MiB flash chip originally discovered on the Pirelli DP-L10,
+# organized as two chip select banks of 8 MiB each; the first flash bank
+# is for the firmware, and the second flash bank is ideally suited for
+# file system storage.
+#
+# Because we don't really need an 8 MiB FFS, instead of allocating the
+# entirety of the second flash bank for one gigantic FFS, our current
+# convention allocates room for up to 3 potential FFS instances, each
+# 2 MiB in size.  Thus we have FFS location 0, FFS location 1 and
+# FFS location 2.  Our Magnetite firmware always uses FFS location 0;
+# when running Citrine firmware, it is up to you whether you wish your
+# Citrine fw to use the same FFS as Magnetite or its own separate FFS
+# instance.
+
+check_target_feature "$1"
+
+if [ $# != 2 ]
+then
+	echo "feature fcfam-ffs: extra argument required" 1>&2
+	exit 1
+fi
+
+FFS_IN_RAM=0
+CONFIG_AFTERMARKET_FFS=1
+
+case "$2" in
+	0)
+		CONFIG_AFTERMARKET_FFS_START=0
+		;;
+	1)
+		CONFIG_AFTERMARKET_FFS_START=8
+		;;
+	2)
+		CONFIG_AFTERMARKET_FFS_START=16
+		;;
+	*)
+		echo "feature mokoffs: argument must be rw, ro or copy" 1>&2
+		exit 1
+		;;
+esac
+
+CONFIG_AFTERMARKET_FFS_NBLOCKS=8
+CONFIG_FLASH_WRITE=1
+
+export_to_c	CONFIG_AFTERMARKET_FFS
+export_to_c	CONFIG_AFTERMARKET_FFS_START
+export_to_c	CONFIG_AFTERMARKET_FFS_NBLOCKS
+export_to_c	CONFIG_FLASH_WRITE
--- a/cfgmagic/target.fcdev3b	Sat Nov 26 01:03:01 2016 +0000
+++ b/cfgmagic/target.fcdev3b	Wed May 03 03:38:22 2017 +0000
@@ -30,3 +30,4 @@
 
 allow_target_feature	at-modem
 allow_target_feature	aftermarket-ffs
+allow_target_feature	fcfam-ffs