H A D | lio_main.c | 1932 * @param octeon_dev octeon device 1939 static inline int setup_io_queues(struct octeon_device *octeon_dev, setup_io_queues() argument 1969 retval = octeon_setup_droq(octeon_dev, q_no, setup_io_queues() 1971 (octeon_get_conf(octeon_dev), setup_io_queues() 1974 (octeon_get_conf(octeon_dev), setup_io_queues() 1977 dev_err(&octeon_dev->pci_dev->dev, setup_io_queues() 1983 droq = octeon_dev->droq[q_no]; setup_io_queues() 1993 octeon_register_droq_ops(octeon_dev, q_no, &droq_ops); setup_io_queues() 1999 (octeon_dev), setup_io_queues() 2001 retval = octeon_setup_iq(octeon_dev, lio->linfo.txpciq[q], setup_io_queues() 2005 dev_err(&octeon_dev->pci_dev->dev, setup_io_queues() 3115 * @param octeon_dev octeon device 3121 static int setup_nic_devices(struct octeon_device *octeon_dev) setup_nic_devices() argument 3139 octeon_register_dispatch_fn(octeon_dev, OPCODE_NIC, setup_nic_devices() 3141 lio_nic_info, octeon_dev); setup_nic_devices() 3146 octeon_register_reqtype_free_fn(octeon_dev, REQTYPE_NORESP_NET, setup_nic_devices() 3149 octeon_register_reqtype_free_fn(octeon_dev, REQTYPE_NORESP_NET_SG, setup_nic_devices() 3152 octeon_register_reqtype_free_fn(octeon_dev, REQTYPE_RESP_NET_SG, setup_nic_devices() 3155 for (i = 0; i < octeon_dev->ifcount; i++) { setup_nic_devices() 3159 octeon_alloc_soft_command(octeon_dev, 0, setup_nic_devices() 3165 CFG_GET_NUM_TXQS_NIC_IF(octeon_get_conf(octeon_dev), i); setup_nic_devices() 3167 CFG_GET_NUM_RXQS_NIC_IF(octeon_get_conf(octeon_dev), i); setup_nic_devices() 3169 CFG_GET_BASE_QUE_NIC_IF(octeon_get_conf(octeon_dev), i); setup_nic_devices() 3171 CFG_GET_GMXID_NIC_IF(octeon_get_conf(octeon_dev), i); setup_nic_devices() 3176 dev_dbg(&octeon_dev->pci_dev->dev, setup_nic_devices() 3180 ctx->octeon_id = lio_get_device_id(octeon_dev); setup_nic_devices() 3188 octeon_prepare_soft_command(octeon_dev, sc, OPCODE_NIC, setup_nic_devices() 3196 retval = octeon_send_soft_command(octeon_dev, sc); setup_nic_devices() 3198 dev_err(&octeon_dev->pci_dev->dev, setup_nic_devices() 3211 dev_err(&octeon_dev->pci_dev->dev, "iq/oq config failed\n"); setup_nic_devices() 3222 dev_err(&octeon_dev->pci_dev->dev, setup_nic_devices() 3228 dev_dbg(&octeon_dev->pci_dev->dev, setup_nic_devices() 3235 dev_err(&octeon_dev->pci_dev->dev, "Device allocation failed\n"); setup_nic_devices() 3239 props = &octeon_dev->props[i]; setup_nic_devices() 3293 lio->oct_dev = octeon_dev; setup_nic_devices() 3298 dev_dbg(&octeon_dev->pci_dev->dev, setup_nic_devices() 3311 if (setup_io_queues(octeon_dev, netdev)) { setup_nic_devices() 3312 dev_err(&octeon_dev->pci_dev->dev, "I/O queues creation failed\n"); setup_nic_devices() 3324 lio->tx_qsize = octeon_get_tx_qsize(octeon_dev, lio->txq); setup_nic_devices() 3325 lio->rx_qsize = octeon_get_rx_qsize(octeon_dev, lio->rxq); setup_nic_devices() 3328 dev_err(&octeon_dev->pci_dev->dev, setup_nic_devices() 3343 dev_err(&octeon_dev->pci_dev->dev, "Device registration failed\n"); setup_nic_devices() 3347 dev_dbg(&octeon_dev->pci_dev->dev, setup_nic_devices() 3361 dev_dbg(&octeon_dev->pci_dev->dev, setup_nic_devices() 3364 octeon_free_soft_command(octeon_dev, sc); setup_nic_devices() 3371 octeon_free_soft_command(octeon_dev, sc); setup_nic_devices() 3374 dev_err(&octeon_dev->pci_dev->dev, setup_nic_devices() 3376 liquidio_destroy_nic_device(octeon_dev, i); setup_nic_devices() 3481 * @param octeon_dev octeon device 3483 static int octeon_device_init(struct octeon_device *octeon_dev) octeon_device_init() argument 3487 (struct octeon_device_priv *)octeon_dev->priv; octeon_device_init() 3488 atomic_set(&octeon_dev->status, OCT_DEV_BEGIN_STATE); octeon_device_init() 3493 if (octeon_pci_os_setup(octeon_dev)) octeon_device_init() 3497 if (octeon_chip_specific_setup(octeon_dev)) { octeon_device_init() 3498 dev_err(&octeon_dev->pci_dev->dev, "Chip specific setup failed\n"); octeon_device_init() 3502 atomic_set(&octeon_dev->status, OCT_DEV_PCI_MAP_DONE); octeon_device_init() 3504 octeon_dev->app_mode = CVM_DRV_INVALID_APP; octeon_device_init() 3507 if (octeon_dev->fn_list.soft_reset(octeon_dev)) octeon_device_init() 3513 if (octeon_init_dispatch_list(octeon_dev)) octeon_device_init() 3516 octeon_register_dispatch_fn(octeon_dev, OPCODE_NIC, octeon_device_init() 3519 octeon_dev); octeon_device_init() 3521 INIT_DELAYED_WORK(&octeon_dev->nic_poll_work.work, nic_starter); octeon_device_init() 3522 octeon_dev->nic_poll_work.ctxptr = (void *)octeon_dev; octeon_device_init() 3523 schedule_delayed_work(&octeon_dev->nic_poll_work.work, octeon_device_init() 3526 atomic_set(&octeon_dev->status, OCT_DEV_DISPATCH_INIT_DONE); octeon_device_init() 3528 octeon_set_io_queues_off(octeon_dev); octeon_device_init() 3531 if (octeon_setup_instr_queues(octeon_dev)) { octeon_device_init() 3532 dev_err(&octeon_dev->pci_dev->dev, octeon_device_init() 3535 for (j = 0; j < octeon_dev->num_iqs; j++) octeon_device_init() 3536 octeon_delete_instr_queue(octeon_dev, j); octeon_device_init() 3539 atomic_set(&octeon_dev->status, OCT_DEV_INSTR_QUEUE_INIT_DONE); octeon_device_init() 3543 if (octeon_setup_sc_buffer_pool(octeon_dev)) { octeon_device_init() 3544 dev_err(&octeon_dev->pci_dev->dev, "sc buffer pool allocation failed\n"); octeon_device_init() 3547 atomic_set(&octeon_dev->status, OCT_DEV_SC_BUFF_POOL_INIT_DONE); octeon_device_init() 3552 if (octeon_setup_response_list(octeon_dev)) { octeon_device_init() 3553 dev_err(&octeon_dev->pci_dev->dev, "Response list allocation failed\n"); octeon_device_init() 3556 atomic_set(&octeon_dev->status, OCT_DEV_RESP_LIST_INIT_DONE); octeon_device_init() 3558 if (octeon_setup_output_queues(octeon_dev)) { octeon_device_init() 3559 dev_err(&octeon_dev->pci_dev->dev, "Output queue initialization failed\n"); octeon_device_init() 3561 for (j = 0; j < octeon_dev->num_oqs; j++) octeon_device_init() 3562 octeon_delete_droq(octeon_dev, j); octeon_device_init() 3565 atomic_set(&octeon_dev->status, OCT_DEV_DROQ_INIT_DONE); octeon_device_init() 3571 ret = octeon_dev->fn_list.setup_device_regs(octeon_dev); octeon_device_init() 3573 dev_err(&octeon_dev->pci_dev->dev, octeon_device_init() 3579 dev_dbg(&octeon_dev->pci_dev->dev, "Initializing droq tasklet\n"); octeon_device_init() 3581 (unsigned long)octeon_dev); octeon_device_init() 3585 octeon_setup_interrupt(octeon_dev); octeon_device_init() 3588 octeon_dev->fn_list.enable_interrupt(octeon_dev->chip); octeon_device_init() 3591 octeon_dev->fn_list.enable_io_queues(octeon_dev); octeon_device_init() 3593 atomic_set(&octeon_dev->status, OCT_DEV_IO_QUEUES_DONE); octeon_device_init() 3595 dev_dbg(&octeon_dev->pci_dev->dev, "Waiting for DDR initialization...\n"); octeon_device_init() 3598 dev_info(&octeon_dev->pci_dev->dev, octeon_device_init() 3605 ret = octeon_wait_for_ddr_init(octeon_dev, &ddr_timeout); octeon_device_init() 3607 dev_err(&octeon_dev->pci_dev->dev, octeon_device_init() 3613 if (octeon_wait_for_bootloader(octeon_dev, 1000) != 0) { octeon_device_init() 3614 dev_err(&octeon_dev->pci_dev->dev, "Board not responding\n"); octeon_device_init() 3618 dev_dbg(&octeon_dev->pci_dev->dev, "Initializing consoles\n"); octeon_device_init() 3619 ret = octeon_init_consoles(octeon_dev); octeon_device_init() 3621 dev_err(&octeon_dev->pci_dev->dev, "Could not access board consoles\n"); octeon_device_init() 3624 ret = octeon_add_console(octeon_dev, 0); octeon_device_init() 3626 dev_err(&octeon_dev->pci_dev->dev, "Could not access board console\n"); octeon_device_init() 3630 atomic_set(&octeon_dev->status, OCT_DEV_CONSOLE_INIT_DONE); octeon_device_init() 3632 dev_dbg(&octeon_dev->pci_dev->dev, "Loading firmware\n"); octeon_device_init() 3633 ret = load_firmware(octeon_dev); octeon_device_init() 3635 dev_err(&octeon_dev->pci_dev->dev, "Could not load firmware to board\n"); octeon_device_init() 3639 handshake[octeon_dev->octeon_id].init_ok = 1; octeon_device_init() 3640 complete(&handshake[octeon_dev->octeon_id].init); octeon_device_init() 3642 atomic_set(&octeon_dev->status, OCT_DEV_HOST_OK); octeon_device_init() 3647 for (j = 0; j < octeon_dev->num_oqs; j++) octeon_device_init() 3648 writel(octeon_dev->droq[j]->max_count, octeon_device_init() 3649 octeon_dev->droq[j]->pkts_credit_reg); octeon_device_init()
|