Skip to contentSkip to conversation

mpc8260: move FDT memory node fixup into common CPU code.

PATCH Superseded Marcel Ziswiler 3 participants 12 messages Sep 8, 2009 – Nov 22, 2009

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Move the memory node fixup of the MPC8260ADS, ids8247, mgcoge and muas3001 boards into common mpc8260 CPU code.

---
 board/freescale/mpc8260ads/mpc8260ads.c |   13 -------------
 board/ids8247/ids8247.c                 |   16 ----------------
 board/keymile/mgcoge/mgcoge.c           |    8 +-------
 board/muas3001/muas3001.c               |   16 ----------------
 cpu/mpc8260/cpu.c                       |    1 +
 5 files changed, 2 insertions(+), 52 deletions(-)
board/freescale/mpc8260ads/mpc8260ads.c +0 -13
index 49a88bb..be55626 100644
@@ -550,24 +550,11 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_blob_update(void *blob, bd_t *bd)
-{
-	int ret;
-
-	ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-	if (ret < 0) {
-		printf("ft_blob_update(): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror(ret));
-	}
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
 	ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
 	ft_pci_setup(blob, bd);
 #endif
-	ft_blob_update(blob, bd);
 }
 #endif
board/ids8247/ids8247.c +0 -16
index 79fe9da..d621833 100644
@@ -400,24 +400,8 @@ int board_nand_init(struct nand_chip *nand)
 #endif	/* CONFIG_CMD_NAND */
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-/*
- * update "memory" property in the blob
- */
-void ft_blob_update(void *blob, bd_t *bd)
-{
-	int ret;
-
-	ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-	if (ret < 0) {
-		printf("ft_blob_update(): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror(ret));
-	}
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
 	ft_cpu_setup( blob, bd);
-	ft_blob_update(blob, bd);
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
board/keymile/mgcoge/mgcoge.c +1 -7
index b16a01c..932a805 100644
@@ -312,11 +312,10 @@ int hush_init_var (void)
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 /*
- * update "memory" property in the blob
+ * update "flash" property in the blob
  */
 void ft_blob_update (void *blob, bd_t *bd)
 {
-	ulong memory_data[2] = {0};
 	ulong *flash_data = NULL;
 	ulong	flash_reg[6] = {0};
 	flash_info_t	*info;
@@ -324,11 +323,6 @@ void ft_blob_update (void *blob, bd_t *bd)
 	int	size;
 	int	i = 0;
 
-	memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-	memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-	fdt_set_node_and_value (blob, "/memory", "reg", memory_data,
-				sizeof (memory_data));
-
 	len = fdt_get_node_and_value (blob, "/localbus", "ranges",
 					(void *)&flash_data);
 
board/muas3001/muas3001.c +0 -16
index 36caed8..e0a7f32 100644
@@ -308,25 +308,9 @@ int board_early_init_r (void)
 void ft_blob_update (void *blob, bd_t *bd)
 {
 	int ret, nodeoffset = 0;
-	ulong memory_data[2] = {0};
 	ulong flash_data[4] = {0};
 	ulong	speed = 0;
 
-	memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-	memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-
-	nodeoffset = fdt_path_offset (blob, "/memory");
-	if (nodeoffset >= 0) {
-		ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
-					sizeof(memory_data));
-	if (ret < 0)
-		printf ("ft_blob_update): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror (ret));
-	} else {
-		/* memory node is required in dts */
-		printf ("ft_blob_update(): cannot find /memory node "
-			"err:%s\n", fdt_strerror(nodeoffset));
-	}
 	/* update Flash addr, size */
 	flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
 	flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE);
cpu/mpc8260/cpu.c +1 -0
index 17e6248..aedbf29 100644
@@ -318,6 +318,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
 		"timebase-frequency", OF_TBCLK, 1);
 	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
 		"clock-frequency", bd->bi_intfreq, 1);
+	fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 }
 #endif /* CONFIG_OF_LIBFDT */
 
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH v2 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Dear Marcel Ziswiler,

Quoted 2 lines · In message <1252423922.5386.17.camel@com-21> you wrote:

Move the memory node fixup of the MPC8260ADS, ids8247, mgcoge and muas3001 boards into common mpc8260 CPU code.

In which way is this patch version 2? I have not seen any v1 of such a patch?

Quoted 7 lines
---
 board/freescale/mpc8260ads/mpc8260ads.c |   13 -------------
 board/ids8247/ids8247.c                 |   16 ----------------
 board/keymile/mgcoge/mgcoge.c           |    8 +-------
 board/muas3001/muas3001.c               |   16 ----------------
 cpu/mpc8260/cpu.c                       |    1 +

You want to put the respective board maintainers on Cc:

Also, what is the impact for the other MPC826x board, that are not listed here?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
No one can guarantee the actions of another.
	-- Spock, "Day of the Dove", stardate unknown
#2 lore raw

PATCH v2 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Hi Wolfgang Denk

Quoted 2 lines · Wolfgang Denk

In which way is this patch version 2? I have not seen any v1 of such a patch?

What about http://article.gmane.org/gmane.comp.boot-loaders.u-boot/67275? A pair of glasses might help (;-p).

Quoted 1 line

You want to put the respective board maintainers on Cc:

Most are maintained by Heiko, who I did actually put on CC. Forgot to add Yuli as the MPC8260 maintainer, sorry. Did so now.

Quoted 2 lines

Also, what is the impact for the other MPC826x board, that are not listed here?

I can assure you there is no impact at all as they are not using FDT at all.

Cheers

Marcel Ziswiler

#3 lore raw

PATCH v2 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Dear Marcel Ziswiler,

Quoted 6 lines · In message <1252440603.5386.40.camel@com-21> you wrote:
Quoted 2 lines · Wolfgang Denk

In which way is this patch version 2? I have not seen any v1 of such a patch?

What about http://article.gmane.org/gmane.comp.boot-loaders.u-boot/67275? A pair of glasses might help (;-p).

Heh. If that was sufficient. I'm alrady wearing glasses _and_ contact lenses, and it didn't help.

Um... but why didn't you set the In-Reply-To: and References:
headers, then?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
2000 pounds of chinese soup                               = 1 Won Ton
#4 lore raw

PATCH v2 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Dear Wolfgang Denk

Quoted 2 lines · Wolfgang Denk

Heh. If that was sufficient. I'm alrady wearing glasses _and_ contact lenses, and it didn't help.

I do know that as I saw you at the EW in N?rnberg this spring.

Quoted 2 lines

Um... but why didn't you set the In-Reply-To: and References:
headers, then?

Sorry about that, my understanding was to post new versions of a patch as a new thread. Is that not so?

What exactly is that references header you are talking about?

Cheers

Marcel Ziswiler

#5 lore raw

PATCH v2 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Dear Marcel Ziswiler,

Quoted 3 lines · In message <1252443768.5386.82.camel@com-21> you wrote:

Sorry about that, my understanding was to post new versions of a patch as a
new thread. Is that not so?

No, on contrary. New versions of a patch should always make sure to thread correctly to the old version(s). It seems that preferences here are a matter of taste - my personal preference is to link to the preceeding version of the patch, but most others seem to prefer to link to the first version always.

Quoted 1 line

What exactly is that references header you are talking about?

It's a standard Mail header like this one:

| In-reply-to: <[email protected]> | References: <[email protected]>

when enables MUAs to display a "threaded view", i. e. you can see the whole history of previous patch submissions, review comments, etc. and thus for example check easily if the new version incorporates all requested changes.

When you use "git send-email" to submit your patches, it will (in standard configuration) ask you:

Message-ID to be used as In-Reply-To for the first email?

Here you can simply enter the message ID of the original posting you are referring to ("<[email protected]>") in the example above.

Note that the message ID of a posting is also a very convenient method to look it up in the gmane archives: just append the message ID to the URL "http://mid.gmane.org/" - i. e. try:

http://mid.gmane.org/1251879636-9115-1-git-send-email-wd at denx.de

Then click on the link in the "Subject: line to see the whole thread.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The typical page layout program is nothing more  than  an  electronic
light table for cutting and pasting documents.
#6 lore raw

PATCH v2 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Quoted 5 lines · Wolfgang Denk

No, on contrary. New versions of a patch should always make sure to thread correctly to the old version(s). It seems that preferences here are a matter of taste - my personal preference is to link to the preceeding version of the patch, but most others seem to prefer to link to the first version always.

That's kind of what I thought at first as well, but then I saw many others posting patches not adhering to that and still getting your ack no problem:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/67581
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/67462
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/67394
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/67187

#7 lore raw

PATCH v2 1/1 mpc8260: move FDT memory node fixup into common CPU code.

In reply to Marcel Ziswiler

Hello Marcel,

Quoted 11 lines · Marcel Ziswiler

Move the memory node fixup of the MPC8260ADS, ids8247, mgcoge and muas3001 boards into common mpc8260 CPU code.

---
 board/freescale/mpc8260ads/mpc8260ads.c |   13 -------------
 board/ids8247/ids8247.c                 |   16 ----------------
 board/keymile/mgcoge/mgcoge.c           |    8 +-------
 board/muas3001/muas3001.c               |   16 ----------------
 cpu/mpc8260/cpu.c                       |    1 +
 5 files changed, 2 insertions(+), 52 deletions(-)

Tested on the mgcoge board. (ids8247 and muas3001 I have no access anymore)

Thanks

bye
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#8 lore raw

PATCH v3 1/1 mpc8260: move FDT memory node fixup into common CPU code.

In reply to Marcel Ziswiler

---
Changes since v1:
- Added previously missed mgcoge board as pointed out by Peter Tyser and Heiko
- Moved the board-specific Ethernet modifications into separate patch Changes since v2:
- Added Heiko's tested-by

 board/freescale/mpc8260ads/mpc8260ads.c |   13 -------------
 board/ids8247/ids8247.c                 |   16 ----------------
 board/keymile/mgcoge/mgcoge.c           |    8 +-------
 board/muas3001/muas3001.c               |   16 ----------------
 cpu/mpc8260/cpu.c                       |    1 +
 5 files changed, 2 insertions(+), 52 deletions(-)
board/freescale/mpc8260ads/mpc8260ads.c +0 -13
index 49a88bb..be55626 100644
@@ -550,24 +550,11 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_blob_update(void *blob, bd_t *bd)
-{
-	int ret;
-
-	ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-	if (ret < 0) {
-		printf("ft_blob_update(): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror(ret));
-	}
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
 	ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
 	ft_pci_setup(blob, bd);
 #endif
-	ft_blob_update(blob, bd);
 }
 #endif
board/ids8247/ids8247.c +0 -16
index 79fe9da..d621833 100644
@@ -400,24 +400,8 @@ int board_nand_init(struct nand_chip *nand)
 #endif	/* CONFIG_CMD_NAND */
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-/*
- * update "memory" property in the blob
- */
-void ft_blob_update(void *blob, bd_t *bd)
-{
-	int ret;
-
-	ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-	if (ret < 0) {
-		printf("ft_blob_update(): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror(ret));
-	}
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
 	ft_cpu_setup( blob, bd);
-	ft_blob_update(blob, bd);
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
board/keymile/mgcoge/mgcoge.c +1 -7
index b16a01c..932a805 100644
@@ -312,11 +312,10 @@ int hush_init_var (void)
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 /*
- * update "memory" property in the blob
+ * update "flash" property in the blob
  */
 void ft_blob_update (void *blob, bd_t *bd)
 {
-	ulong memory_data[2] = {0};
 	ulong *flash_data = NULL;
 	ulong	flash_reg[6] = {0};
 	flash_info_t	*info;
@@ -324,11 +323,6 @@ void ft_blob_update (void *blob, bd_t *bd)
 	int	size;
 	int	i = 0;
 
-	memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-	memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-	fdt_set_node_and_value (blob, "/memory", "reg", memory_data,
-				sizeof (memory_data));
-
 	len = fdt_get_node_and_value (blob, "/localbus", "ranges",
 					(void *)&flash_data);
 
board/muas3001/muas3001.c +0 -16
index 36caed8..e0a7f32 100644
@@ -308,25 +308,9 @@ int board_early_init_r (void)
 void ft_blob_update (void *blob, bd_t *bd)
 {
 	int ret, nodeoffset = 0;
-	ulong memory_data[2] = {0};
 	ulong flash_data[4] = {0};
 	ulong	speed = 0;
 
-	memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-	memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-
-	nodeoffset = fdt_path_offset (blob, "/memory");
-	if (nodeoffset >= 0) {
-		ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
-					sizeof(memory_data));
-	if (ret < 0)
-		printf ("ft_blob_update): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror (ret));
-	} else {
-		/* memory node is required in dts */
-		printf ("ft_blob_update(): cannot find /memory node "
-			"err:%s\n", fdt_strerror(nodeoffset));
-	}
 	/* update Flash addr, size */
 	flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
 	flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE);
cpu/mpc8260/cpu.c +1 -0
index 17e6248..aedbf29 100644
@@ -318,6 +318,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
 		"timebase-frequency", OF_TBCLK, 1);
 	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
 		"clock-frequency", bd->bi_intfreq, 1);
+	fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 }
 #endif /* CONFIG_OF_LIBFDT */
 
Signature · 1 line
1.6.4.2
#9 lore raw

PATCH v3 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Dear Marcel Ziswiler,

Quoted 9 lines · In message <1252524034.3643.10.camel@com-21> you wrote:

---
Changes since v1:
- Added previously missed mgcoge board as pointed out by Peter Tyser and Heiko
- Moved the board-specific Ethernet modifications into separate patch Changes since v2:
- Added Heiko's tested-by

Quoted 6 lines
 board/freescale/mpc8260ads/mpc8260ads.c |   13 -------------
 board/ids8247/ids8247.c                 |   16 ----------------
 board/keymile/mgcoge/mgcoge.c           |    8 +-------
 board/muas3001/muas3001.c               |   16 ----------------
 cpu/mpc8260/cpu.c                       |    1 +
 5 files changed, 2 insertions(+), 52 deletions(-)

Patch does not apply:

Applying: mpc8260: move FDT memory node fixup into common CPU code.
error: patch failed: board/muas3001/muas3001.c:308
error: board/muas3001/muas3001.c: patch does not apply
fatal: sha1 information is lacking or useless (board/keymile/mgcoge/mgcoge.c). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge.
Patch failed at 0001.

Please fix and repost.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Far back in the mists of ancient time, in the great and glorious days
of the former Galactic Empire, life was wild, rich  and  largely  tax
free.         - Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
#10 lore raw

PATCH v4 1/1 mpc8260: move FDT memory node fixup into common CPU code.

---
Changes since v1:
- Added previously missed mgcoge board as pointed out by Peter Tyser and Heiko
- Moved the board-specific Ethernet modifications into separate patch Changes since v2:
- Added Heiko's tested-by
Changes since v3:
- Re-based to origin/master

 board/freescale/mpc8260ads/mpc8260ads.c |   13 -------------
 board/ids8247/ids8247.c                 |   16 ----------------
 board/keymile/mgcoge/mgcoge.c           |    8 +-------
 board/muas3001/muas3001.c               |   16 ----------------
 cpu/mpc8260/cpu.c                       |    1 +
 5 files changed, 2 insertions(+), 52 deletions(-)
board/freescale/mpc8260ads/mpc8260ads.c +0 -13
index 49a88bb..be55626 100644
@@ -550,24 +550,11 @@ void pci_init_board(void)
 #endif
 
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_blob_update(void *blob, bd_t *bd)
-{
-	int ret;
-
-	ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-	if (ret < 0) {
-		printf("ft_blob_update(): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror(ret));
-	}
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
 	ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
 	ft_pci_setup(blob, bd);
 #endif
-	ft_blob_update(blob, bd);
 }
 #endif
board/ids8247/ids8247.c +0 -16
index 79fe9da..d621833 100644
@@ -400,24 +400,8 @@ int board_nand_init(struct nand_chip *nand)
 #endif	/* CONFIG_CMD_NAND */
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-/*
- * update "memory" property in the blob
- */
-void ft_blob_update(void *blob, bd_t *bd)
-{
-	int ret;
-
-	ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-	if (ret < 0) {
-		printf("ft_blob_update(): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror(ret));
-	}
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
 	ft_cpu_setup( blob, bd);
-	ft_blob_update(blob, bd);
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
board/keymile/mgcoge/mgcoge.c +1 -7
index b16a01c..932a805 100644
@@ -312,11 +312,10 @@ int hush_init_var (void)
 
 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
 /*
- * update "memory" property in the blob
+ * update "flash" property in the blob
  */
 void ft_blob_update (void *blob, bd_t *bd)
 {
-	ulong memory_data[2] = {0};
 	ulong *flash_data = NULL;
 	ulong	flash_reg[6] = {0};
 	flash_info_t	*info;
@@ -324,11 +323,6 @@ void ft_blob_update (void *blob, bd_t *bd)
 	int	size;
 	int	i = 0;
 
-	memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-	memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-	fdt_set_node_and_value (blob, "/memory", "reg", memory_data,
-				sizeof (memory_data));
-
 	len = fdt_get_node_and_value (blob, "/localbus", "ranges",
 					(void *)&flash_data);
 
board/muas3001/muas3001.c +0 -16
index 36caed8..e0a7f32 100644
@@ -308,25 +308,9 @@ int board_early_init_r (void)
 void ft_blob_update (void *blob, bd_t *bd)
 {
 	int ret, nodeoffset = 0;
-	ulong memory_data[2] = {0};
 	ulong flash_data[4] = {0};
 	ulong	speed = 0;
 
-	memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-	memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-
-	nodeoffset = fdt_path_offset (blob, "/memory");
-	if (nodeoffset >= 0) {
-		ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
-					sizeof(memory_data));
-	if (ret < 0)
-		printf ("ft_blob_update): cannot set /memory/reg "
-			"property err:%s\n", fdt_strerror (ret));
-	} else {
-		/* memory node is required in dts */
-		printf ("ft_blob_update(): cannot find /memory node "
-			"err:%s\n", fdt_strerror(nodeoffset));
-	}
 	/* update Flash addr, size */
 	flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
 	flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE);
cpu/mpc8260/cpu.c +1 -0
index 17e6248..aedbf29 100644
@@ -318,6 +318,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
 		"timebase-frequency", OF_TBCLK, 1);
 	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
 		"clock-frequency", bd->bi_intfreq, 1);
+	fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 }
 #endif /* CONFIG_OF_LIBFDT */
 
Signature · 1 line
1.6.0.4
#11 lore raw

PATCH v4 1/1 mpc8260: move FDT memory node fixup into common CPU code.

Dear Marcel Ziswiler,

Quoted 11 lines · In message <1254434117.8315.15.camel@com-21> you wrote:

---
Changes since v1:
- Added previously missed mgcoge board as pointed out by Peter Tyser and Heiko
- Moved the board-specific Ethernet modifications into separate patch Changes since v2:
- Added Heiko's tested-by
Changes since v3:
- Re-based to origin/master

Quoted 6 lines
 board/freescale/mpc8260ads/mpc8260ads.c |   13 -------------
 board/ids8247/ids8247.c                 |   16 ----------------
 board/keymile/mgcoge/mgcoge.c           |    8 +-------
 board/muas3001/muas3001.c               |   16 ----------------
 cpu/mpc8260/cpu.c                       |    1 +
 5 files changed, 2 insertions(+), 52 deletions(-)

Apoplied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Maintain an awareness for contribution --  to  your  schedule,  your
project, our company."                         - A Group of Employees