Changeset 0743eae in rtems
- Timestamp:
- Oct 11, 2007, 12:56:09 PM (14 years ago)
- Branches:
- 4.10, 4.11, 4.9, 5, master
- Children:
- 053c2f4
- Parents:
- 8a781ad7
- Location:
- c/src/lib/libbsp/sparc
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/sparc/ChangeLog
r8a781ad7 r0743eae 1 2007-10-11 Daniel Hellstrom <daniel@gaisler.com> 2 3 * Makefile.am, shared/can/occan.c, shared/include/ambapp.h: Add initial 4 i2c and update OC-CAN support. 5 * shared/i2c/i2cmst.c, shared/include/i2cmst.h: New files. 6 1 7 2007-09-21 Daniel Hellstrom <daniel@gaisler.com> 2 8 -
c/src/lib/libbsp/sparc/Makefile.am
r8a781ad7 r0743eae 60 60 EXTRA_DIST += shared/include/b1553brm_rasta.h 61 61 62 # I2C-master (I2CMST) 63 EXTRA_DIST += shared/i2c/i2cmst.c 64 EXTRA_DIST += shared/include/i2cmst.h 65 62 66 include $(top_srcdir)/../../../automake/subdirs.am 63 67 include $(top_srcdir)/../../../automake/local.am -
c/src/lib/libbsp/sparc/shared/can/occan.c
r8a781ad7 r0743eae 199 199 #endif 200 200 201 #define MAX_TSEG 17202 #define MAX_TSEG 215201 #define MAX_TSEG2 7 202 #define MAX_TSEG1 15 203 203 204 204 #if 0 … … 729 729 #endif 730 730 731 /* This function calculates BTR0 BTR1 values for a given bitrate. 732 * Heavily based on mgt_mscan_bitrate() from peak driver, which 733 * in turn is based on work by Arnaud Westenberg. 731 /* This function calculates BTR0 and BTR1 values for a given bitrate. 734 732 * 735 733 * Set communication parameters. 736 * baud rate in Hz 737 * input clock frequency of can core in Hz (system frequency) 738 * sjw synchronization jump width (0-3) prescaled clock cycles 739 * sampl_pt sample point in % (0-100) sets (TSEG1+2)/(TSEG1+TSEG2+3) 740 * ratio 734 * \param clock_hz OC_CAN Core frequency in Hz. 735 * \param rate Requested baud rate in bits/second. 736 * \param result Pointer to where resulting BTRs will be stored. 737 * \return zero if successful to calculate a baud rate. 741 738 */ 742 739 static int occan_calc_speedregs(unsigned int clock_hz, unsigned int rate, occan_speed_regs *result){ … … 749 746 int sampl_pt = 90; 750 747 751 if ( (rate< 10000) || (rate>1000000) ){748 if ( (rate<5000) || (rate>1000000) ){ 752 749 /* invalid speed mode */ 753 750 return -1; … … 817 814 tseg2 = best_tseg - tseg1 - 2; 818 815 } 819 /* 820 result->sjw = sjw; 821 result->brp = best_brp; 822 result->tseg1 = tseg1; 823 result->tseg2 = tseg2; 824 */ 816 825 817 result->btr0 = (sjw<<OCCAN_BUSTIM_SJW_BIT) | (best_brp&OCCAN_BUSTIM_BRP); 826 818 result->btr1 = (0<<7) | (tseg2<<OCCAN_BUSTIM_TSEG2_BIT) | tseg1; … … 835 827 priv->regs->bustim0 = timing->btr0; 836 828 priv->regs->bustim1 = timing->btr1; 837 /*838 priv->regs->bustim0 = (timing->sjw<<OCCAN_BUSTIM_SJW_BIT) | (timing->brp&OCCAN_BUSTIM_BRP);839 priv->regs->bustim1 = (timing->sam<<7) | (timing->tseg2<<OCCAN_BUSTIM_TSEG2_BIT) | timing->tseg1;840 */841 829 return 0; 842 830 } -
c/src/lib/libbsp/sparc/shared/include/ambapp.h
r8a781ad7 r0743eae 59 59 #define GAISLER_SPACEWIRE 0x1f 60 60 #define GAISLER_AHB2AHB 0x20 61 #define GAISLER_I2CMST 0x28 62 #define GAISLER_GRSPW2 0x29 61 63 #define GAISLER_GRHCAN 0x34 62 64 #define GAISLER_GRFIFO 0x35
Note: See TracChangeset
for help on using the changeset viewer.