• Re: Raspberry Pi: gpiomem device support

    From =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?=@21:1/5 to Thomas Lehmann on Sat Apr 6 09:51:46 2024
    To: debian-arm@lists.debian.org (Debian ARM Mailinglist)

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------nvJIQgWdfcL0tulCNmzp0ZxM
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64

    SGVsbG8gVGhvbWFzLA0KDQpPbiAwMy4wNC4yNCAyMTo0OSwgVGhvbWFzIExlaG1hbm4gd3Jv dGU6DQo+IEkgZm9yZ290IHRvIGluY2x1ZGUgdGhlIHJlZmVyZW5jZXM6DQo+IA0KPiBbMV06 IGh0dHBzOi8vcmFzcGkuZGViaWFuLm5ldC90ZXN0ZWQtaW1hZ2VzLw0KPiBbMl06IGh0dHBz Oi8vZ2l0aHViLmNvbS9yYXNwYmVycnlwaS9saW51eC9pc3N1ZXMvMjUxNA0KPiANCj4gQWgs IGFuZCBJIGZvdW5kIEtlcm5lbCBjb2RlIGluIGRyaXZlcnMvY2hhci9yYXNwYmVycnlwaS1n cGlvbWVtLmMgYW5kIA0KPiB0aGUgYWNjb21wYW55aW5nIEtjb25maWcgZGVmaW5pbmcgdGhl IGNvbmZpZyAiUkFTUEJFUlJZUElfR1BJT01FTSIuDQoNCkkgZGlkbid0IGxvb2sgdXAgd2hh dCBhIGdwaW9tZW0gZGV2aWNlIGRvZXMuIEkgZ3Vlc3MgaXQgZHJpdmVzIEdQSU9zIA0KZnJv bSB1c2Vyc3BhY2U/IEkgc3VnZ2VzdCBldmFsdWF0aW5nIGdwaW9jaGlwIGRldmljZXMuIFRo ZSBvYnZpb3VzIGxpYiANCnRvIHVzZSBpcyBsaWJncGlvZDIuDQoNCklmIHRoYXQgcmVwbHkg ZG9lc24ndCBtYXRjaCB5b3VyIHBsYW46IFdoYXQgZG8geW91IHdhbnQgdG8gYWNoaWV2ZT8N Cg0KQmVzdCByZWdhcmRzDQpVd2UNCg0K

    --------------nvJIQgWdfcL0tulCNmzp0ZxM--

    -----BEGIN PGP SIGNATURE-----

    iQEzBAEBCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmYNxBwACgkQj4D7WH0S /k4d3ggAiNre3McwePNyK2Q8XrUhfozBtrFqxD7MUR5d2syHQo+4pZ3I+9Nj4O/a oXi2bgYqWdH9/LLrbrH2rakxw4d+bphhLSs/q84vXPC76ABrRthTUO73lHsaJpph qdLAUz/TKHnSBuQVUwuGVJ2m9d4qpVRzGLCIIKU2pE7H+wfrJcUmWnfOGTvoWtYO ZdK+GQGsIc++/Ev0qnc2V7q3cAkR2OK2zP+U4JL8rm3pFOoqo3DJ7GBIP+JP6AcN 5QGkLIl4qMfezxk6iVeCYnrsYWyEGgmAwHYuoeNJ/IJYgCoQ0tvQPwZ/m7YGe99c KKghGeVQCFh+yUi6PKgm8r/NrhJrdw==
    =Cd/3
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Lehmann@21:1/5 to All on Sat Apr 6 09:50:48 2024
    I forgot to include the references:

    [1]: https://raspi.debian.net/tested-images/
    [2]: https://github.com/raspberrypi/linux/issues/2514

    Ah, and I found Kernel code in drivers/char/raspberrypi-gpiomem.c and
    the accompanying Kconfig defining the config "RASPBERRYPI_GPIOMEM".

    That .c file sounds like the something called "raspberrypi-gpiomem".
    This config is currently not defined in the installed Kernel's config
    (it's default is "n").
    So, one would obviously enable RASPBERRYPI_GPIOMEM (default: "n") in the
    kernel config instead.

    If someone can point me to the correct repository I'm happy to provide a
    pull request or patch.
    Pointing me to a cross compile and/or testing guide of ARM Linux kernels
    would be helpful.

    Thank you for taking time looking into this.


    Best regards,
    Thomas.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Diederik de Haas@21:1/5 to All on Wed Apr 3 22:47:49 2024
    On Wednesday, 3 April 2024 21:49:45 CEST Thomas Lehmann wrote:
    Ah, and I found Kernel code in drivers/char/raspberrypi-gpiomem.c and
    the accompanying Kconfig defining the config "RASPBERRYPI_GPIOMEM".

    That file and that module/symbol do NOT exist in the upstream Linux kernel (probably only in the RaspberryPi kernel) and therefor can't be enabled in the Debian kernel.
    -----BEGIN PGP SIGNATURE-----

    iHUEABYIAB0WIQT1sUPBYsyGmi4usy/XblvOeH7bbgUCZg3AdQAKCRDXblvOeH7b bkA1AQDwInGy1Zb1sbnTCZGkTRW4GC0SrycBt2KIPtCxliwFtgEAlg/INiOSnaqw ZzcS7jz7YJO28kMeXhf4PshIn0bpFww=
    =04lj
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gene heskett@21:1/5 to Hank Barta on Sat Apr 6 09:51:20 2024
    On 4/3/24 18:36, Hank Barta wrote:
    I'm not sure if this will help. I explored GPIO on Debian a bit and
    posted my code at https://github.com/HankB/GPIOD_Debian_Raspberry_Pi <https://github.com/HankB/GPIOD_Debian_Raspberry_Pi>

    I have NDI if its usable for you, but linuxcnc for the pi's has a driver
    module intended for the mesa 7i90HD & similar interface boards, which
    can be configured for high speed spi interfacing that talks spi over 3
    gpio pins, talking to the 7i90HD in 32 bit packets at 42+ megabaud, and
    gets 32 bit status packets back from the 7i90HD card at 25 megabaud.
    Been rock solid thru rpi3b/rpi4b's to run by late WW-II vintage 11x54 I converted to lcnc nearly a decade back just to see if I could do it,
    teaching my old lathe all the new dances that come with linuxcnc. The
    limits of what it can do today is limited only by your imagination.
    best,

    On Wed, Apr 3, 2024 at 12:42 AM Thomas Lehmann
    <lehmann-56d5e+565@posteo.de <mailto:lehmann-56d5e%2B565@posteo.de>> wrote:

    Good Day!

    I've tried to get GPIO access working on 1B (Raspberry Pi B+) images
    from [1], however, the "/dev/gpiomem" device is missing and access to
    "/dev/mem" (some libaries fall back to that device) is denied (even as
    root, and I don't even want to use "/dev/mem").

    Searching the internet brough up some udev rules. So I tried thse
    without success:

    SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
    KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
    SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
    SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio",
    MODE="0660"

    I later found /lib/udev/rules.d/60-rpi.gpio-common.rules and added
    these
    rules. Also no success.

    I can't find "gpiomem" in the kernel config.

    In the official Raspberry Pi repository there once was a request [2] to
    enable a kernel config "CONFIG_BCM2835_DEVGPIOMEM". This module was
    apparently replaced by something called "raspberrypi-gpiomem" in commit
    27543eeff4553f5caf7c6d8763c566042b047af0. Interestingly I can't find
    that phrase in any other commit in their repo.

    (Note: I'm aware that Debian does not refer to the Raspberry Pi [2]
    repo, this just came up in my research.)

    To me there seems to be kernel support missing or a config is not set.

    Can someone please clarify on this?


    Thank you.

    Best regards,
    Thomas.



    --
    Beautiful Sunny Winfield

    Cheers, Gene Heskett, CET.
    --
    "There are four boxes to be used in defense of liberty:
    soap, ballot, jury, and ammo. Please use in that order."
    -Ed Howdershelt (Author, 1940)
    If we desire respect for the law, we must first make the law respectable.
    - Louis D. Brandeis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Lehmann@21:1/5 to All on Sat Apr 6 09:52:44 2024
    Good Day!

    I've tried to get GPIO access working on 1B (Raspberry Pi B+) images
    from [1], however, the "/dev/gpiomem" device is missing and access to "/dev/mem" (some libaries fall back to that device) is denied (even as
    root, and I don't even want to use "/dev/mem").

    Searching the internet brough up some udev rules. So I tried thse
    without success:

    SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
    KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
    SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660" SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio",
    MODE="0660"

    I later found /lib/udev/rules.d/60-rpi.gpio-common.rules and added these
    rules. Also no success.

    I can't find "gpiomem" in the kernel config.

    In the official Raspberry Pi repository there once was a request [2] to
    enable a kernel config "CONFIG_BCM2835_DEVGPIOMEM". This module was
    apparently replaced by something called "raspberrypi-gpiomem" in commit 27543eeff4553f5caf7c6d8763c566042b047af0. Interestingly I can't find
    that phrase in any other commit in their repo.

    (Note: I'm aware that Debian does not refer to the Raspberry Pi [2]
    repo, this just came up in my research.)

    To me there seems to be kernel support missing or a config is not set.

    Can someone please clarify on this?


    Thank you.

    Best regards,
    Thomas.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)