Skip to contentSkip to conversation

Fixes on gdsys boards and some new functionality

PATCH New dirk.eibach at gdsys.cc 4 participants 49 messages Oct 28, 2015 – Nov 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Fixes on gdsys boards and some new functionality

From: Dirk Eibach <[email protected]>

Dirk Eibach (17):
i2c: ihs_i2c: Dual channel support
i2c: ihs_i2c: Use macro bestpractices
i2c: ihs_i2c: Fix hold_bus control
board: gdsys: Configure DP501 SPDIF input
board: gdsys: Increase DP501 I2C retry interval
board: gdsys: Consider DP501 limits on link training
dlvision-10g: Support displayport
controlcenterd: Disable sideband clocks
hrcon: Remove CH7301 configuration
mpc83xx: Add strider board
hrcon: Use generic ioep-fpga support
hrcon: Fix videoboard i2c setup
hrcon: Add support for the DH variant
hrcon: Add fan controllers
board: gdsys: Add osdsize command
board: gdsys: Enable osd on output only
i2c: soft_i2c: Fix bus indizes

Reinhard Pfau (1):
iocon: reset FPGAs in last_stage_init()

 README                             |   9 +
 arch/powerpc/cpu/mpc83xx/Kconfig   |   3 +
 board/gdsys/405ep/dlvision-10g.c   |  67 ++--
 board/gdsys/405ep/iocon.c          |   8 +-
 board/gdsys/common/Makefile        |   9 +-
 board/gdsys/common/adv7611.c       | 177 ++++++++++
 board/gdsys/common/adv7611.h       |  13 +
 board/gdsys/common/ch7301.c        |  64 ++++
 board/gdsys/common/ch7301.h        |  13 +
 board/gdsys/common/dp501.c         |  27 +-
 board/gdsys/common/fanctrl.c       |  32 ++
 board/gdsys/common/fanctrl.h       |  13 +
 board/gdsys/common/ioep-fpga.c     | 232 +++++++++++++
 board/gdsys/common/ioep-fpga.h     |  14 +
 board/gdsys/common/osd.c           | 194 +++++++----
 board/gdsys/common/osd.h           |   1 +
 board/gdsys/mpc8308/Kconfig        |  13 +
 board/gdsys/mpc8308/MAINTAINERS    |   4 +
 board/gdsys/mpc8308/Makefile       |   1 +
 board/gdsys/mpc8308/hrcon.c        | 293 +++--------------
 board/gdsys/mpc8308/strider.c      | 479 +++++++++++++++++++++++++++
 board/gdsys/p1022/controlcenterd.c |   5 +
 configs/hrcon_dh_defconfig         |   5 +
 configs/strider_con_defconfig      |   7 +
 configs/strider_cpu_defconfig      |   7 +
 drivers/i2c/ihs_i2c.c              |  82 ++++-
 drivers/i2c/soft_i2c.c             |  64 +++-
 include/configs/dlvision-10g.h     |  18 +-
 include/configs/hrcon.h            |  89 ++++-
 include/configs/strider.h          | 653 +++++++++++++++++++++++++++++++++++++
 include/gdsys_fpga.h               | 101 +++++-
 31 files changed, 2310 insertions(+), 387 deletions(-)
 create mode 100644 board/gdsys/common/adv7611.c
 create mode 100644 board/gdsys/common/adv7611.h
 create mode 100644 board/gdsys/common/ch7301.c
 create mode 100644 board/gdsys/common/ch7301.h
 create mode 100644 board/gdsys/common/fanctrl.c
 create mode 100644 board/gdsys/common/fanctrl.h
 create mode 100644 board/gdsys/common/ioep-fpga.c
 create mode 100644 board/gdsys/common/ioep-fpga.h
 create mode 100644 board/gdsys/mpc8308/strider.c
 create mode 100644 configs/hrcon_dh_defconfig
 create mode 100644 configs/strider_con_defconfig
 create mode 100644 configs/strider_cpu_defconfig
 create mode 100644 include/configs/strider.h
Signature · 1 line
2.1.3
#1 lore raw

PATCH 1/18 i2c: ihs_i2c: Dual channel support

From: Dirk Eibach <[email protected]>

Support two i2c masters per FPGA.

---

 README                |  9 ++++++
 drivers/i2c/ihs_i2c.c | 76 ++++++++++++++++++++++++++++++++++++++++++---------
 include/gdsys_fpga.h  | 12 ++++----
 3 files changed, 79 insertions(+), 18 deletions(-)
README +9 -0
index 0dc657d..25bd711 100644
@@ -2446,6 +2446,15 @@ CBFS (Coreboot Filesystem) support
 		  - CONFIG_SYS_I2C_IHS_CH3 activate hardware channel 3
 		  - CONFIG_SYS_I2C_IHS_SPEED_3 speed channel 3
 		  - CONFIG_SYS_I2C_IHS_SLAVE_3 slave addr channel 3
+		  - activate dual channel with CONFIG_SYS_I2C_IHS_DUAL
+		  - CONFIG_SYS_I2C_IHS_SPEED_0_1 speed channel 0_1
+		  - CONFIG_SYS_I2C_IHS_SLAVE_0_1 slave addr channel 0_1
+		  - CONFIG_SYS_I2C_IHS_SPEED_1_1 speed channel 1_1
+		  - CONFIG_SYS_I2C_IHS_SLAVE_1_1 slave addr channel 1_1
+		  - CONFIG_SYS_I2C_IHS_SPEED_2_1 speed channel 2_1
+		  - CONFIG_SYS_I2C_IHS_SLAVE_2_1 slave addr channel 2_1
+		  - CONFIG_SYS_I2C_IHS_SPEED_3_1 speed channel 3_1
+		  - CONFIG_SYS_I2C_IHS_SLAVE_3_1 slave addr channel 3_1
 
 		additional defines:
 
drivers/i2c/ihs_i2c.c +63 -13

142 lines not on this page · raw message

