[OpenBIOS] [PATCH] SPARC64: configure the Sabre PCI TAS register

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Sep 13 10:15:01 CEST 2014


Make sure that we declare the same range available as set by the virtual-dma
properties hardcoded in sabre_configure().

This register is checked by FreeBSD during boot which panics if it finds a
default (zero) value.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/arch/sparc64/openbios.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/openbios-devel/arch/sparc64/openbios.c b/openbios-devel/arch/sparc64/openbios.c
index 9cc1ac2..3a36146 100644
--- a/openbios-devel/arch/sparc64/openbios.c
+++ b/openbios-devel/arch/sparc64/openbios.c
@@ -116,6 +116,20 @@ sparc64_reset_all(void)
         : : "r" (val), "r" (addr) : "memory");
 }
 
+/* PCI Target Address Space Register (see UltraSPARC IIi User's Manual
+  section 19.3.0.4) */
+#define PBM_PCI_TARGET_AS              0x2028
+#define PBM_PCI_TARGET_AS_CD_ENABLE    0x40
+
+static void
+sparc64_set_tas_register(unsigned long val)
+{
+    unsigned long addr = APB_SPECIAL_BASE + PBM_PCI_TARGET_AS;
+
+    asm("stxa %0, [%1] 0x15\n\t"
+        : : "r" (val), "r" (addr) : "memory");
+}
+
 static void cpu_generic_init(const struct cpudef *cpu, uint32_t clock_frequency)
 {
     unsigned long iu_version;
@@ -574,6 +588,10 @@ arch_init( void )
 	modules_init();
 #ifdef CONFIG_DRIVER_PCI
         ob_pci_init();
+
+        /* Set TAS register to match the virtual-dma properties
+           set during sabre configure */
+        sparc64_set_tas_register(PBM_PCI_TARGET_AS_CD_ENABLE);
 #endif
         nvconf_init();
         device_end();
-- 
1.7.10.4




More information about the OpenBIOS mailing list