diff options
author | Kinsey Moore <kinsey.moore@oarcorp.com> | 2023-05-24 14:53:58 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2023-06-08 09:48:44 -0500 |
commit | 09fd5dd3539d11529016a31495b44a9cb82413e3 (patch) | |
tree | 5274947a7f9962d365dbb704e9eeef5ac9663a03 /bsps/aarch64 | |
parent | bsps/xqspipsu: Calculate erase sectors correctly (diff) | |
download | rtems-09fd5dd3539d11529016a31495b44a9cb82413e3.tar.bz2 |
bsps/xqspipsu: Use device information from the FCT
Instead of statically defining the device parameters, use the device
information available via the NOR device layer's Flash Configuration
Table.
Diffstat (limited to 'bsps/aarch64')
-rw-r--r-- | bsps/aarch64/xilinx-zynqmp/jffs2_xqspipsu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bsps/aarch64/xilinx-zynqmp/jffs2_xqspipsu.c b/bsps/aarch64/xilinx-zynqmp/jffs2_xqspipsu.c index f647c19ec1..70d954550d 100644 --- a/bsps/aarch64/xilinx-zynqmp/jffs2_xqspipsu.c +++ b/bsps/aarch64/xilinx-zynqmp/jffs2_xqspipsu.c @@ -38,9 +38,6 @@ typedef struct { XQspiPsu *qspipsu; } flash_control; -/* From the N25Q512A datasheet */ -#define BLOCK_SIZE (64UL * 1024UL) -#define FLASH_SIZE (1024UL * BLOCK_SIZE) #define FLASH_DEVICE_ID 0xbb20 /* Type: 0xbb, Capacity: 0x20 */ static flash_control *get_flash_control( rtems_jffs2_flash_control *super ) @@ -117,7 +114,7 @@ static int do_erase( Status = QspiPsu_NOR_Erase( QspiPsuPtr, offset, - BLOCK_SIZE + super->block_size ); if ( Status != XST_SUCCESS ) { return Status; @@ -139,8 +136,6 @@ static void do_destroy( rtems_jffs2_flash_control *super ) static flash_control flash_instance = { .super = { - .block_size = BLOCK_SIZE, - .flash_size = FLASH_SIZE, .read = do_read, .write = do_write, .erase = do_erase, @@ -171,6 +166,11 @@ int xilinx_zynqmp_nor_jffs2_initialize( return rv; } + uint32_t sect_size = QspiPsu_NOR_Get_Sector_Size(qspipsu_ptr); + uint32_t flash_size = QspiPsu_NOR_Get_Device_Size(qspipsu_ptr); + flash_instance.super.flash_size = flash_size; + flash_instance.super.block_size = sect_size; + rv = mount( NULL, mount_dir, |