Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5077

Device Tree • Pi 3 - How to obtain GPIO base address in the kernel?

$
0
0
Hi, I'm new to Raspberry PI and Linux kernel.

I use Pi 3. (Raspberry Pi 3 Model B Plus Rev 1.3)

When I read several articles, it says that my GPIO base register is
- Bus Addresses: 0x7E000000
- Kernel Addresses: 0x3F000000 or 0x20000000 (depending on model)

These are the articles that I found.
- viewtopic.php?t=283456
- viewtopic.php?t=229343
- viewtopic.php?t=180308
- https://datasheets.raspberrypi.com/bcm2 ... herals.pdf

However, if I print it out the actual base register in kernel, it shows different pointer address: (0xbb919000)

Code:

// rpi-6.1.y/drivers/pinctrl/bcm/pinctrl-bcm2835.c   static inline int bcm2835_gpio_get_bit(struct bcm2835_pinctrl *pc, unsigned reg, unsigned bit) {   reg += GPIO_REG_OFFSET(bit) * 4;   printk("base register: %px", pc->base);   return (bcm2835_gpio_rd(pc, reg) >> GPIO_REG_SHIFT(bit)) & 1;}// base register: 0xbb919000
How should I interpret this value? Is there something that I missed or misunderstood?
Please help me with this confusion.

Statistics: Posted by pepsicolav13 — Thu May 02, 2024 1:05 am



Viewing all articles
Browse latest Browse all 5077

Trending Articles