Skip to content

Commit ee2ae1e

Browse files
atorguedavem330
authored andcommitted
stmmac: add new DT platform entries for GMAC4
This is to support the snps,dwmac-4.00 and snps,dwmac-4.10a and related features on the platform driver. See binding doc for further details. Signed-off-by: Giuseppe Cavallaro <[email protected]> Signed-off-by: Alexandre TORGUE <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 36ff7c1 commit ee2ae1e

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Documentation/devicetree/bindings/net/stmmac.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ Optional properties:
5959
- snps,fb: fixed-burst
6060
- snps,mb: mixed-burst
6161
- snps,rb: rebuild INCRx Burst
62+
- snps,tso: this enables the TSO feature otherwise it will be managed by
63+
MAC HW capability register.
6264
- mdio: with compatible = "snps,dwmac-mdio", create and register mdio bus.
6365

6466
Examples:

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
284284
plat->pmt = 1;
285285
}
286286

287+
if (of_device_is_compatible(np, "snps,dwmac-4.00") ||
288+
of_device_is_compatible(np, "snps,dwmac-4.10a")) {
289+
plat->has_gmac4 = 1;
290+
plat->pmt = 1;
291+
plat->tso_en = of_property_read_bool(np, "snps,tso");
292+
}
293+
287294
if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
288295
of_device_is_compatible(np, "snps,dwmac-3.710")) {
289296
plat->enh_desc = 1;

include/linux/stmmac.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,7 @@ struct plat_stmmacenet_data {
137137
void (*exit)(struct platform_device *pdev, void *priv);
138138
void *bsp_priv;
139139
struct stmmac_axi *axi;
140+
int has_gmac4;
141+
bool tso_en;
140142
};
141143
#endif

0 commit comments

Comments
 (0)