From a923abc2d3044324e3c88af7776469a31edf3121 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 25 Mar 2015 13:39:05 +0000 Subject: [PATCH 1/2] sunxi: set GMAC TX delay = 0x1 on Cubietruck. Of 4 boards in our automated test system 2 do not have reliable networking with the default TX delay of 0x0. Increasing to 0x1 seems to make things reliable on all 4 boards. Some previous ad-hpoc tests with tx delay set to 0, 1, 2 and 3 on one of the problematic boards showed: 0: mw.l 0x1c20164 0x006 1 -- t/o in 4/5 tftp runs 1: mw.l 0x1c20164 0x406 1 -- t/o in 1/5 tftp runs 2: mw.l 0x1c20164 0x806 1 -- t/o in 1/5 tftp runs 3: mw.l 0x1c20164 0xc06 1 -- t/o many times in first tftp run For 0, 1 and 2 "t/o" means one or two "T" glitches in the download, but it did complete. For 3 those were basically continuous and it couldn't complete. tftp was of a 16M initrd. Signed-off-by: Ian Campbell Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- configs/Cubietruck_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/Cubietruck_defconfig b/configs/Cubietruck_defconfig index 5c23bc7..fa48331 100644 --- a/configs/Cubietruck_defconfig +++ b/configs/Cubietruck_defconfig @@ -1,6 +1,7 @@ CONFIG_SPL=y CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPH(12),USB_EHCI" CONFIG_FDTFILE="sun7i-a20-cubietruck.dtb" +CONFIG_GMAC_TX_DELAY=1 CONFIG_VIDEO_VGA=y CONFIG_ARM=y CONFIG_ARCH_SUNXI=y From 99deda1dff206d679fcc87949b7151df0d47ea73 Mon Sep 17 00:00:00 2001 From: Iain Paton Date: Wed, 25 Mar 2015 16:03:26 +0000 Subject: [PATCH 2/2] sunxi: axp209: fix incorrect limits on ldo3 board/sunxi/board.c tries to set ldo3 to 2.8v however drivers/power/axp209.c contains an incorrect limit on ldo3 of 2.275v The origin of the incorrect limit seems likely due to some inconsistencies in the axp209 datasheet. ldo3 is described with different limits in different sections. register 0x29 uses 7 bits for voltage configuration while the 2.275v limit would apply if only 6 bits were used. Probably this is a cut&paste error from register 0x23 The linux kernel driver has the correct limit and operation up to the 2.8v required by my board has been physically verified with a multimeter. Signed-off-by: Iain Paton Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- drivers/power/axp209.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/axp209.c b/drivers/power/axp209.c index 4565398..f8c9b77 100644 --- a/drivers/power/axp209.c +++ b/drivers/power/axp209.c @@ -119,7 +119,7 @@ int axp209_set_ldo3(int mvolt) if (mvolt == -1) cfg = 0x80; /* determined by LDO3IN pin */ else - cfg = axp209_mvolt_to_cfg(mvolt, 700, 2275, 25); + cfg = axp209_mvolt_to_cfg(mvolt, 700, 3500, 25); return axp209_write(AXP209_LDO3_VOLTAGE, cfg); }