Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7a88c7e authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt
Browse files

powerpc/scom: Enable 64-bit addresses



On P8, XSCOM addresses has a special "indirect" form that
requires more than 32-bits, so let's use u64 everywhere in
the code instead of u32.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 44790a0b
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -54,8 +54,8 @@ struct scom_controller {
	scom_map_t (*map)(struct device_node *ctrl_dev, u64 reg, u64 count);
	scom_map_t (*map)(struct device_node *ctrl_dev, u64 reg, u64 count);
	void (*unmap)(scom_map_t map);
	void (*unmap)(scom_map_t map);


	int (*read)(scom_map_t map, u32 reg, u64 *value);
	int (*read)(scom_map_t map, u64 reg, u64 *value);
	int (*write)(scom_map_t map, u32 reg, u64 value);
	int (*write)(scom_map_t map, u64 reg, u64 value);
};
};


extern const struct scom_controller *scom_controller;
extern const struct scom_controller *scom_controller;
@@ -137,7 +137,7 @@ static inline void scom_unmap(scom_map_t map)
 *
 *
 * Returns 0 (success) or a negative error code
 * Returns 0 (success) or a negative error code
 */
 */
static inline int scom_read(scom_map_t map, u32 reg, u64 *value)
static inline int scom_read(scom_map_t map, u64 reg, u64 *value)
{
{
	int rc;
	int rc;


@@ -155,7 +155,7 @@ static inline int scom_read(scom_map_t map, u32 reg, u64 *value)
 *
 *
 * Returns 0 (success) or a negative error code
 * Returns 0 (success) or a negative error code
 */
 */
static inline int scom_write(scom_map_t map, u32 reg, u64 value)
static inline int scom_write(scom_map_t map, u64 reg, u64 value)
{
{
	return scom_controller->write(map, reg, value);
	return scom_controller->write(map, reg, value);
}
}
+3 −3
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@
 */
 */
struct opal_scom_map {
struct opal_scom_map {
	uint32_t chip;
	uint32_t chip;
	uint32_t addr;
	uint64_t addr;
};
};


static scom_map_t opal_scom_map(struct device_node *dev, u64 reg, u64 count)
static scom_map_t opal_scom_map(struct device_node *dev, u64 reg, u64 count)
@@ -71,7 +71,7 @@ static int opal_xscom_err_xlate(int64_t rc)
	}
	}
}
}


static int opal_scom_read(scom_map_t map, u32 reg, u64 *value)
static int opal_scom_read(scom_map_t map, u64 reg, u64 *value)
{
{
	struct opal_scom_map *m = map;
	struct opal_scom_map *m = map;
	int64_t rc;
	int64_t rc;
@@ -80,7 +80,7 @@ static int opal_scom_read(scom_map_t map, u32 reg, u64 *value)
	return opal_xscom_err_xlate(rc);
	return opal_xscom_err_xlate(rc);
}
}


static int opal_scom_write(scom_map_t map, u32 reg, u64 value)
static int opal_scom_write(scom_map_t map, u64 reg, u64 value)
{
{
	struct opal_scom_map *m = map;
	struct opal_scom_map *m = map;
	int64_t rc;
	int64_t rc;
+2 −2
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ static void wsp_scom_unmap(scom_map_t map)
	iounmap((void *)map);
	iounmap((void *)map);
}
}


static int wsp_scom_read(scom_map_t map, u32 reg, u64 *value)
static int wsp_scom_read(scom_map_t map, u64 reg, u64 *value)
{
{
	u64 __iomem *addr = (u64 __iomem *)map;
	u64 __iomem *addr = (u64 __iomem *)map;


@@ -59,7 +59,7 @@ static int wsp_scom_read(scom_map_t map, u32 reg, u64 *value)
	return 0;
	return 0;
}
}


static int wsp_scom_write(scom_map_t map, u32 reg, u64 value)
static int wsp_scom_write(scom_map_t map, u64 reg, u64 value)
{
{
	u64 __iomem *addr = (u64 __iomem *)map;
	u64 __iomem *addr = (u64 __iomem *)map;