Skip to contentSkip to conversation

SPL and DM on ZYNQ

U-Boot Hannes Schmelzer 3 participants 8 messages Oct 7, 2015 – Oct 9, 2015

lore
Share & tools
lore
#0 lore raw

hi folks,

i am not very familar with driver model until now and so i've a question.

I'm trying to bring up my Zynq ZC702 evalboard using driver-model during SPL stage (because QSPI needs this).
I simply switched on "Driver Model for SPL" within Kconfig and compiled.

This ends up in:

U-Boot SPL 2015.10-rc4-00050-g996ec1d-dirty (Oct 07 2015 - 13:57:32)

Quoted 1 line
Quoted 1 line

spl:board_init_r()

using memory 0xffff10c0-0xffff20c0 for malloc()
spl_init()
dm_init() failed: -2
dm_init_and_scan() returned error -2
### ERROR ### Please RESET the board ###

i had a look into drivers/core/root.c and saw that

device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);

fails.

Any idea why the root-driver cannot be found ? Maybe there are some switched need to be switched on too.

thanks,
Hannes

#1 lore raw

Hi,

Quoted 19 lines · Hannes Schmelzer

hi folks,

i am not very familar with driver model until now and so i've a question.

I'm trying to bring up my Zynq ZC702 evalboard using driver-model during SPL stage (because QSPI needs this).
I simply switched on "Driver Model for SPL" within Kconfig and compiled.

This ends up in:

U-Boot SPL 2015.10-rc4-00050-g996ec1d-dirty (Oct 07 2015 - 13:57:32)

Quoted 1 line
Quoted 1 line

spl:board_init_r()

using memory 0xffff10c0-0xffff20c0 for malloc()
spl_init()
dm_init() failed: -2
dm_init_and_scan() returned error -2
### ERROR ### Please RESET the board ###

Quoted 8 lines

i had a look into drivers/core/root.c and saw that

device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);

fails.

Any idea why the root-driver cannot be found ? Maybe there are some switched need to be switched on too.

Is there any chance that your SPL does not have the linker lists set up correctly?

See this code in the standard ARM u-boot-spl.lds:

#ifdef CONFIG_SPL_DM
.u_boot_list : {
KEEP(*(SORT(.u_boot_list_*_driver_*)));
KEEP(*(SORT(.u_boot_list_*_uclass_*)));
}
#endif

I don't see it in the zynq one (arch/arm/mach-zynq).

That would cause the uclass driver to be missing.

Regards,
Simon

#2 lore raw
Quoted 34 lines · Simon Glass

Hi,

Quoted 19 lines · Hannes Schmelzer

hi folks,

i am not very familar with driver model until now and so i've a question.

I'm trying to bring up my Zynq ZC702 evalboard using driver-model during SPL stage (because QSPI needs this).
I simply switched on "Driver Model for SPL" within Kconfig and compiled.

This ends up in:

U-Boot SPL 2015.10-rc4-00050-g996ec1d-dirty (Oct 07 2015 - 13:57:32)

Quoted 1 line
Quoted 1 line

spl:board_init_r()

using memory 0xffff10c0-0xffff20c0 for malloc()
spl_init()
dm_init() failed: -2
dm_init_and_scan() returned error -2
### ERROR ### Please RESET the board ###

Quoted 8 lines

i had a look into drivers/core/root.c and saw that

device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);

fails.

Any idea why the root-driver cannot be found ? Maybe there are some switched need to be switched on too.

Is there any chance that your SPL does not have the linker lists set up correctly?

Quoted 8 lines

See this code in the standard ARM u-boot-spl.lds:

#ifdef CONFIG_SPL_DM
.u_boot_list : {
KEEP(*(SORT(.u_boot_list_*_driver_*)));
KEEP(*(SORT(.u_boot_list_*_uclass_*)));
}
#endif

I think these changes still in queue[1] I'm keep sending remainders, there is on PR blocks these changes[2]

[1] http://git.denx.de/?p=u-boot/u-boot-dm.git;a=shortlog;h=refs/heads/zynq-working
[2] https://patchwork.ozlabs.org/patch/517709/

Quoted 4 lines

I don't see it in the zynq one (arch/arm/mach-zynq).

That would cause the uclass driver to be missing.

-- Jagan.

#3 lore raw

Hi Jagan,

Quoted 44 lines · Jagan Teki
Quoted 34 lines · Simon Glass

Hi,

Quoted 19 lines · Hannes Schmelzer

hi folks,

i am not very familar with driver model until now and so i've a question.

I'm trying to bring up my Zynq ZC702 evalboard using driver-model during SPL stage (because QSPI needs this).
I simply switched on "Driver Model for SPL" within Kconfig and compiled.

This ends up in:

U-Boot SPL 2015.10-rc4-00050-g996ec1d-dirty (Oct 07 2015 - 13:57:32)

Quoted 1 line
Quoted 1 line

spl:board_init_r()

using memory 0xffff10c0-0xffff20c0 for malloc()
spl_init()
dm_init() failed: -2
dm_init_and_scan() returned error -2
### ERROR ### Please RESET the board ###

Quoted 8 lines

