void mainboard_gpio_pcie_reset(uint32_t pin_value) { uint32_t pin_number; uint32_t value; /* Determine the correct PCIe reset pin */ if (IS_ENABLED(CONFIG_GALILEO_GEN2)) pin_number = GEN2_PCI_RESET_RESUMEWELL_GPIO; else pin_number = GEN1_PCI_RESET_RESUMEWELL_GPIO; /* Update the PCIe reset value */ value = reg_legacy_gpio_read(R_QNC_GPIO_RGLVL_RESUME_WELL); value = (value & ~(1 << pin_number)) | ((pin_value & 1) << pin_number); reg_legacy_gpio_write(R_QNC_GPIO_RGLVL_RESUME_WELL, value); }
static void reg_write(struct reg_script_context *ctx) { const struct reg_script *step = ctx->step; switch (step->id) { default: printk(BIOS_ERR, "ERROR - Unknown register set (0x%08x)!\n", step->id); ctx->display_features = REG_SCRIPT_DISPLAY_NOTHING; return; case GPE0_REGS: ctx->display_prefix = "GPE0"; reg_gpe0_write(step->reg, (uint32_t)step->value); break; case GPIO_REGS: ctx->display_prefix = "GPIO"; reg_gpio_write(step->reg, (uint32_t)step->value); break; case HOST_BRIDGE: ctx->display_prefix = "Host Bridge"; reg_host_bridge_unit_write(step->reg, (uint32_t)step->value); break; case LEG_GPIO_REGS: ctx->display_prefix = "Legacy GPIO"; reg_legacy_gpio_write(step->reg, (uint32_t)step->value); break; case PCIE_AFE_REGS: ctx->display_prefix = "PCIe AFE"; reg_pcie_afe_write(step->reg, (uint32_t)step->value); break; case PCIE_RESET: if (ctx->display_features) { ctx->display_prefix = "PCIe reset"; ctx->display_features &= ~REG_SCRIPT_DISPLAY_REGISTER; } mainboard_gpio_pcie_reset(step->value); break; case RMU_TEMP_REGS: ctx->display_prefix = "RMU TEMP"; reg_rmu_temp_write(step->reg, (uint32_t)step->value); break; case SOC_UNIT_REGS: ctx->display_prefix = "SOC Unit"; reg_soc_unit_write(step->reg, (uint32_t)step->value); break; case MICROSECOND_DELAY: /* The actual delay is >= the requested delay */ if (ctx->display_features) { /* Higher baud-rates will reduce the impact of displaying this message */ printk(BIOS_INFO, "Delay %lld uSec\n", step->value); ctx->display_features = REG_SCRIPT_DISPLAY_NOTHING; } udelay(step->value); break; case USB_PHY_REGS: ctx->display_prefix = "USB PHY"; reg_usb_write(step->reg, (uint32_t)step->value); break; } }