Beispiel #1
0
def generate_overlay(tree, overlay):
    """Generate the overlay"""
    bootrom = get_spi_flash(tree)

    model = tree.root().get_field("model")
    if model == "sifive,hifive1":
        offset = 0x400000
    elif model == "sifive,hifive1-revb":
        offset = 0x10000
    else:
        offset = 0x0

    if bootrom is not None:
        region = get_spi_region(bootrom)
        set_entry(overlay, bootrom, region, offset)

    set_boot_hart(tree, overlay)
    set_stdout(tree, overlay, 115200)

    if model == "sifive,hifive-unmatched-a00" or \
       model == "sifive,hifive-unleashed-a00":
        ram = itim = ccache = get_ccache(tree)
        region = get_ccache_region(ccache)
        set_rams(overlay, ram, itim, region)
    else:
        ram, itim = get_rams(tree)
        set_rams(overlay, ram, itim)
Beispiel #2
0
def generate_overlay(tree, overlay):
    """Generate the overlay"""
    bootrom = get_spi_flash(tree)
    if bootrom is not None:
        region = get_spi_region(bootrom)
        set_entry(overlay, bootrom, region, 0x400000)

    set_boot_hart(tree, overlay)
    set_stdout(tree, overlay, 115200)

    ram, itim = get_rams(tree)

    # If the ram and itim are the same sram node
    ram_compat = ram.get_field("compatible")
    if ram_compat is None:
        ram_compat = ""
    if ram == itim and "sram" in ram_compat:
        # get the size of the first tuple
        size = ram.get_reg()[0][1]
        # if the size is above the threshold
        if size >= SRAM_SPLIT_MIN_SIZE:
            # split the memory into separate ram and itim
            set_ram(overlay, ram, 0, 0)
            set_itim(overlay, ram, 0, size / 2)
            return

    set_rams(overlay, ram, itim)
def generate_overlay(tree, overlay):
    """Generate the overlay"""
    bootrom = tree.get_by_path("/memory")
    if bootrom is not None:
        set_entry(overlay, bootrom, 0, 0)

    set_boot_hart(tree, overlay)
    set_stdout(tree, overlay, 115200)

    ram, itim = get_rams(tree)
    set_rams(overlay, ram, itim)
def generate_overlay(tree, overlay):
    """Generate the overlay"""
    spi = get_spi_flash(tree)
    memory = tree.get_by_path("/memory")
    if spi is not None:
        region = get_spi_region(spi)
        set_entry(overlay, spi, region, 0x400000)
    else:
        set_entry(overlay, memory, 0, 0x0)

    set_boot_hart(tree, overlay)
    set_stdout(tree, overlay, 115200)

    ram, itim = get_rams(tree)
    set_rams(overlay, ram, itim)
Beispiel #5
0
def generate_overlay(tree, overlay):
    """Generate the overlay"""
    bootrom = tree.get_by_path("/memory")
    if bootrom is not None:
        set_entry(overlay, bootrom, 0, 0)

    set_boot_hart(tree, overlay)
    set_stdout(tree, overlay, 115200)

    ram, itim = get_rams(tree)

    # Prioritize the dtim over /memory
    dtim = get_dtim(tree, get_boot_hart(tree))
    if dtim is not None:
        ram = dtim

    set_rams(overlay, ram, itim)