x86/platform: Increase maximum GPIO number for X86_64
PATCH 1/1 x86/platform: Increase maximum GPIO number for X86_64
By default the 512 GPIOs is a maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for X86_64 and leave 512 for X86_32.
--- arch/x86/Kconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/x86/Kconfig +13 -0
@@ -340,6 +340,19 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK config ARCH_HIBERNATION_POSSIBLE def_bool y +# The GPIO number here must be sorted by descending number. In case of +# a multiplatform kernel, we just want the highest value required by the +# selected platforms. +config ARCH_NR_GPIO + int + default 1024 if X86_64 + default 512 if X86_32 + default 0 + help + Maximum number of GPIOs in the system. + + If unsure, leave the default value. + config ARCH_SUSPEND_POSSIBLE def_bool y
Signature · 1 line
2.30.2
Quoted 7 lines · Andy Shevchenko
By default the 512 GPIOs is a maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for
X86_64and leave 512 forX86_32.Signed-off-by Andy Shevchenko <[email protected]>
Looks reasonable to me.
The goal with the whole descriptor refactoring is to get this completely dynamic but it turns out to take forever. It is as it is.
Yours,
Linus Walleij
Quoted 9 lines · Linus Walleij
Quoted 6 lines · Andy Shevchenko
By default the 512 GPIOs is a maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for
X86_64and leave 512 forX86_32.
Quoted 8 lines
Quoted 1 line
Signed-off-by Andy Shevchenko <[email protected]>Looks reasonable to me.
The goal with the whole descriptor refactoring is to get this completely dynamic but it turns out to take forever. It is as it is.Reviewed-by Linus Walleij <[email protected]>
Thanks!
Rafael, can you please review this?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Rafael J. Wysocki
maintainerQuoted 18 lines · Andy Shevchenko
By default the 512 GPIOs is a maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for
X86_64and leave 512 forX86_32.Signed-off-by Andy Shevchenko <[email protected]>--- arch/x86/Kconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/x86/Kconfig +0
-0@@ -340,6 +340,19 @@ config NEED_PER_CPU_PAGE_FIRST_CHUNK config ARCH_HIBERNATION_POSSIBLE
arch/x86/Kconfig config NEED_PER_CPU_PAGE_FIRST_CHUNK · line 350
Quoted 10 lines
arch/x86/Kconfig +8
-0def_bool y +# The GPIO number here must be sorted by descending number. In case of +# a multiplatform kernel, we just want the highest value required by the +# selected platforms. +config ARCH_NR_GPIO + int + default 1024 if X86_64 + default 512 if X86_32 + default 0
Wouldn't
default 1024 if X86_64
default 512
be sufficient?
It's either X86_64 or X86_32 anyway AFAICS.
Quoted 9 lines
arch/x86/Kconfig +5
-1+ help + Maximum number of GPIOs in the system. + + If unsure, leave the default value. + config ARCH_SUSPEND_POSSIBLE def_bool y --
Quoted 8 lines · Rafael J. Wysocki
Quoted 6 lines · Andy Shevchenko
By default the 512 GPIOs is a maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for
X86_64and leave 512 forX86_32.
Thanks for review, my answers below.
Quoted 11 lines
arch/x86/Kconfig config NEED_PER_CPU_PAGE_FIRST_CHUNK · line 350
Quoted 8 lines
arch/x86/Kconfig +8
-0+# The GPIO number here must be sorted by descending number. In case of +# a multiplatform kernel, we just want the highest value required by the +# selected platforms. +config ARCH_NR_GPIO + int + default 1024 if X86_64 + default 512 if X86_32 + default 0Wouldn't
Quoted 6 lines
default 1024 if
X86_64
default 512be sufficient?
It's either
X86_64orX86_32anyway AFAICS.
I guess so.
Quoted 4 lines
arch/x86/Kconfig config NEED_PER_CPU_PAGE_FIRST_CHUNK · line 354
Quoted 4 lines
arch/x86/Kconfig +4
-0+ help + Maximum number of GPIOs in the system. + + If unsure, leave the default value.
Btw, what do you think. do we need comment above and help text here? I copied these from ARM, but I'm not sure it would be useful on x86 as much.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Rafael J. Wysocki
maintainerQuoted 33 lines · Andy Shevchenko
Quoted 8 lines · Rafael J. Wysocki
Quoted 6 lines · Andy Shevchenko
By default the 512 GPIOs is a maximum on any x86 platform. With, for example, Intel Tiger Lake-H the SoC based controller occupies up to 480 pins. This leaves only 32 available for GPIO expanders or other drivers, like PMIC. Hence, bump the maximum GPIO number to 1024 for
X86_64and leave 512 forX86_32.Thanks for review, my answers below.
Quoted 11 lines
arch/x86/Kconfig config NEED_PER_CPU_PAGE_FIRST_CHUNK · line 350
Quoted 8 lines
arch/x86/Kconfig +8
-0+# The GPIO number here must be sorted by descending number. In case of +# a multiplatform kernel, we just want the highest value required by the +# selected platforms. +config ARCH_NR_GPIO + int + default 1024 if X86_64 + default 512 if X86_32 + default 0Wouldn't
Quoted 6 lines
default 1024 if
X86_64
default 512be sufficient?
It's either
X86_64orX86_32anyway AFAICS.I guess so.
Quoted 7 lines
Quoted 4 lines
arch/x86/Kconfig config NEED_PER_CPU_PAGE_FIRST_CHUNK · line 354
Quoted 4 lines
arch/x86/Kconfig +4
-0+ help + Maximum number of GPIOs in the system. + + If unsure, leave the default value.Btw, what do you think. do we need comment above and help text here? I copied these from ARM, but I'm not sure it would be useful on x86 as much.
Both the comment and the help text aren't particularly useful IMO.
The comment is a bit confusing even, because x86 kernels are multiplatform as a rule.
Quoted 5 lines · Rafael J. Wysocki
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Rafael J. Wysocki
On Fri, Aug 6, 2021 at 4:44 PM Andy Shevchenko
<[email protected]> wrote:
...
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Wouldn't
default 1024 if
X86_64
default 512be sufficient?
It's either
X86_64orX86_32anyway AFAICS.
Fixed in v2.
...
Quoted 7 lines
Quoted 2 lines
Btw, what do you think. do we need comment above and help text here? I copied these from ARM, but I'm not sure it would be useful on x86 as much.
Both the comment and the help text aren't particularly useful IMO.
The comment is a bit confusing even, because x86 kernels are multiplatform as a rule.
Ditto.
Signature · 2 lines
With Best Regards, Andy Shevchenko