From fcf9b3b335b5cbf04032103ab54e57b30beee4fa Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 13 Jun 2024 09:55:19 +0200 Subject: [PATCH] litex_json2dts_linux: Use new byte size definition from litex.gen.common. --- litex/tools/litex_json2dts_linux.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/litex/tools/litex_json2dts_linux.py b/litex/tools/litex_json2dts_linux.py index 4ddb61cc2..3d96bed5d 100755 --- a/litex/tools/litex_json2dts_linux.py +++ b/litex/tools/litex_json2dts_linux.py @@ -7,15 +7,14 @@ # Copyright (c) 2020 Antmicro # SPDX-License-Identifier: BSD-2-Clause +import os import sys import json import argparse -import os + +from litex.gen.common import KILOBYTE, MEGABYTE def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_device=None, polling=False): - kB = 1024 - mB = kB*1024 - aliases = {} # CPU Parameters ------------------------------------------------------------------------------- @@ -63,10 +62,10 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic # Boot Arguments ------------------------------------------------------------------------------- default_initrd_start = { - "or1k": 8*mB, - "riscv": 16*mB, + "or1k": 8 * MEGABYTE, + "riscv": 16 * MEGABYTE, } - default_initrd_size = 8*mB + default_initrd_size = 8 * MEGABYTE if initrd_start is None: