Skip to contentSkip to conversation

spl: ram: Fix u_boot_pos calculation

PATCH In review Michal Simek 3 participants 4 messages Oct 4, 2018 – Oct 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: ram: Fix u_boot_pos calculation

The patch:
"spl: Weed out CONFIG_SYS_TEXT_BASE usage"
(sha1: 04ce5427bd3914cab8be78513275a20ab878520a) introduced bug where assigning to u_boot_pos variable wasn't done which end up in situation where SPL wasn't able to find out image on the selected address.

---

Lines are unfortunatelly longer then 80 char limits but there is no nice way how to fix it.

---
 common/spl/spl_ram.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
common/spl/spl_ram.c +2 -3
index 619b39a53748..5fcc3b1504bb 100644
@@ -63,9 +63,8 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
 			 * No binman support or no information. For now, fix it
 			 * to the address pointed to by U-Boot.
 			 */
-			header = spl_get_load_buffer(-sizeof(*header),
-						     sizeof(*header));
-
+			u_boot_pos = (ulong)spl_get_load_buffer(-sizeof(*header),
+								sizeof(*header));
 		}
 		header = (struct image_header *)map_sysmem(u_boot_pos, 0);
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 spl: ram: Fix u_boot_pos calculation

Quoted 8 lines · Michal Simek

The patch:
"spl: Weed out CONFIG_SYS_TEXT_BASE usage"
(sha1: 04ce5427bd3914cab8be78513275a20ab878520a) introduced bug where assigning to u_boot_pos variable wasn't done which end up in situation where SPL wasn't able to find out image on the selected address.

I needed to apply this to boot my socfpga cyclone5 from FPGA (both SPL and U-Boot in FPGA onchip RAM).

Quoted 25 lines

---

Lines are unfortunatelly longer then 80 char limits but there is no nice way how to fix it.

---
  common/spl/spl_ram.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
common/spl/spl_ram.c +2 -3
index 619b39a53748..5fcc3b1504bb 100644
@@ -63,9 +63,8 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
  			 * No binman support or no information. For now, fix it
  			 * to the address pointed to by U-Boot.
  			 */
-			header = spl_get_load_buffer(-sizeof(*header),
-						     sizeof(*header));
-
+			u_boot_pos = (ulong)spl_get_load_buffer(-sizeof(*header),
+								sizeof(*header));
  		}
  		header = (struct image_header *)map_sysmem(u_boot_pos, 0);
 
#2 lore raw

PATCH 1/1 spl: ram: Fix u_boot_pos calculation

Quoted 8 lines · Simon Goldschmidt
Quoted 7 lines · Michal Simek

The patch:
"spl: Weed out CONFIG_SYS_TEXT_BASE usage"
(sha1: 04ce5427bd3914cab8be78513275a20ab878520a) introduced bug where assigning to u_boot_pos variable wasn't done which end up in situation where SPL wasn't able to find out image on the selected address.

Quoted 5 lines
Quoted 1 line

I needed to apply this to boot my socfpga cyclone5 from FPGA (both SPL and U-Boot in FPGA onchip RAM).

There's a typo in my mail address :-(
Here's the correct tag:

Quoted 27 lines
Quoted 26 lines

---

Lines are unfortunatelly longer then 80 char limits but there is no nice way how to fix it.

---
   common/spl/spl_ram.c | 5 ++---
   1 file changed, 2 insertions(+), 3 deletions(-)
common/spl/spl_ram.c +2 -3
index 619b39a53748..5fcc3b1504bb 100644
@@ -63,9 +63,8 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
   			 * No binman support or no information. For now, fix it
   			 * to the address pointed to by U-Boot.
   			 */
-			header = spl_get_load_buffer(-sizeof(*header),
-						     sizeof(*header));
-
+			u_boot_pos = (ulong)spl_get_load_buffer(-sizeof(*header),
+								sizeof(*header));
   		}
   		header = (struct image_header *)map_sysmem(u_boot_pos, 0);
 
#3 lore raw
In reply to Michal Simek
Quoted 8 lines · Michal Simek

The patch:
"spl: Weed out CONFIG_SYS_TEXT_BASE usage"
(sha1: 04ce5427bd3914cab8be78513275a20ab878520a) introduced bug where assigning to u_boot_pos variable wasn't done which end up in situation where SPL wasn't able to find out image on the selected address.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181006/615a0d24/attachment.sig>