mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
Merge "boot: cleanup edma before jump to kernel"
This commit is contained in:
commit
c520adb295
5 changed files with 64 additions and 0 deletions
|
|
@ -40,6 +40,7 @@
|
||||||
#ifndef USE_HOSTCC
|
#ifndef USE_HOSTCC
|
||||||
|
|
||||||
extern void board_usb_deinit(int id);
|
extern void board_usb_deinit(int id);
|
||||||
|
extern void eth_cleanup(void);
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
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++)
|
for (i = 0; i < CONFIG_USB_MAX_CONTROLLER_COUNT; i++)
|
||||||
board_usb_deinit(i);
|
board_usb_deinit(i);
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
|
* Edma cleanup
|
||||||
|
*/
|
||||||
|
eth_cleanup();
|
||||||
|
|
||||||
ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_GO,
|
ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_GO,
|
||||||
images, boot_fn);
|
images, boot_fn);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2205,3 +2205,18 @@ init_failed:
|
||||||
|
|
||||||
return -1;
|
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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2025,3 +2025,18 @@ init_failed:
|
||||||
|
|
||||||
return -1;
|
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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2276,3 +2276,18 @@ init_failed:
|
||||||
|
|
||||||
return -1;
|
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;
|
||||||
|
}
|
||||||
|
|
|
||||||
13
net/eth.c
13
net/eth.c
|
|
@ -668,6 +668,19 @@ static unsigned int eth_rcv_current, eth_rcv_last;
|
||||||
static struct eth_device *eth_devices;
|
static struct eth_device *eth_devices;
|
||||||
struct eth_device *eth_current;
|
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)
|
static void eth_set_current_to_next(void)
|
||||||
{
|
{
|
||||||
eth_current = eth_current->next;
|
eth_current = eth_current->next;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue