meta-ampere: mtjade: initialize GPIOs

Several GPIOs should be configured properly when booting BMC. Currently,
these GPIOs are configured in u-boot. However, some must be configured
in Linux. For example, the BMC_READY GPIO should be set only after BMC
is ready to work.
This commit introduce platform-init service which starts after BMC boots
to configure GPIOs pins required by hardware design.

Tested:
1. Do A/C power, check GPIO227 is set to 0.
2. Reboot BMC, check GPIO227 is set to 0.
3. Run gpioinfo and check GPIO directions

Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
Change-Id: Ie0cfe171659ad740c6a25297f2fcce259870d43d
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init.bb b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init.bb
new file mode 100644
index 0000000..aaeb33f
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Phosphor OpenBMC Mt.Jade Platform Init Service"
+DESCRIPTION = "Phosphor OpenBMC Mt.Jade Platform Init Daemon"
+
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit systemd
+inherit obmc-phosphor-systemd
+
+DEPENDS += "systemd"
+RDEPENDS:${PN} += "libsystemd"
+RDEPENDS:${PN} += "bash"
+
+SRC_URI = " \
+    file://ampere_platform_init.sh \
+    file://ampere-platform-init.service \
+    "
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE:${PN} = "ampere-platform-init.service"
+
+do_install () {
+    install -d ${D}${sbindir}
+    install -m 0755 ${WORKDIR}/ampere_platform_init.sh ${D}${sbindir}/
+    install -d ${D}${systemd_unitdir}/system/
+    install -m 0644 ${WORKDIR}/ampere-platform-init.service ${D}${systemd_unitdir}/system
+}