Commits

Anonymous committed 477512e

On second thought, do not unconditionnaly register the cpu throttling code
on all Loongson2F systems yet; Gdium does not have a separate scheduling
clock yet and can't afford throttling until then.

Comments (0)

Files changed (3)

sys/arch/loongson/loongson/loongson2_machdep.c

-/*	$OpenBSD: loongson2_machdep.c,v 1.12 2013/01/16 07:17:59 pirofti Exp $	*/
+/*	$OpenBSD: loongson2_machdep.c,v 1.13 2013/01/16 20:28:06 miod Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Miodrag Vallat.
 void	loongson2e_setup(u_long, u_long);
 void	loongson2f_setup(u_long, u_long);
 void	loongson2f_setup_window(uint, uint, uint64_t, uint64_t, uint64_t, uint);
-int	loongson2f_cpuspeed(int *);
-void	loongson2f_setperf(int);
 
 /* PCI view of CPU memory */
 paddr_t loongson_dma_base = 0;
 	    ~(DDR_PHYSICAL_SIZE - 1), DDR_PHYSICAL_BASE, MASTER_CPU);
 
 	cpu_cpuspeed = loongson2f_cpuspeed;
-	cpu_setperf = loongson2f_setperf;
 }
 
 /*

sys/arch/loongson/loongson/yeeloong_machdep.c

-/*	$OpenBSD: yeeloong_machdep.c,v 1.22 2013/01/16 07:17:59 pirofti Exp $	*/
+/*	$OpenBSD: yeeloong_machdep.c,v 1.23 2013/01/16 20:28:06 miod Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Miodrag Vallat.
 
 #include <machine/autoconf.h>
 #include <machine/cpu.h>
+#include <mips64/loongson2.h>
 #include <mips64/mips_cpu.h>
 #include <machine/pmon.h>
 
 void	 fuloong_setup(void);
 
 void	 yeeloong_powerdown(void);
+void	 yeeloong_setup(void);
 
 void	 lemote_pci_attach_hook(pci_chipset_tag_t);
 int	 lemote_intr_map(int, int, int);
 	.isa_chipset = &lemote_isa_chipset,
 	.legacy_io_ranges = yeeloong_legacy_ranges,
 
-	.setup = NULL,
+	.setup = yeeloong_setup,
 	.device_register = lemote_device_register,
 
 	.powerdown = yeeloong_powerdown,
                 comconsiot = &bonito_pci_io_space_tag;
                 comconsaddr = 0x2f8;
                 comconsrate = 115200; /* default PMON console speed */
+		comconscflag = (TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) |
+		    CS8 | CLOCAL; /* 8N1 */
 	}
 #endif
+
+	cpu_setperf = loongson2f_setperf;
+}
+
+void
+yeeloong_setup(void)
+{
+	cpu_setperf = loongson2f_setperf;
 }
 
 void

sys/arch/mips64/include/loongson2.h

-/*	$OpenBSD: loongson2.h,v 1.3 2011/03/23 16:54:36 pirofti Exp $	*/
+/*	$OpenBSD: loongson2.h,v 1.4 2013/01/16 20:28:06 miod Exp $	*/
 
 /*
  * Copyright (c) 2009 Miodrag Vallat.
 #define	COP_0_DIAG_BTB_CLEAR		0x02
 #define	COP_0_DIAG_RAS_DISABLE		0x01
 
+#if defined(_KERNEL) && !defined(_LOCORE)
+int	loongson2f_cpuspeed(int *);
+void	loongson2f_setperf(int);
+#endif
+
 #endif	/* _MIPS64_LOONGSON2_H_ */