Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2499994pxb; Tue, 23 Feb 2021 08:28:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxE1Nnmuj0VxPu5+NrlLyJUpcwWAGFl2+KSnre5PpLSbZO/e+sBJS8+GpYxvUC+RNPiBTSw X-Received: by 2002:aa7:d34e:: with SMTP id m14mr29132723edr.223.1614097710873; Tue, 23 Feb 2021 08:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614097710; cv=none; d=google.com; s=arc-20160816; b=m1ax3Tc4eL/WcV9t3W9lR0bwDPP3K+VgdN2zSKWZFCTwzgcb/94iMTs/H2IJMjwqhv byx5NvqpzcWrOabUUajtIAckGg9oGwt/3K87lm9O/SVhyQtEnsfDGQjMMiF9jrmSwHCp /Yz7Kkye1D8ZZZDbuJrbo9JZ79pKu3yHxcoId7QKwv0zo0FA99QEMencXraUFXdrt3ao iYa0tw0kAe4jMiuSOz0dfM49xr2X1ycDtVz8zXMjHZ/XSBbxiG+JYbHEYh5uxmgeZTw/ QPX6dmEYRIRpXX8qaI5xw6zRKQbhJc0lTWtrk77x7FsfheaeO5uJYUX+iTsBeQXQBXtM QjhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:to:from:subject :message-id:dkim-signature; bh=axrZ+5f+Ljg2I1jFNtFrhR+FtsGgjoHDQe9rWTmrf5Y=; b=eS3zjO5VM5+Tn7PmHb24+kxc1hRUGcLWuG1MC+/Ps9jlePzMgDZyy0YHYxt0zfrTyl icdLTqi9r+wzh4uElsGoU6wOOoe8Movs+vJfqahbBO23BNrCBD0WLTVnzDrMYK7Gp/nW qjdP47Pokn32Xu7VQtG6zR1h8Kyv2oEHBBZnI4CmGiq1abwjbOs8mzilLzrlAM5PtUgp owVeRUPAZshs7ko4/EocM916FARY9HWKKBfXmpVv7eSPwtHqvnSPjCCpTn7SYCLlxzy8 A4SB5lkeiuyZuAljB2Ud/WTg+pgvI/qUayRtxz4lYifgO/9tz4glRf7x/zVnDlXzzzww Oa7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@egauge.net header.s=google header.b=ARscB98O; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=egauge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si7013477edm.297.2021.02.23.08.28.02; Tue, 23 Feb 2021 08:28:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@egauge.net header.s=google header.b=ARscB98O; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=egauge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233576AbhBWQXt (ORCPT + 99 others); Tue, 23 Feb 2021 11:23:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233312AbhBWQXr (ORCPT ); Tue, 23 Feb 2021 11:23:47 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 485D9C061574 for ; Tue, 23 Feb 2021 08:23:07 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id d15so9497022ioe.4 for ; Tue, 23 Feb 2021 08:23:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=egauge.net; s=google; h=message-id:subject:from:to:date:in-reply-to:references:organization :user-agent:mime-version:content-transfer-encoding; bh=axrZ+5f+Ljg2I1jFNtFrhR+FtsGgjoHDQe9rWTmrf5Y=; b=ARscB98O0s0zQKv3HJPWzzfIWf5TTjk06k7TirNbc52LlULLtncA2t67reVdYgpaKO 1ARQdEOl9pEgWnu1FwT4fcNGRgAz/3tvIaLMC3fFiUBS8Lf9IYZ9RbUV2IFxl7N+oLQx uG9LppQ68NA/cemuZtQeYtg8JMqffTmmVtesOHzl5r8xQLW8AJlTxtwgGyCYbsqObpWC IOEl/ILani6EgtjIogtyN4ohNkMsM/BCCQjy2nyrbU5H1n6Oqq0n+XN5Gu4dq976hJfT 5ZOWAFw1Nzcmuf9fcXSsC1ROYooidGACmJPxwa0j33sGPMJ3wFDrZc5CfZigRou7qLMU Eh5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=axrZ+5f+Ljg2I1jFNtFrhR+FtsGgjoHDQe9rWTmrf5Y=; b=Kcb2XTwwLUF1aceWDiw1a5FqvJrN4g1NJPCmGQxyB9WZd3BFwF7udylUwTLrRAUyhn Tgbsnud73HNLdu/VZNnAbqQowpgQjIDdYjVib6g8vw7xg0aKp/rUGgUWqq2QjBdpzKtw xOHiBOSFCp0p4m0tDjpPVwZifwQHlE3/eHm2Hzg3S1rnJwON3nds8CymiBVAfDh61Tle pOwu8vdzKE+Uh8dDdtALQIh0Rstfkg2SXyXlSLwa0sBnx84z0WU0vH+Q41dkdsQ36FVs B2Foeu0QwpvjxW44RsB/fMXsZIVCVqRQAaXlOd9luv4NWIIb4QT/RdPUXTIDBeDl7/uq I8bQ== X-Gm-Message-State: AOAM531zEe12yM2YBOWlHFVqtJRNVjzxguSfyQsBnBwZUN1YEo8YDkiK dhxdNIVgu17p15ZpKqE7uF1IeoP6AGxumCI= X-Received: by 2002:a5e:8a48:: with SMTP id o8mr12722704iom.89.1614097386545; Tue, 23 Feb 2021 08:23:06 -0800 (PST) Received: from ?IPv6:2601:281:8300:4e0:cc6b:9049:f16e:2f39? ([2601:281:8300:4e0:cc6b:9049:f16e:2f39]) by smtp.gmail.com with ESMTPSA id s9sm15462084ilt.77.2021.02.23.08.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 08:23:05 -0800 (PST) Message-ID: <5fc9c8ad5d93e2172f03515f8275851af285a895.camel@egauge.net> Subject: Re: wilc1000 driver From: David Mosberger-Tang To: Ajay.Kathat@microchip.com, linux-wireless@vger.kernel.org Date: Tue, 23 Feb 2021 09:23:04 -0700 In-Reply-To: References: Organization: eGauge Systems LLC Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org OK, the problem below is caused by wilc_set_power_mgmt(). If I change that function into a no-op, the driver actually works! Does this make any sense to you? From what I saw so far, it looks like relevant code is pretty much identical to the one in the linux-at91 tree and that one works fine. --david On Mon, 2021-02-22 at 18:49 -0700, David Mosberger-Tang wrote: > > Now the driver loads the firmware and generally seems to be happy. > However, as soon as a packet is received, things go awry. I'm seeing > this: > > WILC_SPI spi1.0 wlan0: ChipID [1003a0] loading firmware > [atmel/wilc1000_wifi_firmware-1.bin] > WILC_SPI spi1.0: Failed cmd response, cmd (ca), resp (09) > > On the SPI bus, I see these commands: > > MOSI: 0xC8 0x00 0x00 0x00 0x00 0x00 0x38 (DMA_EXT_READ addr 0 size 56) > MISO: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xC8 0x88 (command response) > ----- > MOSI: 0x00 > MISO: 0xF3 (DATA header, last packet in this transaction) > ----- > MOSI: 0x00*56 > MISO: xx*56 (56 data bytes that may be a legitimate packet) > > So far so good. I don't know if this matters, but the last 8 bytes of > data all contain 0x09. > > The problem from then on is that no matter what command is sent, the > chip always returns only 0x09 bytes. For example, the first command > after the DMA read is: > > MOSI: 0xca 0x00 0x10 0x6c (SINGLE_READ) > > but the MISO line only returns 0x09, hence the above "Failed cmd > response" error. > > It's as if the chip wants to send much more than 56 data bytes. The > byte-order for the DMA size matches that of the working driver though, > so maybe that's not it.