Skip to main content
Visitor II
May 3, 2023
Solved

How do we access GPIO port Z registers through devmem?

  • May 3, 2023
  • 3 replies
  • 1156 views

We can use devmem to read/write all gpio port registers except for portZ.

We know this port relates to secure. is there any way to remove secure feature on this port so we can use devmem on this port?

Thanks

    This topic has been closed for replies.
    Best answer by Dat Tran

    I got it working,

    The was because I did not enable GPIOZ in RCC_MP_AHB5ENSETR.

    3 replies

    Super User
    May 3, 2023

    What chip are you talking about?

    JW

    Dat TranAuthor
    Visitor II
    May 3, 2023

    Hi, STM32MP151AAC3

    we are using SPL uboot see that uboot already have these code.

    /* GPIOZ: deactivate the security */

    writel(BIT(0), RCC_MP_AHB5ENSETR);

    writel(0x0, GPIOZ_SECCFGR);

    We also use " /sys/class/gpio/" and turn on /off PZ5 just fine. But use devmem to read 0x54004000 which is portZ base then system crashed.

    Dat TranAuthorAnswer
    Visitor II
    May 3, 2023

    I got it working,

    The was because I did not enable GPIOZ in RCC_MP_AHB5ENSETR.