public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] video: mb862xx: support Coral-PA controller
Date: Fri, 27 May 2011 16:08:20 +0200	[thread overview]
Message-ID: <1306505304-9593-2-git-send-email-agust@denx.de> (raw)
In-Reply-To: <1306505304-9593-1-git-send-email-agust@denx.de>

Add detection of Coral-PA and configure Coral CCF an MMR parameters
using CONFIG_SYS_MB862xx_CCF and CONFIG_SYS_MB862xx_MMR macros.
Use CCF and MMR parameters for Coral-P Eval. Board if the appropriate
macros weren't defined.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 drivers/video/mb862xx.c |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/drivers/video/mb862xx.c b/drivers/video/mb862xx.c
index edf34aa..088365d 100644
--- a/drivers/video/mb862xx.c
+++ b/drivers/video/mb862xx.c
@@ -189,10 +189,19 @@ static void de_init (void)
 }
 
 #if defined(CONFIG_VIDEO_CORALP)
+/* use CCF and MMR parameters for Coral-P Eval. Board as default */
+#ifndef CONFIG_SYS_MB862xx_CCF
+#define CONFIG_SYS_MB862xx_CCF	0x00090000
+#endif
+#ifndef CONFIG_SYS_MB862xx_MMR
+#define CONFIG_SYS_MB862xx_MMR	0x11d7fa13
+#endif
+
 unsigned int pci_video_init (void)
 {
 	GraphicDevice *dev = &mb862xx;
 	pci_dev_t devbusfn;
+	u16 device;
 
 	if ((devbusfn = pci_find_devices (supported, 0)) < 0) {
 		puts ("PCI video controller not found!\n");
@@ -212,10 +221,25 @@ unsigned int pci_video_init (void)
 
 	dev->pciBase = dev->frameAdrs;
 
-	/* Setup clocks and memory mode for Coral-P Eval. Board */
-	HOST_WR_REG (GC_CCF, 0x00090000);
+	puts("Coral-");
+
+	pci_read_config_word(devbusfn, PCI_DEVICE_ID, &device);
+	switch (device) {
+	case PCI_DEVICE_ID_CORAL_P:
+		puts("P\n");
+		break;
+	case PCI_DEVICE_ID_CORAL_PA:
+		puts("PA\n");
+		break;
+	default:
+		puts("Unknown\n");
+		return 0;
+	}
+
+	/* Setup clocks and memory mode for Coral-P(A) */
+	HOST_WR_REG(GC_CCF, CONFIG_SYS_MB862xx_CCF);
 	udelay (200);
-	HOST_WR_REG (GC_MMR, 0x11d7fa13);
+	HOST_WR_REG(GC_MMR, CONFIG_SYS_MB862xx_MMR);
 	udelay (100);
 	return dev->frameAdrs;
 }
@@ -235,8 +259,6 @@ unsigned int card_init (void)
 	if (!pci_video_init ())
 		return 0;
 
-	puts ("CoralP\n");
-
 	tmp = 0;
 	videomode = 0x310;
 	/* get video mode via environment */
-- 
1.7.4.4

  reply	other threads:[~2011-05-27 14:08 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 14:08 [U-Boot] [PATCH 0/5] mpc5200: digsy_mtc: update for next Anatolij Gustschin
2011-05-27 14:08 ` Anatolij Gustschin [this message]
2011-07-04 22:32   ` [U-Boot] [PATCH 1/5] video: mb862xx: support Coral-PA controller Anatolij Gustschin
2011-05-27 14:08 ` [U-Boot] [PATCH 2/5] pci: option for configurable delay between pci reset and pci bus scan Anatolij Gustschin
2011-05-27 15:26   ` Detlev Zundel
2011-05-27 16:43     ` Anatolij Gustschin
2011-05-30  7:45       ` Detlev Zundel
2011-05-30 14:10         ` Stefan Roese
2011-10-11 15:16           ` Anatolij Gustschin
2011-10-11 15:18           ` [U-Boot] [PATCH 1/1] pci: move pcidelay code to new location just before PCI " Anatolij Gustschin
2011-10-12  6:58             ` Matthias Fuchs
2011-10-12  8:44             ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2011-10-12  9:42               ` Stefan Roese
2011-10-13 12:50               ` Matthias Fuchs
2011-10-13 13:03                 ` Stefan Roese
2011-10-13 13:08                   ` Matthias Fuchs
2011-10-15 20:16               ` Wolfgang Denk
2011-05-27 14:08 ` [U-Boot] [PATCH 3/5] mpc5200: digsy_mtc: enable pci_scan_delay option Anatolij Gustschin
2011-05-27 15:28   ` Detlev Zundel
2011-10-13 15:19   ` [U-Boot] [PATCH] mpc5200: digsy_mtc: fix detection of Coral-PA Anatolij Gustschin
2011-10-14  8:19     ` Detlev Zundel
2011-10-15 20:19     ` Wolfgang Denk
2011-05-27 14:08 ` [U-Boot] [PATCH 4/5] mpc5200: digsy_mtc: add support for graphic extension board Anatolij Gustschin
2011-05-27 15:33   ` Detlev Zundel
2011-05-27 17:56     ` Anatolij Gustschin
2011-05-30  7:16   ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2011-06-06  9:49     ` Detlev Zundel
2011-07-27 21:26     ` Wolfgang Denk
2011-05-27 14:08 ` [U-Boot] [PATCH 5/5] mpc5200: digsy_mtc: add support for writing 'appreg' value Anatolij Gustschin
2011-05-27 15:36   ` Detlev Zundel
2011-05-27 18:00     ` Anatolij Gustschin
2011-05-30  7:18   ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2011-07-16 20:26     ` [U-Boot] [PATCH] digsy_mtc: move board into vendor dir and add vendor logo Anatolij Gustschin
2011-07-27 21:27       ` Wolfgang Denk
2011-07-27 21:26     ` [U-Boot] [PATCH v2 5/5] mpc5200: digsy_mtc: add support for writing 'appreg' value Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306505304-9593-2-git-send-email-agust@denx.de \
    --to=agust@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox