From d8906c1f3fd9e437066a9de7ff2de306696a7598 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 8 Jun 2016 05:07:38 -0700 Subject: x86: Probe pinctrl driver in cpu_init_r() At present pinctrl driver gets probed in ich6_gpio driver's probe routine, which has two issues: - Pin's PADs only gets configured when GPIO driver is probed, which is not done by default. This leaves the board in a partially functional state as we must initialize PADs correctly to get perepherals fully working. - The probe routine of pinctrl driver is called multiple times, as normally there are multiple GPIO controllers. It should really be called just once. Move the call to syscon_get_by_driver_data() from ich6_gpio driver to cpu_init_r(). Signed-off-by: Bin Meng Reviewed-by: Stefan Roese Reviewed-by: Simon Glass Reviewed-by: George McCollister Tested-by: George McCollister --- arch/x86/cpu/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/x86') diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index e522ff3..269043d 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -751,6 +752,10 @@ int cpu_init_r(void) uclass_first_device(UCLASS_PCH, &dev); uclass_first_device(UCLASS_LPC, &dev); + /* Set up pin control if available */ + ret = syscon_get_by_driver_data(X86_SYSCON_PINCONF, &dev); + debug("%s, pinctrl=%p, ret=%d\n", __func__, dev, ret); + return 0; } -- cgit v1.1