Skip to contentSkip to conversation

FDT memory and pci node fixes for MPC8260ADS

PATCH RESEND Superseded Matvejchikov Ilya 2 participants 5 messages Jul 6, 2008 – Jul 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 FDT memory and pci node fixes for MPC8260ADS

---
 board/freescale/mpc8260ads/mpc8260ads.c |   27 +++++++++++++++++++++++++++
 cpu/mpc8260/pci.c                       |   12 ++++++++++++
 include/configs/MPC8260ADS.h            |    7 +++++++
 3 files changed, 46 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/board/freescale/mpc8260ads/mpc8260ads.c
index 6f683f0..8ab7d35 100644

board/freescale/mpc8260ads/mpc8260ads.c +27 -0
@@ -46,6 +46,10 @@
 #ifdef CONFIG_PCI
 #include <pci.h>
 #endif
+#ifdef CONFIG_OF_LIBFDT
+#include <libfdt.h>
+#include <fdt_support.h>
+#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
cpu/mpc8260/pci.c +12 -0
index 75c6ab2..940f5c0 100644
@@ -33,6 +33,10 @@
 #include <mpc8260.h>
 #include <asm/m8260_pci.h>
 #include <asm/io.h>
+#ifdef CONFIG_OF_LIBFDT
+#include <libfdt.h>
+#include <fdt_support.h>
+#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 */
include/configs/MPC8260ADS.h +7 -0
index 23508f9..59d0bdb 100644
@@ -197,6 +197,13 @@
 
 #define CONFIG_BAUDRATE		115200
 
+#define CONFIG_OF_LIBFDT	1
+#define CONFIG_OF_BOARD_SETUP	1
+#if defined(CONFIG_OF_LIBFDT)
+#define OF_CPU			"cpu at 0"
+#define OF_TBCLK		(bd->bi_busfreq / 4)
+#endif
+
 /*
  * BOOTP options
  */
Signature · 1 line
1.5.6.1
#1 lore raw

PATCH RESEND 1/1 FDT memory and pci node fixes for MPC8260ADS

Quoted 6 lines · In message <[email protected]> you…
---
 board/freescale/mpc8260ads/mpc8260ads.c |   27 +++++++++++++++++++++++++++
 cpu/mpc8260/pci.c                       |   12 ++++++++++++
 include/configs/MPC8260ADS.h            |    7 +++++++
 3 files changed, 46 insertions(+), 0 deletions(-)

Applied, 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
A verbal contract isn't worth the paper it's written on.
                                                    -- Samuel Goldwyn
#2 lore raw

PATCH RESEND 1/1 FDT memory and pci node fixes for MPC8260ADS

In reply to Matvejchikov Ilya
Quoted 6 lines · In message <[email protected]> you…
---
 board/freescale/mpc8260ads/mpc8260ads.c |   27 +++++++++++++++++++++++++++
 cpu/mpc8260/pci.c                       |   12 ++++++++++++
 include/configs/MPC8260ADS.h            |    7 +++++++
 3 files changed, 46 insertions(+), 0 deletions(-)

...

Quoted 14 lines
cpu/mpc8260/pci.c +4 -0
@@ -33,6 +33,10 @@
 #include <mpc8260.h>
 #include <asm/m8260_pci.h>
 #include <asm/io.h>
+#ifdef CONFIG_OF_LIBFDT
+#include <libfdt.h>
+#include <fdt_support.h>
+#endif
 
 #if defined CONFIG_MPC8266ADS || defined CONFIG_MPC8272 || defined CONFIG_PM826
 DECLARE_GLOBAL_DATA_PTR;

cpu/mpc8260/pci.c void pci_mpc8250_init (struct pci_controller *hose) · line 462

Quoted 10 lines
cpu/mpc8260/pci.c +7 -0
@@ -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

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?

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
Drun'? 'm not drun'! You woudn' dare call m' drun' if I was sober!
                                     - Terry Pratchett, _Men at Arms_
#3 lore raw

PATCH RESEND 1/1 FDT memory and pci node fixes for MPC8260ADS

Quoted 10 lines

cpu/mpc8260/pci.c void pci_mpc8250_init (struct pci_controller *hose) · line 462

Quoted 7 lines
cpu/mpc8260/pci.c +7 -0
+#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:

Quoted 8 lines

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.

#4 lore raw

PATCH RESEND 1/1 FDT memory and pci node fixes for MPC8260ADS

Quoted 16 lines · In message <[email protected]> you…
Quoted 16 lines

cpu/mpc8260/pci.c void pci_mpc8250_init (struct pci_controller *hose) · line 462

Quoted 7 lines
cpu/mpc8260/pci.c +7 -0
+#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

Quoted 5 lines
Quoted 2 lines

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.

Can you please submit a patch?

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 X11 source code style is ATROCIOUS and should not be used  as  a
model."                                                   - Doug Gwyn