diff options
author | Konstantin Porotchkin <kostap@marvell.com> | 2017-02-16 11:52:26 (GMT) |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2017-03-23 07:50:50 (GMT) |
commit | 81b7c7f6379cfb6ca6b40b22504ad4ae8aca1fdd (patch) | |
tree | d9c28ff5a3b1fac36f91e89db00b1b8c63c7648e /board | |
parent | f7cab0f95b05ec6a66fe4796b9ad44406d0cc864 (diff) | |
download | u-boot-81b7c7f6379cfb6ca6b40b22504ad4ae8aca1fdd.tar.xz |
arm64: a37xx: Handle pin controls in early board init
Fix the default pin control values in a board-specific
function on early board init stage.
This fix allows the NETA driver to work in RGMII
mode until the full-featured pin control driver gets
introduced.
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Igal Liberman <igall@marvell.com>
Cc: Nadav Haklai <nadavh@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board')
-rw-r--r-- | board/Marvell/mvebu_armada-37xx/board.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index edf88c7..3337f3f 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -19,9 +19,33 @@ DECLARE_GLOBAL_DATA_PTR; #define I2C_IO_REG_0_SATA_OFF 2 #define I2C_IO_REG_0_USB_H_OFF 1 +#define PINCTRL_NB_REG_VALUE 0x000173fa +#define PINCTRL_SB_REG_VALUE 0x00007a23 + int board_early_init_f(void) { - /* Nothing to do (yet), perhaps later some pin-muxing etc */ + const void *blob = gd->fdt_blob; + const char *bank_name; + const char *compat = "marvell,armada-3700-pinctl"; + int off, len; + void __iomem *addr; + + /* FIXME + * Temporary WA for setting correct pin control values + * until the real pin control driver is awailable. + */ + off = fdt_node_offset_by_compatible(blob, -1, compat); + while (off != -FDT_ERR_NOTFOUND) { + bank_name = fdt_getprop(blob, off, "bank-name", &len); + addr = (void __iomem *)fdtdec_get_addr_size_auto_noparent( + blob, off, "reg", 0, NULL, true); + if (!strncmp(bank_name, "armada-3700-nb", len)) + writel(PINCTRL_NB_REG_VALUE, addr); + else if (!strncmp(bank_name, "armada-3700-sb", len)) + writel(PINCTRL_SB_REG_VALUE, addr); + + off = fdt_node_offset_by_compatible(blob, off, compat); + } return 0; } |