1 /* 2 * File : fal_cfg.h 3 * This file is part of FAL (Flash Abstraction Layer) package 4 * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License along 17 * with this program; if not, write to the Free Software Foundation, Inc., 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Change Logs: 21 * Date Author Notes 22 * 2018-05-17 armink the first version 23 */ 24 25 #ifndef _FAL_CFG_H_ 26 #define _FAL_CFG_H_ 27 28 #ifdef RT_USING_FAL 29 30 #include <rtconfig.h> 31 #include <board.h> 32 33 #define FLASH_SIZE_GRANULARITY_128K (16 * 128 * 1024) 34 35 /* ===================== Flash device Configuration ========================= */ 36 extern const struct fal_flash_dev stm32_onchip_flash_128k; 37 extern struct fal_flash_dev nor_flash0; 38 extern struct fal_flash_dev nor_flash1; 39 40 /* flash device table */ 41 #define FAL_FLASH_DEV_TABLE \ 42 { \ 43 &stm32_onchip_flash_128k, \ 44 &nor_flash0, \ 45 &nor_flash1, \ 46 } 47 /* ====================== Partition Configuration ========================== */ 48 #ifdef FAL_PART_HAS_TABLE_CFG 49 /* partition table */ 50 #define FAL_PART_TABLE \ 51 { \ 52 {FAL_PART_MAGIC_WORD, "bootloader", "onchip_flash_128k", 0, 128*1024, 0}, \ 53 {FAL_PART_MAGIC_WORD, "filesystem", FAL_USING_NOR_FLASH_DEV_NAME, 0, 8*1024*1024, 0}, \ 54 {FAL_PART_MAGIC_WORD, "fs_qspi", "W25Q64_q", 0, 8*1024*1024, 0}, \ 55 } 56 #endif /* FAL_PART_HAS_TABLE_CFG */ 57 58 #endif /* RT_USING_FAL */ 59 60 #endif /* _FAL_CFG_H_ */ 61