public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] CPCI750: Add CPCI-HD/2 support
@ 2011-11-10 18:51 Reinhard Arlt
  2012-03-18 19:10 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Reinhard Arlt @ 2011-11-10 18:51 UTC (permalink / raw)
  To: u-boot

From: Reinhard Arlt <reinhard.arlt@esd.eu>

This patch adds support for the esd CPCI-HD/2 board to u-boot for CPCI-CPU/750.
As the primary devices on the CPCI-HD/2 board are connected to device 1 and 3,
the device must be swaped. 
Signed-off-by: Reinhard Arlt <reinhard.arlt@esd.eu>

--

diff --git a/board/esd/cpci750/ide.c b/board/esd/cpci750/ide.c
index a3bd1b7..aa001df 100644
--- a/board/esd/cpci750/ide.c
+++ b/board/esd/cpci750/ide.c
@@ -31,6 +31,18 @@
 #include <pci.h>
 
 extern ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS];
+int cpci_hd_type;
+
+int ata_device(int dev)
+{
+	int retval;
+
+	retval = (dev & 1) << 4;
+	if (cpci_hd_type == 2)
+		retval ^= 1 << 4;
+	return retval;
+}
+
 
 int ide_preinit (void)
 {
@@ -39,14 +51,21 @@ int ide_preinit (void)
 	int l;
 
 	status = 1;
+	cpci_hd_type = 0;
 	if (CPCI750_SLAVE_TEST != 0)
 		return status;
 	for (l = 0; l < CONFIG_SYS_IDE_MAXBUS; l++) {
 		ide_bus_offset[l] = -ATA_STATUS;
 	}
 	devbusfn = pci_find_device (0x1103, 0x0004, 0);
-	if (devbusfn == -1)
+	if (devbusfn != -1) {
+		cpci_hd_type = 1;
+	} else {
 	        devbusfn = pci_find_device (0x1095, 0x3114, 0);
+		if (devbusfn != -1) {
+			cpci_hd_type = 2;
+		}
+	}
 	if (devbusfn != -1) {
 		ulong *ide_bus_offset_ptr;
 
diff --git a/include/ata.h b/include/ata.h
index b51475d..3b2d737 100644
--- a/include/ata.h
+++ b/include/ata.h
@@ -82,7 +82,9 @@
 /*
  * Device / Head Register Bits
  */
+#ifndef ATA_DEVICE
 #define ATA_DEVICE(x)	((x & 1)<<4)
+#endif /* ATA_DEVICE */
 #define ATA_LBA		0xE0
 
 /*
diff --git a/include/configs/CPCI750.h b/include/configs/CPCI750.h
index d735e61..a6af86c 100644
--- a/include/configs/CPCI750.h
+++ b/include/configs/CPCI750.h
@@ -187,6 +187,8 @@
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 #define CONFIG_SYS_I2C_SPEED	80000		/* I2C speed default */
 
+#define CONFIG_PRAM 0
+
 #define CONFIG_SYS_GT_DUAL_CPU			/* also for JTAG even with one cpu */
 #define CONFIG_SYS_LONGHELP			/* undef to save memory		*/
 #define CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt	*/
@@ -241,11 +243,6 @@
 
 #define CONFIG_SYS_TCLK		133000000
 
-/*#define CONFIG_SYS_750FX_HID0		0x8000c084*/
-#define CONFIG_SYS_750FX_HID0		0x80008484
-#define CONFIG_SYS_750FX_HID1		0x54800000
-#define CONFIG_SYS_750FX_HID2		0x00000000
-
 /*
  * Low Level Configuration Settings
  * (address mappings, register initial values, etc.)
@@ -457,7 +454,11 @@
 #define CONFIG_SYS_ATA_DATA_OFFSET	0x0000	/* Offset for data I/O			*/
 #define CONFIG_SYS_ATA_REG_OFFSET	0x0000	/* Offset for normal register accesses	*/
 #define CONFIG_SYS_ATA_ALT_OFFSET	0x0000	/* Offset for alternate registers	*/
-
+#ifndef __ASSEMBLY__
+int ata_device(int dev);
+#endif
+#define ATA_DEVICE(dev)                 ata_device(dev)
+#define CONFIG_ATAPI                    1
 
 /*----------------------------------------------------------------------
  * Initial BAT mappings
@@ -497,8 +498,8 @@
  * IBAT4 and DBAT4
  * FIXME: ingo disable BATs for Linux Kernel
  */
-#undef SETUP_HIGH_BATS_FX750		/* don't initialize BATS 4-7 */
-/*#define SETUP_HIGH_BATS_FX750*/		/* initialize BATS 4-7 */
+/* #undef SETUP_HIGH_BATS_FX750	*/	/* don't initialize BATS 4-7 */
+#define SETUP_HIGH_BATS_FX750		/* initialize BATS 4-7 */
 
 #ifdef SETUP_HIGH_BATS_FX750
 #define CONFIG_SYS_IBAT4L (CONFIG_SYS_SDRAM1_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
@@ -622,4 +623,6 @@
 #define CPCI750_ECC_TEST	(((in8(0xf0300000) & 0x02) == 0) ? 1 : 0)
 #define CONFIG_SYS_PLD_VER	0xf0e00000
 
+#define CONFIG_OF_LIBFDT 1
+
 #endif	/* __CONFIG_H */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH v2] CPCI750: Add CPCI-HD/2 support
  2011-11-10 18:51 [U-Boot] [PATCH v2] CPCI750: Add CPCI-HD/2 support Reinhard Arlt
@ 2012-03-18 19:10 ` Wolfgang Denk
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2012-03-18 19:10 UTC (permalink / raw)
  To: u-boot

Dear Reinhard Arlt,

In message <4EBC1D4D.4010707@esd.eu> you wrote:
> From: Reinhard Arlt <reinhard.arlt@esd.eu>
> 
> This patch adds support for the esd CPCI-HD/2 board to u-boot for CPCI-CPU/750.
> As the primary devices on the CPCI-HD/2 board are connected to device 1 and 3,
> the device must be swaped. 
> Signed-off-by: Reinhard Arlt <reinhard.arlt@esd.eu>

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
To be is to program.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-18 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-10 18:51 [U-Boot] [PATCH v2] CPCI750: Add CPCI-HD/2 support Reinhard Arlt
2012-03-18 19:10 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox