aboutsummaryrefslogtreecommitdiff
path: root/hw/fsp/fsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/fsp/fsp.c')
-rw-r--r--hw/fsp/fsp.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index 2b2c537..1112fb7 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -91,7 +91,7 @@ static enum ipl_state ipl_state = ipl_initial;
static struct fsp *first_fsp;
static struct fsp *active_fsp;
static u16 fsp_curseq = 0x8000;
-static u64 *fsp_tce_table;
+static __be64 *fsp_tce_table;
#define FSP_INBOUND_SIZE 0x00100000UL
static void *fsp_inbound_buf = NULL;
@@ -181,8 +181,8 @@ static void fsp_trace_msg(struct fsp_msg *msg, u8 dir __unused)
size_t len = offsetof(struct trace_fsp_msg, data[msg->dlen]);
fsp.fsp_msg.dlen = msg->dlen;
- fsp.fsp_msg.word0 = msg->word0;
- fsp.fsp_msg.word1 = msg->word1;
+ fsp.fsp_msg.word0 = cpu_to_be32(msg->word0);
+ fsp.fsp_msg.word1 = cpu_to_be32(msg->word1);
fsp.fsp_msg.dir = dir;
memcpy(fsp.fsp_msg.data, msg->data.bytes, msg->dlen);
trace_add(&fsp, TRACE_FSP_MSG, len);
@@ -634,12 +634,12 @@ static void fsp_trace_event(struct fsp *fsp, u32 evt,
#ifdef FSP_TRACE_EVENT
size_t len = sizeof(struct trace_fsp_event);
- tfsp.fsp_evt.event = evt;
- tfsp.fsp_evt.fsp_state = fsp->state;
- tfsp.fsp_evt.data[0] = data0;
- tfsp.fsp_evt.data[1] = data1;
- tfsp.fsp_evt.data[2] = data2;
- tfsp.fsp_evt.data[3] = data3;
+ tfsp.fsp_evt.event = cpu_to_be16(evt);
+ tfsp.fsp_evt.fsp_state = cpu_to_be16(fsp->state);
+ tfsp.fsp_evt.data[0] = cpu_to_be32(data0);
+ tfsp.fsp_evt.data[1] = cpu_to_be32(data1);
+ tfsp.fsp_evt.data[2] = cpu_to_be32(data2);
+ tfsp.fsp_evt.data[3] = cpu_to_be32(data3);
trace_add(&tfsp, TRACE_FSP_EVENT, len);
#endif /* FSP_TRACE_EVENT */
}
@@ -931,7 +931,7 @@ static bool fsp_post_msg(struct fsp *fsp, struct fsp_msg *msg)
fsp_wreg(fsp, reg, msg->word1); reg += 4;
wlen = (msg->dlen + 3) >> 2;
for (i = 0; i < wlen; i++) {
- fsp_wreg(fsp, reg, msg->data.words[i]);
+ fsp_wreg(fsp, reg, fsp_msg_get_data_word(msg, i));
reg += 4;
}
@@ -994,7 +994,7 @@ static void __fsp_fillmsg(struct fsp_msg *msg, u32 cmd_sub_mod,
msg->dlen = add_words << 2;
for (i = 0; i < add_words; i++)
- msg->data.words[i] = va_arg(list, unsigned int);
+ fsp_msg_set_data_word(msg, i, va_arg(list, unsigned int));
va_end(list);
}
@@ -1141,8 +1141,8 @@ static void fsp_complete_send(struct fsp *fsp)
static void fsp_alloc_inbound(struct fsp_msg *msg)
{
- u16 func_id = msg->data.words[0] & 0xffff;
- u32 len = msg->data.words[1];
+ u16 func_id = fsp_msg_get_data_word(msg, 0) & 0xffff;
+ u32 len = fsp_msg_get_data_word(msg, 1);
u32 tce_token = 0, act_len = 0;
u8 rc = 0;
void *buf;
@@ -1294,12 +1294,12 @@ static bool fsp_local_command(u32 cmd_sub_mod, struct fsp_msg *msg)
return true;
case FSP_CMD_SP_RELOAD_COMP:
if (msg->data.bytes[3] & PPC_BIT8(0)) {
- fsp_fips_dump_notify(msg->data.words[1],
- msg->data.words[2]);
+ fsp_fips_dump_notify(fsp_msg_get_data_word(msg, 1),
+ fsp_msg_get_data_word(msg, 2));
if (msg->data.bytes[3] & PPC_BIT8(1))
prlog(PR_DEBUG, " PLID is %x\n",
- msg->data.words[3]);
+ fsp_msg_get_data_word(msg, 3));
}
if (msg->data.bytes[3] & PPC_BIT8(2)) {
prlog(PR_INFO, "FSP: SP Reset/Reload was NOT done\n");
@@ -1407,7 +1407,7 @@ static void __fsp_fill_incoming(struct fsp *fsp, struct fsp_msg *msg,
wlen = (dlen + 3) >> 2;
reg = FSP_MBX1_FDATA_AREA + 8;
for (i = 0; i < wlen; i++) {
- msg->data.words[i] = fsp_rreg(fsp, reg);
+ fsp_msg_set_data_word(msg, i, fsp_rreg(fsp, reg));
reg += 4;
}
@@ -1842,7 +1842,7 @@ static int fsp_init_mbox(struct fsp *fsp)
/* We use a single fixed TCE table for all PSI interfaces */
static void fsp_init_tce_table(void)
{
- fsp_tce_table = (u64 *)PSI_TCE_TABLE_BASE;
+ fsp_tce_table = (__be64 *)PSI_TCE_TABLE_BASE;
memset(fsp_tce_table, 0, PSI_TCE_TABLE_SIZE);
}
@@ -1859,7 +1859,7 @@ void fsp_tce_map(u32 offset, void *addr, u32 size)
offset >>= TCE_SHIFT;
while(size--) {
- fsp_tce_table[offset++] = raddr | 0x3;
+ fsp_tce_table[offset++] = cpu_to_be64(raddr | 0x3);
raddr += TCE_PSIZE;
}
}
@@ -2397,8 +2397,8 @@ static void fsp_fetch_lid_complete(struct fsp_msg *msg)
last = list_top(&fsp_fetch_lid_queue, struct fsp_fetch_lid_item, link);
fsp_tce_unmap(PSI_DMA_FETCH, last->bsize);
- woffset = msg->resp->data.words[1];
- wlen = msg->resp->data.words[2];
+ woffset = fsp_msg_get_data_word(msg->resp, 1);
+ wlen = fsp_msg_get_data_word(msg->resp, 2);
rc = (msg->resp->word1 >> 8) & 0xff;
/* Fall back to a PHYP LID for kernel loads */