Lines Matching +full:msb +full:- +full:justified
1 // SPDX-License-Identifier: GPL-2.0-or-later
20 #include <asm/isa-bridge.h>
22 static int opal_lpc_chip_id = -1;
120 while(c--) in opal_lpc_insb()
128 while(c--) in opal_lpc_insw()
136 while(c--) in opal_lpc_insl()
144 while(c--) in opal_lpc_outsb()
152 while(c--) in opal_lpc_outsw()
160 while(c--) in opal_lpc_outsl()
187 struct lpc_debugfs_entry *lpc = filp->private_data; in lpc_debug_read()
192 return -EFAULT; in lpc_debug_read()
204 if (lpc->lpc_type == OPAL_LPC_FW) { in lpc_debug_read()
210 rc = opal_lpc_read(opal_lpc_chip_id, lpc->lpc_type, pos, in lpc_debug_read()
213 return -ENXIO; in lpc_debug_read()
217 * as it's the desired data right justified in a 32-bit BE in lpc_debug_read()
220 * This is a very bad interface and I'm to blame for it :-( in lpc_debug_read()
222 * So we can't just apply a 32-bit swap to what comes from OPAL, in lpc_debug_read()
234 * 32-bit: B0 B1 B2 B3 B0B1B2B3 B3B2B1B0 in lpc_debug_read()
235 * 16-bit: B0 B1 0000B0B1 B1B00000 in lpc_debug_read()
236 * 8-bit: B0 000000B0 B0000000 in lpc_debug_read()
238 * So a BE kernel will have the leftmost of the above in the MSB in lpc_debug_read()
266 return -EFAULT; in lpc_debug_read()
269 todo -= len; in lpc_debug_read()
278 struct lpc_debugfs_entry *lpc = filp->private_data; in lpc_debug_write()
283 return -EFAULT; in lpc_debug_write()
295 if (lpc->lpc_type == OPAL_LPC_FW) { in lpc_debug_write()
310 * of the byte sequence. IE: for a 32-bit access, byte 0 should be in lpc_debug_write()
311 * in the MSB. So here we *do* need to byteswap on LE. in lpc_debug_write()
314 * 32-bit: B0 B1 B2 B3 B3B2B1B0 B0B1B2B3 in lpc_debug_write()
315 * 16-bit: B0 B1 0000B1B0 0000B0B1 in lpc_debug_write()
316 * 8-bit: B0 000000B0 000000B0 in lpc_debug_write()
332 return -EFAULT; in lpc_debug_write()
334 rc = opal_lpc_write(opal_lpc_chip_id, lpc->lpc_type, pos, in lpc_debug_write()
337 return -ENXIO; in lpc_debug_write()
340 todo -= len; in lpc_debug_write()
360 return -ENOMEM; in opal_lpc_debugfs_create_type()
361 entry->lpc_type = type; in opal_lpc_debugfs_create_type()
372 return -ENODEV; in opal_lpc_init_debugfs()
393 for_each_compatible_node(np, NULL, "ibm,power8-lpc") { in opal_lpc_init()
411 pr_info("OPAL: Found non-mapped LPC bus on chip %d\n", in opal_lpc_init()