| 1 | # coreboot Console |
| 2 | |
| 3 | coreboot supports multiple ways to access its console. |
| 4 | <https://www.coreboot.org/Console_and_outputs> |
| 5 | |
| 6 | |
| 7 | ## SMBus Console |
| 8 | |
| 9 | SMBus is a two-wire interface which is based on the principles of |
| 10 | operation of I2C. SMBus, was first was designed to allow a battery to |
| 11 | communicate with the charger, the system host, and/or other |
| 12 | power-related components in the system. |
| 13 | |
| 14 | Enable the SMBus console with `CONSOLE_I2C_SMBUS` Kconfig. Set |
| 15 | `CONSOLE_I2C_SMBUS_SLAVE_ADDRESS` and |
| 16 | `CONSOLE_I2C_SMBUS_SLAVE_DATA_REGISTER` configuration values of the |
| 17 | slave I2C device which you will use to capture I2C packets. |
| 18 | |
| 19 | Modern computer Random Access Memory (RAM) slot has SMBus in it |
| 20 | according to the JEDEC standards. We can use a breakout-board to expose |
| 21 | those SMBus pins. Some mainboard have SMBus pins in the PCIe slot as |
| 22 | well. |
| 23 | |
| 24 | This feature has been tested on the following platforms: |
| 25 | ```{eval-rst} |
| 26 | +------------------------------------+ |
| 27 | | Tested platforms | |
| 28 | +====================================+ |
| 29 | | GA-H61M-S2PV + Intel Ivy Bridge | |
| 30 | +------------------------------------+ |
| 31 | ``` |
| 32 | |
| 33 | A minimal DDR3 DIMM breakout board PCB design with only the |
| 34 | SDA(Data line) and SCL(Clock line) pins of I2C/SMBus can be found |
| 35 | [here](https://github.com/drac98/ram-breakout-board). |
| 36 | See the PCB layout [here](https://archive.org/details/ddr3-dimm-F_Cu) |
| 37 | |
| 38 | NOTE: |
| 39 | To capture the I2C packets, an I2C slave device is required. The easiest |
| 40 | way to capture the log message is to use a I2C to UART converter chip |
| 41 | with a UART to USB converter chip. The setup would be as follows. |
| 42 | ```text |
| 43 | +---------+ +-------------+ +-------------+ |
| 44 | + PC +----+ UART to USB +----+ I2C to UART | |
| 45 | +---------+ +-------------+ +-------------+ |
| 46 | | | |
| 47 | ------------------------------------------------+-- System Management |
| 48 | ----------------------------------------------+---- Bus |
| 49 | ``` |
| 50 | |
| 51 | Watch this [video](https://youtu.be/Q0dK41n9db8) to see how it is set |
| 52 | up. A backup of the video is available |
| 53 | [here](https://web.archive.org/web/20220916172605/https://www.youtube.com/watch?v=Q0dK41n9db8) |
| 54 | |
| 55 | If you are using any of the `SC16IS740/750/760` I2C to UART converter |
| 56 | chip, you can enable the `SC16IS7XX_INIT` option to initialize the chip. |
| 57 | |
| 58 | If not we can use other I2C slave devices like an Arduino or a |
| 59 | Beagleboard. |
| 60 | * [Linux I2C Slave interface](https://web.archive.org/web/20220926173943/https://www.kernel.org/doc/html/latest/i2c/slave-interface.html) |
| 61 | * [BeagleBone Black I2C Slave](https://web.archive.org/web/20220926171211/https://forum.beagleboard.org/t/beaglebone-black-and-arduino-uno-i2c-communication-using-c/29990/8) |
| 62 | |
| 63 | This feature was added as part of a GSoC 2022 project. Checkout the |
| 64 | following blog posts for more details. |
| 65 | * [coreboot Console via SMBus — Part I](https://medium.com/@husnifaiz/coreboot-console-via-smbus-introduction-38273691a8ac) |
| 66 | * [coreboot Console via SMBus — Part II](https://medium.com/@husnifaiz/coreboot-console-via-smbus-part-ii-bc324fdd2f24) |