i2c: add tree.py to parse i2c bus info to tree

The i2c topo is so complex if there are many i2c buses and muxes,
it's hard to understand the i2c bus info from the output of
"i2cdetect -l". This patch adds a python script to parse the i2c bus
info to a tree, which is easy to understand.

ps: maybe add a tree view to the i2ctools, but it's not easy to me.

Example:
```
ssh user@<ip> "i2cdetect -l" | python tree.py
root
├── i2c-4
│   ├── i2c-16
│   │   ├── i2c-129
│   │   ├── i2c-130
│   │   ├── i2c-131
│   │   └── i2c-132
│   ├── i2c-17
│   │   ├── i2c-113
│   │   ├── i2c-114
│   │   ├── i2c-115
│   │   ├── i2c-116
│   │   ├── i2c-117
│   │   ├── i2c-118
│   │   ├── i2c-119
│   │   └── i2c-120
│   ├── i2c-18
│   │   ├── i2c-105
│   │   ├── i2c-106
│   │   ├── i2c-107
│   │   ├── i2c-108
....
```

Change-Id: Ia434b093c7ccff80ea52ad7416bcda609890cecd
Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
2 files changed
tree: 7101a1e3e93f38770206feeb31ae4c6f45abdbd0
  1. adcapp/
  2. altitude/
  3. autojson/
  4. bbdbg/
  5. bi2cp/
  6. cla-signers/
  7. dbus-pcap/
  8. dbus-vis/
  9. dbus_sensor_tester/
  10. dbusView/
  11. ddconvnotrunc/
  12. expectedJsonChecker/
  13. format-yaml/
  14. i2c/
  15. ipkdbg/
  16. netboot/
  17. openbmc-autobump/
  18. openbmctool/
  19. overlay/
  20. pldm/
  21. prepare-emmc-qemu/
  22. pretty-journal/
  23. pwmtachtool/
  24. reboot/
  25. reboot-ping-pong/
  26. rootfs_size/
  27. sensor_yaml_config/
  28. tof-voters/
  29. tracing/
  30. witherspoon-debug/
  31. .linter-ignore
  32. .shellcheck-ignore
  33. LICENSE
  34. OWNERS
  35. README.md
README.md

The OpenBMC Tools Collection

The goal of this repository is to collect the two-minute hacks you write to automate interactions with OpenBMC systems.

It's highly likely the scripts don't meet your needs - they could be undocumented, dysfunctional or utterly broken. Please help us improve!

Repository Rules

  • Always inspect what you will be executing
  • Some hacking on your part is to be expected

If you're still with us

Then this repository aims to be the default destination for your otherwise un-homed scripts. As such we are setting the bar for submission pretty low, and we aim to make the process as easy as possible.

Sending patches

Please use gerrit for all patches to this repository:

Do note that you will need to be party to the OpenBMC CLA before your contributions can be accepted. See Gerrit Setup and CLA for more information.

What we will do once we have your patches

So long as your patches look sane with a cursory glance you can expect them to be applied. We may push back in the event that similar tools already exist or there are egregious issues.

What you must have in your patches

We don't ask for much, but you need to give us at least a Signed-off-by, use SPDX markers in your source files and put your work under an Apache 2.0 compatible license.

How you consume the repository

There's no standard way to install the scripts housed here, and adding parts of the repository to your PATH might be a bit of a dice-roll. We may also move or remove scripts from time to time as part of housekeeping. It's probably best to copy things out if you need stability.