use *_PARTITION_SIZE instead of *_MAX_SIZE

Make BoardConfig.mk store the size of the partition rather than the
maximum size of the image that can be flashed there, because the
function used to do the conversion isn't available when BoardConfig.mk
is read any more.
diff --git a/core/definitions.mk b/core/definitions.mk
index 39f706a..0230b9d 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1589,6 +1589,18 @@
  )
 endef
 
+# Like assert-max-file-size, but the second argument is a partition
+# size, which we'll convert to a max image size before checking it
+# against the files.
+#
+# $(1): The file(s) to check (often $@)
+# $(2): The partition size.
+define assert-max-image-size
+$(if $(2), \
+  $(call assert-max-file-size,$(1),$(call image-size-from-data-size,$(2))), \
+  true)
+endef
+
 
 ###########################################################
 ## Define device-specific radio files