Initial commit

Change-Id: I3b3c5b825a050f374780b0ba9b3a1edec1490175
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..7c428f8
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+imx-gpu-viv-ko (6.4.2-2) mendel-day; urgency=medium
+
+  * Initial release.
+
+ -- Coral <coral-support@google.com>  Tue, 22 Sep 2020 19:37:42 -0700
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..ab2ad14
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,20 @@
+Source: imx-gpu-viv-ko
+Maintainer: Coral <coral-support@google.com>
+Build-Depends:
+    debhelper (>=10),
+    gcc-aarch64-linux-gnu,
+    linux-headers-4.14.98-imx
+Standards-Version: 3.9.8
+Section: libs
+Priority: optional
+
+Package: imx-gpu-viv-ko
+Section: libs
+Priority: optional
+Architecture: arm64 armhf
+Depends:
+    ${misc:Depends},
+    kmod,
+Conflicts: imx-gpu-viv (<< 6.4.2-2)
+Description: Kernel module to support Vivante GPU.
+ This package contains the galcore kernel module for Vivante GPU.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..b2f0c69
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,7 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: imx-gpu-viv-ko
+Source: https://coral.withgoogle.com
+
+Files: *
+Copyright: Copyright (C) 2014 - 2020 Vivante Corporation
+License: GPL-2
diff --git a/debian/imx-gpu-viv-ko.udev b/debian/imx-gpu-viv-ko.udev
new file mode 100644
index 0000000..4378f9f
--- /dev/null
+++ b/debian/imx-gpu-viv-ko.udev
@@ -0,0 +1 @@
+KERNEL=="galcore", MODE="0660", GROUP="video"
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..e208e80
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,4 @@
+#!/bin/bash -e
+
+depmod -a 4.14.98-imx
+#DEBHELPER#
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..3efff45
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,64 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+# export DH_VERBOSE=1
+
+CFLAGS := -D_FILE_OFFSET_BITS=64
+LDFLAGS := -z relro
+OUTDIR := out
+DESTDIR := debian/imx-gpu-viv-ko
+
+MAKEOPTS := \
+	CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- \
+	VIVANTE_ENABLE_DRM=1 \
+	SOC_PLATFORM=freescale-imx \
+	USE_BANK_ALIGNMENT=1 \
+	BANK_BIT_START=13 \
+	BANK_BIT_END=15 \
+	BANK_CHANNEL_BIT=12 \
+	ENABLE_GPU_CLOCK_BY_DRIVER=0 \
+	AQROOT=$(shell pwd) \
+	SDK_DIR=$(shell pwd)/debian/$(OUTDIR) \
+	-j$(nproc)
+
+MAKEOPTS_arm64 := \
+	CPU_TYPE=cortex-a53 \
+	CPU_ARCH=armv8-a \
+	ARCH_TYPE=arm64 \
+	ABI=lp64
+
+MAKEOPTS_armhf += \
+	CPU_TYPE=cortex-a9 \
+	CPU_ARCH=armv7-a \
+	ARCH_TYPE=arm \
+	ABI=aapcs-linux
+
+ifeq ($(DEB_TARGET_ARCH),arm64)
+MAKEOPTS += $(MAKEOPTS_arm64)
+endif
+
+ifeq ($(DEB_TARGET_ARCH),armhf)
+MAKEOPTS += $(MAKEOPTS_armhf)
+endif
+
+KERNEL_MAKEOPTS := \
+	CROSS_COMPILE=aarch64-linux-gnu- \
+	KERNEL_DIR=/usr/src/linux-headers-4.14.98-imx
+
+%:
+	dh $@
+
+override_dh_strip:
+override_dh_shlibdeps:
+	true
+
+override_dh_auto_build:
+	# We're building and installing in one run, and we can't use debian/tmp as
+	# that's cleaned between dh_auto_build and dh_auto_install. So we build and
+	# install to debian/$(OUTDIR) where $(OUTDIR) can't be 'tmp'.
+	make -f Kbuild M=. $(MAKEOPTS) $(KERNEL_MAKEOPTS) install
+
+override_dh_auto_install:
+	install -d $(DESTDIR)/lib/modules/4.14.98-imx/kernel/extra
+	install -g 0 -o 0 debian/$(OUTDIR)/drivers/galcore.ko $(DESTDIR)/lib/modules/4.14.98-imx/kernel/extra/
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..d3827e7
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+1.0