i had a look into drivers/core/root.c and saw that

device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);

fails.

Any idea why the root-driver cannot be found ? Maybe there are some switched need to be switched on too.

Is there any chance that your SPL does not have the linker lists set up correctly?

Quoted 8 lines

See this code in the standard ARM u-boot-spl.lds:

#ifdef CONFIG_SPL_DM
.u_boot_list : {
KEEP(*(SORT(.u_boot_list_*_driver_*)));
KEEP(*(SORT(.u_boot_list_*_uclass_*)));
}
#endif

Quoted 6 lines

I think these changes still in queue[1] I'm keep sending remainders, there is on PR blocks these changes[2]

[1] http://git.denx.de/?p=u-boot/u-boot-dm.git;a=shortlog;h=refs/heads/zynq-working
[2] https://patchwork.ozlabs.org/patch/517709/

OK, I don't believe they are going in before the release, nor that I should be pulling them. Please let me know if I have this wrong.

Quoted 6 lines
Quoted 4 lines

I don't see it in the zynq one (arch/arm/mach-zynq).

That would cause the uclass driver to be missing.

-- Jagan.

Regards,
Simon

#4 lore raw
In reply to Jagan Teki
Quoted 2 lines · Jagan Teki
Quoted 1 line · Simon Glass

Hi,

Hi,
there are some news on this.

Quoted 40 lines
Quoted 32 lines · Hannes Schmelzer
Quoted 19 lines

hi folks,

i am not very familar with driver model until now and so i've a question.

I'm trying to bring up my Zynq ZC702 evalboard using driver-model during SPL stage (because QSPI needs this).
I simply switched on "Driver Model for SPL" within Kconfig and compiled.

This ends up in:

U-Boot SPL 2015.10-rc4-00050-g996ec1d-dirty (Oct 07 2015 - 13:57:32)

Quoted 1 line
Quoted 1 line

spl:board_init_r()

using memory 0xffff10c0-0xffff20c0 for malloc()
spl_init()
dm_init() failed: -2
dm_init_and_scan() returned error -2
### ERROR ### Please RESET the board ###

Quoted 8 lines

i had a look into drivers/core/root.c and saw that

device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);

fails.

Any idea why the root-driver cannot be found ? Maybe there are some switched need to be switched on too.

Is there any chance that your SPL does not have the linker lists set up correctly?

Quoted 8 lines

See this code in the standard ARM u-boot-spl.lds:

#ifdef CONFIG_SPL_DM
.u_boot_list : {
KEEP(*(SORT(.u_boot_list_*_driver_*)));
KEEP(*(SORT(.u_boot_list_*_uclass_*)));
}
#endif

Quoted 5 lines

I think these changes still in queue[1] I'm keep sending remainders, there is on PR blocks these changes[2]

[1] http://git.denx.de/?p=u-boot/u-boot-dm.git;a=shortlog;h=refs/heads/zynq-working
[2] https://patchwork.ozlabs.org/patch/517709/

Many thanks for this.
I've now branched from u-boot-dm.git/zynq-working2 and then merged u-boot-spi/master into it.

After a few merge conflicts i'am able to build u-boot and boot it from SD with working DM support during SPL and QSPI support.
The next step was/is burning this file into the QSPI flash and boot from it.

burning was now problem, but boot ends up with:

U-Boot SPL 2015.10-rc4-00101-gb6dcb3f-dirty (Oct 08 2015 - 08:42:53) qspi boot
boot device - 8
uclass_find_device_by_seq: 0 0
- not found
uclass_find_device_by_seq: 1 0
- not found
Invalid bus 0 (err=-19)
SPI probe failed.
### ERROR ### Please RESET the board ###

maybe there is yet another switch, which needs to be turned on. Subject of suspicion is currently "support simple-bus driver in SPL". But if i compile with this option,
boot ends up with:

U-Boot SPL 2015.10-rc4-00101-gb6dcb3f-dirty (Oct 08 2015 - 09:01:35) mmc boot
boot device - 1
mmc_init: 0, time 58
spl: mmc boot mode: fs
reading system.dtb
Error: allocating memory
spl_load_image_fat_os: error reading image system.dtb, err - -1 reading u-boot-dtb.img
Error: allocating memory
spl_load_image_fat: error reading image u-boot-dtb.img, err - -1
spl: mmc: no boot mode left to try
### ERROR ### Please RESET the board ###

Any ideas?

many thanks and best regards,
Hannes

#5 lore raw
Quoted 27 lines

I've now branched from u-boot-dm.git/zynq-working2 and then merged u-boot-spi/master into it.

After a few merge conflicts i'am able to build u-boot and boot it from SD with working DM support during SPL and QSPI support.
The next step was/is burning this file into the QSPI flash and boot from it.

burning was now problem, but boot ends up with:

U-Boot SPL 2015.10-rc4-00101-gb6dcb3f-dirty (Oct 08 2015 - 08:42:53) qspi boot
boot device - 8
uclass_find_device_by_seq: 0 0
- not found
uclass_find_device_by_seq: 1 0
- not found
Invalid bus 0 (err=-19)
SPI probe failed.
### ERROR ### Please RESET the board ###

