From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B035EC2BA19 for ; Mon, 13 Apr 2020 09:13:35 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4EE3720737 for ; Mon, 13 Apr 2020 09:13:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rug-nl.20150623.gappssmtp.com header.i=@rug-nl.20150623.gappssmtp.com header.b="DW72T6Rk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EE3720737 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rug.nl Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1jNv9B-0005T9-Tn; Mon, 13 Apr 2020 05:12:53 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1jNv92-0005Sx-HS for kernelnewbies@kernelnewbies.org; Mon, 13 Apr 2020 05:12:44 -0400 Received: by mail-wm1-x343.google.com with SMTP id y24so9277208wma.4 for ; Mon, 13 Apr 2020 02:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rug-nl.20150623.gappssmtp.com; s=20150623; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=wAN6R5aHy33DFs9c1NfGQtIAS5uMz7DeIyn1mCnn3K8=; b=DW72T6RkLjBzKzuv5QvdhijftFSrLkhtIZwF1Lul2E2y4N/J6vHeAlSCkGmsUw3YcA YUh8dXoHhJ1QoAeOtS0RbHxMn3a1tU1v87zbBXfXrQRD8ITZQMwqKNQHn/YljH+v/YEu y10fvcPoXRx32sorqFxkEW6HT3i+Fgg/inSf2dv8O8Rn4YdXi4zF2HZ6+JjO6kO0At28 UQB3+9CVcE6vQe4diLUFFHRJS2+sD91BhcCHZUz9gP+tKFUIQuO3/QpN89FbVuoKzD4T mIeO06HJG/lMr+Sx0qoCQQOR7V50G5oieXRZMYq5o+ZHn7EFZ/p+RFD6R4sipNQ8A8sD kQkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=wAN6R5aHy33DFs9c1NfGQtIAS5uMz7DeIyn1mCnn3K8=; b=r8ngEQA4xjvFyPalS0gd/letZS7h6ZQlZ11HiVCwxpgM+XJNbE8fdfbWCpj5GGPawt 6chI3uRZnNojaxRLMBMvQGle9HjVkYUr0zXuv/41/recKOUyIl1uNbAOwYeJamk+4OLb WzfWzUvdpQbDTbx5zuM1U+wNYPK1T9zU4qD0O+oUJdC2r0HLfS3WhPitkhsQzuR3w7KB FzX4r2KnUsjMErM4jggelCdpvkISIj2bNNtpLAoLCtGOJdp2dMvwg7gNACYbfTzGcCqT ODC/+JinN63DAG/3UvmBxDKTg4aSmWV+wwI9WRfOXXInx+RHUH7Tew68aHejoyqUmNtF d0Sw== X-Gm-Message-State: AGi0PubVQsWnSQpG2qFxUwhFWotRcyvD1HfL1scyAIr6HH0kQk9+UpzO aBdGNY+ns0vmkbXdCmNt51dYIslQOFnAfw== X-Google-Smtp-Source: APiQypKcdVwjsDw/8oHvG6OBlHezDvOL1jQIHnH1NGImJDs7AfzF8QjgtmrI+8Wv+fxeWmdX4IpdpA== X-Received: by 2002:a1c:a4c2:: with SMTP id n185mr18633907wme.104.1586769100486; Mon, 13 Apr 2020 02:11:40 -0700 (PDT) Received: from ?IPv6:2001:1c01:420a:8c00:a9d3:daae:7410:cd43? (2001-1c01-420a-8c00-a9d3-daae-7410-cd43.cable.dynamic.v6.ziggo.nl. [2001:1c01:420a:8c00:a9d3:daae:7410:cd43]) by smtp.gmail.com with ESMTPSA id n4sm13599400wmi.20.2020.04.13.02.11.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Apr 2020 02:11:40 -0700 (PDT) From: "s.achterop@rug.nl" Subject: How to use enable the FIQ with the ARM timer on rpi zero in my driver? To: kernelnewbies@kernelnewbies.org Message-ID: <2746719d-8b3f-d08d-0f41-83ff00ff2734@rug.nl> Date: Mon, 13 Apr 2020 11:11:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 Content-Language: en-GB X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kernelnewbies-bounces@kernelnewbies.org Hello List, I am on a raspberry pi zero, chipset BCM2835, and try to use the ARM timer to get FIQ interrupts. I compiled the kernel from source to be able to create my out-of-tree module. Uname -a gives: Linux raspberrypi 4.19.108+ #1 PREEMPT Tue Mar 31 10:00:18 CEST 2020 armv6l GNU/Linux (i only set it to be a low-latency-kernel) I try to create an fiq interrupt in a number of ways, but nothing works. The driver I created can be found at https://github.com/SietseAchterop/Batradio/blob/master/batradio_module/fiqtest.c The ARM timer is configured by directly writing to the registers. It is running fine and sets it's interrupt bit at some point. So I assume that linux does not use the ARM timer in a base configuration. When using: ret = claim_fiq(&bat_fh); set_fiq_handler(&batradio_handler, &batradio_handler_end - &batradio_handler); set_fiq_regs(®s); enable_fiq(x); There are no fiq interrupts, i tried several values of x. My main question is, which irq number should I use. Note that I use pdev = platform_device_register_simple("batradio__", 0, NULL, 0); to register this platform device. I did find a complete example in https://bootlin.com/blog/fiq-handlers-in-the-arm-linux-kernel/ But there they used a device tree and got the fiq-irq number via the probe function argument. Maybe that is a way to get it working, but I don't know with compatible value to use. I also tried, instead of enable_fiq, to directly connect the ARM timer to FIQ by writing 0xC0, 0x80 + 0x40, to the FIQ Control register 0x20C. But then Linux freezes immediately, so that's probably the wrong way. What could I do to get FIQ interrupts working? Or where can I find which irq number to use in enable_fiq? Hopefully someone can point me in a direction. Thanks in advance, Sietse PS. I forced dwc_otg to not use fiq by adding the following to /boot/cmdline.txt dwc_otg.fiq_fsm_enable=0 dwc_otg.fiq_enable=0 dwc_otg.nak_holdoff=0 I also make it boot up with console, so no X stuff, and access via ssh. _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies