From owner-freebsd-arm@FreeBSD.ORG Wed Feb 20 12:21:22 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 76466328; Wed, 20 Feb 2013 12:21:22 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 3B3B1D95; Wed, 20 Feb 2013 12:21:22 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 7D4C3C493A; Wed, 20 Feb 2013 14:21:20 +0200 (EET) Date: Wed, 20 Feb 2013 14:21:40 +0200 From: Aleksandr Rybalko To: freebsd-arm@freebsd.org, freebsd-mips@freebsd.org Subject: SPI, _sz fields in struct spi_command Message-Id: <20130220142140.f8e5a616c75d72e2519dbc69@freebsd.org> X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 12:21:22 -0000 Hello ARM and MIPS hackers! Sorry for cross-post, but we have supported SPI devices on both platforms (and seems no others). Anyone know any reasons to keep both TX and RX _sz fields with same values? sys/dev/flash/at45d.c static int at45d_get_mfg_info(device_t dev, uint8_t *resp) { ... cmd.tx_cmd_sz = cmd.rx_cmd_sz = 5; ... } 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 = 5; cmd.rx_cmd_sz = 5; ... } 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. Thanks. WBW -- Aleksandr Rybalko