litex_json2dts_linux: Use new byte size definition from litex.gen.common.

This commit is contained in:
Florent Kermarrec 2024-06-13 09:55:19 +02:00
parent d782a0f8c6
commit fcf9b3b335
1 changed files with 6 additions and 7 deletions

View File

@ -7,15 +7,14 @@
# Copyright (c) 2020 Antmicro <www.antmicro.com> # Copyright (c) 2020 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: BSD-2-Clause # SPDX-License-Identifier: BSD-2-Clause
import os
import sys import sys
import json import json
import argparse 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): def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_device=None, polling=False):
kB = 1024
mB = kB*1024
aliases = {} aliases = {}
# CPU Parameters ------------------------------------------------------------------------------- # CPU Parameters -------------------------------------------------------------------------------
@ -63,10 +62,10 @@ def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devic
# Boot Arguments ------------------------------------------------------------------------------- # Boot Arguments -------------------------------------------------------------------------------
default_initrd_start = { default_initrd_start = {
"or1k": 8*mB, "or1k": 8 * MEGABYTE,
"riscv": 16*mB, "riscv": 16 * MEGABYTE,
} }
default_initrd_size = 8*mB default_initrd_size = 8 * MEGABYTE
if initrd_start is None: if initrd_start is None: