Skip to contentSkip to conversation

fdt: add fdt_del_node_by_path() API

PATCH New Li Yang 3 participants 8 messages Dec 10, 2009

lore
Share & tools
lore

Li Yang

author
#0 lore raw

PATCH 1/5 fdt: add fdt_del_node_by_path() API

For removing node easily by path or alias.

---
 common/fdt_support.c  |   10 ++++++++++
 include/fdt_support.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)
common/fdt_support.c +10 -0
index f89a3ee..8f1186e 100644
@@ -757,3 +757,13 @@ int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size)
 	return -1;
 }
 #endif
+
+int fdt_del_node_by_path(void *fdt, const char *path)
+{
+	int off = fdt_path_offset(fdt, path);
+
+	if (off >= 0)
+		return fdt_del_node(fdt, off);
+	else
+		return off;
+}
include/fdt_support.h +1 -0
index 0a9dd0d..d0705d1 100644
@@ -80,6 +80,7 @@ void set_working_fdt_addr(void *addr);
 int fdt_resize(void *blob);
 
 int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size);
+int fdt_del_node_by_path(void *fdt, const char *path);
 
 #endif /* ifdef CONFIG_OF_LIBFDT */
 #endif /* ifndef __FDT_SUPPORT_H */
Signature · 1 line
1.6.4
author
#1 lore raw

PATCH 2/5 fsl_law: add SRIO2 target id and law_size_bits() macro

---
 include/asm-ppc/fsl_law.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/asm-ppc/fsl_law.h +3 -0
index 31bb754..34c56a2 100644
@@ -46,6 +46,8 @@ enum law_size {
 	LAW_SIZE_32G,
 };
 
