Re: U-Boot, d-i and selecting the console device
Karsten Merker <merker@debian.org> writes:
> On Fri, Jun 26, 2015 at 11:06:05AM +0200, Jens Thiele wrote:
>
>> The specific u-boot environment is needed for the lcd display
>> settings/timings. Would it be an option to build different u-boot
>> configurations for the different board+display combinations?
>
> AFAICS there doesn't seem to be a way in the u-boot KConfig
> system to define/modify specific variables in the default
> environment via config options, so I currently don't see how we
> could do that without changing the u-boot build system.
>
> How have you created the u-boot binaries listed in your table
> below? By manually patching the default environment definition
> in the source for each build?
i added one defconfig for each variant adding some CONFIG_VIDEO_xxx
lines and for the touchscreen changing the CONFIG_FDTFILE
lcd.diff:
$ git --no-pager diff-tree -u a90e77db..HEAD
diff --git a/configs/A20-OLinuXino-Lime2-lcd10_defconfig b/configs/A20-OLinuXino-Lime2-lcd10_defconfig
new file mode 100644
index 0000000..5ee48ab
--- /dev/null
+++ b/configs/A20-OLinuXino-Lime2-lcd10_defconfig
@@ -0,0 +1,12 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3),USB_EHCI"
+CONFIG_FDTFILE="sun7i-a20-olinuxino-lime2-ts.dtb"
+CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:45000,le:150,ri:16,up:21,lo:2,hs:10,vs:2,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_POWER="PH8"
+CONFIG_VIDEO_LCD_BL_PWM="PB2"
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_SUNXI=y
++S:CONFIG_MACH_SUN7I=y
++S:CONFIG_DRAM_CLK=480
++S:CONFIG_DRAM_ZQ=127
++S:CONFIG_DRAM_EMR1=4
diff --git a/configs/A20-OLinuXino-Lime2-lcd7_defconfig b/configs/A20-OLinuXino-Lime2-lcd7_defconfig
new file mode 100644
index 0000000..64cd30a
--- /dev/null
+++ b/configs/A20-OLinuXino-Lime2-lcd7_defconfig
@@ -0,0 +1,12 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3),USB_EHCI"
+CONFIG_FDTFILE="sun7i-a20-olinuxino-lime2-ts.dtb"
+CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_POWER="PH8"
...
the difference to the base defconfig:
prisirah@prisirah:~/u-boot-2015.01~karme1/configs$ diff -u A20-OLinuXino-Lime2_defconfig A20-OLinuXino-Lime2-lcd10_defconfig
--- A20-OLinuXino-Lime2_defconfig 2015-02-12 15:04:46.000000000 +0100
+++ A20-OLinuXino-Lime2-lcd10_defconfig 2015-02-12 15:04:46.000000000 +0100
@@ -1,6 +1,9 @@
CONFIG_SPL=y
CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER,SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3),USB_EHCI"
-CONFIG_FDTFILE="sun7i-a20-olinuxino-lime2.dtb"
+CONFIG_FDTFILE="sun7i-a20-olinuxino-lime2-ts.dtb"
+CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:45000,le:150,ri:16,up:21,lo:2,hs:10,vs:2,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_POWER="PH8"
+CONFIG_VIDEO_LCD_BL_PWM="PB2"
+S:CONFIG_ARM=y
+S:CONFIG_ARCH_SUNXI=y
+S:CONFIG_MACH_SUN7I=y
afair i did change the debian/rules:
override_dh_auto_build:
set -e; sed -n 's/^$(DEB_HOST_ARCH)[[:space:]]\+//p' debian/targets \
| while read subarch platform targets; do \
builddir=debian/build/$$platform; \
mkdir -p $$builddir; \
$(MAKE) O=$$builddir $${platform}_defconfig; \
$(MAKE) $(DEB_UBOOT_FLAGS) O=$$builddir all; \
for target in $$targets; do \
chmod -x $$builddir/$$target; \
cp -vl $$builddir/$$target $$builddir/u-boot-$$platform.bin ; \
echo $$builddir/u-boot-$$platform.bin /boot \
>> debian/build/targets.$$subarch; \
done ; \
done
# Avoid requirement for .config
mkdir -p $(TOOLSDIR)/include/config
touch $(TOOLSDIR)/include/config/auto.conf
# Load dummy config
make O=$(TOOLSDIR) sandbox_defconfig
and adjusted the debian/targets
s.a
http://karme.de/prisirah/debian/pool/main/u/u-boot/
>> The custom device tree is needed to make the touchscreen known. It looks
>> like such a device tree won't be accepted in mainline and one should use
>> device tree overlays. Is there anything related already in debian?
>
> AFAIK the devicetree quirks / overlays interface is still being
> discussed upstream, so there is no "official" solution yet.
ok
i think to bring up the initial console always will be somewhat ugly in
the directly connected lcd display case (afaiu no autodetection
possible, no user input) => the user has to make the choice before the
first boot - and imho the simplest method to do this is to just choose a
different u-boot image filename.
greetings,
jens
Reply to: