diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..e78476b6d0b0c517b2449d6f4b920892a9ae3f37
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: CC0-1.0
+#
+# SPDX-FileCopyrightText: 2019 CERN
+
+---
+variables:
+  KOJI_TARGET: 'ohwr7'
+  KOJI_DISTTAG: '.el7.cern'
+  DIST_PATH: distribution
+  BUILD_PATH: distribution/rpmbuild
+  SRPM_PATH: distribution/rpmbuild/SRPMS/dkms-${CI_PROJECT_NAME}*src.rpm
+
+
+stages:
+  - static-analysis
+  - build
+  - srpm
+  - kscratch
+  - kbuild
+
+reuse:
+  stage: static-analysis
+  image: fsfe/reuse:latest
+  script:
+    - reuse lint
+  allow_failure: true
+
+build:
+  stage: build
+  script:
+    - yum install -y kernel-devel git
+    - export LINUX=/usr/src/kernels/*/
+    - make -C software
+
+build-dkms:
+  stage: build
+  script:
+    - yum install -y kernel-devel lua git dkms
+    - export LINUX=/usr/src/kernels/*/
+    - export PREFIX=$(mktemp -d)
+    - make -C software/ -f dkms.mk dkms_install
+    - make -C ${PREFIX}/usr/src/${CI_PROJECT_NAME}*/
+
+build_srpm:
+  stage: srpm
+  script:
+    - yum-builddep -y ${DIST_PATH}/*.spec
+    - export LINUX=/usr/src/kernels/*/
+    - make -C distribution rpmbuild-source
+  artifacts:
+    paths:
+      - ${SRPM_PATH}
+    expire_in: 1 day
+
+.koji_deps_template: &koji_deps
+  before_script:
+    - yum install -y koji krb5-workstation rpm-build
+    - echo ${OHWR_PASSWORD} | kinit ${OHWR_USER}
+
+kscratch:
+  <<: *koji_deps
+  stage: kscratch
+  script:
+    - koji --config=.koji build --wait --scratch ${KOJI_TARGET} ${SRPM_PATH}
+
+kbuild-ohwr:
+  <<: *koji_deps
+  stage: kbuild
+  only:
+    - /^v[0-9]+\.[0-9]+\.[0-9]+$/
+  except:
+    - branches
+  script:
+    - koji --config=.koji build --wait ${KOJI_TARGET} ${SRPM_PATH}
diff --git a/.koji b/.koji
new file mode 100644
index 0000000000000000000000000000000000000000..2ac20a9a78dca8ed4e0299a78c15c819b26f8812
--- /dev/null
+++ b/.koji
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: CC0-1.0
+#
+# SPDX-FileCopyrightText: 2019 CERN
+
+[koji]
+server = https://kojihub.cern.ch/kojihub
+weburl = https://koji.cern.ch/
+topurl = https://koji.cern.ch/kojifiles
+krb_canon_host = no
+krb_rdns = False
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 8c3a686d0f93c89240070c533051f98d0e987eb8..0000000000000000000000000000000000000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# Changelog
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
-and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-## [Unreleased]
-### Added
-- VHDL functions to convert characters and strings to upper/lower case.
-### Changed
-- Rewritten the WB master interface used in simulations.
-
-## [1.0.0] - 2019-10-21
-### Added
-- First release of general-cores.
-
-[Unreleased]: https://www.ohwr.org/project/general-cores/compare/v1.0.0...proposed_master
-[1.0.0]: https://www.ohwr.org/project/general-cores/tags/v1.0.0
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
new file mode 100644
index 0000000000000000000000000000000000000000..8b26d4ebc32edcecd4bf8383c71b05aaf448d2b3
--- /dev/null
+++ b/CHANGELOG.rst
@@ -0,0 +1,53 @@
+..
+  SPDX-License-Identifier: CC-BY-SA-4.0
+
+  SPDX-FileCopyrightText: 2019-2020 CERN
+
+==========
+Change Log
+==========
+Format: `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_
+Versioning: `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_
+
+[Unreleased]
+============
+Added
+-----
+- [hdl] VHDL functions to convert characters and strings to upper/lower case.
+Changed
+-------
+- [hdl] Rewritten the WB master interface used in simulations.
+
+[1.0.3]_ - 2020-01-15
+====================
+Changed
+-----
+- [sw] add more file to .gitignore
+
+[1.0.2]_ - 2019-10-24
+====================
+Fixed
+-----
+- [ci] forgot rule to publish RPMs
+
+[1.0.1]_ - 2019-10-24
+====================
+Added
+-----
+- [ci] building and publish RPMs automatically on new releases
+Changed
+-------
+- [sw] Makefiles have been changed to better support RPM generation
+
+[1.0.0]_ - 2019-10-21
+====================
+Added
+-----
+- First release of general-cores.
+
+.. _[Unreleased]: https://www.ohwr.org/project/general-cores/compare/v1.0.3...proposed_master
+
+.. _[1.0.3]: https://www.ohwr.org/project/general-cores/tags/v1.0.3
+.. _[1.0.2]: https://www.ohwr.org/project/general-cores/tags/v1.0.2
+.. _[1.0.1]: https://www.ohwr.org/project/general-cores/tags/v1.0.1
+.. _[1.0.0]: https://www.ohwr.org/project/general-cores/tags/v1.0.0
diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0e259d42c996742e9e3cba14c677129b2c1b6311
--- /dev/null
+++ b/LICENSES/CC0-1.0.txt
@@ -0,0 +1,121 @@
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+    HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+  i. the right to reproduce, adapt, distribute, perform, display,
+     communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+     likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+     subject to the limitations in paragraph 4(a), below;
+  v. rights protecting the extraction, dissemination, use and reuse of data
+     in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+     European Parliament and of the Council of 11 March 1996 on the legal
+     protection of databases, and under any national implementation
+     thereof, including any amended or successor version of such
+     directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+     world based on applicable law or treaty, and any national
+     implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+    surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+    warranties of any kind concerning the Work, express, implied,
+    statutory or otherwise, including without limitation warranties of
+    title, merchantability, fitness for a particular purpose, non
+    infringement, or the absence of latent or other defects, accuracy, or
+    the present or absence of errors, whether or not discoverable, all to
+    the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+    that may apply to the Work or any use thereof, including without
+    limitation any person's Copyright and Related Rights in the Work.
+    Further, Affirmer disclaims responsibility for obtaining any necessary
+    consents, permissions or other rights required for any use of the
+    Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+    party to this document and has no duty or obligation with respect to
+    this CC0 or use of the Work.
diff --git a/LICENSES/GPL-2.0.txt b/LICENSES/GPL-2.0.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d159169d1050894d3ea3b98e1c965c4058208fe1
--- /dev/null
+++ b/LICENSES/GPL-2.0.txt
@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/common.mk b/common.mk
new file mode 100644
index 0000000000000000000000000000000000000000..1dc69d4823d9401fd412c8a4b6e8f6f2d3e43b99
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: CC0-1.0
+#
+# SPDX-FileCopyrightText: 2019 CERN
+
+PREFIX ?= /
+
+GIT_VERSION := $(shell git describe --always --dirty --long --tags)
+VERSION := $(shell git describe --tags --abbrev=0 | tr -d 'v')
+
+GCORES_SW := $(GCORES)/software
diff --git a/distribution/.gitignore b/distribution/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..5376fdcb2d6c606f67b08c19ede33702f2e6cbc2
--- /dev/null
+++ b/distribution/.gitignore
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: CC0-1.0
+#
+# SPDX-FileCopyrightText: 2019 CERN
+
+rpmbuild
diff --git a/distribution/Makefile b/distribution/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..e90a9a3d2a88d970ab44979c96aebdc35c4f07fa
--- /dev/null
+++ b/distribution/Makefile
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: CC0-1.0
+#
+# SPDX-FileCopyrightText: 2019 CERN
+
+TOPDIR ?= $(shell pwd)/../
+TRTL ?= $(TOPDIR)
+include $(TRTL)/common.mk
+
+NAME := general-cores
+SPEC_RPM := $(NAME).spec
+DEST := rpmbuild
+
+tar-post = \
+	$(eval tmpdir := $(shell mktemp -d)) \
+	tar --extract -C $(tmpdir)/ -f $(1) \
+	    $(2)/common.mk && \
+	sed -e "s,^GIT_VERSION.*$$,GIT_VERSION := "$(GIT_VERSION)"," \
+	    -e "s,^VERSION.*$$,VERSION := "$(VERSION)"," \
+	    -i $(tmpdir)/$(2)/common.mk && \
+	tar --update -C $(tmpdir) -f $(1) \
+	    $(2)/common.mk && \
+	rm -rf $(tmpdir)
+
+all: rpmbuild-all
+clean: rpmbuild-clean
+
+include rpmbuild.mk
+
+.PHONY: all clean
diff --git a/distribution/general-cores.spec b/distribution/general-cores.spec
new file mode 100644
index 0000000000000000000000000000000000000000..59b023f6c4780867e54fbf13179a021dfce1f521
--- /dev/null
+++ b/distribution/general-cores.spec
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# SPDX-FileCopyrightText: 2019 CERN
+
+%define project_name general-cores
+
+Summary: General Cores Drivers
+Name: dkms-%{project_name}
+Version: %{?_build_version}
+License: GPL-2.0
+Release: 1%{?dist}
+URL: https://www.ohwr.org/projects/general-cores/
+
+BuildRequires: make, gcc, git
+Requires: dkms
+
+Source0: %{project_name}-%{version}.tar.gz
+Source1: CHANGELOG
+
+%description
+This package installs all general-cores drivers
+
+%prep
+%autosetup -n %{project_name}-%{version}
+
+%build
+
+%install
+make -C software PREFIX=%{buildroot}/ -f dkms.mk dkms_install
+
+%post
+dkms add -m %{project_name} -v %{version} --rpm_safe_upgrade
+dkms build -m %{project_name} -v %{version} --rpm_safe_upgrade
+dkms install -m %{project_name} -v %{version} --rpm_safe_upgrade
+
+%preun
+dkms remove -m %{project_name} -v %{version} --rpm_safe_upgrade --all ||:
+
+%files
+%license LICENSES/CC0-1.0.txt
+%license LICENSES/GPL-2.0.txt
+/usr/src/%{project_name}-%{version}/*
+
+
+%changelog
+%include %{SOURCE1}
diff --git a/distribution/rpmbuild.mk b/distribution/rpmbuild.mk
new file mode 100644
index 0000000000000000000000000000000000000000..a861567c1647416eca10b595518bd8a8bee7110f
--- /dev/null
+++ b/distribution/rpmbuild.mk
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: 2019 CERN
+# Author: Federico Vaga <federico.vaga@cern.ch>
+
+
+#
+# Required Project Variables And Functions
+#
+ifndef TOPDIR
+$(error "Define project top-level directory: TOPDIR")
+endif
+ifndef NAME
+$(error "Define project name: NAME")
+endif
+ifndef VERSION
+$(error "Define project version: VERSION")
+endif
+ifndef SPEC_RPM
+$(error "Define RPM spec file: SPEC_RPM")
+endif
+
+
+#
+# Internal Variables
+#
+FULL_NAME := $(NAME)-$(VERSION)
+DEST ?= rpmbuild
+RPMBUILD := $(shell /bin/pwd)/$(DEST)
+SOURCES := $(RPMBUILD)/SOURCES
+SRC_TAR := $(SOURCES)/$(FULL_NAME).tar
+SRC_TAR_GZ := $(SOURCES)/$(FULL_NAME).tar.gz
+CHANGELOG := $(SOURCES)/CHANGELOG
+SPEC := $(RPMBUILD)/SPECS/$(FULL_NAME).spec
+
+#
+# Requirements
+# - git (if this is a git repository)
+#
+GIT ?= git
+ifeq (,$(shell which $(GIT)))
+$(error "The tool 'git' is required to process '$@'")
+endif
+
+#
+# Targets
+#
+
+# Prepare working directories
+$(RPMBUILD):
+	@mkdir -p $@/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
+
+# Build a tar with all sources with the assumption that sources
+# are handled with a git repository. Otherwise, rewrite this rule
+# in order to get get a clean tar.
+$(SRC_TAR): $(RPMBUILD)
+	@cd $(TOPDIR) && \
+	 $(GIT) archive --format=tar -o $@ --prefix=$(FULL_NAME)/ HEAD
+ifdef tar-post
+# Extra processing on the tar file.
+# Modify this target according to project needs, if you do not use git-archive
+# then do everything right while you are building your tar file
+	$(warning "Post processing tar file")
+	@$(call tar-post,$@,$(FULL_NAME))
+endif
+
+# Compress sources (optional)
+$(SRC_TAR_GZ): $(SRC_TAR) $(RPMBUILD)
+	@rm -f $@ # remove any previous archive
+	@gzip $<
+
+# Create an RPM compatible CHANGELOG from the project format
+# (see https://keepachangelog.com/en/1.0.0/)
+$(CHANGELOG): $(SRC_TAR_GZ)
+	$(eval $@_pattern := ^\[([0-9]+\.[0-9]+\.[0-9]+)\]\s-\s([0-9]{4}-[0-9]{2}-[0-9]{2})$)
+	$(eval $@_replace := echo -e "\n"\\* `date --date="\2" "+%a %b %d %Y"` "\1")
+	@tar -C $(SOURCES) -xf $< $(FULL_NAME)/CHANGELOG.rst
+	@mv $(SOURCES)/$(FULL_NAME)/CHANGELOG.rst $(CHANGELOG)
+	@rmdir $(SOURCES)/$(FULL_NAME)
+	@sed -r -i -e "1,+10d" -e "/^(=|-|\s)*$$/d" $(CHANGELOG)
+	@sed -r -i -e 's,$($@_pattern),$($@_replace),e' $(CHANGELOG)
+
+# Put all necessary sources in the source directory
+sources: $(SRC_TAR_GZ) $(CHANGELOG) $(RPMBUILD)
+
+# Build the RPM spec file to embed in the .src.rpm file for a specific version
+$(SPEC): $(SPEC_RPM) $(RPMBUILD)
+	@cp $< $@
+	@sed -i -e "s/%{?_build_version}/$(VERSION)/" $@
+
+# rpmbuild targets
+rpmbuild: $(SPEC) sources $(RPMBUILD)
+
+rpmbuild-source: rpmbuild
+	@rpmbuild -bs --define "_topdir $(RPMBUILD)" $(SPEC)
+
+rpmbuild-binary: rpmbuild
+	@rpmbuild -bb --define "_topdir $(RPMBUILD)" $(SPEC)
+
+rpmbuild-all: rpmbuild
+	@rpmbuild -ba --define "_topdir $(RPMBUILD)" $(SPEC)
+
+rpmbuild-clean:
+	@rm -rf $(RPMBUILD)
+
+.PHONY: srpm sources $(SRC_TAR_GZ) $(SRC_TAR) $(CHANGELOG) $(SPEC)
diff --git a/software/.gitignore b/software/.gitignore
index 877ad2f81dfa2ba8c1398cc7c530b2172352c05b..4119dd19dbf9ad9f60ef3f1427390791fdb420a2 100644
--- a/software/.gitignore
+++ b/software/.gitignore
@@ -2,4 +2,9 @@
 #
 # SPDX-FileCopyrightText: 2019 CERN
 
-Makefile.specific
\ No newline at end of file
+Makefile.specific
+*.mod.c
+*.ko
+*.cmd
+Module.symvers
+modules.order
\ No newline at end of file
diff --git a/software/Makefile b/software/Makefile
index 21482cb2ec6d9814e771191b2c13dd3f024ea5ab..7d350fe6766d8fa842e8d55b2f7485f7de5040bf 100644
--- a/software/Makefile
+++ b/software/Makefile
@@ -1,15 +1,18 @@
--include Makefile.specific
-
-# include parent_common.mk for buildsystem's defines
-#use absolute path for REPO_PARENT
-REPO_PARENT ?= $(shell /bin/pwd)/..
--include $(REPO_PARENT)/parent_common.mk
+# SPDX-License-Identifier: CC0-1.0
+#
+# Copyright (C) 2019 CERN
 
 DIRS := i2c-ocores
 DIRS += spi-ocores
 DIRS += htvic
 
-.PHONY: all clean modules install modules_install
+.PHONY: all clean modules install modules_install gtags
+
+all: modules
+install: modules_install
 
-all clean modules install modules_install:
+clean modules modules_install coccicheck:
 	for D in $(DIRS); do $(MAKE) -C $$D $@; done
+
+gtags:
+	git ls-tree -r --name-only HEAD | grep -E '.*\.(c|h)$$' | gtags -f -
diff --git a/software/dkms.conf b/software/dkms.conf
new file mode 100644
index 0000000000000000000000000000000000000000..978645a7a26f288cd981162825cce1b3e6aca7bf
--- /dev/null
+++ b/software/dkms.conf
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: CC0-1.0
+#
+# Copyright (C) 2019 CERN
+
+PACKAGE_NAME="general-cores"
+PACKAGE_VERSION="@PKGVER@"
+CLEAN="make clean"
+MAKE[0]="make KVERSION=$kernelver all"
+BUILT_MODULE_NAME[0]="htvic"
+BUILT_MODULE_NAME[1]="i2c-ocores"
+BUILT_MODULE_NAME[2]="spi-ocores"
+BUILT_MODULE_LOCATION[0]="htvic/driver"
+BUILT_MODULE_LOCATION[1]="i2c-ocores/drivers/i2c/busses"
+BUILT_MODULE_LOCATION[2]="spi-ocores/drivers/spi"
+DEST_MODULE_LOCATION[0]="/updates"
+DEST_MODULE_LOCATION[1]="/updates"
+DEST_MODULE_LOCATION[2]="/updates"
+AUTOINSTALL="yes"
diff --git a/software/dkms.mk b/software/dkms.mk
new file mode 100644
index 0000000000000000000000000000000000000000..c08da9f90c2340f1a96027854d864c800f9d33b0
--- /dev/null
+++ b/software/dkms.mk
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: CC0-1.0
+#
+# SPDX-FileCopyrightText: 2019 CERN
+
+TOPDIR ?= $(shell pwd)/..
+include $(TOPDIR)/common.mk
+
+NAME := general-cores
+FULL_NAME := $(NAME)-$(VERSION)
+DST := /tmp/dkms-source-$(FULL_NAME)
+
+all: dkms_install
+
+# copy necessary source file to build this driver
+dkms_sources:
+	mkdir -p $(DST)
+	find ./ -regextype posix-extended \
+	     -regex '.*(Makefile|Kbuild|dkms.conf|/[^.]+\.[ch])' \
+	     -exec cp --parents {} $(DST) \;
+	cp $(TOPDIR)/LICENSES/GPL-2.0.txt $(DST)
+
+
+# fix the dkms source file so that the build system is consistent
+# with its new location
+dkms_sources_prep: dkms_sources
+# we do not have git, copy the version
+	@find $(DST) -name Makefile -exec \
+	      sed -e 's,$$(GIT_VERSION),$(GIT_VERSION),' \
+	          -i {} \;
+	@sed -r -e "s/@PKGVER@/$(VERSION)/" \
+	     -i $(DST)/dkms.conf
+# we do not use the common.mk, but we need PREFIX
+	@find $(DST) -name Makefile -exec \
+	      sed -r -e 's/^include.*common.mk$$/PREFIX ?= \//' \
+	          -i {} \;
+
+dkms_install: dkms_sources_prep
+	@mkdir -p $(PREFIX)/usr/src/$(FULL_NAME)/
+	@cp -a $(DST)/* $(PREFIX)/usr/src/$(FULL_NAME)
diff --git a/software/htvic/Makefile b/software/htvic/Makefile
index 5967392673f97d13bc09273dd697504e74f9bda8..07ace2dcf6ab49197bc5f0fdce86361241c6673b 100644
--- a/software/htvic/Makefile
+++ b/software/htvic/Makefile
@@ -2,13 +2,12 @@
 #
 # SPDX-FileCopyrightText: 2019 CERN
 
-all: modules
+.PHONY: all clean modules install modules_install gtags
 
-install: modules_install
-clean modules modules_install:
-	@$(MAKE) -C drivers/ $@
+DIR := drivers/
 
-gtags:
-	git ls-tree -r --name-only HEAD | grep -E '.*\.(c|h)$$' | gtags -f -
+all: modules
+install: modules_install
 
-.PHONY: modules modules_install clean all gtags
+clean modules modules_install coccicheck:
+	@$(MAKE) -C $(DIR) $@
diff --git a/software/htvic/drivers/Kbuild b/software/htvic/drivers/Kbuild
index 672169fde5168b1b70055e40d6e930fab1dbe98b..692c3fff89344d42c901e08a77fa943a9edaaeb7 100644
--- a/software/htvic/drivers/Kbuild
+++ b/software/htvic/drivers/Kbuild
@@ -1,4 +1,4 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
+# SPDX-License-Identifier: CC0-1.0
 #
 # Copyright (C) 2019 CERN
 
@@ -9,6 +9,7 @@ endif
 endif
 
 ccflags-y += -DADDITIONAL_VERSIONS="$(SUBMODULE_VERSIONS-y)"
+ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
 ccflags-y += -Werror
 
 obj-m := htvic.o
diff --git a/software/htvic/drivers/Makefile b/software/htvic/drivers/Makefile
index 6290c00b05a2d4055b6f5314f6129295676433e3..a36e956a801239b3980296a4ce3ea2f84d9acddf 100644
--- a/software/htvic/drivers/Makefile
+++ b/software/htvic/drivers/Makefile
@@ -1,16 +1,36 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
+# SPDX-License-Identifier: CC0-1.0
 #
 # Copyright (C) 2019 CERN
 
+TOPDIR ?= ../../../
+GCORES ?= $(abspath $(TOPDIR))
+
+#
+# External variables and targets
+#
 -include Makefile.specific
-REPO_PARENT ?= $(shell /bin/pwd)/../..
 -include $(REPO_PARENT)/parent_common.mk
+include $(GCORES)/common.mk
 
-LINUX ?= /lib/modules/$(shell uname -r)/build
+#
+# Local variables
+#
+KVERSION ?= $(shell uname -r)
+LINUX ?= /lib/modules/$(KVERSION)/build
+
+#
+# Local targets
+#
 
 all: modules
+install: modules_install
+
+clean coccicheck modules:
+	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) \
+		GIT_VERSION=$(GIT_VERSION) \
+		$@
+modules_install: modules
+	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) INSTALL_MOD_PATH=$(PREFIX) $@
 
-clean modules help modules_install:
-	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) $@
 
-.PHONY: all modules clean help install modules_install
+.PHONY: all clean coccicheck modules modules_install install
diff --git a/software/htvic/drivers/htvic.c b/software/htvic/drivers/htvic.c
index 113c41a02bca18738796bc5e2ebc082b52ef30a2..2f87aa7345d535fe236f01867b472210fcaa9e17 100644
--- a/software/htvic/drivers/htvic.c
+++ b/software/htvic/drivers/htvic.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2016 CERN
  * Author: Federico Vaga <federico.vaga@cern.ch>
diff --git a/software/htvic/drivers/htvic.h b/software/htvic/drivers/htvic.h
index 3a757f66f9ed9547180bebde4022924e6f105840..7e632682939fd8540cc2bc20f18cec45a4cfa28d 100644
--- a/software/htvic/drivers/htvic.h
+++ b/software/htvic/drivers/htvic.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2016 CERN
  * Author: Federico Vaga <federico.vaga@cern.ch>
diff --git a/software/i2c-ocores/Makefile b/software/i2c-ocores/Makefile
index b89a71da826bb72dd3d60b54efb9336f6ac33d17..49225aed5523360015ac2bf73faa83fd7481727c 100644
--- a/software/i2c-ocores/Makefile
+++ b/software/i2c-ocores/Makefile
@@ -2,10 +2,12 @@
 #
 # SPDX-FileCopyrightText: 2019 CERN
 
-all: modules
+.PHONY: all clean modules install modules_install
+
+DIR := drivers/i2c/busses
 
+all: modules
 install: modules_install
-clean modules modules_install:
-	make -C $(shell pwd)/drivers/i2c/busses $@
 
-.PHONY: modules modules_install clean all
+clean modules modules_install coccicheck:
+	@$(MAKE) -C $(DIR) $@
diff --git a/software/i2c-ocores/drivers/i2c/busses/Kbuild b/software/i2c-ocores/drivers/i2c/busses/Kbuild
index 465d57584654f15fe1ad14f182241957243e2f54..9915b65d3a541806035bcda0f03e0c2ed7d306cf 100644
--- a/software/i2c-ocores/drivers/i2c/busses/Kbuild
+++ b/software/i2c-ocores/drivers/i2c/busses/Kbuild
@@ -1,4 +1,4 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
+# SPDX-License-Identifier: CC0-1.0
 #
 # Copyright (C) 2019 CERN
 
@@ -8,9 +8,12 @@ SUBMODULE_VERSIONS-y += MODULE_INFO(version_$(CONFIG_SUPER_REPO),\"$(CONFIG_SUPE
 endif
 endif
 
+ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
+ccflags-y += -Werror
 ccflags-y += -I$(src)/../../../include
 
-# priority to our local headers
-LINUXINCLUDE :=  -I$(src)/../../../include -I$(src)/../../../include/linux $(LINUXINCLUDE)
+# priority to our local headers (avoid conflict with the version in kernel)
+LINUXINCLUDE := -I$(src)/../../../include $(LINUXINCLUDE)
+LINUXINCLUDE := -I$(src)/../../../include/linux $(LINUXINCLUDE)
 
 obj-$(CONFIG_I2C_OCORES) += i2c-ocores.o
\ No newline at end of file
diff --git a/software/i2c-ocores/drivers/i2c/busses/Makefile b/software/i2c-ocores/drivers/i2c/busses/Makefile
index 71ccc47f598b5692d91e49326cc7ccef6a7dce6e..c48039b2a3a9ed3c2f4035c90e30a329eafe08b7 100644
--- a/software/i2c-ocores/drivers/i2c/busses/Makefile
+++ b/software/i2c-ocores/drivers/i2c/busses/Makefile
@@ -1,20 +1,37 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
+# SPDX-License-Identifier: CC0-1.0
 #
 # Copyright (C) 2019 CERN
 
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# Copyright (C) 2019 CERN
+TOPDIR ?= ../../../../../
+GCORES ?= $(abspath $(TOPDIR))
 
+#
+# External variables and targets
+#
 -include Makefile.specific
-REPO_PARENT ?= $(shell /bin/pwd)/../..
 -include $(REPO_PARENT)/parent_common.mk
+include $(GCORES)/common.mk
+
+#
+# Local variables
+#
+KVERSION ?= $(shell uname -r)
+LINUX ?= /lib/modules/$(KVERSION)/build
 
-LINUX ?= /lib/modules/$(shell uname -r)/build
+#
+# Local targets
+#
 
 all: modules
+install: modules_install
+
+clean coccicheck modules:
+	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) \
+		GIT_VERSION=$(GIT_VERSION) \
+		CONFIG_I2C_OCORES=m \
+		$@
+modules_install: modules
+	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) INSTALL_MOD_PATH=$(PREFIX) $@
 
-clean modules help modules_install:
-	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) CONFIG_I2C_OCORES=m $@
 
-.PHONY: all modules clean help install modules_install
+.PHONY: all clean coccicheck modules modules_install install
diff --git a/software/spi-ocores/Makefile b/software/spi-ocores/Makefile
index 8e999182fc8712518ee0c7abd0aacd12a5b82e5a..d8c6fb14d093828cc4e32377199ba349d7a087b8 100644
--- a/software/spi-ocores/Makefile
+++ b/software/spi-ocores/Makefile
@@ -2,10 +2,13 @@
 #
 # SPDX-FileCopyrightText: 2019 CERN
 
-all: modules
 
+.PHONY: all clean modules install modules_install
+
+DIR := drivers/spi
+
+all: modules
 install: modules_install
-clean modules modules_install:
-	make -C $(shell pwd)/drivers/spi $@
 
-.PHONY: modules modules_install clean all
+clean modules modules_install coccicheck:
+	@$(MAKE) -C $(DIR) $@
diff --git a/software/spi-ocores/drivers/spi/Kbuild b/software/spi-ocores/drivers/spi/Kbuild
index af45060d31490d0001b98cc2e6bb1048439ff36d..1acfa13fcb7bf5986b7ce2cc6e7cef09d155ddb9 100644
--- a/software/spi-ocores/drivers/spi/Kbuild
+++ b/software/spi-ocores/drivers/spi/Kbuild
@@ -1,4 +1,4 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
+# SPDX-License-Identifier: CC0-1.0
 #
 # Copyright (C) 2019 CERN
 
@@ -8,6 +8,12 @@ SUBMODULE_VERSIONS-y += MODULE_INFO(version_$(CONFIG_SUPER_REPO),\"$(CONFIG_SUPE
 endif
 endif
 
+ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
+ccflags-y += -Werror
 ccflags-y += -I$(src)/../../include
 
+# priority to our local headers (avoid conflict with the version in kernel)
+LINUXINCLUDE := -I$(src)/../../../include $(LINUXINCLUDE)
+LINUXINCLUDE := -I$(src)/../../../include/linux $(LINUXINCLUDE)
+
 obj-$(CONFIG_SPI_OCORES) += spi-ocores.o
\ No newline at end of file
diff --git a/software/spi-ocores/drivers/spi/Makefile b/software/spi-ocores/drivers/spi/Makefile
index c0d1ef2f61cf2ce824f43adb7633da1231dd612a..61e370524dc6ba28eac2461ca6bd895faf1c378f 100644
--- a/software/spi-ocores/drivers/spi/Makefile
+++ b/software/spi-ocores/drivers/spi/Makefile
@@ -1,16 +1,37 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
+# SPDX-License-Identifier: CC0-1.0
 #
 # Copyright (C) 2019 CERN
 
+TOPDIR ?= ../../../../
+GCORES ?= $(abspath $(TOPDIR))
+
+#
+# External variables and targets
+#
 -include Makefile.specific
-REPO_PARENT ?= $(shell /bin/pwd)/../..
 -include $(REPO_PARENT)/parent_common.mk
+include $(GCORES)/common.mk
 
-LINUX ?= /lib/modules/$(shell uname -r)/build
+#
+# Local variables
+#
+KVERSION ?= $(shell uname -r)
+LINUX ?= /lib/modules/$(KVERSION)/build
+
+#
+# Local targets
+#
 
 all: modules
+install: modules_install
+
+clean coccicheck modules:
+	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) \
+		GIT_VERSION=$(GIT_VERSION) \
+		CONFIG_SPI_OCORES=m \
+		$@
+modules_install: modules
+	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) INSTALL_MOD_PATH=$(PREFIX) $@
 
-clean modules help modules_install:
-	$(MAKE) -C $(LINUX) M=$(shell /bin/pwd) CONFIG_SPI_OCORES=m $@
 
-.PHONY: all modules clean help install modules_install
+.PHONY: all clean coccicheck modules modules_install install
diff --git a/software/spi-ocores/drivers/spi/spi-ocores.c b/software/spi-ocores/drivers/spi/spi-ocores.c
index 2c53043baab8a719b88435a8d751cc176ac0f684..57551687adeb3ea5580dfe50a45d75682264ce34 100644
--- a/software/spi-ocores/drivers/spi/spi-ocores.c
+++ b/software/spi-ocores/drivers/spi/spi-ocores.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2019 CERN (www.cern.ch)
  * Author: Federico Vaga <federico.vaga@cern.ch>
diff --git a/software/spi-ocores/include/linux/platform_data/spi-ocores.h b/software/spi-ocores/include/linux/platform_data/spi-ocores.h
index 042c4ceb5dfa60a248d9984c65c1678e2da7050f..2febfd700e7a79fe9d0efb8e89a8c00d80a313ab 100644
--- a/software/spi-ocores/include/linux/platform_data/spi-ocores.h
+++ b/software/spi-ocores/include/linux/platform_data/spi-ocores.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2019 CERN (www.cern.ch)
  * Author: Federico Vaga <federico.vaga@cern.ch>