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=-0.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 B97ADC4346E for ; Thu, 24 Sep 2020 15:30:29 +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 117802311A for ; Thu, 24 Sep 2020 15:30:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NkTjLaSf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 117802311A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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.94) (envelope-from ) id 1kLTBz-00012f-3O; Thu, 24 Sep 2020 11:29:55 -0400 Received: from mail-ua1-x92b.google.com ([2607:f8b0:4864:20::92b]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kLTBw-00012a-Sg for kernelnewbies@kernelnewbies.org; Thu, 24 Sep 2020 11:29:52 -0400 Received: by mail-ua1-x92b.google.com with SMTP id u48so1137778uau.0 for ; Thu, 24 Sep 2020 08:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=QvwS9NVoSKT85lBkHhwuJV44Wv8aRtMJ/ARSM1noUQ4=; b=NkTjLaSfLY/iDl15LaOs2qRI8XHFCinHLXDZ8gLnCbUXcdcY5vxA8ZAVDFhoBISoSh ZypDjYBkraVz8dekCdeSL2bJTYHPXjMyvYbp2UADCvC0LEDqfTDI3dIZWsXtclfbpTqu JFSikM1TyL5fScE3S1z9bL5tQNsqDgLO1JNxisBgCP+IMm7ZoDGe7r0empN6PnmFLv4H Mdj2UZ8YwOUViLxY2f91dXbk16tm34+cX5GAWN9+eAeTBcManMSwFm7SVczKa5Edl7nl VTYTuN3FjWPVIYQwMuvIK21rtpeOl6cpo/8TFUV9KWsWpO/u7IFICro2hYY4oVXCcaHM 5zxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QvwS9NVoSKT85lBkHhwuJV44Wv8aRtMJ/ARSM1noUQ4=; b=TG6AmaxcuhZ3ihZZVImYWwLqOdWH6a+QEj+pZjbc9xm9KwzA2t7bPVb2kGT/zENX1Y aeKwfPGty1MKm2dwdzZubD3gq5dwE0VeggBar+Ad4PnWkRpPOmpY422+7XUl1k0wLdVU 9BkbWMtUW3lcHrMazphmLdF3QeNQxApJinl89MO2veEHlvcV6FANCKomwlMX4pKrzFTQ Cj2WbN2if/vuDR2+Z6MVF5fJFOoelzzauXVi4VgDj4uAyGzPpFHslGOqnvh7ZsU4pAYr Tn5fHif6myoJr5e0ohxsD6BPBFdyqGGXyqFSsSgBvgFMNSsO74JeqnIEmI1hVjf/CFQC g2zQ== X-Gm-Message-State: AOAM532VOep7umDNC4VfKwWxdhmTe9GZCrxTWHkrPKO4RxzUNHhPDZSJ v9SFPANAbKgkzXWz1zgNHWKeGF/wQwUKeKEj4JkH2pawfrJoUQ== X-Google-Smtp-Source: ABdhPJzgHsjOjWGGlBbinxwPpiqEZpQ3zoAFpsGWZwhN8Z0t3dAgd6KXtmBIYWOt1UlNiTNiYMT0+hLgH4hTqpcMGrM= X-Received: by 2002:ab0:1d99:: with SMTP id l25mr424904uak.56.1600961330015; Thu, 24 Sep 2020 08:28:50 -0700 (PDT) MIME-Version: 1.0 From: Grzegorz Heldt Date: Thu, 24 Sep 2020 17:28:38 +0200 Message-ID: Subject: Using FPGA subsystem to upload bit-stream using altera-ps-spi. To: kernelnewbies@kernelnewbies.org 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-Type: multipart/mixed; boundary="===============3357778156976078401==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============3357778156976078401== Content-Type: multipart/alternative; boundary="0000000000005ff42705b010db19" --0000000000005ff42705b010db19 Content-Type: text/plain; charset="UTF-8" Hello. I'm looking for suggestion of correct way of FPGA programming in my system. This is an am335x based board, yocto based with kernel 4.19. It has FPGA connected through "altera passive serial". There exists a specific kernel module especially made for such scenario, and I was able to include its configuration in device-tree. >From what I was able to find, there are three ways of programming FPGA using FPGA subsystem. 1. I should be able to see /sys/class/fpga_manager/fpga0/firmware or /sys/class/fpga_manager/fpga0/fpga files, which I can use to upload bitstream to fpga. The problem is that I can't see those files. Both altera-ps-spi and fpga-manager drivers do not report any errors, but the result is that I can see some files /sys/class/fpga_manager/fpga0, but no "firmware" or "fpga" files exist. "cat state" result is "unknown". At this point I have no idea how to go further. 2. I can use DT overlays that can disable device drivers already provided by FPGA, do programming, and rediscover drivers provided by FPGA. At the moment I don't see the need for such features in this system, but the approach looks sexy. In my system I can see configfs mounted at /sys/kernel/config. However, based on information that I was able to find, I should see or create /sys/kernel/config/device-tree/ directory. I can't see it and I can't create. Runtime DT overlays look extremely sexy to me, I have played with them on RPI. Very sad I don't know how to enable them on my system. 3. Using kernel API. I haven't tried yet, as I rather like to use methods that will required less possible maintenance in future. Can some suggest: - which of these three methods is most proper ? - how to go forward with way 1 or 2 ? Best Regards Greg. --0000000000005ff42705b010db19 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello.

I'm looking for suggestion o= f correct way of FPGA programming in my system.

Th= is is an am335x based board, yocto based with kernel=C2=A04.19. It has FPGA= connected through "altera passive serial".
There exist= s a specific kernel module especially made for such scenario, and I was abl= e to include its configuration in device-tree.

Fro= m what I was able to find, there are three ways of programming FPGA using F= PGA subsystem.
1. I should be able to see /sys/class/fpga_manager= /fpga0/firmware or=C2=A0/sys/class/fpga_manager/fpga0/fpga files, which I c= an use to upload bitstream to fpga.=C2=A0The problem is that I can't=C2= =A0see those files. Both altera-ps-spi and fpga-manager drivers do not repo= rt any errors, but the result is that I can=C2=A0see some files /sys/class/= fpga_manager/fpga0, but no "firmware" or "fpga" files e= xist. "cat state" result is "unknown". At this point I = have no idea how to go further.=C2=A0
=C2=A0
2. I c= an use DT overlays that can disable=C2=A0device drivers already provided by= FPGA, do programming, and rediscover drivers provided by FPGA. At the mome= nt I don't see the need for such features in this system, but the appro= ach looks sexy. In my system I can see configfs mounted at /sys/kernel/conf= ig. However, based on information that I was able to find, I should see or = create=C2=A0=C2=A0/sys/kernel/config/device-tree/ directory. I can't se= e it and I can't create. Runtime DT overlays look extremely=C2=A0sexy t= o me, I have played with them on RPI. Very sad I don't know how to enab= le them on my system.

3. Using kernel API. I haven= 't tried yet, as I rather like to use methods that will required less p= ossible maintenance in future.

Can some suggest:
- which of these three methods is most proper ?
- how to= go forward with way 1 or 2 ?

Best Regards
Greg.

--0000000000005ff42705b010db19-- --===============3357778156976078401== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============3357778156976078401==--