[U-Boot-Users] [PATCH 2/2] 8260: Making the use of gd->pci_clk dependant on the CONFIG_PCI

2008-07-30 Thread Matvejchikov Ilya
Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED]>
---
 cpu/mpc8260/speed.c |   47 +++
 1 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/cpu/mpc8260/speed.c b/cpu/mpc8260/speed.c
index 38cd0d9..8d280fb 100644
--- a/cpu/mpc8260/speed.c
+++ b/cpu/mpc8260/speed.c
@@ -162,6 +162,30 @@ int get_clocks (void)
gd->cpu_clk = clkin;
}

+#ifdef CONFIG_PCI
+   gd->pci_clk = clkin;
+
+   if (sccr & SCCR_PCI_MODE) {
+   uint pci_div;
+   uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
+
+   if (sccr & SCCR_PCI_MODCK) {
+   pci_div = 2;
+   if (pcidf == 9) {
+   pci_div *= 5;
+   } else if (pcidf == 0xB) {
+   pci_div *= 6;
+   } else {
+   pci_div *= (pcidf + 1);
+   }
+   } else {
+   pci_div = pcidf + 1;
+   }
+
+   gd->pci_clk = (gd->cpm_clk * 2) / pci_div;
+   }
+#endif
+
return (0);
 }

@@ -220,26 +244,9 @@ int prt_8260_clks (void)

printf (" - cpu_clk %10ld, cpm_clk %10ld, bus_clk %10ld\n",
gd->cpu_clk, gd->cpm_clk, gd->bus_clk);
-
-   if (sccr & SCCR_PCI_MODE) {
-   uint pci_div;
-   uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
-
-   if (sccr & SCCR_PCI_MODCK) {
-   pci_div = 2;
-   if (pcidf == 9) {
-   pci_div *= 5;
-   } else if (pcidf == 0xB) {
-   pci_div *= 6;
-   } else {
-   pci_div *= (pcidf + 1);
-   }
-   } else {
-   pci_div = pcidf + 1;
-   }
-
-   printf (" - pci_clk %10ld\n", (gd->cpm_clk * 2) / pci_div);
-   }
+#ifdef CONFIG_PCI
+   printf (" - pci_clk %10ld\n", gd->pci_clk);
+#endif
putc ('\n');

return (0);
-- 
1.5.6.4

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 1/2] PPC: Add pci_clk in the global_data for CPM2 processors

2008-07-30 Thread Matvejchikov Ilya
This patch adds pci_clk field to the global_data structure for the
processors which have CPM2 module in case the CONFIG_PCI is defined.

Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED]>
---
 include/asm-ppc/global_data.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h
index c5ac658..be2ce24 100644
--- a/include/asm-ppc/global_data.h
+++ b/include/asm-ppc/global_data.h
@@ -51,6 +51,9 @@ typedef   struct  global_data {
unsigned long   cpm_clk;
unsigned long   scc_clk;
unsigned long   brg_clk;
+#ifdef CONFIG_PCI
+   unsigned long   pci_clk;
+#endif
 #endif
unsigned long   mem_clk;
 #if defined(CONFIG_MPC83XX)
-- 
1.5.6.4

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH, resend] FDT memory and pci node fixes for MPC8260ADS

2008-07-14 Thread Matvejchikov Ilya
>> +#if defined(CONFIG_OF_LIBFDT)
>> +void ft_pci_setup(void *blob, bd_t *bd)
>> +{
>> + do_fixup_by_prop_u32(blob, "device_type", "pci", 4,
>> + "clock-frequency", bd->pci_clk, 1);
>> +}
>> +#endif
>
> Your patch causes problems:
>
> Configuring for MPC8260ADS board...
> pci.c: In function 'ft_pci_setup':
> pci.c:460: error: 'bd_t' has no member named 'pci_clk'
> make[1]: *** [pci.o] Error 1
>
>
> Do you have a quick fix or shall I back out the patch?
>

This problem can be temporary fixed with replacement of the
gd->pci_clk by CONFIG_8260_CLKIN.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] PPC: Some PCI generalization in the global_data structure.

