summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2016-09-09 15:44:12 +1000
committerAlistair Popple <alistair@popple.id.au>2016-09-09 15:44:12 +1000
commitcc98081d0f3d13c56b3224940d17b8d5812fe173 (patch)
tree116bd993c563321627f20666ae389f3ab90fd79b
parent7c795172a4fa4c8413443c63c5fbc31fe00f1be0 (diff)
downloadpdbg-cc98081d0f3d13c56b3224940d17b8d5812fe173.tar.gz
pdbg-cc98081d0f3d13c56b3224940d17b8d5812fe173.zip
Cleanup backend header file
Rename bmcfsi.h to backend.h in preparation for adding new backends. Signed-off-by: Alistair Popple <alistair@popple.id.au>
-rw-r--r--libpdbg/backend.h (renamed from libpdbg/bmcfsi.h)5
-rw-r--r--libpdbg/bmcfsi.c35
-rw-r--r--libpdbg/scom.c2
-rw-r--r--src/main.c2
4 files changed, 21 insertions, 23 deletions
diff --git a/libpdbg/bmcfsi.h b/libpdbg/backend.h
index 7112bd9..7d9414c 100644
--- a/libpdbg/bmcfsi.h
+++ b/libpdbg/backend.h
@@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef __BMCFSI_H
-#define __BMCFSI_H
+#ifndef __BACKEND_H
+#define __BACKEND_H
/* We only support slave 0 at the moment */
#define SLAVE_ID 0x0
/* backend initialisation */
struct scom_backend *fsi_init(void);
-void fsi_destroy(struct scom_backend *backend);
#endif
diff --git a/libpdbg/bmcfsi.c b/libpdbg/bmcfsi.c
index 4d19b10..7a33b96 100644
--- a/libpdbg/bmcfsi.c
+++ b/libpdbg/bmcfsi.c
@@ -24,7 +24,6 @@
#include <time.h>
#include "bitutils.h"
-#include "bmcfsi.h"
#include "operations.h"
#define FSI_CLK 4 //GPIOA4
@@ -459,6 +458,23 @@ static int fsi_putscom(struct scom_backend *backend, int processor_id,
return 0;
}
+static void fsi_destroy(struct scom_backend *backend)
+{
+ set_direction_out(FSI_CLK);
+ set_direction_out(FSI_DAT);
+ write_gpio(FSI_DAT_EN, 1);
+
+ /* Crank things - this is needed to use this tool for kicking off system boot */
+ write_gpio(FSI_CLK, 1);
+ write_gpio(FSI_DAT, 1); /* Data standby state */
+ clock_cycle(FSI_CLK, 5000);
+ write_gpio(FSI_DAT_EN, 0);
+
+ write_gpio(FSI_CLK, 0);
+ write_gpio(FSI_ENABLE, 0);
+ write_gpio(CRONUS_SEL, 0); //Set Cronus control to FSP2
+}
+
struct scom_backend *fsi_init(void)
{
int i;
@@ -515,20 +531,3 @@ struct scom_backend *fsi_init(void)
return backend;
}
-
-void fsi_destroy(struct scom_backend *backend)
-{
- set_direction_out(FSI_CLK);
- set_direction_out(FSI_DAT);
- write_gpio(FSI_DAT_EN, 1);
-
- /* Crank things - this is needed to use this tool for kicking off system boot */
- write_gpio(FSI_CLK, 1);
- write_gpio(FSI_DAT, 1); /* Data standby state */
- clock_cycle(FSI_CLK, 5000);
- write_gpio(FSI_DAT_EN, 0);
-
- write_gpio(FSI_CLK, 0);
- write_gpio(FSI_ENABLE, 0);
- write_gpio(CRONUS_SEL, 0); //Set Cronus control to FSP2
-}
diff --git a/libpdbg/scom.c b/libpdbg/scom.c
index 9a31c04..162f3e4 100644
--- a/libpdbg/scom.c
+++ b/libpdbg/scom.c
@@ -17,7 +17,7 @@
#include <stdio.h>
#include "bitutils.h"
-#include "bmcfsi.h"
+#include "backend.h"
#include "operations.h"
struct scom_backend *backend = NULL;
diff --git a/src/main.c b/src/main.c
index 2d13256..d779ed9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,7 +22,7 @@
#include <getopt.h>
#include <errno.h>
-#include <bmcfsi.h>
+#include <backend.h>
#include <operations.h>
/* EX/Chiplet GP0 SCOM address */
OpenPOWER on IntegriCloud