Lines Matching +full:board +full:- +full:to +full:- +full:board

3 Utility script to assist in the migration of a board from hardware model v1
4 (HWMv1) to hardware model v2 (HWMv2).
7 This script is not a complete migration tool. It is meant to assist in the
12 - ``-b|--board``: The name of the board to migrate.
13 - ``-g|--group``: The group the board belongs to. This is used to group a set of
16 - ``-v|--vendor``: The vendor name.
17 - ``-s|--soc``: The SoC name.
19 In some cases, the new board name will differ from the old board name. For
20 example, the old board name may have the SoC name as a suffix, while in HWMv2,
21 this is no longer needed. In such cases, ``-n|--new-board`` needs to be
24 For boards with variants, ``--variants`` needs to be provided.
26 For out-of-tree boards, provide ``--board-root`` pointing to the custom board
30 SPDX-License-Identifier: Apache-2.0
44 def board_v1_to_v2(board_root, board, new_board, group, vendor, soc, variants): argument
46 board_path = next(board_root.glob(f"boards/*/{board}"))
48 sys.exit(f"Board not found: {board}")
52 print("New board already exists, updating board with additional SoC")
58 print("Moving files to the new board folder...")
66 print("Creating or updating board.yaml...")
67 board_settings_file = new_board_path / "board.yml"
70 "board": {
77 with open(board_settings_file, encoding='utf-8') as f:
79 board_settings = yaml.load(f) # pylint: disable=assignment-from-no-return
85 board_settings["board"]["socs"].append(soc)
92 print(f"Updating {board}_defconfig...")
93 board_defconfig_file = new_board_path / f"{board}_defconfig"
105 m = re.match(r"^CONFIG_(SOC_[A-Z0-9_]+).*$", line)
129 # drop "config BOARD" entry from Kconfig.defconfig
130 m = re.match(r"^config BOARD$", line)
144 m = re.match(rf"^(.*)BOARD_{board.upper()}(.*)$", line)
161 board_kconfig_file = new_board_path / "Kconfig.board"
168 header = "# SPDX-License-Identifier: Apache-2.0\n"
182 print("Removing old Kconfig.board...")
192 "--board-root",
195 help="Board root",
198 parser.add_argument("-b", "--board", type=str, required=True, help="Board name")
199 parser.add_argument("-n", "--new-board", type=str, help="New board name")
200 parser.add_argument("-g", "--group", type=str, required=True, help="Board group")
201 parser.add_argument("-v", "--vendor", type=str, required=True, help="Vendor name")
202 parser.add_argument("-s", "--soc", type=str, required=True, help="Board SoC")
203 parser.add_argument("--variants", nargs="+", default=[], help="Board variants")
209 args.board,
210 args.new_board or args.board,