Skip to contentSkip to conversation

remoteproc: xlnx: remove binding header dependency

PATCH In review Tanmay Shah 3 participants 4 messages May 8 – May 26 Remote processor (remoteproc)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: xlnx: remove binding header dependency

Bindings can be deprecated and driver should not include bindings headers directly. Instead define needed constants in the driver.

---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +5 -1
index 45a62cb98072..f5b736fa3cb4 100644
@@ -4,7 +4,6 @@
  *
  */
 
-#include <dt-bindings/power/xlnx-zynqmp-power.h>
 #include <linux/dma-mapping.h>
 #include <linux/firmware/xlnx-zynqmp.h>
 #include <linux/kernel.h>
@@ -19,6 +18,11 @@
 
 #include "remoteproc_internal.h"
 
+#define		PD_R5_0_ATCM	15
+#define		PD_R5_0_BTCM	16
+#define		PD_R5_1_ATCM	17
+#define		PD_R5_1_BTCM	18
+
 /* IPI buffer MAX length */
 #define IPI_BUF_LEN_MAX	32U
 

base-commit: 54dacf6efe7196c1cd8ae4b5c691579d0510a8bd

Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 3 lines · Tanmay Shah

Bindings can be deprecated and driver should not include bindings headers directly. Instead define needed constants in the driver.

Is there an official directive about not including bindings in drivers? To me it seems advantageous to have a focal point for the definition of constants, guaranteeing eveyone uses the same values.

Quoted 34 lines
---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +5 -1
index 45a62cb98072..f5b736fa3cb4 100644
@@ -4,7 +4,6 @@
  *
  */
 
-#include <dt-bindings/power/xlnx-zynqmp-power.h>
 #include <linux/dma-mapping.h>
 #include <linux/firmware/xlnx-zynqmp.h>
 #include <linux/kernel.h>
@@ -19,6 +18,11 @@
 
 #include "remoteproc_internal.h"
 
+#define		PD_R5_0_ATCM	15
+#define		PD_R5_0_BTCM	16
+#define		PD_R5_1_ATCM	17
+#define		PD_R5_1_BTCM	18
+
 /* IPI buffer MAX length */
 #define IPI_BUF_LEN_MAX	32U
 

base-commit: 54dacf6efe7196c1cd8ae4b5c691579d0510a8bd

Signature · 1 line
2.34.1
#2 lore raw
Quoted 9 lines · Mathieu Poirier
Quoted 3 lines · Tanmay Shah

Bindings can be deprecated and driver should not include bindings headers directly. Instead define needed constants in the driver.

Is there an official directive about not including bindings in drivers? To me it seems advantageous to have a focal point for the definition of constants, guaranteeing eveyone uses the same values.

This is what I found from here:
https://docs.kernel.org/process/maintainer-soc.html

2.3.2. Driver Branch Dependencies

"Avoid defining custom macros in include/dt-bindings/ for hardware constants that can be derived from a datasheet -- binding macros in header files should only be used as a last resort if there is no natural way to define a binding"

Also, bindings can be deprecated, so if the current binding gets deprecated, the header file can be removed from the include/dt-bindings.

Quoted 34 lines
Quoted 34 lines
---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +5 -1
index 45a62cb98072..f5b736fa3cb4 100644
@@ -4,7 +4,6 @@
  *
  */
 
-#include <dt-bindings/power/xlnx-zynqmp-power.h>
 #include <linux/dma-mapping.h>
 #include <linux/firmware/xlnx-zynqmp.h>
 #include <linux/kernel.h>
@@ -19,6 +18,11 @@
 
 #include "remoteproc_internal.h"
 
+#define		PD_R5_0_ATCM	15
+#define		PD_R5_0_BTCM	16
+#define		PD_R5_1_ATCM	17
+#define		PD_R5_1_BTCM	18
+
 /* IPI buffer MAX length */
 #define IPI_BUF_LEN_MAX	32U
 

base-commit: 54dacf6efe7196c1cd8ae4b5c691579d0510a8bd

Signature · 1 line
2.34.1
maintainer
#3 lore raw
Quoted 19 lines · Tanmay
Quoted 9 lines · Mathieu Poirier
Quoted 3 lines · Tanmay Shah

Bindings can be deprecated and driver should not include bindings headers directly. Instead define needed constants in the driver.

Is there an official directive about not including bindings in drivers? To me it seems advantageous to have a focal point for the definition of constants, guaranteeing eveyone uses the same values.

This is what I found from here:
https://docs.kernel.org/process/maintainer-soc.html

2.3.2. Driver Branch Dependencies

Quoted 8 lines

"Avoid defining custom macros in include/dt-bindings/ for hardware constants that can be derived from a datasheet -- binding macros in header files should only be used as a last resort if there is no natural way to define a binding"

Also, bindings can be deprecated, so if the current binding gets deprecated, the header file can be removed from the include/dt-bindings.

Fair enough. I'll apply your patch tomorrow.

Quoted 35 lines
Quoted 34 lines
Quoted 34 lines
---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +5 -1
index 45a62cb98072..f5b736fa3cb4 100644
@@ -4,7 +4,6 @@
  *
  */
 
-#include <dt-bindings/power/xlnx-zynqmp-power.h>
 #include <linux/dma-mapping.h>
 #include <linux/firmware/xlnx-zynqmp.h>
 #include <linux/kernel.h>
@@ -19,6 +18,11 @@
 
 #include "remoteproc_internal.h"
 
+#define             PD_R5_0_ATCM    15
+#define             PD_R5_0_BTCM    16
+#define             PD_R5_1_ATCM    17
+#define             PD_R5_1_BTCM    18
+
 /* IPI buffer MAX length */
 #define IPI_BUF_LEN_MAX     32U
 

base-commit: 54dacf6efe7196c1cd8ae4b5c691579d0510a8bd --
2.34.1