| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <bootblock_common.h> |
| 4 | #include <device/pnp_ops.h> |
| 5 | #include <superio/ite/common/ite.h> |
| 6 | #include <superio/ite/it8528e/it8528e.h> |
| 7 | #include <intelblocks/lpc_lib.h> |
| 8 | |
| 9 | void bootblock_mainboard_early_init(void) |
| 10 | { |
| 11 | /* |
| 12 | * Enable the EC BRAM interface, and set bank 1's I/O BAR. |
| 13 | * BRAM on this board uses bank 0 from the PCH and bank 1 from the EC: |
| 14 | * |
| 15 | * - PCH bank 0 is used for the RTC. Either should work, but the PCH |
| 16 | * RTC was used historically, and it's preferable not to change this |
| 17 | * in an update. |
| 18 | * - EC bank 1 contains the automatic-power-on setting, which is useful |
| 19 | * to use the Mini as an appliance-like server. |
| 20 | * |
| 21 | * cmos.default can be used to configure the automatic power-on setting |
| 22 | * in firmware. We have to set up the BRAM interface in bootblock, |
| 23 | * because cmos.default is applied early in bootblock. |
| 24 | */ |
| 25 | const pnp_devfn_t ec_rtct_dev = PNP_DEV(0x2E, IT8528E_RTCT); |
| 26 | pnp_enter_conf_state(ec_rtct_dev); |
| 27 | pnp_set_logical_device(ec_rtct_dev); |
| 28 | pnp_set_enable(ec_rtct_dev, 1); |
| 29 | pnp_set_iobase(ec_rtct_dev, 0x62, CONFIG_PC_CMOS_BASE_PORT_BANK1); |
| 30 | pnp_exit_conf_state(ec_rtct_dev); |
| 31 | |
| 32 | /* Open the BRAM 1 bank interface on LPC */ |
| 33 | lpc_open_pmio_window(CONFIG_PC_CMOS_BASE_PORT_BANK1, 2); |
| 34 | } |