| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com> |
| #include <asm/arch/device.h> |
| #include <asm/arch/quark.h> |
| * Intel Galileo gen2 board uses GPIO Resume Well bank pin0 as the PERST# pin. |
| * We cannot use any public GPIO APIs in <asm-generic/gpio.h> to control this |
| * pin, as these APIs will eventually call into gpio_ich6_of_to_plat() |
| * in the Intel ICH6 GPIO driver where it calls PCI configuration space access |
| * APIs which will trigger PCI enumeration process. |
| * Check <asm/arch-quark/quark.h> for more details. |
| void board_assert_perst(void) |
| /* retrieve the GPIO IO base */ |
| qrk_pci_read_config_dword(QUARK_LEGACY_BRIDGE, LB_GBA, &base); |
| base = (base & 0xffff) & ~0x7f; |
| /* configure the pin as output */ |
| /* pull it down (assert) */ |
| void board_deassert_perst(void) |
| /* retrieve the GPIO IO base */ |
| qrk_pci_read_config_dword(QUARK_LEGACY_BRIDGE, LB_GBA, &base); |
| base = (base & 0xffff) & ~0x7f; |
| /* pull it up (de-assert) */ |