+#define law_size_bits(sz)	(__ilog2_u64(sz) - 1)
+
 #ifdef CONFIG_FSL_CORENET
 enum law_trgt_if {
 	LAW_TRGT_IF_PCIE_1 = 0x00,
@@ -78,6 +80,7 @@ enum law_trgt_if {
 	LAW_TRGT_IF_CCSR = 0x08,
 	LAW_TRGT_IF_DDR_INTRLV = 0x0b,
 	LAW_TRGT_IF_RIO = 0x0c,
+	LAW_TRGT_IF_RIO_2 = 0x0d,
 	LAW_TRGT_IF_DDR = 0x0f,
 	LAW_TRGT_IF_DDR_2 = 0x16,	/* 2nd controller */
 };
Signature · 1 line
1.6.4
author
#2 lore raw

PATCH 3/5 85xx: add common serdes ports configuration code

Add common board configuration code which uses serdes configuration information gotten from common fsl_serdes APIs to initialize peripheral ports like PCIE, SGMII and SRIO. Disable unused block when not configured.

Also update device trees to remove unused nodes to prevent these devices/buses being initialized in kernel.

---
 cpu/mpc85xx/Makefile         |    1 +
 cpu/mpc85xx/cpu_init.c       |   14 ++--
 cpu/mpc85xx/serdes.c         |  217 ++++++++++++++++++++++++++++++++++++++++++
 include/asm-ppc/fsl_serdes.h |   50 ++++++++++
 4 files changed, 275 insertions(+), 7 deletions(-)
 create mode 100644 cpu/mpc85xx/serdes.c
cpu/mpc85xx/Makefile +1 -0
index 56de7eb..018ebc9 100644
@@ -62,6 +62,7 @@ COBJS-$(CONFIG_MPC8536) += mpc8536_serdes.o
 COBJS-$(CONFIG_PCI)	+= pci.o
 COBJS-$(CONFIG_QE)	+= qe_io.o
 COBJS-$(CONFIG_CPM2)	+= serial_scc.o
+COBJS-$(CONFIG_FSL_SERDES)	+= serdes.o
 
 COBJS	= $(COBJS-y)
 COBJS	+= cpu.o
cpu/mpc85xx/cpu_init.c +7 -7
index 0041a60..05133d3 100644
@@ -33,14 +33,11 @@
 #include <asm/io.h>
 #include <asm/mmu.h>
 #include <asm/fsl_law.h>
+#include <asm/fsl_serdes.h>
 #include "mp.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_MPC8536
-extern void fsl_serdes_init(void);
-#endif
-
 #ifdef CONFIG_QE
 extern qe_iop_conf_t qe_iop_conf_tab[];
 extern void qe_config_iopin(u8 port, u8 pin, int dir,
@@ -237,9 +234,7 @@ void cpu_init_f (void)
 	/* Config QE ioports */
 	config_qe_ioports();
 #endif
-#if defined(CONFIG_MPC8536)
-	fsl_serdes_init();
-#endif
+
 #if defined(CONFIG_FSL_DMA)
 	dma_init();
 #endif
@@ -374,6 +369,11 @@ int cpu_init_r(void)
 	qe_reset();
 #endif
 
+	/* XXX: remove MPC8536 eventually */
+#if defined(CONFIG_FSL_SERDES) || defined(CONFIG_MPC8536)
+	fsl_serdes_init();
+#endif
+
 #if defined(CONFIG_MP)
 	setup_mp();
 #endif
cpu/mpc85xx/serdes.c new file +217 -0

217 lines not on this page · raw message

include/asm-ppc/fsl_serdes.h +50 -0

61 lines not on this page · raw message

Signature · 1 line
1.6.4
author
#3 lore raw

PATCH 4/5 p2020: add serdes status code complying to fsl_serdes APIs

---
 cpu/mpc85xx/Makefile       |    1 +
 cpu/mpc85xx/p2020_serdes.c |   89 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+), 0 deletions(-)
 create mode 100644 cpu/mpc85xx/p2020_serdes.c
cpu/mpc85xx/Makefile +1 -0
index 018ebc9..457a45f 100644
@@ -63,6 +63,7 @@ COBJS-$(CONFIG_PCI)	+= pci.o
 COBJS-$(CONFIG_QE)	+= qe_io.o
 COBJS-$(CONFIG_CPM2)	+= serial_scc.o
 COBJS-$(CONFIG_FSL_SERDES)	+= serdes.o
+COBJS-$(CONFIG_P2020)	+= p2020_serdes.o
 
 COBJS	= $(COBJS-y)
 COBJS	+= cpu.o
cpu/mpc85xx/p2020_serdes.c new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
1.6.4
author
#4 lore raw

PATCH 5/5 p2020ds: use common code to initialize serdes ports

Setting up LAWs, PCIE, SRIO, SGMII intelligently
based on the power-on serdes configuration.

---
 board/freescale/p2020ds/law.c     |    6 --
 board/freescale/p2020ds/p2020ds.c |  126 ++-----------------------------------
 include/configs/P2020DS.h         |   21 ++++++
 3 files changed, 27 insertions(+), 126 deletions(-)
board/freescale/p2020ds/law.c +0 -6
index 28ed2ed..c90c9ae 100644
@@ -29,12 +29,6 @@
 
 struct law_entry law_table[] = {
 	SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
-	SET_LAW(CONFIG_SYS_PCIE1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCIE_1),
-	SET_LAW(CONFIG_SYS_PCIE1_IO_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_PCIE_1),
-	SET_LAW(CONFIG_SYS_PCIE2_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCIE_2),
-	SET_LAW(CONFIG_SYS_PCIE2_IO_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_PCIE_2),
-	SET_LAW(CONFIG_SYS_PCIE3_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCIE_3),
-	SET_LAW(CONFIG_SYS_PCIE3_IO_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_PCIE_3),
 	SET_LAW(PIXIS_BASE_PHYS, LAW_SIZE_4K, LAW_TRGT_IF_LBC),
 	SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
 };
board/freescale/p2020ds/p2020ds.c +6 -120

159 lines not on this page · raw message

include/configs/P2020DS.h +21 -0
index b48c199..406afc7 100644
@@ -39,6 +39,7 @@
 #define CONFIG_P2020DS		1
 #define CONFIG_MP		1	/* support multiple processors */
 
+#define CONFIG_FSL_SERDES	1	/* Use common serdes init code */
 #define CONFIG_FSL_ELBC		1	/* Has Enhanced localbus controller */
 #define CONFIG_PCI		1	/* Enable PCI/PCIE */
 #define CONFIG_PCIE1		1	/* PCIE controler 1 (slot 1) */
@@ -519,6 +520,26 @@ extern unsigned long calculate_board_ddr_clk(unsigned long dummy);
 #define CONFIG_SYS_ISA_IO_BASE_ADDRESS VIDEO_IO_OFFSET
 #endif
 
+#define CONFIG_SRIO
+
+/* SRIO1 uses the same window as PCIE2 mem window */
+#define CONFIG_SYS_SRIO1_MEM_VIRT	0xa0000000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_SRIO1_MEM_PHYS	0xc20000000ull
+#else
+#define CONFIG_SYS_SRIO1_MEM_PHYS	0xa0000000
+#endif
+#define CONFIG_SYS_SRIO1_MEM_SIZE	0x20000000	/* 512M */
+
+/* SRIO2 uses the same window as PCIE1 mem window */
+#define CONFIG_SYS_SRIO2_MEM_VIRT	0xc0000000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_SRIO2_MEM_PHYS	0xc40000000ull
+#else
+#define CONFIG_SYS_SRIO2_MEM_PHYS	0xc0000000
+#endif
+#define CONFIG_SYS_SRIO2_MEM_SIZE	0x20000000	/* 512M */
+
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP			/* do pci plug-and-play */
 
Signature · 1 line
1.6.4
#6 lore raw

PATCH 1/5 fdt: add fdt_del_node_by_path() API

In reply to Li Yang
Quoted 7 lines · Li Yang

For removing node easily by path or alias.

---
common/fdt_support.c | 10 ++++++++++
include/fdt_support.h | 1 +

2 files changed, 11 insertions(+), 0 deletions(-)

Jerry,

If you can ack this I'll handling pulling this in via the 85xx tree.

- k

#7 lore raw

PATCH 1/5 fdt: add fdt_del_node_by_path() API

Quoted 10 lines · Kumar Gala
Quoted 7 lines · Li Yang

For removing node easily by path or alias.

---
common/fdt_support.c | 10 ++++++++++
include/fdt_support.h | 1 +

2 files changed, 11 insertions(+), 0 deletions(-)
Quoted 5 lines

Jerry,

If you can ack this I'll handling pulling this in via the 85xx tree.

- k

Thanks,
gvb