include/gdsys_fpga.h +7 -5
index 8a5efe7..f8d8322 100644
@@ -143,7 +143,7 @@ struct ihs_fpga {
 	u16 reserved_2[2];	/* 0x001c */
 	struct ihs_io_ep ep;	/* 0x0020 */
 	u16 reserved_3[9];	/* 0x002e */
-	struct ihs_i2c i2c;	/* 0x0040 */
+	struct ihs_i2c i2c0;	/* 0x0040 */
 	u16 reserved_4[10];	/* 0x004c */
 	u16 mc_int;		/* 0x0060 */
 	u16 mc_int_en;		/* 0x0062 */
@@ -177,7 +177,7 @@ struct ihs_fpga {
 	u16 reserved_2[2];	/* 0x001c */
 	struct ihs_io_ep ep;	/* 0x0020 */
 	u16 reserved_3[9];	/* 0x002e */
-	struct ihs_i2c i2c;	/* 0x0040 */
+	struct ihs_i2c i2c0;	/* 0x0040 */
 	u16 reserved_4[10];	/* 0x004c */
 	u16 mc_int;		/* 0x0060 */
 	u16 mc_int_en;		/* 0x0062 */
@@ -208,10 +208,12 @@ struct ihs_fpga {
 	u16 reserved_1[29];	/* 0x001e */
 	u16 mpc3w_control;	/* 0x0058 */
 	u16 reserved_2[3];	/* 0x005a */
-	struct ihs_i2c i2c;	/* 0x0060 */
-	u16 reserved_3[205];	/* 0x0066 */
+	struct ihs_i2c i2c0;	/* 0x0060 */
+	u16 reserved_3[2];	/* 0x006c */
+	struct ihs_i2c i2c1;	/* 0x0070 */
+	u16 reserved_4[194];	/* 0x007c */
 	struct ihs_osd osd;	/* 0x0200 */
-	u16 reserved_4[761];	/* 0x020e */
+	u16 reserved_5[761];	/* 0x020e */
 	u16 videomem[31736];	/* 0x0800 */
 };
 #endif
Signature · 1 line
2.1.3
#2 lore raw

PATCH 1/18 i2c: ihs_i2c: Dual channel support

Hello Dirk,

Am 28.10.2015 um 11:46 schrieb dirk.eibach at gdsys.cc:

Quoted 11 lines

From: Dirk Eibach <[email protected]>

Support two i2c masters per FPGA.

---

  README                |  9 ++++++
  drivers/i2c/ihs_i2c.c | 76 ++++++++++++++++++++++++++++++++++++++++++---------
  include/gdsys_fpga.h  | 12 ++++----
  3 files changed, 79 insertions(+), 18 deletions(-)

I twould be nice to see a patch, which converts this driver to DM ;-) As the hole patchserie goes not through the i2c tree:

bye,
Heiko

Quoted 214 lines
README +9 -0
index 0dc657d..25bd711 100644
@@ -2446,6 +2446,15 @@ CBFS (Coreboot Filesystem) support
  		  - CONFIG_SYS_I2C_IHS_CH3 activate hardware channel 3
  		  - CONFIG_SYS_I2C_IHS_SPEED_3 speed channel 3
  		  - CONFIG_SYS_I2C_IHS_SLAVE_3 slave addr channel 3
+		  - activate dual channel with CONFIG_SYS_I2C_IHS_DUAL
+		  - CONFIG_SYS_I2C_IHS_SPEED_0_1 speed channel 0_1
+		  - CONFIG_SYS_I2C_IHS_SLAVE_0_1 slave addr channel 0_1
+		  - CONFIG_SYS_I2C_IHS_SPEED_1_1 speed channel 1_1
+		  - CONFIG_SYS_I2C_IHS_SLAVE_1_1 slave addr channel 1_1
+		  - CONFIG_SYS_I2C_IHS_SPEED_2_1 speed channel 2_1
+		  - CONFIG_SYS_I2C_IHS_SLAVE_2_1 slave addr channel 2_1
+		  - CONFIG_SYS_I2C_IHS_SPEED_3_1 speed channel 3_1
+		  - CONFIG_SYS_I2C_IHS_SLAVE_3_1 slave addr channel 3_1
 
  		additional defines:
 
drivers/i2c/ihs_i2c.c +63 -13
index 19fbe59..737beaf 100644
@@ -11,6 +11,28 @@
 
  DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_SYS_I2C_IHS_DUAL
+#define I2C_SET_REG(fld, val) \
+	{ if (I2C_ADAP_HWNR & 0x10) \
+		FPGA_SET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
+	else \
+		FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val); }
+#else
+#define I2C_SET_REG(fld, val) \
+		FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val);
+#endif
+
+#ifdef CONFIG_SYS_I2C_IHS_DUAL
+#define I2C_GET_REG(fld, val) \
+	{ if (I2C_ADAP_HWNR & 0x10) \
+		FPGA_GET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
+	else \
+		FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val); }
+#else
+#define I2C_GET_REG(fld, val) \
+		FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val);
+#endif
+
  enum {
  	I2CINT_ERROR_EV = 1 << 13,
  	I2CINT_TRANSMIT_EV = 1 << 14,
@@ -29,14 +51,14 @@ static int wait_for_int(bool read)
  	u16 val;
  	unsigned int ctr = 0;
 
-	FPGA_GET_REG(I2C_ADAP_HWNR, i2c.interrupt_status, &val);
+	I2C_GET_REG(interrupt_status, &val);
  	while (!(val & (I2CINT_ERROR_EV
  	       | (read ? I2CINT_RECEIVE_EV : I2CINT_TRANSMIT_EV)))) {
  		udelay(10);
  		if (ctr++ > 5000) {
  			return 1;
  		}
-		FPGA_GET_REG(I2C_ADAP_HWNR, i2c.interrupt_status, &val);
+		I2C_GET_REG(interrupt_status, &val);
  	}
 
  	return (val & I2CINT_ERROR_EV) ? 1 : 0;
@@ -47,30 +69,30 @@ static int ihs_i2c_transfer(uchar chip, uchar *buffer, int len, bool read,
  {
  	u16 val;
 
-	FPGA_SET_REG(I2C_ADAP_HWNR, i2c.interrupt_status, I2CINT_ERROR_EV
+	I2C_SET_REG(interrupt_status, I2CINT_ERROR_EV
  		     | I2CINT_RECEIVE_EV | I2CINT_TRANSMIT_EV);
-	FPGA_GET_REG(I2C_ADAP_HWNR, i2c.interrupt_status, &val);
+	I2C_GET_REG(interrupt_status, &val);
 
  	if (!read && len) {
  		val = buffer[0];
 
  		if (len > 1)
  			val |= buffer[1] << 8;
-		FPGA_SET_REG(I2C_ADAP_HWNR, i2c.write_mailbox_ext, val);
+		I2C_SET_REG(write_mailbox_ext, val);
  	}
 
-	FPGA_SET_REG(I2C_ADAP_HWNR, i2c.write_mailbox,
-		     I2CMB_NATIVE
-		     | (read ? 0 : I2CMB_WRITE)
-		     | (chip << 1)
-		     | ((len > 1) ? I2CMB_2BYTE : 0)
-		     | (is_last ? 0 : I2CMB_HOLD_BUS));
+	I2C_SET_REG(write_mailbox,
+		    I2CMB_NATIVE
+		    | (read ? 0 : I2CMB_WRITE)
+		    | (chip << 1)
+		    | ((len > 1) ? I2CMB_2BYTE : 0)
+		    | (is_last ? 0 : I2CMB_HOLD_BUS));
 
  	if (wait_for_int(read))
  		return 1;
 
  	if (read) {
-		FPGA_GET_REG(I2C_ADAP_HWNR, i2c.read_mailbox_ext, &val);
+		I2C_GET_REG(read_mailbox_ext, &val);
  		buffer[0] = val & 0xff;
  		if (len > 1)
  			buffer[1] = val >> 8;
@@ -163,7 +185,7 @@ static int ihs_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
  }
 
  static unsigned int ihs_i2c_set_bus_speed(struct i2c_adapter *adap,
-					     unsigned int speed)
+					  unsigned int speed)
  {
  	if (speed != adap->speed)
  		return 1;
@@ -179,6 +201,13 @@ U_BOOT_I2C_ADAP_COMPLETE(ihs0, ihs_i2c_init, ihs_i2c_probe,
  			 ihs_i2c_set_bus_speed,
  			 CONFIG_SYS_I2C_IHS_SPEED_0,
  			 CONFIG_SYS_I2C_IHS_SLAVE_0, 0)
+#ifdef CONFIG_SYS_I2C_IHS_DUAL
+U_BOOT_I2C_ADAP_COMPLETE(ihs0_1, ihs_i2c_init, ihs_i2c_probe,
+			 ihs_i2c_read, ihs_i2c_write,
+			 ihs_i2c_set_bus_speed,
+			 CONFIG_SYS_I2C_IHS_SPEED_0_1,
+			 CONFIG_SYS_I2C_IHS_SLAVE_0_1, 16)
+#endif
  #endif
  #ifdef CONFIG_SYS_I2C_IHS_CH1
  U_BOOT_I2C_ADAP_COMPLETE(ihs1, ihs_i2c_init, ihs_i2c_probe,
@@ -186,6 +215,13 @@ U_BOOT_I2C_ADAP_COMPLETE(ihs1, ihs_i2c_init, ihs_i2c_probe,
  			 ihs_i2c_set_bus_speed,
  			 CONFIG_SYS_I2C_IHS_SPEED_1,
  			 CONFIG_SYS_I2C_IHS_SLAVE_1, 1)
+#ifdef CONFIG_SYS_I2C_IHS_DUAL
+U_BOOT_I2C_ADAP_COMPLETE(ihs1_1, ihs_i2c_init, ihs_i2c_probe,
+			 ihs_i2c_read, ihs_i2c_write,
+			 ihs_i2c_set_bus_speed,
+			 CONFIG_SYS_I2C_IHS_SPEED_1_1,
+			 CONFIG_SYS_I2C_IHS_SLAVE_1_1, 17)
+#endif
  #endif
  #ifdef CONFIG_SYS_I2C_IHS_CH2
  U_BOOT_I2C_ADAP_COMPLETE(ihs2, ihs_i2c_init, ihs_i2c_probe,
@@ -193,6 +229,13 @@ U_BOOT_I2C_ADAP_COMPLETE(ihs2, ihs_i2c_init, ihs_i2c_probe,
  			 ihs_i2c_set_bus_speed,
  			 CONFIG_SYS_I2C_IHS_SPEED_2,
  			 CONFIG_SYS_I2C_IHS_SLAVE_2, 2)
+#ifdef CONFIG_SYS_I2C_IHS_DUAL
+U_BOOT_I2C_ADAP_COMPLETE(ihs2_1, ihs_i2c_init, ihs_i2c_probe,
+			 ihs_i2c_read, ihs_i2c_write,
+			 ihs_i2c_set_bus_speed,
+			 CONFIG_SYS_I2C_IHS_SPEED_2_1,
+			 CONFIG_SYS_I2C_IHS_SLAVE_2_1, 18)
+#endif
  #endif
  #ifdef CONFIG_SYS_I2C_IHS_CH3
  U_BOOT_I2C_ADAP_COMPLETE(ihs3, ihs_i2c_init, ihs_i2c_probe,
@@ -200,4 +243,11 @@ U_BOOT_I2C_ADAP_COMPLETE(ihs3, ihs_i2c_init, ihs_i2c_probe,
  			 ihs_i2c_set_bus_speed,
  			 CONFIG_SYS_I2C_IHS_SPEED_3,
  			 CONFIG_SYS_I2C_IHS_SLAVE_3, 3)
+#ifdef CONFIG_SYS_I2C_IHS_DUAL
+U_BOOT_I2C_ADAP_COMPLETE(ihs3_1, ihs_i2c_init, ihs_i2c_probe,
+			 ihs_i2c_read, ihs_i2c_write,
+			 ihs_i2c_set_bus_speed,
+			 CONFIG_SYS_I2C_IHS_SPEED_3_1,
+			 CONFIG_SYS_I2C_IHS_SLAVE_3_1, 19)
+#endif
  #endif
include/gdsys_fpga.h +7 -5
index 8a5efe7..f8d8322 100644
@@ -143,7 +143,7 @@ struct ihs_fpga {
  	u16 reserved_2[2];	/* 0x001c */
  	struct ihs_io_ep ep;	/* 0x0020 */
  	u16 reserved_3[9];	/* 0x002e */
-	struct ihs_i2c i2c;	/* 0x0040 */
+	struct ihs_i2c i2c0;	/* 0x0040 */
  	u16 reserved_4[10];	/* 0x004c */
  	u16 mc_int;		/* 0x0060 */
  	u16 mc_int_en;		/* 0x0062 */
@@ -177,7 +177,7 @@ struct ihs_fpga {
  	u16 reserved_2[2];	/* 0x001c */
  	struct ihs_io_ep ep;	/* 0x0020 */
  	u16 reserved_3[9];	/* 0x002e */
-	struct ihs_i2c i2c;	/* 0x0040 */
+	struct ihs_i2c i2c0;	/* 0x0040 */
  	u16 reserved_4[10];	/* 0x004c */
  	u16 mc_int;		/* 0x0060 */
  	u16 mc_int_en;		/* 0x0062 */
@@ -208,10 +208,12 @@ struct ihs_fpga {
  	u16 reserved_1[29];	/* 0x001e */
  	u16 mpc3w_control;	/* 0x0058 */
  	u16 reserved_2[3];	/* 0x005a */
-	struct ihs_i2c i2c;	/* 0x0060 */
-	u16 reserved_3[205];	/* 0x0066 */
+	struct ihs_i2c i2c0;	/* 0x0060 */
+	u16 reserved_3[2];	/* 0x006c */
+	struct ihs_i2c i2c1;	/* 0x0070 */
+	u16 reserved_4[194];	/* 0x007c */
  	struct ihs_osd osd;	/* 0x0200 */
-	u16 reserved_4[761];	/* 0x020e */
+	u16 reserved_5[761];	/* 0x020e */
  	u16 videomem[31736];	/* 0x0800 */
  };
  #endif
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

PATCH 1/18 i2c: ihs_i2c: Dual channel support

Hello Heiko,

2015-10-28 12:23 GMT+01:00 Heiko Schocher <[email protected]>:

Quoted 1 line

I twould be nice to see a patch, which converts this driver to DM ;-)

me too ;)
Are there any known good examples?

Cheers
Dirk

#4 lore raw

PATCH 1/18 i2c: ihs_i2c: Dual channel support

Hello Dirk,

Am 28.10.2015 um 13:39 schrieb Dirk Eibach:

Quoted 7 lines

Hello Heiko,

2015-10-28 12:23 GMT+01:00 Heiko Schocher <[email protected]>:

Quoted 1 line

I twould be nice to see a patch, which converts this driver to DM ;-)

me too ;)
Are there any known good examples?

hs at localhost:u-boot [20151012] $ grep -lr U_BOOT_DRIVER drivers/i2c/ drivers/i2c/i2c-uclass.c
drivers/i2c/i2c-uniphier.c
drivers/i2c/sandbox_i2c.c
drivers/i2c/tegra_i2c.c
drivers/i2c/s3c24x0_i2c.c
drivers/i2c/i2c-gpio.c drivers/i2c/muxes/i2c-arb-gpio-challenge.c drivers/i2c/muxes/i2c-mux-uclass.c
drivers/i2c/mxc_i2c.c
drivers/i2c/cros_ec_tunnel.c
drivers/i2c/i2c-uniphier-f.c
drivers/i2c/rk_i2c.c
drivers/i2c/cros_ec_ldo.c
hs at localhost:u-boot [20151012] $

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#5 lore raw

PATCH 1/18 i2c: ihs_i2c: Dual channel support

In reply to dirk.eibach at gdsys.cc
Quoted 6 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Support two i2c masters per FPGA.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/421ae48e/attachment.sig>
#6 lore raw

PATCH 2/18 i2c: ihs_i2c: Use macro bestpractices

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

Reinhard Pfau complained that macros in ihs_i2c do not follow best practices.

---

 drivers/i2c/ihs_i2c.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/i2c/ihs_i2c.c +14 -10
index 737beaf..e001459 100644
@@ -13,24 +13,28 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_SYS_I2C_IHS_DUAL
 #define I2C_SET_REG(fld, val) \
-	{ if (I2C_ADAP_HWNR & 0x10) \
-		FPGA_SET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
-	else \
-		FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val); }
+	do { \
+		if (I2C_ADAP_HWNR & 0x10) \
+			FPGA_SET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
+		else \
+			FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val); \
+	} while (0)
 #else
 #define I2C_SET_REG(fld, val) \
-		FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val);
+		FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val)
 #endif
 
 #ifdef CONFIG_SYS_I2C_IHS_DUAL
 #define I2C_GET_REG(fld, val) \
-	{ if (I2C_ADAP_HWNR & 0x10) \
-		FPGA_GET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
-	else \
-		FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val); }
+	do {					\
+		if (I2C_ADAP_HWNR & 0x10) \
+			FPGA_GET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
+		else \
+			FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val); \
+	} while (0)
 #else
 #define I2C_GET_REG(fld, val) \
-		FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val);
+		FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val)
 #endif
 
 enum {
Signature · 1 line
2.1.3
#7 lore raw

PATCH 2/18 i2c: ihs_i2c: Use macro bestpractices

Hello Dirk,

Am 28.10.2015 um 11:46 schrieb dirk.eibach at gdsys.cc:

Quoted 9 lines

From: Dirk Eibach <[email protected]>

Reinhard Pfau complained that macros in ihs_i2c do not follow best practices.

---

  drivers/i2c/ihs_i2c.c | 24 ++++++++++++++----------
  1 file changed, 14 insertions(+), 10 deletions(-)

As the hole patchserie goes not through the i2c tree:

bye,
Heiko

Quoted 45 lines
drivers/i2c/ihs_i2c.c +14 -10
index 737beaf..e001459 100644
@@ -13,24 +13,28 @@ DECLARE_GLOBAL_DATA_PTR;
 
  #ifdef CONFIG_SYS_I2C_IHS_DUAL
  #define I2C_SET_REG(fld, val) \
-	{ if (I2C_ADAP_HWNR & 0x10) \
-		FPGA_SET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
-	else \
-		FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val); }
+	do { \
+		if (I2C_ADAP_HWNR & 0x10) \
+			FPGA_SET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
+		else \
+			FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val); \
+	} while (0)
  #else
  #define I2C_SET_REG(fld, val) \
-		FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val);
+		FPGA_SET_REG(I2C_ADAP_HWNR, i2c0.fld, val)
  #endif
 
  #ifdef CONFIG_SYS_I2C_IHS_DUAL
  #define I2C_GET_REG(fld, val) \
-	{ if (I2C_ADAP_HWNR & 0x10) \
-		FPGA_GET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
-	else \
-		FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val); }
+	do {					\
+		if (I2C_ADAP_HWNR & 0x10) \
+			FPGA_GET_REG(I2C_ADAP_HWNR & 0xf, i2c1.fld, val); \
+		else \
+			FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val); \
+	} while (0)
  #else
  #define I2C_GET_REG(fld, val) \
