aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/nx-842.c14
-rw-r--r--hw/nx-crypto.c24
2 files changed, 19 insertions, 19 deletions
diff --git a/hw/nx-842.c b/hw/nx-842.c
index b5a43cc..f462f7a 100644
--- a/hw/nx-842.c
+++ b/hw/nx-842.c
@@ -39,9 +39,9 @@
static int nx_cfg_842(u32 gcid, u64 xcfg)
{
u64 cfg, ci, ct;
- int rc;
+ int rc, instance = gcid + 1;
- BUILD_ASSERT(MAX_CHIPS <= NX_842_CFG_CI_MAX);
+ BUILD_ASSERT(MAX_CHIPS < NX_842_CFG_CI_MAX);
rc = xscom_read(gcid, xcfg, &cfg);
if (rc)
@@ -64,14 +64,14 @@ static int nx_cfg_842(u32 gcid, u64 xcfg)
*/
ci = GETFIELD(NX_842_CFG_CI, cfg) >> NX_842_CFG_CI_LSHIFT;
if (!ci)
- prlog(PR_INFO, "NX%d: 842 CI set to %d\n", gcid, gcid);
- else if (ci == gcid)
+ prlog(PR_INFO, "NX%d: 842 CI set to %d\n", gcid, instance);
+ else if (ci == instance)
prlog(PR_INFO, "NX%d: 842 CI already set to %u\n", gcid,
(unsigned int)ci);
else
prlog(PR_INFO, "NX%d: 842 CI already set to %u, "
- "changing to %d\n", gcid, (unsigned int)ci, gcid);
- ci = gcid;
+ "changing to %d\n", gcid, (unsigned int)ci, instance);
+ ci = instance;
cfg = SETFIELD(NX_842_CFG_CI, cfg, ci << NX_842_CFG_CI_LSHIFT);
/* Enable all functions */
@@ -193,5 +193,5 @@ void nx_create_842_node(struct dt_node *node)
prlog(PR_INFO, "NX%d: 842 Coprocessor Enabled\n", gcid);
dt_add_property_cells(node, "ibm,842-coprocessor-type", NX_CT_842);
- dt_add_property_cells(node, "ibm,842-coprocessor-instance", gcid);
+ dt_add_property_cells(node, "ibm,842-coprocessor-instance", gcid + 1);
}
diff --git a/hw/nx-crypto.c b/hw/nx-crypto.c
index 37b64f2..723c571 100644
--- a/hw/nx-crypto.c
+++ b/hw/nx-crypto.c
@@ -48,9 +48,9 @@
static int nx_cfg_sym(u32 gcid, u64 xcfg)
{
u64 cfg, ci, ct;
- int rc;
+ int rc, instance = gcid + 1;
- BUILD_ASSERT(MAX_CHIPS <= NX_SYM_CFG_CI_MAX);
+ BUILD_ASSERT(MAX_CHIPS < NX_SYM_CFG_CI_MAX);
rc = xscom_read(gcid, xcfg, &cfg);
if (rc)
@@ -73,14 +73,14 @@ static int nx_cfg_sym(u32 gcid, u64 xcfg)
*/
ci = GETFIELD(NX_SYM_CFG_CI, cfg) >> NX_SYM_CFG_CI_LSHIFT;
if (!ci)
- prlog(PR_INFO, "NX%d: SYM CI set to %d\n", gcid, gcid);
- else if (ci == gcid)
+ prlog(PR_INFO, "NX%d: SYM CI set to %d\n", gcid, instance);
+ else if (ci == instance)
prlog(PR_INFO, "NX%d: SYM CI already set to %u\n", gcid,
(unsigned int)ci);
else
prlog(PR_INFO, "NX%d: SYM CI already set to %u, "
- "changing to %d\n", gcid, (unsigned int)ci, gcid);
- ci = gcid;
+ "changing to %d\n", gcid, (unsigned int)ci, instance);
+ ci = instance;
cfg = SETFIELD(NX_SYM_CFG_CI, cfg, ci << NX_SYM_CFG_CI_LSHIFT);
cfg = SETFIELD(NX_SYM_CFG_FC_ENABLE, cfg, CFG_SYM_FC_ENABLE);
@@ -101,9 +101,9 @@ static int nx_cfg_sym(u32 gcid, u64 xcfg)
static int nx_cfg_asym(u32 gcid, u64 xcfg)
{
u64 cfg, ci, ct;
- int rc;
+ int rc, instance = gcid + 1;
- BUILD_ASSERT(MAX_CHIPS <= NX_ASYM_CFG_CI_MAX);
+ BUILD_ASSERT(MAX_CHIPS < NX_ASYM_CFG_CI_MAX);
rc = xscom_read(gcid, xcfg, &cfg);
if (rc)
@@ -127,14 +127,14 @@ static int nx_cfg_asym(u32 gcid, u64 xcfg)
*/
ci = GETFIELD(NX_ASYM_CFG_CI, cfg) >> NX_ASYM_CFG_CI_LSHIFT;
if (!ci)
- prlog(PR_INFO, "NX%d: ASYM CI set to %d\n", gcid, gcid);
- else if (ci == gcid)
+ prlog(PR_INFO, "NX%d: ASYM CI set to %d\n", gcid, instance);
+ else if (ci == instance)
prlog(PR_INFO, "NX%d: ASYM CI already set to %u\n", gcid,
(unsigned int)ci);
else
prlog(PR_INFO, "NX%d: ASYM CI already set to %u, "
- "changing to %d\n", gcid, (unsigned int)ci, gcid);
- ci = gcid;
+ "changing to %d\n", gcid, (unsigned int)ci, instance);
+ ci = instance;
cfg = SETFIELD(NX_ASYM_CFG_CI, cfg, ci << NX_ASYM_CFG_CI_LSHIFT);
cfg = SETFIELD(NX_ASYM_CFG_FC_ENABLE, cfg, CFG_ASYM_FC_ENABLE);