diff mbox

[U-Boot,v2,05/12] x86: queensbay: Move unprotect_spi_flash() to arch_misc_init()

Message ID 1440078028-29464-6-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng Aug. 20, 2015, 1:40 p.m. UTC
With dm pci conversion, pci config read/write in unprotect_spi_flash()
silently fails as at that time dm pci is not ready and bus enumeration
is not done yet. Actually we don't need to do this in that early phase,
hence we delay this call to arch_misc_init().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---
Simon's patch (http://patchwork.ozlabs.org/patch/506810/) should fix
this pci config read/write silently failure issue. But it does not do
any harm we move this to some late phase.

Changes in v2: None

 arch/x86/cpu/queensbay/tnc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass Aug. 21, 2015, 11:27 p.m. UTC | #1
On 20 August 2015 at 07:40, Bin Meng <bmeng.cn@gmail.com> wrote:
> With dm pci conversion, pci config read/write in unprotect_spi_flash()
> silently fails as at that time dm pci is not ready and bus enumeration
> is not done yet. Actually we don't need to do this in that early phase,
> hence we delay this call to arch_misc_init().
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> ---
> Simon's patch (http://patchwork.ozlabs.org/patch/506810/) should fix
> this pci config read/write silently failure issue. But it does not do
> any harm we move this to some late phase.
>
> Changes in v2: None
>
>  arch/x86/cpu/queensbay/tnc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Aug. 22, 2015, 4:20 a.m. UTC | #2
On 21 August 2015 at 17:27, Simon Glass <sjg@chromium.org> wrote:
> On 20 August 2015 at 07:40, Bin Meng <bmeng.cn@gmail.com> wrote:
>> With dm pci conversion, pci config read/write in unprotect_spi_flash()
>> silently fails as at that time dm pci is not ready and bus enumeration
>> is not done yet. Actually we don't need to do this in that early phase,
>> hence we delay this call to arch_misc_init().
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>
>> ---
>> Simon's patch (http://patchwork.ozlabs.org/patch/506810/) should fix
>> this pci config read/write silently failure issue. But it does not do
>> any harm we move this to some late phase.
>>
>> Changes in v2: None
>>
>>  arch/x86/cpu/queensbay/tnc.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/arch/x86/cpu/queensbay/tnc.c b/arch/x86/cpu/queensbay/tnc.c
index c465642..9682cff 100644
--- a/arch/x86/cpu/queensbay/tnc.c
+++ b/arch/x86/cpu/queensbay/tnc.c
@@ -36,8 +36,6 @@  int arch_cpu_init(void)
 	if (ret)
 		return ret;
 
-	unprotect_spi_flash();
-
 	return 0;
 }
 
@@ -80,5 +78,7 @@  void cpu_irq_init(void)
 
 int arch_misc_init(void)
 {
+	unprotect_spi_flash();
+
 	return pirq_init();
 }