diff mbox series

[1/3,V2] include: fpga: adi-axi-common.h: add common regs & defs header

Message ID 20190521141425.26176-1-alexandru.ardelean@analog.com (mailing list archive)
State Changes Requested
Headers show
Series [1/3,V2] include: fpga: adi-axi-common.h: add common regs & defs header | expand

Commit Message

Alexandru Ardelean May 21, 2019, 2:14 p.m. UTC
The AXI HDL cores provided for Analog Devices reference designs all share
some common base registers (e.g. version register at address 0x00).

To reduce duplication for this, a common header is added to define these
registers as well as bitfields & macros to work with these registers.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 include/linux/fpga/adi-axi-common.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 include/linux/fpga/adi-axi-common.h

Comments

Alexandru Ardelean May 21, 2019, 2:18 p.m. UTC | #1
On Tue, 2019-05-21 at 17:14 +0300, Alexandru Ardelean wrote:
> The AXI HDL cores provided for Analog Devices reference designs all share
> some common base registers (e.g. version register at address 0x00).
> 
> To reduce duplication for this, a common header is added to define these
> registers as well as bitfields & macros to work with these registers.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---

I forgot to add a changelog for this series when writing the patches.

Changelog v1 -> v2:
* add common `include/linux/fpga/adi-axi-common.h` with reg version; more regs will be added
* use macro to check version of HDL core from common header
* add my S-o-B to patch `dmaengine: axi-dmac: Discover length alignment requirement`


>  include/linux/fpga/adi-axi-common.h | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 include/linux/fpga/adi-axi-common.h
> 
> diff --git a/include/linux/fpga/adi-axi-common.h b/include/linux/fpga/adi-axi-common.h
> new file mode 100644
> index 000000000000..7966c89561b1
> --- /dev/null
> +++ b/include/linux/fpga/adi-axi-common.h
> @@ -0,0 +1,19 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Analog Devices AXI common registers & definitions
> + *
> + * Copyright 2019 Analog Devices Inc.
> + *
> + * https://wiki.analog.com/resources/fpga/docs/axi_ip
> + * https://wiki.analog.com/resources/fpga/docs/hdl/regmap
> + */
> +
> +#ifndef ADI_AXI_COMMON_H_
> +#define ADI_AXI_COMMON_H_
> +
> +#define	ADI_AXI_REG_VERSION			0x0000
> +
> +#define ADI_AXI_PCORE_VER(major, minor, patch)	\
> +	(((major) << 16) | ((minor) << 8) | (patch))
> +
> +#endif /* ADI_AXI_COMMON_H_ */
Vinod Koul May 27, 2019, 6:37 a.m. UTC | #2
On 21-05-19, 17:14, Alexandru Ardelean wrote:
> The AXI HDL cores provided for Analog Devices reference designs all share
> some common base registers (e.g. version register at address 0x00).
> 
> To reduce duplication for this, a common header is added to define these
> registers as well as bitfields & macros to work with these registers.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
>  include/linux/fpga/adi-axi-common.h | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 include/linux/fpga/adi-axi-common.h
> 
> diff --git a/include/linux/fpga/adi-axi-common.h b/include/linux/fpga/adi-axi-common.h
> new file mode 100644
> index 000000000000..7966c89561b1
> --- /dev/null
> +++ b/include/linux/fpga/adi-axi-common.h
> @@ -0,0 +1,19 @@
> +// SPDX-License-Identifier: GPL-2.0

For headers this is not the style to be used.
See Documentation/process/license-rules.rst

      C source: // SPDX-License-Identifier: <SPDX License Expression>
      C header: /* SPDX-License-Identifier: <SPDX License Expression> */

> +/*
> + * Analog Devices AXI common registers & definitions
> + *
> + * Copyright 2019 Analog Devices Inc.
> + *
> + * https://wiki.analog.com/resources/fpga/docs/axi_ip
> + * https://wiki.analog.com/resources/fpga/docs/hdl/regmap
> + */
> +
> +#ifndef ADI_AXI_COMMON_H_
> +#define ADI_AXI_COMMON_H_
> +
> +#define	ADI_AXI_REG_VERSION			0x0000
> +
> +#define ADI_AXI_PCORE_VER(major, minor, patch)	\
> +	(((major) << 16) | ((minor) << 8) | (patch))
> +
> +#endif /* ADI_AXI_COMMON_H_ */
> -- 
> 2.17.1
Alexandru Ardelean May 27, 2019, 6:40 a.m. UTC | #3
On Mon, 2019-05-27 at 12:07 +0530, Vinod Koul wrote:
> [External]
> 
> 
> On 21-05-19, 17:14, Alexandru Ardelean wrote:
> > The AXI HDL cores provided for Analog Devices reference designs all share
> > some common base registers (e.g. version register at address 0x00).
> > 
> > To reduce duplication for this, a common header is added to define these
> > registers as well as bitfields & macros to work with these registers.
> > 
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > ---
> >  include/linux/fpga/adi-axi-common.h | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >  create mode 100644 include/linux/fpga/adi-axi-common.h
> > 
> > diff --git a/include/linux/fpga/adi-axi-common.h b/include/linux/fpga/adi-axi-common.h
> > new file mode 100644
> > index 000000000000..7966c89561b1
> > --- /dev/null
> > +++ b/include/linux/fpga/adi-axi-common.h
> > @@ -0,0 +1,19 @@
> > +// SPDX-License-Identifier: GPL-2.0
> 
> For headers this is not the style to be used.
> See Documentation/process/license-rules.rst
> 
>       C source: // SPDX-License-Identifier: <SPDX License Expression>
>       C header: /* SPDX-License-Identifier: <SPDX License Expression> */
> 

Ack.
Will re-spin.

> > +/*
> > + * Analog Devices AXI common registers & definitions
> > + *
> > + * Copyright 2019 Analog Devices Inc.
> > + *
> > + * https://wiki.analog.com/resources/fpga/docs/axi_ip
> > + * https://wiki.analog.com/resources/fpga/docs/hdl/regmap
> > + */
> > +
> > +#ifndef ADI_AXI_COMMON_H_
> > +#define ADI_AXI_COMMON_H_
> > +
> > +#define      ADI_AXI_REG_VERSION                     0x0000
> > +
> > +#define ADI_AXI_PCORE_VER(major, minor, patch)       \
> > +     (((major) << 16) | ((minor) << 8) | (patch))
> > +
> > +#endif /* ADI_AXI_COMMON_H_ */
> > --
> > 2.17.1
> 
> --
> ~Vinod
diff mbox series

Patch

diff --git a/include/linux/fpga/adi-axi-common.h b/include/linux/fpga/adi-axi-common.h
new file mode 100644
index 000000000000..7966c89561b1
--- /dev/null
+++ b/include/linux/fpga/adi-axi-common.h
@@ -0,0 +1,19 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Analog Devices AXI common registers & definitions
+ *
+ * Copyright 2019 Analog Devices Inc.
+ *
+ * https://wiki.analog.com/resources/fpga/docs/axi_ip
+ * https://wiki.analog.com/resources/fpga/docs/hdl/regmap
+ */
+
+#ifndef ADI_AXI_COMMON_H_
+#define ADI_AXI_COMMON_H_
+
+#define	ADI_AXI_REG_VERSION			0x0000
+
+#define ADI_AXI_PCORE_VER(major, minor, patch)	\
+	(((major) << 16) | ((minor) << 8) | (patch))
+
+#endif /* ADI_AXI_COMMON_H_ */