Skip to contentSkip to conversation

ppc4xx: Add DLVision-10G board support

PATCH Superseded Dirk Eibach 2 participants 2 messages Jan 19, 2011 PowerPC

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ppc4xx: Add DLVision-10G board support

Board support for the Guntermann & Drunck DLVision-10G. Adds support for multiple FPGAs per board for gdsys 405ep architecture.
Adds support for dual link osd hardware for gdsys 405ep.

---
Replaces
- 0001-ppc4xx-Add-DLVision-10G-board-support.patch
- 0002-ppc4xx-Support-multiple-FPGAs.patch
- 0003-ppc4xx-Support-dual-link-OSD.patch

Changes for v2:
- define EBC register values through appropriate macros
- fix condition for extension of struct global_data

Changes for v3:
- added missing commits from v2

Conversion to struct based register access will follow in a sperate patch.

 MAINTAINERS                            |    1 +
 arch/powerpc/include/asm/global_data.h |    3 +
 board/gdsys/405ep/405ep.c              |   64 +++++--
 board/gdsys/405ep/Makefile             |    1 +
 board/gdsys/405ep/dlvision-10g.c       |  243 ++++++++++++++++++++++++
 board/gdsys/405ep/io.c                 |    8 +-
 board/gdsys/405ep/iocon.c              |   14 +-
 board/gdsys/common/Makefile            |    1 +
 board/gdsys/common/fpga.h              |   16 ++-
 board/gdsys/common/osd.c               |  303 +++++++++++++++++++++++--------
 board/gdsys/common/osd.h               |    2 +-
 boards.cfg                             |    1 +
 include/configs/dlvision-10g.h         |  322 ++++++++++++++++++++++++++++++++
 include/configs/io.h                   |    7 +-
 include/configs/iocon.h                |   27 +++-
 15 files changed, 907 insertions(+), 106 deletions(-)
 create mode 100644 board/gdsys/405ep/dlvision-10g.c
 create mode 100644 include/configs/dlvision-10g.h
MAINTAINERS +1 -0
index 0590ad9..ea882c8 100644
@@ -142,6 +142,7 @@ Dirk Eibach <[email protected]>
 
 	devconcenter	PPC460EX
 	dlvision        PPC405EP
+	dlvision-10g	PPC405EP
 	gdppc440etx	PPC440EP/GR
 	intip		PPC460EX
 	io		PPC405EP
