Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3689303imu; Mon, 28 Jan 2019 09:06:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ejv0nhkOVNnlW9Ytz+VIkjKU6WhI5ONnV9tKz86KvuSC/ZJ6w/ahtLJivgXnGZTHf+M8b X-Received: by 2002:a62:5b44:: with SMTP id p65mr22376966pfb.47.1548695163360; Mon, 28 Jan 2019 09:06:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695163; cv=none; d=google.com; s=arc-20160816; b=j9QxBdYWnRz25MgZTfxn/MrCtEQzaHrAo9Ql1yZyIpJEvOaOk0uq5Dub0JYArGXELq iQkmV4TC7E4QksrVdSArLGm1dSGd3YvTWoeH8zaJ0mLq85EjPlbvlZ95tHX4CKPuexza T51GD8TmS2tUt9rILN7oslHrACN4AFZqY/0vRvQGdgSxqSKMFDdZW3EkRQ/mIihnYz+8 V3LJYkxQ/xcCWM7EYIewVrvc6qQW+jyYMWxbJuC8kuTe1UUfHyk4kGXk6Bf765ggg27g M77+tTOeKX5+kY20Lp+pfdXSecrZXn+OG4wNLGg/04/6AbNUllDcwKpM3Z3WoojcyYQF k4Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=rxGIEOknPcIjzPkhfQGdQEUCzYEDmz6NxBwhd+7iTxg=; b=yKKnWQCyZGJutIq0kaHkBc52hN/tIfcXuR2W6TnoBThXPIyaFz1HT4zYSbPoTrXac7 HmFHo0fASwpJqWMOWkguHVsfrsUUQE4Xne+EhVbTkU2D+8hbLKmWyygY7CRUIi157BCY zjDn1hKomLJnEiLhI4mlp4J3+a6PG5jVLUYkUePWKPP//nzJTJOdyYecJ1qEWaBojLqS NCHugnCgx3DwfHli6RMwZlcQTmL/QALKi0BB51ZULQ2v6oiFlQm24v6LH1IlkO4rNuVe qfJtVfljDxiB2XeQGiMPdKVBHFOEGTzjnBOuGZ0IxPtn/4rSwKCsYvZg+Gy7DD6d+Kxk e3OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hjb+GqeQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 203si9951194pgb.440.2019.01.28.09.05.45; Mon, 28 Jan 2019 09:06:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hjb+GqeQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387482AbfA1QNs (ORCPT + 99 others); Mon, 28 Jan 2019 11:13:48 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38018 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731477AbfA1QNq (ORCPT ); Mon, 28 Jan 2019 11:13:46 -0500 Received: by mail-wm1-f68.google.com with SMTP id m22so14599220wml.3; Mon, 28 Jan 2019 08:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=rxGIEOknPcIjzPkhfQGdQEUCzYEDmz6NxBwhd+7iTxg=; b=hjb+GqeQ0nKVYZZ20+EC1gArRGp2v7kwSVXbFjaj+Xi25lIpVWRvAZw6frB6KXMWd4 auLte6qS+WTWa8ejnrWavK5wzdXBjk4mgpm2OVOXU6KrbnxdFu6bgGHlqcmwPnvQx/30 XgLwM5TyFRDv2JEHFxICa1Q13mKObEvTOEZBoObSa/es8e6w2vjlTgpfocsPmjHweDLD aUQ8qraQ/Yr2tZSdzY5/cyrK1RQtoXBE1Bv0SOa6vpkSf0VCPVkVIyOpb36VH0nR2p4K GYhIrDmmCdegAoCVAhcHuApWq573Jp7+E/w1tDZVE8pWRUmvZGLnJUH0AsPv+aD2V2VR L3dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=rxGIEOknPcIjzPkhfQGdQEUCzYEDmz6NxBwhd+7iTxg=; b=ddS347Lw4e1GsW6DLTehGcX1DC0Nz3ng9EfZxB7+/jb9LBiACik1PvM5PVPAqx1Jnx tHO58PlmywxNBoEkzdAQw7KSebfdN5AJ44WLu2e6j5tTd40FeOEdMaYJuGDApIdUG0ut xP5pMaWdda07YrwT3ZN7Pmd29vYhCqzNXjzWGmApyxSmpuT/WcE6A3iir/ivnIkx1Iy4 jD9YJ+4TBcLOZwt/BS1oYqoQEVFDlkOvlI3whB+j/5XC60g3/n9xmI7ScyDYBTcpqyon 92fgDdF/xTjGIU5Hm6IXuyNNdcxdKaORRTJ+TtOd/yAogQjxqU9ygW26fFABUXRtADr7 aOXw== X-Gm-Message-State: AJcUukes/9p5LHjBzZG8PHko8iuxc1iv50Dw2Bj/5wslWUsZeWmfm8SE NLWiZDYGSBsbOiWTPjOfLBo= X-Received: by 2002:a1c:dc86:: with SMTP id t128mr18589508wmg.42.1548692024930; Mon, 28 Jan 2019 08:13:44 -0800 (PST) Received: from Sarah.corp.lairdtech.com ([109.174.151.67]) by smtp.gmail.com with ESMTPSA id l20sm246445944wrb.93.2019.01.28.08.13.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 08:13:44 -0800 (PST) From: Ben Whitten X-Google-Original-From: Ben Whitten To: afaerber@suse.de Cc: linux-lpwan@lists.infradead.org, Ben Whitten , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH lora-next 00/11] net: lora: Get SX130x to transmit lora packets Date: Mon, 28 Jan 2019 16:12:54 +0000 Message-Id: <20190128161306.27805-1-ben.whitten@lairdtech.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This series adds setup nessesary to transmit lora packets from the SX1301x, it builds on the comments on the RFC [1] to a point where the card is capable of sending out a LoRa modulated signal using transmission paramaters from the LORA socket address. As patches have been refactored and split up extensivly to bite sized chunks they do not include individual RFC -> v1, this is covered in this letter. The setup involves starting the firmware up inside the card by providing a LUT of its internal gain values calibrated against the card output. As this information is hardware specific it is added as a binding in the DT, with documentation to match. Binding patch is based off a commit of the basic documentation under review [2] Not captured here are commands to set this gain table for use in devices which do not use DT. As _stat_xmit cannot sleep we spin the tx function to a work queue so we can write to the SPI backed regmaps. As proposed [3] as one way of getting lora packet metadata to the driver is by using the socket address to encode spreading factor, coding rate, bandwidth etc. The corresponding translation is added on the driver side, populating the test transmission with real values and has been tested to show changing bandwidths. To perform testing a tx_test [4] was used to show changing parameters on a spectrum analyser. We also add patches to the defaults in the SX130x to fill in a TODO in our initialisation. Thanks, Ben Whitten [1] http://lists.infradead.org/pipermail/linux-lpwan/2018-December/000019.html [2] http://lists.infradead.org/pipermail/linux-lpwan/2019-January/000150.html [3] https://events.linuxfoundation.org/wp-content/uploads/2017/12/ELCE2018_LoRa_final_Andreas-Farber.pdf slide 16 [4] https://github.com/BWhitten/lora-modules/blob/master/tx_test.c RFC -> v1 * Split up commits to sensible order and logical block sizes. * Added DT binding for TX gain LUT. * Fixed spelling mistakes. * Converted metadata enums to suggested integers with suitable sizes. * Fixed out by 1 in test transmission population. CC: linux-lpwan@lists.infradead.org CC: netdev@vger.kernel.org CC: linux-kernel@vger.kernel.org Ben Whitten (11): dt-bindings: net: lora: sx130x: add power lut binding net: lora: sx130x: add loading of tx lut from DT net: lora: sx130x: add CHRS to volatile register list net: lora: sx130x: add helper function for writing to the SX130x MCU net: lora: sx130x: initialise AGC net: lora: sx130x: add detail to TODO in setup net: lora: sx130x: add work queue to tx path net: lora: sx130x: add test transmission net: lora: introduce lora socket addressing for metadata net: lora: sx130x: make use of lora address metadata in transmission net: lora: sx130x: add patch to register fields .../bindings/net/lora/semtech,sx130x.yaml | 13 + drivers/net/lora/sx130x.c | 521 +++++++++++++++++- drivers/net/lora/sx130x.h | 97 ++++ include/linux/lora/skb.h | 9 + include/uapi/linux/lora.h | 14 + net/lora/dgram.c | 45 ++ 6 files changed, 697 insertions(+), 2 deletions(-) -- 2.17.1