Re: [U-Boot] [PATCH 1/2] fs: cbfs: make file_cbfs_load_header(..) independent of end-of-rom

2019-04-17 Thread Bin Meng
Hi Christian,

On Wed, Apr 17, 2019 at 11:17 PM Christian Gmeiner
 wrote:
>
> Am Mi., 17. Apr. 2019 um 15:21 Uhr schrieb Christian Gmeiner
> :
> >
> > Signed-off-by: Christian Gmeiner 
>
> I think I will send out a v2 that compiles :/
>

and please add some descriptions in the commit message. Thanks!

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] fs: cbfs: make file_cbfs_load_header(..) independent of end-of-rom

2019-04-17 Thread Christian Gmeiner
Am Mi., 17. Apr. 2019 um 15:21 Uhr schrieb Christian Gmeiner
:
>
> Signed-off-by: Christian Gmeiner 

I think I will send out a v2 that compiles :/

-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/2] fs: cbfs: make file_cbfs_load_header(..) independent of end-of-rom

2019-04-17 Thread Christian Gmeiner
Signed-off-by: Christian Gmeiner 
---
 fs/cbfs/cbfs.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c
index 7b2513cb24..c60a8d5dc1 100644
--- a/fs/cbfs/cbfs.c
+++ b/fs/cbfs/cbfs.c
@@ -162,13 +162,10 @@ static void file_cbfs_fill_cache(u8 *start, u32 size, u32 
align)
 }
 
 /* Get the CBFS header out of the ROM and do endian conversion. */
-static int file_cbfs_load_header(uintptr_t end_of_rom,
-struct cbfs_header *header)
+static int file_cbfs_load_header(uintptr_t addr, struct cbfs_header *header)
 {
-   struct cbfs_header *header_in_rom;
-   int32_t offset = *(u32 *)(end_of_rom - 3);
+   struct cbfs_header *header_in_rom = (struct cbfs_header *)addr;
 
-   header_in_rom = (struct cbfs_header *)(end_of_rom + offset + 1);
swap_header(header, header_in_rom);
 
if (header->magic != good_magic || header->offset >
@@ -183,8 +180,9 @@ void file_cbfs_init(uintptr_t end_of_rom)
 {
u8 *start_of_rom;
initialized = 0;
+   const int32_t offset = *(u32 *)(end_of_rom - 3);
 
-   if (file_cbfs_load_header(end_of_rom, &cbfs_header))
+   if (file_cbfs_load_header(end_of_rom + offset + 1, &cbfs_header))
return;
 
start_of_rom = (u8 *)(end_of_rom + 1 - cbfs_header.rom_size);
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot