Changeset 09fd5dd3 in rtems


Ignore:
Timestamp:
05/24/23 19:53:58 (4 months ago)
Author:
Kinsey Moore <kinsey.moore@…>
Branches:
master
Children:
ea27ada
Parents:
7a14c3df
git-author:
Kinsey Moore <kinsey.moore@…> (05/24/23 19:53:58)
git-committer:
Joel Sherrill <joel@…> (06/08/23 14:48:44)
Message:

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.

Location:
bsps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bsps/aarch64/xilinx-zynqmp/jffs2_xqspipsu.c

    r7a14c3df r09fd5dd3  
    3939} flash_control;
    4040
    41 /* From the N25Q512A datasheet */
    42 #define BLOCK_SIZE (64UL * 1024UL)
    43 #define FLASH_SIZE (1024UL * BLOCK_SIZE)
    4441#define FLASH_DEVICE_ID 0xbb20 /* Type: 0xbb, Capacity: 0x20 */
    4542
     
    118115    QspiPsuPtr,
    119116    offset,
    120     BLOCK_SIZE
     117    super->block_size
    121118  );
    122119  if ( Status != XST_SUCCESS ) {
     
    140137static flash_control flash_instance = {
    141138  .super = {
    142     .block_size        = BLOCK_SIZE,
    143     .flash_size        = FLASH_SIZE,
    144139    .read              = do_read,
    145140    .write             = do_write,
     
    172167  }
    173168
     169  uint32_t sect_size = QspiPsu_NOR_Get_Sector_Size(qspipsu_ptr);
     170  uint32_t flash_size = QspiPsu_NOR_Get_Device_Size(qspipsu_ptr);
     171  flash_instance.super.flash_size = flash_size;
     172  flash_instance.super.block_size = sect_size;
     173
    174174  rv = mount(
    175175    NULL,
  • bsps/include/dev/spi/xqspipsu-flash-helper.h

    r7a14c3df r09fd5dd3  
    132132  u8 *ReadBfrPtr
    133133);
     134
     135/*****************************************************************************/
     136/**
     137 *
     138 * This function returns the size of attached flash parts.
     139 *
     140 * @param       QspiPsuPtr is a pointer to the QSPIPSU driver component to use.
     141 *
     142 * @return      The size of attached flash in bytes.
     143 *
     144 ******************************************************************************/
     145u32 QspiPsu_NOR_Get_Device_Size(XQspiPsu *QspiPsuPtr);
     146
     147/*****************************************************************************/
     148/**
     149 *
     150 * This function returns the sector size of attached flash parts.
     151 *
     152 * @param       QspiPsuPtr is a pointer to the QSPIPSU driver component to use.
     153 *
     154 * @return      The sector size of attached flash in bytes.
     155 *
     156 ******************************************************************************/
     157u32 QspiPsu_NOR_Get_Sector_Size(XQspiPsu *QspiPsuPtr);
  • bsps/shared/dev/spi/xqspipsu-flash-helper.c

    r7a14c3df r09fd5dd3  
    22592259  return 0;
    22602260}
     2261
     2262u32 QspiPsu_NOR_Get_Sector_Size(XQspiPsu *QspiPsuPtr)
     2263{
     2264  if(QspiPsuPtr->Config.ConnectionMode == XQSPIPSU_CONNECTION_MODE_PARALLEL) {
     2265    return Flash_Config_Table[FCTIndex].SectSize * 2;
     2266  }
     2267  return Flash_Config_Table[FCTIndex].SectSize;
     2268}
     2269
     2270u32 QspiPsu_NOR_Get_Device_Size(XQspiPsu *QspiPsuPtr)
     2271{
     2272  if(QspiPsuPtr->Config.ConnectionMode == XQSPIPSU_CONNECTION_MODE_STACKED) {
     2273    return Flash_Config_Table[FCTIndex].FlashDeviceSize * 2;
     2274  }
     2275  return Flash_Config_Table[FCTIndex].FlashDeviceSize;
     2276}
Note: See TracChangeset for help on using the changeset viewer.