2008-07-13 Thread Matvejchikov Ilya
> This makes no sense to me.
>
> Please keep in mind that the global_data stuff is intended for, and
> only for, holding global information while we are still running from
> flash (i. e. before relocation) so that we have neiter a writabel data
> segment nor a valid bss segment.
>
> PCI initialization always happens *after* relocation to RAM, therefore
> no PCI related variables are ever needed in the global_data structure.
>

Yes, I know it. But I only meant pci_clk for some cpus and other PCI
related things (pciexp1_clk, pciexp2_clk for MPC837x etc)...
At this moment we have in the global_data such things as:

struct global_data {
...
#ifdef some_cpu1
u32 pci_clk;
...
#enif
...
#ifdef some_cpu2
unsigned long pci_clk;
...
#endif

#ifdef some_cpu3
u32 pci_clk;
...
#endif
}

Does it is right approach? What do I do to use pci_clk for the mpc8272?
May be it is more correctly to use the next form of declaration:

struct global_data {
#ifdef CONFIG_PCI
u32 pci_clk;
#ifdef some_cpu1
/* cpu1 specific pci variables */
#endif
#endif

Thanks.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] 8260: Fix gd->pci_clk usage

2008-07-13 Thread Matvejchikov Ilya
This patch fixes gd->pci_clk usage. Now it depends on CONFIG_PCI option.

Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED]>
---
 cpu/mpc8260/speed.c |   47 +++
 1 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/cpu/mpc8260/speed.c b/cpu/mpc8260/speed.c
index 38cd0d9..993c65a 100644
--- a/cpu/mpc8260/speed.c
+++ b/cpu/mpc8260/speed.c
@@ -162,6 +162,30 @@ int get_clocks (void)
gd->cpu_clk = clkin;
}

+#ifdef CONFIG_PCI
+   gd->pci_clk = clkin;
+
+   if (sccr & SCCR_PCI_MODE) {
+   uint pci_div;
+   uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
+
+   if (sccr & SCCR_PCI_MODCK) {
+   pci_div = 2;
+   if (pcidf == 9) {
+   pci_div *= 5;
+   } else if (pcidf == 0xB) {
+   pci_div *= 6;
+   } else {
+   pci_div *= (pcidf + 1);
+   }
+   } else {
+   pci_div = pcidf + 1;
+   }
+
+   gd->pci_clk = (gd->cpm_clk * 2) / pci_div);
+   }
+#endif
+
return (0);
 }

@@ -220,26 +244,9 @@ int prt_8260_clks (void)

printf (" - cpu_clk %10ld, cpm_clk %10ld, bus_clk %10ld\n",
gd->cpu_clk, gd->cpm_clk, gd->bus_clk);
-
-   if (sccr & SCCR_PCI_MODE) {
-   uint pci_div;
-   uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
-
-   if (sccr & SCCR_PCI_MODCK) {
-   pci_div = 2;
-   if (pcidf == 9) {
-   pci_div *= 5;
-   } else if (pcidf == 0xB) {
-   pci_div *= 6;
-   } else {
-   pci_div *= (pcidf + 1);
-   }
-   } else {
-   pci_div = pcidf + 1;
-   }
-
-   printf (" - pci_clk %10ld\n", (gd->cpm_clk * 2) / pci_div);
-   }
+#ifdef CONFIG_PCI
+   printf (" - pci_clk %10ld\n", gd->pci_clk);
+#endif
putc ('\n');

return (0);
-- 
1.5.6.2

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] PPC: Some PCI generalization in the global_data structure.

2008-07-13 Thread Matvejchikov Ilya
The global_data structure has no well defined method of the PCI clocks
and other PCI related variables declaration. This patch adds initial
support for the generalized method based on CONFIG_PCI usage. At present
it only affects when CONFIG_MPC8272 or CONFIG_MPC8272_FAMILY defined.

Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED]>
---
 include/asm-ppc/global_data.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h
