Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json2dts zephyr: enhance it #2198

Merged
Prev Previous commit
Next Next commit
tools: json2dts_zephyr: only add CSR_DATA_WIDTH, when on non default …
…value

The default value of CONFIG_LITEX_CSR_DATA_WIDTH in zephyr is 32,
so only add it, if it is not 32.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
maass-hamburg committed Mar 5, 2025
commit cd8539876839f157b29bfe0caa005a8b5699d9cb
8 changes: 5 additions & 3 deletions litex/tools/litex_json2dts_zephyr.py
Original file line number Diff line number Diff line change
@@ -363,9 +363,11 @@ def generate_dts_config(csr):
if name not in overlay_handlers.keys():
print('No overlay handler for:', name, 'at', hex(value))

cnf += ' -DCONFIG_LITEX_CSR_DATA_WIDTH={}'.format(
csr['constants']['config_csr_data_width'],
)
# Default CSR data width in zephyr is 32 bits
if csr['constants']['config_csr_data_width'] != 32:
cnf += ' -DCONFIG_LITEX_CSR_DATA_WIDTH={}'.format(
csr['constants']['config_csr_data_width'],
)

return dts, cnf