[Skiboot] [PATCH 02/10] centaur: Expose centaur_chip and get_centaur()

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Jun 23 14:25:52 AEST 2015


They will be used by the i2c driver

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 hw/centaur.c      | 14 +++-----------
 include/centaur.h | 17 +++++++++++++++++
 2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/hw/centaur.c b/hw/centaur.c
index 6f11ee7..6504e92 100644
--- a/hw/centaur.c
+++ b/hw/centaur.c
@@ -34,14 +34,6 @@
  * machine checks happening inside Sapphire which we don't at the
  * moment.
  */
-struct centaur_chip {
-	bool		valid;
-	uint8_t		ec_level;
-	uint32_t	fsi_master_chip_id;
-	uint32_t	fsi_master_port;
-	uint32_t	fsi_master_engine;	
-	struct lock	lock;
-};
 
 /* Is that correct ? */
 #define MAX_CENTAURS_PER_CHIP	8
@@ -120,7 +112,7 @@ static int64_t centaur_fsiscom_read(struct centaur_chip *centaur, uint32_t pcb_a
 	return OPAL_SUCCESS;
 }
 
-static struct centaur_chip *centaur_get(uint32_t part_id)
+struct centaur_chip *get_centaur(uint32_t part_id)
 {
 	uint32_t hchip_id, mchan;
 	struct proc_chip *hchip;
@@ -189,7 +181,7 @@ static int64_t centaur_fsiscom_write(struct centaur_chip *centaur, uint32_t pcb_
 
 int64_t centaur_xscom_read(uint32_t id, uint64_t pcb_addr, uint64_t *val)
 {
-	struct centaur_chip *centaur = centaur_get(id);
+	struct centaur_chip *centaur = get_centaur(id);
 	int64_t rc;
 
 	if (!centaur)
@@ -204,7 +196,7 @@ int64_t centaur_xscom_read(uint32_t id, uint64_t pcb_addr, uint64_t *val)
 
 int64_t centaur_xscom_write(uint32_t id, uint64_t pcb_addr, uint64_t val)
 {
-	struct centaur_chip *centaur = centaur_get(id);
+	struct centaur_chip *centaur = get_centaur(id);
 	int64_t rc;
 
 	if (!centaur)
diff --git a/include/centaur.h b/include/centaur.h
index b524c51..457afd7 100644
--- a/include/centaur.h
+++ b/include/centaur.h
@@ -17,8 +17,25 @@
 #ifndef __CENTAUR_H
 #define __CENTAUR_H
 
+#include <stdint.h>
+#include <lock.h>
+
+#include <ccan/list/list.h>
+
+struct centaur_chip {
+	bool			valid;
+	uint8_t			ec_level;
+	uint32_t		fsi_master_chip_id;
+	uint32_t		fsi_master_port;
+	uint32_t		fsi_master_engine;
+	struct lock		lock;
+};
+
+
 extern int64_t centaur_xscom_read(uint32_t id, uint64_t pcb_addr, uint64_t *val) __warn_unused_result;
 extern int64_t centaur_xscom_write(uint32_t id, uint64_t pcb_addr, uint64_t val) __warn_unused_result;
 extern void centaur_init(void);
 
+extern struct centaur_chip *get_centaur(uint32_t part_id);
+
 #endif /* __CENTAUR_H */
-- 
2.1.4



More information about the Skiboot mailing list