From: AKASHI Takahiro Date: Thu, 27 Jun 2019 17:40:19 +0900 Subject: [U-Boot] [PATCH] arm: qemu: fix failure in flash initialization if booting from TF-A In-Reply-To: References: <20190627010937.19773-1-takahiro.akashi@linaro.org> Message-ID: <20190627084018.GB21948@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > 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. 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