maybe there is yet another switch, which needs to be turned on. Subject of suspicion is currently "support simple-bus driver in SPL". But if i compile with this option,
boot ends up with:

Quoted 13 lines

U-Boot SPL 2015.10-rc4-00101-gb6dcb3f-dirty (Oct 08 2015 - 09:01:35) mmc boot
boot device - 1
mmc_init: 0, time 58
spl: mmc boot mode: fs
reading system.dtb
Error: allocating memory
spl_load_image_fat_os: error reading image system.dtb, err - -1 reading u-boot-dtb.img
Error: allocating memory
spl_load_image_fat: error reading image u-boot-dtb.img, err - -1
spl: mmc: no boot mode left to try
### ERROR ### Please RESET the board ###

This is because there is only very limited heap (0x1000) enabled in zynq-common.h and therefore the FAT buffers cannot be allocated -> solved.

Further i've found out that my board isn't booting from SPI because there is nothing within "SPL-devicetree" about QSPI.

Can anyone explain me how the "normal" and the "SPL" devicetree is separated ?

best regards,
Hannes

#6 lore raw

Hi,

Quoted 41 lines · Hannes Schmelzer
Quoted 27 lines

I've now branched from u-boot-dm.git/zynq-working2 and then merged u-boot-spi/master into it.

After a few merge conflicts i'am able to build u-boot and boot it from SD with working DM support during SPL and QSPI support.
The next step was/is burning this file into the QSPI flash and boot from it.

burning was now problem, but boot ends up with:

U-Boot SPL 2015.10-rc4-00101-gb6dcb3f-dirty (Oct 08 2015 - 08:42:53) qspi boot
boot device - 8
uclass_find_device_by_seq: 0 0
- not found
uclass_find_device_by_seq: 1 0
- not found
Invalid bus 0 (err=-19)
SPI probe failed.
### ERROR ### Please RESET the board ###

maybe there is yet another switch, which needs to be turned on. Subject of suspicion is currently "support simple-bus driver in SPL". But if i compile with this option,
boot ends up with:

Quoted 13 lines

U-Boot SPL 2015.10-rc4-00101-gb6dcb3f-dirty (Oct 08 2015 - 09:01:35) mmc boot
boot device - 1
mmc_init: 0, time 58
spl: mmc boot mode: fs
reading system.dtb
Error: allocating memory
spl_load_image_fat_os: error reading image system.dtb, err - -1 reading u-boot-dtb.img
Error: allocating memory
spl_load_image_fat: error reading image u-boot-dtb.img, err - -1
spl: mmc: no boot mode left to try
### ERROR ### Please RESET the board ###

Quoted 2 lines

This is because there is only very limited heap (0x1000) enabled in zynq-common.h and therefore the FAT buffers cannot be allocated -> solved.

You may be able to use CONFIG_SPL_STACK_R here.

Quoted 6 lines

Further i've found out that my board isn't booting from SPI because there is nothing within "SPL-devicetree" about QSPI.

Can anyone explain me how the "normal" and the "SPL" devicetree is separated ?

Yes you can add the 'u-boot,dm-pre-reloc' property to a node. See the driver-model README.txt (although it does not explicitly mention SPL at present). It will then appear in the SPL device tree.

Quoted 4 lines

best regards,
Hannes

Regards,
Simon

#7 lore raw
Quoted 2 lines

Hi,

Hi Simon,

many thanks for reply.

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines

(....)

maybe there is yet another switch, which needs to be turned on. Subject of suspicion is currently "support simple-bus driver in SPL". But if i compile with this option,
boot ends up with:

U-Boot SPL 2015.10-rc4-00101-gb6dcb3f-dirty (Oct 08 2015 - 09:01:35) mmc boot
boot device - 1
mmc_init: 0, time 58
spl: mmc boot mode: fs
reading system.dtb
Error: allocating memory
spl_load_image_fat_os: error reading image system.dtb, err - -1 reading u-boot-dtb.img
Error: allocating memory
spl_load_image_fat: error reading image u-boot-dtb.img, err - -1
spl: mmc: no boot mode left to try
### ERROR ### Please RESET the board ###

Quoted 3 lines
Quoted 2 lines

This is because there is only very limited heap (0x1000) enabled in zynq-common.h and therefore the FAT buffers cannot be allocated -> solved.

You may be able to use CONFIG_SPL_STACK_R here.

i will check this.

Quoted 9 lines
Quoted 6 lines

Further i've found out that my board isn't booting from SPI because there is nothing within "SPL-devicetree" about QSPI.

Can anyone explain me how the "normal" and the "SPL" devicetree is separated ?

Yes you can add the 'u-boot,dm-pre-reloc' property to a node. See the driver-model README.txt (although it does not explicitly mention SPL at present). It will then appear in the SPL device tree.

I've found out this and added the property to the device-tree, the device appaers now in the spl DTB.
But unfortunately i still cannot boot from QSPI flash - i am currently debugging this.

Did anyone boot yet some ZYNQ from the QSPI flash ?

Quoted 6 lines
Quoted 4 lines

best regards,
Hannes

Regards,
Simon

regards,
Hannes