summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2016-04-25 16:24:58 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2016-06-22 14:36:37 +0200
commit2b2df33f913328b5fba328680b20417d3a3f4a59 (patch)
tree79e0ea2168706de2999acf280950388f912145cf
parent4387807fdaa7f5f2022b77368fac3041f9082ae0 (diff)
apalis_tk1: fix pcie gigabit ethernet initialisation
Fix PCIe gigabit Ethernet initialisation by explicitly controlling +V3.3_ETH provided by LDO9 and LDO10. Note: For this to work an assembly option needs to be patched on the current prototypes. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--board/toradex/apalis_tk1/apalis_tk1.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/board/toradex/apalis_tk1/apalis_tk1.c b/board/toradex/apalis_tk1/apalis_tk1.c
index 9952d13440..61b908a6da 100644
--- a/board/toradex/apalis_tk1/apalis_tk1.c
+++ b/board/toradex/apalis_tk1/apalis_tk1.c
@@ -96,6 +96,53 @@ int tegra_pcie_board_init(void)
/* Reset I210 Gigabit Ethernet Controller */
gpio_request(LAN_RESET_N, "LAN_RESET_N");
gpio_direction_output(LAN_RESET_N, 0);
+
+ /*
+ * Make sure we don't get any back feeding from LAN_WAKE_N resp.
+ * DEV_OFF_N
+ */
+ gpio_request(GPIO_PO5, "LAN_WAKE_N");
+ gpio_direction_output(GPIO_PO5, 0);
+
+ gpio_request(GPIO_PO6, "LAN_DEV_OFF_N");
+ gpio_direction_output(GPIO_PO6, 0);
+
+ /* Make sure LDO9 and LDO10 are initially enabled @ 0V */
+ err = as3722_ldo_enable(pmic, 9);
+ if (err < 0) {
+ error("failed to enable LDO9: %d\n", err);
+ return err;
+ }
+ err = as3722_ldo_enable(pmic, 10);
+ if (err < 0) {
+ error("failed to enable LDO10: %d\n", err);
+ return err;
+ }
+ err = as3722_ldo_set_voltage(pmic, 9, 0x80);
+ if (err < 0) {
+ error("failed to set LDO9 voltage: %d\n", err);
+ return err;
+ }
+ err = as3722_ldo_set_voltage(pmic, 10, 0x80);
+ if (err < 0) {
+ error("failed to set LDO10 voltage: %d\n", err);
+ return err;
+ }
+
+ mdelay(100);
+
+ /* Enable LDO9 and LDO10 for +V3.3_ETH on patched prototypes */
+ err = as3722_ldo_set_voltage(pmic, 9, 0xff);
+ if (err < 0) {
+ error("failed to set LDO9 voltage: %d\n", err);
+ return err;
+ }
+ err = as3722_ldo_set_voltage(pmic, 10, 0xff);
+ if (err < 0) {
+ error("failed to set LDO10 voltage: %d\n", err);
+ return err;
+ }
+
mdelay(100);
gpio_set_value(LAN_RESET_N, 1);