/*
 * Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
 *
 * Author:
 *       Mark Hatle <mark.hatle@amd.com>
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

/dts-v1/;

/ {
        compatible = "system-device-tree-v1,lop";
        lops {
                compatible = "system-device-tree-v1,lop";
                track_feature: track_feature {
                        compatible = "system-device-tree-v1,lop,code-v1";
                        noexec;
                        code = "
                            # print( 'track: lopper library routine: %s' % node )
                            try:
                                node.tunes[prop] = prop
                            except:
                                pass
                        ";
                };
                lop_0_1 {
                      compatible = "system-device-tree-v1,lop,select-v1";
                      select_1;
                      select_2 = "/";
                      lop_0_2 {
                              compatible = "system-device-tree-v1,lop,code-v1";
                              inherit = "subsystem";
                              code = "
                                    for n in tree.__selected__:
                                        mach_name = n['compatible'].value[0].replace(',','-').replace('.','-')
                                        model = n['model'].value[0]
                                        device_id = n['device_id'].value[0]
                                        print( '%s %s %s' % (mach_name.lower(), device_id, model) )
                        ";
                      };
                };
        };
};
