#ifndef __CHEBY__APP_URV_REGS__H__
#define __CHEBY__APP_URV_REGS__H__

#include "mbox_regs.h"
#define APP_URV_REGS_SIZE 2144 /* 0x860 */

/* shared memory between mgmt and app cpus */
#define APP_URV_REGS_SH_MEM 0x0UL
#define ADDR_MASK_APP_URV_REGS_SH_MEM 0x800UL
#define APP_URV_REGS_SH_MEM_SIZE 2048 /* 0x800 = 2KB */

/* None */
#define APP_URV_REGS_MAILBOXES 0x800UL
#define ADDR_MASK_APP_URV_REGS_MAILBOXES 0xff0UL
#define APP_URV_REGS_MAILBOXES_SIZE 16 /* 0x10 */

/* presence lines for boards */
#define APP_URV_REGS_PRESENCE 0x810UL
#define APP_URV_REGS_PRESENCE_EN_MASK 0xffUL
#define APP_URV_REGS_PRESENCE_EN_SHIFT 0

/* None */
#define APP_URV_REGS_LOOPS 0x820UL
#define APP_URV_REGS_LOOPS_SIZE 4 /* 0x4 */

/* None */
#define APP_URV_REGS_LOOPS_PINS 0x0UL

/* None */
#define APP_URV_REGS_RELAYS 0x840UL
#define APP_URV_REGS_RELAYS_SIZE 4 /* 0x4 */

/* None */
#define APP_URV_REGS_RELAYS_PINS 0x0UL

#ifndef __ASSEMBLER__
struct app_urv_regs {
  /* [0x0]: SUBMAP shared memory between mgmt and app cpus */
  uint32_t sh_mem[512];

  /* [0x800]: SUBMAP (no description) */
  struct mbox_regs mailboxes;

  /* padding to: 516 words */
  uint32_t __padding_0[1];

  /* [0x810]: REG (ro) presence lines for boards */
  uint32_t presence;

  /* padding to: 520 words */
  uint32_t __padding_1[3];

  /* [0x820]: REPEAT (no description) */
  struct loops {
    /* [0x0]: REG (ro) (no description) */
    uint32_t pins;
  } loops[8];

  /* [0x840]: REPEAT (no description) */
  struct relays {
    /* [0x0]: REG (rw) (no description) */
    uint32_t pins;
  } relays[8];
};
#endif /* !__ASSEMBLER__*/

#endif /* __CHEBY__APP_URV_REGS__H__ */
