Commit 9efcc52
realtek: pcs: rtl931x: streamline hardware mode setting
The SDK and our code for finally applying the hardware mode are quite
confusing. There are two different "places" where a mode can be set,
in a SerDes register and in a global SerDes mode register. Neither the
SDK nor any of the datasheet/documentation serve any explanation for
that. The functions are just named "fiber_mode_set" and "mii_mode_set"
which is basically as useless as it can be to understand it.
Try to get rid off this confusion by naming the functions
'sds_set_mac_mode' and 'sds_set_ip_mode' to make clear where the mode
is set. While at it, also clarify the naming of 'config_mode' by
renaming it to 'config_hw_mode'.
The naming is based on the following assumption:
> Realtek uses an SerDes IP core design (probably from another vendor)
> in their switch. This supports a variety of modes and must be
> configured properly for each mode. Usually, changing the mode in the
> MAC's registers triggers a proper configuration of the SerDes IP block
> in the background.
> However, for some modes this seems to be incomplete, at least missing
> important parts so it doesn't work on its own in the end. In this
> case, the SerDes IP block needs to be configured manually with the
> missing bits to make it work.
There are several places in the SDK that support this assumption, both
for RTL931X and RTL930X (as they are somewhat similar), e.g. [1].
[1] https://github.com/plappermaul/realtek-doc/blob/f7f85ffc14c6e575ad94f2b427106de533b888fe/sources/rtk-dms1250/src/dal/longan/dal_longan_sds.c#L1746
Signed-off-by: Jonas Jelonek <[email protected]>
Link: openwrt/openwrt#20736
Signed-off-by: Robert Marko <[email protected]>1 parent d5a4387 commit 9efcc52
File tree
1 file changed
+20
-9
lines changed- target/linux/realtek/files-6.12/drivers/net/pcs
1 file changed
+20
-9
lines changedLines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2377 | 2377 | | |
2378 | 2378 | | |
2379 | 2379 | | |
2380 | | - | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
2381 | 2386 | | |
2382 | 2387 | | |
2383 | 2388 | | |
| |||
2417 | 2422 | | |
2418 | 2423 | | |
2419 | 2424 | | |
2420 | | - | |
2421 | | - | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
2422 | 2432 | | |
2423 | 2433 | | |
2424 | 2434 | | |
2425 | 2435 | | |
2426 | 2436 | | |
2427 | | - | |
| 2437 | + | |
2428 | 2438 | | |
2429 | 2439 | | |
2430 | 2440 | | |
| |||
2735 | 2745 | | |
2736 | 2746 | | |
2737 | 2747 | | |
2738 | | - | |
2739 | | - | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
2740 | 2751 | | |
2741 | 2752 | | |
2742 | 2753 | | |
| |||
2912 | 2923 | | |
2913 | 2924 | | |
2914 | 2925 | | |
2915 | | - | |
| 2926 | + | |
2916 | 2927 | | |
2917 | 2928 | | |
2918 | 2929 | | |
| |||
2945 | 2956 | | |
2946 | 2957 | | |
2947 | 2958 | | |
2948 | | - | |
| 2959 | + | |
2949 | 2960 | | |
2950 | | - | |
| 2961 | + | |
2951 | 2962 | | |
2952 | 2963 | | |
2953 | 2964 | | |
| |||
0 commit comments