Merge "boot: cleanup edma before jump to kernel"

This commit is contained in:
Linux Build Service Account 2024-04-22 09:12:12 -07:00 committed by Gerrit - the friendly Code Review server
commit c520adb295
5 changed files with 64 additions and 0 deletions

View file

@ -40,6 +40,7 @@
#ifndef USE_HOSTCC
extern void board_usb_deinit(int id);
extern void eth_cleanup(void);
DECLARE_GLOBAL_DATA_PTR;
@ -726,6 +727,11 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
for (i = 0; i < CONFIG_USB_MAX_CONTROLLER_COUNT; i++)
board_usb_deinit(i);
#endif
/*
* Edma cleanup
*/
eth_cleanup();
ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_GO,
images, boot_fn);
}

View file

@ -2205,3 +2205,18 @@ init_failed:
return -1;
}
void ipq_eth_cleanup(struct eth_device *dev)
{
struct ipq5332_eth_dev *priv = dev->priv;
struct ipq5332_edma_common_info *c_info = priv->c_info;
struct ipq5332_edma_hw *ehw = &c_info->hw;
ipq5332_edma_disable_intr(ehw);
ipq5332_edma_disable_rings(ehw);
ipq5332_edma_reg_write(IPQ5332_EDMA_REG_PORT_CTRL, 0);
return;
}

View file

@ -2025,3 +2025,18 @@ init_failed:
return -1;
}
void ipq_eth_cleanup(struct eth_device *dev)
{
struct ipq6018_eth_dev *priv = dev->priv;
struct ipq6018_edma_common_info *c_info = priv->c_info;
struct ipq6018_edma_hw *ehw = &c_info->hw;
ipq6018_edma_disable_intr(ehw);
ipq6018_edma_disable_rings(ehw);
ipq6018_edma_reg_write(IPQ6018_EDMA_REG_PORT_CTRL, 0);
return;
}

View file

@ -2276,3 +2276,18 @@ init_failed:
return -1;
}
void ipq_eth_cleanup(struct eth_device *dev)
{
struct ipq9574_eth_dev *priv = dev->priv;
struct ipq9574_edma_common_info *c_info = priv->c_info;
struct ipq9574_edma_hw *ehw = &c_info->hw;
ipq9574_edma_disable_intr(ehw);
ipq9574_edma_disable_rings(ehw);
ipq9574_edma_reg_write(IPQ9574_EDMA_REG_PORT_CTRL, 0);
return;
}

View file

@ -668,6 +668,19 @@ static unsigned int eth_rcv_current, eth_rcv_last;
static struct eth_device *eth_devices;
struct eth_device *eth_current;
__weak void ipq_eth_cleanup(struct eth_device *dev)
{
return;
}
void eth_cleanup(void)
{
if (!eth_current)
return;
ipq_eth_cleanup(eth_current);
}
static void eth_set_current_to_next(void)
{
eth_current = eth_current->next;