BigW Consortium Gitlab

Commit 0a75741c by David Clark

Merge remote-tracking branch 'origin/master'

parents 82174f7c b4b4d96b
......@@ -29,3 +29,9 @@
path = linux_kernel_modules/cp2130
url = https://github.com/mangOH/cp2130
branch = development
[submodule "apps/RedSensorToCloud"]
path = apps/RedSensorToCloud
url = https://github.com/mangOH/RedSensorToCloud
[submodule "apps/Heartbeat"]
path = apps/Heartbeat
url = https://github.com/mangOH/Heartbeat
# This makefile depends on targetDefs.* files in the Legato root folder. In order to facilitate the
# inclusion of these files, make needs to be invoked with a --include-dir=$LEGATO_ROOT parameter.
TARGET:=wp85
# Load default PA definitions from main Legato Makefile
$(shell grep 'export PA_DIR .*' $(LEGATO_ROOT)/Makefile > legatoDefs.mk)
$(shell grep 'export .*_PA_.* .*' $(LEGATO_ROOT)/Makefile >> legatoDefs.mk)
include legatoDefs.mk
# Default targets definitions from Framework
include targetDefs.$(TARGET)
.PHONY: all $(TARGET)
all: $(TARGET)
# The comment below is for Developer Studio integration. Do not remove it.
# DS_CLONE_ROOT(MANGOH_ROOT)
MANGOH_ROOT=$(shell pwd)
# The comment below is for Developer Studio integration. Do not remove it.
# DS_CUSTOM_OPTIONS(EXTRA_OPTS)
EXTRA_OPTS = -s "$(MANGOH_ROOT)/apps/GpioExpander/gpioExpanderService"
$(TARGET):
export MANGOH_ROOT=$(MANGOH_ROOT) && \
mksys \
$(MKSYS_FLAGS) \
-t $(TARGET) \
-i "$(LEGATO_ROOT)/interfaces/supervisor" \
-i "$(LEGATO_ROOT)/interfaces/positioning" \
-i "$(LEGATO_ROOT)/interfaces/airVantage" \
-i "$(LEGATO_ROOT)/interfaces/modemServices" \
-i "$(LEGATO_ROOT)/interfaces" \
-i "$(LEGATO_ROOT)/interfaces/atServices" \
-i "$(LEGATO_ROOT)/interfaces/wifi" \
-i "$(LEGATO_ROOT)/interfaces/secureStorage" \
-i "$(LEGATO_ROOT)/interfaces/logDaemon" \
-s "$(LEGATO_ROOT)/modules/WiFi/service" \
-s "$(LEGATO_ROOT)/components" \
-s "$(LEGATO_ROOT)/modules/WiFi/apps/tools/wifi" \
-s "$(LEGATO_ROOT)/apps/platformServices/airVantage" \
-s "$(LEGATO_ROOT)/apps/platformServices" \
-s "$(LEGATO_ROOT)/apps/tools" \
$(EXTRA_OPTS) \
-C -g -X -g -L -g \
mangOH_Green.sdef
#mangOH_Red.sdef
clean:
rm -rf /tmp/mkbuild_* _build_* *.update legatoDefs.mk
all:
$(info Bug LE-7663 prevents this Makefile from building a correct Legato system.)
$(info Once this bug is fixed in a stable version of Legato, the Makefile will)
$(info be restored. For now, build the mangOH system by executing the following)
$(info command from a Legato working copy:)
$(info make wp85 SDEF_TO_USE=$$MANGOH_ROOT/mangOH_Red.sdef MKSYS_FLAGS="-s $$MANGOH_ROOT/apps/GpioExpander/gpioExpanderService -s $$MANGOH_ROOT/apps/RedSensorToCloud")
$(info Note that you must first define MANGOH_ROOT. eg. export MANGOH_ROOT=~/mangOH)
exit 1
# MangOH
Base project containing apps playing with MangOH hardware
Base project containing apps and drivers for the mangOH hardware
## Setup
### Linux
Open a terminal and load Legato development environment
* `source ~/legato/packages/legato.sdk.latest/resources/configlegatoenv`
### Windows
Launch the **Legato Command Line** shortcut to load the Legato development environment
### Get the source code
Clone this repository and the submodules it requires
* `git clone --recursive git://github.com/mangOH/mangOH`
### Build
Build the mangOH Legato system
* `make --include-dir=$LEGATO_ROOT wp85`
1. Download and install the appropriate toolchain from [source.sierrawireless.com](https://source.sierrawireless.com/resources/legato/downloads/)
1. Get the Legato source code as described by the [Legato README](https://github.com/legatoproject/legato-af/blob/master/README.md)
1. Clone the mangOH source code by running `git clone --recursive git://github.com/mangOH/mangOH`
1. `cd` into the Legato working folder and run the following command to build a system for the mangOH Red: `make wp85 SDEF_TO_USE=$MANGOH_ROOT/mangOH_Red.sdef MKSYS_FLAGS="-s $MANGOH_ROOT/apps/GpioExpander/gpioExpanderService -s $MANGOH_ROOT/apps/RedSensorToCloud"`
1. Run `./bin/legs` to put the Legato tools into `$PATH`
1. Run `instlegato wp85 192.168.2.2` to install the system onto the mangOH connected via a USB cable to the CF3 USB port.
Subproject commit 78c752542592fb552bd8fc67b1f7673f8bab3938
Subproject commit 1df717d51f6d2f25a62b57f1b6b7abbdfb4e5319
Subproject commit b7412dcb3589b441426e32c1fc5d12bda6283c9d
Subproject commit 84a92c33c6cb1cc73f42799a806fd4223023178d
Subproject commit 6966f104db935ff771dcce229647255f0bb01fa2
Subproject commit 60da5e1c03b694ce9b45ccd61f67a4bfa3f0fee2
Subproject commit 29c01ea6f23f4b46d9dd735a87c53eed043c310a
Subproject commit 7f669131d16ce30e05ef8406651a7a0965a6b8a4
cflags:
{
-DCONFIG_BMI160
-DCONFIG_BMI160_I2C
-DCONFIG_IIO
-DCONFIG_IIO_BUFFER
-DCONFIG_IIO_TRIGGERED_BUFFER
// TODO: I don't think REGMAP is buildable as a module so our kernel will need to change.
-DREGMAP
-DREGMAP_I2C
}
sources:
{
bmi160_i2c.c
}
Subproject commit 9b663f844d0c39a8acb33ab305f2ed7e4ca0a49a
Subproject commit 3f6ec22ecdcfe42a4582c55321a5b8d8d90cbb2f
cflags:
{
-DCONFIG_IIO
-DCONFIG_IIO_BUFFER
-DCONFIG_IIO_TRIGGER
-DCONFIG_IIO_KFIFO_BUF
-DCONFIG_IIO_TRIGGERED_BUFFER
}
sources:
{
// IIO_KFIFO_BUF
industrialio-triggered-buffer.c
}
IIO Kernel Module Definitions
=============================
The source for the IIO kernel modules is part of the standard Legato Linux
kernel source tree, but the module is not built by default. As a result, we
build this as an out of tree kernel module, but we don't want to version a copy
of the source files.
Instead, it is suggested to put a symlink to each of the sdef files in `[yocto
working copy]/kernel/drivers/iio/` and then refer to the mdef files in the sdef
using an environment variable. For example:
`${LEGATO_KERNELSRC}/drivers/iio/iio`.
The IIO modules are required by the BMP280 pressure sensor driver module.
The source for the IIO kernel modules comes from the standard Legato Linux kernel source tree. The
source is copied into this directory so that it isn't necessary to have the full kernel source code
in order to build the mangOH SDEF.
The kernel source in this folder was copied from the tag `SWI9X15Y_07.12.01.00`
/* The industrial I/O core function defs.
*
* Copyright (c) 2008 Jonathan Cameron
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* These definitions are meant for use only within the IIO core, not individual
* drivers.
*/
#ifndef _IIO_CORE_H_
#define _IIO_CORE_H_
#include <linux/kernel.h>
#include <linux/device.h>
struct iio_chan_spec;
struct iio_dev;
extern struct device_type iio_device_type;
int __iio_add_chan_devattr(const char *postfix,
struct iio_chan_spec const *chan,
ssize_t (*func)(struct device *dev,
struct device_attribute *attr,
char *buf),
ssize_t (*writefunc)(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t len),
u64 mask,
enum iio_shared_by shared_by,
struct device *dev,
struct list_head *attr_list);
void iio_free_chan_devattr_list(struct list_head *attr_list);
ssize_t iio_format_value(char *buf, unsigned int type, int val, int val2);
/* Event interface flags */
#define IIO_BUSY_BIT_POS 1
#ifdef CONFIG_IIO_BUFFER
struct poll_table_struct;
unsigned int iio_buffer_poll(struct file *filp,
struct poll_table_struct *wait);
ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,
size_t n, loff_t *f_ps);
#define iio_buffer_poll_addr (&iio_buffer_poll)
#define iio_buffer_read_first_n_outer_addr (&iio_buffer_read_first_n_outer)
void iio_disable_all_buffers(struct iio_dev *indio_dev);
void iio_buffer_wakeup_poll(struct iio_dev *indio_dev);
#else
#define iio_buffer_poll_addr NULL
#define iio_buffer_read_first_n_outer_addr NULL
static inline void iio_disable_all_buffers(struct iio_dev *indio_dev) {}
static inline void iio_buffer_wakeup_poll(struct iio_dev *indio_dev) {}
#endif
int iio_device_register_eventset(struct iio_dev *indio_dev);
void iio_device_unregister_eventset(struct iio_dev *indio_dev);
void iio_device_wakeup_eventset(struct iio_dev *indio_dev);
int iio_event_getfd(struct iio_dev *indio_dev);
#endif
/* The industrial I/O core, trigger consumer handling functions
*
* Copyright (c) 2008 Jonathan Cameron
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#ifdef CONFIG_IIO_TRIGGER
/**
* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
* @indio_dev: iio_dev associated with the device that will consume the trigger
**/
void iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
/**
* iio_device_unregister_trigger_consumer() - reverse the registration process
* @indio_dev: iio_dev associated with the device that consumed the trigger
**/
void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev);
#else
/**
* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
* @indio_dev: iio_dev associated with the device that will consume the trigger
**/
static int iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
{
return 0;
}
/**
* iio_device_unregister_trigger_consumer() - reverse the registration process
* @indio_dev: iio_dev associated with the device that consumed the trigger
**/
static void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
{
}
#endif /* CONFIG_TRIGGER_CONSUMER */
/*
* Copyright (c) 2012 Analog Devices, Inc.
* Author: Lars-Peter Clausen <lars@metafoo.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/module.h>
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include <linux/iio/kfifo_buf.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/iio/trigger_consumer.h>
static const struct iio_buffer_setup_ops iio_triggered_buffer_setup_ops = {
.postenable = &iio_triggered_buffer_postenable,
.predisable = &iio_triggered_buffer_predisable,
};
/**
* iio_triggered_buffer_setup() - Setup triggered buffer and pollfunc
* @indio_dev: IIO device structure
* @pollfunc_bh: Function which will be used as pollfunc bottom half
* @pollfunc_th: Function which will be used as pollfunc top half
* @setup_ops: Buffer setup functions to use for this device.
* If NULL the default setup functions for triggered
* buffers will be used.
*
* This function combines some common tasks which will normally be performed
* when setting up a triggered buffer. It will allocate the buffer and the
* pollfunc, as well as register the buffer with the IIO core.
*
* Before calling this function the indio_dev structure should already be
* completely initialized, but not yet registered. In practice this means that
* this function should be called right before iio_device_register().
*
* To free the resources allocated by this function call
* iio_triggered_buffer_cleanup().
*/
int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
irqreturn_t (*pollfunc_bh)(int irq, void *p),
irqreturn_t (*pollfunc_th)(int irq, void *p),
const struct iio_buffer_setup_ops *setup_ops)
{
struct iio_buffer *buffer;
int ret;
buffer = iio_kfifo_allocate(indio_dev);
if (!buffer) {
ret = -ENOMEM;
goto error_ret;
}
iio_device_attach_buffer(indio_dev, buffer);
indio_dev->pollfunc = iio_alloc_pollfunc(pollfunc_bh,
pollfunc_th,
IRQF_ONESHOT,
indio_dev,
"%s_consumer%d",
indio_dev->name,
indio_dev->id);
if (indio_dev->pollfunc == NULL) {
ret = -ENOMEM;
goto error_kfifo_free;
}
/* Ring buffer functions - here trigger setup related */
if (setup_ops)
indio_dev->setup_ops = setup_ops;
else
indio_dev->setup_ops = &iio_triggered_buffer_setup_ops;
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
ret = iio_buffer_register(indio_dev,
indio_dev->channels,
indio_dev->num_channels);
if (ret)
goto error_dealloc_pollfunc;
return 0;
error_dealloc_pollfunc:
iio_dealloc_pollfunc(indio_dev->pollfunc);
error_kfifo_free:
iio_kfifo_free(indio_dev->buffer);
error_ret:
return ret;
}
EXPORT_SYMBOL(iio_triggered_buffer_setup);
/**
* iio_triggered_buffer_cleanup() - Free resources allocated by iio_triggered_buffer_setup()
* @indio_dev: IIO device structure
*/
void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev)
{
iio_buffer_unregister(indio_dev);
iio_dealloc_pollfunc(indio_dev->pollfunc);
iio_kfifo_free(indio_dev->buffer);
}
EXPORT_SYMBOL(iio_triggered_buffer_cleanup);
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
MODULE_DESCRIPTION("IIO helper functions for setting up triggered buffers");
MODULE_LICENSE("GPL");
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/workqueue.h>
#include <linux/kfifo.h>
#include <linux/mutex.h>
#include <linux/iio/kfifo_buf.h>
#include <linux/sched.h>
#include <linux/poll.h>
struct iio_kfifo {
struct iio_buffer buffer;
struct kfifo kf;
struct mutex user_lock;
int update_needed;
};
#define iio_to_kfifo(r) container_of(r, struct iio_kfifo, buffer)
static inline int __iio_allocate_kfifo(struct iio_kfifo *buf,
int bytes_per_datum, int length)
{
if ((length == 0) || (bytes_per_datum == 0))
return -EINVAL;
return __kfifo_alloc((struct __kfifo *)&buf->kf, length,
bytes_per_datum, GFP_KERNEL);
}
static int iio_request_update_kfifo(struct iio_buffer *r)
{
int ret = 0;
struct iio_kfifo *buf = iio_to_kfifo(r);
mutex_lock(&buf->user_lock);
if (buf->update_needed) {
kfifo_free(&buf->kf);
ret = __iio_allocate_kfifo(buf, buf->buffer.bytes_per_datum,
buf->buffer.length);
buf->update_needed = false;
} else {
kfifo_reset_out(&buf->kf);
}
mutex_unlock(&buf->user_lock);
return ret;
}
static int iio_get_length_kfifo(struct iio_buffer *r)
{
return r->length;
}
static IIO_BUFFER_ENABLE_ATTR;
static IIO_BUFFER_LENGTH_ATTR;
static struct attribute *iio_kfifo_attributes[] = {
&dev_attr_length.attr,
&dev_attr_enable.attr,
NULL,
};
static struct attribute_group iio_kfifo_attribute_group = {
.attrs = iio_kfifo_attributes,
.name = "buffer",
};
static int iio_get_bytes_per_datum_kfifo(struct iio_buffer *r)
{
return r->bytes_per_datum;
}
static int iio_mark_update_needed_kfifo(struct iio_buffer *r)
{
struct iio_kfifo *kf = iio_to_kfifo(r);
kf->update_needed = true;
return 0;
}
static int iio_set_bytes_per_datum_kfifo(struct iio_buffer *r, size_t bpd)
{
if (r->bytes_per_datum != bpd) {
r->bytes_per_datum = bpd;
iio_mark_update_needed_kfifo(r);
}
return 0;
}
static int iio_set_length_kfifo(struct iio_buffer *r, int length)
{
/* Avoid an invalid state */
if (length < 2)
length = 2;
if (r->length != length) {
r->length = length;
iio_mark_update_needed_kfifo(r);
}
return 0;
}
static int iio_store_to_kfifo(struct iio_buffer *r,
const void *data)
{
int ret;
struct iio_kfifo *kf = iio_to_kfifo(r);
ret = kfifo_in(&kf->kf, data, 1);
if (ret != 1)
return -EBUSY;
wake_up_interruptible_poll(&r->pollq, POLLIN | POLLRDNORM);
return 0;
}
static int iio_read_first_n_kfifo(struct iio_buffer *r,
size_t n, char __user *buf)
{
int ret, copied;
struct iio_kfifo *kf = iio_to_kfifo(r);
if (mutex_lock_interruptible(&kf->user_lock))
return -ERESTARTSYS;
if (!kfifo_initialized(&kf->kf) || n < kfifo_esize(&kf->kf))
ret = -EINVAL;
else
ret = kfifo_to_user(&kf->kf, buf, n, &copied);
mutex_unlock(&kf->user_lock);
if (ret < 0)
return ret;
return copied;
}
static bool iio_kfifo_buf_data_available(struct iio_buffer *r)
{
struct iio_kfifo *kf = iio_to_kfifo(r);
bool empty;
mutex_lock(&kf->user_lock);
empty = kfifo_is_empty(&kf->kf);
mutex_unlock(&kf->user_lock);
return !empty;
}
static void iio_kfifo_buffer_release(struct iio_buffer *buffer)
{
struct iio_kfifo *kf = iio_to_kfifo(buffer);
mutex_destroy(&kf->user_lock);
kfifo_free(&kf->kf);
kfree(kf);
}
static const struct iio_buffer_access_funcs kfifo_access_funcs = {
.store_to = &iio_store_to_kfifo,
.read_first_n = &iio_read_first_n_kfifo,
.data_available = iio_kfifo_buf_data_available,
.request_update = &iio_request_update_kfifo,
.get_bytes_per_datum = &iio_get_bytes_per_datum_kfifo,
.set_bytes_per_datum = &iio_set_bytes_per_datum_kfifo,
.get_length = &iio_get_length_kfifo,
.set_length = &iio_set_length_kfifo,
.release = &iio_kfifo_buffer_release,
};
struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev)
{
struct iio_kfifo *kf;
kf = kzalloc(sizeof *kf, GFP_KERNEL);
if (!kf)
return NULL;
kf->update_needed = true;
iio_buffer_init(&kf->buffer);
kf->buffer.attrs = &iio_kfifo_attribute_group;
kf->buffer.access = &kfifo_access_funcs;
kf->buffer.length = 2;
mutex_init(&kf->user_lock);
return &kf->buffer;
}
EXPORT_SYMBOL(iio_kfifo_allocate);
void iio_kfifo_free(struct iio_buffer *r)
{
iio_buffer_put(r);
}
EXPORT_SYMBOL(iio_kfifo_free);
MODULE_LICENSE("GPL");
cflags:
{
// Needed for lsm6ds3 platform data type definition
-I${MANGOH_ROOT}/linux_kernel_modules/lsm6ds3
}
sources:
{
mangoh_module.c
board_green_dv4.c
board_red_dv2.c
board_red_dv3.c
}
params:
{
board = "green dv4"
}
cflags:
{
// Needed for lsm6ds3 platform data type definition
-I${MANGOH_ROOT}/linux_kernel_modules/lsm6ds3
}
sources:
{
mangoh_module.c
board_green_dv4.c
board_red_dv2.c
board_red_dv3.c
}
params:
{
board = "red dv2"
}
cflags:
{
// Needed for lsm6ds3 platform data type definition
-I${MANGOH_ROOT}/linux_kernel_modules/lsm6ds3
}
sources:
{
mangoh_module.c
board_green_dv4.c
board_red_dv2.c
board_red_dv3.c
}
params:
{
board = "red dv3"
}
#ifndef BOARD_GREEN_DV4_H
#define BOARD_GREEN_DV4_H
#include "mangoh.h"
extern const struct mangoh_descriptor green_dv4_descriptor;
int green_dv4_create_device(struct platform_device** d);
#endif // BOARD_GREEN_DV4_H
#define DEBUG
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/i2c/pca954x.h>
#include <linux/i2c/sx150x.h>
#include <linux/gpio.h>
#include "mangoh.h"
#include "lsm6ds3_platform_data.h"
/*
*-----------------------------------------------------------------------------
* Type definitions
*-----------------------------------------------------------------------------
*/
struct red_dv2_platform_data {
struct i2c_client* i2c_switch;
struct i2c_client* gpio_expander;
struct i2c_client* accelerometer;
struct i2c_client* pressure;
};
struct red_dv2_device
{
struct platform_device pdev;
struct red_dv2_platform_data pdata;
};
/*
*-----------------------------------------------------------------------------
* Function declarations
*-----------------------------------------------------------------------------
*/
static int red_dv2_map(struct platform_device *pdev);
static int red_dv2_unmap(struct platform_device* pdev);
static void red_dv2_release_device(struct device* dev);
/*
*-----------------------------------------------------------------------------
* Constants
*-----------------------------------------------------------------------------
*/
#define RED_DV2_I2C_SW_BASE_ADAPTER_ID (1)
#define RED_DV2_I2C_SW_PORT_IOT0 (0)
#define RED_DV2_I2C_SW_PORT_USB_HUB (1)
#define RED_DV2_I2C_SW_PORT_GPIO_EXPANDER (2)
#define RED_DV2_I2C_SW_PORT_EXP (3) /* expansion header */
/*
*-----------------------------------------------------------------------------
* Variables
*-----------------------------------------------------------------------------
*/
const struct mangoh_descriptor red_dv2_descriptor = {
.type = "mangoh red dv2",
.map = red_dv2_map,
.unmap = red_dv2_unmap,
};
static struct pca954x_platform_mode red_dv2_pca954x_adap_modes[] = {
{.adap_id=RED_DV2_I2C_SW_BASE_ADAPTER_ID + 0, .deselect_on_exit=1, .class=0},
{.adap_id=RED_DV2_I2C_SW_BASE_ADAPTER_ID + 1, .deselect_on_exit=1, .class=0},
{.adap_id=RED_DV2_I2C_SW_BASE_ADAPTER_ID + 2, .deselect_on_exit=1, .class=0},
{.adap_id=RED_DV2_I2C_SW_BASE_ADAPTER_ID + 3, .deselect_on_exit=1, .class=0},
};
static struct pca954x_platform_data red_dv2_pca954x_pdata = {
red_dv2_pca954x_adap_modes,
ARRAY_SIZE(red_dv2_pca954x_adap_modes),
};
static const struct i2c_board_info red_dv2_pca954x_device_info = {
I2C_BOARD_INFO("pca9546", 0x71),
.platform_data = &red_dv2_pca954x_pdata,
};
static struct sx150x_platform_data red_dv2_expander_platform_data = {
.gpio_base = -1,
.oscio_is_gpo = false,
.io_pullup_ena = 0,
.io_pulldn_ena = 0,
.io_open_drain_ena = 0,
.io_polarity = 0,
.irq_summary = -1,
.irq_base = -1,
};
static const struct i2c_board_info red_dv2_expander_devinfo = {
I2C_BOARD_INFO("sx1509q", 0x3e),
.platform_data = &red_dv2_expander_platform_data,
.irq = 0,
};
static struct lsm6ds3_platform_data red_dv2_accelerometer_platform_data = {
.drdy_int_pin = 1,
};
static struct i2c_board_info red_dv2_accelerometer_devinfo = {
I2C_BOARD_INFO("lsm6ds3", 0x6A),
.platform_data = &red_dv2_accelerometer_platform_data,
};
static struct i2c_board_info red_dv2_pressure_devinfo = {
I2C_BOARD_INFO("bmp280", 0x76),
};
static const char platform_device_name[] = "mangoh red dv2";
/*
*-----------------------------------------------------------------------------
* Public function definitions
*-----------------------------------------------------------------------------
*/
int red_dv2_create_device(struct platform_device** d)
{
struct red_dv2_device *dv2 = kzalloc(sizeof(struct red_dv2_device), GFP_KERNEL);
if (!dv2)
return -ENOMEM;
dv2->pdev.name = platform_device_name;
dv2->pdev.id = -1;
dv2->pdev.dev.platform_data = &dv2->pdata;
dv2->pdev.dev.release = red_dv2_release_device;
*d = &dv2->pdev;
return 0;
}
/*
*-----------------------------------------------------------------------------
* Static function definitions
*-----------------------------------------------------------------------------
*/
static int get_sx150x_gpio_base(struct i2c_client *client)
{
/*
* This is kind of a hack. It depends on the fact that we know
* that the clientdata of the gpio expander is a struct
* sx150x_chip (type is private to the sx150x driver) and
* knowing that the first element of that struct is a struct
* gpio_chip.
*/
struct gpio_chip *expander = i2c_get_clientdata(client);
return expander->base;
}
static int red_dv2_map(struct platform_device *pdev)
{
struct red_dv2_platform_data* pdata = dev_get_platdata(&pdev->dev);
/* Get the main i2c adapter */
struct i2c_adapter* adapter = i2c_get_adapter(0);
if (!adapter) {
dev_err(&pdev->dev, "Failed to get I2C adapter 0.\n");
return -ENODEV;
}
/* Map the I2C switch */
dev_dbg(&pdev->dev, "mapping i2c switch\n");
pdata->i2c_switch = i2c_new_device(adapter, &red_dv2_pca954x_device_info);
if (!pdata->i2c_switch) {
dev_err(
&pdev->dev,
"Failed to register %s\n",
red_dv2_pca954x_device_info.type);
return -ENODEV;
}
/* Map GPIO expander */
dev_dbg(&pdev->dev, "mapping gpio expander\n");
/*
* GPIOEXP_INT1 goes to GPIO32 on the CF3 inner ring which maps to
* GPIO30 in the WP85.
*/
red_dv2_expander_platform_data.irq_summary = gpio_to_irq(30);
/*
* Currently we just hard code an IRQ base that was tested to have a
* contiguous set of 16 available IRQs. TODO: Is there a better way to
* find a contiguous set of IRQs?
*/
red_dv2_expander_platform_data.irq_base = 347;
adapter = i2c_get_adapter(RED_DV2_I2C_SW_BASE_ADAPTER_ID +
RED_DV2_I2C_SW_PORT_GPIO_EXPANDER);
if (!adapter) {
dev_err(&pdev->dev, "No I2C bus %d.\n", RED_DV2_I2C_SW_PORT_GPIO_EXPANDER);
return -ENODEV;
}
pdata->gpio_expander = i2c_new_device(adapter, &red_dv2_expander_devinfo);
if (!pdata->gpio_expander) {
dev_err(&pdev->dev, "GPIO expander is missing\n");
return -ENODEV;
}
/* Map the I2C LSM6DS3 accelerometer */
dev_dbg(&pdev->dev, "mapping lsm6ds3 accelerometer\n");
/* Pin 12 of the gpio expander is connected to INT2 of the lsm6ds3 */
red_dv2_accelerometer_devinfo.irq =
gpio_to_irq(get_sx150x_gpio_base(pdata->gpio_expander) + 12);
adapter = i2c_get_adapter(0);
if (!adapter) {
dev_err(&pdev->dev, "No I2C bus %d.\n", RED_DV2_I2C_SW_BASE_ADAPTER_ID);
return -ENODEV;
}
pdata->accelerometer = i2c_new_device(adapter, &red_dv2_accelerometer_devinfo);
if (!pdata->accelerometer) {
dev_err(&pdev->dev, "Accelerometer is missing\n");
return -ENODEV;
}
/* Map the I2C BMP280 pressure sensor */
dev_dbg(&pdev->dev, "mapping bmp280 pressure sensor\n");
adapter = i2c_get_adapter(0);
if (!adapter) {
dev_err(&pdev->dev, "No I2C bus %d.\n", RED_DV2_I2C_SW_BASE_ADAPTER_ID);
return -ENODEV;
}
pdata->pressure = i2c_new_device(adapter, &red_dv2_pressure_devinfo);
if (!pdata->pressure) {
dev_err(&pdev->dev, "Pressure sensor is missing\n");
return -ENODEV;
}
/*
* TODO:
* Pressure Sensor: 0x76
* chip is bmp280 by Bosch which has a driver in the mainline kernel
* 3503 USB Hub: 0x08
* Looks like there is a driver in the wp85 kernel source at drivers/usb/misc/usb3503.c
* I'm not really sure what benefit is achieved through using this driver.
* Battery Gauge: 0x64
* chip is LTC29421 which is made by linear technologies (now Analog
* Devices). I haven't found a linux kernel driver.
* Buck & Battery Charger: 0x6B
* chip is BQ24296RGER
*/
return 0;
}
static int red_dv2_unmap(struct platform_device* pdev)
{
struct red_dv2_platform_data* pdata = dev_get_platdata(&pdev->dev);
i2c_unregister_device(pdata->pressure);
i2c_put_adapter(pdata->pressure->adapter);
i2c_unregister_device(pdata->accelerometer);
i2c_put_adapter(pdata->accelerometer->adapter);
i2c_unregister_device(pdata->gpio_expander);
i2c_put_adapter(pdata->gpio_expander->adapter);
i2c_unregister_device(pdata->i2c_switch);
i2c_put_adapter(pdata->i2c_switch->adapter);
return 0;
}
static void red_dv2_release_device(struct device* dev)
{
struct platform_device *pdev = container_of(dev, struct platform_device, dev);
struct red_dv2_device *dv2 = container_of(pdev, struct red_dv2_device, pdev);
kfree(dv2);
}
#ifndef BOARD_RED_DV2_H
#define BOARD_RED_DV2_H
#include "mangoh.h"
extern const struct mangoh_descriptor red_dv2_descriptor;
int red_dv2_create_device(struct platform_device** d);
#endif // BOARD_RED_DV2_H
#define DEBUG
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/i2c/pca954x.h>
#include <linux/i2c/sx150x.h>
#include <linux/gpio.h>
#include "mangoh.h"
#include "lsm6ds3_platform_data.h"
/*
*-----------------------------------------------------------------------------
* Type definitions
*-----------------------------------------------------------------------------
*/
struct red_dv3_platform_data {
struct i2c_client* i2c_switch;
struct i2c_client* gpio_expander;
struct i2c_client* accelerometer;
struct i2c_client* pressure;
};
struct red_dv3_device
{
struct platform_device pdev;
struct red_dv3_platform_data pdata;
};
/*
*-----------------------------------------------------------------------------
* Function declarations
*-----------------------------------------------------------------------------
*/
static int red_dv3_map(struct platform_device *pdev);
static int red_dv3_unmap(struct platform_device* pdev);
static void red_dv3_release_device(struct device* dev);
/*
*-----------------------------------------------------------------------------
* Constants
*-----------------------------------------------------------------------------
*/
#define RED_DV3_I2C_SW_BASE_ADAPTER_ID (1)
#define RED_DV3_I2C_SW_PORT_IOT0 (0)
#define RED_DV3_I2C_SW_PORT_USB_HUB (1)
#define RED_DV3_I2C_SW_PORT_GPIO_EXPANDER (2)
#define RED_DV3_I2C_SW_PORT_EXP (3) /* expansion header */
/*
*-----------------------------------------------------------------------------
* Variables
*-----------------------------------------------------------------------------
*/
const struct mangoh_descriptor red_dv3_descriptor = {
.type = "mangoh red dv3",
.map = red_dv3_map,
.unmap = red_dv3_unmap,
};
static struct pca954x_platform_mode red_dv3_pca954x_adap_modes[] = {
{.adap_id=RED_DV3_I2C_SW_BASE_ADAPTER_ID + 0, .deselect_on_exit=1, .class=0},
{.adap_id=RED_DV3_I2C_SW_BASE_ADAPTER_ID + 1, .deselect_on_exit=1, .class=0},
{.adap_id=RED_DV3_I2C_SW_BASE_ADAPTER_ID + 2, .deselect_on_exit=1, .class=0},
{.adap_id=RED_DV3_I2C_SW_BASE_ADAPTER_ID + 3, .deselect_on_exit=1, .class=0},
};
static struct pca954x_platform_data red_dv3_pca954x_pdata = {
red_dv3_pca954x_adap_modes,
ARRAY_SIZE(red_dv3_pca954x_adap_modes),
};
static const struct i2c_board_info red_dv3_pca954x_device_info = {
I2C_BOARD_INFO("pca9546", 0x71),
.platform_data = &red_dv3_pca954x_pdata,
};
static struct sx150x_platform_data red_dv3_expander_platform_data = {
.gpio_base = -1,
.oscio_is_gpo = false,
.io_pullup_ena = 0,
.io_pulldn_ena = 0,
.io_open_drain_ena = 0,
.io_polarity = 0,
.irq_summary = -1,
.irq_base = -1,
};
static const struct i2c_board_info red_dv3_expander_devinfo = {
I2C_BOARD_INFO("sx1509q", 0x3e),
.platform_data = &red_dv3_expander_platform_data,
.irq = 0,
};
static struct i2c_board_info red_dv3_accelerometer_devinfo = {
I2C_BOARD_INFO("bmi160", 0x68),
};
static struct i2c_board_info red_dv3_pressure_devinfo = {
I2C_BOARD_INFO("bmp280", 0x76),
};
static const char platform_device_name[] = "mangoh red dv3";
/*
*-----------------------------------------------------------------------------
* Public function definitions
*-----------------------------------------------------------------------------
*/
int red_dv3_create_device(struct platform_device** d)
{
struct red_dv3_device *dv3 = kzalloc(sizeof(struct red_dv3_device), GFP_KERNEL);
if (!dv3)
return -ENOMEM;
dv3->pdev.name = platform_device_name;
dv3->pdev.id = -1;
dv3->pdev.dev.platform_data = &dv3->pdata;
dv3->pdev.dev.release = red_dv3_release_device;
*d = &dv3->pdev;
return 0;
}
/*
*-----------------------------------------------------------------------------
* Static function definitions
*-----------------------------------------------------------------------------
*/
static int red_dv3_map(struct platform_device *pdev)
{
struct red_dv3_platform_data* pdata = dev_get_platdata(&pdev->dev);
/* Get the main i2c adapter */
struct i2c_adapter* adapter = i2c_get_adapter(0);
if (!adapter) {
dev_err(&pdev->dev, "Failed to get I2C adapter 0.\n");
return -ENODEV;
}
/* Map the I2C switch */
dev_dbg(&pdev->dev, "mapping i2c switch\n");
pdata->i2c_switch = i2c_new_device(adapter, &red_dv3_pca954x_device_info);
if (!pdata->i2c_switch) {
dev_err(
&pdev->dev,
"Failed to register %s\n",
red_dv3_pca954x_device_info.type);
return -ENODEV;
}
#if 0
/* Map GPIO expander */
dev_dbg(&pdev->dev, "mapping gpio expander\n");
/*
* GPIOEXP_INT1 goes to GPIO32 on the CF3 inner ring which maps to
* GPIO30 in the WP85.
*/
red_dv3_expander_platform_data.irq_summary = gpio_to_irq(30);
/*
* Currently we just hard code an IRQ base that was tested to have a
* contiguous set of 16 available IRQs. TODO: Is there a better way to
* find a contiguous set of IRQs?
*/
red_dv3_expander_platform_data.irq_base = 347;
adapter = i2c_get_adapter(RED_DV3_I2C_SW_BASE_ADAPTER_ID +
RED_DV3_I2C_SW_PORT_GPIO_EXPANDER);
if (!adapter) {
dev_err(&pdev->dev, "No I2C bus %d.\n",
RED_DV3_I2C_SW_BASE_ADAPTER_ID +
RED_DV3_I2C_SW_PORT_GPIO_EXPANDER);
return -ENODEV;
}
pdata->gpio_expander = i2c_new_device(adapter, &red_dv3_expander_devinfo);
if (!pdata->gpio_expander) {
dev_err(&pdev->dev, "GPIO expander is missing\n");
return -ENODEV;
}
#endif // GPIO expander not properly supported
/* Map the I2C BMI160 accelerometer */
dev_dbg(&pdev->dev, "mapping bmi160 accelerometer\n");
/*
* Pins 11 and 12 of the gpio expander are connected to bmi160's INT1
* and INT2 pins respectively. It does not appear that the bmi160 driver
* makes use of these interrupt pins.
*/
adapter = i2c_get_adapter(0);
if (!adapter) {
dev_err(&pdev->dev, "No I2C bus %d.\n", 0);
return -ENODEV;
}
pdata->accelerometer = i2c_new_device(adapter, &red_dv3_accelerometer_devinfo);
if (!pdata->accelerometer) {
dev_err(&pdev->dev, "Accelerometer is missing\n");
return -ENODEV;
}
/* Map the I2C BMP280 pressure sensor */
dev_dbg(&pdev->dev, "mapping bmp280 pressure sensor\n");
adapter = i2c_get_adapter(0);
if (!adapter) {
dev_err(&pdev->dev, "No I2C bus %d.\n", 0);
return -ENODEV;
}
pdata->pressure = i2c_new_device(adapter, &red_dv3_pressure_devinfo);
if (!pdata->pressure) {
dev_err(&pdev->dev, "Pressure sensor is missing\n");
return -ENODEV;
}
/*
* TODO:
* 3503 USB Hub: 0x08
* Looks like there is a driver in the wp85 kernel source at drivers/usb/misc/usb3503.c
* I'm not really sure what benefit is achieved through using this driver.
* Battery Gauge: 0x64
* chip is LTC29421 which is made by linear technologies (now Analog
* Devices). I haven't found a linux kernel driver.
* Buck & Battery Charger: 0x6B
* chip is BQ24296RGER
*/
return 0;
}
static int red_dv3_unmap(struct platform_device* pdev)
{
struct red_dv3_platform_data* pdata = dev_get_platdata(&pdev->dev);
i2c_unregister_device(pdata->pressure);
i2c_put_adapter(pdata->pressure->adapter);
i2c_unregister_device(pdata->accelerometer);
i2c_put_adapter(pdata->accelerometer->adapter);
#if 0
i2c_unregister_device(pdata->gpio_expander);
i2c_put_adapter(pdata->gpio_expander->adapter);
#endif // GPIO expander not properly supported
i2c_unregister_device(pdata->i2c_switch);
i2c_put_adapter(pdata->i2c_switch->adapter);
return 0;
}
static void red_dv3_release_device(struct device* dev)
{
struct platform_device *pdev = container_of(dev, struct platform_device, dev);
struct red_dv3_device *dv3 = container_of(pdev, struct red_dv3_device, pdev);
kfree(dv3);
}
#ifndef BOARD_RED_DV3_H
#define BOARD_RED_DV3_H
#include "mangoh.h"
extern const struct mangoh_descriptor red_dv3_descriptor;
int red_dv3_create_device(struct platform_device** d);
#endif // BOARD_RED_DV3_H
#ifndef MANGOH_H
#define MANGOH_H
int mangoh_find_contiguous_irqs(unsigned int num_required, unsigned long irq_flags);
struct mangoh_descriptor {
char* type; // TODO: why is this needed?
int (*map)(struct platform_device* pdev);
int (*unmap)(struct platform_device* pdev);
};
#endif // MANGOH_H
#define DEBUG
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <asm/irq.h>
#include "mangoh.h"
#include "board_green_dv4.h"
#include "board_red_dv2.h"
#include "board_red_dv3.h"
/*
*-----------------------------------------------------------------------------
* Type definitions
*-----------------------------------------------------------------------------
*/
/*
*-----------------------------------------------------------------------------
* Function declarations
*-----------------------------------------------------------------------------
*/
static int mangoh_probe(struct platform_device* pdev);
static int mangoh_remove(struct platform_device* pdev);
/*
*-----------------------------------------------------------------------------
* Variables
*-----------------------------------------------------------------------------
*/
/* Module parameter definitions */
static char *board = "green dv4";
module_param(board, charp, S_IRUGO);
MODULE_PARM_DESC(revision, "mangOH hardware board model and revision");
static struct platform_device* mangoh_device;
static const struct platform_device_id mangoh_ids[] = {
{.name="mangoh green dv4", .driver_data=(kernel_ulong_t)&green_dv4_descriptor},
{.name="mangoh red dv2", .driver_data=(kernel_ulong_t)&red_dv2_descriptor},
{.name="mangoh red dv3", .driver_data=(kernel_ulong_t)&red_dv3_descriptor},
{},
};
MODULE_DEVICE_TABLE(platform, mangoh_ids);
static struct platform_driver mangoh_driver = {
.probe = mangoh_probe,
.remove = mangoh_remove,
.driver = {
.name = "mangoh",
.owner = THIS_MODULE,
.bus = &platform_bus_type,
},
.id_table = mangoh_ids,
};
/*
*-----------------------------------------------------------------------------
* Function definitions
*-----------------------------------------------------------------------------
*/
static int __init mangoh_init(void)
{
printk(KERN_DEBUG "Called %s\n", __func__);
if (strcmp(board, "green dv4") == 0) {
int rc = green_dv4_create_device(&mangoh_device);
printk(KERN_DEBUG "mangoh: created green_dv4 device\n");
if (rc != 0) {
pr_err(
"%s: Couldn't create device for '%s'.\n",
__func__,
board);
return rc;
}
} else if (strcmp(board, "red dv2") == 0) {
int rc = red_dv2_create_device(&mangoh_device);
if (rc != 0) {
pr_err(
"%s: Couldn't create device for '%s'.\n",
__func__,
board);
return rc;
}
} else if (strcmp(board, "red dv3") == 0) {
int rc = red_dv3_create_device(&mangoh_device);
if (rc != 0) {
pr_err(
"%s: Couldn't create device for '%s'.\n",
__func__,
board);
return rc;
}
} else {
pr_err(
"%s: unsupported board '%s'.\n",
__func__,
board);
return -ENODEV;
}
platform_driver_register(&mangoh_driver);
printk(KERN_DEBUG "mangoh: registered platform driver\n");
if (platform_device_register(mangoh_device)) {
platform_driver_unregister(&mangoh_driver);
return -ENODEV;
}
printk(KERN_DEBUG "mangoh: registered platform device\n");
return 0;
}
static void __exit mangoh_exit(void)
{
printk(KERN_DEBUG "Called %s\n", __func__);
if (mangoh_device != NULL)
platform_device_unregister(mangoh_device);
platform_driver_unregister(&mangoh_driver);
}
static int mangoh_probe(struct platform_device* pdev)
{
struct mangoh_descriptor* desc =
(struct mangoh_descriptor*)
platform_get_device_id(pdev)->driver_data;
platform_set_drvdata(pdev, desc);
return desc->map(pdev);
}
static int mangoh_remove(struct platform_device* pdev)
{
struct mangoh_descriptor* desc = platform_get_drvdata(pdev);
const int res = desc->unmap(pdev);
dev_info(&pdev->dev, res ? "Removal failed.\n" : "Removed.\n");
return res;
}
module_init(mangoh_init);
module_exit(mangoh_exit);
MODULE_ALIAS(PLATFORM_MODULE_PREFIX "mangoh");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Sierra Wireless");
MODULE_DESCRIPTION("Add devices on mangOH green hardware board");
MODULE_VERSION("1.0");
//--------------------------------------------------------------------------------------------------
// MangOH system definition that includes essential modem and positioning services
// plus available MangOH apps
// mangOH Green system definition that extends the wifi sdef from Legato.
//
// Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
//--------------------------------------------------------------------------------------------------
buildVars:
{
LEGATO_WIFI_ROOT = $LEGATO_ROOT/modules/WiFi
LEGATO_WIFI_PA = ti
}
#include "$LEGATO_ROOT/modules/WiFi/wifi.sdef"
apps:
{
// Platform services.
$LEGATO_ROOT/apps/platformServices/airVantage/avcService
$LEGATO_ROOT/apps/platformServices/audioService
$LEGATO_ROOT/apps/platformServices/cellNetService
$LEGATO_ROOT/apps/platformServices/dataConnectionService
$LEGATO_ROOT/apps/platformServices/fwupdateService
$LEGATO_ROOT/apps/platformServices/modemService
$LEGATO_ROOT/apps/platformServices/positioningService
$LEGATO_ROOT/apps/platformServices/powerMgr
$LEGATO_ROOT/apps/platformServices/secStore
$LEGATO_ROOT/apps/platformServices/smsInboxService
$LEGATO_ROOT/apps/platformServices/voiceCallService
$LEGATO_ROOT/apps/platformServices/gpioService
$LEGATO_ROOT/apps/platformServices/atClient
$LEGATO_ROOT/apps/platformServices/atServer
$LEGATO_ROOT/apps/platformServices/spiService
$LEGATO_ROOT/apps/platformServices/devMode
$LEGATO_WIFI_ROOT/service/wifiService
$LEGATO_WIFI_ROOT/apps/sample/wifiClientTest/wifiClientTest
$LEGATO_WIFI_ROOT/apps/sample/wifiApTest/wifiApTest
$LEGATO_WIFI_ROOT/apps/sample/wifiWebAp/wifiWebAp
$LEGATO_WIFI_ROOT/apps/tools/wifi/wifi
$MANGOH_ROOT/apps/GpioExpander/gpioExpanderService/gpioExpanderServiceGreen
$MANGOH_ROOT/apps/MuxControl/muxCtrlService/muxCtrlService
$MANGOH_ROOT/apps/MuxControl/tools/muxCtrlTools
$MANGOH_ROOT/apps/MqttClient/mqttClient
$MANGOH_ROOT/apps/DataRouter/dataRouter
$MANGOH_ROOT/apps/DataRouter/drTool/drTool
$MANGOH_ROOT/apps/ArduinoBridge/arduinoBridge
// Data Router is disabled because the published version doesn't build against Legato 17.05
// $MANGOH_ROOT/apps/DataRouter/dataRouter
// $MANGOH_ROOT/apps/DataRouter/drTool/drTool
// $MANGOH_ROOT/apps/ArduinoBridge/arduinoBridge
$MANGOH_ROOT/apps/SocialService/socialService
// Command-line tools.
$LEGATO_ROOT/apps/tools/tools
$MANGOH_ROOT/apps/Heartbeat/heartbeatGreen
$LEGATO_ROOT/apps/tools/devMode
}
commands:
{
cm = tools:/bin/cm
fwupdate = tools:/bin/fwupdate
secstore = tools:/bin/secstore
pmtool = tools:/bin/pmtool
gnss = tools:/bin/gnss
uartMode = tools:/bin/uartMode
wifi = wifi:/bin/wifi
mux = muxCtrlTools:/bin/mux
dr = drTool:/bin/dr
// dr = drTool:/bin/dr
twitter = socialService:/bin/twitter
}
bindings:
kernelModules:
{
<root>.le_fwupdate -> fwupdateService.le_fwupdate
}
$MANGOH_ROOT/linux_kernel_modules/mangoh/9-mangoh_green_dv4
interfaceSearch:
{
interfaces/modemServices
interfaces/positioning
$MANGOH_ROOT/linux_kernel_modules/lsm6ds3/0-lsm6ds3
$MANGOH_ROOT/linux_kernel_modules/lsm6ds3/1-lsm6ds3-i2c
}
//--------------------------------------------------------------------------------------------------
// MangOH system definition that includes essential modem and positioning services
// plus available MangOH apps
// mangOH Red system definition that extends the wifi sdef from Legato.
//
// Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
//--------------------------------------------------------------------------------------------------
#include "$LEGATO_ROOT/legatoTargetConfig.sinc"
#include "$LEGATO_ROOT/apps/platformServices/defaultAirVantage.sinc"
#include "$LEGATO_ROOT/modules/WiFi/wifi.sdef"
apps:
{
// Platform services.
// $LEGATO_ROOT/apps/platformServices/airVantage/avcService
$LEGATO_ROOT/apps/platformServices/audioService
$LEGATO_ROOT/apps/platformServices/cellNetService
$LEGATO_ROOT/apps/platformServices/dataConnectionService
$LEGATO_ROOT/apps/platformServices/fwupdateService
$LEGATO_ROOT/apps/platformServices/modemService
$LEGATO_ROOT/apps/platformServices/positioningService
$LEGATO_ROOT/apps/platformServices/powerMgr
$LEGATO_ROOT/apps/platformServices/secStore
$LEGATO_ROOT/apps/platformServices/smsInboxService
$LEGATO_ROOT/apps/platformServices/voiceCallService
$LEGATO_ROOT/apps/platformServices/gpioService
// $LEGATO_ROOT/apps/platformServices/atClient
// $LEGATO_ROOT/apps/platformServices/atServer
$LEGATO_ROOT/apps/platformServices/spiService
$LEGATO_ROOT/apps/tools/devMode
$MANGOH_ROOT/apps/GpioExpander/gpioExpanderService/gpioExpanderServiceRed
// TODO: MuxControl was written specifically for mangOH Green. Perhaps mangOH Red needs a
// similar facility to manage uart routing.
// $MANGOH_ROOT/apps/MuxControl/muxCtrlService/muxCtrlService
// $MANGOH_ROOT/apps/MuxControl/tools/muxCtrlTools
$MANGOH_ROOT/apps/MqttClient/mqttClient
// $MANGOH_ROOT/apps/DataRouter/dataRouter
// $MANGOH_ROOT/apps/DataRouter/drTool/drTool
// Data Router is disabled because the published version doesn't build against Legato 17.05
// $MANGOH_ROOT/apps/DataRouter/dataRouter
// $MANGOH_ROOT/apps/DataRouter/drTool/drTool
$MANGOH_ROOT/apps/SocialService/socialService
// Command-line tools.
$LEGATO_ROOT/apps/tools/tools
}
$MANGOH_ROOT/apps/RedSensorToCloud/redSensorToCloud
$MANGOH_ROOT/apps/Heartbeat/heartbeatRed
kernelModules:
{
$MANGOH_ROOT/linux_kernel_modules/cp2130/spi-cp2130.mdef
$MANGOH_ROOT/linux_kernel_modules/spisvc/spisvc.mdef
$MANGOH_ROOT/linux_kernel_modules/mt7697wifi/mt7697wifi_core.mdef
$MANGOH_ROOT/linux_kernel_modules/mt7697q/mt7697q.mdef
$LEGATO_ROOT/apps/tools/devMode
}
buildVars:
commands:
{
LEGATO_KERNELROOT = /home/david/kernel
// dr = drTool:/bin/dr
twitter = socialService:/bin/twitter
}
commands:
kernelModules:
{
cm = tools:/bin/cm
fwupdate = tools:/bin/fwupdate
secstore = tools:/bin/secstore
pmtool = tools:/bin/pmtool
gnss = tools:/bin/gnss
uartMode = tools:/bin/uartMode
$MANGOH_ROOT/linux_kernel_modules/mangoh/9-mangoh_red_dv3
// $MANGOH_ROOT/linux_kernel_modules/mangoh/9-mangoh_red_dv2
// mux = muxCtrlTools:/bin/mux
$MANGOH_ROOT/linux_kernel_modules/cp2130/0-cp2130
// dr = drTool:/bin/dr
// Required for bmp280 & bmi160
$MANGOH_ROOT/linux_kernel_modules/iio/0-iio
$MANGOH_ROOT/linux_kernel_modules/iio/1-iio-kfifo-buf
// Required for bmi160
$MANGOH_ROOT/linux_kernel_modules/iio/2-iio-triggered-buffer
twitter = socialService:/bin/twitter
}
$MANGOH_ROOT/linux_kernel_modules/bmp280/2-bmp280
$MANGOH_ROOT/linux_kernel_modules/bmp280/3-bmp280-i2c
bindings:
{
<root>.le_fwupdate -> fwupdateService.le_fwupdate
}
// Only on mangOH Red DV2
// $MANGOH_ROOT/linux_kernel_modules/lsm6ds3/0-lsm6ds3
// $MANGOH_ROOT/linux_kernel_modules/lsm6ds3/1-lsm6ds3-i2c
interfaceSearch:
{
interfaces/modemServices
interfaces/positioning
// Only on mangOH Red DV3
$MANGOH_ROOT/linux_kernel_modules/bmi160/3-bmi160
$MANGOH_ROOT/linux_kernel_modules/bmi160/4-bmi160-i2c
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment