linux-mips
[Top] [All Lists]

[PATCH]Check for Hypertransport Link Initialization on PMC-Sierra Titan

To: linux-mips@linux-mips.org
Subject: [PATCH]Check for Hypertransport Link Initialization on PMC-Sierra Titan before configuring the interface
From: Manish Lachwani <mlachwani@mvista.com>
Date: 20 Oct 2004 17:18:26 -0700
Cc: ralf@linux-mips.org
Organization:
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hello Ralf

Attached patch checks for the Hypertransport Link Initialization before
configuring the interface. Assuming PMON did try to do link
initialization and there were no errors (like CRC etc.), the Link
register will indicate it.

Thanks
Manish Lachwani

--- arch/mips/pmc-sierra/yosemite/setup.c.orig  2004-10-20
16:51:24.000000000 -0700
+++ arch/mips/pmc-sierra/yosemite/setup.c       2004-10-20 16:58:56.000000000
-0700
@@ -191,6 +191,8 @@
 static int __init pmc_yosemite_setup(void)
 {
        extern void pmon_smp_bootstrap(void);
+       /* Hypertransport Link initialization register */
+       unsigned long val = OCD_READ(RM9000x2_OCD_HTLINK);
 
        board_time_init = yosemite_time_init;
        late_time_init = py_map_ocd;
@@ -198,14 +200,21 @@
        /* Add memory regions */
        add_memory_region(0x00000000, 0x10000000, BOOT_MEM_RAM);
 
-#if 0 /* XXX Crash ...  */
-       OCD_WRITE(RM9000x2_OCD_HTSC,
-                 OCD_READ(RM9000x2_OCD_HTSC) | HYPERTRANSPORT_ENABLE);
-
-       /* Set the BAR. Shifted mode */
-       OCD_WRITE(RM9000x2_OCD_HTBAR0, HYPERTRANSPORT_BAR0_ADDR);
-       OCD_WRITE(RM9000x2_OCD_HTMASK0, HYPERTRANSPORT_SIZE0);
-#endif
+       if (val & 0x00000020) {
+               /*
+                * If Hypertransport is enabled and no device is connected on
+                * the Hypertranport interface, dont scan the interface.
+                * Check the Link initialization register first. If the Link
+                * is enabled, then initialize and scan the HT interface
+                */
+               OCD_WRITE(RM9000x2_OCD_HTSC,
+                         OCD_READ(RM9000x2_OCD_HTSC) | HYPERTRANSPORT_ENABLE);
+
+               /* Set the BAR. Shifted mode */
+               OCD_WRITE(RM9000x2_OCD_HTBAR0, HYPERTRANSPORT_BAR0_ADDR);
+               OCD_WRITE(RM9000x2_OCD_HTMASK0, HYPERTRANSPORT_SIZE0);
+               OCD_WRITE(RM9000x2_OCD_HTBAA30, 0x01); /* Supports byte swap */
+       }
 
        return 0;
 }


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH]Check for Hypertransport Link Initialization on PMC-Sierra Titan before configuring the interface, Manish Lachwani <=