-		FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val);
+		FPGA_GET_REG(I2C_ADAP_HWNR, i2c0.fld, val)
  #endif
 
  enum {
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#8 lore raw

PATCH 2/18 i2c: ihs_i2c: Use macro bestpractices

In reply to dirk.eibach at gdsys.cc
Quoted 6 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Reinhard Pfau complained that macros in ihs_i2c do not follow best practices.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/ed541f0c/attachment.sig>
#9 lore raw

PATCH 3/18 i2c: ihs_i2c: Fix hold_bus control

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

Bus has to be held for repeated start regardless of read/write access.

---

 drivers/i2c/ihs_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/ihs_i2c.c +1 -1
index e001459..b05c15f 100644
@@ -135,7 +135,7 @@ static int ihs_i2c_access(struct i2c_adapter *adap, uchar chip, uint addr,
 	if (len <= 0)
 		return 1;
 
-	if (ihs_i2c_address(chip, addr, alen, !read))
+	if (ihs_i2c_address(chip, addr, alen, len))
 		return 1;
 
 	while (len) {
Signature · 1 line
2.1.3
#10 lore raw

PATCH 3/18 i2c: ihs_i2c: Fix hold_bus control

Hello Dirk,

Am 28.10.2015 um 11:46 schrieb dirk.eibach at gdsys.cc:

Quoted 10 lines

From: Dirk Eibach <[email protected]>

Bus has to be held for repeated start regardless of read/write access.

---

  drivers/i2c/ihs_i2c.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

As the hole patchserie goes not through the i2c tree:

bye,
Heiko

Quoted 15 lines
drivers/i2c/ihs_i2c.c +1 -1
index e001459..b05c15f 100644
@@ -135,7 +135,7 @@ static int ihs_i2c_access(struct i2c_adapter *adap, uchar chip, uint addr,
  	if (len <= 0)
  		return 1;
 
-	if (ihs_i2c_address(chip, addr, alen, !read))
+	if (ihs_i2c_address(chip, addr, alen, len))
  		return 1;
 
  	while (len) {
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#11 lore raw

PATCH 3/18 i2c: ihs_i2c: Fix hold_bus control

In reply to dirk.eibach at gdsys.cc
Quoted 7 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Bus has to be held for repeated start regardless of read/write access.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/8cf96a04/attachment.sig>
#12 lore raw

PATCH 4/18 board: gdsys: Configure DP501 SPDIF input

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

---

 board/gdsys/common/dp501.c | 2 ++
 1 file changed, 2 insertions(+)
board/gdsys/common/dp501.c +2 -0
index 7eb15ed..baace38 100644
@@ -77,6 +77,8 @@ void dp501_powerup(u8 addr)
 	i2c_reg_write(addr + 2, 0x24, 0x02); /* clock input single ended */
 #endif
 
+	i2c_reg_write(addr + 2, 0x1a, 0x04); /* SPDIF input method TTL */
+
 	i2c_reg_write(addr + 2, 0x00, 0x18); /* driving strength */
 	i2c_reg_write(addr + 2, 0x03, 0x06); /* driving strength */
 	i2c_reg_write(addr, 0x2c, 0x00); /* configure N value */
Signature · 1 line
2.1.3
#13 lore raw

PATCH 4/18 board: gdsys: Configure DP501 SPDIF input

Hello Dirk,

Am 28.10.2015 um 11:46 schrieb dirk.eibach at gdsys.cc:

Quoted 13 lines

From: Dirk Eibach <[email protected]>

---

  board/gdsys/common/dp501.c | 2 ++
  1 file changed, 2 insertions(+)
board/gdsys/common/dp501.c +0 -0
index 7eb15ed..baace38 100644

board/gdsys/common/dp501.c void dp501_powerup(u8 addr) · line 84

Quoted 8 lines
board/gdsys/common/dp501.c +2 -0
@@ -77,6 +77,8 @@ void dp501_powerup(u8 addr)
  	i2c_reg_write(addr + 2, 0x24, 0x02); /* clock input single ended */
  #endif
 
+	i2c_reg_write(addr + 2, 0x1a, 0x04); /* SPDIF input method TTL */
+
  	i2c_reg_write(addr + 2, 0x00, 0x18); /* driving strength */
  	i2c_reg_write(addr + 2, 0x03, 0x06); /* driving strength */
  	i2c_reg_write(addr, 0x2c, 0x00); /* configure N value */

Hmm... a lot of magical values ... some defines would be nice here.

Beside of this:

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#14 lore raw

PATCH 4/18 board: gdsys: Configure DP501 SPDIF input

Hello Heiko,

2015-10-28 12:25 GMT+01:00 Heiko Schocher <[email protected]>:

Quoted 1 line

Hmm... a lot of magical values ... some defines would be nice here.

Agreed. Documenting all the ugly mess Parade Technologies calls an interface would result in a list of enums, that would be as long as (at least) the driver itself. So I decided to comment line by line what happens. Since this is (at least as far I as know) the only open source code for DP501, I hope one day I will find some time to invest some more effort here.

Cheers
Dirk

#15 lore raw

PATCH 4/18 board: gdsys: Configure DP501 SPDIF input

In reply to dirk.eibach at gdsys.cc
Quoted 4 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/57f59b1c/attachment.sig>
#16 lore raw

PATCH 5/18 board: gdsys: Increase DP501 I2C retry interval

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

With Club 3D dual link adapter there are AUX-channel timeouts when EDID is read. Increasing retry interval time to max (400us) fixes this.

---

 board/gdsys/common/dp501.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/gdsys/common/dp501.c +2 -1
index baace38..0389fd1 100644
@@ -88,7 +88,8 @@ void dp501_powerup(u8 addr)
 	dp501_setbits(addr, 0x78, 0x03); /* clear all interrupt */
 	i2c_reg_write(addr, 0x75, 0xf8); /* aux channel reset */
 	i2c_reg_write(addr, 0x75, 0x00); /* clear aux channel reset */
-	i2c_reg_write(addr, 0x87, 0x70); /* set retry counter as 7 */
+	i2c_reg_write(addr, 0x87, 0x7f); /* set retry counter as 7
+					    retry interval 400us */
 
 	if (dp501_detect_cable_adapter(addr)) {
 		printf("DVI/HDMI cable adapter detected\n");
Signature · 1 line
2.1.3
#17 lore raw

PATCH 5/18 board: gdsys: Increase DP501 I2C retry interval

Hello Dirk,

Am 28.10.2015 um 11:46 schrieb dirk.eibach at gdsys.cc:

Quoted 11 lines

From: Dirk Eibach <[email protected]>

With Club 3D dual link adapter there are AUX-channel timeouts when EDID is read. Increasing retry interval time to max (400us) fixes this.

---

  board/gdsys/common/dp501.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

except the same comment as patch before ... this file uses a lot of magic values ... maybe this should be fixed?

Hmm... and converting the hole board support to DM would be nice ;-)

bye,
Heiko

Quoted 15 lines
board/gdsys/common/dp501.c +2 -1
index baace38..0389fd1 100644
@@ -88,7 +88,8 @@ void dp501_powerup(u8 addr)
  	dp501_setbits(addr, 0x78, 0x03); /* clear all interrupt */
  	i2c_reg_write(addr, 0x75, 0xf8); /* aux channel reset */
  	i2c_reg_write(addr, 0x75, 0x00); /* clear aux channel reset */
-	i2c_reg_write(addr, 0x87, 0x70); /* set retry counter as 7 */
+	i2c_reg_write(addr, 0x87, 0x7f); /* set retry counter as 7
+					    retry interval 400us */
 
  	if (dp501_detect_cable_adapter(addr)) {
  		printf("DVI/HDMI cable adapter detected\n");
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#18 lore raw

PATCH 5/18 board: gdsys: Increase DP501 I2C retry interval

In reply to dirk.eibach at gdsys.cc
Quoted 8 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

With Club 3D dual link adapter there are AUX-channel timeouts when EDID is read. Increasing retry interval time to max (400us) fixes this.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/c4a39d79/attachment-0001.sig>
#19 lore raw

PATCH 6/18 board: gdsys: Consider DP501 limits on link training

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

DP501 only supports DP 1.1a.
Limit settings for link bandwidth and lane count to values allowed by DP 1.1a.

---

 board/gdsys/common/dp501.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
board/gdsys/common/dp501.c +20 -2
index 0389fd1..d35aee0 100644
@@ -40,11 +40,29 @@ static int dp501_detect_cable_adapter(u8 addr)
 static void dp501_link_training(u8 addr)
 {
 	u8 val;
+	u8 link_bw;
+	u8 max_lane_cnt;
+	u8 lane_cnt;
 
 	val = i2c_reg_read(addr, 0x51);
-	i2c_reg_write(addr, 0x5d, val); /* set link_bw */
+	if (val >= 0x0a)
+		link_bw = 0x0a;
+	else
+		link_bw = 0x06;
+	if (link_bw != val)
+		printf("DP sink supports %d Mbps link rate, set to %d Mbps\n",
+		       val * 270, link_bw * 270);
+	i2c_reg_write(addr, 0x5d, link_bw); /* set link_bw */
 	val = i2c_reg_read(addr, 0x52);
-	i2c_reg_write(addr, 0x5e, val); /* set lane_cnt */
+	max_lane_cnt = val & 0x1f;
+	if (max_lane_cnt >= 4)
+		lane_cnt = 4;
+	else
+		lane_cnt = max_lane_cnt;
+	if (lane_cnt != max_lane_cnt)
+		printf("DP sink supports %d lanes, set to %d lanes\n",
+		       max_lane_cnt, lane_cnt);
+	i2c_reg_write(addr, 0x5e, lane_cnt | (val & 0x80)); /* set lane_cnt */
 	val = i2c_reg_read(addr, 0x53);
 	i2c_reg_write(addr, 0x5c, val); /* set downspread_ctl */
 
Signature · 1 line
2.1.3
#20 lore raw

PATCH 6/18 board: gdsys: Consider DP501 limits on link training

Quoted 7 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

DP501 only supports DP 1.1a.
Limit settings for link bandwidth and lane count to values allowed by DP 1.1a.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/f1e9a5e2/attachment-0001.sig>
#21 lore raw

PATCH 7/18 dlvision-10g: Support displayport

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

Support dlvision-10g hardware with displayport output.

---

 board/gdsys/405ep/dlvision-10g.c | 67 ++++++++++++++++++++++------------------
 board/gdsys/common/Makefile      |  2 +-
 include/configs/dlvision-10g.h   | 18 ++++++++---
 3 files changed, 51 insertions(+), 36 deletions(-)
board/gdsys/405ep/dlvision-10g.c +37 -30
index 35dfbbc..54c7eb3 100644
@@ -25,17 +25,19 @@
 #define LATCH2_MC2_PRESENT_N 0x0080
 
 enum {
-	UNITTYPE_VIDEO_USER = 0,
-	UNITTYPE_MAIN_USER = 1,
-	UNITTYPE_VIDEO_SERVER = 2,
-	UNITTYPE_MAIN_SERVER = 3,
+	UNITTYPE_MAIN = 1<<0,
+	UNITTYPE_SERVER = 1<<1,
+	UNITTYPE_DISPLAYPORT = 1<<2,
 };
 
 enum {
 	HWVER_101 = 0,
 	HWVER_110 = 1,
-	HWVER_120 = 2,
-	HWVER_130 = 3,
+	HWVER_130 = 2,
+	HWVER_140 = 3,
+	HWVER_150 = 4,
+	HWVER_160 = 5,
+	HWVER_170 = 6,
 };
 
 enum {
@@ -121,43 +123,48 @@ static void print_fpga_info(unsigned dev)
 	feature_carriers = (fpga_features >> 2) & 0x0003;
 	feature_video_channels = fpga_features & 0x0003;
 
-	switch (unit_type) {
-	case UNITTYPE_VIDEO_USER:
-		printf("Videochannel Userside");
-		break;
+	if (unit_type & UNITTYPE_MAIN)
+		printf("Mainchannel ");
+	else
+		printf("Videochannel ");
 
-	case UNITTYPE_MAIN_USER:
-		printf("Mainchannel Userside");
-		break;
+	if (unit_type & UNITTYPE_SERVER)
+		printf("Serverside ");
+	else
+		printf("Userside ");
+
+	if (unit_type & UNITTYPE_DISPLAYPORT)
+		printf("DisplayPort");
+	else
+		printf("DVI-DL");
 
-	case UNITTYPE_VIDEO_SERVER:
-		printf("Videochannel Serverside");
+	switch (hardware_version) {
+	case HWVER_101:
+		printf(" HW-Ver 1.01\n");
 		break;
 
-	case UNITTYPE_MAIN_SERVER:
-		printf("Mainchannel Serverside");
+	case HWVER_110:
+		printf(" HW-Ver 1.10-1.20\n");
 		break;
 
-	default:
-		printf("UnitType %d(not supported)", unit_type);
+	case HWVER_130:
+		printf(" HW-Ver 1.30\n");
 		break;
-	}
 
-	switch (hardware_version) {
-	case HWVER_101:
-		printf(" HW-Ver 1.01\n");
+	case HWVER_140:
+		printf(" HW-Ver 1.40-1.43\n");
 		break;
 
-	case HWVER_110:
-		printf(" HW-Ver 1.10-1.12\n");
+	case HWVER_150:
+		printf(" HW-Ver 1.50\n");
 		break;
 
-	case HWVER_120:
-		printf(" HW-Ver 1.20\n");
+	case HWVER_160:
+		printf(" HW-Ver 1.60-1.61\n");
 		break;
 
-	case HWVER_130:
-		printf(" HW-Ver 1.30\n");
+	case HWVER_170:
+		printf(" HW-Ver 1.70\n");
 		break;
 
 	default:
@@ -260,7 +267,7 @@ int last_stage_init(void)
 	if (get_mc2_present())
 		print_fpga_info(1);
 
-	if (((versions >> 4) & 0x000f) != UNITTYPE_MAIN_USER)
+	if (((versions >> 4) & 0x000f) & UNITTYPE_SERVER)
 		return 0;
 
 	if (!get_fpga_state(0) || (get_hwver() == HWVER_101))
board/gdsys/common/Makefile +1 -1
index 4957943..95e41de 100644
@@ -10,6 +10,6 @@ obj-$(CONFIG_CMD_IOLOOP) += cmd_ioloop.o
 obj-$(CONFIG_IO) += miiphybb.o
 obj-$(CONFIG_IO64) += miiphybb.o
 obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o
-obj-$(CONFIG_DLVISION_10G) += osd.o
+obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o
 obj-$(CONFIG_CONTROLCENTERD) += dp501.o
 obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o
include/configs/dlvision-10g.h +13 -5
index e6bfe58..08cd1dd 100644
@@ -69,7 +69,7 @@
 #undef CONFIG_CMD_DIAG
 #undef CONFIG_CMD_EEPROM
 #undef CONFIG_CMD_ELF
-#undef CONFIG_CMD_I2C
+#define CONFIG_CMD_I2C
 #undef CONFIG_CMD_IRQ
 
 /*
@@ -107,17 +107,22 @@
 #define CONFIG_SYS_I2C_PPC4XX_SLAVE_0		0x7F
 
 #define CONFIG_SYS_I2C_IHS
+#define CONFIG_SYS_I2C_IHS_DUAL
 #define CONFIG_SYS_I2C_IHS_CH0
 #define CONFIG_SYS_I2C_IHS_SPEED_0		50000
 #define CONFIG_SYS_I2C_IHS_SLAVE_0		0x7F
+#define CONFIG_SYS_I2C_IHS_SPEED_0_1		50000
+#define CONFIG_SYS_I2C_IHS_SLAVE_0_1		0x7F
 #define CONFIG_SYS_I2C_IHS_CH1
 #define CONFIG_SYS_I2C_IHS_SPEED_1		50000
 #define CONFIG_SYS_I2C_IHS_SLAVE_1		0x7F
+#define CONFIG_SYS_I2C_IHS_SPEED_1_1		50000
+#define CONFIG_SYS_I2C_IHS_SLAVE_1_1		0x7F
 
-#define CONFIG_SYS_SPD_BUS_NUM		2
+#define CONFIG_SYS_SPD_BUS_NUM		4
 
 /* Temp sensor/hwmon/dtt */
-#define CONFIG_SYS_DTT_BUS_NUM	2
+#define CONFIG_SYS_DTT_BUS_NUM	4
 #define CONFIG_DTT_LM63		1	/* National LM63	*/
 #define CONFIG_DTT_SENSORS	{ 0x4c, 0x4e, 0x18 } /* Sensor addresses */
 #define CONFIG_DTT_PWM_LOOKUPTABLE	\
@@ -125,8 +130,9 @@
 		  { 54, 27 }, { 56, 31 }, { 58, 36 }, { 60, 40 } }
 #define CONFIG_DTT_TACH_LIMIT	0xa10
 
-#define CONFIG_SYS_ICS8N3QV01_I2C	{0, 1}
-#define CONFIG_SYS_SIL1178_I2C		{0, 1}
+#define CONFIG_SYS_ICS8N3QV01_I2C	{1, 3}
+#define CONFIG_SYS_SIL1178_I2C		{0, 2}
+#define CONFIG_SYS_DP501_I2C		{0, 2}
 
 /* EBC peripherals */
 
@@ -329,5 +335,7 @@
  */
 #define CONFIG_SYS_MPC92469AC
 #define CONFIG_SYS_OSD_SCREENS		CONFIG_SYS_FPGA_COUNT
+#define CONFIG_SYS_DP501_DIFFERENTIAL
+#define CONFIG_SYS_DP501_VCAPCTRL0	0x01 /* DDR mode 0, DE for H/VSYNC */
 
 #endif	/* __CONFIG_H */
Signature · 1 line
2.1.3
#22 lore raw

PATCH 7/18 dlvision-10g: Support displayport

Quoted 5 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Support dlvision-10g hardware with displayport output.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/5f166ccd/attachment.sig>
#23 lore raw

PATCH 8/18 controlcenterd: Disable sideband clocks

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

---

 board/gdsys/p1022/controlcenterd.c | 5 +++++
 1 file changed, 5 insertions(+)
board/gdsys/p1022/controlcenterd.c +5 -0
index 64d90dd..2f98e47 100644
@@ -57,6 +57,8 @@ struct ihs_fpga {
 	u32 versions;		/* 0x0004 */
 	u32 fpga_version;	/* 0x0008 */
 	u32 fpga_features;	/* 0x000c */
+	u32 reserved[4];	/* 0x0010 */
+	u32 control;		/* 0x0020 */
 };
 
 #ifndef CONFIG_TRAILBLAZER
@@ -384,6 +386,9 @@ static void hydra_initialize(void)
 		fpga = pci_map_bar(devno, PCI_BASE_ADDRESS_0,
 			PCI_REGION_MEM);
 
+		/* disable sideband clocks */
+		writel(1, &fpga->control);
+
 		versions = readl(&fpga->versions);
 		fpga_version = readl(&fpga->fpga_version);
 		fpga_features = readl(&fpga->fpga_features);
Signature · 1 line
2.1.3
#24 lore raw

PATCH 8/18 controlcenterd: Disable sideband clocks

Quoted 3 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/3c0d7c26/attachment.sig>
#25 lore raw

PATCH 9/18 iocon: reset FPGAs in last_stage_init()

In reply to dirk.eibach at gdsys.cc

From: Reinhard Pfau <[email protected]>

- Reset FPGAs in last_stage_init()

---

 board/gdsys/405ep/iocon.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
board/gdsys/405ep/iocon.c +7 -1
index 3a51d86..7484624 100644
@@ -381,7 +381,7 @@ int last_stage_init(void)
 		ch0_rgmii2_present = !pca9698_get_value(0x20, 30);
 	}
 
-	/* wait for FPGA done */
+	/* wait for FPGA done; then reset FPGA */
 	for (k = 0; k < ARRAY_SIZE(mclink_controllers); ++k) {
 		unsigned int ctr = 0;
 
@@ -396,6 +396,12 @@ int last_stage_init(void)
 				break;
 			}
 		}
+
+		pca953x_set_dir(mclink_controllers[k], MCFPGA_RESET_N, 0);
+		pca953x_set_val(mclink_controllers[k], MCFPGA_RESET_N, 0);
+		udelay(10);
+		pca953x_set_val(mclink_controllers[k], MCFPGA_RESET_N,
+				MCFPGA_RESET_N);
 	}
 
 	if (!legacy && (feature_carrier_speed == CARRIER_SPEED_1G)) {
Signature · 1 line
2.1.3
#26 lore raw

PATCH 9/18 iocon: reset FPGAs in last_stage_init()

Quoted 6 lines · Dirk Eibach

From: Reinhard Pfau <[email protected]>

- Reset FPGAs in last_stage_init()

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/bd30e0d6/attachment.sig>
#27 lore raw

PATCH 9/18 iocon: reset FPGAs in last_stage_init()

In reply to dirk.eibach at gdsys.cc
Quoted 6 lines · Dirk Eibach

From: Reinhard Pfau <[email protected]>

- Reset FPGAs in last_stage_init()

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/dfe06629/attachment.sig>
#28 lore raw

PATCH 10/18 hrcon: Remove CH7301 configuration

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

hrcon has no CH7301 DVI-transmitter.
Probably not removed when copying from iocon.

---

 include/configs/hrcon.h | 1 -
 1 file changed, 1 deletion(-)
include/configs/hrcon.h +0 -1
index 558edfc..f1a69a3 100644
@@ -361,7 +361,6 @@
 #define CONFIG_SYS_I2C_SOFT_SLAVE_4		0x7F
 
 #define CONFIG_SYS_ICS8N3QV01_I2C		{5, 6, 7, 8}
-#define CONFIG_SYS_CH7301_I2C			{5, 6, 7, 8}
 #define CONFIG_SYS_DP501_I2C			{1, 2, 3, 4}
 
 #ifndef __ASSEMBLY__
Signature · 1 line
2.1.3
#29 lore raw

PATCH 10/18 hrcon: Remove CH7301 configuration

Quoted 6 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

hrcon has no CH7301 DVI-transmitter.
Probably not removed when copying from iocon.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/375e97ef/attachment.sig>
#30 lore raw

PATCH 11/18 mpc83xx: Add strider board

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

The gdsys strider board is based on a Freescale MPC8308 SOC. It boots from NOR-Flash, kernel and rootfs are stored on SD-Card.

On board peripherals include:
- 1x 10/100 Mbit/s Ethernet (optional)
- Lattice ECP3 FPGA connected via eLBC

---

 arch/powerpc/cpu/mpc83xx/Kconfig |   3 +
 board/gdsys/common/Makefile      |   4 +-
 board/gdsys/common/adv7611.c     | 177 +++++++++++
 board/gdsys/common/adv7611.h     |  13 +
 board/gdsys/common/ch7301.c      |  64 ++++
 board/gdsys/common/ch7301.h      |  13 +
 board/gdsys/common/ioep-fpga.c   | 227 ++++++++++++++
 board/gdsys/common/ioep-fpga.h   |  14 +
 board/gdsys/common/osd.c         |  43 +--
 board/gdsys/common/osd.h         |   1 +
 board/gdsys/mpc8308/Kconfig      |  13 +
 board/gdsys/mpc8308/MAINTAINERS  |   3 +
 board/gdsys/mpc8308/Makefile     |   1 +
 board/gdsys/mpc8308/strider.c    | 501 ++++++++++++++++++++++++++++++
 configs/strider_con_defconfig    |   7 +
 configs/strider_cpu_defconfig    |   7 +
 include/configs/strider.h        | 653 +++++++++++++++++++++++++++++++++++++++
 include/gdsys_fpga.h             |  63 ++++
 18 files changed, 1766 insertions(+), 41 deletions(-)
 create mode 100644 board/gdsys/common/adv7611.c
 create mode 100644 board/gdsys/common/adv7611.h
 create mode 100644 board/gdsys/common/ch7301.c
 create mode 100644 board/gdsys/common/ch7301.h
 create mode 100644 board/gdsys/common/ioep-fpga.c
 create mode 100644 board/gdsys/common/ioep-fpga.h
 create mode 100644 board/gdsys/mpc8308/strider.c
 create mode 100644 configs/strider_con_defconfig
 create mode 100644 configs/strider_cpu_defconfig
 create mode 100644 include/configs/strider.h
arch/powerpc/cpu/mpc83xx/Kconfig +3 -0
index 3fb901f..3ea62ca 100644
@@ -67,6 +67,9 @@ config TARGET_TQM834X
 config TARGET_HRCON
 	bool "Support hrcon"
 
+config TARGET_STRIDER
+	bool "Support strider"
+
 endchoice
 
 source "board/esd/vme8349/Kconfig"
board/gdsys/common/Makefile +3 -1
index 95e41de..ba48e8b 100644
@@ -9,7 +9,9 @@ obj-$(CONFIG_SYS_FPGA_COMMON) += fpga.o
 obj-$(CONFIG_CMD_IOLOOP) += cmd_ioloop.o
 obj-$(CONFIG_IO) += miiphybb.o
 obj-$(CONFIG_IO64) += miiphybb.o
-obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o
+obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o
 obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o
 obj-$(CONFIG_CONTROLCENTERD) += dp501.o
 obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o
+obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o
+obj-$(CONFIG_STRIDER_CON) += osd.o
board/gdsys/common/adv7611.c new file +177 -0

177 lines not on this page · raw message

board/gdsys/common/adv7611.h new file +13 -0
new file mode 100644
index 0000000..25a8367
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2014
+ * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eibach at gdsys.cc
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _ADV7611_H_
+#define _ADV7611_H_
+
+int adv7611_probe(unsigned int screen);
+
+#endif
board/gdsys/common/ch7301.c new file +64 -0

64 lines not on this page · raw message

board/gdsys/common/ch7301.h new file +13 -0
new file mode 100644
index 0000000..8383719
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2014
+ * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eibach at gdsys.cc
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _CH7301_H_
+#define _CH7301_H_
+
+int ch7301_probe(unsigned screen, bool power);
+
+#endif
board/gdsys/common/ioep-fpga.c new file +227 -0

227 lines not on this page · raw message

board/gdsys/common/ioep-fpga.h new file +14 -0
new file mode 100644
index 0000000..44f7139
@@ -0,0 +1,14 @@
+/*
+ * (C) Copyright 2014
+ * Dirk Eibach,  Guntermann & Drunck GmbH, [email protected]
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _IOEP_FPGA_H_
+#define _IOEP_FPGA_H_
+
+void ioep_fpga_print_info(unsigned int fpga);
+bool ioep_fpga_has_osd(unsigned int fpga);
+
+#endif
board/gdsys/common/osd.c +3 -40

70 lines not on this page · raw message

board/gdsys/common/osd.h +1 -0
index 440b276..5b3f14b 100644
@@ -8,6 +8,7 @@
 #ifndef _OSD_H_
 #define _OSD_H_
 
+int ch7301_probe(unsigned screen, bool power);
 int osd_probe(unsigned screen);
 
 #endif
board/gdsys/mpc8308/Kconfig +13 -0
index 43e1663..9a1a3a2 100644
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
 	default "hrcon"
 
 endif
+
+if TARGET_STRIDER
+
+config SYS_BOARD
+	default "mpc8308"
+
+config SYS_VENDOR
+	default "gdsys"
+
+config SYS_CONFIG_NAME
+	default "strider"
+
+endif
board/gdsys/mpc8308/MAINTAINERS +3 -0
index a7853a5..35704bc 100644
@@ -4,3 +4,6 @@ S:	Maintained
 F:	board/gdsys/mpc8308/
 F:	include/configs/hrcon.h
 F:	configs/hrcon_defconfig
+F:	include/configs/strider.h
+F:	configs/strider_cpu_defconfig
+F:	configs/strider_con_defconfig
board/gdsys/mpc8308/Makefile +1 -0
index b5dfdbb..42702fb 100644
@@ -7,3 +7,4 @@
 
 obj-y := mpc8308.o sdram.o
 obj-$(CONFIG_HRCON) += hrcon.o
+obj-$(CONFIG_STRIDER) += strider.o
board/gdsys/mpc8308/strider.c new file +501 -0

501 lines not on this page · raw message

configs/strider_con_defconfig new file +7 -0
new file mode 100644
index 0000000..74ef69e
@@ -0,0 +1,7 @@
+CONFIG_SYS_EXTRA_OPTIONS="STRIDER_CON"
+CONFIG_PPC=y
+CONFIG_MPC83xx=y
+CONFIG_TARGET_STRIDER=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_SETEXPR is not set
configs/strider_cpu_defconfig new file +7 -0
new file mode 100644
index 0000000..fc0a823
@@ -0,0 +1,7 @@
+CONFIG_SYS_EXTRA_OPTIONS="STRIDER_CPU"
+CONFIG_PPC=y
+CONFIG_MPC83xx=y
+CONFIG_TARGET_STRIDER=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_SETEXPR is not set
include/configs/strider.h new file +653 -0

653 lines not on this page · raw message

include/gdsys_fpga.h +63 -0

69 lines not on this page · raw message

Signature · 1 line
2.1.3
#31 lore raw

PATCH 11/18 mpc83xx: Add strider board

Quoted 11 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

The gdsys strider board is based on a Freescale MPC8308 SOC. It boots from NOR-Flash, kernel and rootfs are stored on SD-Card.

On board peripherals include:
- 1x 10/100 Mbit/s Ethernet (optional)
- Lattice ECP3 FPGA connected via eLBC

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/22a9d8f3/attachment.sig>
#32 lore raw

PATCH 12/18 hrcon: Use generic ioep-fpga support

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

The strider platform moved some generic code into ioep-fpga.c. Make use of that on hrcon platform.

---

 board/gdsys/common/Makefile    |   2 +-
 board/gdsys/common/ioep-fpga.c |   5 +
 board/gdsys/mpc8308/hrcon.c    | 241 +----------------------------------------
 3 files changed, 9 insertions(+), 239 deletions(-)
board/gdsys/common/Makefile +1 -1
index ba48e8b..0aa1849 100644
@@ -12,6 +12,6 @@ obj-$(CONFIG_IO64) += miiphybb.o
 obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o
 obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o
 obj-$(CONFIG_CONTROLCENTERD) += dp501.o
-obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o
+obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o
 obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o
 obj-$(CONFIG_STRIDER_CON) += osd.o
board/gdsys/common/ioep-fpga.c +5 -0
index 18d37dc..96f02d6 100644
@@ -43,6 +43,7 @@ enum {
 enum {
 	RAM_DDR2_32 = 0,
 	RAM_DDR3_32 = 1,
+	RAM_DDR3_48 = 2,
 };
 
 enum {
@@ -215,6 +216,10 @@ void ioep_fpga_print_info(unsigned int fpga)
 		printf(", RAM 32 bit DDR3");
 		break;
 
+	case RAM_DDR3_48:
+		printf(", RAM 48 bit DDR3");
+		break;
+
 	default:
 		printf(", RAM %d(not supported)", feature_ramconfig);
 		break;
board/gdsys/mpc8308/hrcon.c +3 -238

271 lines not on this page · raw message

Signature · 1 line
2.1.3
#33 lore raw

PATCH 12/18 hrcon: Use generic ioep-fpga support

Quoted 6 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

The strider platform moved some generic code into ioep-fpga.c. Make use of that on hrcon platform.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/ef010f5e/attachment.sig>
#34 lore raw

PATCH 13/18 hrcon: Fix videoboard i2c setup

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

- i2c addresses for the videoboard port expanders were wrong.
- the fpga reset signal was not initialized.

---

 board/gdsys/mpc8308/hrcon.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
board/gdsys/mpc8308/hrcon.c +8 -2
index 29c85c8..5492718 100644
@@ -119,7 +119,7 @@ int last_stage_init(void)
 	int slaves;
 	unsigned int k;
 	unsigned int mux_ch;
-	unsigned char mclink_controllers[] = { 0x24, 0x25, 0x26 };
+	unsigned char mclink_controllers[] = { 0x3c, 0x3d, 0x3e };
 	u16 fpga_features;
 	bool hw_type_cat = pca9698_get_value(0x20, 20);
 	bool ch0_rgmii2_present = false;
@@ -131,7 +131,7 @@ int last_stage_init(void)
 
 	ch0_rgmii2_present = !pca9698_get_value(0x20, 30);
 
-	/* wait for FPGA done */
+	/* wait for FPGA done, then reset FPGA */
 	for (k = 0; k < ARRAY_SIZE(mclink_controllers); ++k) {
 		unsigned int ctr = 0;
 
@@ -146,6 +146,12 @@ int last_stage_init(void)
 				break;
 			}
 		}
+
+		pca953x_set_dir(mclink_controllers[k], MCFPGA_RESET_N, 0);
+		pca953x_set_val(mclink_controllers[k], MCFPGA_RESET_N, 0);
+		udelay(10);
+		pca953x_set_val(mclink_controllers[k], MCFPGA_RESET_N,
+				MCFPGA_RESET_N);
 	}
 
 	if (hw_type_cat) {
Signature · 1 line
2.1.3
#35 lore raw

PATCH 13/18 hrcon: Fix videoboard i2c setup

Quoted 7 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

- i2c addresses for the videoboard port expanders were wrong.
- the fpga reset signal was not initialized.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/1a3d1c63/attachment.sig>
#36 lore raw

PATCH 14/18 hrcon: Add support for the DH variant

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

hrcon DH(dual head) has two video outputs per FPGA.

---

 board/gdsys/common/osd.c        | 111 +++++++++++++++++++++++++++++++---------
 board/gdsys/mpc8308/MAINTAINERS |   1 +
 board/gdsys/mpc8308/hrcon.c     |  31 +++++++++--
 configs/hrcon_dh_defconfig      |   5 ++
 drivers/i2c/soft_i2c.c          |  28 ++++++++++
 include/configs/hrcon.h         |  56 ++++++++++++++++++++
 include/gdsys_fpga.h            |  30 +++++++----
 7 files changed, 225 insertions(+), 37 deletions(-)
 create mode 100644 configs/hrcon_dh_defconfig
board/gdsys/common/osd.c +87 -24
index f11e26f..b288df8 100644
@@ -28,12 +28,45 @@
 
 #define PIXCLK_640_480_60 25180000
 
+#ifdef CONFIG_SYS_OSD_DH
+#define MAX_OSD_SCREEN 8
+#define OSD_DH_BASE 4
+#else
+#define MAX_OSD_SCREEN 4
+#endif
+
+#ifdef CONFIG_SYS_OSD_DH
+#define OSD_SET_REG(screen, fld, val) \
+	do { \
+		if (screen >= OSD_DH_BASE) \
+			FPGA_SET_REG(screen - OSD_DH_BASE, osd1.fld, val); \
+		else \
+			FPGA_SET_REG(screen, osd0.fld, val); \
+	} while (0)
+#else
+#define OSD_SET_REG(screen, fld, val) \
+		FPGA_SET_REG(screen, osd0.fld, val)
+#endif
+
+#ifdef CONFIG_SYS_OSD_DH
+#define OSD_GET_REG(screen, fld, val) \
+	do {					\
+		if (screen >= OSD_DH_BASE) \
+			FPGA_GET_REG(screen - OSD_DH_BASE, osd1.fld, val); \
+		else \
+			FPGA_GET_REG(screen, osd0.fld, val); \
+	} while (0)
+#else
+#define OSD_GET_REG(screen, fld, val) \
+		FPGA_GET_REG(screen, osd0.fld, val)
+#endif
+
 unsigned int base_width;
 unsigned int base_height;
 size_t bufsize;
 u16 *buf;
 
-unsigned int max_osd_screen = CONFIG_SYS_OSD_SCREENS - 1;
+unsigned int osd_screen_mask = 0;
 
 #ifdef CONFIG_SYS_ICS8N3QV01_I2C
 int ics8n3qv01_i2c[] = CONFIG_SYS_ICS8N3QV01_I2C;
@@ -47,6 +80,9 @@ int sil1178_i2c[] = CONFIG_SYS_SIL1178_I2C;
 int dp501_i2c[] = CONFIG_SYS_DP501_I2C;
 #endif
 
+#ifdef CONFIG_SYS_DP501_BASE
+int dp501_base[] = CONFIG_SYS_DP501_BASE;
+#endif
 
 #ifdef CONFIG_SYS_MPC92469AC
 static void mpc92469ac_calc_parameters(unsigned int fout,
@@ -216,7 +252,15 @@ static int osd_write_videomem(unsigned screen, unsigned offset,
 	for (k = 0; k < charcount; ++k) {
 		if (offset + k >= bufsize)
 			return -1;
-		FPGA_SET_REG(screen, videomem[offset + k], data[k]);
+#ifdef CONFIG_SYS_OSD_DH
+		if (screen >= OSD_DH_BASE)
+			FPGA_SET_REG(screen - OSD_DH_BASE,
+				     videomem1[offset + k], data[k]);
+		else
+			FPGA_SET_REG(screen, videomem0[offset + k], data[k]);
+#else
+		FPGA_SET_REG(screen, videomem0[offset + k], data[k]);
+#endif
 	}
 
 	return charcount;
@@ -226,7 +270,12 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned screen;
 
-	for (screen = 0; screen <= max_osd_screen; ++screen) {
+	if (argc < 5) {
+		cmd_usage(cmdtp);
+		return 1;
+	}
+
+	for (screen = 0; screen < MAX_OSD_SCREEN; ++screen) {
 		unsigned x;
 		unsigned y;
 		unsigned charcount;
@@ -236,10 +285,8 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		char *text;
 		int res;
 
-		if (argc < 5) {
-			cmd_usage(cmdtp);
-			return 1;
-		}
+		if (!(osd_screen_mask & (1 << screen)))
+			continue;
 
 		x = simple_strtoul(argv[1], NULL, 16);
 		y = simple_strtoul(argv[2], NULL, 16);
@@ -266,9 +313,16 @@ int osd_probe(unsigned screen)
 	int old_bus = i2c_get_bus_num();
 	bool pixclock_present = false;
 	bool output_driver_present = false;
+#ifdef CONFIG_SYS_DP501_I2C
+#ifdef CONFIG_SYS_DP501_BASE
+	uint8_t dp501_addr = dp501_base[screen];
+#else
+	uint8_t dp501_addr = DP501_I2C_ADDR;
+#endif
+#endif
 
-	FPGA_GET_REG(0, osd.version, &version);
-	FPGA_GET_REG(0, osd.features, &features);
+	OSD_GET_REG(0, version, &version);
+	OSD_GET_REG(0, features, &features);
 
 	base_width = ((features & 0x3f00) >> 8) + 1;
 	base_height = (features & 0x001f) + 1;
@@ -277,9 +331,15 @@ int osd_probe(unsigned screen)
 	if (!buf)
 		return -1;
 
+#ifdef CONFIG_SYS_OSD_DH
+	printf("OSD%d-%d: Digital-OSD version %01d.%02d, %d" "x%d characters\n",
+	       (screen >= OSD_DH_BASE) ? (screen - OSD_DH_BASE) : screen,
+	       (screen > 3) ? 1 : 0, version/100, version%100, base_width,
+	       base_height);
+#else
 	printf("OSD%d:  Digital-OSD version %01d.%02d, %d" "x%d characters\n",
-		screen, version/100, version%100, base_width, base_height);
-
+	       screen, version/100, version%100, base_width, base_height);
+#endif
 	/* setup pixclock */
 
 #ifdef CONFIG_SYS_MPC92469AC
@@ -330,8 +390,8 @@ int osd_probe(unsigned screen)
 
 #ifdef CONFIG_SYS_DP501_I2C
 	i2c_set_bus_num(dp501_i2c[screen]);
-	if (!i2c_probe(DP501_I2C_ADDR)) {
-		dp501_powerup(DP501_I2C_ADDR);
+	if (!i2c_probe(dp501_addr)) {
+		dp501_powerup(dp501_addr);
 		output_driver_present = true;
 	}
 #endif
@@ -339,14 +399,14 @@ int osd_probe(unsigned screen)
 	if (!output_driver_present)
 		printf("       no output driver found\n");
 
-	FPGA_SET_REG(screen, osd.control, 0x0049);
+	OSD_SET_REG(screen, control, 0x0049);
 
-	FPGA_SET_REG(screen, osd.xy_size, ((32 - 1) << 8) | (16 - 1));
-	FPGA_SET_REG(screen, osd.x_pos, 0x007f);
-	FPGA_SET_REG(screen, osd.y_pos, 0x005f);
+	OSD_SET_REG(screen, xy_size, ((32 - 1) << 8) | (16 - 1));
+	OSD_SET_REG(screen, x_pos, 0x007f);
+	OSD_SET_REG(screen, y_pos, 0x005f);
 
-	if (screen > max_osd_screen)
-		max_osd_screen = screen;
+	if (pixclock_present && output_driver_present)
+		osd_screen_mask |= 1 << screen;
 
 	i2c_set_bus_num(old_bus);
 
@@ -357,7 +417,12 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned screen;
 
-	for (screen = 0; screen <= max_osd_screen; ++screen) {
+	if ((argc < 4) || (strlen(argv[3]) % 4)) {
+		cmd_usage(cmdtp);
+		return 1;
+	}
+
+	for (screen = 0; screen < MAX_OSD_SCREEN; ++screen) {
 		unsigned x;
 		unsigned y;
 		unsigned k;
@@ -367,10 +432,8 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		unsigned count = (argc > 4) ?
 			simple_strtoul(argv[4], NULL, 16) : 1;
 
-		if ((argc < 4) || (strlen(argv[3]) % 4)) {
-			cmd_usage(cmdtp);
-			return 1;
-		}
+		if (!(osd_screen_mask & (1 << screen)))
+			continue;
 
 		x = simple_strtoul(argv[1], NULL, 16);
 		y = simple_strtoul(argv[2], NULL, 16);
board/gdsys/mpc8308/MAINTAINERS +1 -0
index 35704bc..3895b01 100644
@@ -4,6 +4,7 @@ S:	Maintained
 F:	board/gdsys/mpc8308/
 F:	include/configs/hrcon.h
 F:	configs/hrcon_defconfig
+F:	configs/hrcon_dh_defconfig
 F:	include/configs/strider.h
 F:	configs/strider_cpu_defconfig
 F:	configs/strider_con_defconfig
board/gdsys/mpc8308/hrcon.c +27 -4
index 5492718..3cc03cb 100644
@@ -128,6 +128,7 @@ int last_stage_init(void)
 
 	/* Turn on Parade DP501 */
 	pca9698_direction_output(0x20, 10, 1);
+	pca9698_direction_output(0x20, 11, 1);
 
 	ch0_rgmii2_present = !pca9698_get_value(0x20, 30);
 
@@ -174,6 +175,9 @@ int last_stage_init(void)
 
 	ioep_fpga_print_info(0);
 	osd_probe(0);
+#ifdef CONFIG_SYS_OSD_DH
+	osd_probe(4);
+#endif
 
 	if (slaves <= 0)
 		return 0;
@@ -185,6 +189,9 @@ int last_stage_init(void)
 
 		ioep_fpga_print_info(k);
 		osd_probe(k);
+#ifdef CONFIG_SYS_OSD_DH
+		osd_probe(k + 4);
+#endif
 		if (hw_type_cat) {
 			miiphy_register(bb_miiphy_buses[k].name,
 					bb_miiphy_read, bb_miiphy_write);
@@ -196,28 +203,44 @@ int last_stage_init(void)
 }
 
 /*
- * provide access to fpga gpios (for I2C bitbang)
+ * provide access to fpga gpios and controls (for I2C bitbang)
  * (these may look all too simple but make iocon.h much more readable)
  */
 void fpga_gpio_set(unsigned int bus, int pin)
 {
-	FPGA_SET_REG(bus, gpio.set, pin);
+	FPGA_SET_REG(bus >= 4 ? (bus - 4) : bus, gpio.set, pin);
 }
 
 void fpga_gpio_clear(unsigned int bus, int pin)
 {
-	FPGA_SET_REG(bus, gpio.clear, pin);
+	FPGA_SET_REG(bus >= 4 ? (bus - 4) : bus, gpio.clear, pin);
 }
 
 int fpga_gpio_get(unsigned int bus, int pin)
 {
 	u16 val;
 
-	FPGA_GET_REG(bus, gpio.read, &val);
+	FPGA_GET_REG(bus >= 4 ? (bus - 4) : bus, gpio.read, &val);
 
 	return val & pin;
 }
 
+void fpga_control_set(unsigned int bus, int pin)
+{
+	u16 val;
+
+	FPGA_GET_REG(bus >= 4 ? (bus - 4) : bus, control, &val);
+	FPGA_SET_REG(bus >= 4 ? (bus - 4) : bus, control, val | pin);
+}
+
+void fpga_control_clear(unsigned int bus, int pin)
+{
+	u16 val;
+
+	FPGA_GET_REG(bus >= 4 ? (bus - 4) : bus, control, &val);
+	FPGA_SET_REG(bus >= 4 ? (bus - 4) : bus, control, val & ~pin);
+}
+
 void mpc8308_init(void)
 {
 	pca9698_direction_output(0x20, 4, 1);
configs/hrcon_dh_defconfig new file +5 -0
new file mode 100644
index 0000000..a059dd9
@@ -0,0 +1,5 @@
+CONFIG_SYS_EXTRA_OPTIONS="HRCON_DH"
+
+CONFIG_PPC=y
+CONFIG_MPC83xx=y
+CONFIG_TARGET_HRCON=y
drivers/i2c/soft_i2c.c +28 -0
index db9b402..b000a0e 100644
@@ -473,3 +473,31 @@ U_BOOT_I2C_ADAP_COMPLETE(soft3, soft_i2c_init, soft_i2c_probe,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_4,
 			 3)
 #endif
+#if defined(I2C_SOFT_DECLARATIONS5)
+U_BOOT_I2C_ADAP_COMPLETE(soft4, soft_i2c_init, soft_i2c_probe,
+			 soft_i2c_read, soft_i2c_write, NULL,
+			 CONFIG_SYS_I2C_SOFT_SPEED_5,
+			 CONFIG_SYS_I2C_SOFT_SLAVE_5,
+			 4)
+#endif
+#if defined(I2C_SOFT_DECLARATIONS6)
+U_BOOT_I2C_ADAP_COMPLETE(soft5, soft_i2c_init, soft_i2c_probe,
+			 soft_i2c_read, soft_i2c_write, NULL,
+			 CONFIG_SYS_I2C_SOFT_SPEED_6,
+			 CONFIG_SYS_I2C_SOFT_SLAVE_6,
+			 5)
+#endif
+#if defined(I2C_SOFT_DECLARATIONS7)
+U_BOOT_I2C_ADAP_COMPLETE(soft6, soft_i2c_init, soft_i2c_probe,
+			 soft_i2c_read, soft_i2c_write, NULL,
+			 CONFIG_SYS_I2C_SOFT_SPEED_7,
+			 CONFIG_SYS_I2C_SOFT_SLAVE_7,
+			 6)
+#endif
+#if defined(I2C_SOFT_DECLARATIONS8)
+U_BOOT_I2C_ADAP_COMPLETE(soft7, soft_i2c_init, soft_i2c_probe,
+			 soft_i2c_read, soft_i2c_write, NULL,
+			 CONFIG_SYS_I2C_SOFT_SPEED_8,
+			 CONFIG_SYS_I2C_SOFT_SLAVE_8,
+			 7)
+#endif
include/configs/hrcon.h +56 -0

91 lines not on this page · raw message

include/gdsys_fpga.h +21 -9
index 69d248f..3b8762d 100644
@@ -157,9 +157,9 @@ struct ihs_fpga {
 	u16 mc_rx_data;		/* 0x0072 */
 	u16 reserved_5[69];	/* 0x0074 */
 	u16 reflection_high;	/* 0x00fe */
-	struct ihs_osd osd;	/* 0x0100 */
+	struct ihs_osd osd0;	/* 0x0100 */
 	u16 reserved_6[889];	/* 0x010e */
-	u16 videomem[31736];	/* 0x0800 */
+	u16 videomem0[2048];	/* 0x0800 */
 };
 #endif
 
@@ -171,7 +171,9 @@ struct ihs_fpga {
 	u16 fpga_features;	/* 0x0006 */
 	u16 reserved_0[1];	/* 0x0008 */
 	u16 top_interrupt;	/* 0x000a */
-	u16 reserved_1[4];	/* 0x000c */
+	u16 reserved_1[2];	/* 0x000c */
+	u16 control;		/* 0x0010 */
+	u16 extended_control;	/* 0x0012 */
 	struct ihs_gpio gpio;	/* 0x0014 */
 	u16 mpc3w_control;	/* 0x001a */
 	u16 reserved_2[2];	/* 0x001c */
@@ -191,9 +193,19 @@ struct ihs_fpga {
 	u16 mc_rx_data;		/* 0x0072 */
 	u16 reserved_5[69];	/* 0x0074 */
 	u16 reflection_high;	/* 0x00fe */
-	struct ihs_osd osd;	/* 0x0100 */
+	struct ihs_osd osd0;	/* 0x0100 */
+#ifdef CONFIG_SYS_OSD_DH
+	u16 reserved_6[57];	/* 0x010e */
+	struct ihs_osd osd1;	/* 0x0180 */
+	u16 reserved_7[9];	/* 0x018e */
+	struct ihs_i2c i2c1;	/* 0x01a0 */
+	u16 reserved_8[1834];	/* 0x01ac */
+	u16 videomem0[2048];	/* 0x1000 */
+	u16 videomem1[2048];	/* 0x2000 */
+#else
 	u16 reserved_6[889];	/* 0x010e */
-	u16 videomem[31736];	/* 0x0800 */
+	u16 videomem0[2048];	/* 0x0800 */
+#endif
 };
 #endif
 
@@ -254,9 +266,9 @@ struct ihs_fpga {
 	u16 mc_rx_cmd_status;	/* 0x0070 */
 	u16 mc_rx_data;		/* 0x0072 */
 	u16 reserved_5[70];	/* 0x0074 */
-	struct ihs_osd osd;	/* 0x0100 */
+	struct ihs_osd osd0;	/* 0x0100 */
 	u16 reserved_6[889];	/* 0x010e */
-	u16 videomem[31736];	/* 0x0800 */
+	u16 videomem0[2048];	/* 0x0800 */
 };
 #endif
 
@@ -275,9 +287,9 @@ struct ihs_fpga {
 	u16 reserved_3[2];	/* 0x006c */
 	struct ihs_i2c i2c1;	/* 0x0070 */
 	u16 reserved_4[194];	/* 0x007c */
-	struct ihs_osd osd;	/* 0x0200 */
+	struct ihs_osd osd0;	/* 0x0200 */
 	u16 reserved_5[761];	/* 0x020e */
-	u16 videomem[31736];	/* 0x0800 */
+	u16 videomem0[2048];	/* 0x0800 */
 };
 #endif
 
Signature · 1 line
2.1.3
#37 lore raw

PATCH 14/18 hrcon: Add support for the DH variant

Quoted 5 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

hrcon DH(dual head) has two video outputs per FPGA.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/2949f373/attachment.sig>
#38 lore raw

PATCH 15/18 hrcon: Add fan controllers

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

---

 board/gdsys/common/Makefile   |  3 ++-
 board/gdsys/common/fanctrl.c  | 32 +++++++++++++++++++++++++++++++
 board/gdsys/common/fanctrl.h  | 13 +++++++++++++
 board/gdsys/mpc8308/hrcon.c   | 11 +++++++++++
 board/gdsys/mpc8308/strider.c | 24 +----------------------
 drivers/i2c/soft_i2c.c        | 28 +++++++++++++++++++++++++++
 include/configs/hrcon.h       | 44 +++++++++++++++++++++++++++++++------------
 7 files changed, 119 insertions(+), 36 deletions(-)
 create mode 100644 board/gdsys/common/fanctrl.c
 create mode 100644 board/gdsys/common/fanctrl.h
board/gdsys/common/Makefile +2 -1
index 0aa1849..ce23045 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_IO64) += miiphybb.o
 obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o
 obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o
 obj-$(CONFIG_CONTROLCENTERD) += dp501.o
-obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o
+obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o fanctrl.o
 obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o
+obj-$(CONFIG_STRIDER) += fanctrl.o
 obj-$(CONFIG_STRIDER_CON) += osd.o
board/gdsys/common/fanctrl.c new file +32 -0
new file mode 100644
index 0000000..44569bb
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2015
+ * Dirk Eibach,  Guntermann & Drunck GmbH, eibach at gdsys.de
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <i2c.h>
+
+enum {
+	FAN_CONFIG = 0x03,
+	FAN_TACHLIM_LSB = 0x48,
+	FAN_TACHLIM_MSB = 0x49,
+	FAN_PWM_FREQ = 0x4D,
+};
+
+void init_fan_controller(u8 addr)
+{
+	int val;
+
+	/* set PWM Frequency to 2.5% resolution */
+	i2c_reg_write(addr, FAN_PWM_FREQ, 20);
+
+	/* set Tachometer Limit */
+	i2c_reg_write(addr, FAN_TACHLIM_LSB, 0x10);
+	i2c_reg_write(addr, FAN_TACHLIM_MSB, 0x0a);
+
+	/* enable Tach input */
+	val = i2c_reg_read(addr, FAN_CONFIG) | 0x04;
+	i2c_reg_write(addr, FAN_CONFIG, val);
+}
board/gdsys/common/fanctrl.h new file +13 -0
new file mode 100644
index 0000000..12bc850
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2015
+ * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eibach at gdsys.cc
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _FANCTRL_H_
+#define _FANCTRL_H_
+
+void init_fan_controller(u8 addr);
+
+#endif
board/gdsys/mpc8308/hrcon.c +11 -0
index 3cc03cb..880b638 100644
@@ -26,6 +26,7 @@
 #include "../common/osd.h"
 #include "../common/mclink.h"
 #include "../common/phy.h"
+#include "../common/fanctrl.h"
 
 #include <pca953x.h>
 #include <pca9698.h>
@@ -52,6 +53,11 @@ enum {
 unsigned int mclink_fpgacount;
 struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
 
+struct {
+	u8 bus;
+	u8 addr;
+} hrcon_fans[] = CONFIG_HRCON_FANS;
+
 int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
 {
 	int res;
@@ -199,6 +205,11 @@ int last_stage_init(void)
 		}
 	}
 
+	for (k = 0; k < ARRAY_SIZE(hrcon_fans); ++k) {
+		i2c_set_bus_num(hrcon_fans[k].bus);
+		init_fan_controller(hrcon_fans[k].addr);
+	}
+
 	return 0;
 }
 
board/gdsys/mpc8308/strider.c +1 -23
index 8e5d5de..ef5b6c0 100644
@@ -28,6 +28,7 @@
 #include "../common/mclink.h"
 #include "../common/osd.h"
 #include "../common/phy.h"
+#include "../common/fanctrl.h"
 
 #include <pca953x.h>
 #include <pca9698.h>
@@ -51,13 +52,6 @@ enum {
 	GPIO_MDIO = 1 << 15,
 };
 
-enum {
-	FAN_CONFIG = 0x03,
-	FAN_TACHLIM_LSB = 0x48,
-	FAN_TACHLIM_MSB = 0x49,
-	FAN_PWM_FREQ = 0x4D,
-};
-
 unsigned int mclink_fpgacount;
 struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
 
@@ -128,22 +122,6 @@ int checkboard(void)
 	return 0;
 }
 
-static void init_fan_controller(u8 addr)
-{
-	int val;
-
-	/* set PWM Frequency to 2.5% resolution */
-	i2c_reg_write(addr, FAN_PWM_FREQ, 20);
-
-	/* set Tachometer Limit */
-	i2c_reg_write(addr, FAN_TACHLIM_LSB, 0x10);
-	i2c_reg_write(addr, FAN_TACHLIM_MSB, 0x0a);
-
-	/* enable Tach input */
-	val = i2c_reg_read(addr, FAN_CONFIG) | 0x04;
-	i2c_reg_write(addr, FAN_CONFIG, val);
-}
-
 int last_stage_init(void)
 {
 	int slaves;
drivers/i2c/soft_i2c.c +28 -0
index b000a0e..5ffc974 100644
@@ -501,3 +501,31 @@ U_BOOT_I2C_ADAP_COMPLETE(soft7, soft_i2c_init, soft_i2c_probe,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_8,
 			 7)
 #endif
+#if defined(I2C_SOFT_DECLARATIONS9)
+U_BOOT_I2C_ADAP_COMPLETE(soft8, soft_i2c_init, soft_i2c_probe,
+			 soft_i2c_read, soft_i2c_write, NULL,
+			 CONFIG_SYS_I2C_SOFT_SPEED_9,
+			 CONFIG_SYS_I2C_SOFT_SLAVE_9,
+			 8)
+#endif
+#if defined(I2C_SOFT_DECLARATIONS10)
+U_BOOT_I2C_ADAP_COMPLETE(soft9, soft_i2c_init, soft_i2c_probe,
+			 soft_i2c_read, soft_i2c_write, NULL,
+			 CONFIG_SYS_I2C_SOFT_SPEED_10,
+			 CONFIG_SYS_I2C_SOFT_SLAVE_10,
+			 9)
+#endif
+#if defined(I2C_SOFT_DECLARATIONS11)
+U_BOOT_I2C_ADAP_COMPLETE(soft10, soft_i2c_init, soft_i2c_probe,
+			 soft_i2c_read, soft_i2c_write, NULL,
+			 CONFIG_SYS_I2C_SOFT_SPEED_11,
+			 CONFIG_SYS_I2C_SOFT_SLAVE_11,
+			 10)
+#endif
+#if defined(I2C_SOFT_DECLARATIONS12)
+U_BOOT_I2C_ADAP_COMPLETE(soft11, soft_i2c_init, soft_i2c_probe,
+			 soft_i2c_read, soft_i2c_write, NULL,
+			 CONFIG_SYS_I2C_SOFT_SPEED_12,
+			 CONFIG_SYS_I2C_SOFT_SLAVE_12,
+			 11)
+#endif
include/configs/hrcon.h +32 -12

87 lines not on this page · raw message

Signature · 1 line
2.1.3
#39 lore raw

PATCH 15/18 hrcon: Add fan controllers

Quoted 3 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/b33dfa29/attachment.sig>
#40 lore raw

PATCH 16/18 board: gdsys: Add osdsize command

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

osdsize adjusts the gdsys IHS osd dimensions in characters.

---

 board/gdsys/common/osd.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
board/gdsys/common/osd.c +38 -0
index b288df8..a774bec 100644
@@ -27,6 +27,8 @@
 #define DP501_I2C_ADDR 0x08
 
 #define PIXCLK_640_480_60 25180000
+#define MAX_X_CHARS 53
+#define MAX_Y_CHARS 26
 
 #ifdef CONFIG_SYS_OSD_DH
 #define MAX_OSD_SCREEN 8
@@ -464,6 +466,35 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+int osd_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	unsigned screen;
+	unsigned x;
+	unsigned y;
+
+	if (argc < 3) {
+		cmd_usage(cmdtp);
+		return 1;
+	}
+
+	x = simple_strtoul(argv[1], NULL, 16);
+	y = simple_strtoul(argv[2], NULL, 16);
+
+	if (!x || (x > 64) || (x > MAX_X_CHARS) ||
+	    !y || (y > 32) || (y > MAX_Y_CHARS)) {
+		cmd_usage(cmdtp);
+		return 1;
+	}
+
+	for (screen = 0; screen < MAX_OSD_SCREEN; ++screen) {
+		OSD_SET_REG(screen, xy_size, ((x - 1) << 8) | (y - 1));
+		OSD_SET_REG(screen, x_pos, 32767 * (640 - 12 * x) / 65535);
+		OSD_SET_REG(screen, y_pos, 32767 * (480 - 18 * y) / 65535);
+	}
+
+	return 0;
+}
+
 U_BOOT_CMD(
 	osdw, 5, 0, osd_write,
 	"write 16-bit hex encoded buffer to osd memory",
@@ -475,3 +506,10 @@ U_BOOT_CMD(
 	"write ASCII buffer to osd memory",
 	"pos_x pos_y color text\n"
 );
+
+U_BOOT_CMD(
+	osdsize, 3, 0, osd_size,
+	"set OSD XY size in characters",
+	"size_x(max. " __stringify(MAX_X_CHARS)
+	") size_y(max. " __stringify(MAX_Y_CHARS) ")\n"
+);
Signature · 1 line
2.1.3
#41 lore raw

PATCH 16/18 board: gdsys: Add osdsize command

Quoted 5 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

osdsize adjusts the gdsys IHS osd dimensions in characters.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/e19dc57f/attachment.sig>
#42 lore raw

PATCH 17/18 board: gdsys: Enable osd on output only

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

---

 board/gdsys/common/osd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
board/gdsys/common/osd.c +4 -2
index a774bec..7444bee 100644
@@ -303,6 +303,8 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		res = osd_write_videomem(screen, y * base_width + x, buf, len);
 		if (res < 0)
 			return res;
+
+		OSD_SET_REG(screen, control, 0x0049);
 	}
 
 	return 0;
@@ -401,8 +403,6 @@ int osd_probe(unsigned screen)
 	if (!output_driver_present)
 		printf("       no output driver found\n");
 
-	OSD_SET_REG(screen, control, 0x0049);
-
 	OSD_SET_REG(screen, xy_size, ((32 - 1) << 8) | (16 - 1));
 	OSD_SET_REG(screen, x_pos, 0x007f);
 	OSD_SET_REG(screen, y_pos, 0x005f);
@@ -461,6 +461,8 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			osd_write_videomem(screen, offset, buffer,
 				wp - buffer);
 		}
+
+		OSD_SET_REG(screen, control, 0x0049);
 	}
 
 	return 0;
Signature · 1 line
2.1.3
#43 lore raw

PATCH 17/18 board: gdsys: Enable osd on output only

Quoted 3 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/08d86555/attachment.sig>
#44 lore raw

PATCH 18/18 i2c: soft_i2c: Fix bus indizes

In reply to dirk.eibach at gdsys.cc

From: Dirk Eibach <[email protected]>

Since busses are sorted in alphabetical order, introducing more than nine busses led to unexpected behaviour.

---

 drivers/i2c/soft_i2c.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/i2c/soft_i2c.c +10 -10
index 5ffc974..05bf4d4 100644
@@ -448,68 +448,68 @@ static int  soft_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
 /*
  * Register soft i2c adapters
  */
-U_BOOT_I2C_ADAP_COMPLETE(soft0, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft00, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED, CONFIG_SYS_I2C_SOFT_SLAVE,
 			 0)
 #if defined(I2C_SOFT_DECLARATIONS2)
-U_BOOT_I2C_ADAP_COMPLETE(soft1, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft01, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_2,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_2,
 			 1)
 #endif
 #if defined(I2C_SOFT_DECLARATIONS3)
-U_BOOT_I2C_ADAP_COMPLETE(soft2, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft02, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_3,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_3,
 			 2)
 #endif
 #if defined(I2C_SOFT_DECLARATIONS4)
-U_BOOT_I2C_ADAP_COMPLETE(soft3, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft03, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_4,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_4,
 			 3)
 #endif
 #if defined(I2C_SOFT_DECLARATIONS5)
-U_BOOT_I2C_ADAP_COMPLETE(soft4, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft04, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_5,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_5,
 			 4)
 #endif
 #if defined(I2C_SOFT_DECLARATIONS6)
-U_BOOT_I2C_ADAP_COMPLETE(soft5, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft05, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_6,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_6,
 			 5)
 #endif
 #if defined(I2C_SOFT_DECLARATIONS7)
-U_BOOT_I2C_ADAP_COMPLETE(soft6, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft06, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_7,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_7,
 			 6)
 #endif
 #if defined(I2C_SOFT_DECLARATIONS8)
-U_BOOT_I2C_ADAP_COMPLETE(soft7, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft07, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_8,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_8,
 			 7)
 #endif
 #if defined(I2C_SOFT_DECLARATIONS9)
-U_BOOT_I2C_ADAP_COMPLETE(soft8, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft08, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_9,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_9,
 			 8)
 #endif
 #if defined(I2C_SOFT_DECLARATIONS10)
-U_BOOT_I2C_ADAP_COMPLETE(soft9, soft_i2c_init, soft_i2c_probe,
+U_BOOT_I2C_ADAP_COMPLETE(soft09, soft_i2c_init, soft_i2c_probe,
 			 soft_i2c_read, soft_i2c_write, NULL,
 			 CONFIG_SYS_I2C_SOFT_SPEED_10,
 			 CONFIG_SYS_I2C_SOFT_SLAVE_10,
Signature · 1 line
2.1.3
#45 lore raw

PATCH 18/18 i2c: soft_i2c: Fix bus indizes

Quoted 6 lines · Dirk Eibach

From: Dirk Eibach <[email protected]>

Since busses are sorted in alphabetical order, introducing more than nine busses led to unexpected behaviour.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/80cbb821/attachment.sig>
#46 lore raw

cover Fixes on gdsys boards and some new functionality

In reply to dirk.eibach at gdsys.cc

Hi Dirk,

Quoted 24 lines · On 28 October 2015 at 04:46, <[email protected]> wrote:

From: Dirk Eibach <[email protected]>

Dirk Eibach (17):
i2c: ihs_i2c: Dual channel support
i2c: ihs_i2c: Use macro bestpractices
i2c: ihs_i2c: Fix hold_bus control
board: gdsys: Configure DP501 SPDIF input
board: gdsys: Increase DP501 I2C retry interval
board: gdsys: Consider DP501 limits on link training
dlvision-10g: Support displayport
controlcenterd: Disable sideband clocks
hrcon: Remove CH7301 configuration
mpc83xx: Add strider board
hrcon: Use generic ioep-fpga support
hrcon: Fix videoboard i2c setup
hrcon: Add support for the DH variant
hrcon: Add fan controllers
board: gdsys: Add osdsize command
board: gdsys: Enable osd on output only
i2c: soft_i2c: Fix bus indizes

Quoted 2 lines

Reinhard Pfau (1):
iocon: reset FPGAs in last_stage_init()

Would this be a good opportunity to convert these boards over to driver model for I2C?

Regards,
Simon

#47 lore raw

cover Fixes on gdsys boards and some new functionality

Hi Simon,

2015-10-28 14:42 GMT+01:00 Simon Glass <[email protected]>:

Quoted 19 lines
Quoted 19 lines

Dirk Eibach (17):
i2c: ihs_i2c: Dual channel support
i2c: ihs_i2c: Use macro bestpractices
i2c: ihs_i2c: Fix hold_bus control
board: gdsys: Configure DP501 SPDIF input
board: gdsys: Increase DP501 I2C retry interval
board: gdsys: Consider DP501 limits on link training
dlvision-10g: Support displayport
controlcenterd: Disable sideband clocks
hrcon: Remove CH7301 configuration
mpc83xx: Add strider board
hrcon: Use generic ioep-fpga support
hrcon: Fix videoboard i2c setup
hrcon: Add support for the DH variant
hrcon: Add fan controllers
board: gdsys: Add osdsize command
board: gdsys: Enable osd on output only
i2c: soft_i2c: Fix bus indizes

Quoted 5 lines
Quoted 2 lines

Reinhard Pfau (1):
iocon: reset FPGAs in last_stage_init()

Would this be a good opportunity to convert these boards over to driver model for I2C?

I'd love to, devicetrees are already there. But I am still working on a concept to deploy this on *all* our boards and not only for I2C. So please remain patient, I think this will be for the next merge window.

Cheers
Dirk

#48 lore raw

cover Fixes on gdsys boards and some new functionality

Hello Dirk,

Am 28.10.2015 um 15:01 schrieb Dirk Eibach:

Quoted 25 lines

Hi Simon,

2015-10-28 14:42 GMT+01:00 Simon Glass <[email protected]>:

Quoted 22 lines
Quoted 21 lines

Dirk Eibach (17):
i2c: ihs_i2c: Dual channel support
i2c: ihs_i2c: Use macro bestpractices
i2c: ihs_i2c: Fix hold_bus control
board: gdsys: Configure DP501 SPDIF input
board: gdsys: Increase DP501 I2C retry interval
board: gdsys: Consider DP501 limits on link training
dlvision-10g: Support displayport
controlcenterd: Disable sideband clocks
hrcon: Remove CH7301 configuration
mpc83xx: Add strider board
hrcon: Use generic ioep-fpga support
hrcon: Fix videoboard i2c setup
hrcon: Add support for the DH variant
hrcon: Add fan controllers
board: gdsys: Add osdsize command
board: gdsys: Enable osd on output only
i2c: soft_i2c: Fix bus indizes

Reinhard Pfau (1):
iocon: reset FPGAs in last_stage_init()

Quoted 6 lines
Quoted 2 lines

Would this be a good opportunity to convert these boards over to driver model for I2C?

I'd love to, devicetrees are already there. But I am still working on a concept to deploy this on *all* our boards and not only for I2C. So please remain patient, I think this will be for the next merge window.

Sounds great!

bye,
Heiko

Quoted 4 lines

Cheers
Dirk

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany