mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
ipq807x: Fixed the AQ phy reset
Removing the delay for boot time. Change-Id: Iab968986d58aa5bc930b7c03bb16f5b1041be3b1 Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
This commit is contained in:
parent
e85f60b2d8
commit
897bc3b2a4
4 changed files with 45 additions and 7 deletions
|
|
@ -157,6 +157,8 @@ int board_init(void)
|
|||
printf("WARN: ipq_board_usb_init failed\n");
|
||||
}
|
||||
|
||||
aquantia_phy_reset_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -781,7 +781,8 @@ static int do_bootipq(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
|||
|
||||
ret = qca_scm_call(SCM_SVC_FUSE, QFPROM_IS_AUTHENTICATE_CMD, &buf, sizeof(char));
|
||||
|
||||
aquantia_phy_reset();
|
||||
aquantia_phy_reset_init_done();
|
||||
|
||||
if (ret == 0 && buf == 1) {
|
||||
ret = do_boot_signedimg(cmdtp, flag, argc, argv);
|
||||
} else if (ret == 0 || ret == -EOPNOTSUPP) {
|
||||
|
|
|
|||
|
|
@ -288,7 +288,20 @@ void emmc_sdhci_init(void)
|
|||
writel(readl(MSM_SDC1_MCI_HC_MODE) | (0x1), MSM_SDC1_MCI_HC_MODE);
|
||||
}
|
||||
|
||||
void aquantia_phy_reset(void)
|
||||
int get_aquantia_gpio()
|
||||
{
|
||||
int aquantia_gpio = -1, node;
|
||||
|
||||
node = fdt_path_offset(gd->fdt_blob, "/ess-switch");
|
||||
if (node >= 0)
|
||||
aquantia_gpio = fdtdec_get_uint(gd->fdt_blob, node, "aquantia_gpio", -1);
|
||||
else
|
||||
return node;
|
||||
|
||||
return aquantia_gpio;
|
||||
}
|
||||
|
||||
void aquantia_phy_reset_init(void)
|
||||
{
|
||||
int aquantia_gpio = -1, node;
|
||||
unsigned int *aquantia_gpio_base;
|
||||
|
|
@ -301,14 +314,22 @@ void aquantia_phy_reset(void)
|
|||
if (aquantia_gpio >=0) {
|
||||
aquantia_gpio_base = (unsigned int *)GPIO_CONFIG_ADDR(aquantia_gpio);
|
||||
writel(0x203, aquantia_gpio_base);
|
||||
gpio_set_value(aquantia_gpio, 0x0);
|
||||
mdelay(500);
|
||||
gpio_set_value(aquantia_gpio, 0x1);
|
||||
mdelay(500);
|
||||
gpio_direction_output(aquantia_gpio, 0x0);
|
||||
}
|
||||
aq_phy_initialised = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void aquantia_phy_reset_init_done(void)
|
||||
{
|
||||
int aquantia_gpio;
|
||||
|
||||
aquantia_gpio = get_aquantia_gpio();
|
||||
if (aquantia_gpio >= 0) {
|
||||
gpio_set_value(aquantia_gpio, 0x1);
|
||||
}
|
||||
}
|
||||
|
||||
void eth_clock_enable(void)
|
||||
{
|
||||
int tlmm_base = 0x1025000;
|
||||
|
|
@ -372,7 +393,10 @@ void eth_clock_enable(void)
|
|||
writel(2, tlmm_base + 0x4);
|
||||
writel(7, tlmm_base + 0x1f000);
|
||||
writel(7, tlmm_base + 0x20000);
|
||||
aquantia_phy_reset();
|
||||
aquantia_phy_reset_init();
|
||||
mdelay(500);
|
||||
aquantia_phy_reset_init_done();
|
||||
mdelay(500);
|
||||
}
|
||||
|
||||
int board_eth_init(bd_t *bis)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,17 @@ int gpio_get_value(unsigned int gpio)
|
|||
return (val & 1);
|
||||
}
|
||||
|
||||
void gpio_direction_output(unsigned int gpio, unsigned int out)
|
||||
{
|
||||
unsigned int *addr = (unsigned int *)GPIO_CONFIG_ADDR(gpio);
|
||||
unsigned int val = 0;
|
||||
|
||||
gpio_set_value(gpio, out);
|
||||
val = readl(addr);
|
||||
val |= 1 << 9;
|
||||
writel(val, addr);
|
||||
}
|
||||
|
||||
int qca_gpio_init(int offset)
|
||||
{
|
||||
struct qca_gpio_config gpio_config;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue