Skip to contentSkip to conversation

unassigned-patches/30: [PATCH] 85xx: socrates: Add support for new image format.

U-Boot Applied u-boot at bugs.denx.de 2 participants 4 messages Sep 11, 2008 – Sep 13, 2008 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

[U-Boot] unassigned-patches/31: [PATCH] 85xx: socrates: autoprobe Lime chip

This patch is an attempt to implement autoprobing for the Lime presence on the bus.
Configure GPCM for Lime CS2 and try to access chip ID registers. Second read atempt delivers register values if the chip is present.

---
Added to GNATS database as unassigned-patches/31

Quoted 5 lines
Responsible:    patch-coord
Message-Id:     <[email protected]>

In-Reply-To:
References:
Patch-Date: Thu Sep 11 15:34:57 +0200 2008

---
 board/socrates/socrates.c |   58 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 43 insertions(+), 15 deletions(-)
board/socrates/socrates.c +43 -15
index 73a2d9d..b9d9f08 100644
@@ -36,12 +36,15 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <asm/io.h>
-
+#include <i2c.h>
+#include <mb862xx.h>
+#include <video_fb.h>
 #include "upm_table.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
 extern flash_info_t flash_info[];	/* FLASH chips info */
+extern GraphicDevice mb862xx;
 
 void local_bus_init (void);
 ulong flash_get_size (ulong base, int banknum);
@@ -174,11 +177,9 @@ void local_bus_init (void)
 	out_be32 (&lbc->mamr, 0x44440); /* Use a customer-supplied value */
 	upmconfig (UPMA, (uint *)UPMTableA, sizeof(UPMTableA)/sizeof(int));
 
-	if (getenv("lime")) {
-		/* Init UPMB for Lime controller access */
-		out_be32 (&lbc->mbmr, 0x444440); /* Use a customer-supplied value */
-		upmconfig (UPMB, (uint *)UPMTableB, sizeof(UPMTableB)/sizeof(int));
-	}
+	/* Init UPMB for Lime controller access */
+	out_be32 (&lbc->mbmr, 0x444440); /* Use a customer-supplied value */
+	upmconfig (UPMB, (uint *)UPMTableB, sizeof(UPMTableB)/sizeof(int));
 }
 
 #if defined(CONFIG_PCI)
@@ -245,7 +246,7 @@ ft_board_setup(void *blob, bd_t *bd)
 	val[i++] = gd->bd->bi_flashstart;
 	val[i++] = gd->bd->bi_flashsize;
 
-	if (getenv("lime")) {
+	if (mb862xx.frameAdrs == CFG_LIME_BASE) {
 		/* Fixup LIME mapping */
 		val[i++] = 2;			/* chip select number */
 		val[i++] = 0;			/* always 0 */
@@ -267,10 +268,6 @@ ft_board_setup(void *blob, bd_t *bd)
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
-#include <i2c.h>
-#include <mb862xx.h>
-#include <video_fb.h>
-
 #define CFG_LIME_SRST		((CFG_LIME_BASE) + 0x01FC002C)
 #define CFG_LIME_CCF		((CFG_LIME_BASE) + 0x01FC0038)
 #define CFG_LIME_MMR		((CFG_LIME_BASE) + 0x01FCFFFC)
@@ -285,8 +282,6 @@ ft_board_setup(void *blob, bd_t *bd)
 #define DEFAULT_BRIGHTNESS	25
 #define BACKLIGHT_ENABLE	(1 << 31)
 
-extern GraphicDevice mb862xx;
-
 static const gdc_regs init_regs [] =
 {
 	{0x0100, 0x00010f00},
@@ -313,11 +308,44 @@ const gdc_regs *board_get_regs (void)
 	return init_regs;
 }
 
+#define CFG_LIME_CID		((CFG_LIME_BASE) + 0x01FC00F0)
+#define CFG_LIME_REV		((CFG_LIME_BASE) + 0x01FF8084)
+int lime_probe(void)
+{
+	volatile ccsr_lbc_t *memctl = (void *)(CFG_MPC85xx_LBC_ADDR);
+	uint cfg_br2;
+	uint cfg_or2;
+	uint reg;
+
+	cfg_br2 = memctl->br2;
+	cfg_or2 = memctl->or2;
+
+	/* Configure GPCM for CS2 */
+	memctl->br2 = 0;
+	memctl->or2 = 0xfc000410;
+	memctl->br2 = (CFG_LIME_BASE) | 0x00001901;
+
+	/* Try to access GDC ID/Revision registers */
+	reg = in_be32((void *)CFG_LIME_CID);
+	reg = in_be32((void *)CFG_LIME_CID);
+	if (reg == 0x303) {
+		reg = in_be32((void *)CFG_LIME_REV);
+		reg = in_be32((void *)CFG_LIME_REV);
+		reg = ((reg & ~0xff) == 0x20050100) ? 1 : 0;
+	} else
+		reg = 0;
+
+	/* Restore previous CS2 configuration */
+	memctl->br2 = 0;
+	memctl->or2 = cfg_or2;
+	memctl->br2 = cfg_br2;
+	return reg;
+}
+
 /* Returns Lime base address */
 unsigned int board_video_init (void)
 {
-
-	if (!getenv("lime"))
+	if (!lime_probe())
 		return 0;
 
 	/*
Signature · 1 line
1.5.6.1
#3 lore raw

[U-Boot] unassigned-patches/31: [PATCH] 85xx: socrates: autoprobe Lime chip

Dear Anatolij,

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

This patch is an attempt to implement autoprobing for the Lime presence on the bus.
Configure GPCM for Lime CS2 and try to access chip ID registers. Second read atempt delivers register values if the chip is present.

---
 board/socrates/socrates.c |   58 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 43 insertions(+), 15 deletions(-)

Applied, thanks.

Andy, I hope / guess this is OK with you.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Leave bigotry in your quarters; there's no room for it on the bridge.
	-- Kirk, "Balance of Terror", stardate 1709.2
#4 lore raw
In reply to a message not in the archive

---
Added to GNATS database as unassigned-patches/30

Quoted 5 lines
Responsible:    patch-coord
Message-Id:     <[email protected]>
In-Reply-To:    <[email protected]>
References:     <[email protected]>
Patch-Date:     Thu Sep 11 15:34:58 +0200 2008
---
 include/configs/socrates.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
include/configs/socrates.h +5 -0
index a981a8f..94124cd 100644
@@ -33,6 +33,11 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+/* new uImage format support */
+#define CONFIG_FIT		1
+#define CONFIG_OF_LIBFDT	1
+#define CONFIG_FIT_VERBOSE	1 /* enable fit_format_{error,warning}() */
+
 /* High Level Configuration Options */
 #define CONFIG_BOOKE		1	/* BOOKE			*/
 #define CONFIG_E500		1	/* BOOKE e500 family		*/
Signature · 1 line
1.5.6.1
#5 lore raw

Dear Detlev,

Quoted 4 lines · In message <[email protected]> you wrote:
 include/configs/socrates.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Applied, thanks.

Andy, I hope / guess this is OK with you.

Best regards,

Wolfgang Denk

Signature · 4 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
Of all the things I've lost, I miss my mind the most.