...
  View open merge request
Commits (230)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{signal: [
{name: 'CAN frame field', wave: '53..........45', data: ['SOF', 'Base Identifier', 'SRR', 'IDE'], node: '.......'},
{name: 'Control counter value', wave: 'x===========x.', data: ['10', '9','8','7','6','5','4','3','2','1','0'], node: '.......'},
],
//edge:['a<->b', 'c<->d', 'e~>f Destuff', 'f~>g Process', 'g~>i Stuff'],
}
{signal: [
{name: 'System clock', wave: 'p..|...', period: 2},
{name: 'Port A Address', wave: 'x.3.x..|......', data: [1]},
{name: 'Port A Data (write)', wave: 'x.3.x..|......', data: ['AA55AA55']},
{name: 'Port A Write', wave: '0.1.0..|......'},
{name: 'Memory content', wave: 'x...2..|......', data: ['AA55AA55']},
{name: 'Port B Address', wave: 'x......|5.x...', data: [1]},
{name: 'Port B Data (read)', wave: 'x......|..5.x.', data: ['AA55AA55']}
]}
{signal: [
{name: 'System clock', wave: 'p..|...', period: 2},
{name: 'Port A Address', wave: 'x.3.x..|......', data: [1]},
{name: 'Port A Data (write)', wave: 'x.3.x..|......', data: ['AA55AA55']},
{name: 'Port A Write', wave: '0.1.0..|......'},
{name: 'Memory content', wave: 'x...2..|......', data: ['AA55AA55']},
{name: 'Port B Address', wave: 'x......|5.x...', data: [1]},
{name: 'Port B Data (read)', wave: 'x......|..5.x.', data: ['AA55AA55']}
]}
{signal: [
{name: 'CAN Bus', wave: '13..4.1.3..4.1.3..4.1.', data: ['CAN frame', 'Error frame', 'CAN frame', 'Error frame', 'CAN frame', 'Error frame'], node: '.......'},
{name: 'Retransmitt counter', wave: '=...=......=......=...', data: ['0', '1', '2', '0'], node: '.......'},
{name: 'Retransmitt limit', wave: '=.....................', data: ['2'], node: '.......'},
{name: 'Transmission type', wave: 'x=....x.=....x.=....x.', data: ['Initial transmission', 'First re-transmission', 'Second re-transmission'], node: '.......'},
{name: 'Operational state', wave: '=5....=.5....=.5....=.', data: ['Idle', 'Transmitter', 'Idle', 'Transmitter', 'Idle', 'Transmitter', 'Idle'], node: '.......'},
{name: 'TXT Buffer state', wave: '=4..=...4..=...4..=...', data: ['Ready', 'TX in Progress', 'Ready', 'TX in Progress', 'Ready', 'TX in Progress','TX Error'], node: '.......'},
],
//edge:['a<->b', 'c<->d', 'e~>f Destuff', 'f~>g Process', 'g~>i Stuff'],
}
{signal: [
{name: 'System clock', wave: '0...p.........', data: [''],
node: '..............'},
{name: 'External reset', wave: '101...........', data: [''], phase: -0.1,
node: '.ac...........'},
{name: 'Soft reset', wave: '0.........10..', data: [''],
node: '..........eg..'},
{name: 'System reset', wave: '01...0.....10.', data: [''], phase: -0.1,
node: '.b...d.....fh.'},
{name: '', node: '..............'},
],
edge:['a->b Assert', 'c~>d De-assert', 'e~>f Assert', 'g~>h De-assert'],
}
{signal: [
{name: 'CAN Bus', wave: '13..4.1.3...4.1.3....1.', data: ['CAN frame', 'Error frame', 'CAN frame', 'Error frame', 'CAN frame'], node: '.......'},
{name: 'Retransmitt counter', wave: '=...=.......=........=.', data: ['0', '1', '2', '0'], node: '.......'},
{name: 'Retransmitt limit', wave: '=......................', data: ['2'], node: '.......'},
{name: 'Transmission type', wave: 'x=....x.=.....x.=....x.', data: ['Initial transmission', 'First re-transmission', 'Second re-transmission'], node: '.......'},
{name: 'Operational state', wave: '=5....=.5.....=.5....=.', data: ['Idle', 'Transmitter', 'Idle', 'Transmitter', 'Idle', 'Transmitter', 'Idle'], node: '.......'},
{name: 'TXT Buffer state', wave: '=4..=...4...=...4....=.', data: ['Ready', 'TX in Progress', 'Ready', 'TX in Progress', 'Ready', 'TX in Progress','TX OK'], node: '.......'},
],
//edge:['a<->b', 'c<->d', 'e~>f Destuff', 'f~>g Process', 'g~>i Stuff'],
}
{signal: [
{name: 'CAN Bus', wave: '13..4.1.3..4.1.3..4.1.', data: ['CAN frame', 'Error frame', 'CAN frame', 'Error frame', 'CAN frame', 'Error frame'], node: '.......'},
{name: 'Retransmitt counter', wave: '=...=......=......=...', data: ['0', '1', '2', '0'], node: '.......'},
{name: 'Retransmitt limit', wave: '=.....................', data: ['2'], node: '.......'},
{name: 'Transmission type', wave: 'x=....x.=....x.=....x.', data: ['Initial transmission', 'First re-transmission', 'Second re-transmission'], node: '.......'},
{name: 'Operational state', wave: '=5....=.5....=.5....=.', data: ['Idle', 'Transmitter', 'Idle', 'Transmitter', 'Idle', 'Transmitter', 'Idle'], node: '.......'},
{name: 'TXT Buffer state', wave: '=4..=...4..=...4..=...', data: ['Ready', 'TX in Progress', 'Ready', 'TX in Progress', 'Ready', 'TX in Progress','TX Error'], node: '.......'},
],
//edge:['a<->b', 'c<->d', 'e~>f Destuff', 'f~>g Process', 'g~>i Stuff'],
}
{signal: [
{name: 'CAN Bus', wave: '13..4.1.3...4.1.3..4.1.', data: ['CAN frame', 'Error frame', 'CAN frame', 'Error frame', 'CAN frame', 'Error frame'], node: '.......'},
{name: 'Retransmitt counter', wave: '=...=......=.......=...', data: ['0', '1', '2', '0'], node: '.......'},
{name: 'Retransmitt limit', wave: '=......................', data: ['2'], node: '.......'},
{name: 'Arbitration lost', wave: '0..........10..........', data: ['2'], node: '.......'},
{name: 'Transmission type', wave: 'x=....x.=.....x.=....x.', data: ['Initial transmission', 'First re-transmission', 'Second re-transmission'], node: '.......'},
{name: 'Operational state', wave: '=5....=.5..3..=.5....=.', data: ['Idle', 'Transmitter', 'Idle', 'Transmitter', 'Receiver', 'Idle', 'Transmitter', 'Idle'], node: '.......'},
{name: 'TXT Buffer state', wave: '=4..=...4..=....4..=...', data: ['Ready', 'TX in Progress', 'Ready', 'TX in Progress', 'Ready', 'TX in Progress','TX Error'], node: '.......'},
],
//edge:['a<->b', 'c<->d', 'e~>f Destuff', 'f~>g Process', 'g~>i Stuff'],
}
This diff is collapsed.
......@@ -179,9 +179,13 @@ void ctu_can_fd_set_mode_reg(struct ctucanfd_priv *priv,
reg.s.lom = flags & CAN_CTRLMODE_LISTENONLY ?
LOM_ENABLED : LOM_DISABLED;
#ifdef CTUCANFD_TSM_AVAILABLE
if (mode->mask & CAN_CTRLMODE_3_SAMPLES)
reg.s.tsm = flags & CAN_CTRLMODE_3_SAMPLES ?
TSM_ENABLE : TSM_DISABLE;
#else
#warning TSM_ENABLE not defined
#endif
if (mode->mask & CAN_CTRLMODE_FD)
reg.s.fde = flags & CAN_CTRLMODE_FD ?
......@@ -223,7 +227,11 @@ void ctu_can_fd_abort_tx(struct ctucanfd_priv *priv)
union ctu_can_fd_command reg;
reg.u32 = 0;
#ifdef CTUCANFD_ABT_AVAILABLE
reg.s.abt = 1;
#else
#warning abt not available
#endif
priv->write_reg(priv, CTU_CAN_FD_COMMAND, reg.u32);
}
......
......@@ -106,8 +106,8 @@
// RX Buffer data overrun interrupt
#define CTU_CAN_FD_OVERRUN_INT(int_stat) (!!(int_stat).s.doi)
// Core turned error passive interrupt
#define CTU_CAN_FD_ERR_PASSIVE_INT(int_stat) (!!(int_stat).s.epi)
// Fault confinement changed interrupt
#define CTU_CAN_FD_FAULT_STATE_CHANGED_INT(int_stat) (!!(int_stat).s.fcsi)
// Error frame transmission started interrupt
#define CTU_CAN_FD_BUS_ERROR_INT(int_stat) (!!(int_stat).s.bei)
......@@ -129,7 +129,7 @@
static inline bool CTU_CAN_FD_INT_ERROR(union ctu_can_fd_int_stat i)
{
return i.s.ewli || i.s.doi || i.s.epi || i.s.ali;
return i.s.ewli || i.s.doi || i.s.fcsi || i.s.ali;
}
struct ctucanfd_priv;
......@@ -370,6 +370,32 @@ void ctu_can_fd_int_ena(struct ctucanfd_priv *priv,
union ctu_can_fd_int_stat mask,
union ctu_can_fd_int_stat val);
/*
* Mask interrupts of CTU CAN FD Core.
*
* Arguments:
* priv Private info
* mask Mask of interrupts which should be masked.
*/
static inline void ctu_can_fd_int_mask_set(struct ctucanfd_priv *priv,
union ctu_can_fd_int_stat mask)
{
priv->write_reg(priv, CTU_CAN_FD_INT_MASK_SET, mask.u32);
}
/*
* Unmask interrupts of CTU CAN FD Core.
*
* Arguments:
* priv Private info
* mask Mask of interrupts which should be unmasked.
*/
static inline void ctu_can_fd_int_mask_clr(struct ctucanfd_priv *priv,
union ctu_can_fd_int_stat mask)
{
priv->write_reg(priv, CTU_CAN_FD_INT_MASK_CLR, mask.u32);
}
/*
* Mask/Unmask interrupts of CTU CAN FD Core.
*
......@@ -540,6 +566,22 @@ enum can_state ctu_can_fd_read_error_state(struct ctucanfd_priv *priv);
void ctu_can_fd_set_err_ctrs(struct ctucanfd_priv *priv,
const struct can_berr_counter *ctr);
/*
* Read core captured last error or arbitration lost reason.
*
* Arguments:
* priv Private info
* Returns:
* Error state of the CTU CAN FD.
*/
static inline union ctu_can_fd_err_capt_alc
ctu_can_fd_read_err_capt_alc(struct ctucanfd_priv *priv)
{
union ctu_can_fd_err_capt_alc res;
res.u32 = priv->read_reg(priv, CTU_CAN_FD_ERR_CAPT);
return res;
}
/*
* Check Mask filters support of given filter.
*
......
This diff is collapsed.
This diff is collapsed.
......@@ -144,11 +144,11 @@ int main(int argc, char *argv[])
apb_read(CTU_CAN_FD_DEVICE_ID);
CHECK(0x0201CAFD, "CAN ID reg mismatch (just after HW reset)");
CHECK(0x0202CAFD, "CAN ID reg mismatch (just after HW reset)");
apb_write(CTU_CAN_FD_BTR, 0xFFFFFFFF, 0b1111);
apb_read(CTU_CAN_FD_DEVICE_ID);
CHECK(0x0201CAFD, "CAN ID reg mismatch");
CHECK(0x0202CAFD, "CAN ID reg mismatch");
apb_read(CTU_CAN_FD_BTR);
CHECK(0xFFFFFFFF, "readback mismatch");
......
This diff is collapsed.
This diff is collapsed.
********************************************************************************
** Generating Lyx docs for VHDL entity interfaces!
********************************************************************************
Python version is: python3.6
********************************************************************************
Processing prescaler entity
********************************************************************************
../doc/template.lyx
Subproject commit 4e78535d62f76ae5a0b91819ab6cbb914cba4662
Subproject commit a4ff72245f8cf381719b3bdc6517007444274e0a
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -166,7 +166,7 @@ package can_fd_frame_format is
------------------------------------------------------------------------------
-- IDENTIFIER_W register
--
-- CAN Identifier
-- CAN Identifier.
------------------------------------------------------------------------------
constant IDENTIFIER_EXT_L : natural := 0;
constant IDENTIFIER_EXT_H : natural := 17;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.