[util / sw] Flash template updates

- All the size parameters are now exposed through flash_ctrl.hjson
- Convert flash_ctrl to take those values instead of defining them
- This allows size_reduce to only change the hjson and nothing else

Signed-off-by: Timothy Chen <timothytim@google.com>
diff --git a/sw/device/lib/flash_ctrl.h b/sw/device/lib/flash_ctrl.h
index ff5d5cf..eab6bd1 100644
--- a/sw/device/lib/flash_ctrl.h
+++ b/sw/device/lib/flash_ctrl.h
@@ -10,11 +10,6 @@
 
 // Flash memory base defines, _SZ are presented in bytes
 #define FLASH_MEM_BASE_ADDR 0x20000000
-#define FLASH_WORDS_PER_PAGE 128
-#define FLASH_WORD_SZ 8
-#define FLASH_PAGE_SZ (FLASH_WORDS_PER_PAGE * FLASH_WORD_SZ)
-#define FLASH_PAGES_PER_BANK 256
-#define FLASH_BANK_SZ (FLASH_PAGES_PER_BANK * FLASH_PAGE_SZ)
 
 /**
  * Flash bank IDs
@@ -117,6 +112,24 @@
  */
 void flash_cfg_region(const mp_region_t *region_cfg);
 
+/** Get number of flash banks */
+uint32_t flash_get_banks();
+
+/** Get number of pages per bank */
+uint32_t flash_get_pages_per_bank();
+
+/** Get number of words per page */
+uint32_t flash_get_words_per_page();
+
+/** Get size of each bank in bytes */
+uint32_t flash_get_bank_size();
+
+/** Get size of each page in bytes */
+uint32_t flash_get_page_size();
+
+/** Get size of each flash word in bytes */
+uint32_t flash_get_word_size();
+
 /** Write value to flash scratch register */
 void flash_write_scratch_reg(uint32_t value);