Merge pull request #2044 from VOGL-electronic/json2dts_zephyr_omit_disabled_handler

json2dts_zephyr: omit disable handler
This commit is contained in:
enjoy-digital 2024-08-20 14:29:35 +02:00 committed by GitHub
commit b7605bc633
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 3 deletions

View File

@ -273,26 +273,31 @@ overlay_handlers = {
'handler': peripheral_handler,
'alias': 'sdcard_block2mem',
'size': 0x18,
'disable_handler': False,
},
'sdcard_core': {
'handler': peripheral_handler,
'alias': 'sdcard_core',
'size': 0x2C,
'disable_handler': False,
},
'sdcard_irq': {
'handler': peripheral_handler,
'alias': 'sdcard_irq',
'size': 0x0C,
'disable_handler': False,
},
'sdcard_mem2block': {
'handler': peripheral_handler,
'alias': 'sdcard_mem2block',
'size': 0x18,
'disable_handler': False,
},
'sdcard_phy': {
'handler': peripheral_handler,
'alias': 'sdcard_phy',
'size': 0x10,
'disable_handler': False,
},
'i2c0' : {
'handler': i2c_handler,
@ -333,9 +338,13 @@ def generate_dts_config(csr):
try:
dtsi += parm['handler'](name, parm, csr)
except KeyError as e:
print(' dtsi key', e, 'not found, disable', name)
enable = 'n'
if parm.get('disable_handler', True):
print(' dtsi key', e, 'not found, disable', name)
dtsi += disabled_handler(name, parm, csr)
else:
print(' dtsi key', e, 'not found, skip', name)
continue
dtsi += dts_close()
dts += dtsi