index c5ac658..ac3e719 100644
--- a/include/asm-ppc/global_data.h
+++ b/include/asm-ppc/global_data.h
@@ -42,6 +42,11 @@ typedef  struct  global_data {
unsigned long   baudrate;
unsigned long   cpu_clk;/* CPU clock in Hz! */
unsigned long   bus_clk;
+#ifdef CONFIG_PCI
+#if defined(CONFIG_MPC8272) || defined(CONFIG_MPC8272_FAMILY)
+   u32 pci_clk;
+#endif
+#endif
 #if defined(CONFIG_8xx)
unsigned long   brg_clk;
 #endif
-- 
1.5.6.2

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH, resend] Some copy-n-paste fixes in printf usage

2008-07-06 Thread Matvejchikov Ilya
Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED]>
---
 board/cm5200/cm5200.c   |2 +-
 board/ids8247/ids8247.c |2 +-
 board/mgcoge/mgcoge.c   |6 +++---
 board/mgsuvd/mgsuvd.c   |8 
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c
index 3e952d8..24e8db0 100644
--- a/board/cm5200/cm5200.c
+++ b/board/cm5200/cm5200.c
@@ -275,7 +275,7 @@ static void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);

if (ret < 0) {
-   printf("ft_blob_update): cannot set /memory/reg "
+   printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
 }
diff --git a/board/ids8247/ids8247.c b/board/ids8247/ids8247.c
index 8ec4cd7..44fc79c 100644
--- a/board/ids8247/ids8247.c
+++ b/board/ids8247/ids8247.c
@@ -334,7 +334,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);

if (ret < 0) {
-   printf("ft_blob_update): cannot set /memory/reg "
+   printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
 }
diff --git a/board/mgcoge/mgcoge.c b/board/mgcoge/mgcoge.c
index 89ced1e..51b6dc6 100644
--- a/board/mgcoge/mgcoge.c
+++ b/board/mgcoge/mgcoge.c
@@ -307,7 +307,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "reg", memory_data,
sizeof(memory_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /memory/reg "
+   printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -327,7 +327,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "ranges", flash_data,
sizeof(flash_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /localbus/ranges "
+   printf("ft_blob_update(): cannot set /localbus/ranges "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -341,7 +341,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "mac-address", 
bd->bi_enetaddr,
sizeof(uchar) * 6);
if (ret < 0)
-   printf("ft_blob_update): cannot set 
/soc/cpm/ethernet/mac-address "
+   printf("ft_blob_update(): cannot set 
/soc/cpm/ethernet/mac-address "
"property err:%s\n", fdt_strerror(ret));
}
else {
diff --git a/board/mgsuvd/mgsuvd.c b/board/mgsuvd/mgsuvd.c
index d81cafb..c51ea7e 100644
--- a/board/mgsuvd/mgsuvd.c
+++ b/board/mgsuvd/mgsuvd.c
@@ -164,7 +164,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "reg", memory_data,
sizeof(memory_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /memory/reg "
+   printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -180,7 +180,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "ranges", flash_data,
sizeof(flash_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /localbus/ranges "
+   printf("ft_blob_update(): cannot set /localbus/ranges "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -195,7 +195,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "brg-frequency", brg_data,
sizeof(brg_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /soc/cpm/brg-frequency "
+   printf("ft_blob_update(): cannot set /soc/cpm/brg-frequency "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -209,7 +209,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "mac-address", 
bd->bi_enetaddr,
sizeof(uchar) * 6);
if 

[U-Boot-Users] [PATCH, resend] FDT memory and pci node fixes for MPC8260ADS

2008-07-06 Thread Matvejchikov Ilya
Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED]>
---
 board/freescale/mpc8260ads/mpc8260ads.c |   27 +++
 cpu/mpc8260/pci.c   |   12 
 include/configs/MPC8260ADS.h|7 +++
 3 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mpc8260ads/mpc8260ads.c
b/board/freescale/mpc8260ads/mpc8260ads.c
index 6f683f0..8ab7d35 100644
--- a/board/freescale/mpc8260ads/mpc8260ads.c
+++ b/board/freescale/mpc8260ads/mpc8260ads.c
@@ -46,6 +46,10 @@
 #ifdef CONFIG_PCI
 #include 
 #endif
+#ifdef CONFIG_OF_LIBFDT
+#include 
+#include 
+#endif

 /*
  * I/O Port configuration table
@@ -544,3 +548,26 @@ void pci_init_board(void)
pci_mpc8250_init(&hose);
 }
 #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
diff --git a/cpu/mpc8260/pci.c b/cpu/mpc8260/pci.c
index 75c6ab2..940f5c0 100644
--- a/cpu/mpc8260/pci.c
+++ b/cpu/mpc8260/pci.c
@@ -33,6 +33,10 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_OF_LIBFDT
+#include 
+#include 
+#endif

 #if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272 || defined CONFIG_PM826
 DECLARE_GLOBAL_DATA_PTR;
@@ -449,4 +453,12 @@ void pci_mpc8250_init (struct pci_controller *hose)
immap->im_pci.pci_emr |= cpu_to_le32 (PCI_ERROR_PCI_NO_RSP);
 }

+#if defined(CONFIG_OF_LIBFDT)
+void ft_pci_setup(void *blob, bd_t *bd)
+{
+   do_fixup_by_prop_u32(blob, "device_type", "pci", 4,
+   "clock-frequency", bd->pci_clk, 1);
+}
+#endif
+
 #endif /* CONFIG_PCI */
diff --git a/include/configs/MPC8260ADS.h b/include/configs/MPC8260ADS.h
index 23508f9..59d0bdb 100644
--- a/include/configs/MPC8260ADS.h
+++ b/include/configs/MPC8260ADS.h
@@ -197,6 +197,13 @@

 #define CONFIG_BAUDRATE115200

+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#if defined(CONFIG_OF_LIBFDT)
+#define OF_CPU "[EMAIL PROTECTED]"
+#define OF_TBCLK   (bd->bi_busfreq / 4)
+#endif
+
 /*
  * BOOTP options
  */
-- 
1.5.6.1

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Some copy-n-paste fixes in printf usage

2008-06-07 Thread Matvejchikov Ilya
>From 9bdd14533d7c6f0af336b59a2a026093be84eff9 Mon Sep 17 00:00:00 2001
From: Matvejchikov Ilya <[EMAIL PROTECTED](none)>
Date: Sat, 7 Jun 2008 17:01:42 +0400
Subject: [PATCH] Some copy-n-paste fixes in printf usage


Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED](none)>
---
 board/cm5200/cm5200.c   |2 +-
 board/ids8247/ids8247.c |2 +-
 board/mgcoge/mgcoge.c   |6 +++---
 board/mgsuvd/mgsuvd.c   |8 
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/board/cm5200/cm5200.c b/board/cm5200/cm5200.c
index 79fb71d..9548619 100644
--- a/board/cm5200/cm5200.c
+++ b/board/cm5200/cm5200.c
@@ -275,7 +275,7 @@ static void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);

if (ret < 0) {
-   printf("ft_blob_update): cannot set /memory/reg "
+   printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
 }
diff --git a/board/ids8247/ids8247.c b/board/ids8247/ids8247.c
index 7176770..c4eddfa 100644
--- a/board/ids8247/ids8247.c
+++ b/board/ids8247/ids8247.c
@@ -334,7 +334,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);

if (ret < 0) {
-   printf("ft_blob_update): cannot set /memory/reg "
+   printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
 }
diff --git a/board/mgcoge/mgcoge.c b/board/mgcoge/mgcoge.c
index e7c3fa0..4945a99 100644
--- a/board/mgcoge/mgcoge.c
+++ b/board/mgcoge/mgcoge.c
@@ -307,7 +307,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "reg", memory_data,
sizeof(memory_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /memory/reg "
+   printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -327,7 +327,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "ranges", flash_data,
sizeof(flash_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /localbus/ranges "
+   printf("ft_blob_update(): cannot set /localbus/ranges "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -341,7 +341,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "mac-address", 
bd->bi_enetaddr,
sizeof(uchar) * 6);
if (ret < 0)
-   printf("ft_blob_update): cannot set 
/soc/cpm/ethernet/mac-address "
+   printf("ft_blob_update(): cannot set 
/soc/cpm/ethernet/mac-address "
"property err:%s\n", fdt_strerror(ret));
}
else {
diff --git a/board/mgsuvd/mgsuvd.c b/board/mgsuvd/mgsuvd.c
index e0123bf..944a5f8 100644
--- a/board/mgsuvd/mgsuvd.c
+++ b/board/mgsuvd/mgsuvd.c
@@ -164,7 +164,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "reg", memory_data,
sizeof(memory_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /memory/reg "
+   printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -180,7 +180,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "ranges", flash_data,
sizeof(flash_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /localbus/ranges "
+   printf("ft_blob_update(): cannot set /localbus/ranges "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -195,7 +195,7 @@ void ft_blob_update(void *blob, bd_t *bd)
ret = fdt_setprop(blob, nodeoffset, "brg-frequency", brg_data,
sizeof(brg_data));
if (ret < 0)
-   printf("ft_blob_update): cannot set /soc/cpm/brg-frequency "
+   printf("ft_blob_update(): cannot set /soc/cpm/brg-frequency "
"property err:%s\n", fdt_strerror(ret));
}
else {
@@ -209,7 

[U-Boot-Users] [PATCH] FDT memory and pci node fixes for MPC8260ADS

2008-06-07 Thread Matvejchikov Ilya
>From 3c7a1b900ab7b473fed62398fc76a16fa9c5940a Mon Sep 17 00:00:00 2001
From: Matvejchikov Ilya <[EMAIL PROTECTED](none)>
Date: Sat, 7 Jun 2008 16:57:14 +0400
Subject: [PATCH] FDT memory and pci fixes for MPC8260ADS


Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED](none)>
---
 board/freescale/mpc8260ads/mpc8260ads.c |   27 +++
 cpu/mpc8260/pci.c   |   12 
 include/configs/MPC8260ADS.h|7 +++
 3 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mpc8260ads/mpc8260ads.c
b/board/freescale/mpc8260ads/mpc8260ads.c
index 93550e2..44a68fe 100644
--- a/board/freescale/mpc8260ads/mpc8260ads.c
+++ b/board/freescale/mpc8260ads/mpc8260ads.c
@@ -46,6 +46,10 @@
 #ifdef CONFIG_PCI
 #include 
 #endif
+#ifdef CONFIG_OF_LIBFDT
+#include 
+#include 
+#endif

 /*
  * I/O Port configuration table
@@ -544,3 +548,26 @@ void pci_init_board(void)
pci_mpc8250_init(&hose);
 }
 #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
diff --git a/cpu/mpc8260/pci.c b/cpu/mpc8260/pci.c
index 75c6ab2..940f5c0 100644
--- a/cpu/mpc8260/pci.c
+++ b/cpu/mpc8260/pci.c
@@ -33,6 +33,10 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_OF_LIBFDT
+#include 
+#include 
+#endif

 #if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272 || defined CONFIG_PM826
 DECLARE_GLOBAL_DATA_PTR;
@@ -449,4 +453,12 @@ void pci_mpc8250_init (struct pci_controller *hose)
immap->im_pci.pci_emr |= cpu_to_le32 (PCI_ERROR_PCI_NO_RSP);
 }

+#if defined(CONFIG_OF_LIBFDT)
+void ft_pci_setup(void *blob, bd_t *bd)
+{
+   do_fixup_by_prop_u32(blob, "device_type", "pci", 4,
+   "clock-frequency", bd->pci_clk, 1);
+}
+#endif
+
 #endif /* CONFIG_PCI */
diff --git a/include/configs/MPC8260ADS.h b/include/configs/MPC8260ADS.h
index 23508f9..59d0bdb 100644
--- a/include/configs/MPC8260ADS.h
+++ b/include/configs/MPC8260ADS.h
@@ -197,6 +197,13 @@

 #define CONFIG_BAUDRATE115200

+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#if defined(CONFIG_OF_LIBFDT)
+#define OF_CPU "[EMAIL PROTECTED]"
+#define OF_TBCLK   (bd->bi_busfreq / 4)
+#endif
+
 /*
  * BOOTP options
  */
-- 
1.5.3.7

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users