Skip to content

Commit

Permalink
[Edgecore][device][platform] Enhance fpga driver about eeprom init sy…
Browse files Browse the repository at this point in the history
…sfs size create.

Detail:
  When 400G xcvr plugin, fpga need to get support-pagable info from xcvr:
  If get info failed, do not create 256 bytes. Because this will let xcvr cannot get page1~page0xff's data.
  Enhance method is create 32,896 bytes( (1+256)*128 ) when get info failed.

Signed-off-by: michael_shih <michael_shih@edge-core.com>
  • Loading branch information
ec-michael-shih committed Apr 11, 2023
1 parent 8955274 commit 2368576
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2079,8 +2079,17 @@ static int check_qsfp_eeprom_pageable(struct bin_attribute *eeprom)

pdata = eeprom->private;

if( fpga_i2c_ready_to_read(eeprom, EEPROM_LOWER_PAGE, pdata->i2c_slave_addr) != 1) {
return ret;
ret = fpga_i2c_ready_to_read(eeprom, EEPROM_LOWER_PAGE, pdata->i2c_slave_addr);

if(ret != 1) {
/* If user space code create port_eeprom sysfs when 400G insert.
* FPGA FW can't handle data quickly. Status code (ret) is 2 (busy).
* We let default case to support pageable.
* PS:This fix if 400G try read bigger than 256 bytes data. But sysfs only is 256 bytes
*/
pdata->pageable = 1; /*This flag need to set 1, otherwise page-0 data can not get*/

return pdata->pageable;
}

read_status = ioread32(pdata->data_base_addr + (pdata->i2c_rtc_read_data));
Expand Down

0 comments on commit 2368576

Please sign in to comment.