-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pds_core: add devcmd device interfaces
The devcmd interface is the basic connection to the device through the PCI BAR for low level identification and command services. This does the early device initialization and finds the identity data, and adds devcmd routines to be used by later driver bits. Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Shannon Nelson
authored and
David S. Miller
committed
Apr 21, 2023
1 parent
55435ea
commit 523847d
Showing
8 changed files
with
699 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* Copyright(c) 2023 Advanced Micro Devices, Inc */ | ||
|
||
#include "core.h" | ||
|
||
int pdsc_setup(struct pdsc *pdsc, bool init) | ||
{ | ||
int err = 0; | ||
|
||
if (init) | ||
err = pdsc_dev_init(pdsc); | ||
else | ||
err = pdsc_dev_reinit(pdsc); | ||
if (err) | ||
return err; | ||
|
||
clear_bit(PDSC_S_FW_DEAD, &pdsc->state); | ||
return 0; | ||
} | ||
|
||
void pdsc_teardown(struct pdsc *pdsc, bool removing) | ||
{ | ||
pdsc_devcmd_reset(pdsc); | ||
|
||
if (removing) { | ||
kfree(pdsc->intr_info); | ||
pdsc->intr_info = NULL; | ||
} | ||
|
||
if (pdsc->kern_dbpage) { | ||
iounmap(pdsc->kern_dbpage); | ||
pdsc->kern_dbpage = NULL; | ||
} | ||
|
||
set_bit(PDSC_S_FW_DEAD, &pdsc->state); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.