Lines Matching +full:mram +full:- +full:cfg

1 // SPDX-License-Identifier: GPL-2.0
5 // Copyright (C) 2018-19 Texas Instruments Incorporated - http://www.ti.com/
8 * https://github.com/linux-can/can-doc/tree/master/m_can
321 return cdev->ops->read_reg(cdev, reg); in m_can_read()
327 cdev->ops->write_reg(cdev, reg, val); in m_can_write()
334 u32 addr_offset = cdev->mcfg[MRAM_RXF0].off + fgi * RXF0_ELEMENT_SIZE + in m_can_fifo_read()
340 return cdev->ops->read_fifo(cdev, addr_offset, val, val_count); in m_can_fifo_read()
347 u32 addr_offset = cdev->mcfg[MRAM_TXB].off + fpi * TXB_ELEMENT_SIZE + in m_can_fifo_write()
353 return cdev->ops->write_fifo(cdev, addr_offset, val, val_count); in m_can_fifo_write()
359 return cdev->ops->write_fifo(cdev, fpi, &val, 1); in m_can_fifo_write_no_off()
365 u32 addr_offset = cdev->mcfg[MRAM_TXE].off + fgi * TXE_ELEMENT_SIZE + in m_can_txe_fifo_read()
368 return cdev->ops->read_fifo(cdev, addr_offset, val, 1); in m_can_txe_fifo_read()
402 netdev_warn(cdev->net, "Failed to init module\n"); in m_can_config_endisable()
405 timeout--; in m_can_config_endisable()
421 /* Retrieve internal timestamp counter from TSCV.TSC, and shift it to 32-bit
439 if (cdev->tx_skb) { in m_can_clean()
442 net->stats.tx_errors++; in m_can_clean()
443 if (cdev->version > 30) in m_can_clean()
447 can_free_echo_skb(cdev->net, putidx, NULL); in m_can_clean()
448 cdev->tx_skb = NULL; in m_can_clean()
452 /* For peripherals, pass skb to rx-offload, which will push skb from
453 * napi. For non-peripherals, RX is done in napi already, so push
455 * rx-offload and is ignored for non-peripherals.
461 if (cdev->is_peripheral) { in m_can_receive_skb()
462 struct net_device_stats *stats = &cdev->net->stats; in m_can_receive_skb()
465 err = can_rx_offload_queue_timestamp(&cdev->offload, skb, in m_can_receive_skb()
468 stats->rx_fifo_errors++; in m_can_receive_skb()
476 struct net_device_stats *stats = &dev->stats; in m_can_read_fifo()
496 stats->rx_dropped++; in m_can_read_fifo()
501 cf->len = can_fd_dlc2len((fifo_header.dlc >> 16) & 0x0F); in m_can_read_fifo()
503 cf->len = can_cc_dlc2len((fifo_header.dlc >> 16) & 0x0F); in m_can_read_fifo()
506 cf->can_id = (fifo_header.id & CAN_EFF_MASK) | CAN_EFF_FLAG; in m_can_read_fifo()
508 cf->can_id = (fifo_header.id >> 18) & CAN_SFF_MASK; in m_can_read_fifo()
511 cf->flags |= CANFD_ESI; in m_can_read_fifo()
516 cf->can_id |= CAN_RTR_FLAG; in m_can_read_fifo()
519 cf->flags |= CANFD_BRS; in m_can_read_fifo()
522 cf->data, DIV_ROUND_UP(cf->len, 4)); in m_can_read_fifo()
526 stats->rx_bytes += cf->len; in m_can_read_fifo()
528 stats->rx_packets++; in m_can_read_fifo()
564 quota--; in m_can_do_rx_poll()
575 struct net_device_stats *stats = &dev->stats; in m_can_handle_lost_msg()
582 stats->rx_errors++; in m_can_handle_lost_msg()
583 stats->rx_over_errors++; in m_can_handle_lost_msg()
589 frame->can_id |= CAN_ERR_CRTL; in m_can_handle_lost_msg()
590 frame->data[1] = CAN_ERR_CRTL_RX_OVERFLOW; in m_can_handle_lost_msg()
592 if (cdev->is_peripheral) in m_can_handle_lost_msg()
604 struct net_device_stats *stats = &dev->stats; in m_can_handle_lec_err()
609 cdev->can.can_stats.bus_error++; in m_can_handle_lec_err()
610 stats->rx_errors++; in m_can_handle_lec_err()
620 cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR; in m_can_handle_lec_err()
625 cf->data[2] |= CAN_ERR_PROT_STUFF; in m_can_handle_lec_err()
629 cf->data[2] |= CAN_ERR_PROT_FORM; in m_can_handle_lec_err()
633 cf->data[3] = CAN_ERR_PROT_LOC_ACK; in m_can_handle_lec_err()
637 cf->data[2] |= CAN_ERR_PROT_BIT1; in m_can_handle_lec_err()
641 cf->data[2] |= CAN_ERR_PROT_BIT0; in m_can_handle_lec_err()
645 cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ; in m_can_handle_lec_err()
651 if (cdev->is_peripheral) in m_can_handle_lec_err()
666 bec->rxerr = FIELD_GET(ECR_REC_MASK, ecr); in __m_can_get_berr_counter()
667 bec->txerr = FIELD_GET(ECR_TEC_MASK, ecr); in __m_can_get_berr_counter()
674 if (cdev->pm_clock_support == 0) in m_can_clk_start()
677 return pm_runtime_resume_and_get(cdev->dev); in m_can_clk_start()
682 if (cdev->pm_clock_support) in m_can_clk_stop()
683 pm_runtime_put_sync(cdev->dev); in m_can_clk_stop()
716 cdev->can.can_stats.error_warning++; in m_can_handle_state_change()
717 cdev->can.state = CAN_STATE_ERROR_WARNING; in m_can_handle_state_change()
721 cdev->can.can_stats.error_passive++; in m_can_handle_state_change()
722 cdev->can.state = CAN_STATE_ERROR_PASSIVE; in m_can_handle_state_change()
725 /* bus-off state */ in m_can_handle_state_change()
726 cdev->can.state = CAN_STATE_BUS_OFF; in m_can_handle_state_change()
728 cdev->can.can_stats.bus_off++; in m_can_handle_state_change()
745 cf->can_id |= CAN_ERR_CRTL | CAN_ERR_CNT; in m_can_handle_state_change()
746 cf->data[1] = (bec.txerr > bec.rxerr) ? in m_can_handle_state_change()
749 cf->data[6] = bec.txerr; in m_can_handle_state_change()
750 cf->data[7] = bec.rxerr; in m_can_handle_state_change()
754 cf->can_id |= CAN_ERR_CRTL | CAN_ERR_CNT; in m_can_handle_state_change()
757 cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE; in m_can_handle_state_change()
759 cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE; in m_can_handle_state_change()
760 cf->data[6] = bec.txerr; in m_can_handle_state_change()
761 cf->data[7] = bec.rxerr; in m_can_handle_state_change()
764 /* bus-off state */ in m_can_handle_state_change()
765 cf->can_id |= CAN_ERR_BUSOFF; in m_can_handle_state_change()
771 if (cdev->is_peripheral) in m_can_handle_state_change()
784 if (psr & PSR_EW && cdev->can.state != CAN_STATE_ERROR_WARNING) { in m_can_handle_state_errors()
790 if (psr & PSR_EP && cdev->can.state != CAN_STATE_ERROR_PASSIVE) { in m_can_handle_state_errors()
796 if (psr & PSR_BO && cdev->can.state != CAN_STATE_BUS_OFF) { in m_can_handle_state_errors()
833 struct net_device_stats *stats = &dev->stats; in m_can_handle_protocol_error()
843 stats->tx_errors++; in m_can_handle_protocol_error()
846 if (cdev->version >= 31 && (irqstatus & IR_PEA)) { in m_can_handle_protocol_error()
848 cdev->can.can_stats.arbitration_lost++; in m_can_handle_protocol_error()
850 cf->can_id |= CAN_ERR_LOSTARB; in m_can_handle_protocol_error()
851 cf->data[0] |= CAN_ERR_LOSTARB_UNSPEC; in m_can_handle_protocol_error()
860 if (cdev->is_peripheral) in m_can_handle_protocol_error()
878 if ((cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) && in m_can_handle_bus_errors()
883 if ((cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) && in m_can_handle_bus_errors()
900 irqstatus = cdev->irqstatus | m_can_read(cdev, M_CAN_IR); in m_can_rx_handler()
914 if (cdev->version <= 31 && irqstatus & IR_MRAF && in m_can_rx_handler()
934 rx_work_or_err = m_can_do_rx_poll(dev, (quota - work_done)); in m_can_rx_handler()
951 /* Don't re-enable interrupts if the driver had a fatal error in m_can_rx_peripheral()
962 struct net_device *dev = napi->dev; in m_can_poll()
968 /* Don't re-enable interrupts if the driver had a fatal error in m_can_poll()
979 /* Echo tx skb and update net stats. Peripherals use rx-offload for
981 * by rx-offload, and is ignored for non-peripherals.
987 struct net_device *dev = cdev->net; in m_can_tx_update_stats()
988 struct net_device_stats *stats = &dev->stats; in m_can_tx_update_stats()
990 if (cdev->is_peripheral) in m_can_tx_update_stats()
991 stats->tx_bytes += in m_can_tx_update_stats()
992 can_rx_offload_get_echo_skb(&cdev->offload, in m_can_tx_update_stats()
997 stats->tx_bytes += can_get_echo_skb(dev, msg_mark, NULL); in m_can_tx_update_stats()
999 stats->tx_packets++; in m_can_tx_update_stats()
1053 if (pm_runtime_suspended(cdev->dev)) in m_can_isr()
1063 if (cdev->ops->clear_interrupts) in m_can_isr()
1064 cdev->ops->clear_interrupts(cdev); in m_can_isr()
1067 * - rx IRQ in m_can_isr()
1068 * - state change IRQ in m_can_isr()
1069 * - bus error IRQ and bus error reporting in m_can_isr()
1072 cdev->irqstatus = ir; in m_can_isr()
1074 if (!cdev->is_peripheral) in m_can_isr()
1075 napi_schedule(&cdev->napi); in m_can_isr()
1080 if (cdev->version == 30) { in m_can_isr()
1085 if (cdev->is_peripheral) in m_can_isr()
1102 if (cdev->is_peripheral) in m_can_isr()
1103 can_rx_offload_threaded_irq_finish(&cdev->offload); in m_can_isr()
1163 const struct can_bittiming *bt = &cdev->can.bittiming; in m_can_set_bittiming()
1164 const struct can_bittiming *dbt = &cdev->can.data_bittiming; in m_can_set_bittiming()
1168 brp = bt->brp - 1; in m_can_set_bittiming()
1169 sjw = bt->sjw - 1; in m_can_set_bittiming()
1170 tseg1 = bt->prop_seg + bt->phase_seg1 - 1; in m_can_set_bittiming()
1171 tseg2 = bt->phase_seg2 - 1; in m_can_set_bittiming()
1178 if (cdev->can.ctrlmode & CAN_CTRLMODE_FD) { in m_can_set_bittiming()
1180 brp = dbt->brp - 1; in m_can_set_bittiming()
1181 sjw = dbt->sjw - 1; in m_can_set_bittiming()
1182 tseg1 = dbt->prop_seg + dbt->phase_seg1 - 1; in m_can_set_bittiming()
1183 tseg2 = dbt->phase_seg2 - 1; in m_can_set_bittiming()
1189 if (dbt->bitrate > 2500000) { in m_can_set_bittiming()
1195 ssp = dbt->sample_point; in m_can_set_bittiming()
1200 tdco = (cdev->can.clock.freq / 1000) * in m_can_set_bittiming()
1201 ssp / dbt->bitrate; in m_can_set_bittiming()
1227 * - set rx buffer/fifo element size
1228 * - configure rx fifo
1229 * - accept non-matching frame into fifo 0
1230 * - configure tx buffer
1231 * - >= v3.1.x: TX FIFO is used
1232 * - configure mode
1233 * - setup bittiming
1234 * - configure timestamp generation
1249 /* Accept Non-matching Frames Into FIFO 0 */ in m_can_chip_config()
1252 if (cdev->version == 30) { in m_can_chip_config()
1255 cdev->mcfg[MRAM_TXB].off); in m_can_chip_config()
1260 cdev->mcfg[MRAM_TXB].num) | in m_can_chip_config()
1261 cdev->mcfg[MRAM_TXB].off); in m_can_chip_config()
1269 if (cdev->version == 30) { in m_can_chip_config()
1272 cdev->mcfg[MRAM_TXE].off); in m_can_chip_config()
1277 cdev->mcfg[MRAM_TXE].num) | in m_can_chip_config()
1278 cdev->mcfg[MRAM_TXE].off); in m_can_chip_config()
1283 FIELD_PREP(RXFC_FS_MASK, cdev->mcfg[MRAM_RXF0].num) | in m_can_chip_config()
1284 cdev->mcfg[MRAM_RXF0].off); in m_can_chip_config()
1287 FIELD_PREP(RXFC_FS_MASK, cdev->mcfg[MRAM_RXF1].num) | in m_can_chip_config()
1288 cdev->mcfg[MRAM_RXF1].off); in m_can_chip_config()
1293 if (cdev->version == 30) { in m_can_chip_config()
1300 if (cdev->can.ctrlmode & CAN_CTRLMODE_FD) in m_can_chip_config()
1309 if (cdev->can.ctrlmode & CAN_CTRLMODE_FD_NON_ISO) in m_can_chip_config()
1312 if (cdev->can.ctrlmode & CAN_CTRLMODE_FD) in m_can_chip_config()
1317 if (cdev->can.ctrlmode & CAN_CTRLMODE_LOOPBACK) { in m_can_chip_config()
1323 if (cdev->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) in m_can_chip_config()
1327 if (cdev->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT) in m_can_chip_config()
1336 if (!(cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)) in m_can_chip_config()
1337 if (cdev->version == 30) in m_can_chip_config()
1361 if (cdev->ops->init) in m_can_chip_config()
1362 cdev->ops->init(cdev); in m_can_chip_config()
1372 cdev->can.state = CAN_STATE_ERROR_ACTIVE; in m_can_start()
1386 return -EOPNOTSUPP; in m_can_set_mode()
1428 int niso_timeout = -ETIMEDOUT; in m_can_niso_supported()
1452 /* return false if time out (-ETIMEDOUT), else return true */ in m_can_niso_supported()
1458 struct net_device *dev = cdev->net; in m_can_dev_setup()
1464 dev_err(cdev->dev, "Unsupported version number: %2d", in m_can_dev_setup()
1466 return -EINVAL; in m_can_dev_setup()
1469 if (!cdev->is_peripheral) in m_can_dev_setup()
1470 netif_napi_add(dev, &cdev->napi, m_can_poll); in m_can_dev_setup()
1473 cdev->version = m_can_version; in m_can_dev_setup()
1474 cdev->can.do_set_mode = m_can_set_mode; in m_can_dev_setup()
1475 cdev->can.do_get_berr_counter = m_can_get_berr_counter; in m_can_dev_setup()
1478 cdev->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK | in m_can_dev_setup()
1485 switch (cdev->version) { in m_can_dev_setup()
1491 cdev->can.bittiming_const = &m_can_bittiming_const_30X; in m_can_dev_setup()
1492 cdev->can.data_bittiming_const = &m_can_data_bittiming_const_30X; in m_can_dev_setup()
1499 cdev->can.bittiming_const = &m_can_bittiming_const_31X; in m_can_dev_setup()
1500 cdev->can.data_bittiming_const = &m_can_data_bittiming_const_31X; in m_can_dev_setup()
1505 cdev->can.bittiming_const = &m_can_bittiming_const_31X; in m_can_dev_setup()
1506 cdev->can.data_bittiming_const = &m_can_data_bittiming_const_31X; in m_can_dev_setup()
1508 cdev->can.ctrlmode_supported |= in m_can_dev_setup()
1513 dev_err(cdev->dev, "Unsupported version number: %2d", in m_can_dev_setup()
1514 cdev->version); in m_can_dev_setup()
1515 return -EINVAL; in m_can_dev_setup()
1518 if (cdev->ops->init) in m_can_dev_setup()
1519 cdev->ops->init(cdev); in m_can_dev_setup()
1535 cdev->can.state = CAN_STATE_STOPPED; in m_can_stop()
1544 if (!cdev->is_peripheral) in m_can_close()
1545 napi_disable(&cdev->napi); in m_can_close()
1549 free_irq(dev->irq, dev); in m_can_close()
1551 if (cdev->is_peripheral) { in m_can_close()
1552 cdev->tx_skb = NULL; in m_can_close()
1553 destroy_workqueue(cdev->tx_wq); in m_can_close()
1554 cdev->tx_wq = NULL; in m_can_close()
1557 if (cdev->is_peripheral) in m_can_close()
1558 can_rx_offload_disable(&cdev->offload); in m_can_close()
1562 phy_power_off(cdev->transceiver); in m_can_close()
1571 unsigned int wrap = cdev->can.echo_skb_max; in m_can_next_echo_skb_occupied()
1578 return !!cdev->can.echo_skb[next_idx]; in m_can_next_echo_skb_occupied()
1583 struct canfd_frame *cf = (struct canfd_frame *)cdev->tx_skb->data; in m_can_tx_handler()
1584 struct net_device *dev = cdev->net; in m_can_tx_handler()
1585 struct sk_buff *skb = cdev->tx_skb; in m_can_tx_handler()
1591 cdev->tx_skb = NULL; in m_can_tx_handler()
1595 if (cf->can_id & CAN_EFF_FLAG) { in m_can_tx_handler()
1596 fifo_header.id = cf->can_id & CAN_EFF_MASK; in m_can_tx_handler()
1599 fifo_header.id = ((cf->can_id & CAN_SFF_MASK) << 18); in m_can_tx_handler()
1602 if (cf->can_id & CAN_RTR_FLAG) in m_can_tx_handler()
1605 if (cdev->version == 30) { in m_can_tx_handler()
1608 fifo_header.dlc = can_fd_len2dlc(cf->len) << 16; in m_can_tx_handler()
1616 cf->data, DIV_ROUND_UP(cf->len, 4)); in m_can_tx_handler()
1620 if (cdev->can.ctrlmode & CAN_CTRLMODE_FD) { in m_can_tx_handler()
1624 if (cf->flags & CANFD_BRS) in m_can_tx_handler()
1651 if (cdev->is_peripheral) { in m_can_tx_handler()
1653 dev->stats.tx_dropped++; in m_can_tx_handler()
1664 /* Construct DLC Field, with CAN-FD configuration. in m_can_tx_handler()
1673 if (cf->flags & CANFD_BRS) in m_can_tx_handler()
1678 FIELD_PREP(TX_BUF_DLC_MASK, can_fd_len2dlc(cf->len)) | in m_can_tx_handler()
1685 cf->data, DIV_ROUND_UP(cf->len, 4)); in m_can_tx_handler()
1727 if (cdev->is_peripheral) { in m_can_start_xmit()
1728 if (cdev->tx_skb) { in m_can_start_xmit()
1733 if (cdev->can.state == CAN_STATE_BUS_OFF) { in m_can_start_xmit()
1741 cdev->tx_skb = skb; in m_can_start_xmit()
1742 netif_stop_queue(cdev->net); in m_can_start_xmit()
1743 queue_work(cdev->tx_wq, &cdev->tx_work); in m_can_start_xmit()
1746 cdev->tx_skb = skb; in m_can_start_xmit()
1758 err = phy_power_on(cdev->transceiver); in m_can_open()
1773 if (cdev->is_peripheral) in m_can_open()
1774 can_rx_offload_enable(&cdev->offload); in m_can_open()
1777 if (cdev->is_peripheral) { in m_can_open()
1778 cdev->tx_skb = NULL; in m_can_open()
1779 cdev->tx_wq = alloc_workqueue("mcan_wq", in m_can_open()
1781 if (!cdev->tx_wq) { in m_can_open()
1782 err = -ENOMEM; in m_can_open()
1786 INIT_WORK(&cdev->tx_work, m_can_tx_work_queue); in m_can_open()
1788 err = request_threaded_irq(dev->irq, NULL, m_can_isr, in m_can_open()
1790 dev->name, dev); in m_can_open()
1792 err = request_irq(dev->irq, m_can_isr, IRQF_SHARED, dev->name, in m_can_open()
1804 if (!cdev->is_peripheral) in m_can_open()
1805 napi_enable(&cdev->napi); in m_can_open()
1812 if (cdev->is_peripheral) in m_can_open()
1813 destroy_workqueue(cdev->tx_wq); in m_can_open()
1815 if (cdev->is_peripheral) in m_can_open()
1816 can_rx_offload_disable(&cdev->offload); in m_can_open()
1821 phy_power_off(cdev->transceiver); in m_can_open()
1838 dev->flags |= IFF_ECHO; /* we support local echo */ in register_m_can_dev()
1839 dev->netdev_ops = &m_can_netdev_ops; in register_m_can_dev()
1840 dev->ethtool_ops = &m_can_ethtool_ops; in register_m_can_dev()
1848 cdev->mcfg[MRAM_SIDF].off = mram_config_vals[0]; in m_can_of_parse_mram()
1849 cdev->mcfg[MRAM_SIDF].num = mram_config_vals[1]; in m_can_of_parse_mram()
1850 cdev->mcfg[MRAM_XIDF].off = cdev->mcfg[MRAM_SIDF].off + in m_can_of_parse_mram()
1851 cdev->mcfg[MRAM_SIDF].num * SIDF_ELEMENT_SIZE; in m_can_of_parse_mram()
1852 cdev->mcfg[MRAM_XIDF].num = mram_config_vals[2]; in m_can_of_parse_mram()
1853 cdev->mcfg[MRAM_RXF0].off = cdev->mcfg[MRAM_XIDF].off + in m_can_of_parse_mram()
1854 cdev->mcfg[MRAM_XIDF].num * XIDF_ELEMENT_SIZE; in m_can_of_parse_mram()
1855 cdev->mcfg[MRAM_RXF0].num = mram_config_vals[3] & in m_can_of_parse_mram()
1857 cdev->mcfg[MRAM_RXF1].off = cdev->mcfg[MRAM_RXF0].off + in m_can_of_parse_mram()
1858 cdev->mcfg[MRAM_RXF0].num * RXF0_ELEMENT_SIZE; in m_can_of_parse_mram()
1859 cdev->mcfg[MRAM_RXF1].num = mram_config_vals[4] & in m_can_of_parse_mram()
1861 cdev->mcfg[MRAM_RXB].off = cdev->mcfg[MRAM_RXF1].off + in m_can_of_parse_mram()
1862 cdev->mcfg[MRAM_RXF1].num * RXF1_ELEMENT_SIZE; in m_can_of_parse_mram()
1863 cdev->mcfg[MRAM_RXB].num = mram_config_vals[5]; in m_can_of_parse_mram()
1864 cdev->mcfg[MRAM_TXE].off = cdev->mcfg[MRAM_RXB].off + in m_can_of_parse_mram()
1865 cdev->mcfg[MRAM_RXB].num * RXB_ELEMENT_SIZE; in m_can_of_parse_mram()
1866 cdev->mcfg[MRAM_TXE].num = mram_config_vals[6]; in m_can_of_parse_mram()
1867 cdev->mcfg[MRAM_TXB].off = cdev->mcfg[MRAM_TXE].off + in m_can_of_parse_mram()
1868 cdev->mcfg[MRAM_TXE].num * TXE_ELEMENT_SIZE; in m_can_of_parse_mram()
1869 cdev->mcfg[MRAM_TXB].num = mram_config_vals[7] & in m_can_of_parse_mram()
1872 dev_dbg(cdev->dev, in m_can_of_parse_mram()
1874 cdev->mcfg[MRAM_SIDF].off, cdev->mcfg[MRAM_SIDF].num, in m_can_of_parse_mram()
1875 cdev->mcfg[MRAM_XIDF].off, cdev->mcfg[MRAM_XIDF].num, in m_can_of_parse_mram()
1876 cdev->mcfg[MRAM_RXF0].off, cdev->mcfg[MRAM_RXF0].num, in m_can_of_parse_mram()
1877 cdev->mcfg[MRAM_RXF1].off, cdev->mcfg[MRAM_RXF1].num, in m_can_of_parse_mram()
1878 cdev->mcfg[MRAM_RXB].off, cdev->mcfg[MRAM_RXB].num, in m_can_of_parse_mram()
1879 cdev->mcfg[MRAM_TXE].off, cdev->mcfg[MRAM_TXE].num, in m_can_of_parse_mram()
1880 cdev->mcfg[MRAM_TXB].off, cdev->mcfg[MRAM_TXB].num); in m_can_of_parse_mram()
1891 start = cdev->mcfg[MRAM_SIDF].off; in m_can_init_ram()
1892 end = cdev->mcfg[MRAM_TXB].off + in m_can_init_ram()
1893 cdev->mcfg[MRAM_TXB].num * TXB_ELEMENT_SIZE; in m_can_init_ram()
1909 cdev->hclk = devm_clk_get(cdev->dev, "hclk"); in m_can_class_get_clocks()
1910 cdev->cclk = devm_clk_get(cdev->dev, "cclk"); in m_can_class_get_clocks()
1912 if (IS_ERR(cdev->hclk) || IS_ERR(cdev->cclk)) { in m_can_class_get_clocks()
1913 dev_err(cdev->dev, "no clock found\n"); in m_can_class_get_clocks()
1914 ret = -ENODEV; in m_can_class_get_clocks()
1931 "bosch,mram-cfg", in m_can_class_allocate_dev()
1952 class_dev->net = net_dev; in m_can_class_allocate_dev()
1953 class_dev->dev = dev; in m_can_class_allocate_dev()
1972 if (cdev->pm_clock_support) { in m_can_class_register()
1978 if (cdev->is_peripheral) { in m_can_class_register()
1979 ret = can_rx_offload_add_manual(cdev->net, &cdev->offload, in m_can_class_register()
1989 ret = register_m_can_dev(cdev->net); in m_can_class_register()
1991 dev_err(cdev->dev, "registering %s failed (err=%d)\n", in m_can_class_register()
1992 cdev->net->name, ret); in m_can_class_register()
1996 of_can_transceiver(cdev->net); in m_can_class_register()
1998 dev_info(cdev->dev, "%s device registered (irq=%d, version=%d)\n", in m_can_class_register()
1999 KBUILD_MODNAME, cdev->net->irq, cdev->version); in m_can_class_register()
2009 if (cdev->is_peripheral) in m_can_class_register()
2010 can_rx_offload_del(&cdev->offload); in m_can_class_register()
2020 if (cdev->is_peripheral) in m_can_class_unregister()
2021 can_rx_offload_del(&cdev->offload); in m_can_class_unregister()
2022 unregister_candev(cdev->net); in m_can_class_unregister()
2029 struct net_device *ndev = cdev->net; in m_can_class_suspend()
2040 cdev->can.state = CAN_STATE_SLEEPING; in m_can_class_suspend()
2049 struct net_device *ndev = cdev->net; in m_can_class_resume()
2053 cdev->can.state = CAN_STATE_ERROR_ACTIVE; in m_can_class_resume()