diff options
| author | Tom Rini <[email protected]> | 2025-10-17 18:07:06 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-10-17 18:07:06 -0600 |
| commit | 64a4645c4e4f54d4e67d2954ed20b9e1af389530 (patch) | |
| tree | 220a6ffc7811a403797f5e0fa4140cfbe0a644f3 /drivers | |
| parent | 5340dc6fe75b5ffde3afe91c01bd8551b3cb8182 (diff) | |
| parent | b9efaf6729d06df94ded46710725746a41eaf0fc (diff) | |
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
SH HSCIF FIFO fixes, R-Car V4H/V4M DT corrections, R-Car V4H Sparrow
Hawk PCIe shutdown support before booting Linux.
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/pci/pci-rcar-gen4.c | 26 | ||||
| -rw-r--r-- | drivers/serial/serial_sh.c | 11 |
2 files changed, 36 insertions, 1 deletions
diff --git a/drivers/pci/pci-rcar-gen4.c b/drivers/pci/pci-rcar-gen4.c index 1f41ce28b0b..e165271f58c 100644 --- a/drivers/pci/pci-rcar-gen4.c +++ b/drivers/pci/pci-rcar-gen4.c @@ -477,6 +477,10 @@ static int rcar_gen4_pcie_probe(struct udevice *dev) if (!rcar_gen4_pcie_link_up(rcar)) { printf("PCIE-%d: Link down\n", dev_seq(dev)); + rcar_gen4_pcie_ltssm_control(rcar, false); + dm_gpio_set_value(&rcar->pe_rst, 1); + reset_assert(&rcar->pwr_rst); + clk_disable_unprepare(rcar->ref_clk); return -ENODEV; } @@ -494,6 +498,26 @@ static int rcar_gen4_pcie_probe(struct udevice *dev) } /** + * rcar_gen4_pcie_remove() - Stop the PCIe bus active link + * @dev: A pointer to the device being operated on + * + * Stop an active link on the PCIe bus and deconfigure the controller. + * + * Return: 0 on success, else -ENODEV + */ +static int rcar_gen4_pcie_remove(struct udevice *dev) +{ + struct rcar_gen4_pcie *rcar = dev_get_priv(dev); + + rcar_gen4_pcie_ltssm_control(rcar, false); + dm_gpio_set_value(&rcar->pe_rst, 1); + reset_assert(&rcar->pwr_rst); + clk_disable_unprepare(rcar->ref_clk); + + return 0; +} + +/** * rcar_gen4_pcie_of_to_plat() - Translate from DT to device state * * @dev: A pointer to the device being operated on @@ -566,5 +590,7 @@ U_BOOT_DRIVER(rcar_gen4_pcie) = { .ops = &rcar_gen4_pcie_ops, .of_to_plat = rcar_gen4_pcie_of_to_plat, .probe = rcar_gen4_pcie_probe, + .remove = rcar_gen4_pcie_remove, .priv_auto = sizeof(struct rcar_gen4_pcie), + .flags = DM_FLAG_ACTIVE_DMA, }; diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c index e4cc4ee4260..7ab62e0e90b 100644 --- a/drivers/serial/serial_sh.c +++ b/drivers/serial/serial_sh.c @@ -112,7 +112,16 @@ static int serial_raw_putc(struct uart_port *port, const char c) static int serial_rx_fifo_level(struct uart_port *port) { - return scif_rxfill(port); + int ret; + + ret = scif_rxfill(port); + if (ret) + return ret; + + if (sci_in(port, SCxSR) & SCxSR_RDxF(port)) + return 1; + + return 0; } static int sh_serial_tstc_generic(struct uart_port *port) |
