Index: head/sys/arm/conf/VIRT =================================================================== --- head/sys/arm/conf/VIRT (revision 281465) +++ head/sys/arm/conf/VIRT (revision 281466) @@ -1,96 +1,97 @@ # # VIRT -- Custom configuration for the qemu virt platform # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ../../conf/NOTES and NOTES files. # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # # $FreeBSD$ ident VIRT include "../qemu/std.virt" options HZ=100 options SCHED_4BSD # 4BSD scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling options QUOTA # Enable disk quotas for UFS options NFSCL # Network Filesystem Client options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework options TMPFS # Efficient memory filesystem options GEOM_PART_GPT # GUID Partition Tables options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options GEOM_LABEL # Provides labelization options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PLATFORM options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options ARM_NEW_PMAP # Enable the new v6 pmap # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB # Enable kernel debugger support # For minimum debugger support (stable branch) use: #options KDB_TRACE # Print a stack trace for a panic # For full debugger support use this instead: options DDB # Enable the kernel debugger options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC device bpf device loop device ether device uart device pty device snp device pl011 +device psci device virtio device virtio_mmio device virtio_blk device vtnet device md device random # Entropy device # Flattened Device Tree options FDT # Configure using FDT/DTB data Index: head/sys/conf/files.arm =================================================================== --- head/sys/conf/files.arm (revision 281465) +++ head/sys/conf/files.arm (revision 281466) @@ -1,120 +1,122 @@ # $FreeBSD$ arm/arm/autoconf.c standard arm/arm/bcopy_page.S standard arm/arm/bcopyinout.S standard arm/arm/blockio.S standard arm/arm/bus_space_asm_generic.S standard arm/arm/busdma_machdep.c optional !armv6 arm/arm/busdma_machdep-v6.c optional armv6 arm/arm/copystr.S standard arm/arm/cpufunc.c standard arm/arm/cpufunc_asm.S standard arm/arm/cpufunc_asm_arm9.S optional cpu_arm9 arm/arm/cpufunc_asm_arm10.S optional cpu_arm9e arm/arm/cpufunc_asm_arm11.S optional cpu_arm1176 arm/arm/cpufunc_asm_arm11x6.S optional cpu_arm1176 arm/arm/cpufunc_asm_armv4.S optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_xscale_80321 | cpu_xscale_pxa2x0 | cpu_xscale_ixp425 | cpu_xscale_80219 | cpu_xscale_81342 arm/arm/cpufunc_asm_armv5_ec.S optional cpu_arm9e arm/arm/cpufunc_asm_armv6.S optional cpu_arm1176 arm/arm/cpufunc_asm_armv7.S optional cpu_cortexa | cpu_krait | cpu_mv_pj4b arm/arm/cpufunc_asm_fa526.S optional cpu_fa526 arm/arm/cpufunc_asm_pj4b.S optional cpu_mv_pj4b arm/arm/cpufunc_asm_sheeva.S optional cpu_arm9e arm/arm/cpufunc_asm_xscale.S optional cpu_xscale_80321 | cpu_xscale_pxa2x0 | cpu_xscale_ixp425 | cpu_xscale_80219 | cpu_xscale_81342 arm/arm/cpufunc_asm_xscale_c3.S optional cpu_xscale_81342 arm/arm/cpuinfo.c standard arm/arm/cpu_asm-v6.S optional armv6 arm/arm/db_disasm.c optional ddb arm/arm/db_interface.c optional ddb arm/arm/db_trace.c optional ddb arm/arm/devmap.c standard arm/arm/disassem.c optional ddb arm/arm/dump_machdep.c standard arm/arm/elf_machdep.c standard arm/arm/elf_note.S standard arm/arm/exception.S standard arm/arm/fiq.c standard arm/arm/fiq_subr.S standard arm/arm/fusu.S standard arm/arm/gdb_machdep.c optional gdb arm/arm/identcpu.c standard arm/arm/in_cksum.c optional inet | inet6 arm/arm/in_cksum_arm.S optional inet | inet6 arm/arm/intr.c standard arm/arm/locore.S standard no-obj arm/arm/machdep.c standard arm/arm/mem.c optional mem arm/arm/minidump_machdep.c optional mem arm/arm/mp_machdep.c optional smp arm/arm/nexus.c standard arm/arm/physmem.c standard arm/arm/pl190.c optional pl190 arm/arm/pl310.c optional pl310 arm/arm/platform.c optional platform arm/arm/platform_if.m optional platform arm/arm/pmap.c optional !armv6 arm/arm/pmap-v6.c optional armv6 !arm_new_pmap arm/arm/pmap-v6-new.c optional armv6 arm_new_pmap arm/arm/sc_machdep.c optional sc arm/arm/setcpsr.S standard arm/arm/setstack.s standard arm/arm/stack_machdep.c optional ddb | stack arm/arm/stdatomic.c standard \ compile-with "${NORMAL_C:N-Wmissing-prototypes}" arm/arm/support.S standard arm/arm/swtch.S standard arm/arm/sys_machdep.c standard arm/arm/syscall.c standard arm/arm/trap.c optional !armv6 arm/arm/trap-v6.c optional armv6 arm/arm/uio_machdep.c standard arm/arm/undefined.c standard arm/arm/unwind.c optional ddb | kdtrace_hooks arm/arm/vm_machdep.c standard arm/arm/vfp.c standard board_id.h standard \ dependency "$S/arm/conf/genboardid.awk $S/arm/conf/mach-types" \ compile-with "${AWK} -f $S/arm/conf/genboardid.awk $S/arm/conf/mach-types > board_id.h" \ no-obj no-implicit-rule before-depend \ clean "board_id.h" cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs compile-with "${ZFS_C}" crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/fb/fb.c optional sc dev/fdt/fdt_arm_platform.c optional platform fdt dev/hwpmc/hwpmc_arm.c optional hwpmc dev/hwpmc/hwpmc_armv7.c optional hwpmc armv6 dev/kbd/kbd.c optional sc | vt +dev/psci/psci.c optional psci +dev/psci/psci_arm.S optional psci dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt font.h optional sc \ compile-with "uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h" \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" kern/subr_busdma_bufalloc.c standard kern/subr_dummy_vdso_tc.c standard kern/subr_sfbuf.c standard libkern/arm/aeabi_unwind.c standard libkern/arm/divsi3.S standard libkern/arm/ffs.S standard libkern/arm/ldivmod.S standard libkern/arm/ldivmod_helper.c standard libkern/arm/memcpy.S standard libkern/arm/memset.S standard libkern/arm/muldi3.c standard libkern/ashldi3.c standard libkern/ashrdi3.c standard libkern/divdi3.c standard libkern/ffsl.c standard libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard libkern/lshrdi3.c standard libkern/moddi3.c standard libkern/qdivrem.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard Index: head/sys/dev/psci/psci.c =================================================================== --- head/sys/dev/psci/psci.c (nonexistent) +++ head/sys/dev/psci/psci.c (revision 281466) @@ -0,0 +1,286 @@ +/*- + * Copyright (c) 2014 Robin Randhawa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * This implements support for ARM's Power State Co-ordination Interface + * [PSCI]. The implementation adheres to version 0.2 of the PSCI specification + * but also supports v0.1. PSCI standardizes operations such as system reset, CPU + * on/off/suspend. PSCI requires a compliant firmware implementation. + * + * The PSCI specification used for this implementation is available at: + * + * . + * + * TODO: + * - Add support for remaining PSCI calls [this implementation only + * supports get_version, system_reset and cpu_on]. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +struct psci_softc { + device_t dev; + + psci_callfn_t psci_call; + uint32_t psci_fnids[PSCI_FN_MAX]; +}; + +static int psci_v0_1_init(device_t dev); +static int psci_v0_2_init(device_t dev); + +struct psci_softc *psci_softc = NULL; + +static struct ofw_compat_data compat_data[] = { + {"arm,psci-0.2", (uintptr_t)psci_v0_2_init}, + {"arm,psci", (uintptr_t)psci_v0_1_init}, + {NULL, 0} +}; + +static int psci_probe(device_t dev); +static int psci_attach(device_t dev); +static void psci_shutdown(void *, int); + +static device_method_t psci_methods[] = { + DEVMETHOD(device_probe, psci_probe), + DEVMETHOD(device_attach, psci_attach), + + DEVMETHOD_END +}; + +static driver_t psci_driver = { + "psci", + psci_methods, + sizeof(struct psci_softc), +}; + +static devclass_t psci_devclass; + +EARLY_DRIVER_MODULE(psci, simplebus, psci_driver, psci_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); +EARLY_DRIVER_MODULE(psci, ofwbus, psci_driver, psci_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); + +static int +psci_probe(device_t dev) +{ + const struct ofw_compat_data *ocd; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + ocd = ofw_bus_search_compatible(dev, compat_data); + if (ocd->ocd_str == NULL) + return (ENXIO); + + device_set_desc(dev, "ARM Power State Co-ordination Interface Driver"); + + return (BUS_PROBE_SPECIFIC); +} + +static int +psci_attach(device_t dev) +{ + struct psci_softc *sc = device_get_softc(dev); + const struct ofw_compat_data *ocd; + psci_initfn_t psci_init; + phandle_t node; + char method[16]; + + if (psci_softc != NULL) + return (ENXIO); + + ocd = ofw_bus_search_compatible(dev, compat_data); + psci_init = (psci_initfn_t)ocd->ocd_data; + KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL")); + + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "method", method, sizeof(method))) > 0) { + if (strcmp(method, "hvc") == 0) + sc->psci_call = psci_hvc_despatch; + else if (strcmp(method, "smc") == 0) + sc->psci_call = psci_smc_despatch; + else { + device_printf(dev, + "psci_attach: PSCI conduit \"%s\" invalid\n", + method); + return (ENXIO); + } + } else { + device_printf(dev, + "psci_attach: PSCI conduit not supplied in the DT\n"); + return (ENXIO); + } + + if (psci_init(dev)) + return (ENXIO); + + psci_softc = sc; + + return (0); +} + +static int +psci_get_version(struct psci_softc *sc) +{ + uint32_t fnid; + + /* PSCI version wasn't supported in v0.1. */ + fnid = sc->psci_fnids[PSCI_FN_VERSION]; + if (fnid) + return (sc->psci_call(fnid, 0, 0, 0)); + + return (PSCI_RETVAL_NOT_SUPPORTED); +} + +int +psci_cpu_on(unsigned long cpu, unsigned long entry, unsigned long context_id) +{ + + /* PSCI v0.1 and v0.2 both support cpu_on. */ + return(psci_softc->psci_call(psci_softc->psci_fnids[PSCI_FN_CPU_ON], cpu, + entry, context_id)); +} + +static void +psci_shutdown(void *xsc, int howto) +{ + uint32_t fn = 0; + + /* PSCI system_off and system_reset werent't supported in v0.1. */ + if ((howto & RB_POWEROFF) != 0) + fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_OFF]; + else if ((howto & RB_HALT) == 0) + fn = psci_softc->psci_fnids[PSCI_FN_SYSTEM_RESET]; + + if (fn) + psci_softc->psci_call(fn, 0, 0, 0); + + /* System reset and off do not return. */ +} + +static int +psci_v0_1_init(device_t dev) +{ + struct psci_softc *sc = device_get_softc(dev); + int psci_fn; + uint32_t psci_fnid; + phandle_t node; + int len; + + + /* Zero out the function ID table - Is this needed ? */ + for (psci_fn = PSCI_FN_VERSION, psci_fnid = PSCI_FNID_VERSION; + psci_fn < PSCI_FN_MAX; psci_fn++, psci_fnid++) + sc->psci_fnids[psci_fn] = 0; + + /* PSCI v0.1 doesn't specify function IDs. Get them from DT */ + node = ofw_bus_get_node(dev); + + if ((len = OF_getproplen(node, "cpu_suspend")) > 0) { + OF_getencprop(node, "cpu_suspend", &psci_fnid, len); + sc->psci_fnids[PSCI_FN_CPU_SUSPEND] = psci_fnid; + } + + if ((len = OF_getproplen(node, "cpu_on")) > 0) { + OF_getencprop(node, "cpu_on", &psci_fnid, len); + sc->psci_fnids[PSCI_FN_CPU_ON] = psci_fnid; + } + + if ((len = OF_getproplen(node, "cpu_off")) > 0) { + OF_getencprop(node, "cpu_off", &psci_fnid, len); + sc->psci_fnids[PSCI_FN_CPU_OFF] = psci_fnid; + } + + if ((len = OF_getproplen(node, "migrate")) > 0) { + OF_getencprop(node, "migrate", &psci_fnid, len); + sc->psci_fnids[PSCI_FN_MIGRATE] = psci_fnid; + } + + if (bootverbose) + device_printf(dev, "PSCI version 0.1 available\n"); + + return(0); +} + +static int +psci_v0_2_init(device_t dev) +{ + struct psci_softc *sc = device_get_softc(dev); + int version; + + /* PSCI v0.2 specifies explicit function IDs. */ + sc->psci_fnids[PSCI_FN_VERSION] = PSCI_FNID_VERSION; + sc->psci_fnids[PSCI_FN_CPU_SUSPEND] = PSCI_FNID_CPU_SUSPEND; + sc->psci_fnids[PSCI_FN_CPU_OFF] = PSCI_FNID_CPU_OFF; + sc->psci_fnids[PSCI_FN_CPU_ON] = PSCI_FNID_CPU_ON; + sc->psci_fnids[PSCI_FN_AFFINITY_INFO] = PSCI_FNID_AFFINITY_INFO; + sc->psci_fnids[PSCI_FN_MIGRATE] = PSCI_FNID_MIGRATE; + sc->psci_fnids[PSCI_FN_MIGRATE_INFO_TYPE] = PSCI_FNID_MIGRATE_INFO_TYPE; + sc->psci_fnids[PSCI_FN_MIGRATE_INFO_UP_CPU] = PSCI_FNID_MIGRATE_INFO_UP_CPU; + sc->psci_fnids[PSCI_FN_SYSTEM_OFF] = PSCI_FNID_SYSTEM_OFF; + sc->psci_fnids[PSCI_FN_SYSTEM_RESET] = PSCI_FNID_SYSTEM_RESET; + + version = psci_get_version(sc); + + if (version == PSCI_RETVAL_NOT_SUPPORTED) + return (1); + + if ((PSCI_VER_MAJOR(version) != 0) && (PSCI_VER_MINOR(version) != 2)) { + device_printf(dev, "PSCI version number mismatched with DT\n"); + return (1); + } + + if (bootverbose) + device_printf(dev, "PSCI version 0.2 available\n"); + + /* + * We only register this for v0.2 since v0.1 doesn't support + * system_reset. + */ + EVENTHANDLER_REGISTER(shutdown_final, psci_shutdown, sc, + SHUTDOWN_PRI_LAST); + + return (0); +} Property changes on: head/sys/dev/psci/psci.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sys/dev/psci/psci.h =================================================================== --- head/sys/dev/psci/psci.h (nonexistent) +++ head/sys/dev/psci/psci.h (revision 281466) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2013, 2014 Robin Randhawa + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PSCI_H_ +#define _MACHINE_PSCI_H_ + +#include + +typedef int (*psci_initfn_t)(device_t dev); +typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t); + +extern int psci_present; + +void psci_system_reset(void); +int psci_cpu_on(unsigned long, unsigned long, unsigned long); +int psci_hvc_despatch(register_t, register_t, register_t, register_t); +int psci_smc_despatch(register_t, register_t, register_t, register_t); + + +/* + * PSCI return codes. + */ +#define PSCI_RETVAL_SUCCESS 0 +#define PSCI_RETVAL_NOT_SUPPORTED -1 +#define PSCI_RETVAL_INVALID_PARAMS -2 +#define PSCI_RETVAL_DENIED -3 +#define PSCI_RETVAL_ALREADY_ON -4 +#define PSCI_RETVAL_ON_PENDING -5 +#define PSCI_RETVAL_INTERNAL_FAILURE -6 +#define PSCI_RETVAL_NOT_PRESENT -7 +#define PSCI_RETVAL_DISABLED -8 + +/* + * PSCI function codes (as per PSCI v0.2). + */ +#ifdef __aarch64__ +#define PSCI_FNID_VERSION 0x84000000 +#define PSCI_FNID_CPU_SUSPEND 0xc4000001 +#define PSCI_FNID_CPU_OFF 0x84000002 +#define PSCI_FNID_CPU_ON 0xc4000003 +#define PSCI_FNID_AFFINITY_INFO 0xc4000004 +#define PSCI_FNID_MIGRATE 0xc4000005 +#define PSCI_FNID_MIGRATE_INFO_TYPE 0x84000006 +#define PSCI_FNID_MIGRATE_INFO_UP_CPU 0xc4000007 +#define PSCI_FNID_SYSTEM_OFF 0x84000008 +#define PSCI_FNID_SYSTEM_RESET 0x84000009 +#else +#define PSCI_FNID_VERSION 0x84000000 +#define PSCI_FNID_CPU_SUSPEND 0x84000001 +#define PSCI_FNID_CPU_OFF 0x84000002 +#define PSCI_FNID_CPU_ON 0x84000003 +#define PSCI_FNID_AFFINITY_INFO 0x84000004 +#define PSCI_FNID_MIGRATE 0x84000005 +#define PSCI_FNID_MIGRATE_INFO_TYPE 0x84000006 +#define PSCI_FNID_MIGRATE_INFO_UP_CPU 0x84000007 +#define PSCI_FNID_SYSTEM_OFF 0x84000008 +#define PSCI_FNID_SYSTEM_RESET 0x84000009 +#endif + +#define PSCI_VER_MAJOR(v) (((v) >> 16) & 0xFF) +#define PSCI_VER_MINOR(v) ((v) & 0xFF) + +enum psci_fn { + PSCI_FN_VERSION, + PSCI_FN_CPU_SUSPEND, + PSCI_FN_CPU_OFF, + PSCI_FN_CPU_ON, + PSCI_FN_AFFINITY_INFO, + PSCI_FN_MIGRATE, + PSCI_FN_MIGRATE_INFO_TYPE, + PSCI_FN_MIGRATE_INFO_UP_CPU, + PSCI_FN_SYSTEM_OFF, + PSCI_FN_SYSTEM_RESET, + PSCI_FN_MAX +}; + +#endif /* _MACHINE_PSCI_H_ */ Property changes on: head/sys/dev/psci/psci.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sys/dev/psci/psci_arm.S =================================================================== --- head/sys/dev/psci/psci_arm.S (nonexistent) +++ head/sys/dev/psci/psci_arm.S (revision 281466) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2015 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +.arch_extension virt /* For hvc */ + +/* + * int psci_hvc_despatch(register_t psci_fnid, register_t...) + */ +ENTRY(psci_hvc_despatch) + hvc #0 + RET +END(psci_hvc_despatch) + +/* + * int psci_smc_despatch(register_t psci_fnid, register_t...) + */ +ENTRY(psci_smc_despatch) + smc #0 + RET +END(psci_hvc_despatch) Property changes on: head/sys/dev/psci/psci_arm.S ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property