Skip to content

Commit

Permalink
Fix bit offset of INCREMENT fields
Browse files Browse the repository at this point in the history
  • Loading branch information
zeldin committed Apr 14, 2018
1 parent 064b61e commit 5393626
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions rdb/generator/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
field_name_fixups = {
'OTG_CTRL': {'11': ('B_SESS_VALID', 'B_END_SESS')},
}
field_bits_fixups = {
'GPIF_ADDR_COUNT_CONFIG': {'INCREMENT': ('7:0', '15:8')},
'GPIF_DATA_COUNT_CONFIG': {'INCREMENT': ('7:0', '15:8')},
}

class Register:
rdb_prefix='FX3_'
Expand Down Expand Up @@ -123,6 +127,12 @@ def print_field_defs(self, file):
name[0] = fixup[1]
except KeyError:
pass
try:
fixup = field_bits_fixups[self.name][name[0]]
if field[0] == fixup[0]:
bits = fixup[1].split(':')
except KeyError:
pass
if len(bits) == 1 and len(name) == 2 and (name[0] == 'EN_GPIO' or name[0] == 'EV_GPIO' or name[0] == 'POL_GPIO'):
name = [name[0]+'_'+name[1].split(']')[0]]
pad_size = self.pad_size_field
Expand Down
8 changes: 4 additions & 4 deletions rdb/gpif.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@
#define FX3_GPIF_CTRL_COUNT_LIMIT_LIMIT_BITS 16
#define FX3_GPIF_CTRL_COUNT_LIMIT_LIMIT_MASK (0xffffUL << 0)

#define FX3_GPIF_ADDR_COUNT_CONFIG_INCREMENT_SHIFT 0
#define FX3_GPIF_ADDR_COUNT_CONFIG_INCREMENT_SHIFT 8
#define FX3_GPIF_ADDR_COUNT_CONFIG_INCREMENT_BITS 8
#define FX3_GPIF_ADDR_COUNT_CONFIG_INCREMENT_MASK (0xffUL << 0)
#define FX3_GPIF_ADDR_COUNT_CONFIG_INCREMENT_MASK (0xffUL << 8)
#define FX3_GPIF_ADDR_COUNT_CONFIG_DOWN_UP (1UL << 3)
#define FX3_GPIF_ADDR_COUNT_CONFIG_SW_RESET (1UL << 2)
#define FX3_GPIF_ADDR_COUNT_CONFIG_RELOAD (1UL << 1)
Expand All @@ -260,9 +260,9 @@
#define FX3_GPIF_STATE_COUNT_LIMIT_LIMIT_BITS 16
#define FX3_GPIF_STATE_COUNT_LIMIT_LIMIT_MASK (0xffffUL << 0)

#define FX3_GPIF_DATA_COUNT_CONFIG_INCREMENT_SHIFT 0
#define FX3_GPIF_DATA_COUNT_CONFIG_INCREMENT_SHIFT 8
#define FX3_GPIF_DATA_COUNT_CONFIG_INCREMENT_BITS 8
#define FX3_GPIF_DATA_COUNT_CONFIG_INCREMENT_MASK (0xffUL << 0)
#define FX3_GPIF_DATA_COUNT_CONFIG_INCREMENT_MASK (0xffUL << 8)
#define FX3_GPIF_DATA_COUNT_CONFIG_DOWN_UP (1UL << 3)
#define FX3_GPIF_DATA_COUNT_CONFIG_SW_RESET (1UL << 2)
#define FX3_GPIF_DATA_COUNT_CONFIG_RELOAD (1UL << 1)
Expand Down

0 comments on commit 5393626

Please sign in to comment.