From owner-freebsd-arm@freebsd.org Tue Aug 1 06:19:35 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFBDFDB4496 for ; Tue, 1 Aug 2017 06:19:35 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 289106639F; Tue, 1 Aug 2017 06:19:34 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id a2e72557; Tue, 1 Aug 2017 08:19:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=4LPiJksDar3mu8ezNj30Mp+kOAw=; b=oIXevmEwVGqgvo2/Zlc2i+27UVKn RNPzQYCxTE47z9OeWeGdZxjf0T+ikbonqYq/sMqAJJWcfVQ23pi0i2/WAjQunGxV L1ffnQ4+1DvregQA+FBaUD/K2nsqkyKnzvhYBdI38tSXPrTNvW6jy/H0zkeaLVAR NGFhl4CmPtsAfvA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=PJej2NnmVxGm+OPXIAQmgkHf5qROhduUhvVZ9CIxwpldfvqpwRcpOtXL jHLk1prhC8+Uy0n3MoTSJunUVO2IKx7ahte5lCPg+xcasSZMVfQRL6lcaEZuXPVq 9RK3l+5lHNKrTayLWgIVIN+vg53QMs60/448nClxcqGexCo1DeM= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 972595b6 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Tue, 1 Aug 2017 08:19:24 +0200 (CEST) Date: Tue, 1 Aug 2017 08:19:21 +0200 From: Emmanuel Vadot To: Dustin Marquess Cc: Ian Lepore , freebsd-arm@freebsd.org Subject: Re: Allwinner GPIO IRQ? Message-Id: <20170801081921.0f9224bea088b8f58140ab9d@bidouilliste.com> In-Reply-To: References: <1501537511.90400.116.camel@freebsd.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.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.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2017 06:19:35 -0000 On Mon, 31 Jul 2017 17:22:11 -0500 Dustin Marquess wrote: > Ian, > > Thanks for the confirmation! I'm not exactly a kernel-level dev, so I > was just pretty much guessing and poking around :). > > Thanks! > -Dustin > As Ian said the controller driver doesn't support interrupts, this would be easy to add but I have too much stuff to do so if someone want to work on this I'll be very happy. > On Mon, Jul 31, 2017 at 4:45 PM, Ian Lepore wrote: > > On Mon, 2017-07-31 at 15:38 -0500, Dustin Marquess wrote: > >> I'm trying to setup gpiopps on my Pine A64. I managed to hack up the > >> device tree and that part seems to work, however I was getting: > >> > >> gpiopps0: Pin cannot be configured for the requested signal edge > >> > >> I noticed that sys/arm/allwinner/a10_gpio.c had: > >> > >> #define A10_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT > >> | \ > >> GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) > >> > >> So I changed that to: > >> > >> #define A10_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT > >> | \ > >> GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN | GPIO_INTR_MASK) > >> > >> That changed the error to: > >> > >> gpiopps0: Cannot allocate an IRQ for the GPIO > >> > >> And now I'm having problems finding a DEVMETHOD mapping for > >> bus_alloc_resource for the Allwinner gpios. Am I right in guessing > >> that this code simply doesn't exist yet? > >> > >> Thanks! > >> -Dustin > > > > It looks like you've got the right bottom line: aw gpio isn't ready to > > support interrupts yet. It's not because bus_alloc_resource is > > missing, it's because the code just doesn't support being an interrupt > > controller yet. The methods missing are these (from imx_gpio.c): > > > > DEVMETHOD(pic_disable_intr, gpio_pic_disable_intr), > > DEVMETHOD(pic_enable_intr, gpio_pic_enable_intr), > > DEVMETHOD(pic_map_intr, gpio_pic_map_intr), > > DEVMETHOD(pic_setup_intr, gpio_pic_setup_intr), > > DEVMETHOD(pic_teardown_intr, gpio_pic_teardown_intr), > > DEVMETHOD(pic_post_filter, gpio_pic_post_filter), > > DEVMETHOD(pic_post_ithread, gpio_pic_post_ithread), > > DEVMETHOD(pic_pre_ithread, gpio_pic_pre_ithread), > > > > From a quick glance at the docs, it looks like only 32 of the pins on > > allwinner can be configured as interrupt sources, but it doesn't look > > like our code is ready to do that at all (I don't see any pins in the > > padconf tables that have "irq" as one of their choices). Yes, not all pins can be interrupts sources. I've added for most of the padconf information on which pins can do it (see https://svnweb.freebsd.org/base/head/sys/arm/allwinner/a20/a20_padconf.c?revision=310117&view=markup#l104 for example). They are named eint like in the datasheet and linux (so a dts that would reference them on linux would work for us). > > -- Ian > > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" -- Emmanuel Vadot