arch/powerpc/include/asm/global_data.h +3 -0
index 2e218de..a33ca2f 100644
@@ -172,6 +172,9 @@ typedef	struct	global_data {
 #if defined(CONFIG_LWMON) || defined(CONFIG_LWMON5)
 	unsigned long kbd_status;
 #endif
+#ifdef CONFIG_SYS_FPGA_COUNT
+	unsigned fpga_state[CONFIG_SYS_FPGA_COUNT];
+#endif
 #if defined(CONFIG_WD_MAX_RATE)
 	unsigned long long wdt_last;	/* trace watch-dog triggering rate */
 #endif
board/gdsys/405ep/405ep.c +52 -12

91 lines not on this page · raw message

board/gdsys/405ep/Makefile +1 -0
index ed31207..169418c 100644
@@ -27,6 +27,7 @@ LIB	= $(obj)lib$(BOARD).o
 
 COBJS-$(CONFIG_IO) += io.o
 COBJS-$(CONFIG_IOCON) += iocon.o
+COBJS-$(CONFIG_DLVISION_10G) += dlvision-10g.o
 
 COBJS   := $(BOARD).o $(COBJS-y)
 SOBJS   =
board/gdsys/405ep/dlvision-10g.c new file +243 -0

243 lines not on this page · raw message

board/gdsys/405ep/io.c +4 -4
index 80877b6..b2c02bf 100644
@@ -95,9 +95,9 @@ err_out:
 int checkboard(void)
 {
 	char *s = getenv("serial#");
-	u16 versions = fpga_get_reg(REG_VERSIONS);
-	u16 fpga_version = fpga_get_reg(REG_FPGA_VERSION);
-	u16 fpga_features = fpga_get_reg(REG_FPGA_FEATURES);
+	u16 versions = fpga_get_reg(0, REG_VERSIONS);
+	u16 fpga_version = fpga_get_reg(0, REG_FPGA_VERSION);
+	u16 fpga_features = fpga_get_reg(0, REG_FPGA_FEATURES);
 	unsigned unit_type;
 	unsigned hardware_version;
 	unsigned feature_channels;
@@ -175,7 +175,7 @@ int last_stage_init(void)
 		configure_gbit_phy(k);
 
 	/* take fpga serdes blocks out of reset */
-	fpga_set_reg(REG_QUAD_SERDES_RESET, 0);
+	fpga_set_reg(0, REG_QUAD_SERDES_RESET, 0);
 
 	return 0;
 }
board/gdsys/405ep/iocon.c +7 -7
index ecd6cb2..d5196c1 100644
@@ -75,9 +75,9 @@ enum {
 int checkboard(void)
 {
 	char *s = getenv("serial#");
-	u16 versions = fpga_get_reg(REG_VERSIONS);
-	u16 fpga_version = fpga_get_reg(REG_FPGA_VERSION);
-	u16 fpga_features = fpga_get_reg(REG_FPGA_FEATURES);
+	u16 versions = fpga_get_reg(0, REG_VERSIONS);
+	u16 fpga_version = fpga_get_reg(0, REG_FPGA_VERSION);
+	u16 fpga_features = fpga_get_reg(0, REG_FPGA_FEATURES);
 	unsigned unit_type;
 	unsigned hardware_version;
 	unsigned feature_compression;
@@ -214,7 +214,7 @@ int checkboard(void)
 
 int last_stage_init(void)
 {
-	return osd_probe();
+	return osd_probe(0);
 }
 
 /*
@@ -222,15 +222,15 @@ int last_stage_init(void)
  */
 void fpga_gpio_set(int pin)
 {
-	out_le16((void *)(CONFIG_SYS_FPGA_BASE + 0x18), pin);
+	out_le16((void *)(CONFIG_SYS_FPGA0_BASE + 0x18), pin);
 }
 
 void fpga_gpio_clear(int pin)
 {
-	out_le16((void *)(CONFIG_SYS_FPGA_BASE + 0x16), pin);
+	out_le16((void *)(CONFIG_SYS_FPGA0_BASE + 0x16), pin);
 }
 
 int fpga_gpio_get(int pin)
 {
-	return in_le16((void *)(CONFIG_SYS_FPGA_BASE + 0x14)) & pin;
+	return in_le16((void *)(CONFIG_SYS_FPGA0_BASE + 0x14)) & pin;
 }
board/gdsys/common/Makefile +1 -0
index 2257037..4c7fc99 100644
@@ -31,6 +31,7 @@ LIB	= $(obj)lib$(VENDOR).o
 
 COBJS-$(CONFIG_IO) += miiphybb.o
 COBJS-$(CONFIG_IOCON) += osd.o
+COBJS-$(CONFIG_DLVISION_10G) += osd.o
 
 COBJS   := $(COBJS-y)
 SOBJS   =
board/gdsys/common/fpga.h +12 -4
index c1434e7..29846b7 100644
@@ -24,14 +24,22 @@
 #ifndef _FPGA_H_
 #define _FPGA_H_
 
-static inline u16 fpga_get_reg(unsigned reg)
+enum {
+	FPGA_STATE_DONE_FAILED = 1 << 0,
+	FPGA_STATE_REFLECTION_FAILED = 1 << 1,
+};
+
+int get_fpga_state(unsigned dev);
+void print_fpga_state(unsigned dev);
+
+static inline u16 fpga_get_reg(unsigned dev, unsigned reg)
 {
-	return in_le16((void *)(CONFIG_SYS_FPGA_BASE + reg));
+	return in_le16((void *)(CONFIG_SYS_FPGA_BASE(dev) + reg));
 }
 
-static inline void fpga_set_reg(unsigned reg, u16 val)
+static inline void fpga_set_reg(unsigned dev, unsigned reg, u16 val)
 {
-	return out_le16((void *)(CONFIG_SYS_FPGA_BASE + reg), val);
+	return out_le16((void *)(CONFIG_SYS_FPGA_BASE(dev) + reg), val);
 }
 
 #endif
board/gdsys/common/osd.c +229 -74

374 lines not on this page · raw message

board/gdsys/common/osd.h +1 -1
index 4431cbc..c59d9c3 100644
@@ -24,6 +24,6 @@
 #ifndef _OSD_H_
 #define _OSD_H_
 
-int osd_probe(void);
+int osd_probe(unsigned screen);
 
 #endif
boards.cfg +1 -0
index dcd5a12..4a40685 100644
@@ -713,6 +713,7 @@ VOM405                       powerpc     ppc4xx      vom405              esd
 WUH405                       powerpc     ppc4xx      wuh405              esd
 devconcenter                 powerpc     ppc4xx      intip               gdsys          -           intip:DEVCONCENTER
 dlvision                     powerpc     ppc4xx      -                   gdsys
+dlvision-10g                 powerpc     ppc4xx      405ep               gdsys
 gdppc440etx                  powerpc     ppc4xx      -                   gdsys
 intip                        powerpc     ppc4xx      intip               gdsys          -           intip:INTIB
 io                           powerpc     ppc4xx      405ep               gdsys
include/configs/dlvision-10g.h new file +322 -0

322 lines not on this page · raw message

include/configs/io.h +6 -1
index a66c704..e287ad9 100644
@@ -229,14 +229,19 @@
 #define CONFIG_SYS_EBC_PB1CR		0x7f318000
 
 /* Memory Bank 2 (FPGA) initialization */
-#define CONFIG_SYS_FPGA_BASE		0x7f100000
+#define CONFIG_SYS_FPGA0_BASE		0x7f100000
 #define CONFIG_SYS_EBC_PB2AP		0x02025080
 /* BAS=0x7f1,BS=1MB,BU=R/W,BW=16bit */
 #define CONFIG_SYS_EBC_PB2CR		0x7f11a000
 
+#define CONFIG_SYS_FPGA_BASE(k)		CONFIG_SYS_FPGA0_BASE
+#define CONFIG_SYS_FPGA_DONE(k)		0x0010
+
 #define CONFIG_SYS_FPGA_RFL_LOW		0x0000
 #define CONFIG_SYS_FPGA_RFL_HIGH	0x3ffe
 
+#define CONFIG_SYS_FPGA_COUNT		1
+
 /* Memory Bank 3 (Latches) initialization */
 #define CONFIG_SYS_LATCH_BASE		0x7f200000
 #define CONFIG_SYS_EBC_PB3AP		0xa2015480
include/configs/iocon.h +24 -3
index 5e61b11..c713915 100644
@@ -131,6 +131,12 @@ int fpga_gpio_get(int pin);
 #define I2C_DELAY	udelay(25)	/* 1/4 I2C clock duration */
 
 /*
+ * OSD hardware
+ */
+#define CONFIG_SYS_MPC92469AC
+#define CONFIG_SYS_CH7301
+
+/*
  * FLASH organization
  */
 #define CONFIG_SYS_FLASH_CFI		/* The flash is CFI compatible	*/
@@ -231,14 +237,22 @@ int fpga_gpio_get(int pin);
 #define CONFIG_SYS_EBC_PB1AP		0x92015480
 #define CONFIG_SYS_EBC_PB1CR		0xFB858000
 
-/* Memory Bank 2 (FPGA) initialization */
-#define CONFIG_SYS_FPGA_BASE		0x7f100000
+/* Memory Bank 2 (FPGA0) initialization */
+#define CONFIG_SYS_FPGA0_BASE		0x7f100000
 #define CONFIG_SYS_EBC_PB2AP		0x02825080
-#define CONFIG_SYS_EBC_PB2CR		(CONFIG_SYS_FPGA_BASE | 0x1a000)
+#define CONFIG_SYS_EBC_PB2CR		(CONFIG_SYS_FPGA0_BASE | 0x1a000)
+
+#define CONFIG_SYS_FPGA_BASE(k)		CONFIG_SYS_FPGA0_BASE
+#define CONFIG_SYS_FPGA_DONE(k)		0x0010
 
 #define CONFIG_SYS_FPGA_RFL_LOW		0x0000
 #define CONFIG_SYS_FPGA_RFL_HIGH	0x00fe
 
+#define CONFIG_SYS_FPGA_OSD_BASE	0x0100
+#define CONFIG_SYS_FPGA_OSD_MEM		0x0800
+
+#define CONFIG_SYS_FPGA_COUNT		1
+
 /* Memory Bank 3 (Latches) initialization */
 #define CONFIG_SYS_LATCH_BASE		0x7f200000
 #define CONFIG_SYS_EBC_PB3AP		0x02025080
@@ -249,4 +263,11 @@ int fpga_gpio_get(int pin);
 #define CONFIG_SYS_LATCH1_RESET		0xffff
 #define CONFIG_SYS_LATCH1_BOOT		0xffff
 
+/*
+ * OSD Setup
+ */
+#define CONFIG_SYS_MPC92469AC
+#define CONFIG_SYS_CH7301
+#define CONFIG_SYS_OSD_SCREENS		CONFIG_SYS_FPGA_COUNT
+
 #endif	/* __CONFIG_H */
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH v3 1/1 ppc4xx: Add DLVision-10G board support

Dear Dirk Eibach,

Quoted 12 lines · In message <[email protected]> you wrote:

Board support for the Guntermann & Drunck DLVision-10G. Adds support for multiple FPGAs per board for gdsys 405ep architecture.
Adds support for dual link osd hardware for gdsys 405ep.

---
Replaces
- 0001-ppc4xx-Add-DLVision-10G-board-support.patch
- 0002-ppc4xx-Support-multiple-FPGAs.patch
- 0003-ppc4xx-Support-dual-link-OSD.patch

Quoted 8 lines

Changes for v2:
- define EBC register values through appropriate macros
- fix condition for extension of struct global_data

Changes for v3:
- added missing commits from v2

Conversion to struct based register access will follow in a sperate patch.

What does that mean? We need a single patch that includes everything at once.

Best regards,

Wolfgang Denk

Signature · 7 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
Winners never talk about glorious victories. That's  because  they're
the  ones  who  see  what the battlefield looks like afterwards. It's
only the losers who have glorious victories.
                                      - Terry Pratchett, _Small Gods_