Commit 8731fd2f authored by Andrey Filippov's avatar Andrey Filippov

Corrected address offsets

parent c6586f9e
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "elphel/x393_types.h" #include "elphel/x393_types.h"
//#include "elphel/x393_defs.h // alternative variant" //#include "elphel/x393_defs.h // alternative variant"
// See elphel/x393_map.h for the ordered list of all I/O register addresses used
// init_mmio_ptr() should be called once before using any of the other declared functions // init_mmio_ptr() should be called once before using any of the other declared functions
int init_mmio_ptr(void); int init_mmio_ptr(void);
......
...@@ -127,6 +127,7 @@ class X393ExportC(object): ...@@ -127,6 +127,7 @@ class X393ExportC(object):
# Includes section # Includes section
txt = '\n#include "elphel/x393_types.h"\n' txt = '\n#include "elphel/x393_types.h"\n'
txt +='//#include "elphel/x393_defs.h // alternative variant"\n\n' txt +='//#include "elphel/x393_defs.h // alternative variant"\n\n'
txt +='// See elphel/x393_map.h for the ordered list of all I/O register addresses used\n'
txt += '// init_mmio_ptr() should be called once before using any of the other declared functions\n\n' txt += '// init_mmio_ptr() should be called once before using any of the other declared functions\n\n'
txt += 'int init_mmio_ptr(void);\n' txt += 'int init_mmio_ptr(void);\n'
...@@ -1193,7 +1194,7 @@ class X393ExportC(object): ...@@ -1193,7 +1194,7 @@ class X393ExportC(object):
elif (mode =='func_def'): elif (mode =='func_def'):
return self.func_define (define_tuple = (name, return self.func_define (define_tuple = (name,
var_name, var_name,
address * 4 + self.MAXI0_BASE, address * 4, # + self.MAXI0_BASE,
address_inc * 4, address_inc * 4,
var_range, var_range,
data_type, data_type,
...@@ -1287,7 +1288,7 @@ class X393ExportC(object): ...@@ -1287,7 +1288,7 @@ class X393ExportC(object):
s+='{ %s d; %s = readl(mmio_ptr + '%(data_type, td) s+='{ %s d; %s = readl(mmio_ptr + '%(data_type, td)
if address_inc: if address_inc:
s+='(0x%08x'%(address) s+='(0x%04x'%(address)
if multivar: if multivar:
for vn, vi in zip (var_name, address_inc): for vn, vi in zip (var_name, address_inc):
s+=' + 0x%x * %s'%(vi, vn.lower()) s+=' + 0x%x * %s'%(vi, vn.lower())
...@@ -1295,7 +1296,7 @@ class X393ExportC(object): ...@@ -1295,7 +1296,7 @@ class X393ExportC(object):
s+=' + 0x%x * %s'%(address_inc, arg) s+=' + 0x%x * %s'%(address_inc, arg)
s += ')' s += ')'
else: else:
s+='0x%08x'%(address) s+='0x%04x'%(address)
s+='); return d; }' s+='); return d; }'
else: else:
s += ';' s += ';'
...@@ -1342,7 +1343,7 @@ class X393ExportC(object): ...@@ -1342,7 +1343,7 @@ class X393ExportC(object):
td='d' td='d'
s+='{writel(%s, mmio_ptr + '%(td) s+='{writel(%s, mmio_ptr + '%(td)
if address_inc: if address_inc:
s+='(0x%08x'%(address) s+='(0x%04x'%(address)
if multivar: if multivar:
for vn, vi in zip (var_name, address_inc): for vn, vi in zip (var_name, address_inc):
s+=' + 0x%x * %s'%(vi, vn.lower()) s+=' + 0x%x * %s'%(vi, vn.lower())
...@@ -1350,7 +1351,7 @@ class X393ExportC(object): ...@@ -1350,7 +1351,7 @@ class X393ExportC(object):
s+=' + 0x%x * %s'%(address_inc, arg) s+=' + 0x%x * %s'%(address_inc, arg)
s += ')' s += ')'
else: else:
s+='0x%08x'%(address) s+='0x%04x'%(address)
s+=');}' s+=');}'
else: else:
s += ';' s += ';'
...@@ -1388,7 +1389,7 @@ class X393ExportC(object): ...@@ -1388,7 +1389,7 @@ class X393ExportC(object):
# s+='{' # s+='{'
s+='{writel(0, mmio_ptr + ' s+='{writel(0, mmio_ptr + '
if address_inc: if address_inc:
s+='(0x%08x'%(address) s+='(0x%04x'%(address)
if multivar: if multivar:
for vn, vi in zip (var_name, address_inc): for vn, vi in zip (var_name, address_inc):
s+=' + 0x%x * %s'%(vi, vn.lower()) s+=' + 0x%x * %s'%(vi, vn.lower())
...@@ -1396,7 +1397,7 @@ class X393ExportC(object): ...@@ -1396,7 +1397,7 @@ class X393ExportC(object):
s+=' + 0x%x * %s'%(address_inc, arg) s+=' + 0x%x * %s'%(address_inc, arg)
s += ')' s += ')'
else: else:
s+='0x%08x'%(address) s+='0x%04x'%(address)
s+=');}' s+=');}'
else: else:
s += ';' s += ';'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment