Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2219100ybi; Sun, 9 Jun 2019 06:34:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwONY2Oy3MXmxZqRgt+e9TF+PafFGb1Y06ELMrM6m+qZ2fLMJhD2bQlWWuuhFK52iUz5CUX X-Received: by 2002:a17:90a:258b:: with SMTP id k11mr15496096pje.110.1560087246987; Sun, 09 Jun 2019 06:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560087246; cv=none; d=google.com; s=arc-20160816; b=QA5T/Ys62uGP7NdD+5h/JScR/3Bm8HSYO7bFuSthWkpU4xhag1QHTeGYZbLLvmgp7j ngK5mpYXF956WYdPCl9OBPEZOB5lmZ7bVAEeCKzDr0RXoobZJVKIWWklqki6CQThBjrX dYiP4LWOOXdylsiekRILLnJjk9C+GvW+obaPXiB3qJkALiEV3lNQfGzivFn7opvtHr0j UAmAfGAtmOQ6Fpy9CL1LxcS0CP3le9EhReBEjsyGq2Znn3IEQ3kJNKue7azm888pxSlY qCFc46wU8B0hXzgJs8i15XOz0cpDEdkGraWjruN1O/liienPjnO2+SLGPwqR577WJsll vyQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NNU5NfcRwFmjSQDPSqcnbF989yjW4THtyaQsaHDsW3M=; b=qvv+ieAfPOQ7MiZqYReDCLiFKVNeglezTpBMh8zArlgscFLb/wDHgDp9I8pjIAheFl JpMdvtrec+xvRFp31U5SDVyG7llMxSd0cJxRGw7Scf2MJZfNIOFIRvSut/LmuHA/O2ry KqzE3lPqFl0APhNCfa0rHPsSWlCmdCAU+fcvAbe63wy9D+4jZyMrsnokTlTOJjA72RMV JBbOEMLSnwGk2JmyUHLkraKfGmt9JagXmeFkQzjT+dGJ+BfK33oWJYdbzIwV4h0hW6Kz Wnhc5GqFj0ZQUqxlPRU4NDwfgkPo35n3ht1Tr81bPgGrW2R8gdaAg88vLQZgQZgGDvyE oVoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mBHXJW4s; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (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 i97si7712838plb.50.2019.06.09.06.33.37; Sun, 09 Jun 2019 06:34:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mBHXJW4s; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728471AbfFIN3G (ORCPT + 99 others); Sun, 9 Jun 2019 09:29:06 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52714 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbfFIN3G (ORCPT ); Sun, 9 Jun 2019 09:29:06 -0400 Received: by mail-wm1-f65.google.com with SMTP id s3so6083657wms.2 for ; Sun, 09 Jun 2019 06:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NNU5NfcRwFmjSQDPSqcnbF989yjW4THtyaQsaHDsW3M=; b=mBHXJW4smXmT+jI8QIXE/LE2AQ50/owrxp2Mo6KfvXeoxHADAu1U0uOpDXZcpSEyJX ArPdKZNJo/zaNR4ai8hDeKPMOBMBBFDkV1r0/FRgO7LQmJTVVGlqOLEJDOSj9tDh/1tE oSw4QqVRG6D8SrdHlJCzUztQKDunii1spuclSEYGFvPjMY14MaWPc0TG+H61QU2YrtN8 /Vqk9AgU5YpYDCOdcQ4haDwZ2Vz+ZXGltaHP4fMKwiPNf+IvbIRTPnNf5CZXcLEF0Wzv n53AW+ceTRi7JKc+veyj5oCDt/aiscK/RqgJcjDYhQFi8Ywo4fLm8KMlNBAyVCStJkfR ed4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NNU5NfcRwFmjSQDPSqcnbF989yjW4THtyaQsaHDsW3M=; b=tSgWI179xNhQ3ZhI1NWyTcCAplVNMf/WrfwuwRlw4AEmZctft63bmsVxm2IUnUPulb +S+a7mTfPUbvlDoxW5HbvWi9nouX2U+Tx0MpMTFiDGZ5UhZVguVgADH5do+HQgBjTL5q Zut+yNrYA0gc27CF5NC+5bY8gfJ07X52MRzedhfsQ03bxCSzPSJXEol1xHtyRxUwQvpG QQsvUq/792l6Z7Fagn8FrYpsCVFI9cRBFLp3DVUsZv153iLKk0ftLuFzina2f2cqUKd7 RsL0bDJb2uS7Wcc55CleL/0B8JmlDAUq1Nq6X5Khyuwz0Os6//BVRGN/BXizD9gRR4Bd y7GA== X-Gm-Message-State: APjAAAUTd9ePnQVqiSWY51fmE4TBH7O1185u78eWQHJaLdL6/MbCshMX sEFyyIGiQlJGIysy/+D+TKQd7a0sgJK73khQWwM= X-Received: by 2002:a7b:cc81:: with SMTP id p1mr9707840wma.107.1560086944218; Sun, 09 Jun 2019 06:29:04 -0700 (PDT) MIME-Version: 1.0 References: <20190608144947.744-1-chunkeey@gmail.com> <20190608144947.744-2-chunkeey@gmail.com> In-Reply-To: <20190608144947.744-2-chunkeey@gmail.com> From: Julian Calaby Date: Sun, 9 Jun 2019 23:28:53 +1000 Message-ID: Subject: Re: [RFC PATCH v2] ath9k: add loader for AR92XX (and older) pci(e) To: Christian Lamparter Cc: QCA ath9k Development , linux-wireless@vger.kernel.org, Hauke Mehrtens , Martin Blumenstingl Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Christian, On Sun, Jun 9, 2019 at 12:49 AM Christian Lamparter wrote: > > Atheros cards with a AR92XX generation (and older) chip usually > store their pci(e) initialization vectors on an external eeprom chip. > However these chips technically don't need the eeprom chip attached, > the AR9280 Datasheet in section "6.1.2 DEVICE_ID" describes that > "... if the EEPROM content is not valid, a value of 0XFF1C returns > when read from the register". So the embedded devices like routers > and accesspoint usually have the pci(e) initialization vectors > stored on the system's FLASH, which is out of reach of the ath9k > chip. > > Furthermore, Some devices (like the Cisco Meraki Z1 Cloud Managed > Teleworker Gateway) need to be able to initialize the PCIe wifi device. > Normally, this should be done as a pci quirk during the early stages of > booting linux. However, this isn't possible for devices which have the > init code for the Atheros chip stored on NAND in an UBI volume. > Hence, this module can be used to initialize the chip when the > user-space is ready to extract the init code. > > Martin Blumenstingl prodived the following fixes: > owl-loader: add support for OWL emulation PCI devices > owl-loader: don't re-scan the bus when ath9k_pci_fixup failed > owl-loader: use dev_* instead of pr_* logging functions > owl-loader: auto-generate the eeprom filename as fallback > owl-loader: add a debug message when swapping the eeprom data > owl-loader: add missing newlines in log messages > > Signed-off-by: Christian Lamparter > Signed-off-by: Martin Blumenstingl > --- > v2: address Julian Calaby's comments: > - make it a separate driver again (much like OpenWrt) > - remove ar71xx leftovers (pdata) This looks sane to me. Thanks for splitting it out. Reviewed-by: Julian Calaby > --- > drivers/net/wireless/ath/ath9k/Kconfig | 16 ++ > drivers/net/wireless/ath/ath9k/Makefile | 2 + > .../wireless/ath/ath9k/ath9k_pci_owl_loader.c | 215 ++++++++++++++++++ > 3 files changed, 233 insertions(+) > create mode 100644 drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c > > diff --git a/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c > new file mode 100644 > index 000000000000..7ed495a9f1fe > --- /dev/null > +++ b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c > @@ -0,0 +1,215 @@ > +module_pci_driver(owl_driver); > +MODULE_AUTHOR("Christian Lamparter "); > +MODULE_DESCRIPTION("Initializes Atheros' Owl Emulation devices"); Tiniest nit: something like "External EEPROM data loader for Atheros AR500X to AR92XX" would make more sense to someone who isn't familiar with the hardware. Thanks, -- Julian Calaby Email: julian.calaby@gmail.com Profile: http://www.google.com/profiles/julian.calaby/