Re: [U-Boot] [PATCH 7/8] x86: Probe pinctrl driver in cpu_init_r()
On Sat, Jun 11, 2016 at 2:33 AM, George McCollisterwrote: > On Wed, Jun 8, 2016 at 7:07 AM, Bin Meng wrote: >> 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: George McCollister > Tested-by: George McCollister applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 7/8] x86: Probe pinctrl driver in cpu_init_r()
Hi Simon, On Fri, Jun 10, 2016 at 8:35 AM, Simon Glasswrote: > On 8 June 2016 at 06:07, Bin Meng wrote: >> 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 >> >> --- >> >> arch/x86/cpu/cpu.c | 5 + >> drivers/gpio/intel_ich6_gpio.c | 7 --- >> 2 files changed, 5 insertions(+), 7 deletions(-) > > I suppose this is better. But will the pins always be set up even if > the GPIO driver is not used until later? > I checked ich6_gpio and broadwell_gpio driver. Looks we are OK as the pinctrl driver only needs the GPIO base address. > Reviewed-by: Simon Glass Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 7/8] x86: Probe pinctrl driver in cpu_init_r()
On Wed, Jun 8, 2016 at 7:07 AM, Bin Mengwrote: > 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: George McCollister Tested-by: George McCollister ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 7/8] x86: Probe pinctrl driver in cpu_init_r()
On 8 June 2016 at 06:07, Bin Mengwrote: > 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 > > --- > > arch/x86/cpu/cpu.c | 5 + > drivers/gpio/intel_ich6_gpio.c | 7 --- > 2 files changed, 5 insertions(+), 7 deletions(-) I suppose this is better. But will the pins always be set up even if the GPIO driver is not used until later? Reviewed-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 7/8] x86: Probe pinctrl driver in cpu_init_r()
On 08.06.2016 14:07, Bin Meng wrote: 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 MengReviewed-by: Stefan Roese Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 7/8] 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--- arch/x86/cpu/cpu.c | 5 + drivers/gpio/intel_ich6_gpio.c | 7 --- 2 files changed, 5 insertions(+), 7 deletions(-) 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, ); uclass_first_device(UCLASS_LPC, ); + /* Set up pin control if available */ + ret = syscon_get_by_driver_data(X86_SYSCON_PINCONF, ); + debug("%s, pinctrl=%p, ret=%d\n", __func__, dev, ret); + return 0; } diff --git a/drivers/gpio/intel_ich6_gpio.c b/drivers/gpio/intel_ich6_gpio.c index 2d66d04..fd6181f 100644 --- a/drivers/gpio/intel_ich6_gpio.c +++ b/drivers/gpio/intel_ich6_gpio.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -113,12 +112,6 @@ static int ich6_gpio_probe(struct udevice *dev) struct ich6_bank_platdata *plat = dev_get_platdata(dev); struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); struct ich6_bank_priv *bank = dev_get_priv(dev); - struct udevice *pinctrl; - int ret; - - /* Set up pin control if available */ - ret = syscon_get_by_driver_data(X86_SYSCON_PINCONF, ); - debug("%s, pinctrl=%p, ret=%d\n", __func__, pinctrl, ret); uc_priv->gpio_count = GPIO_PER_BANK; uc_priv->bank_name = plat->bank_name; -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot