[U-Boot] [PATCH] sunxi: Fix wrong serial console setup in Forfun Q88DB tablet

The Forfun Q88DB tablet was unbootable since commit b6006baf9c2553543e3384983d23d95efbf24fa6 ("sunxi: Move all boards to the driver-model"). Appears that this is caused by the wrong serial console setup in the SPL. The serial console should use PG3/PG4 pins according to the FEX file.
Signed-off-by: Siarhei Siamashka siarhei.siamashka@gmail.com --- configs/forfun_q88db_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
While this should be a correct fix, the reason why the tablet failed to boot is a bit unclear. Without the correct CONS_INDEX setup, we should just get the serial console routed to the nonexisting pins B19/B20, and this is expected to be harmless. Maybe the DM code in the main U-Boot binary can't initialize serial console properly if we have a mismatch between the settings in the dts file and the CONS_INDEX settings in the SPL?
diff --git a/configs/forfun_q88db_defconfig b/configs/forfun_q88db_defconfig index 30cead7..30e0937 100644 --- a/configs/forfun_q88db_defconfig +++ b/configs/forfun_q88db_defconfig @@ -13,7 +13,7 @@ CONFIG_VIDEO_LCD_BL_PWM="PB2" CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-forfun-q88db" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y -CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER" +CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,AXP209_POWER" # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set

On Tue, 8 Sep 2015 17:49:08 +0300 Siarhei Siamashka siarhei.siamashka@gmail.com wrote:
The Forfun Q88DB tablet was unbootable since commit b6006baf9c2553543e3384983d23d95efbf24fa6 ("sunxi: Move all boards to the driver-model"). Appears that this is caused by the wrong serial console setup in the SPL. The serial console should use PG3/PG4 pins according to the FEX file.
Signed-off-by: Siarhei Siamashka siarhei.siamashka@gmail.com
configs/forfun_q88db_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
While this should be a correct fix, the reason why the tablet failed to boot is a bit unclear. Without the correct CONS_INDEX setup, we should just get the serial console routed to the nonexisting pins B19/B20, and this is expected to be harmless. Maybe the DM code in the main U-Boot binary can't initialize serial console properly if we have a mismatch between the settings in the dts file and the CONS_INDEX settings in the SPL?
Yes, as an experiment, pretending that the tablet has an A10S SoC (the same die as A13, but with more pins routed to the outside, including B19/B20) also "fixes" the boot issue:
index 24de86c..9254a42 100644 --- a/arch/arm/dts/sun5i-a13-forfun-q88db.dts +++ b/arch/arm/dts/sun5i-a13-forfun-q88db.dts @@ -7,14 +7,14 @@ */
/dts-v1/; -#include "sun5i-a13.dtsi" +#include "sun5i-a10s.dtsi"
/ { model = "Forfun Q88db"; compatible = "forfun,q88db", "allwinner,sun5i-a13";
aliases { - serial0 = &uart1; + serial0 = &uart0; };
chosen { @@ -22,8 +22,8 @@ }; };
-&uart1 { +&uart0 { pinctrl-names = "default"; - pinctrl-0 = <&uart1_pins_b>; + pinctrl-0 = <&uart0_pins_a>; status = "okay"; };
Is something broken in the sunxi DM serial code, so that it partially relies on the SPL configuring the UART pins properly?

Hi,
On 08-09-15 16:49, Siarhei Siamashka wrote:
The Forfun Q88DB tablet was unbootable since commit b6006baf9c2553543e3384983d23d95efbf24fa6 ("sunxi: Move all boards to the driver-model"). Appears that this is caused by the wrong serial console setup in the SPL. The serial console should use PG3/PG4 pins according to the FEX file.
Signed-off-by: Siarhei Siamashka siarhei.siamashka@gmail.com
Thanks I've queued this up in my tree and it will be part of my next pull-req.
configs/forfun_q88db_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
While this should be a correct fix, the reason why the tablet failed to boot is a bit unclear. Without the correct CONS_INDEX setup, we should just get the serial console routed to the nonexisting pins B19/B20, and this is expected to be harmless. Maybe the DM code in the main U-Boot binary can't initialize serial console properly if we have a mismatch between the settings in the dts file and the CONS_INDEX settings in the SPL?
Yes this is a problem with the dm code vs the dts. I hit the same problem when creating a generic q8_a13_tablet_defconfig.
Talking about the generic q8_a13_tablet_defconfig (currently in my sunxi-wip, soon upstream). This one should work fine for the forfun_q88db too. The idea is to have a single config which works on all q8 a13 tablets as it is impossible for users to figure out which variant they exactly have.
We are still figuring out what to do wrt different touchscreen controllers / accelerometers, but we can likely come up with some autodetection for that (either in u-boot or in the kernel).
Since currently we do not support any touchscreen controllers / accelerometers in such tablets in the mainline kernel this is a non issue for now.
Can you try this new defconfig on your forfun_q88db? An added advantage is that it comes with a kernel dts too, which the forfun seems to be missing (currently only available in my sunxi-wip kernel branch).
If the q8_a13_tablet_defconfig works well for the forfun_q88db I would like to drop that as a target from u-boot, is that ok with you ?
Regards,
Hans
diff --git a/configs/forfun_q88db_defconfig b/configs/forfun_q88db_defconfig index 30cead7..30e0937 100644 --- a/configs/forfun_q88db_defconfig +++ b/configs/forfun_q88db_defconfig @@ -13,7 +13,7 @@ CONFIG_VIDEO_LCD_BL_PWM="PB2" CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-forfun-q88db" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y -CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER" +CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,AXP209_POWER" # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set
participants (2)
-
Hans de Goede
-
Siarhei Siamashka