Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/coresight/coresight_funnel_fdt.c
/*- | /*- | ||||
* Copyright (c) 2018-2020 Ruslan Bukin <br@bsdpad.com> | * Copyright (c) 2018-2023 Ruslan Bukin <br@bsdpad.com> | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* This software was developed by BAE Systems, the University of Cambridge | * This software was developed by BAE Systems, the University of Cambridge | ||||
* Computer Laboratory, and Memorial University under DARPA/AFRL contract | * Computer Laboratory, and Memorial University under DARPA/AFRL contract | ||||
* FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing | * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing | ||||
* (TC) research program. | * (TC) research program. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
Show All 30 Lines | |||||
#include <dev/ofw/ofw_bus_subr.h> | #include <dev/ofw/ofw_bus_subr.h> | ||||
#include <arm64/coresight/coresight.h> | #include <arm64/coresight/coresight.h> | ||||
#include <arm64/coresight/coresight_funnel.h> | #include <arm64/coresight/coresight_funnel.h> | ||||
#include "coresight_if.h" | #include "coresight_if.h" | ||||
static struct ofw_compat_data compat_data[] = { | static struct ofw_compat_data compat_data[] = { | ||||
{ "arm,coresight-funnel", HWTYPE_FUNNEL }, | { "arm,coresight-dynamic-funnel", HWTYPE_FUNNEL }, | ||||
{ "arm,coresight-static-funnel", HWTYPE_STATIC_FUNNEL }, | { "arm,coresight-static-funnel", HWTYPE_STATIC_FUNNEL }, | ||||
{ NULL, HWTYPE_NONE } | { NULL, HWTYPE_NONE } | ||||
}; | }; | ||||
static int | static int | ||||
funnel_fdt_probe(device_t dev) | funnel_fdt_probe(device_t dev) | ||||
{ | { | ||||
struct funnel_softc *sc; | struct funnel_softc *sc; | ||||
Show All 24 Lines | funnel_fdt_attach(device_t dev) | ||||
struct funnel_softc *sc; | struct funnel_softc *sc; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
sc->pdata = coresight_fdt_get_platform_data(dev); | sc->pdata = coresight_fdt_get_platform_data(dev); | ||||
return (funnel_attach(dev)); | return (funnel_attach(dev)); | ||||
} | } | ||||
static int | |||||
funnel_fdt_detach(device_t dev) | |||||
{ | |||||
struct funnel_softc *sc; | |||||
sc = device_get_softc(dev); | |||||
coresight_fdt_release_platform_data(sc->pdata); | |||||
sc->pdata = NULL; | |||||
return (funnel_detach(dev)); | |||||
} | |||||
static device_method_t funnel_fdt_methods[] = { | static device_method_t funnel_fdt_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, funnel_fdt_probe), | DEVMETHOD(device_probe, funnel_fdt_probe), | ||||
DEVMETHOD(device_attach, funnel_fdt_attach), | DEVMETHOD(device_attach, funnel_fdt_attach), | ||||
DEVMETHOD(device_detach, funnel_fdt_detach), | |||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
DEFINE_CLASS_1(funnel, funnel_fdt_driver, funnel_fdt_methods, | DEFINE_CLASS_1(coresight_funnel, coresight_funnel_fdt_driver, | ||||
sizeof(struct funnel_softc), funnel_driver); | funnel_fdt_methods, sizeof(struct funnel_softc), | ||||
coresight_funnel_driver); | |||||
EARLY_DRIVER_MODULE(funnel, simplebus, funnel_fdt_driver, 0, 0, | EARLY_DRIVER_MODULE(coresight_funnel, simplebus, coresight_funnel_fdt_driver, | ||||
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); | 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); | ||||
MODULE_DEPEND(coresight_funnel, coresight, 1, 1, 1); | |||||
MODULE_VERSION(coresight_funnel, 1); |