OSDN Git Service

net: ethernet: ti: am65-cpsw: move ale selection in pdata
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 30 Oct 2020 20:06:58 +0000 (22:06 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Nov 2020 00:41:07 +0000 (16:41 -0800)
In preparation of adding more multi-port K3 CPSW versions move ALE
selection in am65_cpsw_pdata, so it can be selected basing on DT
compatibility property.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/am65-cpsw-nuss.c
drivers/net/ethernet/ti/am65-cpsw-nuss.h

index 501d676..0ee1c7a 100644 (file)
@@ -2005,10 +2005,12 @@ static const struct soc_device_attribute am65_cpsw_socinfo[] = {
 
 static const struct am65_cpsw_pdata am65x_sr1_0 = {
        .quirks = AM65_CPSW_QUIRK_I2027_NO_TX_CSUM,
+       .ale_dev_id = "am65x-cpsw2g",
 };
 
 static const struct am65_cpsw_pdata j721e_pdata = {
        .quirks = 0,
+       .ale_dev_id = "am65x-cpsw2g",
 };
 
 static const struct of_device_id am65_cpsw_nuss_of_mtable[] = {
@@ -2145,7 +2147,7 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev)
        ale_params.ale_ageout = AM65_CPSW_ALE_AGEOUT_DEFAULT;
        ale_params.ale_ports = common->port_num + 1;
        ale_params.ale_regs = common->cpsw_base + AM65_CPSW_NU_ALE_BASE;
-       ale_params.dev_id = "am65x-cpsw2g";
+       ale_params.dev_id = common->pdata.ale_dev_id;
        ale_params.bus_freq = common->bus_freq;
 
        common->ale = cpsw_ale_create(&ale_params);
index 993e1d4..9c2186b 100644 (file)
@@ -77,6 +77,7 @@ struct am65_cpsw_rx_chn {
 
 struct am65_cpsw_pdata {
        u32     quirks;
+       const char      *ale_dev_id;
 };
 
 struct am65_cpsw_common {