[1/5] common/cnxk: define platform configuration

Message ID 20240902062940.182273-2-hkalra@marvell.com (mailing list archive)
State Accepted
Delegated to: Jerin Jacob
Headers
Series Marvell cn20K SOC base code |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Harman Kalra Sept. 2, 2024, 6:29 a.m. UTC
Defining compile time platform configuration to discrimate
among different SOCs.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/meson.build | 13 +++++++++++++
 1 file changed, 13 insertions(+)
  

Patch

diff --git a/drivers/common/cnxk/meson.build b/drivers/common/cnxk/meson.build
index e0e4600989..dc2ddf1f20 100644
--- a/drivers/common/cnxk/meson.build
+++ b/drivers/common/cnxk/meson.build
@@ -91,6 +91,19 @@  sources += files('cnxk_telemetry_bphy.c',
                  'cnxk_telemetry_sso.c',
 )
 
+if meson.is_cross_build()
+    soc_type = meson.get_cross_property('platform', '')
+else
+    soc_type = platform
+endif
+if soc_type == 'cn9k'
+    dpdk_conf.set('ROC_PLATFORM_CN9K', 1)
+elif soc_type == 'cn10k'
+    dpdk_conf.set('ROC_PLATFORM_CN10K', 1)
+elif soc_type == 'cn20k'
+    dpdk_conf.set('ROC_PLATFORM_CN20K', 1)
+endif
+
 deps += ['bus_pci', 'net', 'telemetry']
 
 require_iova_in_mbuf = false