[centec] fix some bugs on centec tsingma bsp and v682 sonic_platform package (#10685)
#### Why I did it Fix some bugs on centec tsingma bsp and v682 sonic_platform package. #### How I did it 1. add module license for centec mars phy driver 2. Fix i2c function ability setting for tsingma soc i2c controller 3. Fix eeprom read error on v682 sonic_platform sfp module #### How to verify it Build SONiC image and verify it on centec E530-48T4X and V682-48Y8C board.
This commit is contained in:
parent
b9a7665662
commit
25bc8c4054
@ -314,3 +314,6 @@ static struct mdio_device_id __maybe_unused mars_tbl[] = {
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(mdio, mars_tbl);
|
||||
|
||||
MODULE_AUTHOR("Centec, Inc.");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
@ -789,6 +789,11 @@ static int ctc_i2c_plat_probe(struct platform_device *pdev)
|
||||
of_property_read_u32(pdev->dev.of_node, "clock-frequency", &clk_freq);
|
||||
|
||||
dev->clk_freq = clk_freq;
|
||||
|
||||
dev->functionality = I2C_FUNC_10BIT_ADDR | CTC_IC_DEFAULT_FUNCTIONALITY;
|
||||
dev->master_cfg = CTC_IC_CON_MASTER | CTC_IC_CON_SLAVE_DISABLE |
|
||||
CTC_IC_CON_RESTART_EN;
|
||||
|
||||
if (dev->clk_freq <= 100000)
|
||||
dev->master_cfg |= CTC_IC_CON_SPEED_STD;
|
||||
else if (dev->clk_freq <= 400000)
|
||||
|
@ -383,7 +383,7 @@ class Sfp(SfpBase):
|
||||
|
||||
try:
|
||||
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
|
||||
fd.read()
|
||||
fd.read(256)
|
||||
except IOError:
|
||||
return False
|
||||
|
||||
|
@ -383,7 +383,7 @@ class Sfp(SfpBase):
|
||||
|
||||
try:
|
||||
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
|
||||
fd.read()
|
||||
fd.read(256)
|
||||
except IOError:
|
||||
return False
|
||||
|
||||
|
Reference in New Issue
Block a user