ipq806x: Enable the additional uart in ipq806x

Change-Id: I34d8f6dbb904fbee9b1fb453e968a5ac932320bf
Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
This commit is contained in:
Sham Muthayyan 2017-05-15 18:57:32 +05:30 committed by Gerrit - the friendly Code Review server
parent b5f4069981
commit 956b528723
2 changed files with 21 additions and 5 deletions

View file

@ -21,6 +21,7 @@
aliases {
console = "/serial@16340000";
uart2 = "/serial@12490000";
nand = "/nand@1A600000";
gmac_gpio = "/gmac1_gpio";
i2c0 = "/i2c@16380000";
@ -30,6 +31,11 @@
status = "ok";
};
serial@12490000 {
status = "ok";
};
gmac_cfg {
gmac_count = <2>;

View file

@ -276,7 +276,7 @@ int board_eth_init(bd_t *bis)
void qca_serial_init(struct ipq_serial_platdata *plat)
{
int serial_node, gpio_node;
int serial_node, gpio_node, uart2_node;
unsigned gsbi_base;
serial_node = fdt_path_offset(gd->fdt_blob, "console");
@ -284,6 +284,15 @@ void qca_serial_init(struct ipq_serial_platdata *plat)
return;
}
if (plat->port_id == 2) {
uart2_node = fdt_path_offset(gd->fdt_blob, "uart2");
if (uart2_node < 0) {
printf("uart2 node not defined\n");
} else {
serial_node = uart2_node;
}
}
gpio_node = fdt_subnode_offset(gd->fdt_blob,
serial_node, "serial_gpio");
gsbi_base = fdtdec_get_uint(gd->fdt_blob,
@ -292,15 +301,16 @@ void qca_serial_init(struct ipq_serial_platdata *plat)
return;
qca_gpio_init(gpio_node);
writel(GSBI_PROTOCOL_CODE_I2C_UART <<
GSBI_CTRL_REG_PROTOCOL_CODE_S,
GSBI_CTRL_REG(gsbi_base));
if (!(plat->m_value == -1) || ( plat->n_value == -1) || (plat->d_value == -1))
uart_clock_config(plat->port_id,
plat->m_value,
plat->n_value,
plat->d_value);
writel(GSBI_PROTOCOL_CODE_I2C_UART <<
GSBI_CTRL_REG_PROTOCOL_CODE_S,
GSBI_CTRL_REG(gsbi_base));
}
int ipq_fdt_fixup_socinfo(void *blob)