aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2017-11-22 16:50:52 +0100
committerChristian Gromm <christian.gromm@microchip.com>2017-11-23 15:24:38 +0100
commit04b63f89f1cb5af9c009d25dc42fc5fa1664d941 (patch)
tree044d8d3a3b842e4036687fc4326b6fab121196b4
parentd312c2fb6f0a00f3abb45e99d4085845715866c7 (diff)
recipes-platform: add MOST driver configuration
This patch adds the necessary files to have the MOST driver configured for UNICENS2 at system start up. Change-Id: I9a69192332d355a3f9d3df3771cd364771e8eb9a Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
-rw-r--r--recipes-config/unicens-config/files/unicens-config.service10
-rwxr-xr-xrecipes-config/unicens-config/files/unicens-config.sh159
-rw-r--r--recipes-config/unicens-config/unicens-config.bb29
-rwxr-xr-xrecipes-platform/packagegroups/packagegroup-agl-demo-platform.bb1
4 files changed, 199 insertions, 0 deletions
diff --git a/recipes-config/unicens-config/files/unicens-config.service b/recipes-config/unicens-config/files/unicens-config.service
new file mode 100644
index 000000000..24366cd8d
--- /dev/null
+++ b/recipes-config/unicens-config/files/unicens-config.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Driver configuration for Unicens2
+After=systemd-modules-load.service
+Requires=systemd-modules-load.service
+
+[Service]
+ExecStart=/usr/bin/unicens-config.sh
+
+[Install]
+WantedBy=default.target
diff --git a/recipes-config/unicens-config/files/unicens-config.sh b/recipes-config/unicens-config/files/unicens-config.sh
new file mode 100755
index 000000000..35b578130
--- /dev/null
+++ b/recipes-config/unicens-config/files/unicens-config.sh
@@ -0,0 +1,159 @@
+#!/bin/bash
+
+##########################################################################
+# NOTE: This script is intentended to be used with the MOST starter-kit[1]
+# in conjuction with the agl-service-unicens widget only. For other setups
+# this script and also the UNICENS config settings need to be adapted
+# accordingly.
+#
+# An optional approach to configure the driver is provided by the
+# default_conf.ko kernel module that can be found in
+# /lib/modules/`uname -r`/extra
+#
+#
+# [1]: The starter-kit consists of one Network Interface Controller and
+# three slim amplifier modules)
+##########################################################################
+
+
+##########################################
+# interface: mdev0
+# chip: Vantage
+# aim: cdev
+# name: inic-usb-crx
+echo rx > /sys/devices/virtual/most/mostcore/devices/mdev0/ep8f/set_direction 2>/dev/null
+echo control > /sys/devices/virtual/most/mostcore/devices/mdev0/ep8f/set_datatype 2>/dev/null
+echo 16 > /sys/devices/virtual/most/mostcore/devices/mdev0/ep8f/set_number_of_buffers 2>/dev/null
+echo 64 > /sys/devices/virtual/most/mostcore/devices/mdev0/ep8f/set_buffer_size 2>/dev/null
+
+echo mdev0:ep8f:inic-usb-crx > /sys/devices/virtual/most/mostcore/aims/cdev/add_link 2>/dev/null
+
+#aim: cdev
+#name: inic-usb-ctx
+echo tx > /sys/devices/virtual/most/mostcore/devices/mdev0/ep0f/set_direction 2>/dev/null
+echo control > /sys/devices/virtual/most/mostcore/devices/mdev0/ep0f/set_datatype 2>/dev/null
+echo 16 > /sys/devices/virtual/most/mostcore/devices/mdev0/ep0f/set_number_of_buffers 2>/dev/null
+echo 64 > /sys/devices/virtual/most/mostcore/devices/mdev0/ep0f/set_buffer_size 2>/dev/null
+
+echo mdev0:ep0f:inic-usb-ctx > /sys/devices/virtual/most/mostcore/aims/cdev/add_link 2>/dev/null
+
+##########################################
+# interface: mdev1
+#aim: networking
+#name: inic-usb-arx
+echo rx > /sys/devices/virtual/most/mostcore/devices/mdev1/ep8e/set_direction 2>/dev/null
+echo async > /sys/devices/virtual/most/mostcore/devices/mdev1/ep8e/set_datatype 2>/dev/null
+echo 20 > /sys/devices/virtual/most/mostcore/devices/mdev1/ep8e/set_number_of_buffers 2>/dev/null
+echo 1522 > /sys/devices/virtual/most/mostcore/devices/mdev1/ep8e/set_buffer_size 2>/dev/null
+
+echo mdev1:ep8e:inic-usb-arx > /sys/devices/virtual/most/mostcore/aims/networking/add_link 2>/dev/null
+#aim: networking
+#name: inic-usb-atx
+echo tx > /sys/devices/virtual/most/mostcore/devices/mdev1/ep0e/set_direction 2>/dev/null
+echo async > /sys/devices/virtual/most/mostcore/devices/mdev1/ep0e/set_datatype 2>/dev/null
+echo 20 > /sys/devices/virtual/most/mostcore/devices/mdev1/ep0e/set_number_of_buffers 2>/dev/null
+echo 1522 > /sys/devices/virtual/most/mostcore/devices/mdev1/ep0e/set_buffer_size 2>/dev/null
+
+echo mdev1:ep0e:inic-usb-atx > /sys/devices/virtual/most/mostcore/aims/networking/add_link 2>/dev/null
+###########################################
+## interface: mdev0
+## chip: Durango
+##aim: cdev
+##name: inic-usb-crx
+echo rx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep87/set_direction 2>/dev/null
+echo control > /sys/devices/virtual/most/mostcore/devices/mdev2/ep87/set_datatype 2>/dev/null
+echo 16 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep87/set_number_of_buffers 2>/dev/null
+echo 64 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep87/set_buffer_size 2>/dev/null
+
+echo mdev0:ep8f:inic-usb-crx > /sys/devices/virtual/most/mostcore/aims/cdev/add_link 2>/dev/null
+#aim: cdev
+#name: inic-usb-ctx
+echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep07/set_direction 2>/dev/null
+echo control > /sys/devices/virtual/most/mostcore/devices/mdev2/ep07/set_datatype 2>/dev/null
+echo 16 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep07/set_number_of_buffers 2>/dev/null
+echo 64 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep07/set_buffer_size 2>/dev/null
+
+echo mdev0:ep07:inic-usb-ctx > /sys/devices/virtual/most/mostcore/aims/cdev/add_link 2>/dev/null
+###########################################
+## interface: mdev0
+## aim: networking
+##name: inic-usb-arx
+echo rx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep86/set_direction 2>/dev/null
+echo async > /sys/devices/virtual/most/mostcore/devices/mdev2/ep86/set_datatype 2>/dev/null
+echo 20 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep86/set_number_of_buffers 2>/dev/null
+echo 1522 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep86/set_buffer_size 2>/dev/null
+
+echo mdev0:ep86:inic-usb-arx > /sys/devices/virtual/most/mostcore/aims/networking/add_link 2>/dev/null
+#aim: networking
+#name: inic-usb-atx
+echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep06/set_direction 2>/dev/null
+echo async > /sys/devices/virtual/most/mostcore/devices/mdev2/ep06/set_datatype 2>/dev/null
+echo 20 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep06/set_number_of_buffers 2>/dev/null
+echo 1522 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep06/set_buffer_size 2>/dev/null
+
+echo mdev0:ep06:inic-usb-atx > /sys/devices/virtual/most/mostcore/aims/networking/add_link 2>/dev/null
+
+##########################################
+# interface: mdev2
+#aim: sound
+#name: ep01-6ch.6x16
+echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_direction 2>/dev/null
+echo sync > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_datatype 2>/dev/null
+echo 16 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_number_of_buffers 2>/dev/null
+echo 1008 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_buffer_size 2>/dev/null
+echo 12 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_subbuffer_size 2>/dev/null
+echo 42 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_packets_per_xact 2>/dev/null
+
+echo mdev2:ep01:ep01-6ch.6x16 > /sys/devices/virtual/most/mostcore/aims/sound/add_link 2>/dev/null
+##aim: cdev
+##name: inic-usb-itx1
+echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep02/set_direction 2>/dev/null
+echo isoc > /sys/devices/virtual/most/mostcore/devices/mdev2/ep02/set_datatype 2>/dev/null
+echo 8 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep02/set_number_of_buffers 2>/dev/null
+echo 7520 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep02/set_buffer_size 2>/dev/null
+echo 188 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_subbuffer_size 2>/dev/null
+echo 2 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_packets_per_xact 2>/dev/null
+
+echo mdev2:ep02:inic-usb-itx1 > /sys/devices/virtual/most/mostcore/aims/cdev/add_link 2>/dev/null
+
+##aim: sound
+##name: ep02-2ch.2x16
+#echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep02/set_direction
+#echo sync > /sys/devices/virtual/most/mostcore/devices/mdev2/ep02/set_datatype
+#echo 4 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep02/set_number_of_buffers
+#echo 1024 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep02/set_buffer_size
+#echo 4 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_subbuffer_size
+#echo 128 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_packets_per_xact
+#
+#echo mdev2:ep02:ep02-2ch.2x16 > /sys/devices/virtual/most/mostcore/aims/sound/add_link
+##aim: sound
+##name: ep81-6ch.6x16
+#echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep81/set_direction
+#echo sync > /sys/devices/virtual/most/mostcore/devices/mdev2/ep81/set_datatype
+#echo 4 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep81/set_number_of_buffers
+#echo 1008 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep81/set_buffer_size
+#echo 12 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep81/set_subbuffer_size
+#echo 42 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep81/set_packets_per_xact
+#
+#echo mdev2:ep81:ep81-6ch.6x16 > /sys/devices/virtual/most/mostcore/aims/sound/add_link
+##aim: sound
+##name: ep82-6ch.6x16
+#echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep82/set_direction
+#echo sync > /sys/devices/virtual/most/mostcore/devices/mdev2/ep82/set_datatype
+#echo 4 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep82/set_number_of_buffers
+#echo 1008 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep81/set_buffer_size
+#echo 12 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep82/set_subbuffer_size
+#echo 42 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep82/set_packets_per_xact
+#
+#echo mdev2:ep82:ep82-6ch.6x16 > /sys/devices/virtual/most/mostcore/aims/sound/add_link
+##aim: sound
+##name: ep83-2ch.2x16
+#echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep83/set_direction
+#echo sync > /sys/devices/virtual/most/mostcore/devices/mdev2/ep83/set_datatype
+#echo 4 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep83/set_number_of_buffers
+#echo 1024 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep83/set_buffer_size
+#echo 4 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep83/set_subbuffer_size
+#echo 128 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep83/set_packets_per_xact
+#
+#echo mdev2:ep83:ep83-2ch.2x16 > /sys/devices/virtual/most/mostcore/aims/sound/add_link
+
diff --git a/recipes-config/unicens-config/unicens-config.bb b/recipes-config/unicens-config/unicens-config.bb
new file mode 100644
index 000000000..e8f5b78d9
--- /dev/null
+++ b/recipes-config/unicens-config/unicens-config.bb
@@ -0,0 +1,29 @@
+DESCRIPTION = "Configure MOST driver"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI = "\
+ file://unicens-config.service \
+ file://unicens-config.sh \
+"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "unicens-config.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "enable"
+
+do_configure () {
+}
+
+do_compile() {
+}
+
+do_install() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0755 ${WORKDIR}/unicens-config.service ${D}${systemd_system_unitdir}
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/unicens-config.sh ${D}${bindir}
+}
+
+FILES_${PN} += "${systemd_system_unitdir}"
diff --git a/recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb b/recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb
index e6359f456..4e3740553 100755
--- a/recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb
+++ b/recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb
@@ -31,6 +31,7 @@ MOST_DRIVERS_remove_porter = "most"
MOST_HVAC = " "
MOST_HVAC_append = " \
${MOST_DRIVERS} \
+ unicens-config \
"
# can-lin is a binary and only for porter :(