Skip to content


gpio: Increase ARCH_NR_GPIOs to 512
Browse files Browse the repository at this point in the history
Some newer Intel SoCs, like Braswell already have more than 256 GPIOs
available so the default limit is exceeded. Instead of adding more
architecture specific gpio.h files with custom ARCH_NR_GPIOs we increase
the gpiolib default limit to be twice the current.

Current generic ARCH_NR_GPIOS limit is 256 which starts to be too small
for newer Intel SoCs like Braswell. In order to support GPIO controllers
on these SoCs we increase ARCH_NR_GPIOS to be 512 which should be
sufficient for now.

The kernel size increases a bit with this change. Below is an example of
x86_64 kernel image.

 text     data    bss     dec      hex    filename
 11476173 1971328 1265664 14713165 e0814d vmlinux

 text     data    bss     dec      hex    filename
 11476173 1971328 1269760 14717261 e0914d vmlinux

So the BSS size and this the kernel image size increases by 4k.

Signed-off-by: Mika Westerberg <>
Signed-off-by: Linus Walleij <>
  • Loading branch information
westeri authored and linusw committed Sep 23, 2014
1 parent 56b4276 commit 7ca267f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/asm-generic/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#define ARCH_NR_GPIOS 256
#define ARCH_NR_GPIOS 512

Expand Down

0 comments on commit 7ca267f

Please sign in to comment.