{
const struct firmware *entry;
int ret;
+ enum ipc_region reg;
+ char *name;
if (bl) {
ret = request_firmware(&entry, "bl.unchecked.bin", ipc->dev);
- if (ret) {
- dev_err(ipc->dev, "%s, bl request_firmware failed\n",
- __func__);
- return ret;
- }
- memcpy(ipc_get_base(IPC_REG_BL), entry->data, entry->size);
- dev_info(ipc->dev, "%s: bootloader(size:0x%x) on %lx\n",
- __func__, (int)entry->size,
- (unsigned long)ipc_get_base(IPC_REG_BL));
- release_firmware(entry);
+ reg = IPC_REG_BL;
} else {
ret = request_firmware(&entry, ipc->os_name, ipc->dev);
- if (ret) {
- dev_err(ipc->dev, "%s, %s request_firmware failed\n",
- __func__, ipc->os_name);
- return ret;
- }
- memcpy(ipc_get_base(IPC_REG_OS), entry->data, entry->size);
- dev_info(ipc->dev, "%s: %s(size:0x%x) on %lx\n", __func__,
- ipc->os_name, (int)entry->size,
- (unsigned long)ipc_get_base(IPC_REG_OS));
- release_firmware(entry);
+ reg = IPC_REG_OS;
+ }
+
+ if (ret) {
+ dev_err(ipc->dev, "%s, bl(%d) request_firmware failed\n",
+ bl, __func__);
+ return ret;
}
+ memcpy(ipc_get_base(reg), entry->data, entry->size);
+ dev_info(ipc->dev, "%s: bl:%d, bin(size:0x%x) on %lx\n",
+ __func__, bl, (int)entry->size,
+ (unsigned long)ipc_get_base(reg));
+ release_firmware(entry);
return 0;
}
if (ipc->irq_wdt)
enable_irq(ipc->irq_wdt);
}
+#else
+ atomic_set(&ipc->chub_status, CHUB_ST_HANG);
#endif
} else {
/* dump log into file: DO NOT logbuf dueto sram corruption */
nanohub_wakeup_unlock(data);
}
#elif defined(CONFIG_NANOHUB_MAILBOX)
+#ifdef CHUB_RESET_ENABLE
ret = contexthub_reset(data->pdata->mailbox_client);
+#else
+ ret = -EINVAL;
+#endif
#endif
return ret;
}
static const struct sched_param param = {
.sched_priority = (MAX_USER_RT_PRIO/2)-1,
};
+#ifdef CONFIG_NANOHUB_MAILBOX
+#ifndef CHUB_RESET_ENABLE
+ struct contexthub_ipc_info *ipc;
+#endif
+#endif
data->kthread_err_cnt = 0;
sched_setscheduler(current, SCHED_FIFO, ¶m);
}
msleep_interruptible(WAKEUP_TIMEOUT_MS);
nanohub_set_state(data, ST_RUNNING);
+#ifdef CONFIG_NANOHUB_MAILBOX
+#ifndef CHUB_RESET_ENABLE
+ if (ret) {
+ dev_warn(data->io[ID_NANOHUB_SENSOR].dev,
+ "%s fails. nanohub isn't running\n", __func__);
+ return 0;
+ }
+#endif
+#endif
break;
case ST_RUNNING:
break;