[U-Boot] [PATCH] arm: qemu: fix failure in flash initialization if booting from TF-A

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Jun 28 05:56:00 UTC 2019


On 6/27/19 10:40 AM, AKASHI Takahiro wrote:
> Yamada-san,
>
> On Thu, Jun 27, 2019 at 05:10:37PM +0900, Masahiro Yamada wrote:
>> AKASHI-san,
>>
>> On Thu, Jun 27, 2019 at 10:08 AM AKASHI Takahiro
>> <takahiro.akashi at linaro.org> wrote:
>>>
>>> If U-Boot is loaded and started from TF-A (you need to change
>>> SYS_TEXT_BASE to 0x60000000), it will hang up at flash initialization.
>>>
>>> If secure mode is off (default, or -machine virt,secure=off) at qemu,
>>> it will provide dtb with two flash memory banks:
>>>          flash at 0 {
>>>                  bank-width = <0x4>;
>>>                  reg = <0x0 0x0 0x0 0x4000000 0x0 0x4000000 0x0 0x4000000>;
>>>                  compatible = "cfi-flash";
>>>          };
>>> If secure mode is on, on the other hand, qemu provides dtb with 1 bank:
>>>          flash at 0 {
>>>                  bank-width = <0x4>;
>>>                  reg = <0x0 0x4000000 0x0 0x4000000>;
>>>                  compatible = "cfi-flash";
>>>          };
>>>
>>> As a result, flash_init()/flash_get_size() will eventually fail.
>>> With this patch applied, relevant CONFIG values are modified.
>>>
>>> NOTE: you will not have to modify SYS_TEXT_BASE any more once
>>> Yamada-san's patch[1] is merged.
>>>
>>> [1] https://lists.denx.de/pipermail/u-boot/2019-June/374178.html
>>
>> No. My patch is unrelated.
>>
>> You are talking about CONFIG_POSITION_INDEPENDENT,
>> and you can enable it irrespective of my work.

I have tested now with this patch and qemu_arm64_config and the
following settingss:

CONFIG_SYS_TEXT_BASE=0x00000000
CONFIG_POSITION_INDEPENDENT=y
CONFIG_TFABOOT=y

and U-Boot runs fine.

Unfortunately in my TF-A build PSCI reset does not work. Do you know how
to enable that?

resetting ...
INFO:    PSCI Power Domain Map:
INFO:      Domain Node : Level 1, parent_node -1, State ON (0x0)
INFO:      Domain Node : Level 1, parent_node -1, State OFF (0x2)
INFO:      CPU Node : MPID 0x0, parent_node 0, State ON (0x0)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 0, State OFF
(0x2)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 0, State OFF
(0x2)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 0, State OFF
(0x2)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 1, State OFF
(0x2)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 1, State OFF
(0x2)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 1, State OFF
(0x2)
INFO:      CPU Node : MPID 0xffffffffffffffff, parent_node 1, State OFF
(0x2)
ERROR:   QEMU System Reset: operation not handled.
BACKTRACE: START: qemu_system_reset
0: EL3: 0xe0435dc
1: EL3: 0xe04082c
2: EL3: 0xe042e78
3: EL3: 0xe0429a8
4: EL3: 0xe04104c
5: EL3: 0xe044dfc
BACKTRACE: END: qemu_system_reset
QEMU: Terminated

Best regards

Heinrich


>
> Yes, I confirmed this. I might have already enabled this config
> before I created/tested my patch.
> I will drop this reference from the commit message.
>
> Thanks,
> -Takahiro Akashi
>
>>
>> --
>> Best Regards
>> Masahiro Yamada
>



More information about the U-Boot mailing list