Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/coresight/coresight_etm4x_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 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | etm_fdt_attach(device_t dev) | ||||
struct etm_softc *sc; | struct etm_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 (etm_attach(dev)); | return (etm_attach(dev)); | ||||
} | } | ||||
static int | |||||
etm_fdt_detach(device_t dev) | |||||
{ | |||||
struct etm_softc *sc; | |||||
sc = device_get_softc(dev); | |||||
coresight_fdt_release_platform_data(sc->pdata); | |||||
sc->pdata = NULL; | |||||
return (etm_detach(dev)); | |||||
} | |||||
static device_method_t etm_fdt_methods[] = { | static device_method_t etm_fdt_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, etm_fdt_probe), | DEVMETHOD(device_probe, etm_fdt_probe), | ||||
DEVMETHOD(device_attach, etm_fdt_attach), | DEVMETHOD(device_attach, etm_fdt_attach), | ||||
DEVMETHOD(device_detach, etm_fdt_detach), | |||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
DEFINE_CLASS_1(etm, etm_fdt_driver, etm_fdt_methods, | DEFINE_CLASS_1(coresight_etm4x, coresight_etm4x_fdt_driver, etm_fdt_methods, | ||||
sizeof(struct etm_softc), etm_driver); | sizeof(struct etm_softc), coresight_etm4x_driver); | ||||
EARLY_DRIVER_MODULE(etm, simplebus, etm_fdt_driver, 0, 0, | EARLY_DRIVER_MODULE(coresight_etm4x, simplebus, coresight_etm4x_fdt_driver, | ||||
BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); | 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); | ||||
MODULE_DEPEND(coresight_etm4x, coresight, 1, 1, 1); | |||||
MODULE_VERSION(coresight_etm4x, 1); |