int fjes_hw_init(struct fjes_hw *hw) { int ret; hw->base = fjes_hw_iomap(hw); if (!hw->base) return -EIO; ret = fjes_hw_reset(hw); if (ret) return ret; fjes_hw_set_irqmask(hw, REG_ICTL_MASK_ALL, true); INIT_WORK(&hw->update_zone_task, fjes_hw_update_zone_task); INIT_WORK(&hw->epstop_task, fjes_hw_epstop_task); mutex_init(&hw->hw_info.lock); hw->max_epid = fjes_hw_get_max_epid(hw); hw->my_epid = fjes_hw_get_my_epid(hw); if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid)) return -ENXIO; ret = fjes_hw_setup(hw); return ret; }
int fjes_hw_init(struct fjes_hw *hw) { int ret; hw->base = fjes_hw_iomap(hw); if (!hw->base) return -EIO; ret = fjes_hw_reset(hw); if (ret) return ret; fjes_hw_set_irqmask(hw, REG_ICTL_MASK_ALL, true); INIT_WORK(&hw->update_zone_task, fjes_hw_update_zone_task); INIT_WORK(&hw->epstop_task, fjes_hw_epstop_task); mutex_init(&hw->hw_info.lock); spin_lock_init(&hw->rx_status_lock); hw->max_epid = fjes_hw_get_max_epid(hw); hw->my_epid = fjes_hw_get_my_epid(hw); if ((hw->max_epid == 0) || (hw->my_epid >= hw->max_epid)) return -ENXIO; ret = fjes_hw_setup(hw); hw->hw_info.trace = vzalloc(FJES_DEBUG_BUFFER_SIZE); hw->hw_info.trace_size = FJES_DEBUG_BUFFER_SIZE; return ret; }