diff mbox

[U-Boot,v3,4/7] x86: Allow cpu-x86 driver to be probed for UP

Message ID 1437553275-30727-5-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng July 22, 2015, 8:21 a.m. UTC
Currently cpu-x86 driver is probed only for SMP. We add the same
support for UP when there is only one cpu node in the deive tree.

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

---

Changes in v3:
- Remove the call to device_probe()
- Add a comment to explain why return value is not checked

Changes in v2:
- New patch to allow cpu-x86 driver to be probed for UP

 arch/x86/cpu/cpu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Simon Glass July 22, 2015, 1:22 p.m. UTC | #1
On 22 July 2015 at 02:21, Bin Meng <bmeng.cn@gmail.com> wrote:
> Currently cpu-x86 driver is probed only for SMP. We add the same
> support for UP when there is only one cpu node in the deive tree.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>
> ---
>
> Changes in v3:
> - Remove the call to device_probe()
> - Add a comment to explain why return value is not checked
>
> Changes in v2:
> - New patch to allow cpu-x86 driver to be probed for UP
>
>  arch/x86/cpu/cpu.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass July 22, 2015, 11:24 p.m. UTC | #2
On 22 July 2015 at 07:22, Simon Glass <sjg@chromium.org> wrote:
> On 22 July 2015 at 02:21, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Currently cpu-x86 driver is probed only for SMP. We add the same
>> support for UP when there is only one cpu node in the deive tree.
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>
>> ---
>>
>> Changes in v3:
>> - Remove the call to device_probe()
>> - Add a comment to explain why return value is not checked
>>
>> Changes in v2:
>> - New patch to allow cpu-x86 driver to be probed for UP
>>
>>  arch/x86/cpu/cpu.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>
> Acked-by: Simon Glass <sjg@chromium.org>

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

Patch

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index b4e0fd9..b9134cf 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -696,6 +696,15 @@  __weak int x86_init_cpus(void)
 #ifdef CONFIG_SMP
 	debug("Init additional CPUs\n");
 	x86_mp_init();
+#else
+	struct udevice *dev;
+
+	/*
+	 * This causes the cpu-x86 driver to be probed.
+	 * We don't check return value here as we want to allow boards
+	 * which have not been converted to use cpu uclass driver to boot.
+	 */
+	uclass_first_device(UCLASS_CPU, &dev);
 #endif
 
 	return 0;