From owner-freebsd-arm@FreeBSD.ORG Wed Feb 20 14:15:52 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1382859B for ; Wed, 20 Feb 2013 14:15:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-x234.google.com (ie-in-x0234.1e100.net [IPv6:2607:f8b0:4001:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id DB4A370A for ; Wed, 20 Feb 2013 14:15:51 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id bn7so9743245ieb.39 for ; Wed, 20 Feb 2013 06:15:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=O8Jeiq/iupp3/DNz14CvZFGlsEnTE3MXGh9GIdzcqD4=; b=GB1shHKeOhIF+R2lHzqKDBNQaf/pyCgWuKi2bQ5vL11/axDpUYSQF7UcLn1aBNX0LJ pAGBsUAGCMyzCoPiHR76xsl/F2vJ7kjFqPCPP7ShO9iV8V3SSvhOQPWmYnnCCsuFnQy8 lISOt9OLlnf2Cl+2wOWsR7gxkZgGFGKTRfAxUIyMgwS8OQgZxDYpuSZ6dRCYRPAROdf5 RYzh2rX6XsUv1S0abtgMBhTbVhf648K8K1WZx3PEBkFH8jEtgpLaB2E9MQTiZOKZWWYW E5LB1mT1PvNNs2dgRFXR+EP0zoXzESg2FOYiwUPEMhSuCU72gWfB86ZxNuzB/Hn3yzBH eNpg== X-Received: by 10.43.8.200 with SMTP id ot8mr9298733icb.11.1361369751261; Wed, 20 Feb 2013 06:15:51 -0800 (PST) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id wv1sm13816863igb.0.2013.02.20.06.15.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 06:15:50 -0800 (PST) Sender: Warner Losh Subject: Re: SPI, _sz fields in struct spi_command Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130220142140.f8e5a616c75d72e2519dbc69@freebsd.org> Date: Wed, 20 Feb 2013 07:15:47 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <54C08D8E-4C5F-49AF-BEE6-D78EC05D2A24@bsdimp.com> References: <20130220142140.f8e5a616c75d72e2519dbc69@freebsd.org> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQmHO2XbuFLZvs+bXJc4P9i0a7Jm77B8choifBEnCTgiK6FeGqMIiRQZAi43pHRGQczF4r7E Cc: freebsd-arm@freebsd.org, freebsd-mips@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2013 14:15:52 -0000 On Feb 20, 2013, at 5:21 AM, Aleksandr Rybalko wrote: > Hello ARM and MIPS hackers! >=20 > Sorry for cross-post, but we have supported SPI devices on both > platforms (and seems no others). >=20 > Anyone know any reasons to keep both TX and RX _sz fields with same > values? I wrote them to be separate for a reason.... I think I'd thought = there'd be cases when you'd want to throw away the results or transmit = garbage... I can't think of why right now... > sys/dev/flash/at45d.c > static int > at45d_get_mfg_info(device_t dev, uint8_t *resp) > { > ... > cmd.tx_cmd_sz =3D cmd.rx_cmd_sz =3D 5; > ... > } >=20 > or sys/dev/flash/mx25l.c > static int > mx25l_read(device_t dev, off_t offset, caddr_t data, off_t count) > { > ... > cmd.tx_cmd_sz =3D 5; > cmd.rx_cmd_sz =3D 5; > ... > } >=20 > That always require second but unused buffer or writable tx buffer. = And > not all controllers able to TX with RX same time. (at least rt305x > can't). So if nobody have any objections, I will update drivers (SPI > controllers and SPI attached devices) to set unused _sz field to zero. > IIRC, I will require help with AT91 controller update, at least with > testing. The AT91, I think, required a minimum size, which is why the at45d = driver set it I think.. I can't imagine an SPI controller that can't do both, because when you = write something with SPI, you usually have to read back the status at = the same time... Warner > Thanks. >=20 > WBW > --=20 > Aleksandr Rybalko > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to = "freebsd-mips-unsubscribe@freebsd.org"