diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2017-05-21 13:00:54 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2017-05-21 13:00:54 +0000 |
commit | 799df8f1ea252a453c6519ce1108d5bb52ca6109 (patch) | |
tree | 09db6f2494a20adffaa9a5acbdd05425f5ef3761 /sys/arch | |
parent | ed3a9a1e17cf4ba2d1a8476904c0e1e989ac1aa1 (diff) |
Enable radeondrm(4) on loongson to get accelerated graphics
with the RS780E chipset.
OK kettenis@, jsg@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/loongson/conf/GENERIC | 5 | ||||
-rw-r--r-- | sys/arch/loongson/include/autoconf.h | 3 | ||||
-rw-r--r-- | sys/arch/loongson/include/pmon.h | 3 | ||||
-rw-r--r-- | sys/arch/loongson/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/loongson/loongson/conf.c | 16 | ||||
-rw-r--r-- | sys/arch/loongson/loongson/generic3a_machdep.c | 7 | ||||
-rw-r--r-- | sys/arch/loongson/loongson/machdep.c | 3 | ||||
-rw-r--r-- | sys/arch/loongson/loongson/pmon.c | 12 | ||||
-rw-r--r-- | sys/arch/mips64/conf/files.mips64 | 3 |
9 files changed, 46 insertions, 10 deletions
diff --git a/sys/arch/loongson/conf/GENERIC b/sys/arch/loongson/conf/GENERIC index 0fa6a2d10b4..0d24a1d5d69 100644 --- a/sys/arch/loongson/conf/GENERIC +++ b/sys/arch/loongson/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.54 2016/11/17 14:44:34 visa Exp $ +# $OpenBSD: GENERIC,v 1.55 2017/05/21 13:00:53 visa Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -86,6 +86,9 @@ audio* at azalia? piixpm* at pci? iic* at piixpm? spdmem* at iic? +radeondrm* at pci? +drm* at radeondrm? +wsdisplay* at radeondrm? radeonfb* at pci? wsdisplay* at radeonfb? diff --git a/sys/arch/loongson/include/autoconf.h b/sys/arch/loongson/include/autoconf.h index 6c87ee8f841..1a31fcf5a58 100644 --- a/sys/arch/loongson/include/autoconf.h +++ b/sys/arch/loongson/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.16 2017/05/10 15:21:02 visa Exp $ */ +/* $OpenBSD: autoconf.h,v 1.17 2017/05/21 13:00:53 visa Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -92,6 +92,7 @@ struct platform { #define LOONGSON_MAXCPUS 16 extern const struct platform *sys_platform; +extern void *loongson_videobios; extern uint loongson_cpumask; extern uint loongson_ver; extern int nnodes; diff --git a/sys/arch/loongson/include/pmon.h b/sys/arch/loongson/include/pmon.h index 1efcf2495ff..4616052054d 100644 --- a/sys/arch/loongson/include/pmon.h +++ b/sys/arch/loongson/include/pmon.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmon.h,v 1.4 2016/11/22 15:44:24 visa Exp $ */ +/* $OpenBSD: pmon.h,v 1.5 2017/05/21 13:00:53 visa Exp $ */ /* * Copyright (c) 2009, 2012 Miodrag Vallat. @@ -195,6 +195,7 @@ struct pmon_env_device { const char *pmon_getenv(const char *); const struct pmon_env_reset *pmon_get_env_reset(void); +const struct pmon_env_smbios *pmon_get_env_smbios(void); const struct pmon_env_mem *pmon_get_env_mem(void); const struct pmon_env_cpu *pmon_get_env_cpu(void); const struct pmon_env_sys *pmon_get_env_sys(void); diff --git a/sys/arch/loongson/include/vmparam.h b/sys/arch/loongson/include/vmparam.h index be5d726ec4e..597a26179a5 100644 --- a/sys/arch/loongson/include/vmparam.h +++ b/sys/arch/loongson/include/vmparam.h @@ -1,9 +1,9 @@ -/* $OpenBSD: vmparam.h,v 1.4 2014/03/27 21:58:13 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.5 2017/05/21 13:00:53 visa Exp $ */ /* public domain */ #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ -#define VM_PHYSSEG_MAX 3 /* Max number of physical memory segments */ +#define VM_PHYSSEG_MAX 8 /* Max number of physical memory segments */ #define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST #include <mips64/vmparam.h> diff --git a/sys/arch/loongson/loongson/conf.c b/sys/arch/loongson/loongson/conf.c index 3aa932a0485..87746db5225 100644 --- a/sys/arch/loongson/loongson/conf.c +++ b/sys/arch/loongson/loongson/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.23 2016/09/04 10:51:23 naddy Exp $ */ +/* $OpenBSD: conf.c,v 1.24 2017/05/21 13:00:53 visa Exp $ */ /* * Copyright (c) 1992, 1993 @@ -98,6 +98,8 @@ cdev_decl(fd); #include "apm.h" #include "com.h" cdev_decl(com); +#include "drm.h" +cdev_decl(drm); #include "lpt.h" cdev_decl(lpt); #include "ch.h" @@ -209,6 +211,18 @@ struct cdevsw cdevsw[] = cdev_fuse_init(NFUSE,fuse), /* 73: fuse */ cdev_tun_init(NTUN,tap), /* 74: Ethernet network tunnel */ cdev_switch_init(NSWITCH,switch), /* 75: switch(4) control interface */ + cdev_notdef(), /* 76 */ + cdev_notdef(), /* 77 */ + cdev_notdef(), /* 78 */ + cdev_notdef(), /* 79 */ + cdev_notdef(), /* 80 */ + cdev_notdef(), /* 81 */ + cdev_notdef(), /* 82 */ + cdev_notdef(), /* 83 */ + cdev_notdef(), /* 84 */ + cdev_notdef(), /* 85 */ + cdev_notdef(), /* 86 */ + cdev_drm_init(NDRM,drm), /* 87: drm */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/loongson/loongson/generic3a_machdep.c b/sys/arch/loongson/loongson/generic3a_machdep.c index 7c26088783e..ac3f1db6ccd 100644 --- a/sys/arch/loongson/loongson/generic3a_machdep.c +++ b/sys/arch/loongson/loongson/generic3a_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: generic3a_machdep.c,v 1.7 2017/05/10 16:04:21 visa Exp $ */ +/* $OpenBSD: generic3a_machdep.c,v 1.8 2017/05/21 13:00:53 visa Exp $ */ /* * Copyright (c) 2009, 2010, 2012 Miodrag Vallat. @@ -187,6 +187,7 @@ void generic3a_setup(void) { const struct pmon_env_reset *resetenv = pmon_get_env_reset(); + const struct pmon_env_smbios *smbios = pmon_get_env_smbios(); uint32_t boot_cpuid = loongson3_get_cpuid(); /* Override the mask if it misses the boot CPU. */ @@ -202,6 +203,10 @@ generic3a_setup(void) generic3a_poweroff_entry = resetenv->poweroff; } + if (smbios != NULL) + /* pmon_init() has checked that `vga_bios' points to kseg0. */ + loongson_videobios = (void *)smbios->vga_bios; + loongson3_intr_init(); #ifdef MULTIPROCESSOR diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c index 3100d7cf40c..d5f8984fe3d 100644 --- a/sys/arch/loongson/loongson/machdep.c +++ b/sys/arch/loongson/loongson/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.77 2017/04/30 16:45:45 mpi Exp $ */ +/* $OpenBSD: machdep.c,v 1.78 2017/05/21 13:00:53 visa Exp $ */ /* * Copyright (c) 2009, 2010, 2014 Miodrag Vallat. @@ -126,6 +126,7 @@ uint32_t ipi_mask; const struct platform *sys_platform; struct cpu_hwinfo bootcpu_hwinfo; +void *loongson_videobios; uint loongson_cpumask = 1; uint loongson_ver; diff --git a/sys/arch/loongson/loongson/pmon.c b/sys/arch/loongson/loongson/pmon.c index 98202ca3890..44ca8e8a5cf 100644 --- a/sys/arch/loongson/loongson/pmon.c +++ b/sys/arch/loongson/loongson/pmon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmon.c,v 1.6 2016/09/28 14:46:34 visa Exp $ */ +/* $OpenBSD: pmon.c,v 1.7 2017/05/21 13:00:53 visa Exp $ */ /* * Copyright (c) 2009, 2012 Miodrag Vallat. @@ -184,6 +184,16 @@ const struct pmon_env_reset *pmon_get_env_reset() return &env->reset; } +const struct pmon_env_smbios *pmon_get_env_smbios() +{ + struct pmon_env *env = (struct pmon_env *)pmon_envp; + + if (pmon_envtype != PMON_ENVTYPE_EFI) + return NULL; + + return &env->efi.bios; +} + const struct pmon_env_mem *pmon_get_env_mem() { struct pmon_env *env = (struct pmon_env *)pmon_envp; diff --git a/sys/arch/mips64/conf/files.mips64 b/sys/arch/mips64/conf/files.mips64 index a33de306281..b3f7153e6f9 100644 --- a/sys/arch/mips64/conf/files.mips64 +++ b/sys/arch/mips64/conf/files.mips64 @@ -1,4 +1,4 @@ -# $OpenBSD: files.mips64,v 1.26 2015/09/09 15:48:52 visa Exp $ +# $OpenBSD: files.mips64,v 1.27 2017/05/21 13:00:53 visa Exp $ file arch/mips64/mips64/arcbios.c arcbios file arch/mips64/mips64/clock.c clock @@ -47,3 +47,4 @@ file netinet/in_cksum.c file netinet/in4_cksum.c file lib/libkern/softfloat.c +file lib/libkern/arch/mips64/sync.S drm |