phosphor: image_types_phosphor: flash overrides

Add an override based on FLASH_SIZE, for use with the hardcoded offsets
that exist when building raw flash images.

This lets us have different flash layouts for different size flash
modules that can be shared between machines.

The existing 32MiB layouts are unchanged:
  partition: size: offset

  u-boot: 384 KiB (0 KiB)
  u-boot-env: 128 KiB (384 KiB)
  kernel/FIT: 4352 KiB (512 KiB)
  rootfs: 23808 KiB (4864 KiB)
  rwfs: 4MiB (28672 KiB)

The new layout is as follows:
  partition: size: offset

  u-boot: 896 KiB (0 KiB)
  u-boot-env: 128 KiB (896 KiB)
  kernel/FIT: 9 MiB (1 MiB)
  rootfs: 86 MiB (10 MiB)
  rwfs: 32MiB (96 MiB)

(From meta-phosphor rev: 9e84ca2ad4aa7f864bb53faa6f21ae580d64d07d)

Change-Id: I4edf302d4e738b31906cd03459ad6f2f44c3c749
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass
index ae90c0e..f7742c8 100644
--- a/meta-phosphor/classes/image_types_phosphor.bbclass
+++ b/meta-phosphor/classes/image_types_phosphor.bbclass
@@ -27,6 +27,7 @@
 IMAGE_TYPES_MASKED += "mtd-static mtd-static-alltar mtd-static-tar mtd-ubi mtd-ubi-tar"
 
 # Flash characteristics in KB unless otherwise noted
+DISTROOVERRIDES .= ":flash-${FLASH_SIZE}"
 FLASH_SIZE ?= "32768"
 FLASH_PEB_SIZE ?= "64"
 # Flash page and overhead sizes in bytes
@@ -36,13 +37,18 @@
 # Fixed partition offsets
 FLASH_UBOOT_OFFSET ?= "0"
 FLASH_KERNEL_OFFSET ?= "512"
+FLASH_KERNEL_OFFSET_flash-131072 ?= "1024"
 FLASH_UBI_OFFSET ?= "${FLASH_KERNEL_OFFSET}"
 FLASH_ROFS_OFFSET ?= "4864"
+FLASH_ROFS_OFFSET_flash-131072 ?= "10240"
 FLASH_RWFS_OFFSET ?= "28672"
+FLASH_RWFS_OFFSET_flash-131072 ?= "98304"
 
 # UBI volume sizes in KB unless otherwise noted.
 FLASH_UBI_RWFS_SIZE ?= "6144"
+FLASH_UBI_RWFS_SIZE_flash-131072 ?= "32768"
 FLASH_UBI_RWFS_TXT_SIZE ?= "6MiB"
+FLASH_UBI_RWFS_TXT_SIZE_flash-131072 ?= "32MiB"
 
 SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv"
 INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}"