habanalabs: create common folder
authorOded Gabbay <oded.gabbay@gmail.com>
Mon, 13 Jul 2020 09:21:04 +0000 (12:21 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Fri, 24 Jul 2020 17:31:37 +0000 (20:31 +0300)
For internal needs of our CI we need to move all the common code into a
common folder instead of putting them in the root folder of the driver.

Same applies to the common header files under include/

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Omer Shpigelman <oshpigelman@habana.ai>
25 files changed:
drivers/misc/habanalabs/Makefile
drivers/misc/habanalabs/common/Makefile [new file with mode: 0644]
drivers/misc/habanalabs/common/asid.c [moved from drivers/misc/habanalabs/asid.c with 100% similarity]
drivers/misc/habanalabs/common/command_buffer.c [moved from drivers/misc/habanalabs/command_buffer.c with 100% similarity]
drivers/misc/habanalabs/common/command_submission.c [moved from drivers/misc/habanalabs/command_submission.c with 100% similarity]
drivers/misc/habanalabs/common/context.c [moved from drivers/misc/habanalabs/context.c with 100% similarity]
drivers/misc/habanalabs/common/debugfs.c [moved from drivers/misc/habanalabs/debugfs.c with 100% similarity]
drivers/misc/habanalabs/common/device.c [moved from drivers/misc/habanalabs/device.c with 100% similarity]
drivers/misc/habanalabs/common/firmware_if.c [moved from drivers/misc/habanalabs/firmware_if.c with 99% similarity]
drivers/misc/habanalabs/common/habanalabs.h [moved from drivers/misc/habanalabs/habanalabs.h with 99% similarity]
drivers/misc/habanalabs/common/habanalabs_drv.c [moved from drivers/misc/habanalabs/habanalabs_drv.c with 100% similarity]
drivers/misc/habanalabs/common/habanalabs_ioctl.c [moved from drivers/misc/habanalabs/habanalabs_ioctl.c with 100% similarity]
drivers/misc/habanalabs/common/hw_queue.c [moved from drivers/misc/habanalabs/hw_queue.c with 100% similarity]
drivers/misc/habanalabs/common/hwmon.c [moved from drivers/misc/habanalabs/hwmon.c with 100% similarity]
drivers/misc/habanalabs/common/irq.c [moved from drivers/misc/habanalabs/irq.c with 100% similarity]
drivers/misc/habanalabs/common/memory.c [moved from drivers/misc/habanalabs/memory.c with 100% similarity]
drivers/misc/habanalabs/common/mmu.c [moved from drivers/misc/habanalabs/mmu.c with 100% similarity]
drivers/misc/habanalabs/common/pci.c [moved from drivers/misc/habanalabs/pci.c with 100% similarity]
drivers/misc/habanalabs/common/sysfs.c [moved from drivers/misc/habanalabs/sysfs.c with 100% similarity]
drivers/misc/habanalabs/gaudi/Makefile
drivers/misc/habanalabs/gaudi/gaudiP.h
drivers/misc/habanalabs/goya/goyaP.h
drivers/misc/habanalabs/include/common/armcp_if.h [moved from drivers/misc/habanalabs/include/armcp_if.h with 100% similarity]
drivers/misc/habanalabs/include/common/hl_boot_if.h [moved from drivers/misc/habanalabs/include/hl_boot_if.h with 100% similarity]
drivers/misc/habanalabs/include/common/qman_if.h [moved from drivers/misc/habanalabs/include/qman_if.h with 100% similarity]

index 421ebd9..a786c0a 100644 (file)
@@ -3,16 +3,15 @@
 # Makefile for HabanaLabs AI accelerators driver
 #
 
-obj- := habanalabs.o
+obj-$(CONFIG_HABANA_AI) := habanalabs.o
 
-habanalabs-y := habanalabs_drv.o device.o context.o asid.o habanalabs_ioctl.o \
-               command_buffer.o hw_queue.o irq.o sysfs.o hwmon.o memory.o \
-               command_submission.o mmu.o firmware_if.o pci.o
-
-habanalabs-$(CONFIG_DEBUG_FS) += debugfs.o
+include $(src)/common/Makefile
+habanalabs-y += $(HL_COMMON_FILES)
 
 include $(src)/goya/Makefile
 habanalabs-y += $(HL_GOYA_FILES)
 
 include $(src)/gaudi/Makefile
 habanalabs-y += $(HL_GAUDI_FILES)
+
+habanalabs-$(CONFIG_DEBUG_FS) += common/debugfs.o
diff --git a/drivers/misc/habanalabs/common/Makefile b/drivers/misc/habanalabs/common/Makefile
new file mode 100644 (file)
index 0000000..97d03b5
--- /dev/null
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+subdir-ccflags-y += -I$(src)/common
+
+HL_COMMON_FILES := common/habanalabs_drv.o common/device.o common/context.o \
+               common/asid.o common/habanalabs_ioctl.o \
+               common/command_buffer.o common/hw_queue.o common/irq.o \
+               common/sysfs.o common/hwmon.o common/memory.o \
+               common/command_submission.o common/mmu.o common/firmware_if.o \
+               common/pci.o
similarity index 99%
rename from drivers/misc/habanalabs/firmware_if.c
rename to drivers/misc/habanalabs/common/firmware_if.c
index 3be1549..b2b8451 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #include "habanalabs.h"
-#include "include/hl_boot_if.h"
+#include "include/common/hl_boot_if.h"
 
 #include <linux/firmware.h>
 #include <linux/genalloc.h>
similarity index 99%
rename from drivers/misc/habanalabs/habanalabs.h
rename to drivers/misc/habanalabs/common/habanalabs.h
index 14def0d..82532f1 100644 (file)
@@ -8,8 +8,8 @@
 #ifndef HABANALABSP_H_
 #define HABANALABSP_H_
 
-#include "include/armcp_if.h"
-#include "include/qman_if.h"
+#include "include/common/armcp_if.h"
+#include "include/common/qman_if.h"
 #include <uapi/misc/habanalabs.h>
 
 #include <linux/cdev.h>
index f802cdc..75104ae 100644 (file)
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-subdir-ccflags-y += -I$(src)
+subdir-ccflags-y += -I$(src)/common
 
 HL_GAUDI_FILES := gaudi/gaudi.o gaudi/gaudi_hwmgr.o gaudi/gaudi_security.o \
        gaudi/gaudi_coresight.o
index bdc5f96..a94ab6a 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <uapi/misc/habanalabs.h>
 #include "habanalabs.h"
-#include "include/hl_boot_if.h"
+#include "include/common/hl_boot_if.h"
 #include "include/gaudi/gaudi_packets.h"
 #include "include/gaudi/gaudi.h"
 #include "include/gaudi/gaudi_async_events.h"
index 8265cc2..9e674cf 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <uapi/misc/habanalabs.h>
 #include "habanalabs.h"
-#include "include/hl_boot_if.h"
+#include "include/common/hl_boot_if.h"
 #include "include/goya/goya_packets.h"
 #include "include/goya/goya.h"
 #include "include/goya/goya_async_events.h"