carrier_csr.h 4.42 KB
Newer Older
1 2 3 4 5
/*
  Register definitions for slave core: Carrier control and status registers

  * File           : carrier_csr.h
  * Author         : auto-generated by wbgen2 from carrier_csr.wb
6
  * Created        : Tue Jan 14 11:45:49 2014
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
  * Standard       : ANSI C

    THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE carrier_csr.wb
    DO NOT HAND-EDIT UNLESS IT'S ABSOLUTELY NECESSARY!

*/

#ifndef __WBGEN2_REGDEFS_CARRIER_CSR_WB
#define __WBGEN2_REGDEFS_CARRIER_CSR_WB

#include <inttypes.h>

#if defined( __GNUC__)
#define PACKED __attribute__ ((packed))
#else
#error "Unsupported compiler?"
#endif

#ifndef __WBGEN2_MACROS_DEFINED__
#define __WBGEN2_MACROS_DEFINED__
#define WBGEN2_GEN_MASK(offset, size) (((1<<(size))-1) << (offset))
#define WBGEN2_GEN_WRITE(value, offset, size) (((value) & ((1<<(size))-1)) << (offset))
#define WBGEN2_GEN_READ(reg, offset, size) (((reg) >> (offset)) & ((1<<(size))-1))
#define WBGEN2_SIGN_EXTEND(value, bits) (((value) & (1<<bits) ? ~((1<<(bits))-1): 0 ) | (value))
#endif


/* definitions for register: Carrier type and PCB version */

/* definitions for field: PCB revision in reg: Carrier type and PCB version */
#define CARRIER_CSR_CARRIER_PCB_REV_MASK      WBGEN2_GEN_MASK(0, 4)
#define CARRIER_CSR_CARRIER_PCB_REV_SHIFT     0
#define CARRIER_CSR_CARRIER_PCB_REV_W(value)  WBGEN2_GEN_WRITE(value, 0, 4)
#define CARRIER_CSR_CARRIER_PCB_REV_R(reg)    WBGEN2_GEN_READ(reg, 0, 4)

42 43 44 45 46
/* definitions for field: Reserved register in reg: Carrier type and PCB version */
#define CARRIER_CSR_CARRIER_RESERVED_MASK     WBGEN2_GEN_MASK(4, 12)
#define CARRIER_CSR_CARRIER_RESERVED_SHIFT    4
#define CARRIER_CSR_CARRIER_RESERVED_W(value) WBGEN2_GEN_WRITE(value, 4, 12)
#define CARRIER_CSR_CARRIER_RESERVED_R(reg)   WBGEN2_GEN_READ(reg, 4, 12)
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

/* definitions for field: Carrier type in reg: Carrier type and PCB version */
#define CARRIER_CSR_CARRIER_TYPE_MASK         WBGEN2_GEN_MASK(16, 16)
#define CARRIER_CSR_CARRIER_TYPE_SHIFT        16
#define CARRIER_CSR_CARRIER_TYPE_W(value)     WBGEN2_GEN_WRITE(value, 16, 16)
#define CARRIER_CSR_CARRIER_TYPE_R(reg)       WBGEN2_GEN_READ(reg, 16, 16)

/* definitions for register: Status */

/* definitions for field: FMC presence in reg: Status */
#define CARRIER_CSR_STAT_FMC_PRES             WBGEN2_GEN_MASK(0, 1)

/* definitions for field: GN4142 core P2L PLL status in reg: Status */
#define CARRIER_CSR_STAT_P2L_PLL_LCK          WBGEN2_GEN_MASK(1, 1)

/* definitions for field: System clock PLL status in reg: Status */
#define CARRIER_CSR_STAT_SYS_PLL_LCK          WBGEN2_GEN_MASK(2, 1)

/* definitions for field: DDR3 calibration status in reg: Status */
#define CARRIER_CSR_STAT_DDR3_CAL_DONE        WBGEN2_GEN_MASK(3, 1)

68 69 70 71 72 73
/* definitions for field: Reserved in reg: Status */
#define CARRIER_CSR_STAT_RESERVED_MASK        WBGEN2_GEN_MASK(4, 28)
#define CARRIER_CSR_STAT_RESERVED_SHIFT       4
#define CARRIER_CSR_STAT_RESERVED_W(value)    WBGEN2_GEN_WRITE(value, 4, 28)
#define CARRIER_CSR_STAT_RESERVED_R(reg)      WBGEN2_GEN_READ(reg, 4, 28)

74 75 76 77 78 79 80 81 82 83 84
/* definitions for register: Control */

/* definitions for field: Green LED in reg: Control */
#define CARRIER_CSR_CTRL_LED_GREEN            WBGEN2_GEN_MASK(0, 1)

/* definitions for field: Red LED in reg: Control */
#define CARRIER_CSR_CTRL_LED_RED              WBGEN2_GEN_MASK(1, 1)

/* definitions for field: DAC clear in reg: Control */
#define CARRIER_CSR_CTRL_DAC_CLR_N            WBGEN2_GEN_MASK(2, 1)

85 86 87 88 89 90
/* definitions for field: Reserved in reg: Control */
#define CARRIER_CSR_CTRL_RESERVED_MASK        WBGEN2_GEN_MASK(3, 29)
#define CARRIER_CSR_CTRL_RESERVED_SHIFT       3
#define CARRIER_CSR_CTRL_RESERVED_W(value)    WBGEN2_GEN_WRITE(value, 3, 29)
#define CARRIER_CSR_CTRL_RESERVED_R(reg)      WBGEN2_GEN_READ(reg, 3, 29)

91 92 93
/* definitions for register: Reset Register */

/* definitions for field: State of the reset line in reg: Reset Register */
94
#define CARRIER_CSR_RST_FMC0_N                WBGEN2_GEN_MASK(0, 1)
95 96

/* definitions for field: Reserved in reg: Reset Register */
97
#define CARRIER_CSR_RST_RESERVED_MASK         WBGEN2_GEN_MASK(1, 31)
98
#define CARRIER_CSR_RST_RESERVED_SHIFT        1
99 100
#define CARRIER_CSR_RST_RESERVED_W(value)     WBGEN2_GEN_WRITE(value, 1, 31)
#define CARRIER_CSR_RST_RESERVED_R(reg)       WBGEN2_GEN_READ(reg, 1, 31)
101

102 103 104
PACKED struct CARRIER_CSR_WB {
  /* [0x0]: REG Carrier type and PCB version */
  uint32_t CARRIER;
105
  /* [0x4]: REG Status */
106
  uint32_t STAT;
107
  /* [0x8]: REG Control */
108
  uint32_t CTRL;
109 110
  /* [0xc]: REG Reset Register */
  uint32_t RST;
111 112 113
};

#endif