From 3f6dbf0c4bdc96fc00e9f9c057da0f5f53712f20 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 19 Sep 2024 16:08:39 +0200 Subject: [PATCH] [hw/top] Add support for english_breakfast Signed-off-by: Amaury Pouly --- hw/top/BUILD | 9 +++++++++ hw/top/alias_top.bzl | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/hw/top/BUILD b/hw/top/BUILD index 85242b0c9c0600..9aab5484a47fb8 100644 --- a/hw/top/BUILD +++ b/hw/top/BUILD @@ -13,26 +13,31 @@ load("//hw/top:alias_top.bzl", "alias_top", "alias_ip_sw") alias_top( name = "top_lib", earlgrey = "//hw/top_earlgrey/sw/autogen:top_earlgrey", + englishbreakfast = "//hw/top_englishbreakfast:top_lib", ) alias_top( name = "dt_api", earlgrey = "//hw/top_earlgrey/sw/autogen:dt_api", + englishbreakfast = "//hw/top_englishbreakfast:dt_api", ) alias_top( name = "devicetables", earlgrey = "//hw/top_earlgrey/sw/autogen:devicetables", + englishbreakfast = "//hw/top_englishbreakfast:devicetables", ) alias_ip_sw( name = "sensor_ctrl", earlgrey = "//hw/top_earlgrey/ip/sensor_ctrl/data:sensor_ctrl", + englishbreakfast = "//hw/top_englishbreakfast/ip/sensor_ctrl/data:sensor_ctrl", ) alias_ip_sw( name = "ast", earlgrey = "//hw/top_earlgrey/ip/ast/data:ast", + englishbreakfast = "//hw/top_englishbreakfast/ip/ast/data:ast", ) IP_AUTOGEN = [ @@ -45,6 +50,7 @@ IP_AUTOGEN = [ [ alias_ip_sw( name = "{}".format(ipname), + englishbreakfast = "//hw/top_englishbreakfast:{}".format(ipname), earlgrey = "//hw/top_earlgrey/ip_autogen/{}:{}".format(ipname, ipname), ) for ipname in IP_AUTOGEN @@ -53,15 +59,18 @@ IP_AUTOGEN = [ # The following IPs do not follow the regular scheme above for earlgrey and should ideally be made more uniform. alias_ip_sw( name = "rv_plic", + englishbreakfast = "//hw/top_englishbreakfast:rv_plic", earlgrey = "//hw/top_earlgrey:rv_plic", ) alias_ip_sw( name = "alert_handler", + englishbreakfast = "//hw/top_englishbreakfast:alert_handler", earlgrey = "//hw/top_earlgrey:alert_handler", ) alias_ip_sw( name = "pinmux", + englishbreakfast = "//hw/top_englishbreakfast:pinmux", earlgrey = "//hw/top_earlgrey/ip/pinmux/data/autogen:pinmux", ) diff --git a/hw/top/alias_top.bzl b/hw/top/alias_top.bzl index 6a3601868b372c..0aa3c2534d688d 100644 --- a/hw/top/alias_top.bzl +++ b/hw/top/alias_top.bzl @@ -2,17 +2,19 @@ # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 -def alias_top(name, earlgrey): +def alias_top(name, earlgrey, englishbreakfast): native.alias( name = name, actual = select({ + "//sw/device:is_english_breakfast": englishbreakfast, "//conditions:default": earlgrey, }), ) -def alias_ip_sw(name, earlgrey): - for suffix in ["c_regs", "rust_regs"]: +def alias_ip_sw(name, earlgrey, englishbreakfast): + for suffix in ["c_regs", "rust_regs", "dt"]: alias_top( name = "{}_{}".format(name, suffix), earlgrey = "{}_{}".format(earlgrey, suffix), + englishbreakfast = "{}_{}".format(englishbreakfast, suffix), )