2 * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/device.h>
10 #include <asm/arch/quark.h>
12 int board_early_init_f(void)
18 * Intel Galileo gen2 board uses GPIO Resume Well bank pin0 as the PERST# pin.
20 * We cannot use any public GPIO APIs in <asm-generic/gpio.h> to control this
21 * pin, as these APIs will eventually call into gpio_ich6_ofdata_to_platdata()
22 * in the Intel ICH6 GPIO driver where it calls PCI configuration space access
23 * APIs which will trigger PCI enumeration process.
25 * Check <asm/arch-quark/quark.h> for more details.
27 void board_assert_perst(void)
31 /* retrieve the GPIO IO base */
32 qrk_pci_read_config_dword(QUARK_LEGACY_BRIDGE, LB_GBA, &base);
33 base = (base & 0xffff) & ~0x7f;
41 /* configure the pin as output */
47 /* pull it down (assert) */
54 void board_deassert_perst(void)
58 /* retrieve the GPIO IO base */
59 qrk_pci_read_config_dword(QUARK_LEGACY_BRIDGE, LB_GBA, &base);
60 base = (base & 0xffff) & ~0x7f;
62 /* pull it up (de-assert) */
69 void setup_pch_gpios(u16 gpiobase, const struct pch_gpio_map *gpio)