Skip to content

Abstract Pio register layout to support more SoC - #251

Open
dlan17 wants to merge 2 commits into
linux-sunxi:masterfrom
dlan17:pio
Open

Abstract Pio register layout to support more SoC#251
dlan17 wants to merge 2 commits into
linux-sunxi:masterfrom
dlan17:pio

Conversation

@dlan17

@dlan17 dlan17 commented Aug 1, 2026

Copy link
Copy Markdown

This is a prerequisite patch to support T153 SoC, also A733 can be adapted to this new model too.

Yixun Lan added 2 commits August 1, 2026 01:06
The GPIO bank controller has different register layout information among
different SoC generations, abstract those info in the driver.

Take T153 SoC chip GPIO controller as example
1) base: The BASE address of GPIO controller
  17.9.5.1 page-1085 (1115/1759) of datasheet
  GPIO Base address 0x03604000

2) offs: First GPIO bank offset to GPIO base address, usually it's PA
 PA_CFG0 - 0x0080 (PA Configure Register 0)
 Usually it's the PA_CFG0 register offset

3) size: Register space of each GPIO bank, can be caculated from
  size = (PB_CFG0 - PA_CFG0) = (0x100 - 0x80) = 0x80

4) pull: GPIO PULL register offset to its bank base address
  PA_PULL0 - 0x00B0
  pull = (PA_PULL0 - PA_CFG0) = 0xB0 - 0x80 = 0x30

In the driver, only update SoC which support FLAG_NEW_GPIO to new layout.

Signed-off-by: Yixun Lan <dlan@kernel.org>
Update SoC which support FLAG_NCAT2 (FLAG_NEW_GPIO)

Signed-off-by: Yixun Lan <dlan@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant