@@ -2073,6 +2073,38 @@ int ixgbe_enter_lplu_e610(struct ixgbe_hw *hw)
2073
2073
return ixgbe_aci_set_phy_cfg (hw , & phy_cfg );
2074
2074
}
2075
2075
2076
+ /**
2077
+ * ixgbe_init_eeprom_params_e610 - Initialize EEPROM params
2078
+ * @hw: pointer to hardware structure
2079
+ *
2080
+ * Initialize the EEPROM parameters ixgbe_eeprom_info within the ixgbe_hw
2081
+ * struct in order to set up EEPROM access.
2082
+ *
2083
+ * Return: the operation exit code.
2084
+ */
2085
+ int ixgbe_init_eeprom_params_e610 (struct ixgbe_hw * hw )
2086
+ {
2087
+ struct ixgbe_eeprom_info * eeprom = & hw -> eeprom ;
2088
+ u32 gens_stat ;
2089
+ u8 sr_size ;
2090
+
2091
+ if (eeprom -> type != ixgbe_eeprom_uninitialized )
2092
+ return 0 ;
2093
+
2094
+ eeprom -> type = ixgbe_flash ;
2095
+
2096
+ gens_stat = IXGBE_READ_REG (hw , GLNVM_GENS );
2097
+ sr_size = FIELD_GET (GLNVM_GENS_SR_SIZE_M , gens_stat );
2098
+
2099
+ /* Switching to words (sr_size contains power of 2). */
2100
+ eeprom -> word_size = BIT (sr_size ) * IXGBE_SR_WORDS_IN_1KB ;
2101
+
2102
+ hw_dbg (hw , "Eeprom params: type = %d, size = %d\n" , eeprom -> type ,
2103
+ eeprom -> word_size );
2104
+
2105
+ return 0 ;
2106
+ }
2107
+
2076
2108
/**
2077
2109
* ixgbe_aci_get_netlist_node - get a node handle
2078
2110
* @hw: pointer to the hw struct
@@ -2319,6 +2351,36 @@ int ixgbe_read_flat_nvm(struct ixgbe_hw *hw, u32 offset, u32 *length,
2319
2351
return err ;
2320
2352
}
2321
2353
2354
+ /**
2355
+ * ixgbe_read_sr_buf_aci - Read Shadow RAM buffer via ACI
2356
+ * @hw: pointer to the HW structure
2357
+ * @offset: offset of the Shadow RAM words to read (0x000000 - 0x001FFF)
2358
+ * @words: (in) number of words to read; (out) number of words actually read
2359
+ * @data: words read from the Shadow RAM
2360
+ *
2361
+ * Read 16 bit words (data buf) from the Shadow RAM. Acquire/release the NVM
2362
+ * ownership.
2363
+ *
2364
+ * Return: the operation exit code.
2365
+ */
2366
+ int ixgbe_read_sr_buf_aci (struct ixgbe_hw * hw , u16 offset , u16 * words ,
2367
+ u16 * data )
2368
+ {
2369
+ u32 bytes = * words * 2 ;
2370
+ int err ;
2371
+
2372
+ err = ixgbe_read_flat_nvm (hw , offset * 2 , & bytes , (u8 * )data , true);
2373
+ if (err )
2374
+ return err ;
2375
+
2376
+ * words = bytes / 2 ;
2377
+
2378
+ for (int i = 0 ; i < * words ; i ++ )
2379
+ data [i ] = le16_to_cpu (((__le16 * )data )[i ]);
2380
+
2381
+ return 0 ;
2382
+ }
2383
+
2322
2384
/**
2323
2385
* ixgbe_read_ee_aci_e610 - Read EEPROM word using the admin command.
2324
2386
* @hw: pointer to hardware structure
@@ -2352,6 +2414,39 @@ int ixgbe_read_ee_aci_e610(struct ixgbe_hw *hw, u16 offset, u16 *data)
2352
2414
return err ;
2353
2415
}
2354
2416
2417
+ /**
2418
+ * ixgbe_read_ee_aci_buffer_e610 - Read EEPROM words via ACI
2419
+ * @hw: pointer to hardware structure
2420
+ * @offset: offset of words in the EEPROM to read
2421
+ * @words: number of words to read
2422
+ * @data: words to read from the EEPROM
2423
+ *
2424
+ * Read 16 bit words from the EEPROM via the ACI. Initialize the EEPROM params
2425
+ * prior to the read. Acquire/release the NVM ownership.
2426
+ *
2427
+ * Return: the operation exit code.
2428
+ */
2429
+ int ixgbe_read_ee_aci_buffer_e610 (struct ixgbe_hw * hw , u16 offset ,
2430
+ u16 words , u16 * data )
2431
+ {
2432
+ int err ;
2433
+
2434
+ if (hw -> eeprom .type == ixgbe_eeprom_uninitialized ) {
2435
+ err = hw -> eeprom .ops .init_params (hw );
2436
+ if (err )
2437
+ return err ;
2438
+ }
2439
+
2440
+ err = ixgbe_acquire_nvm (hw , IXGBE_RES_READ );
2441
+ if (err )
2442
+ return err ;
2443
+
2444
+ err = ixgbe_read_sr_buf_aci (hw , offset , & words , data );
2445
+ ixgbe_release_nvm (hw );
2446
+
2447
+ return err ;
2448
+ }
2449
+
2355
2450
/**
2356
2451
* ixgbe_validate_eeprom_checksum_e610 - Validate EEPROM checksum
2357
2452
* @hw: pointer to hardware structure
0 commit comments