diff options
79 files changed, 1127 insertions, 5711 deletions
| @@ -1,6 +1,8 @@  *~  *.o +/cache/  /lbmk.err.log +/repo/  /docs/  /pciroms/  /util/dell-flash-unlock/dell_flash_unlock @@ -31,3 +33,4 @@  /CHANGELOG  /todo.txt  /lock +/hash/ @@ -16,7 +16,7 @@ fi  . "include/vendor.sh"  . "include/mrc.sh" -eval `setvars "" vdir src_dirname srcdir mode xp` +eval `setvars "" vdir src_dirname srcdir mode xp ser`  err="fail"  main() @@ -34,6 +34,12 @@ main()  	release) shift 1; mkrelease $@ ;;  	inject) shift 1; vendor_inject $@ ;;  	download) shift 1; vendor_download $@ ;; +	roms) +		if [ $# -gt 1 ] && [ "$2" = "serprog" ]; then +			x_ ./update trees -b stm32-vserprog +			x_ ./update trees -b pico-serprog; return 0 +		fi; shift 1 +		x_ ./update trees -b coreboot $@ ;;  	*)  		[ -f "$spath" ] || $err "bad command"  		shift 1; "$spath" $@ || $err "excmd: $spath $@" ;; @@ -94,6 +100,7 @@ build_release()  	cd "$srcdir" || $err "$vdir: !cd \"$srcdir\""  	./update trees -f  	rmgit . +	x_ rm -Rf tmp  	x_ mv src/docs docs  	) || $err "can't create release files" @@ -111,9 +118,9 @@ build_release()  	(  	cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\"" -	./build roms all || $err "$vdir: roms-all" -	./build roms serprog rp2040 || $err "$vdir: rp2040" -	./build roms serprog stm32 || $err "$vdir: stm32" +	./update trees -b coreboot || $err "$vdir: roms-all" +	./update trees -b pico-serprog || $err "$vdir: rp2040" +	./update trees -b stm32-vserprog || $err "$vdir: stm32"  	x_ mv bin ../roms  	) || $err "can't build rom images" diff --git a/config/coreboot/d510mo/target.cfg b/config/coreboot/d510mo/target.cfg index 2be9c81b..bb79aee5 100644 --- a/config/coreboot/d510mo/target.cfg +++ b/config/coreboot/d510mo/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_memtest="y"  release="n" +build_depend="seabios/default memtest86plus" diff --git a/config/coreboot/d945gclf_512kb/target.cfg b/config/coreboot/d945gclf_512kb/target.cfg index cc133e56..d2d78f7a 100644 --- a/config/coreboot/d945gclf_512kb/target.cfg +++ b/config/coreboot/d945gclf_512kb/target.cfg @@ -2,3 +2,4 @@ tree="default"  xarch="i386-elf"  payload_seabios="y"  release="n" +build_depend="seabios/default" diff --git a/config/coreboot/d945gclf_8mb/target.cfg b/config/coreboot/d945gclf_8mb/target.cfg index 3f020323..0d97499e 100644 --- a/config/coreboot/d945gclf_8mb/target.cfg +++ b/config/coreboot/d945gclf_8mb/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_grub="y"  release="n" +build_depend="seabios/default grub/default" diff --git a/config/coreboot/dell9020mt_nri_12mb/target.cfg b/config/coreboot/dell9020mt_nri_12mb/target.cfg index 3c3f9802..6d2e9a22 100644 --- a/config/coreboot/dell9020mt_nri_12mb/target.cfg +++ b/config/coreboot/dell9020mt_nri_12mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  grub_scan_disk="nvme ahci"  grubtree="xhci"  vcfg="haswell" +build_depend="seabios/default grub/xhci memtest86plus" diff --git a/config/coreboot/dell9020sff_nri_12mb/target.cfg b/config/coreboot/dell9020sff_nri_12mb/target.cfg index 3c3f9802..6d2e9a22 100644 --- a/config/coreboot/dell9020sff_nri_12mb/target.cfg +++ b/config/coreboot/dell9020sff_nri_12mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  grub_scan_disk="nvme ahci"  grubtree="xhci"  vcfg="haswell" +build_depend="seabios/default grub/xhci memtest86plus" diff --git a/config/coreboot/g43t_am3/target.cfg b/config/coreboot/g43t_am3/target.cfg index 796ceabf..7f3d7886 100644 --- a/config/coreboot/g43t_am3/target.cfg +++ b/config/coreboot/g43t_am3/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_memtest="y"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/g43t_am3_16mb/target.cfg b/config/coreboot/g43t_am3_16mb/target.cfg index 46e8fc4f..594b6612 100644 --- a/config/coreboot/g43t_am3_16mb/target.cfg +++ b/config/coreboot/g43t_am3_16mb/target.cfg @@ -4,3 +4,4 @@ payload_seabios="y"  payload_memtest="y"  release="n"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/ga_g41m_es2l/target.cfg b/config/coreboot/ga_g41m_es2l/target.cfg index 796ceabf..7f3d7886 100644 --- a/config/coreboot/ga_g41m_es2l/target.cfg +++ b/config/coreboot/ga_g41m_es2l/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_memtest="y"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/gru_bob/target.cfg b/config/coreboot/gru_bob/target.cfg index a7c36159..482ff306 100644 --- a/config/coreboot/gru_bob/target.cfg +++ b/config/coreboot/gru_bob/target.cfg @@ -1,3 +1,4 @@  tree="default"  xarch="aarch64-elf arm-eabi"  payload_uboot="y" +build_depend="u-boot/gru_bob" diff --git a/config/coreboot/gru_kevin/target.cfg b/config/coreboot/gru_kevin/target.cfg index a7c36159..993bf617 100644 --- a/config/coreboot/gru_kevin/target.cfg +++ b/config/coreboot/gru_kevin/target.cfg @@ -1,3 +1,4 @@  tree="default"  xarch="aarch64-elf arm-eabi"  payload_uboot="y" +build_depend="u-boot/gru_kevin" diff --git a/config/coreboot/hp8200sff_4mb/target.cfg b/config/coreboot/hp8200sff_4mb/target.cfg index 59c6f1d1..54966da1 100644 --- a/config/coreboot/hp8200sff_4mb/target.cfg +++ b/config/coreboot/hp8200sff_4mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  grub_scan_disk="nvme ahci"  grubtree="nvme"  vcfg="hp8200sff" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/hp8200sff_8mb/target.cfg b/config/coreboot/hp8200sff_8mb/target.cfg index 59c6f1d1..54966da1 100644 --- a/config/coreboot/hp8200sff_8mb/target.cfg +++ b/config/coreboot/hp8200sff_8mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  grub_scan_disk="nvme ahci"  grubtree="nvme"  vcfg="hp8200sff" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/hp820g2_12mb/target.cfg b/config/coreboot/hp820g2_12mb/target.cfg index 26a51303..99be701a 100644 --- a/config/coreboot/hp820g2_12mb/target.cfg +++ b/config/coreboot/hp820g2_12mb/target.cfg @@ -7,3 +7,4 @@ release="n"  grub_scan_disk="nvme ahci"  grubtree="xhci"  vcfg="hp820g2" +build_depend="seabios/default grub/xhci memtest86plus" diff --git a/config/coreboot/hp8300cmt_16mb/target.cfg b/config/coreboot/hp8300cmt_16mb/target.cfg index 247bb3f1..d0e19b73 100644 --- a/config/coreboot/hp8300cmt_16mb/target.cfg +++ b/config/coreboot/hp8300cmt_16mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  grub_scan_disk="nvme ahci"  grubtree="nvme"  vcfg="ivybridge" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/kcma_d8-udimm_16mb/target.cfg b/config/coreboot/kcma_d8-udimm_16mb/target.cfg index ce97e14f..8be2926f 100644 --- a/config/coreboot/kcma_d8-udimm_16mb/target.cfg +++ b/config/coreboot/kcma_d8-udimm_16mb/target.cfg @@ -8,3 +8,4 @@ xlang="c"  grub_timout=10  grub_scan_disk="nvme ahci"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/kcma_d8_rdimm_16mb/target.cfg b/config/coreboot/kcma_d8_rdimm_16mb/target.cfg index cb012f9f..fbe50f7a 100644 --- a/config/coreboot/kcma_d8_rdimm_16mb/target.cfg +++ b/config/coreboot/kcma_d8_rdimm_16mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  xlang="c"  grub_scan_disk="nvme ahci"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/kcma_d8_rdimm_2mb/target.cfg b/config/coreboot/kcma_d8_rdimm_2mb/target.cfg index cb012f9f..fbe50f7a 100644 --- a/config/coreboot/kcma_d8_rdimm_2mb/target.cfg +++ b/config/coreboot/kcma_d8_rdimm_2mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  xlang="c"  grub_scan_disk="nvme ahci"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/kcma_d8_udimm_2mb/target.cfg b/config/coreboot/kcma_d8_udimm_2mb/target.cfg index 9c3a0902..259dbb9b 100644 --- a/config/coreboot/kcma_d8_udimm_2mb/target.cfg +++ b/config/coreboot/kcma_d8_udimm_2mb/target.cfg @@ -7,3 +7,4 @@ payload_memtest="y"  xlang="c"  grub_scan_disk="nvme ahci"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/kfsn4_dre_1mb/target.cfg b/config/coreboot/kfsn4_dre_1mb/target.cfg index 79ca98c4..a7d7e297 100644 --- a/config/coreboot/kfsn4_dre_1mb/target.cfg +++ b/config/coreboot/kfsn4_dre_1mb/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_memtest="y"  xlang="c" +build_depend="seabios/default memtest86plus" diff --git a/config/coreboot/kgpe_d16_rdimm_16mb/target.cfg b/config/coreboot/kgpe_d16_rdimm_16mb/target.cfg index cb012f9f..fbe50f7a 100644 --- a/config/coreboot/kgpe_d16_rdimm_16mb/target.cfg +++ b/config/coreboot/kgpe_d16_rdimm_16mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  xlang="c"  grub_scan_disk="nvme ahci"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/kgpe_d16_rdimm_2mb/target.cfg b/config/coreboot/kgpe_d16_rdimm_2mb/target.cfg index cb012f9f..fbe50f7a 100644 --- a/config/coreboot/kgpe_d16_rdimm_2mb/target.cfg +++ b/config/coreboot/kgpe_d16_rdimm_2mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  xlang="c"  grub_scan_disk="nvme ahci"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/kgpe_d16_udimm_16mb/target.cfg b/config/coreboot/kgpe_d16_udimm_16mb/target.cfg index 9c3a0902..259dbb9b 100644 --- a/config/coreboot/kgpe_d16_udimm_16mb/target.cfg +++ b/config/coreboot/kgpe_d16_udimm_16mb/target.cfg @@ -7,3 +7,4 @@ payload_memtest="y"  xlang="c"  grub_scan_disk="nvme ahci"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/kgpe_d16_udimm_2mb/target.cfg b/config/coreboot/kgpe_d16_udimm_2mb/target.cfg index 9c3a0902..259dbb9b 100644 --- a/config/coreboot/kgpe_d16_udimm_2mb/target.cfg +++ b/config/coreboot/kgpe_d16_udimm_2mb/target.cfg @@ -7,3 +7,4 @@ payload_memtest="y"  xlang="c"  grub_scan_disk="nvme ahci"  grubtree="nvme" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/macbook11/target.cfg b/config/coreboot/macbook11/target.cfg index c7eddcc2..1add675c 100644 --- a/config/coreboot/macbook11/target.cfg +++ b/config/coreboot/macbook11/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_grub="y"  grub_scan_disk="ahci" +build_depend="seabios/default grub/default" diff --git a/config/coreboot/macbook11_16mb/target.cfg b/config/coreboot/macbook11_16mb/target.cfg index 1bdb98f1..03a4d349 100644 --- a/config/coreboot/macbook11_16mb/target.cfg +++ b/config/coreboot/macbook11_16mb/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_grub="y"  scan_scan_disk="ahci" +build_depend="seabios/default grub/default" diff --git a/config/coreboot/qemu_arm64_12mb/target.cfg b/config/coreboot/qemu_arm64_12mb/target.cfg index a7c36159..980de84f 100644 --- a/config/coreboot/qemu_arm64_12mb/target.cfg +++ b/config/coreboot/qemu_arm64_12mb/target.cfg @@ -1,3 +1,4 @@  tree="default"  xarch="aarch64-elf arm-eabi"  payload_uboot="y" +build_depend="u-boot/qemu_arm64_12mb" diff --git a/config/coreboot/t1650_12mb/target.cfg b/config/coreboot/t1650_12mb/target.cfg index edbca096..abc1d14e 100644 --- a/config/coreboot/t1650_12mb/target.cfg +++ b/config/coreboot/t1650_12mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  grub_scan_disk="nvme ahci"  grubtree="nvme"  vcfg="t1650" +build_depend="seabios/default grub/nvme memtest86plus" diff --git a/config/coreboot/t440plibremrc_12mb/target.cfg b/config/coreboot/t440plibremrc_12mb/target.cfg index 3c3f9802..6d2e9a22 100644 --- a/config/coreboot/t440plibremrc_12mb/target.cfg +++ b/config/coreboot/t440plibremrc_12mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  grub_scan_disk="nvme ahci"  grubtree="xhci"  vcfg="haswell" +build_depend="seabios/default grub/xhci memtest86plus" diff --git a/config/coreboot/t60_16mb_intelgpu/target.cfg b/config/coreboot/t60_16mb_intelgpu/target.cfg index c7eddcc2..1add675c 100644 --- a/config/coreboot/t60_16mb_intelgpu/target.cfg +++ b/config/coreboot/t60_16mb_intelgpu/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_grub="y"  grub_scan_disk="ahci" +build_depend="seabios/default grub/default" diff --git a/config/coreboot/t60_intelgpu/target.cfg b/config/coreboot/t60_intelgpu/target.cfg index c7eddcc2..1add675c 100644 --- a/config/coreboot/t60_intelgpu/target.cfg +++ b/config/coreboot/t60_intelgpu/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_grub="y"  grub_scan_disk="ahci" +build_depend="seabios/default grub/default" diff --git a/config/coreboot/w541_12mb/target.cfg b/config/coreboot/w541_12mb/target.cfg index 3c3f9802..6d2e9a22 100644 --- a/config/coreboot/w541_12mb/target.cfg +++ b/config/coreboot/w541_12mb/target.cfg @@ -6,3 +6,4 @@ payload_memtest="y"  grub_scan_disk="nvme ahci"  grubtree="xhci"  vcfg="haswell" +build_depend="seabios/default grub/xhci memtest86plus" diff --git a/config/coreboot/x60/target.cfg b/config/coreboot/x60/target.cfg index c7eddcc2..1add675c 100644 --- a/config/coreboot/x60/target.cfg +++ b/config/coreboot/x60/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_grub="y"  grub_scan_disk="ahci" +build_depend="seabios/default grub/default" diff --git a/config/coreboot/x60_16mb/target.cfg b/config/coreboot/x60_16mb/target.cfg index c7eddcc2..1add675c 100644 --- a/config/coreboot/x60_16mb/target.cfg +++ b/config/coreboot/x60_16mb/target.cfg @@ -3,3 +3,4 @@ xarch="i386-elf"  payload_seabios="y"  payload_grub="y"  grub_scan_disk="ahci" +build_depend="seabios/default grub/default" diff --git a/config/data/coreboot/build.list b/config/data/coreboot/build.list deleted file mode 100644 index f6535149..00000000 --- a/config/data/coreboot/build.list +++ /dev/null @@ -1 +0,0 @@ -build/coreboot.rom diff --git a/config/data/coreboot/mkhelper.cfg b/config/data/coreboot/mkhelper.cfg new file mode 100644 index 00000000..de07b4c1 --- /dev/null +++ b/config/data/coreboot/mkhelper.cfg @@ -0,0 +1,16 @@ +. "include/rom.sh" + +makeargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" +build_depend="seabios/default grub/default memtest86plus" + +seavgabiosrom="elf/seabios/default/libgfxinit/vgabios.bin" + +pv="payload_uboot payload_seabios payload_memtest payload_grub" +v="initmode ubootelf grub_scan_disk uboot_config grubtree grubelf pname" +v="$v displaymode tmprom" +eval `setvars "n" $pv` +eval `setvars "" $v` + +premake="mkvendorfiles" +mkhelper="mkcorebootbin" +postmake="mkcoreboottar" diff --git a/config/data/grub/mkhelper.cfg b/config/data/grub/mkhelper.cfg index ff93a27c..b75cf9d7 100644 --- a/config/data/grub/mkhelper.cfg +++ b/config/data/grub/mkhelper.cfg @@ -1,3 +1,5 @@ +. "include/rom.sh" +  bootstrapargs="--gnulib-srcdir=gnulib/ --no-git"  autoconfargs="--with-platform=coreboot --disable-werror"  makeargs="FS_PAYLOAD_MODULES=\"\"" diff --git a/config/data/grub/module/xhci b/config/data/grub/module/xhci index 8bf80bfe..6235bbad 100755 --- a/config/data/grub/module/xhci +++ b/config/data/grub/module/xhci @@ -8,6 +8,7 @@ usbserial_ftdi \  usbserial_pl2303 \  usbserial_usbdebug \  video_colors \ +xhci \  "  # Modules (and always loaded)  grub_modules=" \ @@ -35,7 +36,6 @@ crypto \  cryptodisk \  diskfilter \  echo \ -xhci \  ehci \  eval \  exfat \ diff --git a/config/data/pico-serprog/mkhelper.cfg b/config/data/pico-serprog/mkhelper.cfg new file mode 100644 index 00000000..e424e2f4 --- /dev/null +++ b/config/data/pico-serprog/mkhelper.cfg @@ -0,0 +1,7 @@ +. "include/rom.sh" + +sersrc="src/pico-serprog" +serx="$sersrc/build/pico_serprog.uf2" +picosdk="src/pico-sdk" +serdir="$picosdk/src/boards/include/boards" +premake="mkserprog rp2040" diff --git a/config/data/seabios/mkhelper.cfg b/config/data/seabios/mkhelper.cfg new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/config/data/seabios/mkhelper.cfg diff --git a/config/data/stm32-vserprog/mkhelper.cfg b/config/data/stm32-vserprog/mkhelper.cfg new file mode 100644 index 00000000..8f45d7fd --- /dev/null +++ b/config/data/stm32-vserprog/mkhelper.cfg @@ -0,0 +1,6 @@ +. "include/rom.sh" + +sersrc="src/stm32-vserprog" +serx="$sersrc/stm32-vserprog.hex" +serdir="$sersrc/boards" +mkhelper="mkserprog stm32" diff --git a/config/u-boot/default/patches/0001-clk-rockchip-rk3399-Set-hardcoded-clock-rates-same-a.patch b/config/u-boot/default/patches/0001-clk-rockchip-rk3399-Set-hardcoded-clock-rates-same-a.patch index 4a3e8687..4ceeac59 100644 --- a/config/u-boot/default/patches/0001-clk-rockchip-rk3399-Set-hardcoded-clock-rates-same-a.patch +++ b/config/u-boot/default/patches/0001-clk-rockchip-rk3399-Set-hardcoded-clock-rates-same-a.patch @@ -1,4 +1,4 @@ -From 27d49512277677afb7f71e093b007b3e2022b83e Mon Sep 17 00:00:00 2001 +From f98475a64fcfe6ef710acb29391c33c17903e580 Mon Sep 17 00:00:00 2001  From: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Date: Fri, 8 Oct 2021 17:33:22 +0300  Subject: [PATCH] clk: rockchip: rk3399: Set hardcoded clock rates same as @@ -60,7 +60,7 @@ index d941a129f3e5..54035c0df1f3 100644   #define PWM_CLOCK_HZ    PMU_PCLK_HZ  diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c -index f748fb5189e0..33f02c2d633c 100644 +index 67b2c05ec9ed..754b35c23197 100644  --- a/drivers/clk/rockchip/clk_rk3399.c  +++ b/drivers/clk/rockchip/clk_rk3399.c  @@ -54,10 +54,11 @@ struct pll_div { @@ -87,7 +87,7 @@ index f748fb5189e0..33f02c2d633c 100644   	void *aclkreg_addr, *dclkreg_addr;   	u32 div; -@@ -1336,6 +1337,7 @@ static void rkclk_init(struct rockchip_cru *cru) +@@ -1395,6 +1396,7 @@ static void rkclk_init(struct rockchip_cru *cru)   	/* configure gpll cpll */   	rkclk_set_pll(&cru->gpll_con[0], &gpll_init_cfg);   	rkclk_set_pll(&cru->cpll_con[0], &cpll_init_cfg); @@ -96,5 +96,5 @@ index f748fb5189e0..33f02c2d633c 100644   	/* configure perihp aclk, hclk, pclk */   	aclk_div = GPLL_HZ / PERIHP_ACLK_HZ - 1;  --  -2.42.0 +2.45.2 diff --git a/config/u-boot/default/patches/0002-video-improve-UEFI-experience-on-DM_VIDEO.patch b/config/u-boot/default/patches/0002-video-improve-UEFI-experience-on-DM_VIDEO.patch index cd5a2751..d5c6788a 100644 --- a/config/u-boot/default/patches/0002-video-improve-UEFI-experience-on-DM_VIDEO.patch +++ b/config/u-boot/default/patches/0002-video-improve-UEFI-experience-on-DM_VIDEO.patch @@ -1,7 +1,7 @@ -From ac31b6bc4bcfc328342ec1677db5b80548d43b35 Mon Sep 17 00:00:00 2001 +From 3e1e14e0b14539ca42db40488c7b1067eb01dea4 Mon Sep 17 00:00:00 2001  From: Andre Przywara <andre.przywara@arm.com>  Date: Mon, 10 Jan 2022 00:56:31 +0000 -Subject: [PATCH 1/4] video: Add cursor support for video consoles +Subject: [PATCH 1/3] video: Add cursor support for video consoles  So far the video console is completely lacking any cursor, which makes  typing and correcting quite irritating. @@ -24,7 +24,7 @@ Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>   3 files changed, 44 insertions(+)  diff --git a/drivers/video/console_core.c b/drivers/video/console_core.c -index b5d0e3dceca3..60de5fcacb82 100644 +index 939363653f6c..6b531718276f 100644  --- a/drivers/video/console_core.c  +++ b/drivers/video/console_core.c  @@ -30,6 +30,7 @@ static int console_set_font(struct udevice *dev, struct video_fontdata *fontdata @@ -36,10 +36,10 @@ index b5d0e3dceca3..60de5fcacb82 100644   	vc_priv->y_charsize = fontdata->height;   	if (vid_priv->rot % 2) {  diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c -index b5b3b6625902..a6d994bd637c 100644 +index 80e7adf6a1a4..8b2ef51f1b3b 100644  --- a/drivers/video/vidconsole-uclass.c  +++ b/drivers/video/vidconsole-uclass.c -@@ -56,6 +56,26 @@ static int vidconsole_entry_start(struct udevice *dev) +@@ -57,6 +57,26 @@ int vidconsole_entry_start(struct udevice *dev)   	return ops->entry_start(dev);   } @@ -66,7 +66,7 @@ index b5b3b6625902..a6d994bd637c 100644   /* Move backwards one space */   static int vidconsole_back(struct udevice *dev)   { -@@ -63,6 +83,8 @@ static int vidconsole_back(struct udevice *dev) +@@ -64,6 +84,8 @@ static int vidconsole_back(struct udevice *dev)   	struct vidconsole_ops *ops = vidconsole_get_ops(dev);   	int ret; @@ -75,7 +75,7 @@ index b5b3b6625902..a6d994bd637c 100644   	if (ops->backspace) {   		ret = ops->backspace(dev);   		if (ret != -ENOSYS) -@@ -89,6 +111,8 @@ static void vidconsole_newline(struct udevice *dev) +@@ -90,6 +112,8 @@ static void vidconsole_newline(struct udevice *dev)   	const int rows = CONFIG_VAL(CONSOLE_SCROLL_LINES);   	int i, ret; @@ -84,7 +84,7 @@ index b5b3b6625902..a6d994bd637c 100644   	priv->xcur_frac = priv->xstart_frac;   	priv->ycur += priv->y_charsize; -@@ -282,6 +306,14 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) +@@ -284,6 +308,14 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)   		break;   	} @@ -99,9 +99,9 @@ index b5b3b6625902..a6d994bd637c 100644   	case 'J': {   		int mode; -@@ -456,6 +488,11 @@ int vidconsole_put_char(struct udevice *dev, char ch) +@@ -458,6 +490,11 @@ int vidconsole_put_char(struct udevice *dev, char ch)   	struct vidconsole_priv *priv = dev_get_uclass_priv(dev); - 	int ret; + 	int cp, ret;  +	/*  +	 * We don't need to clear the cursor since we are going to overwrite @@ -111,7 +111,7 @@ index b5b3b6625902..a6d994bd637c 100644   	if (priv->escape) {   		vidconsole_escape_char(dev, ch);   		return 0; -@@ -470,6 +507,7 @@ int vidconsole_put_char(struct udevice *dev, char ch) +@@ -472,6 +509,7 @@ int vidconsole_put_char(struct udevice *dev, char ch)   		/* beep */   		break;   	case '\r': @@ -119,7 +119,7 @@ index b5b3b6625902..a6d994bd637c 100644   		priv->xcur_frac = priv->xstart_frac;   		break;   	case '\n': -@@ -477,6 +515,7 @@ int vidconsole_put_char(struct udevice *dev, char ch) +@@ -479,6 +517,7 @@ int vidconsole_put_char(struct udevice *dev, char ch)   		vidconsole_entry_start(dev);   		break;   	case '\t':	/* Tab (8 chars alignment) */ @@ -127,7 +127,7 @@ index b5b3b6625902..a6d994bd637c 100644   		priv->xcur_frac = ((priv->xcur_frac / priv->tab_width_frac)   				+ 1) * priv->tab_width_frac; -@@ -494,6 +533,8 @@ int vidconsole_put_char(struct udevice *dev, char ch) +@@ -503,6 +542,8 @@ int vidconsole_put_char(struct udevice *dev, char ch)   		break;   	} @@ -136,7 +136,7 @@ index b5b3b6625902..a6d994bd637c 100644   	return 0;   } -@@ -646,6 +687,7 @@ static int vidconsole_pre_probe(struct udevice *dev) +@@ -723,6 +764,7 @@ static int vidconsole_pre_probe(struct udevice *dev)   	struct video_priv *vid_priv = dev_get_uclass_priv(vid);   	priv->xsize_frac = VID_TO_POS(vid_priv->xsize); @@ -145,25 +145,27 @@ index b5b3b6625902..a6d994bd637c 100644   	return 0;   }  diff --git a/include/video_console.h b/include/video_console.h -index 2694e44f6ecf..949abb3861e7 100644 +index 8b5928dc5ebb..00c5ecb664b9 100644  --- a/include/video_console.h  +++ b/include/video_console.h -@@ -59,6 +59,7 @@ struct vidconsole_priv { +@@ -66,6 +66,7 @@ struct vidconsole_priv {   	int escape_len;   	int row_saved;   	int col_saved;  +	bool cursor_visible;   	char escape_buf[32]; + 	char utf8_buf[5];   }; -  + +base-commit: 475aa8345a78396d39b42f96eccecd37ebe24e99  --  -2.42.0 +2.45.2 -From ab8ddf81c1442717f6ffddc3460d4e4adbd5b570 Mon Sep 17 00:00:00 2001 +From 0dd4fb08993b01d36e491705b24063834dcb618e Mon Sep 17 00:00:00 2001  From: Andre Przywara <andre.przywara@arm.com>  Date: Mon, 10 Jan 2022 00:56:36 +0000 -Subject: [PATCH 2/4] efi-selftest: Add international characters test +Subject: [PATCH 2/3] efi-selftest: Add international characters test  UEFI relies entirely on unicode output, which actual fonts displayed on  the screen might not be ready for. @@ -180,10 +182,10 @@ Link: https://lore.kernel.org/r/20220110005638.21599-7-andre.przywara@arm.com   1 file changed, 5 insertions(+)  diff --git a/lib/efi_selftest/efi_selftest_textoutput.c b/lib/efi_selftest/efi_selftest_textoutput.c -index cc44b38bc23a..175731ae96b6 100644 +index a3023c82567c..2f8d8d323c2b 100644  --- a/lib/efi_selftest/efi_selftest_textoutput.c  +++ b/lib/efi_selftest/efi_selftest_textoutput.c -@@ -118,6 +118,11 @@ static int execute(void) +@@ -154,6 +154,11 @@ static int execute(void)   		efi_st_printf("Unicode not handled properly\n");   		return EFI_ST_FAILURE;   	} @@ -193,16 +195,16 @@ index cc44b38bc23a..175731ae96b6 100644  +		return EFI_ST_FAILURE;  +	}   	efi_st_printf("\n"); -  - 	return EFI_ST_SUCCESS; + 	ret = con_out->output_string(con_out, text); + 	if (ret != EFI_ST_SUCCESS) {  --  -2.42.0 +2.45.2 -From 48e918c31a46815325ffd7a77eb7a3ffedf8e59c Mon Sep 17 00:00:00 2001 +From 13101947807bec7ceaf3231d94e943b9b29a7369 Mon Sep 17 00:00:00 2001  From: Andre Przywara <andre.przywara@arm.com>  Date: Mon, 10 Jan 2022 00:56:37 +0000 -Subject: [PATCH 3/4] efi_selftest: Add box drawing character selftest +Subject: [PATCH 3/3] efi_selftest: Add box drawing character selftest  UEFI applications rely on Unicode output capability, and might use that  for drawing pseudo-graphical interfaces using Unicode defined box @@ -220,10 +222,10 @@ Link: https://lore.kernel.org/r/20220110005638.21599-8-andre.przywara@arm.com   1 file changed, 11 insertions(+)  diff --git a/lib/efi_selftest/efi_selftest_textoutput.c b/lib/efi_selftest/efi_selftest_textoutput.c -index 175731ae96b6..3c6870f74241 100644 +index 2f8d8d323c2b..02209a5bf224 100644  --- a/lib/efi_selftest/efi_selftest_textoutput.c  +++ b/lib/efi_selftest/efi_selftest_textoutput.c -@@ -123,6 +123,17 @@ static int execute(void) +@@ -159,6 +159,17 @@ static int execute(void)   		efi_st_error("OutputString failed for international chars\n");   		return EFI_ST_FAILURE;   	} @@ -239,275 +241,8 @@ index 175731ae96b6..3c6870f74241 100644  +	con_out->output_string(con_out, L"waiting for admiration...\n");  +	EFI_CALL(systab.boottime->stall(3000000));   	efi_st_printf("\n"); -  - 	return EFI_ST_SUCCESS; ---  -2.42.0 - - -From 407ca7e821aabf240c2602dd0db56d6398a0c03b Mon Sep 17 00:00:00 2001 -From: Andre Przywara <andre.przywara@arm.com> -Date: Mon, 10 Jan 2022 00:56:38 +0000 -Subject: [PATCH 4/4] video: Convert UTF-8 input stream to the 437 code page - -The bitmap fonts (VGA 8x16 and friends) we import from Linux use the -437 code page to map their glyphs. For U-Boot's own purposes this is -probably fine, but UEFI applications output Unicode, which only matches -in the very basic first 127 characters. - -Add a function that converts UTF-8 character sequences into the -respective CP437 code point, as far as the characters defined in there -allow this. This includes quite some international and box drawing -characters, which are used by UEFI applications. - -Signed-off-by: Andre Przywara <andre.przywara@arm.com> -Link: https://lore.kernel.org/r/20220110005638.21599-9-andre.przywara@arm.com -[Alper: Rebase for makefile changes, use $(SPL_TPL_)VIDEO] -Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> ---- - drivers/video/Makefile            |   1 + - drivers/video/utf8_cp437.c        | 169 ++++++++++++++++++++++++++++++ - drivers/video/vidconsole-uclass.c |   6 +- - include/video_console.h           |   9 ++ - 4 files changed, 184 insertions(+), 1 deletion(-) - create mode 100644 drivers/video/utf8_cp437.c - -diff --git a/drivers/video/Makefile b/drivers/video/Makefile -index d13af9f3b19b..4b1983990aba 100644 ---- a/drivers/video/Makefile -+++ b/drivers/video/Makefile -@@ -20,6 +20,7 @@ obj-$(CONFIG_DISPLAY) += display-uclass.o - obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi-host-uclass.o - obj-$(CONFIG_$(SPL_TPL_)VIDEO) += video-uclass.o vidconsole-uclass.o - obj-$(CONFIG_$(SPL_TPL_)VIDEO) += video_bmp.o -+obj-$(CONFIG_$(SPL_TPL_)VIDEO) += utf8_cp437.o - obj-$(CONFIG_$(SPL_TPL_)PANEL) += panel-uclass.o - obj-$(CONFIG_PANEL_HX8238D) += hx8238d.o - obj-$(CONFIG_$(SPL_TPL_)SIMPLE_PANEL) += simple_panel.o -diff --git a/drivers/video/utf8_cp437.c b/drivers/video/utf8_cp437.c -new file mode 100644 -index 000000000000..cab68b92b6e3 ---- /dev/null -+++ b/drivers/video/utf8_cp437.c -@@ -0,0 +1,169 @@ -+/* -+ * Convert UTF-8 bytes into a code page 437 character. -+ * Based on the table in the Code_page_437 Wikipedia page. -+ */ -+ -+#include <linux/types.h> -+ -+uint8_t code_points_00a0[] = { -+	255, 173, 155, 156,   7, 157,   7,  21, -+	  7,   7, 166, 174, 170,   7,   7,   7, -+	248, 241, 253,   7,   7, 230,  20, 250, -+	  7,   7, 167, 175, 172, 171,   7, 168, -+	  7,   7,   7,   7, 142, 143, 146, 128, -+	  7, 144,   7,   7,   7,   7,   7,   7, -+	  7, 165,   7,   7,   7,   7, 153,   7, -+	  7,   7,   7,   7, 154,   7,   7, 225, -+	133, 160, 131,   7, 132, 134, 145, 135, -+	138, 130, 136, 137, 141, 161, 140, 139, -+	  7, 164, 149, 162, 147,   7, 148, 246, -+	  7, 151, 163, 150, 129,   7,   7, 152, -+}; -+ -+uint8_t code_points_2550[] = { -+	205, 186, 213, 214, 201, 184, 183, 187, -+	212, 211, 200, 190, 189, 188, 198, 199, -+	204, 181, 182, 185, 209, 210, 203, 207, -+	208, 202, 216, 215, 206 -+}; -+ -+static uint8_t utf8_convert_11bit(uint16_t code) -+{ -+	switch (code) { -+	case 0x0192: return 159; -+	case 0x0393: return 226; -+	case 0x0398: return 233; -+	case 0x03A3: return 228; -+	case 0x03A6: return 232; -+	case 0x03A9: return 234; -+	case 0x03B1: return 224; -+	case 0x03B4: return 235; -+	case 0x03B5: return 238; -+	case 0x03C0: return 227; -+	case 0x03C3: return 229; -+	case 0x03C4: return 231; -+	case 0x03C6: return 237; -+	} -+ -+	return 0; -+}; -+ -+static uint8_t utf8_convert_2xxx(uint16_t code) -+{ -+	switch (code) { -+	case 0x2022: return 7; -+	case 0x203C: return 19; -+	case 0x207F: return 252; -+	case 0x20A7: return 158; -+	case 0x2190: return 27; -+	case 0x2191: return 24; -+	case 0x2192: return 26; -+	case 0x2193: return 25; -+	case 0x2194: return 29; -+	case 0x2195: return 18; -+	case 0x21A8: return 23; -+	case 0x2219: return 249; -+	case 0x221A: return 251; -+	case 0x221E: return 236; -+	case 0x221F: return 28; -+	case 0x2229: return 239; -+	case 0x2248: return 247; -+	case 0x2261: return 240; -+	case 0x2264: return 243; -+	case 0x2265: return 242; -+	case 0x2310: return 169; -+	case 0x2320: return 244; -+	case 0x2321: return 245; -+	case 0x2500: return 196; -+	case 0x2502: return 179; -+	case 0x250C: return 218; -+	case 0x2510: return 191; -+	case 0x2514: return 192; -+	case 0x2518: return 217; -+	case 0x251C: return 195; -+	case 0x2524: return 180; -+	case 0x252C: return 194; -+	case 0x2534: return 193; -+	case 0x253C: return 197; -+	case 0x2580: return 223; -+	case 0x2584: return 220; -+	case 0x2588: return 219; -+	case 0x258C: return 221; -+	case 0x2590: return 222; -+	case 0x2591: return 176; -+	case 0x2592: return 177; -+	case 0x2593: return 178; -+	case 0x25A0: return 254; -+	case 0x25AC: return 22; -+	case 0x25B2: return 30; -+	case 0x25BA: return 16; -+	case 0x25BC: return 31; -+	case 0x25C4: return 17; -+	case 0x25CB: return 9; -+	case 0x25D8: return 8; -+	case 0x25D9: return 10; -+	case 0x263A: return 1; -+	case 0x263B: return 2; -+	case 0x263C: return 15; -+	case 0x2640: return 12; -+	case 0x2642: return 11; -+	case 0x2660: return 6; -+	case 0x2663: return 5; -+	case 0x2665: return 3; -+	case 0x2666: return 4; -+	case 0x266A: return 13; -+	case 0x266B: return 14; -+	} -+ -+	return 0; -+} -+ -+uint8_t convert_uc16_to_cp437(uint16_t code) -+{ -+	if (code < 0x7f)		// ASCII -+		return code; -+	if (code < 0xa0)		// high control characters -+		return code; -+	if (code < 0x100)		// international characters -+		return code_points_00a0[code - 0xa0]; -+	if (code < 0x800) -+		return utf8_convert_11bit(code); -+	if (code >= 0x2550 && code < 0x256d)	// block graphics -+		return code_points_2550[code - 0x2550]; -+ -+	return utf8_convert_2xxx(code); -+} -+ -+uint8_t convert_utf8_to_cp437(uint8_t c, uint32_t *esc) -+{ -+	int shift; -+	uint16_t ucs; -+ -+	if (c < 127)			// ASCII -+		return c; -+	if (c == 127) -+		return 8;		// DEL (?) -+ -+	switch (c & 0xf0) { -+	case 0xc0: case 0xd0:		// two bytes sequence -+		*esc = (1U << 24) | ((c & 0x1f) << 6); -+		return 0; -+	case 0xe0:			// three bytes sequence -+		*esc = (2U << 24) | ((c & 0x0f) << 12); -+		return 0; -+	case 0xf0:			// four bytes sequence -+		*esc = (3U << 24) | ((c & 0x07) << 18); -+		return 0; -+	case 0x80: case 0x90: case 0xa0: case 0xb0:	// continuation -+		shift = (*esc >> 24) - 1; -+		ucs = *esc & 0xffffff; -+		if (shift) { -+			*esc = (shift << 24) | ucs | (c & 0x3f) << (shift * 6); -+			return 0; -+		} -+		*esc = 0; -+		return convert_uc16_to_cp437(ucs | (c & 0x3f)); -+	} -+ -+	return 0; -+} -diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c -index a6d994bd637c..a4029a58660b 100644 ---- a/drivers/video/vidconsole-uclass.c -+++ b/drivers/video/vidconsole-uclass.c -@@ -486,6 +486,7 @@ static int vidconsole_output_glyph(struct udevice *dev, char ch) - int vidconsole_put_char(struct udevice *dev, char ch) - { - 	struct vidconsole_priv *priv = dev_get_uclass_priv(dev); -+	uint8_t cp437; - 	int ret; -  - 	/* -@@ -527,7 +528,10 @@ int vidconsole_put_char(struct udevice *dev, char ch) - 		priv->last_ch = 0; - 		break; - 	default: --		ret = vidconsole_output_glyph(dev, ch); -+		cp437 = convert_utf8_to_cp437(ch, &priv->ucs); -+		if (cp437 == 0) -+			return 0; -+		ret = vidconsole_output_glyph(dev, cp437); - 		if (ret < 0) - 			return ret; - 		break; -diff --git a/include/video_console.h b/include/video_console.h -index 949abb3861e7..dbfb389f324f 100644 ---- a/include/video_console.h -+++ b/include/video_console.h -@@ -59,6 +59,7 @@ struct vidconsole_priv { - 	int escape_len; - 	int row_saved; - 	int col_saved; -+	u32 ucs; - 	bool cursor_visible; - 	char escape_buf[32]; - }; -@@ -457,4 +458,12 @@ static inline int vidconsole_memmove(struct udevice *dev, void *dst, -  - #endif -  -+/* -+ * Convert an UTF-8 byte into the corresponding character in the CP437 -+ * code page. Returns 0 if that character is part of a multi-byte sequence. -+ * for which *esc holds the state of. Repeatedly feed in more bytes until -+ * the return value returns a non-0 character. -+ */ -+uint8_t convert_utf8_to_cp437(uint8_t c, uint32_t *esc); -+ - #endif + 	ret = con_out->output_string(con_out, text); + 	if (ret != EFI_ST_SUCCESS) {  --  -2.42.0 +2.45.2 diff --git a/config/u-boot/default/patches/0003-Add-video-damage-tracking.patch b/config/u-boot/default/patches/0003-Add-video-damage-tracking.patch index 80195dc0..616efa0f 100644 --- a/config/u-boot/default/patches/0003-Add-video-damage-tracking.patch +++ b/config/u-boot/default/patches/0003-Add-video-damage-tracking.patch @@ -1,4 +1,4 @@ -From 60a24786c1c542b2a5967632df15ae14d1385061 Mon Sep 17 00:00:00 2001 +From 3efc90a6ea3bb88b66af7f7096e8168c2cc34aa6 Mon Sep 17 00:00:00 2001  From: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Date: Fri, 18 Aug 2023 13:31:36 +0300  Subject: [PATCH 01/13] video: test: Split copy frame buffer check into a @@ -12,16 +12,17 @@ function that we can skip calling, since we won't want it to error on  those mismatched cases.  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Reviewed-by: Simon Glass <sjg@chromium.org>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-2-alpernebiyasak@gmail.com/  ---   test/dm/video.c | 69 +++++++++++++++++++++++++++++++++++++++++--------   1 file changed, 58 insertions(+), 11 deletions(-)  diff --git a/test/dm/video.c b/test/dm/video.c -index d907f681600b..641a6250100a 100644 +index 7dfbeb9555d1..14e6af5181f1 100644  --- a/test/dm/video.c  +++ b/test/dm/video.c -@@ -55,9 +55,6 @@ DM_TEST(dm_test_video_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +@@ -54,9 +54,6 @@ DM_TEST(dm_test_video_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);    * size of the compressed data. This provides a pretty good level of    * certainty and the resulting tests need only check a single value.    * @@ -31,7 +32,7 @@ index d907f681600b..641a6250100a 100644    * @uts:	Test state    * @dev:	Video device    * Return: compressed size of the frame buffer, or -ve on error -@@ -66,7 +63,6 @@ static int compress_frame_buffer(struct unit_test_state *uts, +@@ -65,7 +62,6 @@ static int compress_frame_buffer(struct unit_test_state *uts,   				 struct udevice *dev)   {   	struct video_priv *priv = dev_get_uclass_priv(dev); @@ -39,7 +40,7 @@ index d907f681600b..641a6250100a 100644   	uint destlen;   	void *dest;   	int ret; -@@ -82,16 +78,34 @@ static int compress_frame_buffer(struct unit_test_state *uts, +@@ -81,16 +77,34 @@ static int compress_frame_buffer(struct unit_test_state *uts,   	if (ret)   		return ret; @@ -81,7 +82,7 @@ index d907f681600b..641a6250100a 100644   /*    * Call this function at any point to halt and show the current display. Be    * sure to run the test with the -l flag. -@@ -155,24 +169,30 @@ static int dm_test_video_text(struct unit_test_state *uts) +@@ -154,24 +168,30 @@ static int dm_test_video_text(struct unit_test_state *uts)   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	ut_assertok(vidconsole_select_font(con, "8x16", 0));   	ut_asserteq(46, compress_frame_buffer(uts, dev)); @@ -112,7 +113,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -191,24 +211,30 @@ static int dm_test_video_text_12x22(struct unit_test_state *uts) +@@ -190,24 +210,30 @@ static int dm_test_video_text_12x22(struct unit_test_state *uts)   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	ut_assertok(vidconsole_select_font(con, "12x22", 0));   	ut_asserteq(46, compress_frame_buffer(uts, dev)); @@ -143,7 +144,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -226,6 +252,7 @@ static int dm_test_video_chars(struct unit_test_state *uts) +@@ -225,6 +251,7 @@ static int dm_test_video_chars(struct unit_test_state *uts)   	ut_assertok(vidconsole_select_font(con, "8x16", 0));   	vidconsole_put_string(con, test_string);   	ut_asserteq(466, compress_frame_buffer(uts, dev)); @@ -151,7 +152,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -247,19 +274,23 @@ static int dm_test_video_ansi(struct unit_test_state *uts) +@@ -246,19 +273,23 @@ static int dm_test_video_ansi(struct unit_test_state *uts)   	video_clear(con->parent);   	video_sync(con->parent, false);   	ut_asserteq(46, compress_frame_buffer(uts, dev)); @@ -175,7 +176,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -292,11 +323,13 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot, +@@ -291,11 +322,13 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot,   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	ut_assertok(vidconsole_select_font(con, "8x16", 0));   	ut_asserteq(46, compress_frame_buffer(uts, dev)); @@ -189,7 +190,7 @@ index d907f681600b..641a6250100a 100644   	/* Check display scrolling */   	for (i = 0; i < SCROLL_LINES; i++) { -@@ -304,11 +337,13 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot, +@@ -303,11 +336,13 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot,   		vidconsole_put_char(con, '\n');   	}   	ut_asserteq(scroll_size, compress_frame_buffer(uts, dev)); @@ -203,7 +204,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -383,6 +418,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts) +@@ -382,6 +417,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));   	ut_asserteq(1368, compress_frame_buffer(uts, dev)); @@ -211,7 +212,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -402,6 +438,7 @@ static int dm_test_video_bmp8(struct unit_test_state *uts) +@@ -401,6 +437,7 @@ static int dm_test_video_bmp8(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));   	ut_asserteq(1247, compress_frame_buffer(uts, dev)); @@ -219,7 +220,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -425,6 +462,7 @@ static int dm_test_video_bmp16(struct unit_test_state *uts) +@@ -424,6 +461,7 @@ static int dm_test_video_bmp16(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, dst, 0, 0, false));   	ut_asserteq(3700, compress_frame_buffer(uts, dev)); @@ -227,7 +228,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -448,6 +486,7 @@ static int dm_test_video_bmp24(struct unit_test_state *uts) +@@ -447,6 +485,7 @@ static int dm_test_video_bmp24(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, dst, 0, 0, false));   	ut_asserteq(3656, compress_frame_buffer(uts, dev)); @@ -235,7 +236,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -471,6 +510,7 @@ static int dm_test_video_bmp24_32(struct unit_test_state *uts) +@@ -470,6 +509,7 @@ static int dm_test_video_bmp24_32(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, dst, 0, 0, false));   	ut_asserteq(6827, compress_frame_buffer(uts, dev)); @@ -243,7 +244,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -489,6 +529,7 @@ static int dm_test_video_bmp32(struct unit_test_state *uts) +@@ -488,6 +528,7 @@ static int dm_test_video_bmp32(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));   	ut_asserteq(2024, compress_frame_buffer(uts, dev)); @@ -251,7 +252,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -505,6 +546,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts) +@@ -504,6 +545,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));   	ut_asserteq(1368, compress_frame_buffer(uts, dev)); @@ -259,7 +260,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -524,6 +566,7 @@ static int dm_test_video_comp_bmp32(struct unit_test_state *uts) +@@ -523,6 +565,7 @@ static int dm_test_video_comp_bmp32(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));   	ut_asserteq(2024, compress_frame_buffer(uts, dev)); @@ -267,7 +268,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -543,6 +586,7 @@ static int dm_test_video_comp_bmp8(struct unit_test_state *uts) +@@ -542,6 +585,7 @@ static int dm_test_video_comp_bmp8(struct unit_test_state *uts)   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false));   	ut_asserteq(1247, compress_frame_buffer(uts, dev)); @@ -275,7 +276,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -558,6 +602,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts) +@@ -557,6 +601,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts)   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	vidconsole_put_string(con, test_string);   	ut_asserteq(12174, compress_frame_buffer(uts, dev)); @@ -283,7 +284,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -579,6 +624,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts) +@@ -578,6 +623,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	vidconsole_put_string(con, test_string);   	ut_asserteq(34287, compress_frame_buffer(uts, dev)); @@ -291,7 +292,7 @@ index d907f681600b..641a6250100a 100644   	return 0;   } -@@ -600,6 +646,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts) +@@ -599,6 +645,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	vidconsole_put_string(con, test_string);   	ut_asserteq(29471, compress_frame_buffer(uts, dev)); @@ -299,11 +300,13 @@ index d907f681600b..641a6250100a 100644   	return 0;   } + +base-commit: 475aa8345a78396d39b42f96eccecd37ebe24e99  --  -2.42.0 +2.45.2 -From e441c509aa784328c735c52e0a27a39601049de7 Mon Sep 17 00:00:00 2001 +From 19c878635c1271c79a017ea3a860b9a2f1a3fed9 Mon Sep 17 00:00:00 2001  From: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Date: Sun, 20 Aug 2023 17:46:46 +0300  Subject: [PATCH 02/13] video: test: Support checking copy frame buffer @@ -320,16 +323,17 @@ Add a boolean argument to the existing helper function to indicate which  frame buffer we want to inspect, and update the existing callers.  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Reviewed-by: Simon Glass <sjg@chromium.org>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-3-alpernebiyasak@gmail.com/  ---   test/dm/video.c | 76 ++++++++++++++++++++++++++-----------------------   1 file changed, 41 insertions(+), 35 deletions(-)  diff --git a/test/dm/video.c b/test/dm/video.c -index 641a6250100a..b9ff3da10c18 100644 +index 14e6af5181f1..50374cafc009 100644  --- a/test/dm/video.c  +++ b/test/dm/video.c -@@ -57,22 +57,28 @@ DM_TEST(dm_test_video_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +@@ -56,22 +56,28 @@ DM_TEST(dm_test_video_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);    *    * @uts:	Test state    * @dev:	Video device @@ -360,7 +364,7 @@ index 641a6250100a..b9ff3da10c18 100644   				       3, 0, 0);   	free(dest);   	if (ret) -@@ -168,30 +174,30 @@ static int dm_test_video_text(struct unit_test_state *uts) +@@ -167,30 +173,30 @@ static int dm_test_video_text(struct unit_test_state *uts)   	ut_assertok(video_get_nologo(uts, &dev));   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	ut_assertok(vidconsole_select_font(con, "8x16", 0)); @@ -397,7 +401,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -210,30 +216,30 @@ static int dm_test_video_text_12x22(struct unit_test_state *uts) +@@ -209,30 +215,30 @@ static int dm_test_video_text_12x22(struct unit_test_state *uts)   	ut_assertok(video_get_nologo(uts, &dev));   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	ut_assertok(vidconsole_select_font(con, "12x22", 0)); @@ -434,7 +438,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -251,7 +257,7 @@ static int dm_test_video_chars(struct unit_test_state *uts) +@@ -250,7 +256,7 @@ static int dm_test_video_chars(struct unit_test_state *uts)   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	ut_assertok(vidconsole_select_font(con, "8x16", 0));   	vidconsole_put_string(con, test_string); @@ -443,7 +447,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -273,23 +279,23 @@ static int dm_test_video_ansi(struct unit_test_state *uts) +@@ -272,23 +278,23 @@ static int dm_test_video_ansi(struct unit_test_state *uts)   	/* reference clear: */   	video_clear(con->parent);   	video_sync(con->parent, false); @@ -471,7 +475,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -322,13 +328,13 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot, +@@ -321,13 +327,13 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot,   	ut_assertok(video_get_nologo(uts, &dev));   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	ut_assertok(vidconsole_select_font(con, "8x16", 0)); @@ -487,7 +491,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	/* Check display scrolling */ -@@ -336,13 +342,13 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot, +@@ -335,13 +341,13 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot,   		vidconsole_put_char(con, 'A' + i % 50);   		vidconsole_put_char(con, '\n');   	} @@ -503,7 +507,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -417,7 +423,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts) +@@ -416,7 +422,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts)   	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); @@ -512,7 +516,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -437,7 +443,7 @@ static int dm_test_video_bmp8(struct unit_test_state *uts) +@@ -436,7 +442,7 @@ static int dm_test_video_bmp8(struct unit_test_state *uts)   	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); @@ -521,7 +525,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -461,7 +467,7 @@ static int dm_test_video_bmp16(struct unit_test_state *uts) +@@ -460,7 +466,7 @@ static int dm_test_video_bmp16(struct unit_test_state *uts)   			   &src_len));   	ut_assertok(video_bmp_display(dev, dst, 0, 0, false)); @@ -530,7 +534,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -485,7 +491,7 @@ static int dm_test_video_bmp24(struct unit_test_state *uts) +@@ -484,7 +490,7 @@ static int dm_test_video_bmp24(struct unit_test_state *uts)   			   &src_len));   	ut_assertok(video_bmp_display(dev, dst, 0, 0, false)); @@ -539,7 +543,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -509,7 +515,7 @@ static int dm_test_video_bmp24_32(struct unit_test_state *uts) +@@ -508,7 +514,7 @@ static int dm_test_video_bmp24_32(struct unit_test_state *uts)   			   &src_len));   	ut_assertok(video_bmp_display(dev, dst, 0, 0, false)); @@ -548,7 +552,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -528,7 +534,7 @@ static int dm_test_video_bmp32(struct unit_test_state *uts) +@@ -527,7 +533,7 @@ static int dm_test_video_bmp32(struct unit_test_state *uts)   	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); @@ -557,7 +561,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -545,7 +551,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts) +@@ -544,7 +550,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts)   	ut_assertok(read_file(uts, "tools/logos/denx-comp.bmp", &addr));   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); @@ -566,7 +570,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -565,7 +571,7 @@ static int dm_test_video_comp_bmp32(struct unit_test_state *uts) +@@ -564,7 +570,7 @@ static int dm_test_video_comp_bmp32(struct unit_test_state *uts)   	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); @@ -575,7 +579,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -585,7 +591,7 @@ static int dm_test_video_comp_bmp8(struct unit_test_state *uts) +@@ -584,7 +590,7 @@ static int dm_test_video_comp_bmp8(struct unit_test_state *uts)   	ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr));   	ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); @@ -584,7 +588,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -601,7 +607,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts) +@@ -600,7 +606,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts)   	ut_assertok(video_get_nologo(uts, &dev));   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	vidconsole_put_string(con, test_string); @@ -593,7 +597,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -623,7 +629,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts) +@@ -622,7 +628,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)   	ut_assertok(video_get_nologo(uts, &dev));   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	vidconsole_put_string(con, test_string); @@ -602,7 +606,7 @@ index 641a6250100a..b9ff3da10c18 100644   	ut_assertok(check_copy_frame_buffer(uts, dev));   	return 0; -@@ -645,7 +651,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts) +@@ -644,7 +650,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)   	ut_assertok(video_get_nologo(uts, &dev));   	ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));   	vidconsole_put_string(con, test_string); @@ -612,10 +616,10 @@ index 641a6250100a..b9ff3da10c18 100644   	return 0;  --  -2.42.0 +2.45.2 -From 2b431f45d217e3ab454fc719157cb8b78657a129 Mon Sep 17 00:00:00 2001 +From 173f97f38d1c6621acd9f24f8956c3a7d808cdd7 Mon Sep 17 00:00:00 2001  From: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Date: Fri, 18 Aug 2023 17:31:27 +0300  Subject: [PATCH 03/13] video: test: Test partial updates of hardware frame @@ -628,16 +632,17 @@ then checking if the overwritten contents have been redrawn on the next  sync.  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Reviewed-by: Simon Glass <sjg@chromium.org>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-4-alpernebiyasak@gmail.com/  ---   test/dm/video.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++   1 file changed, 54 insertions(+)  diff --git a/test/dm/video.c b/test/dm/video.c -index b9ff3da10c18..e4bd27a6b76f 100644 +index 50374cafc009..4798f2205a99 100644  --- a/test/dm/video.c  +++ b/test/dm/video.c -@@ -657,3 +657,57 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts) +@@ -656,3 +656,57 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)   	return 0;   }   DM_TEST(dm_test_video_truetype_bs, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); @@ -696,10 +701,10 @@ index b9ff3da10c18..e4bd27a6b76f 100644  +}  +DM_TEST(dm_test_video_copy, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);  --  -2.42.0 +2.45.2 -From 5aea7d8d14de93dcd33acc2bc19d9de942b6d8cd Mon Sep 17 00:00:00 2001 +From 11066af4f8d7a9c6b4729ce2647eb6251397423d Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Fri, 10 Jun 2022 00:59:15 +0200  Subject: [PATCH 04/13] dm: video: Add damage tracking API @@ -717,14 +722,15 @@ Reported-by: Da Xue <da@libre.computer>  Co-developed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-5-alpernebiyasak@gmail.com/ +Reviewed-by: Simon Glass <sjg@chromium.org>  ---   drivers/video/Kconfig        | 13 ++++++++++++ - drivers/video/video-uclass.c | 41 +++++++++++++++++++++++++++++++++--- - include/video.h              | 32 ++++++++++++++++++++++++++-- - 3 files changed, 81 insertions(+), 5 deletions(-) + drivers/video/video-uclass.c | 40 +++++++++++++++++++++++++++++++++--- + include/video.h              | 40 ++++++++++++++++++++++++++++++++++-- + 3 files changed, 88 insertions(+), 5 deletions(-)  diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig -index 69f4809cf4a6..db531d7caae0 100644 +index 7808ae7919e0..7815b590481e 100644  --- a/drivers/video/Kconfig  +++ b/drivers/video/Kconfig  @@ -92,6 +92,19 @@ config VIDEO_COPY @@ -748,23 +754,21 @@ index 69f4809cf4a6..db531d7caae0 100644   	bool "Generic PWM based Backlight Driver"   	depends on BACKLIGHT && DM_PWM  diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c -index f743ed74c818..9888a580bfd3 100644 +index ff1382f4a43b..75ab5f5ba9d7 100644  --- a/drivers/video/video-uclass.c  +++ b/drivers/video/video-uclass.c -@@ -351,9 +351,39 @@ void video_set_default_colors(struct udevice *dev, bool invert) +@@ -346,9 +346,38 @@ void video_set_default_colors(struct udevice *dev, bool invert)   	priv->colour_bg = video_index_to_colour(priv, back);   }  +/* Notify about changes in the frame buffer */ ++#ifdef CONFIG_VIDEO_DAMAGE  +void video_damage(struct udevice *vid, int x, int y, int width, int height)  +{  +	struct video_priv *priv = dev_get_uclass_priv(vid);  +	int xend = x + width;  +	int yend = y + height;  + -+	if (!IS_ENABLED(CONFIG_VIDEO_DAMAGE)) -+		return; -+  +	if (x > priv->xsize)  +		return;  + @@ -783,6 +787,7 @@ index f743ed74c818..9888a580bfd3 100644  +	priv->damage.xend = max(xend, priv->damage.xend);  +	priv->damage.yend = max(yend, priv->damage.yend);  +} ++#endif  +   /* Flush video activity to the caches */   int video_sync(struct udevice *vid, bool force) @@ -791,7 +796,7 @@ index f743ed74c818..9888a580bfd3 100644   	struct video_ops *ops = video_get_ops(vid);   	int ret; -@@ -369,15 +399,12 @@ int video_sync(struct udevice *vid, bool force) +@@ -364,15 +393,12 @@ int video_sync(struct udevice *vid, bool force)   	 * out whether it exists? For now, ARM is safe.   	 */   #if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) @@ -807,7 +812,7 @@ index f743ed74c818..9888a580bfd3 100644   	static ulong last_sync;   	if (force || get_timer(last_sync) > 100) { -@@ -385,6 +412,14 @@ int video_sync(struct udevice *vid, bool force) +@@ -380,6 +406,14 @@ int video_sync(struct udevice *vid, bool force)   		last_sync = get_timer(0);   	}   #endif @@ -823,10 +828,10 @@ index f743ed74c818..9888a580bfd3 100644   }  diff --git a/include/video.h b/include/video.h -index 16f7a83f8d50..307e954db828 100644 +index 4d8df9baaada..d2dabb66e9e6 100644  --- a/include/video.h  +++ b/include/video.h -@@ -85,6 +85,11 @@ enum video_format { +@@ -88,6 +88,11 @@ enum video_format {    * @fb_size:	Frame buffer size    * @copy_fb:	Copy of the frame buffer to keep up to date; see struct    *		video_uc_plat @@ -838,7 +843,7 @@ index 16f7a83f8d50..307e954db828 100644    * @line_length:	Length of each frame buffer line, in bytes. This can be    *		set by the driver, but if not, the uclass will set it after    *		probing -@@ -112,6 +117,12 @@ struct video_priv { +@@ -115,6 +120,12 @@ struct video_priv {   	void *fb;   	int fb_size;   	void *copy_fb; @@ -851,7 +856,7 @@ index 16f7a83f8d50..307e954db828 100644   	int line_length;   	u32 colour_fg;   	u32 colour_bg; -@@ -254,8 +265,9 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, +@@ -257,8 +268,9 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend,    * @return: 0 on success, error code otherwise    *    * Some frame buffers are cached or have a secondary frame buffer. This @@ -863,10 +868,11 @@ index 16f7a83f8d50..307e954db828 100644    */   int video_sync(struct udevice *vid, bool force); -@@ -375,6 +387,22 @@ static inline int video_sync_copy_all(struct udevice *dev) +@@ -378,6 +390,30 @@ static inline int video_sync_copy_all(struct udevice *dev)   #endif ++#ifdef CONFIG_VIDEO_DAMAGE  +/**  + * video_damage() - Notify the video subsystem about screen updates.  + * @@ -882,15 +888,22 @@ index 16f7a83f8d50..307e954db828 100644  + * next call to video_sync().  + */  +void video_damage(struct udevice *vid, int x, int y, int width, int height); ++#else ++static inline void video_damage(struct udevice *vid, int x, int y, int width, ++				int height) ++{ ++	return; ++} ++#endif /* CONFIG_VIDEO_DAMAGE */  +   /**    * video_is_active() - Test if one video device it active    *  --  -2.42.0 +2.45.2 -From 9d61d286be0e696a719af0c25a60d31482ee152c Mon Sep 17 00:00:00 2001 +From 5613cd630801ccb329895f62c27b8690a2cbf74c Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Fri, 10 Jun 2022 00:59:16 +0200  Subject: [PATCH 05/13] dm: video: Add damage notification on display fills @@ -902,16 +915,17 @@ Signed-off-by: Alexander Graf <agraf@csgraf.de>  Reported-by: Da Xue <da@libre.computer>  [Alper: Move from video_clear() to video_fill(), video_fill_part()]  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Reviewed-by: Simon Glass <sjg@chromium.org>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-6-alpernebiyasak@gmail.com/  ---   drivers/video/video-uclass.c | 4 ++++   1 file changed, 4 insertions(+)  diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c -index 9888a580bfd3..09172f1f7f45 100644 +index 75ab5f5ba9d7..ca348101817a 100644  --- a/drivers/video/video-uclass.c  +++ b/drivers/video/video-uclass.c -@@ -203,6 +203,8 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, +@@ -195,6 +195,8 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend,   	if (ret)   		return ret; @@ -920,7 +934,7 @@ index 9888a580bfd3..09172f1f7f45 100644   	return 0;   } -@@ -249,6 +251,8 @@ int video_fill(struct udevice *dev, u32 colour) +@@ -244,6 +246,8 @@ int video_fill(struct udevice *dev, u32 colour)   	if (ret)   		return ret; @@ -930,10 +944,10 @@ index 9888a580bfd3..09172f1f7f45 100644   }  --  -2.42.0 +2.45.2 -From 599159f0d1678a473211a2beda302d12ac64bf5c Mon Sep 17 00:00:00 2001 +From 4e29f9d2190f2ea390d5321192f5e71193d62f71 Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Fri, 10 Jun 2022 00:59:17 +0200  Subject: [PATCH 06/13] vidconsole: Add damage notifications to all vidconsole @@ -954,11 +968,10 @@ Link: https://lore.kernel.org/u-boot/20230821135111.3558478-7-alpernebiyasak@gma   drivers/video/console_normal.c   | 18 +++++++++++   drivers/video/console_rotate.c   | 54 ++++++++++++++++++++++++++++++++   drivers/video/console_truetype.c | 21 +++++++++++++ - drivers/video/video-uclass.c     |  1 + - 4 files changed, 94 insertions(+) + 3 files changed, 93 insertions(+)  diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c -index 413c7abee9e1..a19ce6a2bc11 100644 +index 6f4194a18147..51ac8cc78e9d 100644  --- a/drivers/video/console_normal.c  +++ b/drivers/video/console_normal.c  @@ -39,6 +39,12 @@ static int console_set_row(struct udevice *dev, uint row, int clr) @@ -987,7 +1000,7 @@ index 413c7abee9e1..a19ce6a2bc11 100644   	return 0;   } -@@ -90,6 +102,12 @@ static int console_putc_xy(struct udevice *dev, uint x_frac, uint y, char ch) +@@ -91,6 +103,12 @@ static int console_putc_xy(struct udevice *dev, uint x_frac, uint y, int cp)   	if (ret)   		return ret; @@ -1001,7 +1014,7 @@ index 413c7abee9e1..a19ce6a2bc11 100644   	if (ret)   		return ret;  diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c -index 65358a1c6e74..6c3e7c1bb8dc 100644 +index dc9698362741..5c4a98f6cad0 100644  --- a/drivers/video/console_rotate.c  +++ b/drivers/video/console_rotate.c  @@ -36,6 +36,12 @@ static int console_set_row_1(struct udevice *dev, uint row, int clr) @@ -1030,7 +1043,7 @@ index 65358a1c6e74..6c3e7c1bb8dc 100644   	return 0;   } -@@ -96,6 +108,12 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) +@@ -97,6 +109,12 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, int cp)   	if (ret)   		return ret; @@ -1043,7 +1056,7 @@ index 65358a1c6e74..6c3e7c1bb8dc 100644   	return VID_TO_POS(fontdata->width);   } -@@ -121,6 +139,12 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr) +@@ -122,6 +140,12 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr)   	if (ret)   		return ret; @@ -1056,7 +1069,7 @@ index 65358a1c6e74..6c3e7c1bb8dc 100644   	return 0;   } -@@ -142,6 +166,12 @@ static int console_move_rows_2(struct udevice *dev, uint rowdst, uint rowsrc, +@@ -143,6 +167,12 @@ static int console_move_rows_2(struct udevice *dev, uint rowdst, uint rowsrc,   	vidconsole_memmove(dev, dst, src,   			   fontdata->height * vid_priv->line_length * count); @@ -1069,7 +1082,7 @@ index 65358a1c6e74..6c3e7c1bb8dc 100644   	return 0;   } -@@ -174,6 +204,12 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) +@@ -176,6 +206,12 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, int cp)   	if (ret)   		return ret; @@ -1082,7 +1095,7 @@ index 65358a1c6e74..6c3e7c1bb8dc 100644   	return VID_TO_POS(fontdata->width);   } -@@ -198,6 +234,12 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr) +@@ -200,6 +236,12 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr)   	if (ret)   		return ret; @@ -1095,7 +1108,7 @@ index 65358a1c6e74..6c3e7c1bb8dc 100644   	return 0;   } -@@ -224,6 +266,12 @@ static int console_move_rows_3(struct udevice *dev, uint rowdst, uint rowsrc, +@@ -226,6 +268,12 @@ static int console_move_rows_3(struct udevice *dev, uint rowdst, uint rowsrc,   		dst += vid_priv->line_length;   	} @@ -1108,7 +1121,7 @@ index 65358a1c6e74..6c3e7c1bb8dc 100644   	return 0;   } -@@ -255,6 +303,12 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch) +@@ -258,6 +306,12 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, int cp)   	if (ret)   		return ret; @@ -1122,10 +1135,10 @@ index 65358a1c6e74..6c3e7c1bb8dc 100644   }  diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c -index 0f9bb49e44f7..0adbf9cc3d67 100644 +index c435162d3f94..6a17f732fc26 100644  --- a/drivers/video/console_truetype.c  +++ b/drivers/video/console_truetype.c -@@ -178,6 +178,7 @@ struct console_tt_priv { +@@ -190,6 +190,7 @@ struct console_tt_store {   static int console_truetype_set_row(struct udevice *dev, uint row, int clr)   {   	struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); @@ -1133,7 +1146,7 @@ index 0f9bb49e44f7..0adbf9cc3d67 100644   	struct console_tt_priv *priv = dev_get_priv(dev);   	struct console_tt_metrics *met = priv->cur_met;   	void *end, *line; -@@ -221,6 +222,12 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr) +@@ -233,6 +234,12 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr)   	if (ret)   		return ret; @@ -1146,7 +1159,7 @@ index 0f9bb49e44f7..0adbf9cc3d67 100644   	return 0;   } -@@ -228,6 +235,7 @@ static int console_truetype_move_rows(struct udevice *dev, uint rowdst, +@@ -240,6 +247,7 @@ static int console_truetype_move_rows(struct udevice *dev, uint rowdst,   				     uint rowsrc, uint count)   {   	struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); @@ -1154,7 +1167,7 @@ index 0f9bb49e44f7..0adbf9cc3d67 100644   	struct console_tt_priv *priv = dev_get_priv(dev);   	struct console_tt_metrics *met = priv->cur_met;   	void *dst; -@@ -246,6 +254,12 @@ static int console_truetype_move_rows(struct udevice *dev, uint rowdst, +@@ -258,6 +266,12 @@ static int console_truetype_move_rows(struct udevice *dev, uint rowdst,   	for (i = 0; i < priv->pos_ptr; i++)   		priv->pos[i].ypos -= diff; @@ -1167,7 +1180,7 @@ index 0f9bb49e44f7..0adbf9cc3d67 100644   	return 0;   } -@@ -403,6 +417,13 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, +@@ -418,6 +432,13 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,   		line += vid_priv->line_length;   	} @@ -1181,23 +1194,11 @@ index 0f9bb49e44f7..0adbf9cc3d67 100644   	ret = vidconsole_sync_copy(dev, start, line);   	if (ret)   		return ret; -diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c -index 09172f1f7f45..06e344f415ce 100644 ---- a/drivers/video/video-uclass.c -+++ b/drivers/video/video-uclass.c -@@ -199,6 +199,7 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, - 		} - 		line += priv->line_length; - 	} -+ - 	ret = video_sync_copy(dev, start, line); - 	if (ret) - 		return ret;  --  -2.42.0 +2.45.2 -From 4946d75efb4a6b4ff1c2ec306cb7509e98c24c17 Mon Sep 17 00:00:00 2001 +From 11fa5d7c68878f629c8fff7dc28a76acaf1252ab Mon Sep 17 00:00:00 2001  From: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Date: Fri, 18 Aug 2023 17:55:08 +0300  Subject: [PATCH 07/13] video: test: Test video damage tracking via vidconsole @@ -1208,6 +1209,7 @@ the config in sandbox and add a test for it, by printing strings at a  few locations and checking the tracked region.  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Reviewed-by: Simon Glass <sjg@chromium.org>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-8-alpernebiyasak@gmail.com/  ---   configs/sandbox_defconfig |  1 + @@ -1215,10 +1217,10 @@ Link: https://lore.kernel.org/u-boot/20230821135111.3558478-8-alpernebiyasak@gma   2 files changed, 57 insertions(+)  diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig -index 62bc182ca161..d26659ff0a0b 100644 +index da8c1976d7bd..6bc20ec34169 100644  --- a/configs/sandbox_defconfig  +++ b/configs/sandbox_defconfig -@@ -307,6 +307,7 @@ CONFIG_USB_ETH_CDC=y +@@ -319,6 +319,7 @@ CONFIG_USB_ETH_CDC=y   CONFIG_VIDEO=y   CONFIG_VIDEO_FONT_SUN12X22=y   CONFIG_VIDEO_COPY=y @@ -1227,10 +1229,10 @@ index 62bc182ca161..d26659ff0a0b 100644   CONFIG_CONSOLE_TRUETYPE=y   CONFIG_CONSOLE_TRUETYPE_CANTORAONE=y  diff --git a/test/dm/video.c b/test/dm/video.c -index e4bd27a6b76f..8c7d9800a42e 100644 +index 4798f2205a99..119c43153165 100644  --- a/test/dm/video.c  +++ b/test/dm/video.c -@@ -711,3 +711,59 @@ static int dm_test_video_copy(struct unit_test_state *uts) +@@ -710,3 +710,59 @@ static int dm_test_video_copy(struct unit_test_state *uts)   	return 0;   }   DM_TEST(dm_test_video_copy, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); @@ -1291,10 +1293,10 @@ index e4bd27a6b76f..8c7d9800a42e 100644  +}  +DM_TEST(dm_test_video_damage, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);  --  -2.42.0 +2.45.2 -From a8073a8ba8a35600302ad6430977c766869f1605 Mon Sep 17 00:00:00 2001 +From 80a32fe8f34466e6b86553018f47192a1fef3c6a Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Fri, 10 Jun 2022 00:59:18 +0200  Subject: [PATCH 08/13] video: Add damage notification on bmp display @@ -1311,10 +1313,10 @@ Link: https://lore.kernel.org/u-boot/20230821135111.3558478-9-alpernebiyasak@gma   1 file changed, 2 insertions(+)  diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c -index 45f003c8251a..10943b9ca19f 100644 +index ad512d99a1b9..78de95607924 100644  --- a/drivers/video/video_bmp.c  +++ b/drivers/video/video_bmp.c -@@ -460,6 +460,8 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, +@@ -459,6 +459,8 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,   		break;   	}; @@ -1324,10 +1326,10 @@ index 45f003c8251a..10943b9ca19f 100644   	fb = (uchar *)(priv->fb + y * priv->line_length + x * bpix / 8);   	ret = video_sync_copy(dev, start, fb);  --  -2.42.0 +2.45.2 -From 210faf6dd92d4d7647cec88aa5affddf74c35fcb Mon Sep 17 00:00:00 2001 +From 7afe761e51bfb0f24fd4547e8bec1826aaf2e6a0 Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Fri, 10 Jun 2022 00:59:19 +0200  Subject: [PATCH 09/13] efi_loader: GOP: Add damage notification on BLT @@ -1340,13 +1342,14 @@ Reported-by: Da Xue <da@libre.computer>  Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>  [Alper: Add struct comment for new member]  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Reviewed-by: Simon Glass <sjg@chromium.org>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-10-alpernebiyasak@gmail.com/  ---   lib/efi_loader/efi_gop.c | 7 +++++++   1 file changed, 7 insertions(+)  diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c -index 778b693f983a..db6535e080c4 100644 +index 41e12fa72460..1694e23dcc62 100644  --- a/lib/efi_loader/efi_gop.c  +++ b/lib/efi_loader/efi_gop.c  @@ -24,6 +24,7 @@ static const efi_guid_t efi_gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; @@ -1383,19 +1386,19 @@ index 778b693f983a..db6535e080c4 100644   	return EFI_SUCCESS;   } -@@ -548,6 +554,7 @@ efi_status_t efi_gop_register(void) +@@ -549,6 +555,7 @@ efi_status_t efi_gop_register(void)   	gopobj->info.pixels_per_scanline = col;   	gopobj->bpix = bpix; - 	gopobj->fb = fb; + 	gopobj->fb = map_sysmem(fb_base, fb_size);  +	gopobj->vdev = vdev;   	return EFI_SUCCESS;   }  --  -2.42.0 +2.45.2 -From 95c2109f13e9457961745193cae222523366d810 Mon Sep 17 00:00:00 2001 +From 134415d6cbe38f7ab630f978a602b6e15929feea Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Fri, 10 Jun 2022 00:59:20 +0200  Subject: [PATCH 10/13] video: Only dcache flush damaged lines @@ -1412,29 +1415,29 @@ Co-developed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-11-alpernebiyasak@gmail.com/  --- - drivers/video/video-uclass.c | 41 +++++++++++++++++++++++++++++++----- - 1 file changed, 36 insertions(+), 5 deletions(-) + drivers/video/video-uclass.c | 43 +++++++++++++++++++++++++++++++----- + 1 file changed, 38 insertions(+), 5 deletions(-)  diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c -index 06e344f415ce..ac2141892bf7 100644 +index ca348101817a..add7a85b20fe 100644  --- a/drivers/video/video-uclass.c  +++ b/drivers/video/video-uclass.c -@@ -385,6 +385,41 @@ void video_damage(struct udevice *vid, int x, int y, int width, int height) - 	priv->damage.yend = max(yend, priv->damage.yend); +@@ -378,6 +378,40 @@ void video_damage(struct udevice *vid, int x, int y, int width, int height)   } + #endif  +#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) -+static void video_flush_dcache(struct udevice *vid) ++static void video_flush_dcache(struct udevice *vid, bool use_copy)  +{  +	struct video_priv *priv = dev_get_uclass_priv(vid); ++	ulong fb = use_copy ? (ulong)priv->copy_fb : (ulong)priv->fb;  +  +	if (!priv->flush_dcache)  +		return;  +  +	if (!IS_ENABLED(CONFIG_VIDEO_DAMAGE)) { -+		flush_dcache_range((ulong)priv->fb, -+				   ALIGN((ulong)priv->fb + priv->fb_size, -+					 CONFIG_SYS_CACHELINE_SIZE)); ++		flush_dcache_range(fb, ALIGN(fb + priv->fb_size, ++					     CONFIG_SYS_CACHELINE_SIZE));  +  +		return;  +	} @@ -1445,7 +1448,6 @@ index 06e344f415ce..ac2141892bf7 100644  +		int y;  +  +		for (y = priv->damage.ystart; y < priv->damage.yend; y++) { -+			ulong fb = (ulong)priv->fb;  +			ulong start = fb + (y * priv->line_length) + lstart;  +			ulong end = start + lend - lstart;  + @@ -1461,7 +1463,7 @@ index 06e344f415ce..ac2141892bf7 100644   /* Flush video activity to the caches */   int video_sync(struct udevice *vid, bool force)   { -@@ -404,11 +439,7 @@ int video_sync(struct udevice *vid, bool force) +@@ -397,11 +431,10 @@ int video_sync(struct udevice *vid, bool force)   	 * out whether it exists? For now, ARM is safe.   	 */   #if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) @@ -1470,15 +1472,18 @@ index 06e344f415ce..ac2141892bf7 100644  -				   ALIGN((ulong)priv->fb + priv->fb_size,  -					 CONFIG_SYS_CACHELINE_SIZE));  -	} -+	video_flush_dcache(vid); ++	video_flush_dcache(vid, false); ++ ++	if (IS_ENABLED(CONFIG_VIDEO_COPY)) ++		video_flush_dcache(vid, true);   #elif defined(CONFIG_VIDEO_SANDBOX_SDL)   	static ulong last_sync;  --  -2.42.0 +2.45.2 -From d4c117c2455f2df8fa224ec603f2749219c72243 Mon Sep 17 00:00:00 2001 +From d3f1653a87d51c5ecf187b19ecb60a2f740fb8e2 Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Fri, 10 Jun 2022 00:59:21 +0200  Subject: [PATCH 11/13] video: Use VIDEO_DAMAGE for VIDEO_COPY @@ -1511,20 +1516,20 @@ Link: https://lore.kernel.org/u-boot/20230821135111.3558478-12-alpernebiyasak@gm   drivers/video/Kconfig             |  5 ++   drivers/video/console_normal.c    | 13 +----   drivers/video/console_rotate.c    | 44 +++----------- - drivers/video/console_truetype.c  | 16 +---- - drivers/video/vidconsole-uclass.c | 16 ----- - drivers/video/video-uclass.c      | 97 ++++++++----------------------- + drivers/video/console_truetype.c  | 16 +----- + drivers/video/vidconsole-uclass.c | 16 ------ + drivers/video/video-uclass.c      | 96 ++++++++-----------------------   drivers/video/video_bmp.c         |  7 ---   include/video.h                   | 37 ------------   include/video_console.h           | 52 -----------------   test/dm/video.c                   |  3 +- - 11 files changed, 43 insertions(+), 248 deletions(-) + 11 files changed, 43 insertions(+), 247 deletions(-)  diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig -index d26659ff0a0b..62bc182ca161 100644 +index 6bc20ec34169..da8c1976d7bd 100644  --- a/configs/sandbox_defconfig  +++ b/configs/sandbox_defconfig -@@ -307,7 +307,6 @@ CONFIG_USB_ETH_CDC=y +@@ -319,7 +319,6 @@ CONFIG_USB_ETH_CDC=y   CONFIG_VIDEO=y   CONFIG_VIDEO_FONT_SUN12X22=y   CONFIG_VIDEO_COPY=y @@ -1533,7 +1538,7 @@ index d26659ff0a0b..62bc182ca161 100644   CONFIG_CONSOLE_TRUETYPE=y   CONFIG_CONSOLE_TRUETYPE_CANTORAONE=y  diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig -index db531d7caae0..5f17c6be84ed 100644 +index 7815b590481e..88c6f8e68976 100644  --- a/drivers/video/Kconfig  +++ b/drivers/video/Kconfig  @@ -83,11 +83,14 @@ config VIDEO_PCI_DEFAULT_FB_SIZE @@ -1561,7 +1566,7 @@ index db531d7caae0..5f17c6be84ed 100644   	bool "Generic PWM based Backlight Driver"   	depends on BACKLIGHT && DM_PWM  diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c -index a19ce6a2bc11..c44aa09473a3 100644 +index 51ac8cc78e9d..07db613ac53c 100644  --- a/drivers/video/console_normal.c  +++ b/drivers/video/console_normal.c  @@ -35,10 +35,6 @@ static int console_set_row(struct udevice *dev, uint row, int clr) @@ -1591,7 +1596,7 @@ index a19ce6a2bc11..c44aa09473a3 100644   	video_damage(dev->parent,   		     0, -@@ -108,10 +101,6 @@ static int console_putc_xy(struct udevice *dev, uint x_frac, uint y, char ch) +@@ -109,10 +102,6 @@ static int console_putc_xy(struct udevice *dev, uint x_frac, uint y, int cp)   		     fontdata->width,   		     fontdata->height); @@ -1603,7 +1608,7 @@ index a19ce6a2bc11..c44aa09473a3 100644   }  diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c -index 6c3e7c1bb8dc..6e9067d1c7fb 100644 +index 5c4a98f6cad0..9f8e1b92770c 100644  --- a/drivers/video/console_rotate.c  +++ b/drivers/video/console_rotate.c  @@ -21,7 +21,6 @@ static int console_set_row_1(struct udevice *dev, uint row, int clr) @@ -1645,7 +1650,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   		src += vid_priv->line_length;   		dst += vid_priv->line_length;   	} -@@ -104,10 +97,6 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) +@@ -105,10 +98,6 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, int cp)   		return ret;   	/* We draw backwards from 'start, so account for the first line */ @@ -1656,7 +1661,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   	video_damage(dev->parent,   		     vid_priv->xsize - y - fontdata->height,   		     linenum - 1, -@@ -125,7 +114,7 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr) +@@ -126,7 +115,7 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr)   	struct video_fontdata *fontdata = priv->fontdata;   	void *start, *line, *dst, *end;   	int pixels = fontdata->height * vid_priv->xsize; @@ -1665,7 +1670,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   	int pbytes = VNBYTES(vid_priv->bpix);   	start = vid_priv->fb + vid_priv->ysize * vid_priv->line_length - -@@ -135,9 +124,6 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr) +@@ -136,9 +125,6 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr)   	for (i = 0; i < pixels; i++)   		fill_pixel_and_goto_next(&dst, clr, pbytes, pbytes);   	end = dst; @@ -1675,7 +1680,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   	video_damage(dev->parent,   		     0, -@@ -163,8 +149,7 @@ static int console_move_rows_2(struct udevice *dev, uint rowdst, uint rowsrc, +@@ -164,8 +150,7 @@ static int console_move_rows_2(struct udevice *dev, uint rowdst, uint rowsrc,   		vid_priv->line_length;   	src = end - (rowsrc + count) * fontdata->height *   		vid_priv->line_length; @@ -1685,7 +1690,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   	video_damage(dev->parent,   		     0, -@@ -199,11 +184,6 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) +@@ -201,11 +186,6 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, int cp)   	if (ret)   		return ret; @@ -1697,7 +1702,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   	video_damage(dev->parent,   		     x - fontdata->width + 1,   		     linenum - fontdata->height + 1, -@@ -220,7 +200,7 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr) +@@ -222,7 +202,7 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr)   	struct video_fontdata *fontdata = priv->fontdata;   	int pbytes = VNBYTES(vid_priv->bpix);   	void *start, *dst, *line; @@ -1706,7 +1711,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   	start = vid_priv->fb + row * fontdata->height * pbytes;   	line = start; -@@ -230,9 +210,6 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr) +@@ -232,9 +212,6 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr)   			fill_pixel_and_goto_next(&dst, clr, pbytes, pbytes);   		line += vid_priv->line_length;   	} @@ -1716,7 +1721,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   	video_damage(dev->parent,   		     row * fontdata->height, -@@ -252,16 +229,13 @@ static int console_move_rows_3(struct udevice *dev, uint rowdst, uint rowsrc, +@@ -254,16 +231,13 @@ static int console_move_rows_3(struct udevice *dev, uint rowdst, uint rowsrc,   	int pbytes = VNBYTES(vid_priv->bpix);   	void *dst;   	void *src; @@ -1735,7 +1740,7 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   		src += vid_priv->line_length;   		dst += vid_priv->line_length;   	} -@@ -296,10 +270,6 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch) +@@ -299,10 +273,6 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, int cp)   	line = start;   	ret = fill_char_horizontally(pfont, &line, vid_priv, fontdata, NORMAL_DIRECTION); @@ -1747,10 +1752,10 @@ index 6c3e7c1bb8dc..6e9067d1c7fb 100644   		return ret;  diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c -index 0adbf9cc3d67..07bb0af71311 100644 +index 6a17f732fc26..58dcd8e050c3 100644  --- a/drivers/video/console_truetype.c  +++ b/drivers/video/console_truetype.c -@@ -182,7 +182,6 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr) +@@ -194,7 +194,6 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr)   	struct console_tt_priv *priv = dev_get_priv(dev);   	struct console_tt_metrics *met = priv->cur_met;   	void *end, *line; @@ -1758,7 +1763,7 @@ index 0adbf9cc3d67..07bb0af71311 100644   	line = vid_priv->fb + row * met->font_size * vid_priv->line_length;   	end = line + met->font_size * vid_priv->line_length; -@@ -218,9 +217,6 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr) +@@ -230,9 +229,6 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr)   	default:   		return -ENOSYS;   	} @@ -1768,7 +1773,7 @@ index 0adbf9cc3d67..07bb0af71311 100644   	video_damage(dev->parent,   		     0, -@@ -240,14 +236,11 @@ static int console_truetype_move_rows(struct udevice *dev, uint rowdst, +@@ -252,14 +248,11 @@ static int console_truetype_move_rows(struct udevice *dev, uint rowdst,   	struct console_tt_metrics *met = priv->cur_met;   	void *dst;   	void *src; @@ -1785,7 +1790,7 @@ index 0adbf9cc3d67..07bb0af71311 100644   	/* Scroll up our position history */   	diff = (rowsrc - rowdst) * met->font_size; -@@ -280,7 +273,7 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, +@@ -292,7 +285,7 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,   	u8 *bits, *data;   	int advance;   	void *start, *end, *line; @@ -1793,8 +1798,8 @@ index 0adbf9cc3d67..07bb0af71311 100644  +	int row;   	/* First get some basic metrics about this character */ - 	stbtt_GetCodepointHMetrics(font, ch, &advance, &lsb); -@@ -424,9 +417,6 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, + 	stbtt_GetCodepointHMetrics(font, cp, &advance, &lsb); +@@ -439,9 +432,6 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,   		     width,   		     height); @@ -1805,10 +1810,10 @@ index 0adbf9cc3d67..07bb0af71311 100644   	return width_frac;  diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c -index a4029a58660b..f0db412146a8 100644 +index 80e7adf6a1a4..6dc5162804aa 100644  --- a/drivers/video/vidconsole-uclass.c  +++ b/drivers/video/vidconsole-uclass.c -@@ -728,22 +728,6 @@ UCLASS_DRIVER(vidconsole) = { +@@ -759,22 +759,6 @@ UCLASS_DRIVER(vidconsole) = {   	.per_device_auto	= sizeof(struct vidconsole_priv),   }; @@ -1832,10 +1837,10 @@ index a4029a58660b..f0db412146a8 100644   {   	int ret;  diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c -index ac2141892bf7..afbd4670240b 100644 +index add7a85b20fe..3b9b9fad0975 100644  --- a/drivers/video/video-uclass.c  +++ b/drivers/video/video-uclass.c -@@ -160,7 +160,7 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, +@@ -152,7 +152,7 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend,   	struct video_priv *priv = dev_get_uclass_priv(dev);   	void *start, *line;   	int pixels = xend - xstart; @@ -1844,18 +1849,17 @@ index ac2141892bf7..afbd4670240b 100644   	start = priv->fb + ystart * priv->line_length;   	start += xstart * VNBYTES(priv->bpix); -@@ -200,10 +200,6 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, +@@ -191,9 +191,6 @@ int video_fill_part(struct udevice *dev, int xstart, int ystart, int xend, + 		}   		line += priv->line_length;   	} -   -	ret = video_sync_copy(dev, start, line);  -	if (ret)  -		return ret; -- +    	video_damage(dev, xstart, ystart, xend - xstart, yend - ystart); - 	return 0; -@@ -223,7 +219,6 @@ int video_reserve_from_bloblist(struct video_handoff *ho) +@@ -217,7 +214,6 @@ int video_reserve_from_bloblist(struct video_handoff *ho)   int video_fill(struct udevice *dev, u32 colour)   {   	struct video_priv *priv = dev_get_uclass_priv(dev); @@ -1863,7 +1867,7 @@ index ac2141892bf7..afbd4670240b 100644   	switch (priv->bpix) {   	case VIDEO_BPP16: -@@ -248,9 +243,6 @@ int video_fill(struct udevice *dev, u32 colour) +@@ -242,9 +238,6 @@ int video_fill(struct udevice *dev, u32 colour)   		memset(priv->fb, colour, priv->fb_size);   		break;   	} @@ -1873,7 +1877,7 @@ index ac2141892bf7..afbd4670240b 100644   	video_damage(dev, 0, 0, priv->xsize, priv->ysize); -@@ -420,6 +412,27 @@ static void video_flush_dcache(struct udevice *vid) +@@ -412,6 +405,27 @@ static void video_flush_dcache(struct udevice *vid, bool use_copy)   }   #endif @@ -1901,7 +1905,7 @@ index ac2141892bf7..afbd4670240b 100644   /* Flush video activity to the caches */   int video_sync(struct udevice *vid, bool force)   { -@@ -427,6 +440,9 @@ int video_sync(struct udevice *vid, bool force) +@@ -419,6 +433,9 @@ int video_sync(struct udevice *vid, bool force)   	struct video_ops *ops = video_get_ops(vid);   	int ret; @@ -1911,7 +1915,7 @@ index ac2141892bf7..afbd4670240b 100644   	if (ops && ops->video_sync) {   		ret = ops->video_sync(vid);   		if (ret) -@@ -503,69 +519,6 @@ int video_get_ysize(struct udevice *dev) +@@ -502,69 +519,6 @@ int video_get_ysize(struct udevice *dev)   	return priv->ysize;   } @@ -1982,10 +1986,10 @@ index ac2141892bf7..afbd4670240b 100644   	extern u8 __splash_ ## _name ## _begin[]; \   	extern u8 __splash_ ## _name ## _end[]  diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c -index 10943b9ca19f..da2bbe864a03 100644 +index 78de95607924..1f267d45812c 100644  --- a/drivers/video/video_bmp.c  +++ b/drivers/video/video_bmp.c -@@ -268,7 +268,6 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, +@@ -267,7 +267,6 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,   	enum video_format eformat;   	struct bmp_color_table_entry *palette;   	int hdr_size; @@ -1993,7 +1997,7 @@ index 10943b9ca19f..da2bbe864a03 100644   	if (!bmp || !(bmp->header.signature[0] == 'B' &&   	    bmp->header.signature[1] == 'M')) { -@@ -462,11 +461,5 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, +@@ -461,11 +460,5 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,   	video_damage(dev, x, y, width, height); @@ -2006,10 +2010,10 @@ index 10943b9ca19f..da2bbe864a03 100644   	return video_sync(dev, false);   }  diff --git a/include/video.h b/include/video.h -index 307e954db828..3f072b4d6b89 100644 +index d2dabb66e9e6..44557457bf80 100644  --- a/include/video.h  +++ b/include/video.h -@@ -350,43 +350,6 @@ void video_set_default_colors(struct udevice *dev, bool invert); +@@ -353,43 +353,6 @@ void video_set_default_colors(struct udevice *dev, bool invert);    */   int video_default_font_height(struct udevice *dev); @@ -2050,14 +2054,14 @@ index 307e954db828..3f072b4d6b89 100644  -  -#endif  - + #ifdef CONFIG_VIDEO_DAMAGE   /**    * video_damage() - Notify the video subsystem about screen updates. -  *  diff --git a/include/video_console.h b/include/video_console.h -index dbfb389f324f..4b4d2e621b30 100644 +index 8b5928dc5ebb..8806d10f946d 100644  --- a/include/video_console.h  +++ b/include/video_console.h -@@ -406,58 +406,6 @@ void vidconsole_list_fonts(struct udevice *dev); +@@ -529,56 +529,4 @@ void vidconsole_list_fonts(struct udevice *dev);    */   int vidconsole_get_font_size(struct udevice *dev, const char **name, uint *sizep); @@ -2113,14 +2117,12 @@ index dbfb389f324f..4b4d2e621b30 100644  -  -#endif  - - /* -  * Convert an UTF-8 byte into the corresponding character in the CP437 -  * code page. Returns 0 if that character is part of a multi-byte sequence. + #endif  diff --git a/test/dm/video.c b/test/dm/video.c -index 8c7d9800a42e..4c3bcd26e94f 100644 +index 119c43153165..9b7bb51a3dd9 100644  --- a/test/dm/video.c  +++ b/test/dm/video.c -@@ -106,6 +106,7 @@ static int check_copy_frame_buffer(struct unit_test_state *uts, +@@ -105,6 +105,7 @@ static int check_copy_frame_buffer(struct unit_test_state *uts,   	if (!IS_ENABLED(CONFIG_VIDEO_COPY))   		return 0; @@ -2128,7 +2130,7 @@ index 8c7d9800a42e..4c3bcd26e94f 100644   	ut_assertf(!memcmp(priv->fb, priv->copy_fb, priv->fb_size),   		   "Copy framebuffer does not match fb"); -@@ -706,7 +707,7 @@ static int dm_test_video_copy(struct unit_test_state *uts) +@@ -705,7 +706,7 @@ static int dm_test_video_copy(struct unit_test_state *uts)   	vidconsole_put_string(con, test_string);   	vidconsole_put_string(con, test_string);   	ut_asserteq(7589, compress_frame_buffer(uts, dev, false)); @@ -2138,10 +2140,10 @@ index 8c7d9800a42e..4c3bcd26e94f 100644   	return 0;   }  --  -2.42.0 +2.45.2 -From cf7e5c9411fbe82487191e162bafcf178eaeaf5e Mon Sep 17 00:00:00 2001 +From d0b64a4e493b665d7abafc185d88f533ebc27f2f Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Tue, 3 Jan 2023 22:50:03 +0100  Subject: [PATCH 12/13] video: Always compile cache flushing code @@ -2162,21 +2164,16 @@ Signed-off-by: Alexander Graf <agraf@csgraf.de>  Reviewed-by: Simon Glass <sjg@chromium.org>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-13-alpernebiyasak@gmail.com/  --- - drivers/video/video-uclass.c | 14 +++++--------- - 1 file changed, 5 insertions(+), 9 deletions(-) + drivers/video/video-uclass.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-)  diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c -index afbd4670240b..2c7777261ad1 100644 +index 3b9b9fad0975..f050ed1f67cb 100644  --- a/drivers/video/video-uclass.c  +++ b/drivers/video/video-uclass.c -@@ -377,11 +377,13 @@ void video_damage(struct udevice *vid, int x, int y, int width, int height) - 	priv->damage.yend = max(yend, priv->damage.yend); - } -  --#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) - static void video_flush_dcache(struct udevice *vid) - { +@@ -377,6 +377,9 @@ static void video_flush_dcache(struct udevice *vid, bool use_copy)   	struct video_priv *priv = dev_get_uclass_priv(vid); + 	ulong fb = use_copy ? (ulong)priv->copy_fb : (ulong)priv->fb;  +	if (CONFIG_IS_ENABLED(SYS_DCACHE_OFF))  +		return; @@ -2184,15 +2181,7 @@ index afbd4670240b..2c7777261ad1 100644   	if (!priv->flush_dcache)   		return; -@@ -410,7 +412,6 @@ static void video_flush_dcache(struct udevice *vid) - 		} - 	} - } --#endif -  - static void video_flush_copy(struct udevice *vid) - { -@@ -449,14 +450,9 @@ int video_sync(struct udevice *vid, bool force) +@@ -442,17 +445,12 @@ int video_sync(struct udevice *vid, bool force)   			return ret;   	} @@ -2202,7 +2191,10 @@ index afbd4670240b..2c7777261ad1 100644  -	 * out whether it exists? For now, ARM is safe.  -	 */  -#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) - 	video_flush_dcache(vid); + 	video_flush_dcache(vid, false); +  + 	if (IS_ENABLED(CONFIG_VIDEO_COPY)) + 		video_flush_dcache(vid, true);  -#elif defined(CONFIG_VIDEO_SANDBOX_SDL)  +  +#if defined(CONFIG_VIDEO_SANDBOX_SDL) @@ -2210,10 +2202,10 @@ index afbd4670240b..2c7777261ad1 100644   	if (force || get_timer(last_sync) > 100) {  --  -2.42.0 +2.45.2 -From 2ada48e20ae7fb1ce66d63c6f549887c38b058d4 Mon Sep 17 00:00:00 2001 +From e6b053a9d59d0b4ea0936edee5be2fadf0b8efc2 Mon Sep 17 00:00:00 2001  From: Alexander Graf <agraf@csgraf.de>  Date: Tue, 3 Jan 2023 22:50:04 +0100  Subject: [PATCH 13/13] video: Enable VIDEO_DAMAGE for drivers that need it @@ -2230,6 +2222,7 @@ Signed-off-by: Alexander Graf <agraf@csgraf.de>  [Alper: Add to VIDEO_TIDSS, imply instead of select]  Co-developed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>  Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Reviewed-by: Simon Glass <sjg@chromium.org>  Link: https://lore.kernel.org/u-boot/20230821135111.3558478-14-alpernebiyasak@gmail.com/  ---   arch/arm/mach-sunxi/Kconfig    | 1 + @@ -2244,11 +2237,11 @@ Link: https://lore.kernel.org/u-boot/20230821135111.3558478-14-alpernebiyasak@gm   9 files changed, 16 insertions(+)  diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig -index e20c3a3ee926..6bd813b68c9c 100644 +index ddf9414b08e7..3c9745065bab 100644  --- a/arch/arm/mach-sunxi/Kconfig  +++ b/arch/arm/mach-sunxi/Kconfig -@@ -813,6 +813,7 @@ config VIDEO_SUNXI - 	depends on !SUN50I_GEN_H6 +@@ -863,6 +863,7 @@ config VIDEO_SUNXI + 	depends on !SUNXI_GEN_NCAT2   	select VIDEO   	select DISPLAY  +	imply VIDEO_DAMAGE @@ -2256,7 +2249,7 @@ index e20c3a3ee926..6bd813b68c9c 100644   	default y   	---help---  diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig -index 5f17c6be84ed..546df93f51a9 100644 +index 88c6f8e68976..06d3ed8a736e 100644  --- a/drivers/video/Kconfig  +++ b/drivers/video/Kconfig  @@ -499,6 +499,7 @@ config VIDEO_LCD_ANX9804 @@ -2275,7 +2268,7 @@ index 5f17c6be84ed..546df93f51a9 100644   	help   	  The graphics processor already sets up the display so this driver   	  simply checks the resolution and then sets up the frame buffer with -@@ -654,6 +656,7 @@ source "drivers/video/meson/Kconfig" +@@ -671,6 +673,7 @@ source "drivers/video/meson/Kconfig"   config VIDEO_MVEBU   	bool "Armada XP LCD controller" @@ -2283,7 +2276,7 @@ index 5f17c6be84ed..546df93f51a9 100644   	---help---   	Support for the LCD controller integrated in the Marvell   	Armada XP SoC. -@@ -688,6 +691,7 @@ config NXP_TDA19988 +@@ -705,6 +708,7 @@ config NXP_TDA19988   config ATMEL_HLCD   	bool "Enable ATMEL video support using HLCDC" @@ -2291,7 +2284,7 @@ index 5f17c6be84ed..546df93f51a9 100644   	help   	   HLCDC supports video output to an attached LCD panel. -@@ -764,6 +768,7 @@ source "drivers/video/tidss/Kconfig" +@@ -781,6 +785,7 @@ source "drivers/video/tidss/Kconfig"   config VIDEO_TEGRA124   	bool "Enable video support on Tegra124" @@ -2299,7 +2292,7 @@ index 5f17c6be84ed..546df93f51a9 100644   	help   	   Tegra124 supports many video output options including eDP and   	   HDMI. At present only eDP is supported by U-Boot. This option -@@ -778,6 +783,7 @@ source "drivers/video/imx/Kconfig" +@@ -795,6 +800,7 @@ source "drivers/video/imx/Kconfig"   config VIDEO_MXS   	bool "Enable video support on i.MX28/i.MX6UL/i.MX7 SoCs" @@ -2307,7 +2300,7 @@ index 5f17c6be84ed..546df93f51a9 100644   	help   	  Enable framebuffer driver for i.MX28/i.MX6UL/i.MX7 processors -@@ -840,6 +846,7 @@ config VIDEO_DW_MIPI_DSI +@@ -857,6 +863,7 @@ config VIDEO_DW_MIPI_DSI   config VIDEO_SIMPLE   	bool "Simple display driver for preconfigured display" @@ -2315,7 +2308,7 @@ index 5f17c6be84ed..546df93f51a9 100644   	help   	  Enables a simple generic display driver which utilizes the   	  simple-framebuffer devicetree bindings. -@@ -858,6 +865,7 @@ config VIDEO_DT_SIMPLEFB +@@ -875,6 +882,7 @@ config VIDEO_DT_SIMPLEFB   config VIDEO_MCDE_SIMPLE   	bool "Simple driver for ST-Ericsson MCDE with preconfigured display" @@ -2407,5 +2400,5 @@ index 95086f3a5d66..3291b3ceb8d5 100644   	  TIDSS supports  video output options LVDS and   	  DPI . This option enables these supports which can be used on  --  -2.42.0 +2.45.2 diff --git a/config/u-boot/default/patches/0004-HACK-Makefile-Ignore-missing-input-files-for-binman.patch b/config/u-boot/default/patches/0004-HACK-Makefile-Ignore-missing-input-files-for-binman.patch new file mode 100644 index 00000000..e1a26bb4 --- /dev/null +++ b/config/u-boot/default/patches/0004-HACK-Makefile-Ignore-missing-input-files-for-binman.patch @@ -0,0 +1,34 @@ +From ba34d29274c23c52be957ea040539dccbab09765 Mon Sep 17 00:00:00 2001 +From: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Date: Wed, 10 Jul 2024 17:37:56 +0300 +Subject: [PATCH] HACK: Makefile: Ignore missing input files for binman images + +For Rockchip boards binman tries to build SPI and MMC images that +require an externally built BL31 file to be provided, and the build +fails otherwise. + +Some downstreams only care about build outputs for U-Boot proper. As a +hack to make sure they can do so without passing in a BL31 file, tell +binman to ignore missing input files. + +Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 1c754ceb5953..fec8d9b2d2b1 100644 +--- a/Makefile ++++ b/Makefile +@@ -1375,7 +1375,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ +                 --toolpath $(objtree)/tools \ + 		$(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ + 		build -u -d u-boot.dtb -O . -m \ +-		--allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \ ++		--allow-missing --ignore-missing \ + 		-I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ + 		-I $(dt_dir) -a of-list=$(CONFIG_OF_LIST) \ + 		$(foreach f,$(BINMAN_INDIRS),-I $(f)) \ +--  +2.45.2 + diff --git a/config/u-boot/default/patches/0004-HACK-regulator-Don-t-error-on-reentrant-regulator-ac.patch b/config/u-boot/default/patches/0004-HACK-regulator-Don-t-error-on-reentrant-regulator-ac.patch deleted file mode 100644 index 3a66b99a..00000000 --- a/config/u-boot/default/patches/0004-HACK-regulator-Don-t-error-on-reentrant-regulator-ac.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 2ab104621dc97a89bc8f75e3b5903b83e793baf8 Mon Sep 17 00:00:00 2001 -From: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Date: Sat, 19 Aug 2023 16:43:58 +0300 -Subject: [PATCH] HACK: regulator: Don't error on reentrant regulator actions - -Commit 4fcba5d556b42 ("regulator: implement basic reference counter") -implements reference counting for regulator enable/disable actions, but -does not update its callers to handle the error cases it adds. This -breaks gru-kevin, report enabling the regulator as a success as a -workaround. It would be better to fix the callers but that needs more -debugging. - -Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> ---- - drivers/power/regulator/regulator_common.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c -index e26f5ebec347..1c2dfdf9b19d 100644 ---- a/drivers/power/regulator/regulator_common.c -+++ b/drivers/power/regulator/regulator_common.c -@@ -75,7 +75,7 @@ int regulator_common_set_enable(const struct udevice *dev, - 	/* If previously enabled, increase count */ - 	if (enable && plat->enable_count > 0) { - 		plat->enable_count++; --		return -EALREADY; -+		return 0; - 	} -  - 	if (!enable) { -@@ -85,7 +85,7 @@ int regulator_common_set_enable(const struct udevice *dev, - 			return -EBUSY; - 		} else if (!plat->enable_count) { - 			/* If already disabled, do nothing */ --			return -EALREADY; -+			return 0; - 		} - 	} -  ---  -2.42.0 - diff --git a/config/u-boot/default/patches/0005-HACK-rk3399-gru-Remove-assigned-clock-dt-properties-.patch b/config/u-boot/default/patches/0005-HACK-rk3399-gru-Remove-assigned-clock-dt-properties-.patch new file mode 100644 index 00000000..73789811 --- /dev/null +++ b/config/u-boot/default/patches/0005-HACK-rk3399-gru-Remove-assigned-clock-dt-properties-.patch @@ -0,0 +1,36 @@ +From 1107dc81b24743e77374f1b484a843d81fa0348a Mon Sep 17 00:00:00 2001 +From: Alper Nebi Yasak <alpernebiyasak@gmail.com> +Date: Wed, 10 Jul 2024 14:32:19 +0300 +Subject: [PATCH] HACK: rk3399: gru: Remove assigned clock dt properties for + EDP node + +Having the PCLK_EDP clock in the assigned-clocks property of the `edp` +node means that U-Boot tries to set its rate automatically. This clock +isn't implemented for the RK3399 clock driver, so it fails and prevents +display from being initialized. + +The display happens to work fine without it, remove the property until +the clock driver can handle the clock. + +Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> +--- + arch/arm/dts/rk3399-gru-u-boot.dtsi | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi b/arch/arm/dts/rk3399-gru-u-boot.dtsi +index 487dde38d86a..30cfb58aca12 100644 +--- a/arch/arm/dts/rk3399-gru-u-boot.dtsi ++++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi +@@ -28,6 +28,9 @@ &cros_ec { +  + &edp { + 	rockchip,panel = <&edp_panel>; ++ ++	/delete-property/ assigned-clocks; ++	/delete-property/ assigned-clock-rates; + }; +  + &pp1800_audio { +--  +2.45.2 + diff --git a/config/u-boot/default/patches/0005-HACK-rockchip-Remove-binman-image-descriptions.patch b/config/u-boot/default/patches/0005-HACK-rockchip-Remove-binman-image-descriptions.patch deleted file mode 100644 index ac3ada3b..00000000 --- a/config/u-boot/default/patches/0005-HACK-rockchip-Remove-binman-image-descriptions.patch +++ /dev/null @@ -1,307 +0,0 @@ -From b14bc4a5d8dc31294dde4ee9ce8008d763c695de Mon Sep 17 00:00:00 2001 -From: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Date: Fri, 13 Oct 2023 14:06:26 +0300 -Subject: [PATCH] HACK: rockchip: Remove binman image descriptions - -For Rockchip boards binman tries to build SPI and MMC images that -require an externally built BL31 file to be provided, and the build -fails otherwise. This is not really as configurable as it should be. - -Some downstreams only care about build outputs for U-Boot proper. As a -hack to make sure they can do so without building BL31, remove the -binman image descriptions from the device-tree sources. However, -BINMAN_FDT expects these to be present and has to be disabled as well. - -Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> ---- - arch/arm/dts/rk3288-u-boot.dtsi     |  24 ---- - arch/arm/dts/rk3399-gru-u-boot.dtsi |   6 - - arch/arm/dts/rk3399-u-boot.dtsi     |  25 ---- - arch/arm/dts/rockchip-u-boot.dtsi   | 186 ---------------------------- - 4 files changed, 241 deletions(-) - -diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi -index c4c5a2d225c4..432ab92d97c9 100644 ---- a/arch/arm/dts/rk3288-u-boot.dtsi -+++ b/arch/arm/dts/rk3288-u-boot.dtsi -@@ -55,30 +55,6 @@ noc: syscon@ffac0000 { - 	}; - }; -  --#if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM) --&binman { --	rom { --		filename = "u-boot.rom"; --		size = <0x400000>; --		pad-byte = <0xff>; -- --		mkimage { --			args = "-n rk3288 -T rkspi"; --			u-boot-spl { --			}; --		}; --		u-boot-img { --			offset = <0x20000>; --		}; --		u-boot { --			offset = <0x300000>; --		}; --		fdtmap { --		}; --	}; --}; --#endif -- - &bus_intmem { - 	ddr_sram: ddr-sram@1000 { - 		compatible = "rockchip,rk3288-ddr-sram"; -diff --git a/arch/arm/dts/rk3399-gru-u-boot.dtsi b/arch/arm/dts/rk3399-gru-u-boot.dtsi -index b1604a6872c0..54296b4d7a1c 100644 ---- a/arch/arm/dts/rk3399-gru-u-boot.dtsi -+++ b/arch/arm/dts/rk3399-gru-u-boot.dtsi -@@ -15,12 +15,6 @@ config { - 	}; - }; -  --&binman { --	rom { --		size = <0x800000>; --	}; --}; -- - &cros_ec { - 	ec-interrupt = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>; - }; -diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi -index 3423b882c437..0bf4c481b39a 100644 ---- a/arch/arm/dts/rk3399-u-boot.dtsi -+++ b/arch/arm/dts/rk3399-u-boot.dtsi -@@ -60,31 +60,6 @@ pmusgrf: syscon@ff330000 { -  - }; -  --#if defined(CONFIG_ROCKCHIP_SPI_IMAGE) && defined(CONFIG_HAS_ROM) --&binman { --	multiple-images; --	rom { --		filename = "u-boot.rom"; --		size = <0x400000>; --		pad-byte = <0xff>; -- --		mkimage { --			args = "-n rk3399 -T rkspi"; --			u-boot-spl { --			}; --		}; --		u-boot-img { --			offset = <0x40000>; --		}; --		u-boot { --			offset = <0x300000>; --		}; --		fdtmap { --		}; --	}; --}; --#endif /* CONFIG_ROCKCHIP_SPI_IMAGE && CONFIG_HAS_ROM */ -- - &cru { - 	bootph-all; - }; -diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi -index be2658e8ef18..3d55553e4401 100644 ---- a/arch/arm/dts/rockchip-u-boot.dtsi -+++ b/arch/arm/dts/rockchip-u-boot.dtsi -@@ -10,189 +10,3 @@ binman: binman { - 		multiple-images; - 	}; - }; -- --#ifdef CONFIG_SPL --&binman { --	simple-bin { --		filename = "u-boot-rockchip.bin"; --		pad-byte = <0xff>; -- --		mkimage { --			filename = "idbloader.img"; --			args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; --			multiple-data-files; -- --#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL --			rockchip-tpl { --			}; --#elif defined(CONFIG_TPL) --			u-boot-tpl { --			}; --#endif --			u-boot-spl { --			}; --		}; -- --#if defined(CONFIG_SPL_FIT) && (defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE)) --		fit: fit { --#ifdef CONFIG_ARM64 --			description = "FIT image for U-Boot with bl31 (TF-A)"; --#else --			description = "FIT image with OP-TEE"; --#endif --			#address-cells = <1>; --			fit,fdt-list = "of-list"; --			filename = "u-boot.itb"; --			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; --			fit,align = <512>; --			offset = <CONFIG_SPL_PAD_TO>; --			images { --				u-boot { --					description = "U-Boot"; --					type = "standalone"; --					os = "U-Boot"; --#ifdef CONFIG_ARM64 --					arch = "arm64"; --#else --					arch = "arm"; --#endif --					compression = "none"; --					load = <CONFIG_TEXT_BASE>; --					entry = <CONFIG_TEXT_BASE>; --					u-boot-nodtb { --					}; --#ifdef CONFIG_SPL_FIT_SIGNATURE --					hash { --						algo = "sha256"; --					}; --#endif --				}; -- --#ifdef CONFIG_ARM64 --				@atf-SEQ { --					fit,operation = "split-elf"; --					description = "ARM Trusted Firmware"; --					type = "firmware"; --					arch = "arm64"; --					os = "arm-trusted-firmware"; --					compression = "none"; --					fit,load; --					fit,entry; --					fit,data; -- --					atf-bl31 { --					}; --#ifdef CONFIG_SPL_FIT_SIGNATURE --					hash { --						algo = "sha256"; --					}; --#endif --				}; --				@tee-SEQ { --					fit,operation = "split-elf"; --					description = "TEE"; --					type = "tee"; --					arch = "arm64"; --					os = "tee"; --					compression = "none"; --					fit,load; --					fit,entry; --					fit,data; -- --					tee-os { --						optional; --					}; --#ifdef CONFIG_SPL_FIT_SIGNATURE --					hash { --						algo = "sha256"; --					}; --#endif --				}; --#else --				op-tee { --					description = "OP-TEE"; --					type = "tee"; --					arch = "arm"; --					os = "tee"; --					compression = "none"; --					load = <(CFG_SYS_SDRAM_BASE + 0x8400000)>; --					entry = <(CFG_SYS_SDRAM_BASE + 0x8400000)>; -- --					tee-os { --					}; --#ifdef CONFIG_SPL_FIT_SIGNATURE --					hash { --						algo = "sha256"; --					}; --#endif --				}; --#endif -- --				@fdt-SEQ { --					description = "fdt-NAME"; --					compression = "none"; --					type = "flat_dt"; --#ifdef CONFIG_SPL_FIT_SIGNATURE --					hash { --						algo = "sha256"; --					}; --#endif --				}; --			}; -- --			configurations { --				default = "@config-DEFAULT-SEQ"; --				@config-SEQ { --					description = "NAME.dtb"; --					fdt = "fdt-SEQ"; --#ifdef CONFIG_ARM64 --					fit,firmware = "atf-1", "u-boot"; --#else --					fit,firmware = "op-tee", "u-boot"; --#endif --					fit,loadables; --				}; --			}; --		}; --#else --		u-boot-img { --			offset = <CONFIG_SPL_PAD_TO>; --		}; --#endif --	}; -- --#ifdef CONFIG_ROCKCHIP_SPI_IMAGE --	simple-bin-spi { --		filename = "u-boot-rockchip-spi.bin"; --		pad-byte = <0xff>; -- --		mkimage { --			filename = "idbloader-spi.img"; --			args = "-n", CONFIG_SYS_SOC, "-T", "rkspi"; --			multiple-data-files; -- --#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL --			rockchip-tpl { --			}; --#elif defined(CONFIG_TPL) --			u-boot-tpl { --			}; --#endif --			u-boot-spl { --			}; --		}; -- --#if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE) --		fit { --			type = "blob"; --			filename = "u-boot.itb"; --#else --		u-boot-img { --#endif --			/* Sync with u-boot,spl-payload-offset if present */ --			offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>; --		}; --	}; --#endif /* CONFIG_ROCKCHIP_SPI_IMAGE */ --}; --#endif /* CONFIG_SPL */ ---  -2.42.0 - diff --git a/config/u-boot/default/patches/0006-arm-qemu-Enable-Bochs-console-buffering-USB-keyboard.patch b/config/u-boot/default/patches/0006-arm-qemu-Enable-Bochs-console-buffering-USB-keyboard.patch deleted file mode 100644 index 7aa4e526..00000000 --- a/config/u-boot/default/patches/0006-arm-qemu-Enable-Bochs-console-buffering-USB-keyboard.patch +++ /dev/null @@ -1,348 +0,0 @@ -From 2957e8bf43edf8de6e579ce1ed7f95e5bb4a1437 Mon Sep 17 00:00:00 2001 -From: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Date: Mon, 14 Aug 2023 20:39:41 +0300 -Subject: [PATCH 1/4] arm: qemu: Enable Bochs video support - -Commit 716161663ec49 ("riscv: qemu: Enable Bochs video support") enables -a video console for QEMU RISC-V virtual machines using an emulated Bochs -VGA card. Similarly, enable it for ARM virtual machines as well. - -Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Reviewed-by: Bin Meng <bmeng@tinylab.org> -Link: https://lore.kernel.org/u-boot/20230814173944.288356-2-alpernebiyasak@gmail.com/ ---- - arch/arm/Kconfig                      | 4 ++++ - board/emulation/qemu-arm/qemu-arm.env | 3 +++ - doc/board/emulation/qemu-arm.rst      | 4 ++++ - 3 files changed, 11 insertions(+) - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 328e2ddc33af..d96e230e9ee8 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -1036,6 +1036,10 @@ config ARCH_QEMU - 	imply DM_RTC - 	imply RTC_PL031 - 	imply OF_HAS_PRIOR_STAGE -+	imply VIDEO -+	imply VIDEO_BOCHS -+	imply SYS_WHITE_ON_BLACK -+	imply SYS_CONSOLE_IS_IN_ENV -  - config ARCH_RMOBILE - 	bool "Renesas ARM SoCs" -diff --git a/board/emulation/qemu-arm/qemu-arm.env b/board/emulation/qemu-arm/qemu-arm.env -index e658d5ee7d63..86a99a2e8713 100644 ---- a/board/emulation/qemu-arm/qemu-arm.env -+++ b/board/emulation/qemu-arm/qemu-arm.env -@@ -2,6 +2,9 @@ -  - /* environment for qemu-arm and qemu-arm64 */ -  -+stdin=serial -+stdout=serial,vidconsole -+stderr=serial,vidconsole - fdt_high=0xffffffff - initrd_high=0xffffffff - fdt_addr=0x40000000 -diff --git a/doc/board/emulation/qemu-arm.rst b/doc/board/emulation/qemu-arm.rst -index 7291fa4a3150..c423fce76edd 100644 ---- a/doc/board/emulation/qemu-arm.rst -+++ b/doc/board/emulation/qemu-arm.rst -@@ -67,6 +67,10 @@ Additional persistent U-Boot environment support can be added as follows: - Additional peripherals that have been tested to work in both U-Boot and Linux - can be enabled with the following command line parameters: -  -+- To add a video console, remove "-nographic" and add e.g.:: -+ -+    -serial stdio -device VGA -+ - - To add a Serial ATA disk via an Intel ICH9 AHCI controller, pass e.g.:: -  -     -drive if=none,file=disk.img,format=raw,id=mydisk \ ---  -2.42.0 - - -From 5330bc1c2ad84ba9ecc473f8c24d6e15b366adf9 Mon Sep 17 00:00:00 2001 -From: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Date: Mon, 14 Aug 2023 20:39:42 +0300 -Subject: [PATCH 2/4] arm: qemu: Enable PRE_CONSOLE_BUFFER - -Commit 608b80b5b855 ("riscv: qemu: Enable PRE_CONSOLE_BUFFER") enables -buffering console messages for QEMU RISC-V virtual machines so those -printed before the video console is available will still show up on the -display. Similarly, enable it for ARM virtual machines as well. - -Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Reviewed-by: Simon Glass <sjg@chromium.org> -Reviewed-by: Bin Meng <bmeng@tinylab.org> -Link: https://lore.kernel.org/u-boot/20230814173944.288356-3-alpernebiyasak@gmail.com/ ---- - arch/arm/Kconfig                 | 1 + - board/emulation/qemu-arm/Kconfig | 4 ++++ - 2 files changed, 5 insertions(+) - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index d96e230e9ee8..1cc2be55140a 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -1040,6 +1040,7 @@ config ARCH_QEMU - 	imply VIDEO_BOCHS - 	imply SYS_WHITE_ON_BLACK - 	imply SYS_CONSOLE_IS_IN_ENV -+	imply PRE_CONSOLE_BUFFER -  - config ARCH_RMOBILE - 	bool "Renesas ARM SoCs" -diff --git a/board/emulation/qemu-arm/Kconfig b/board/emulation/qemu-arm/Kconfig -index ed9949651c4b..09c95413a541 100644 ---- a/board/emulation/qemu-arm/Kconfig -+++ b/board/emulation/qemu-arm/Kconfig -@@ -12,6 +12,10 @@ config BOARD_SPECIFIC_OPTIONS # dummy - 	imply VIRTIO_NET - 	imply VIRTIO_BLK -  -+config PRE_CON_BUF_ADDR -+	hex -+	default 0x40100000 -+ - endif -  - if TARGET_QEMU_ARM_64BIT && !TFABOOT ---  -2.42.0 - - -From 7f666214855d062dc939ff54a0fa52fbde9f0391 Mon Sep 17 00:00:00 2001 -From: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Date: Mon, 14 Aug 2023 20:39:43 +0300 -Subject: [PATCH 3/4] arm: qemu: Enable usb keyboard as an input device - -Commit 02be57caf730 ("riscv: qemu: Enable usb keyboard as an input -device") adds PCI xHCI support to QEMU RISC-V virtual machines and -enables using a USB keyboard as one of the input devices. Similarly, -enable those for ARM virtual machines as well. - -Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Reviewed-by: Simon Glass <sjg@chromium.org> -Reviewed-by: Bin Meng <bmeng@tinylab.org> -Link: https://lore.kernel.org/u-boot/20230814173944.288356-4-alpernebiyasak@gmail.com/ ---- - arch/arm/Kconfig                      | 5 +++++ - board/emulation/qemu-arm/qemu-arm.c   | 5 +++++ - board/emulation/qemu-arm/qemu-arm.env | 2 +- - configs/qemu_arm64_defconfig          | 2 -- - configs/qemu_arm_defconfig            | 2 -- - doc/board/emulation/qemu-arm.rst      | 4 ++++ - 6 files changed, 15 insertions(+), 5 deletions(-) - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 1cc2be55140a..4c739bd9bc82 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -1041,6 +1041,11 @@ config ARCH_QEMU - 	imply SYS_WHITE_ON_BLACK - 	imply SYS_CONSOLE_IS_IN_ENV - 	imply PRE_CONSOLE_BUFFER -+	imply USB -+	imply USB_XHCI_HCD -+	imply USB_XHCI_PCI -+	imply USB_KEYBOARD -+	imply CMD_USB -  - config ARCH_RMOBILE - 	bool "Renesas ARM SoCs" -diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c -index dfea0d92a3c8..942f1fff5717 100644 ---- a/board/emulation/qemu-arm/qemu-arm.c -+++ b/board/emulation/qemu-arm/qemu-arm.c -@@ -11,6 +11,7 @@ - #include <fdtdec.h> - #include <init.h> - #include <log.h> -+#include <usb.h> - #include <virtio_types.h> - #include <virtio.h> -  -@@ -114,6 +115,10 @@ int board_late_init(void) - 	 */ - 	virtio_init(); -  -+	/* start usb so that usb keyboard can be used as input device */ -+	if (CONFIG_IS_ENABLED(USB_KEYBOARD)) -+		usb_init(); -+ - 	return 0; - } -  -diff --git a/board/emulation/qemu-arm/qemu-arm.env b/board/emulation/qemu-arm/qemu-arm.env -index 86a99a2e8713..fb4adef281ed 100644 ---- a/board/emulation/qemu-arm/qemu-arm.env -+++ b/board/emulation/qemu-arm/qemu-arm.env -@@ -2,7 +2,7 @@ -  - /* environment for qemu-arm and qemu-arm64 */ -  --stdin=serial -+stdin=serial,usbkbd - stdout=serial,vidconsole - stderr=serial,vidconsole - fdt_high=0xffffffff -diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig -index 94bd96678443..f6b8ae530a4a 100644 ---- a/configs/qemu_arm64_defconfig -+++ b/configs/qemu_arm64_defconfig -@@ -35,7 +35,6 @@ CONFIG_CMD_NVEDIT_EFI=y - CONFIG_CMD_DFU=y - CONFIG_CMD_MTD=y - CONFIG_CMD_PCI=y --CONFIG_CMD_USB=y - CONFIG_CMD_TPM=y - CONFIG_CMD_MTDPARTS=y - CONFIG_ENV_IS_IN_FLASH=y -@@ -68,7 +67,6 @@ CONFIG_SYSRESET=y - CONFIG_SYSRESET_CMD_POWEROFF=y - CONFIG_SYSRESET_PSCI=y - CONFIG_TPM2_MMIO=y --CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_EHCI_PCI=y - CONFIG_TPM=y -diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig -index 7cb1e9f037ff..1347b86f34b1 100644 ---- a/configs/qemu_arm_defconfig -+++ b/configs/qemu_arm_defconfig -@@ -36,7 +36,6 @@ CONFIG_CMD_NVEDIT_EFI=y - CONFIG_CMD_DFU=y - CONFIG_CMD_MTD=y - CONFIG_CMD_PCI=y --CONFIG_CMD_USB=y - CONFIG_CMD_TPM=y - CONFIG_CMD_MTDPARTS=y - CONFIG_ENV_IS_IN_FLASH=y -@@ -69,7 +68,6 @@ CONFIG_SYSRESET=y - CONFIG_SYSRESET_CMD_POWEROFF=y - CONFIG_SYSRESET_PSCI=y - CONFIG_TPM2_MMIO=y --CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_EHCI_PCI=y - CONFIG_TPM=y -diff --git a/doc/board/emulation/qemu-arm.rst b/doc/board/emulation/qemu-arm.rst -index c423fce76edd..5481ef6da328 100644 ---- a/doc/board/emulation/qemu-arm.rst -+++ b/doc/board/emulation/qemu-arm.rst -@@ -84,6 +84,10 @@ can be enabled with the following command line parameters: -  -     -device usb-ehci,id=ehci -  -+- To add a USB keyboard attached to an emulated xHCI controller, pass e.g.:: -+ -+    -device qemu-xhci,id=xhci -device usb-kbd,bus=xhci.0 -+ - - To add an NVMe disk, pass e.g.:: -  -     -drive if=none,file=disk.img,id=mydisk -device nvme,drive=mydisk,serial=foo ---  -2.42.0 - - -From fcc1b6cb56beaaf90bf80928627a606f33a42c3c Mon Sep 17 00:00:00 2001 -From: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Date: Mon, 14 Aug 2023 20:39:44 +0300 -Subject: [PATCH 4/4] doc: qemu: arm: Add a section on booting Linux distros - -Add an example qemu-system-aarch64 command that can make U-Boot on QEMU -boot into the Debian Installer, along with resulting console messages -from U-Boot, based on the existing documentation section for the x86 -version. - -Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> -Link: https://lore.kernel.org/u-boot/20230814173944.288356-5-alpernebiyasak@gmail.com/ ---- - doc/board/emulation/qemu-arm.rst | 68 ++++++++++++++++++++++++++++++++ - 1 file changed, 68 insertions(+) - -diff --git a/doc/board/emulation/qemu-arm.rst b/doc/board/emulation/qemu-arm.rst -index 5481ef6da328..1c91c7f3ac67 100644 ---- a/doc/board/emulation/qemu-arm.rst -+++ b/doc/board/emulation/qemu-arm.rst -@@ -98,6 +98,74 @@ can be enabled with the following command line parameters: -  - These have been tested in QEMU 2.9.0 but should work in at least 2.5.0 as well. -  -+Booting distros -+--------------- -+ -+It is possible to install and boot a standard Linux distribution using -+qemu_arm64 by setting up a root disk:: -+ -+    qemu-img create root.img 20G -+ -+then using the installer to install. For example, with Debian 12:: -+ -+    qemu-system-aarch64 \ -+      -machine virt -cpu cortex-a53 -m 4G -smp 4 \ -+      -bios u-boot.bin \ -+      -serial stdio -device VGA \ -+      -nic user,model=virtio-net-pci \ -+      -device virtio-rng-pci \ -+      -device qemu-xhci,id=xhci \ -+      -device usb-kbd -device usb-tablet \ -+      -drive if=virtio,file=debian-12.0.0-arm64-netinst.iso,format=raw,readonly=on,media=cdrom \ -+      -drive if=virtio,file=root.img,format=raw,media=disk -+ -+The output will be something like this:: -+ -+    U-Boot 2023.10-rc2-00075-gbe8fbe718e35 (Aug 11 2023 - 08:38:49 +0000) -+ -+    DRAM:  4 GiB -+    Core:  51 devices, 14 uclasses, devicetree: board -+    Flash: 64 MiB -+    Loading Environment from Flash... *** Warning - bad CRC, using default environment -+ -+    In:    serial,usbkbd -+    Out:   serial,vidconsole -+    Err:   serial,vidconsole -+    Bus xhci_pci: Register 8001040 NbrPorts 8 -+    Starting the controller -+    USB XHCI 1.00 -+    scanning bus xhci_pci for devices... 3 USB Device(s) found -+    Net:   eth0: virtio-net#32 -+    Hit any key to stop autoboot:  0 -+    Scanning for bootflows in all bootdevs -+    Seq  Method       State   Uclass    Part  Name                      Filename -+    ---  -----------  ------  --------  ----  ------------------------  ---------------- -+    Scanning global bootmeth 'efi_mgr': -+    Scanning bootdev 'fw-cfg@9020000.bootdev': -+    fatal: no kernel available -+    scanning bus for devices... -+    Scanning bootdev 'virtio-blk#34.bootdev': -+      0  efi          ready   virtio       2  virtio-blk#34.bootdev.par efi/boot/bootaa64.efi -+    ** Booting bootflow 'virtio-blk#34.bootdev.part_2' with efi -+    Using prior-stage device tree -+    Failed to load EFI variables -+    Error: writing contents -+    ** Unable to write file ubootefi.var ** -+    Failed to persist EFI variables -+    Missing TPMv2 device for EFI_TCG_PROTOCOL -+    Booting /efi\boot\bootaa64.efi -+    Error: writing contents -+    ** Unable to write file ubootefi.var ** -+    Failed to persist EFI variables -+    Welcome to GRUB! -+ -+Standard boot looks through various available devices and finds the virtio -+disks, then boots from the first one. After a second or so the grub menu appears -+and you can work through the installer flow normally. -+ -+After the installation, you can boot into the installed system by running QEMU -+again without the drive argument corresponding to the installer CD image. -+ - Enabling TPMv2 support - ---------------------- -  ---  -2.42.0 - diff --git a/config/u-boot/default/target.cfg b/config/u-boot/default/target.cfg index cdbb5216..8d6af6d9 100644 --- a/config/u-boot/default/target.cfg +++ b/config/u-boot/default/target.cfg @@ -1,2 +1,2 @@  tree="default" -rev="4459ed60cb1e0562bc5b40405e2b4b9bbf766d57" # v2023.10 +rev="3f772959501c99fbe5aa0b22a36efe3478d1ae1c" # v2024.07 diff --git a/config/u-boot/gru_bob/config/default b/config/u-boot/gru_bob/config/default index 2bcbe3d8..da088ef0 100644 --- a/config/u-boot/gru_bob/config/default +++ b/config/u-boot/gru_bob/config/default @@ -1,13 +1,14 @@  #  # Automatically generated file; DO NOT EDIT. -# U-Boot 2023.10 Configuration +# U-Boot 2024.07 Configuration  #  # -# Compiler: gcc (Debian 13.2.0-5) 13.2.0 +# Compiler: gcc (Debian 13.3.0-2) 13.3.0  #  CONFIG_CREATE_ARCH_SYMLINK=y  CONFIG_SYS_CACHE_SHIFT_6=y +CONFIG_64BIT=y  CONFIG_SYS_CACHELINE_SIZE=64  CONFIG_LINKER_LIST_ALIGN=8  # CONFIG_ARC is not set @@ -40,7 +41,7 @@ CONFIG_SKIP_LOWLEVEL_INIT=y  # CONFIG_SYS_ICACHE_OFF is not set  # CONFIG_SPL_SYS_ICACHE_OFF is not set  # CONFIG_SYS_DCACHE_OFF is not set -# CONFIG_SPL_SYS_DCACHE_OFF is not set +CONFIG_SPL_SYS_DCACHE_OFF=y  #  # ARM architecture @@ -53,6 +54,7 @@ CONFIG_INIT_SP_RELATIVE=y  CONFIG_SYS_INIT_SP_BSS_OFFSET=524288  CONFIG_LNX_KRNL_IMG_TEXT_OFFSET_BASE=0x18000000  # CONFIG_GIC_V3_ITS is not set +# CONFIG_GICV3_SUPPORT_GIC600 is not set  CONFIG_STATIC_RELA=y  CONFIG_DMA_ADDR_T_64BIT=y  CONFIG_ARM_ASM_UNIFIED=y @@ -81,13 +83,11 @@ CONFIG_ARM64_SUPPORT_AARCH32=y  # CONFIG_ARCH_KIRKWOOD is not set  # CONFIG_ARCH_MVEBU is not set  # CONFIG_ARCH_ORION5X is not set -# CONFIG_TARGET_STV0991 is not set  # CONFIG_ARCH_BCM283X is not set  # CONFIG_ARCH_BCMSTB is not set  # CONFIG_ARCH_BCMBCA is not set  # CONFIG_TARGET_VEXPRESS_CA9X4 is not set  # CONFIG_TARGET_BCMNS is not set -# CONFIG_TARGET_BCMNS2 is not set  # CONFIG_TARGET_BCMNS3 is not set  # CONFIG_ARCH_EXYNOS is not set  # CONFIG_ARCH_S5PC1XX is not set @@ -117,7 +117,7 @@ CONFIG_ARM64_SUPPORT_AARCH32=y  # CONFIG_ARCH_APPLE is not set  # CONFIG_ARCH_OWL is not set  # CONFIG_ARCH_QEMU is not set -# CONFIG_ARCH_RMOBILE is not set +# CONFIG_ARCH_RENESAS is not set  # CONFIG_ARCH_SNAPDRAGON is not set  # CONFIG_ARCH_SOCFPGA is not set  # CONFIG_ARCH_SUNXI is not set @@ -176,6 +176,7 @@ CONFIG_ARCH_ROCKCHIP=y  # CONFIG_ARCH_ASPEED is not set  # CONFIG_TARGET_DURIAN is not set  # CONFIG_TARGET_POMELO is not set +# CONFIG_TARGET_PE2201 is not set  # CONFIG_TARGET_PRESIDIO_ASIC is not set  # CONFIG_TARGET_XENGUEST_ARM64 is not set  # CONFIG_ARCH_GXP is not set @@ -194,10 +195,9 @@ CONFIG_SF_DEFAULT_MODE=0x0  CONFIG_ENV_SIZE=0x8000  CONFIG_DM_GPIO=y  CONFIG_SPL_DM_SPI=y -CONFIG_DEFAULT_DEVICE_TREE="rk3399-gru-bob" +CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3399-gru-bob"  CONFIG_SPL_TEXT_BASE=0xff8c2000 -CONFIG_BOARD_SPECIFIC_OPTIONS=y -# CONFIG_OF_LIBFDT_OVERLAY is not set +CONFIG_OF_LIBFDT_OVERLAY=y  CONFIG_MULTI_DTB_FIT_UNCOMPRESS_SZ=0x8000  CONFIG_DM_RESET=y  CONFIG_SYS_MONITOR_LEN=0 @@ -227,13 +227,15 @@ CONFIG_ROCKCHIP_STIMER=y  CONFIG_ROCKCHIP_STIMER_BASE=0xff8680a0  CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000  # CONFIG_SPL_ROCKCHIP_EARLYRETURN_TO_BROM is not set +CONFIG_ROCKCHIP_DISABLE_FORCE_JTAG=y  # CONFIG_SPL_MMC is not set  CONFIG_ROCKCHIP_SPI_IMAGE=y +CONFIG_ROCKCHIP_COMMON_STACK_ADDR=y  CONFIG_SPL_SERIAL=y  CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl-v8.lds"  CONFIG_TPL_TEXT_BASE=0xff8c2000  CONFIG_TPL_STACK=0xff8effff -CONFIG_SPL_DRIVERS_MISC=y +# CONFIG_SPL_DRIVERS_MISC is not set  CONFIG_SPL_STACK_R_ADDR=0x04000000  CONFIG_TARGET_CHROMEBOOK_BOB=y  # CONFIG_TARGET_CHROMEBOOK_KEVIN is not set @@ -242,16 +244,23 @@ CONFIG_TARGET_CHROMEBOOK_BOB=y  # CONFIG_TARGET_PINEPHONE_PRO_RK3399 is not set  # CONFIG_TARGET_PUMA_RK3399 is not set  # CONFIG_TARGET_ROCK960_RK3399 is not set +# CONFIG_TARGET_ROCKPI4_RK3399 is not set  # CONFIG_TARGET_ROCKPRO64_RK3399 is not set  # CONFIG_TARGET_ROC_PC_RK3399 is not set  CONFIG_SPL_STACK=0xff8effff  CONFIG_SPL_SYS_MALLOC_F_LEN=0x4000 +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y +CONFIG_SPL_BSS_START_ADDR=0xff8e0000 +CONFIG_SPL_BSS_MAX_SIZE=0x10000 +CONFIG_SPL_STACK_R=y +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000 +CONFIG_SPL_SYS_MALLOC_F=y  CONFIG_ERR_PTR_OFFSET=0x0  CONFIG_SPL_SIZE_LIMIT=0x0  CONFIG_SPL=y  CONFIG_PRE_CON_BUF_ADDR=0x0f200000  CONFIG_PRE_CON_BUF_SZ=4096 -CONFIG_BOOTSTAGE_STASH_ADDR=0 +CONFIG_BOOTSTAGE_STASH_ADDR=0x0  CONFIG_DEBUG_UART_BASE=0xff1a0000  CONFIG_DEBUG_UART_CLOCK=24000000  CONFIG_DEBUG_UART_BOARD_INIT=y @@ -265,7 +274,7 @@ CONFIG_SPL_SPI=y  # CONFIG_CMO_BY_VA_ONLY is not set  # CONFIG_ARMV8_SPL_EXCEPTION_VECTORS is not set  # CONFIG_ARMV8_MULTIENTRY is not set -# CONFIG_ARMV8_SET_SMPEN is not set +CONFIG_ARMV8_SET_SMPEN=y  # CONFIG_ARMV8_SWITCH_TO_EL1 is not set  # @@ -277,7 +286,9 @@ CONFIG_SPL_SPI=y  CONFIG_PSCI_RESET=y  # CONFIG_ARMV8_PSCI is not set  # CONFIG_ARMV8_EA_EL3_FIRST is not set -# CONFIG_ARMV8_CRYPTO is not set +CONFIG_ARMV8_CRYPTO=y +CONFIG_ARMV8_CE_SHA1=y +CONFIG_ARMV8_CE_SHA256=y  # CONFIG_CMD_DEKBLOB is not set  # CONFIG_IMX_CAAM_DEK_ENCAP is not set  # CONFIG_IMX_OPTEE_DEK_ENCAP is not set @@ -285,8 +296,6 @@ CONFIG_PSCI_RESET=y  # CONFIG_IMX_ELE_DEK_ENCAP is not set  # CONFIG_CMD_HDMIDETECT is not set  CONFIG_IMX_DCD_ADDR=0x00910000 -# CONFIG_SPL_LOAD_IMX_CONTAINER is not set -CONFIG_IMX_CONTAINER_CFG=""  CONFIG_SYS_MEM_TOP_HIDE=0x0  CONFIG_SYS_LOAD_ADDR=0x800800 @@ -313,7 +322,7 @@ CONFIG_DEBUG_UART=y  CONFIG_LOCALVERSION=""  CONFIG_LOCALVERSION_AUTO=y  CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=130200 +CONFIG_GCC_VERSION=130300  CONFIG_CLANG_VERSION=0  CONFIG_CC_OPTIMIZE_FOR_SIZE=y  # CONFIG_CC_OPTIMIZE_FOR_SPEED is not set @@ -346,6 +355,10 @@ CONFIG_STACK_SIZE=0x1000000  CONFIG_SYS_SRAM_BASE=0x0  CONFIG_SYS_SRAM_SIZE=0x0  # CONFIG_MP is not set +CONFIG_HAVE_TEXT_BASE=y +# CONFIG_HAVE_SYS_UBOOT_START is not set +CONFIG_SYS_UBOOT_START=0x18000000 +# CONFIG_DYNAMIC_SYS_CLK_FREQ is not set  # CONFIG_API is not set  # @@ -356,8 +369,8 @@ CONFIG_SYS_SRAM_SIZE=0x0  # Boot images  #  # CONFIG_ANDROID_BOOT_IMAGE is not set -CONFIG_FIT=y  # CONFIG_TIMESTAMP is not set +CONFIG_FIT=y  CONFIG_FIT_EXTERNAL_OFFSET=0x0  CONFIG_FIT_FULL_CHECK=y  # CONFIG_FIT_SIGNATURE is not set @@ -377,6 +390,8 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x0  CONFIG_SPL_FIT_SOURCE=""  # CONFIG_USE_SPL_FIT_GENERATOR is not set  CONFIG_PXE_UTILS=y +CONFIG_BOOT_DEFAULTS_FEATURES=y +CONFIG_BOOT_DEFAULTS_CMDS=y  CONFIG_BOOT_DEFAULTS=y  CONFIG_BOOTSTD=y  # CONFIG_SPL_BOOTSTD is not set @@ -384,9 +399,11 @@ CONFIG_BOOTSTD_FULL=y  CONFIG_BOOTSTD_DEFAULTS=y  CONFIG_BOOTSTD_BOOTCOMMAND=y  CONFIG_BOOTMETH_GLOBAL=y +# CONFIG_BOOTMETH_CROS is not set  CONFIG_BOOTMETH_EXTLINUX=y  CONFIG_BOOTMETH_EXTLINUX_PXE=y  CONFIG_BOOTMETH_EFILOADER=y +CONFIG_BOOTMETH_EFI_BOOTMGR=y  CONFIG_BOOTMETH_VBE=y  CONFIG_BOOTMETH_DISTRO=y  # CONFIG_SPL_BOOTMETH_VBE is not set @@ -398,13 +415,8 @@ CONFIG_BOOTMETH_VBE_SIMPLE_OS=y  CONFIG_EXPO=y  CONFIG_BOOTMETH_SCRIPT=y  CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_SYS_BOOTM_LEN=0x4000000  CONFIG_SUPPORT_RAW_INITRD=y -# CONFIG_OF_BOARD_SETUP is not set -# CONFIG_OF_SYSTEM_SETUP is not set -# CONFIG_OF_STDOUT_VIA_ALIAS is not set -CONFIG_HAVE_TEXT_BASE=y -# CONFIG_DYNAMIC_SYS_CLK_FREQ is not set -CONFIG_ARCH_FIXUP_FDT_MEMORY=y  # CONFIG_CHROMEOS is not set  # CONFIG_CHROMEOS_VBOOT is not set  # CONFIG_RAMBOOT_PBL is not set @@ -444,6 +456,17 @@ CONFIG_BOOTDELAY=2  # Image support  #  # CONFIG_IMAGE_PRE_LOAD is not set + +# +# Devicetree fixup +# +# CONFIG_OF_ENV_SETUP is not set +# CONFIG_OF_BOARD_SETUP is not set +# CONFIG_OF_SYSTEM_SETUP is not set +# CONFIG_OF_STDOUT_VIA_ALIAS is not set +# CONFIG_FDT_FIXUP_PARTITIONS is not set +# CONFIG_FDT_SIMPLEFB is not set +CONFIG_ARCH_FIXUP_FDT_MEMORY=y  # CONFIG_USE_BOOTARGS is not set  # CONFIG_BOOTARGS_SUBST is not set  CONFIG_USE_BOOTCOMMAND=y @@ -463,6 +486,8 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-gru-bob.dtb"  #  CONFIG_MENU=y  # CONFIG_CONSOLE_RECORD is not set +CONFIG_SYS_CBSIZE=1024 +CONFIG_SYS_PBSIZE=1044  # CONFIG_DISABLE_CONSOLE is not set  CONFIG_LOGLEVEL=4  CONFIG_SPL_LOGLEVEL=4 @@ -471,6 +496,7 @@ CONFIG_SPL_LOGLEVEL=4  # CONFIG_TPL_SILENT_CONSOLE is not set  CONFIG_PRE_CONSOLE_BUFFER=y  CONFIG_CONSOLE_FLUSH_SUPPORT=y +# CONFIG_CONSOLE_FLUSH_ON_NEWLINE is not set  CONFIG_CONSOLE_MUX=y  CONFIG_SYS_CONSOLE_IS_IN_ENV=y  # CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE is not set @@ -517,7 +543,7 @@ CONFIG_BOARD_EARLY_INIT_R=y  CONFIG_BOARD_LATE_INIT=y  # CONFIG_CLOCKS is not set  # CONFIG_HWCONFIG is not set -# CONFIG_LAST_STAGE_INIT is not set +CONFIG_LAST_STAGE_INIT=y  CONFIG_MISC_INIT_R=y  # CONFIG_SYS_MALLOC_BOOTPARAMS is not set  # CONFIG_ID_EEPROM is not set @@ -557,14 +583,11 @@ CONFIG_SUPPORT_TPL=y  #  CONFIG_SPL_FRAMEWORK=y  # CONFIG_SPL_FRAMEWORK_BOARD_INIT_F is not set -CONFIG_SPL_MAX_SIZE=0x2e000 +CONFIG_SPL_MAX_SIZE=0x1e000  CONFIG_SPL_PAD_TO=0x7f8000 -CONFIG_SPL_HAS_BSS_LINKER_SECTION=y -CONFIG_SPL_BSS_START_ADDR=0xff8e0000  # CONFIG_SPL_NO_BSS_LIMIT is not set  CONFIG_SPL_BSS_LIMIT=y  # CONFIG_SPL_FOOTPRINT_LIMIT is not set -CONFIG_SPL_BSS_MAX_SIZE=0x10000  CONFIG_SPL_SYS_STACK_F_CHECK_BYTE=0xaa  # CONFIG_SPL_SYS_REPORT_STACK_F_USAGE is not set  # CONFIG_SPL_SHOW_ERRORS is not set @@ -576,12 +599,11 @@ CONFIG_SPL_BOARD_INIT=y  # CONFIG_SPL_BOOTROM_SUPPORT is not set  # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set  # CONFIG_SPL_LEGACY_IMAGE_FORMAT is not set +# CONFIG_SPL_LOAD_IMX_CONTAINER is not set  CONFIG_SPL_SYS_MALLOC_SIMPLE=y  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set -CONFIG_SPL_STACK_R=y -CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000  CONFIG_SPL_SEPARATE_BSS=y -# CONFIG_SYS_SPL_MALLOC is not set +# CONFIG_SPL_SYS_MALLOC is not set  CONFIG_SPL_BANNER_PRINT=y  # CONFIG_SPL_DISPLAY_PRINT is not set  CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y @@ -602,7 +624,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0  # CONFIG_SPL_DM_MAILBOX is not set  # CONFIG_SPL_MEMORY is not set  # CONFIG_SPL_MPC8XXX_INIT_DDR is not set -# CONFIG_SPL_MTD_SUPPORT is not set +# CONFIG_SPL_MTD is not set  # CONFIG_SPL_MUSB_NEW is not set  # CONFIG_SPL_NAND_SUPPORT is not set  # CONFIG_SPL_NAND_DRIVERS is not set @@ -640,23 +662,21 @@ CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y  CONFIG_SPL_TARGET=""  # CONFIG_TPL is not set  # CONFIG_VPL is not set -# CONFIG_FDT_SIMPLEFB is not set -# CONFIG_BMP is not set +CONFIG_CMDLINE=y +CONFIG_HUSH_PARSER=y  # -# Command line interface +# Hush flavor to use  # -CONFIG_CMDLINE=y -CONFIG_HUSH_PARSER=y +CONFIG_HUSH_OLD_PARSER=y +# CONFIG_HUSH_MODERN_PARSER is not set  CONFIG_CMDLINE_EDITING=y  # CONFIG_CMDLINE_PS_SUPPORT is not set  CONFIG_AUTO_COMPLETE=y  CONFIG_SYS_LONGHELP=y  CONFIG_SYS_PROMPT="=> "  CONFIG_SYS_PROMPT_HUSH_PS2="> " -CONFIG_SYS_MAXARGS=16 -CONFIG_SYS_CBSIZE=1024 -CONFIG_SYS_PBSIZE=1044 +CONFIG_SYS_MAXARGS=64  CONFIG_SYS_XTRACE=y  # @@ -670,8 +690,10 @@ CONFIG_CMD_BDI=y  # CONFIG_CMD_BDINFO_EXTRA is not set  # CONFIG_CMD_CONFIG is not set  CONFIG_CMD_CONSOLE=y +# CONFIG_CMD_HISTORY is not set  # CONFIG_CMD_LICENSE is not set  # CONFIG_CMD_PMC is not set +# CONFIG_CMD_SMBIOS is not set  #  # Boot commands @@ -693,24 +715,24 @@ CONFIG_BOOTM_PLAN9=y  CONFIG_BOOTM_RTEMS=y  CONFIG_CMD_VBE=y  CONFIG_BOOTM_VXWORKS=y -CONFIG_SYS_BOOTM_LEN=0x4000000  CONFIG_CMD_BOOTEFI=y +CONFIG_CMD_BOOTEFI_BINARY=y +CONFIG_CMD_BOOTEFI_BOOTMGR=y  CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y  CONFIG_CMD_BOOTEFI_HELLO=y  CONFIG_CMD_BOOTEFI_SELFTEST=y  CONFIG_CMD_BOOTMENU=y  # CONFIG_CMD_ADTIMG is not set  CONFIG_CMD_ELF=y +# CONFIG_CMD_ELF_FDT_SETUP is not set  CONFIG_CMD_FDT=y  CONFIG_CMD_GO=y  CONFIG_CMD_RUN=y  CONFIG_CMD_IMI=y  # CONFIG_CMD_IMLS is not set  CONFIG_CMD_XIMG=y -# CONFIG_CMD_XXD is not set +CONFIG_SYS_XIMG_LEN=0x800000  # CONFIG_CMD_SPL is not set -# CONFIG_CMD_THOR_DOWNLOAD is not set -# CONFIG_CMD_ZBOOT is not set  #  # Environment commands @@ -776,7 +798,6 @@ CONFIG_CMD_GPIO=y  # CONFIG_CMD_GPIO_READ is not set  # CONFIG_CMD_PWM is not set  CONFIG_CMD_GPT=y -CONFIG_RANDOM_UUID=y  # CONFIG_CMD_GPT_RENAME is not set  # CONFIG_CMD_IDE is not set  # CONFIG_CMD_IO is not set @@ -794,8 +815,11 @@ CONFIG_CMD_LOADXY_TIMEOUT=90  # CONFIG_CMD_MISC is not set  CONFIG_CMD_MMC=y  # CONFIG_CMD_BKOPS_ENABLE is not set +# CONFIG_CMD_MMC_REG is not set  # CONFIG_CMD_MMC_SWRITE is not set  # CONFIG_CMD_CLONE is not set +# CONFIG_CMD_MTD is not set +# CONFIG_CMD_ONENAND is not set  # CONFIG_CMD_OSD is not set  CONFIG_CMD_PART=y  # CONFIG_CMD_PCI is not set @@ -808,11 +832,12 @@ CONFIG_CMD_SF=y  CONFIG_CMD_SF_TEST=y  CONFIG_CMD_SPI=y  CONFIG_DEFAULT_SPI_BUS=0 -CONFIG_DEFAULT_SPI_MODE=0 +CONFIG_DEFAULT_SPI_MODE=0x0  # CONFIG_CMD_TSI148 is not set  # CONFIG_CMD_UNIVERSE is not set  CONFIG_CMD_USB=y  # CONFIG_CMD_USB_SDP is not set +# CONFIG_CMD_RKMTD is not set  # CONFIG_CMD_WRITE is not set  # @@ -823,6 +848,7 @@ CONFIG_CMD_ECHO=y  CONFIG_CMD_ITEST=y  CONFIG_CMD_SOURCE=y  # CONFIG_CMD_SETEXPR is not set +# CONFIG_CMD_XXD is not set  #  # Android support commands @@ -845,6 +871,7 @@ CONFIG_BOOTP_SUBNETMASK=y  # CONFIG_CMD_PCAP is not set  CONFIG_BOOTP_PXE=y  CONFIG_BOOTP_PXE_CLIENTARCH=0x16 +# CONFIG_BOOTP_PXE_DHCP_OPTION is not set  CONFIG_BOOTP_VCI_STRING="U-Boot.armv8"  CONFIG_CMD_TFTPBOOT=y  # CONFIG_CMD_TFTPPUT is not set @@ -898,7 +925,6 @@ CONFIG_CMD_VIDCONSOLE=y  #  # TI specific command line interface  # -# CONFIG_CMD_DDR3 is not set  #  # Power commands @@ -933,9 +959,9 @@ CONFIG_CMD_FAT=y  CONFIG_CMD_FS_GENERIC=y  # CONFIG_CMD_FS_UUID is not set  # CONFIG_CMD_JFFS2 is not set +# CONFIG_CMD_MTDPARTS is not set  CONFIG_MTDIDS_DEFAULT=""  CONFIG_MTDPARTS_DEFAULT="" -# CONFIG_CMD_REISER is not set  # CONFIG_CMD_ZFS is not set  # @@ -979,16 +1005,18 @@ CONFIG_BINMAN=y  CONFIG_OF_CONTROL=y  CONFIG_OF_REAL=y  CONFIG_SPL_OF_CONTROL=y -# CONFIG_OF_LIVE is not set +CONFIG_OF_LIVE=y +CONFIG_OF_UPSTREAM=y +# CONFIG_OF_UPSTREAM_BUILD_VENDOR is not set  CONFIG_OF_SEPARATE=y  # CONFIG_OF_EMBED is not set  # CONFIG_OF_BOARD is not set  # CONFIG_OF_OMIT_DTB is not set  CONFIG_DEVICE_TREE_INCLUDES="" -CONFIG_OF_LIST="rk3399-gru-bob" +CONFIG_OF_LIST="rockchip/rk3399-gru-bob"  # CONFIG_MULTI_DTB_FIT is not set  # CONFIG_SPL_MULTI_DTB_FIT is not set -CONFIG_SPL_OF_LIST="rk3399-gru-bob" +CONFIG_SPL_OF_LIST="rockchip/rk3399-gru-bob"  CONFIG_OF_TAG_MIGRATE=y  CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"  # CONFIG_OF_DTB_PROPS_REMOVE is not set @@ -1066,10 +1094,11 @@ CONFIG_SYS_RX_ETH_BUFFER=4  #  CONFIG_DM=y  CONFIG_SPL_DM=y -CONFIG_DM_WARN=y +# CONFIG_DM_WARN is not set  # CONFIG_SPL_DM_WARN is not set  # CONFIG_DM_DEBUG is not set  # CONFIG_DM_STATS is not set +# CONFIG_SPL_DM_STATS is not set  CONFIG_DM_DEVICE_REMOVE=y  CONFIG_DM_EVENT=y  # CONFIG_SPL_DM_DEVICE_REMOVE is not set @@ -1089,8 +1118,8 @@ CONFIG_SPL_SIMPLE_BUS=y  CONFIG_OF_TRANSLATE=y  # CONFIG_SPL_OF_TRANSLATE is not set  # CONFIG_TRANSLATION_OFFSET is not set -CONFIG_DM_DEV_READ_INLINE=y -# CONFIG_OFNODE_MULTI_TREE is not set +CONFIG_OFNODE_MULTI_TREE=y +CONFIG_OFNODE_MULTI_TREE_MAX=4  CONFIG_BOUNCE_BUFFER=y  CONFIG_ADC=y  # CONFIG_ADC_EXYNOS is not set @@ -1119,6 +1148,7 @@ CONFIG_BLOCK_CACHE=y  # CONFIG_IDE is not set  # CONFIG_LBA48 is not set  # CONFIG_SYS_64BIT_LBA is not set +# CONFIG_RKMTD is not set  # CONFIG_BOOTCOUNT_LIMIT is not set  # @@ -1131,9 +1161,10 @@ CONFIG_BLOCK_CACHE=y  #  # CONFIG_CACHE is not set  # CONFIG_L2X0_CACHE is not set -# CONFIG_V5L2_CACHE is not set +# CONFIG_ANDES_L2_CACHE is not set  # CONFIG_NCORE_CACHE is not set  # CONFIG_SIFIVE_CCACHE is not set +# CONFIG_SIFIVE_PL2 is not set  #  # Clock @@ -1142,6 +1173,8 @@ CONFIG_CLK=y  CONFIG_SPL_CLK=y  # CONFIG_SPL_CLK_CCF is not set  # CONFIG_CLK_CCF is not set +# CONFIG_CLK_GPIO is not set +# CONFIG_SPL_CLK_GPIO is not set  # CONFIG_CLK_CDCE9XX is not set  # CONFIG_CLK_ICS8N3QV01 is not set  # CONFIG_CLK_K210 is not set @@ -1266,7 +1299,6 @@ CONFIG_ROCKCHIP_GPIO=y  # CONFIG_NOMADIK_GPIO is not set  # CONFIG_ZYNQMP_GPIO_MODEPIN is not set  # CONFIG_SLG7XL45106_I2C_GPO is not set -# CONFIG_TURRIS_OMNIA_MCU is not set  # CONFIG_FTGPIO010 is not set  # CONFIG_ADP5585_GPIO is not set @@ -1351,6 +1383,7 @@ CONFIG_SPL_MISC=y  # CONFIG_GATEWORKS_SC is not set  CONFIG_ROCKCHIP_EFUSE=y  # CONFIG_ROCKCHIP_OTP is not set +CONFIG_ROCKCHIP_IODOMAIN=y  # CONFIG_SIFIVE_OTP is not set  # CONFIG_SMSC_LPC47M is not set  # CONFIG_SMSC_SIO1007 is not set @@ -1370,6 +1403,7 @@ CONFIG_PWRSEQ=y  # CONFIG_SPL_PWRSEQ is not set  # CONFIG_PCA9551_LED is not set  # CONFIG_TEST_DRV is not set +# CONFIG_TURRIS_OMNIA_MCU is not set  # CONFIG_USB_HUB_USB251XB is not set  # CONFIG_TWL4030_LED is not set  # CONFIG_WINBOND_W83627 is not set @@ -1385,6 +1419,7 @@ CONFIG_PWRSEQ=y  # CONFIG_MICROCHIP_FLEXCOM is not set  # CONFIG_ESM_PMIC is not set  # CONFIG_SL28CPLD is not set +# CONFIG_SPL_SOCFPGA_DT_REG is not set  #  # MMC Host controller Support @@ -1420,8 +1455,11 @@ CONFIG_MMC_DW_ROCKCHIP=y  CONFIG_MMC_SDHCI=y  CONFIG_MMC_SDHCI_SDMA=y  # CONFIG_MMC_SDHCI_ADMA is not set +# CONFIG_MMC_SDHCI_ADMA_FORCE_32BIT is not set +CONFIG_MMC_SDHCI_ADMA_64BIT=y  # CONFIG_MMC_SDHCI_BCMSTB is not set  # CONFIG_MMC_SDHCI_CADENCE is not set +# CONFIG_MMC_SDHCI_CV1800B is not set  # CONFIG_MMC_SDHCI_IPROC is not set  # CONFIG_MMC_SDHCI_F_SDH30 is not set  # CONFIG_MMC_SDHCI_KONA is not set @@ -1442,9 +1480,11 @@ CONFIG_MMC_SDHCI_ROCKCHIP=y  #  # MTD Support  # -# CONFIG_MTD is not set +CONFIG_MTD=y  # CONFIG_DM_MTD is not set  # CONFIG_MTD_NOR_FLASH is not set +# CONFIG_MTD_CONCAT is not set +# CONFIG_SYS_MTDPARTS_RUNTIME is not set  # CONFIG_FLASH_CFI_DRIVER is not set  # CONFIG_HBMC_AM654 is not set  # CONFIG_SAMSUNG_ONENAND is not set @@ -1464,20 +1504,24 @@ CONFIG_SPI_FLASH_SMART_HWCAPS=y  # CONFIG_SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT is not set  # CONFIG_SPI_FLASH_SOFT_RESET is not set  # CONFIG_SPI_FLASH_BAR is not set +CONFIG_SPI_FLASH_LOCK=y  CONFIG_SPI_FLASH_UNLOCK_ALL=y  # CONFIG_SPI_FLASH_ATMEL is not set  # CONFIG_SPI_FLASH_EON is not set  CONFIG_SPI_FLASH_GIGADEVICE=y  # CONFIG_SPI_FLASH_ISSI is not set  # CONFIG_SPI_FLASH_MACRONIX is not set +# CONFIG_SPI_FLASH_SILICONKAISER is not set  # CONFIG_SPI_FLASH_SPANSION is not set  # CONFIG_SPI_FLASH_STMICRO is not set  # CONFIG_SPI_FLASH_SST is not set  CONFIG_SPI_FLASH_WINBOND=y  # CONFIG_SPI_FLASH_XMC is not set  # CONFIG_SPI_FLASH_XTX is not set +# CONFIG_SPI_FLASH_ZBIT is not set  CONFIG_SPI_FLASH_USE_4K_SECTORS=y  # CONFIG_SPI_FLASH_DATAFLASH is not set +# CONFIG_SPI_FLASH_MTD is not set  #  # UBI support @@ -1538,7 +1582,7 @@ CONFIG_DM_ETH=y  # CONFIG_DM_MDIO is not set  # CONFIG_DM_ETH_PHY is not set  CONFIG_NETDEVICES=y -# CONFIG_PHY_GIGE is not set +CONFIG_PHY_GIGE=y  # CONFIG_ALTERA_TSE is not set  # CONFIG_BCM_SF2_ETH is not set  # CONFIG_BCMGENET is not set @@ -1557,7 +1601,6 @@ CONFIG_ETH_DESIGNWARE=y  # CONFIG_FTMAC100 is not set  # CONFIG_FTGMAC100 is not set  # CONFIG_MCFFEC is not set -# CONFIG_FSLDMAFEC is not set  # CONFIG_KS8851_MLL is not set  # CONFIG_LITEETH is not set  # CONFIG_MACB is not set @@ -1586,6 +1629,7 @@ CONFIG_GMAC_ROCKCHIP=y  # CONFIG_SYS_DPAA_QBMAN is not set  # CONFIG_TSEC_ENET is not set  # CONFIG_MEDIATEK_ETH is not set +# CONFIG_HIFEMAC_ETH is not set  # CONFIG_HIGMACV300_ETH is not set  # CONFIG_NVME is not set  # CONFIG_NVME_APPLE is not set @@ -1611,6 +1655,7 @@ CONFIG_PHY=y  # Rockchip PHY driver  #  # CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY is not set +# CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set  CONFIG_PHY_ROCKCHIP_INNO_USB2=y  # CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY is not set  # CONFIG_PHY_ROCKCHIP_PCIE is not set @@ -1649,6 +1694,8 @@ CONFIG_SPL_PINCONF_RECURSIVE=y  # CONFIG_PINCTRL_K210 is not set  CONFIG_PINCTRL_ROCKCHIP=y  CONFIG_SPL_PINCTRL_ROCKCHIP=y +# CONFIG_PINCTRL_TEGRA is not set +# CONFIG_SPL_PINCTRL_TEGRA is not set  CONFIG_POWER=y  # CONFIG_POWER_LEGACY is not set  # CONFIG_ACPI_PMC is not set @@ -1678,6 +1725,7 @@ CONFIG_SPL_PMIC_CHILDREN=y  # CONFIG_SPL_DM_PMIC_PCA9450 is not set  # CONFIG_DM_PMIC_PFUZE100 is not set  # CONFIG_SPL_DM_PMIC_PFUZE100 is not set +# CONFIG_DM_PMIC_MAX77663 is not set  # CONFIG_DM_PMIC_MAX77686 is not set  # CONFIG_DM_PMIC_MAX8998 is not set  # CONFIG_DM_PMIC_MC34708 is not set @@ -1695,12 +1743,14 @@ CONFIG_PMIC_RK8XX=y  # CONFIG_PMIC_LP873X is not set  # CONFIG_PMIC_LP87565 is not set  # CONFIG_DM_PMIC_TPS65910 is not set +# CONFIG_DM_PMIC_TPS80031 is not set  # CONFIG_PMIC_STPMIC1 is not set  # CONFIG_SPL_PMIC_PALMAS is not set  # CONFIG_SPL_PMIC_LP873X is not set  # CONFIG_SPL_PMIC_LP87565 is not set  # CONFIG_PMIC_TPS65941 is not set  # CONFIG_PMIC_TPS65219 is not set +# CONFIG_PMIC_RAA215300 is not set  # CONFIG_PMIC_TPS65217 is not set  # CONFIG_POWER_TPS65218 is not set  # CONFIG_POWER_TPS62362 is not set @@ -1758,6 +1808,7 @@ CONFIG_RAM_ROCKCHIP_DEBUG=y  #  # Remote Processor drivers  # +CONFIG_REMOTEPROC_MAX_FW_SIZE=0x10000  #  # Reset Controller Support @@ -1770,11 +1821,13 @@ CONFIG_RESET_ROCKCHIP=y  # CONFIG_RESET_SCMI is not set  # CONFIG_RESET_DRA7 is not set  CONFIG_DM_RNG=y +# CONFIG_SPL_DM_RNG is not set  # CONFIG_RNG_MSM is not set  # CONFIG_RNG_NPCM is not set  CONFIG_RNG_ROCKCHIP=y  # CONFIG_RNG_IPROC200 is not set  # CONFIG_RNG_SMCCC_TRNG is not set +# CONFIG_RNG_ARM_RNDR is not set  #  # Real Time Clock @@ -1794,9 +1847,9 @@ CONFIG_RNG_ROCKCHIP=y  # CONFIG_RTC_MC146818 is not set  # CONFIG_RTC_M41T62 is not set  # CONFIG_SCSI is not set -# CONFIG_DM_SCSI is not set  CONFIG_SERIAL=y  CONFIG_BAUDRATE=115200 +# CONFIG_DEFAULT_ENV_IS_RW is not set  CONFIG_REQUIRE_SERIAL_CONSOLE=y  # CONFIG_SPECIFY_CONSOLE_INDEX is not set  CONFIG_SERIAL_PRESENT=y @@ -1838,11 +1891,14 @@ CONFIG_SYS_NS16550_MEM32=y  # CONFIG_MSM_GENI_SERIAL is not set  # CONFIG_MXS_AUART_SERIAL is not set  # CONFIG_OMAP_SERIAL is not set +# CONFIG_HTIF_CONSOLE is not set  # CONFIG_SIFIVE_SERIAL is not set  # CONFIG_ZYNQ_SERIAL is not set  # CONFIG_MTK_SERIAL is not set  # CONFIG_MT7620_SERIAL is not set  # CONFIG_NPCM_SERIAL is not set +# CONFIG_SM is not set +# CONFIG_MESON_SM is not set  # CONFIG_SMEM is not set  # @@ -1854,6 +1910,7 @@ CONFIG_SYS_NS16550_MEM32=y  # SOC (System On Chip) specific Drivers  #  # CONFIG_SOC_DEVICE is not set +# CONFIG_SOC_SAMSUNG is not set  # CONFIG_SOC_TI is not set  CONFIG_SPI=y  CONFIG_DM_SPI=y @@ -1867,6 +1924,7 @@ CONFIG_SPI_MEM=y  # CONFIG_CORTINA_SFLASH is not set  # CONFIG_CADENCE_QSPI is not set  # CONFIG_CF_SPI is not set +# CONFIG_CV1800B_SPIF is not set  # CONFIG_DESIGNWARE_SPI is not set  # CONFIG_EXYNOS_SPI is not set  # CONFIG_FSL_DSPI is not set @@ -1919,7 +1977,8 @@ CONFIG_ROCKCHIP_SPI=y  CONFIG_SYSRESET=y  CONFIG_SPL_SYSRESET=y  CONFIG_SYSRESET_CMD_RESET=y -# CONFIG_SYSRESET_CMD_POWEROFF is not set +CONFIG_SYSRESET_CMD_POWEROFF=y +# CONFIG_SYSRESET_CV1800B is not set  # CONFIG_POWEROFF_GPIO is not set  # CONFIG_SYSRESET_GPIO is not set  # CONFIG_SYSRESET_PSCI is not set @@ -1950,9 +2009,8 @@ CONFIG_SPL_DM_USB=y  CONFIG_USB_HOST=y  # CONFIG_SPL_USB_HOST is not set  CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y -# CONFIG_USB_XHCI_PCI is not set +# CONFIG_USB_XHCI_DWC3 is not set +# CONFIG_USB_XHCI_DWC3_OF_SIMPLE is not set  # CONFIG_USB_XHCI_FSL is not set  # CONFIG_USB_XHCI_BRCM is not set  CONFIG_USB_EHCI_HCD=y @@ -1977,7 +2035,7 @@ CONFIG_USB_DWC3=y  # Platform Glue Driver Support  #  # CONFIG_USB_DWC3_OMAP is not set -# CONFIG_USB_DWC3_GENERIC is not set +CONFIG_USB_DWC3_GENERIC=y  # CONFIG_SPL_USB_DWC3_GENERIC is not set  # CONFIG_USB_DWC3_LAYERSCAPE is not set @@ -2046,7 +2104,7 @@ CONFIG_VIDEO_FONT_8X16=y  # CONFIG_VIDEO_FONT_16X32 is not set  CONFIG_VIDEO_LOGO=y  CONFIG_BACKLIGHT=y -CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE=0 +CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE=0x0  # CONFIG_VIDEO_COPY is not set  CONFIG_VIDEO_DAMAGE=y  CONFIG_BACKLIGHT_PWM=y @@ -2077,9 +2135,11 @@ CONFIG_SIMPLE_PANEL=y  # CONFIG_VIDEO_LCD_ENDEAVORU is not set  # CONFIG_VIDEO_LCD_HIMAX_HX8394 is not set  # CONFIG_VIDEO_LCD_ORISETECH_OTM8009A is not set +# CONFIG_VIDEO_LCD_LG_LD070WX3 is not set  # CONFIG_VIDEO_LCD_RAYDIUM_RM68200 is not set  # CONFIG_VIDEO_LCD_RENESAS_R61307 is not set  # CONFIG_VIDEO_LCD_RENESAS_R69328 is not set +# CONFIG_VIDEO_LCD_SAMSUNG_LTL106HL02 is not set  # CONFIG_VIDEO_LCD_SSD2828 is not set  # CONFIG_VIDEO_LCD_TDO_TL070WSH30 is not set  # CONFIG_VIDEO_LCD_HITACHI_TX18D42VM is not set @@ -2106,7 +2166,9 @@ CONFIG_DISPLAY_ROCKCHIP_EDP=y  # CONFIG_VIDEO_TIDSS is not set  # CONFIG_VIDEO_TEGRA124 is not set  # CONFIG_VIDEO_BRIDGE is not set +# CONFIG_VIDEO_BRIDGE_PARADE_DP501 is not set  # CONFIG_VIDEO_BRIDGE_SOLOMON_SSD2825 is not set +# CONFIG_VIDEO_BRIDGE_TOSHIBA_TC358768 is not set  # CONFIG_VIDEO_TEGRA20 is not set  # CONFIG_VIDEO_DSI_TEGRA30 is not set  # CONFIG_TEGRA_BACKLIGHT_PWM is not set @@ -2119,6 +2181,7 @@ CONFIG_CONSOLE_SCROLL_LINES=1  # CONFIG_OSD is not set  # CONFIG_VIDEO_REMOVE is not set  # CONFIG_SPLASH_SCREEN is not set +# CONFIG_BMP is not set  CONFIG_VIDEO_LOGO_MAX_SIZE=0x100000  CONFIG_VIDEO_BMP_RLE8=y  # CONFIG_BMP_16BPP is not set @@ -2183,6 +2246,7 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=65536  CONFIG_CHARSET=y  # CONFIG_DYNAMIC_CRC_TABLE is not set  CONFIG_LIB_UUID=y +CONFIG_RANDOM_UUID=y  CONFIG_SPL_LIB_UUID=y  # CONFIG_SEMIHOSTING is not set  # CONFIG_SPL_SEMIHOSTING is not set @@ -2200,6 +2264,7 @@ CONFIG_LIB_RAND=y  # CONFIG_LIB_HW_RAND is not set  CONFIG_SUPPORT_ACPI=y  # CONFIG_ACPI is not set +# CONFIG_SPL_ACPI is not set  # CONFIG_SPL_TINY_MEMSET is not set  # CONFIG_BITREVERSE is not set  # CONFIG_TRACE is not set @@ -2238,6 +2303,7 @@ CONFIG_MD5=y  # CONFIG_SPL_MD5 is not set  CONFIG_CRC8=y  # CONFIG_SPL_CRC8 is not set +# CONFIG_SPL_CRC16 is not set  CONFIG_CRC32=y  # @@ -2262,7 +2328,7 @@ CONFIG_ERRNO_STR=y  # CONFIG_HEXDUMP is not set  CONFIG_GETOPT=y  CONFIG_OF_LIBFDT=y -CONFIG_OF_LIBFDT_ASSUME_MASK=0 +CONFIG_OF_LIBFDT_ASSUME_MASK=0x0  CONFIG_SYS_FDT_PAD=0x3000  CONFIG_SPL_OF_LIBFDT=y  CONFIG_SPL_OF_LIBFDT_ASSUME_MASK=0xff @@ -2273,13 +2339,15 @@ CONFIG_SPL_OF_LIBFDT_ASSUME_MASK=0xff  CONFIG_GENERATE_SMBIOS_TABLE=y  # CONFIG_LIB_RATIONAL is not set  # CONFIG_SPL_LIB_RATIONAL is not set +CONFIG_SMBIOS=y  # CONFIG_SMBIOS_PARSER is not set  CONFIG_EFI_LOADER=y -CONFIG_CMD_BOOTEFI_BOOTMGR=y +CONFIG_EFI_BINARY_EXEC=y +CONFIG_EFI_BOOTMGR=y  # CONFIG_EFI_VARIABLE_FILE_STORE is not set  CONFIG_EFI_VARIABLE_NO_STORE=y  # CONFIG_EFI_VARIABLES_PRESEED is not set -CONFIG_EFI_VAR_BUF_SIZE=65536 +CONFIG_EFI_VAR_BUF_SIZE=131072  # CONFIG_EFI_SCROLL_ON_CLEAR_SCREEN is not set  # CONFIG_EFI_RUNTIME_UPDATE_CAPSULE is not set  # CONFIG_EFI_CAPSULE_ON_DISK is not set @@ -2297,6 +2365,7 @@ CONFIG_EFI_RNG_PROTOCOL=y  CONFIG_EFI_LOAD_FILE2_INITRD=y  CONFIG_EFI_ECPT=y  CONFIG_EFI_EBBR_2_1_CONFORMANCE=y +# CONFIG_EFI_HTTP_BOOT is not set  # CONFIG_OPTEE_LIB is not set  # CONFIG_OPTEE_IMAGE is not set  # CONFIG_BOOTM_OPTEE is not set @@ -2308,15 +2377,11 @@ CONFIG_LMB_MAX_REGIONS=16  # CONFIG_PHANDLE_CHECK_SEQ is not set  # -# FWU Multi Bank Updates -# -# CONFIG_POST is not set - -# -# Unit tests +# Testing  #  # CONFIG_UNIT_TEST is not set  # CONFIG_SPL_UNIT_TEST is not set +# CONFIG_POST is not set  #  # Tools options @@ -2324,6 +2389,7 @@ CONFIG_LMB_MAX_REGIONS=16  CONFIG_MKIMAGE_DTC_PATH="dtc"  CONFIG_TOOLS_CRC32=y  CONFIG_TOOLS_LIBCRYPTO=y +CONFIG_TOOLS_KWBIMAGE=y  CONFIG_TOOLS_FIT=y  CONFIG_TOOLS_FIT_FULL_CHECK=y  CONFIG_TOOLS_FIT_PRINT=y diff --git a/config/u-boot/gru_kevin/config/default b/config/u-boot/gru_kevin/config/default index 466bc96d..1bf46d24 100644 --- a/config/u-boot/gru_kevin/config/default +++ b/config/u-boot/gru_kevin/config/default @@ -1,13 +1,14 @@  #  # Automatically generated file; DO NOT EDIT. -# U-Boot 2023.10 Configuration +# U-Boot 2024.07 Configuration  #  # -# Compiler: gcc (Debian 13.2.0-5) 13.2.0 +# Compiler: gcc (Debian 13.3.0-2) 13.3.0  #  CONFIG_CREATE_ARCH_SYMLINK=y  CONFIG_SYS_CACHE_SHIFT_6=y +CONFIG_64BIT=y  CONFIG_SYS_CACHELINE_SIZE=64  CONFIG_LINKER_LIST_ALIGN=8  # CONFIG_ARC is not set @@ -40,7 +41,7 @@ CONFIG_SKIP_LOWLEVEL_INIT=y  # CONFIG_SYS_ICACHE_OFF is not set  # CONFIG_SPL_SYS_ICACHE_OFF is not set  # CONFIG_SYS_DCACHE_OFF is not set -# CONFIG_SPL_SYS_DCACHE_OFF is not set +CONFIG_SPL_SYS_DCACHE_OFF=y  #  # ARM architecture @@ -53,6 +54,7 @@ CONFIG_INIT_SP_RELATIVE=y  CONFIG_SYS_INIT_SP_BSS_OFFSET=524288  CONFIG_LNX_KRNL_IMG_TEXT_OFFSET_BASE=0x18000000  # CONFIG_GIC_V3_ITS is not set +# CONFIG_GICV3_SUPPORT_GIC600 is not set  CONFIG_STATIC_RELA=y  CONFIG_DMA_ADDR_T_64BIT=y  CONFIG_ARM_ASM_UNIFIED=y @@ -81,13 +83,11 @@ CONFIG_ARM64_SUPPORT_AARCH32=y  # CONFIG_ARCH_KIRKWOOD is not set  # CONFIG_ARCH_MVEBU is not set  # CONFIG_ARCH_ORION5X is not set -# CONFIG_TARGET_STV0991 is not set  # CONFIG_ARCH_BCM283X is not set  # CONFIG_ARCH_BCMSTB is not set  # CONFIG_ARCH_BCMBCA is not set  # CONFIG_TARGET_VEXPRESS_CA9X4 is not set  # CONFIG_TARGET_BCMNS is not set -# CONFIG_TARGET_BCMNS2 is not set  # CONFIG_TARGET_BCMNS3 is not set  # CONFIG_ARCH_EXYNOS is not set  # CONFIG_ARCH_S5PC1XX is not set @@ -117,7 +117,7 @@ CONFIG_ARM64_SUPPORT_AARCH32=y  # CONFIG_ARCH_APPLE is not set  # CONFIG_ARCH_OWL is not set  # CONFIG_ARCH_QEMU is not set -# CONFIG_ARCH_RMOBILE is not set +# CONFIG_ARCH_RENESAS is not set  # CONFIG_ARCH_SNAPDRAGON is not set  # CONFIG_ARCH_SOCFPGA is not set  # CONFIG_ARCH_SUNXI is not set @@ -176,6 +176,7 @@ CONFIG_ARCH_ROCKCHIP=y  # CONFIG_ARCH_ASPEED is not set  # CONFIG_TARGET_DURIAN is not set  # CONFIG_TARGET_POMELO is not set +# CONFIG_TARGET_PE2201 is not set  # CONFIG_TARGET_PRESIDIO_ASIC is not set  # CONFIG_TARGET_XENGUEST_ARM64 is not set  # CONFIG_ARCH_GXP is not set @@ -194,10 +195,9 @@ CONFIG_SF_DEFAULT_MODE=0x0  CONFIG_ENV_SIZE=0x8000  CONFIG_DM_GPIO=y  CONFIG_SPL_DM_SPI=y -CONFIG_DEFAULT_DEVICE_TREE="rk3399-gru-kevin" +CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3399-gru-kevin"  CONFIG_SPL_TEXT_BASE=0xff8c2000 -CONFIG_BOARD_SPECIFIC_OPTIONS=y -# CONFIG_OF_LIBFDT_OVERLAY is not set +CONFIG_OF_LIBFDT_OVERLAY=y  CONFIG_MULTI_DTB_FIT_UNCOMPRESS_SZ=0x8000  CONFIG_DM_RESET=y  CONFIG_SYS_MONITOR_LEN=0 @@ -227,13 +227,15 @@ CONFIG_ROCKCHIP_STIMER=y  CONFIG_ROCKCHIP_STIMER_BASE=0xff8680a0  CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000  # CONFIG_SPL_ROCKCHIP_EARLYRETURN_TO_BROM is not set +CONFIG_ROCKCHIP_DISABLE_FORCE_JTAG=y  # CONFIG_SPL_MMC is not set  CONFIG_ROCKCHIP_SPI_IMAGE=y +CONFIG_ROCKCHIP_COMMON_STACK_ADDR=y  CONFIG_SPL_SERIAL=y  CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl-v8.lds"  CONFIG_TPL_TEXT_BASE=0xff8c2000  CONFIG_TPL_STACK=0xff8effff -CONFIG_SPL_DRIVERS_MISC=y +# CONFIG_SPL_DRIVERS_MISC is not set  CONFIG_SPL_STACK_R_ADDR=0x04000000  # CONFIG_TARGET_CHROMEBOOK_BOB is not set  CONFIG_TARGET_CHROMEBOOK_KEVIN=y @@ -242,16 +244,23 @@ CONFIG_TARGET_CHROMEBOOK_KEVIN=y  # CONFIG_TARGET_PINEPHONE_PRO_RK3399 is not set  # CONFIG_TARGET_PUMA_RK3399 is not set  # CONFIG_TARGET_ROCK960_RK3399 is not set +# CONFIG_TARGET_ROCKPI4_RK3399 is not set  # CONFIG_TARGET_ROCKPRO64_RK3399 is not set  # CONFIG_TARGET_ROC_PC_RK3399 is not set  CONFIG_SPL_STACK=0xff8effff  CONFIG_SPL_SYS_MALLOC_F_LEN=0x4000 +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y +CONFIG_SPL_BSS_START_ADDR=0xff8e0000 +CONFIG_SPL_BSS_MAX_SIZE=0x10000 +CONFIG_SPL_STACK_R=y +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000 +CONFIG_SPL_SYS_MALLOC_F=y  CONFIG_ERR_PTR_OFFSET=0x0  CONFIG_SPL_SIZE_LIMIT=0x0  CONFIG_SPL=y  CONFIG_PRE_CON_BUF_ADDR=0x0f200000  CONFIG_PRE_CON_BUF_SZ=4096 -CONFIG_BOOTSTAGE_STASH_ADDR=0 +CONFIG_BOOTSTAGE_STASH_ADDR=0x0  CONFIG_DEBUG_UART_BASE=0xff1a0000  CONFIG_DEBUG_UART_CLOCK=24000000  CONFIG_DEBUG_UART_BOARD_INIT=y @@ -265,7 +274,7 @@ CONFIG_SPL_SPI=y  # CONFIG_CMO_BY_VA_ONLY is not set  # CONFIG_ARMV8_SPL_EXCEPTION_VECTORS is not set  # CONFIG_ARMV8_MULTIENTRY is not set -# CONFIG_ARMV8_SET_SMPEN is not set +CONFIG_ARMV8_SET_SMPEN=y  # CONFIG_ARMV8_SWITCH_TO_EL1 is not set  # @@ -277,7 +286,9 @@ CONFIG_SPL_SPI=y  CONFIG_PSCI_RESET=y  # CONFIG_ARMV8_PSCI is not set  # CONFIG_ARMV8_EA_EL3_FIRST is not set -# CONFIG_ARMV8_CRYPTO is not set +CONFIG_ARMV8_CRYPTO=y +CONFIG_ARMV8_CE_SHA1=y +CONFIG_ARMV8_CE_SHA256=y  # CONFIG_CMD_DEKBLOB is not set  # CONFIG_IMX_CAAM_DEK_ENCAP is not set  # CONFIG_IMX_OPTEE_DEK_ENCAP is not set @@ -285,8 +296,6 @@ CONFIG_PSCI_RESET=y  # CONFIG_IMX_ELE_DEK_ENCAP is not set  # CONFIG_CMD_HDMIDETECT is not set  CONFIG_IMX_DCD_ADDR=0x00910000 -# CONFIG_SPL_LOAD_IMX_CONTAINER is not set -CONFIG_IMX_CONTAINER_CFG=""  CONFIG_SYS_MEM_TOP_HIDE=0x0  CONFIG_SYS_LOAD_ADDR=0x800800 @@ -313,7 +322,7 @@ CONFIG_DEBUG_UART=y  CONFIG_LOCALVERSION=""  CONFIG_LOCALVERSION_AUTO=y  CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=130200 +CONFIG_GCC_VERSION=130300  CONFIG_CLANG_VERSION=0  CONFIG_CC_OPTIMIZE_FOR_SIZE=y  # CONFIG_CC_OPTIMIZE_FOR_SPEED is not set @@ -346,6 +355,10 @@ CONFIG_STACK_SIZE=0x1000000  CONFIG_SYS_SRAM_BASE=0x0  CONFIG_SYS_SRAM_SIZE=0x0  # CONFIG_MP is not set +CONFIG_HAVE_TEXT_BASE=y +# CONFIG_HAVE_SYS_UBOOT_START is not set +CONFIG_SYS_UBOOT_START=0x18000000 +# CONFIG_DYNAMIC_SYS_CLK_FREQ is not set  # CONFIG_API is not set  # @@ -356,8 +369,8 @@ CONFIG_SYS_SRAM_SIZE=0x0  # Boot images  #  # CONFIG_ANDROID_BOOT_IMAGE is not set -CONFIG_FIT=y  # CONFIG_TIMESTAMP is not set +CONFIG_FIT=y  CONFIG_FIT_EXTERNAL_OFFSET=0x0  CONFIG_FIT_FULL_CHECK=y  # CONFIG_FIT_SIGNATURE is not set @@ -377,6 +390,8 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x0  CONFIG_SPL_FIT_SOURCE=""  # CONFIG_USE_SPL_FIT_GENERATOR is not set  CONFIG_PXE_UTILS=y +CONFIG_BOOT_DEFAULTS_FEATURES=y +CONFIG_BOOT_DEFAULTS_CMDS=y  CONFIG_BOOT_DEFAULTS=y  CONFIG_BOOTSTD=y  # CONFIG_SPL_BOOTSTD is not set @@ -384,9 +399,11 @@ CONFIG_BOOTSTD_FULL=y  CONFIG_BOOTSTD_DEFAULTS=y  CONFIG_BOOTSTD_BOOTCOMMAND=y  CONFIG_BOOTMETH_GLOBAL=y +# CONFIG_BOOTMETH_CROS is not set  CONFIG_BOOTMETH_EXTLINUX=y  CONFIG_BOOTMETH_EXTLINUX_PXE=y  CONFIG_BOOTMETH_EFILOADER=y +CONFIG_BOOTMETH_EFI_BOOTMGR=y  CONFIG_BOOTMETH_VBE=y  CONFIG_BOOTMETH_DISTRO=y  # CONFIG_SPL_BOOTMETH_VBE is not set @@ -398,13 +415,8 @@ CONFIG_BOOTMETH_VBE_SIMPLE_OS=y  CONFIG_EXPO=y  CONFIG_BOOTMETH_SCRIPT=y  CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_SYS_BOOTM_LEN=0x4000000  CONFIG_SUPPORT_RAW_INITRD=y -# CONFIG_OF_BOARD_SETUP is not set -# CONFIG_OF_SYSTEM_SETUP is not set -# CONFIG_OF_STDOUT_VIA_ALIAS is not set -CONFIG_HAVE_TEXT_BASE=y -# CONFIG_DYNAMIC_SYS_CLK_FREQ is not set -CONFIG_ARCH_FIXUP_FDT_MEMORY=y  # CONFIG_CHROMEOS is not set  # CONFIG_CHROMEOS_VBOOT is not set  # CONFIG_RAMBOOT_PBL is not set @@ -444,6 +456,17 @@ CONFIG_BOOTDELAY=2  # Image support  #  # CONFIG_IMAGE_PRE_LOAD is not set + +# +# Devicetree fixup +# +# CONFIG_OF_ENV_SETUP is not set +# CONFIG_OF_BOARD_SETUP is not set +# CONFIG_OF_SYSTEM_SETUP is not set +# CONFIG_OF_STDOUT_VIA_ALIAS is not set +# CONFIG_FDT_FIXUP_PARTITIONS is not set +# CONFIG_FDT_SIMPLEFB is not set +CONFIG_ARCH_FIXUP_FDT_MEMORY=y  # CONFIG_USE_BOOTARGS is not set  # CONFIG_BOOTARGS_SUBST is not set  CONFIG_USE_BOOTCOMMAND=y @@ -463,6 +486,8 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-gru-kevin.dtb"  #  CONFIG_MENU=y  # CONFIG_CONSOLE_RECORD is not set +CONFIG_SYS_CBSIZE=1024 +CONFIG_SYS_PBSIZE=1044  # CONFIG_DISABLE_CONSOLE is not set  CONFIG_LOGLEVEL=4  CONFIG_SPL_LOGLEVEL=4 @@ -471,6 +496,7 @@ CONFIG_SPL_LOGLEVEL=4  # CONFIG_TPL_SILENT_CONSOLE is not set  CONFIG_PRE_CONSOLE_BUFFER=y  CONFIG_CONSOLE_FLUSH_SUPPORT=y +# CONFIG_CONSOLE_FLUSH_ON_NEWLINE is not set  CONFIG_CONSOLE_MUX=y  CONFIG_SYS_CONSOLE_IS_IN_ENV=y  # CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE is not set @@ -517,7 +543,7 @@ CONFIG_BOARD_EARLY_INIT_R=y  CONFIG_BOARD_LATE_INIT=y  # CONFIG_CLOCKS is not set  # CONFIG_HWCONFIG is not set -# CONFIG_LAST_STAGE_INIT is not set +CONFIG_LAST_STAGE_INIT=y  CONFIG_MISC_INIT_R=y  # CONFIG_SYS_MALLOC_BOOTPARAMS is not set  # CONFIG_ID_EEPROM is not set @@ -557,14 +583,11 @@ CONFIG_SUPPORT_TPL=y  #  CONFIG_SPL_FRAMEWORK=y  # CONFIG_SPL_FRAMEWORK_BOARD_INIT_F is not set -CONFIG_SPL_MAX_SIZE=0x2e000 +CONFIG_SPL_MAX_SIZE=0x1e000  CONFIG_SPL_PAD_TO=0x7f8000 -CONFIG_SPL_HAS_BSS_LINKER_SECTION=y -CONFIG_SPL_BSS_START_ADDR=0xff8e0000  # CONFIG_SPL_NO_BSS_LIMIT is not set  CONFIG_SPL_BSS_LIMIT=y  # CONFIG_SPL_FOOTPRINT_LIMIT is not set -CONFIG_SPL_BSS_MAX_SIZE=0x10000  CONFIG_SPL_SYS_STACK_F_CHECK_BYTE=0xaa  # CONFIG_SPL_SYS_REPORT_STACK_F_USAGE is not set  # CONFIG_SPL_SHOW_ERRORS is not set @@ -576,12 +599,11 @@ CONFIG_SPL_BOARD_INIT=y  # CONFIG_SPL_BOOTROM_SUPPORT is not set  # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set  # CONFIG_SPL_LEGACY_IMAGE_FORMAT is not set +# CONFIG_SPL_LOAD_IMX_CONTAINER is not set  CONFIG_SPL_SYS_MALLOC_SIMPLE=y  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set -CONFIG_SPL_STACK_R=y -CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000  CONFIG_SPL_SEPARATE_BSS=y -# CONFIG_SYS_SPL_MALLOC is not set +# CONFIG_SPL_SYS_MALLOC is not set  CONFIG_SPL_BANNER_PRINT=y  # CONFIG_SPL_DISPLAY_PRINT is not set  CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y @@ -602,7 +624,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0  # CONFIG_SPL_DM_MAILBOX is not set  # CONFIG_SPL_MEMORY is not set  # CONFIG_SPL_MPC8XXX_INIT_DDR is not set -# CONFIG_SPL_MTD_SUPPORT is not set +# CONFIG_SPL_MTD is not set  # CONFIG_SPL_MUSB_NEW is not set  # CONFIG_SPL_NAND_SUPPORT is not set  # CONFIG_SPL_NAND_DRIVERS is not set @@ -640,23 +662,21 @@ CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y  CONFIG_SPL_TARGET=""  # CONFIG_TPL is not set  # CONFIG_VPL is not set -# CONFIG_FDT_SIMPLEFB is not set -# CONFIG_BMP is not set +CONFIG_CMDLINE=y +CONFIG_HUSH_PARSER=y  # -# Command line interface +# Hush flavor to use  # -CONFIG_CMDLINE=y -CONFIG_HUSH_PARSER=y +CONFIG_HUSH_OLD_PARSER=y +# CONFIG_HUSH_MODERN_PARSER is not set  CONFIG_CMDLINE_EDITING=y  # CONFIG_CMDLINE_PS_SUPPORT is not set  CONFIG_AUTO_COMPLETE=y  CONFIG_SYS_LONGHELP=y  CONFIG_SYS_PROMPT="=> "  CONFIG_SYS_PROMPT_HUSH_PS2="> " -CONFIG_SYS_MAXARGS=16 -CONFIG_SYS_CBSIZE=1024 -CONFIG_SYS_PBSIZE=1044 +CONFIG_SYS_MAXARGS=64  CONFIG_SYS_XTRACE=y  # @@ -670,8 +690,10 @@ CONFIG_CMD_BDI=y  # CONFIG_CMD_BDINFO_EXTRA is not set  # CONFIG_CMD_CONFIG is not set  CONFIG_CMD_CONSOLE=y +# CONFIG_CMD_HISTORY is not set  # CONFIG_CMD_LICENSE is not set  # CONFIG_CMD_PMC is not set +# CONFIG_CMD_SMBIOS is not set  #  # Boot commands @@ -693,24 +715,24 @@ CONFIG_BOOTM_PLAN9=y  CONFIG_BOOTM_RTEMS=y  CONFIG_CMD_VBE=y  CONFIG_BOOTM_VXWORKS=y -CONFIG_SYS_BOOTM_LEN=0x4000000  CONFIG_CMD_BOOTEFI=y +CONFIG_CMD_BOOTEFI_BINARY=y +CONFIG_CMD_BOOTEFI_BOOTMGR=y  CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y  CONFIG_CMD_BOOTEFI_HELLO=y  CONFIG_CMD_BOOTEFI_SELFTEST=y  CONFIG_CMD_BOOTMENU=y  # CONFIG_CMD_ADTIMG is not set  CONFIG_CMD_ELF=y +# CONFIG_CMD_ELF_FDT_SETUP is not set  CONFIG_CMD_FDT=y  CONFIG_CMD_GO=y  CONFIG_CMD_RUN=y  CONFIG_CMD_IMI=y  # CONFIG_CMD_IMLS is not set  CONFIG_CMD_XIMG=y -# CONFIG_CMD_XXD is not set +CONFIG_SYS_XIMG_LEN=0x800000  # CONFIG_CMD_SPL is not set -# CONFIG_CMD_THOR_DOWNLOAD is not set -# CONFIG_CMD_ZBOOT is not set  #  # Environment commands @@ -776,7 +798,6 @@ CONFIG_CMD_GPIO=y  # CONFIG_CMD_GPIO_READ is not set  # CONFIG_CMD_PWM is not set  CONFIG_CMD_GPT=y -CONFIG_RANDOM_UUID=y  # CONFIG_CMD_GPT_RENAME is not set  # CONFIG_CMD_IDE is not set  # CONFIG_CMD_IO is not set @@ -794,8 +815,11 @@ CONFIG_CMD_LOADXY_TIMEOUT=90  # CONFIG_CMD_MISC is not set  CONFIG_CMD_MMC=y  # CONFIG_CMD_BKOPS_ENABLE is not set +# CONFIG_CMD_MMC_REG is not set  # CONFIG_CMD_MMC_SWRITE is not set  # CONFIG_CMD_CLONE is not set +# CONFIG_CMD_MTD is not set +# CONFIG_CMD_ONENAND is not set  # CONFIG_CMD_OSD is not set  CONFIG_CMD_PART=y  # CONFIG_CMD_PCI is not set @@ -808,11 +832,12 @@ CONFIG_CMD_SF=y  CONFIG_CMD_SF_TEST=y  CONFIG_CMD_SPI=y  CONFIG_DEFAULT_SPI_BUS=0 -CONFIG_DEFAULT_SPI_MODE=0 +CONFIG_DEFAULT_SPI_MODE=0x0  # CONFIG_CMD_TSI148 is not set  # CONFIG_CMD_UNIVERSE is not set  CONFIG_CMD_USB=y  # CONFIG_CMD_USB_SDP is not set +# CONFIG_CMD_RKMTD is not set  # CONFIG_CMD_WRITE is not set  # @@ -823,6 +848,7 @@ CONFIG_CMD_ECHO=y  CONFIG_CMD_ITEST=y  CONFIG_CMD_SOURCE=y  # CONFIG_CMD_SETEXPR is not set +# CONFIG_CMD_XXD is not set  #  # Android support commands @@ -845,6 +871,7 @@ CONFIG_BOOTP_SUBNETMASK=y  # CONFIG_CMD_PCAP is not set  CONFIG_BOOTP_PXE=y  CONFIG_BOOTP_PXE_CLIENTARCH=0x16 +# CONFIG_BOOTP_PXE_DHCP_OPTION is not set  CONFIG_BOOTP_VCI_STRING="U-Boot.armv8"  CONFIG_CMD_TFTPBOOT=y  # CONFIG_CMD_TFTPPUT is not set @@ -898,7 +925,6 @@ CONFIG_CMD_VIDCONSOLE=y  #  # TI specific command line interface  # -# CONFIG_CMD_DDR3 is not set  #  # Power commands @@ -933,9 +959,9 @@ CONFIG_CMD_FAT=y  CONFIG_CMD_FS_GENERIC=y  # CONFIG_CMD_FS_UUID is not set  # CONFIG_CMD_JFFS2 is not set +# CONFIG_CMD_MTDPARTS is not set  CONFIG_MTDIDS_DEFAULT=""  CONFIG_MTDPARTS_DEFAULT="" -# CONFIG_CMD_REISER is not set  # CONFIG_CMD_ZFS is not set  # @@ -979,16 +1005,18 @@ CONFIG_BINMAN=y  CONFIG_OF_CONTROL=y  CONFIG_OF_REAL=y  CONFIG_SPL_OF_CONTROL=y -# CONFIG_OF_LIVE is not set +CONFIG_OF_LIVE=y +CONFIG_OF_UPSTREAM=y +# CONFIG_OF_UPSTREAM_BUILD_VENDOR is not set  CONFIG_OF_SEPARATE=y  # CONFIG_OF_EMBED is not set  # CONFIG_OF_BOARD is not set  # CONFIG_OF_OMIT_DTB is not set  CONFIG_DEVICE_TREE_INCLUDES="" -CONFIG_OF_LIST="rk3399-gru-kevin" +CONFIG_OF_LIST="rockchip/rk3399-gru-kevin"  # CONFIG_MULTI_DTB_FIT is not set  # CONFIG_SPL_MULTI_DTB_FIT is not set -CONFIG_SPL_OF_LIST="rk3399-gru-kevin" +CONFIG_SPL_OF_LIST="rockchip/rk3399-gru-kevin"  CONFIG_OF_TAG_MIGRATE=y  CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"  # CONFIG_OF_DTB_PROPS_REMOVE is not set @@ -1066,10 +1094,11 @@ CONFIG_SYS_RX_ETH_BUFFER=4  #  CONFIG_DM=y  CONFIG_SPL_DM=y -CONFIG_DM_WARN=y +# CONFIG_DM_WARN is not set  # CONFIG_SPL_DM_WARN is not set  # CONFIG_DM_DEBUG is not set  # CONFIG_DM_STATS is not set +# CONFIG_SPL_DM_STATS is not set  CONFIG_DM_DEVICE_REMOVE=y  CONFIG_DM_EVENT=y  # CONFIG_SPL_DM_DEVICE_REMOVE is not set @@ -1089,8 +1118,8 @@ CONFIG_SPL_SIMPLE_BUS=y  CONFIG_OF_TRANSLATE=y  # CONFIG_SPL_OF_TRANSLATE is not set  # CONFIG_TRANSLATION_OFFSET is not set -CONFIG_DM_DEV_READ_INLINE=y -# CONFIG_OFNODE_MULTI_TREE is not set +CONFIG_OFNODE_MULTI_TREE=y +CONFIG_OFNODE_MULTI_TREE_MAX=4  CONFIG_BOUNCE_BUFFER=y  CONFIG_ADC=y  # CONFIG_ADC_EXYNOS is not set @@ -1119,6 +1148,7 @@ CONFIG_BLOCK_CACHE=y  # CONFIG_IDE is not set  # CONFIG_LBA48 is not set  # CONFIG_SYS_64BIT_LBA is not set +# CONFIG_RKMTD is not set  # CONFIG_BOOTCOUNT_LIMIT is not set  # @@ -1131,9 +1161,10 @@ CONFIG_BLOCK_CACHE=y  #  # CONFIG_CACHE is not set  # CONFIG_L2X0_CACHE is not set -# CONFIG_V5L2_CACHE is not set +# CONFIG_ANDES_L2_CACHE is not set  # CONFIG_NCORE_CACHE is not set  # CONFIG_SIFIVE_CCACHE is not set +# CONFIG_SIFIVE_PL2 is not set  #  # Clock @@ -1142,6 +1173,8 @@ CONFIG_CLK=y  CONFIG_SPL_CLK=y  # CONFIG_SPL_CLK_CCF is not set  # CONFIG_CLK_CCF is not set +# CONFIG_CLK_GPIO is not set +# CONFIG_SPL_CLK_GPIO is not set  # CONFIG_CLK_CDCE9XX is not set  # CONFIG_CLK_ICS8N3QV01 is not set  # CONFIG_CLK_K210 is not set @@ -1266,7 +1299,6 @@ CONFIG_ROCKCHIP_GPIO=y  # CONFIG_NOMADIK_GPIO is not set  # CONFIG_ZYNQMP_GPIO_MODEPIN is not set  # CONFIG_SLG7XL45106_I2C_GPO is not set -# CONFIG_TURRIS_OMNIA_MCU is not set  # CONFIG_FTGPIO010 is not set  # CONFIG_ADP5585_GPIO is not set @@ -1351,6 +1383,7 @@ CONFIG_SPL_MISC=y  # CONFIG_GATEWORKS_SC is not set  CONFIG_ROCKCHIP_EFUSE=y  # CONFIG_ROCKCHIP_OTP is not set +CONFIG_ROCKCHIP_IODOMAIN=y  # CONFIG_SIFIVE_OTP is not set  # CONFIG_SMSC_LPC47M is not set  # CONFIG_SMSC_SIO1007 is not set @@ -1370,6 +1403,7 @@ CONFIG_PWRSEQ=y  # CONFIG_SPL_PWRSEQ is not set  # CONFIG_PCA9551_LED is not set  # CONFIG_TEST_DRV is not set +# CONFIG_TURRIS_OMNIA_MCU is not set  # CONFIG_USB_HUB_USB251XB is not set  # CONFIG_TWL4030_LED is not set  # CONFIG_WINBOND_W83627 is not set @@ -1385,6 +1419,7 @@ CONFIG_PWRSEQ=y  # CONFIG_MICROCHIP_FLEXCOM is not set  # CONFIG_ESM_PMIC is not set  # CONFIG_SL28CPLD is not set +# CONFIG_SPL_SOCFPGA_DT_REG is not set  #  # MMC Host controller Support @@ -1420,8 +1455,11 @@ CONFIG_MMC_DW_ROCKCHIP=y  CONFIG_MMC_SDHCI=y  CONFIG_MMC_SDHCI_SDMA=y  # CONFIG_MMC_SDHCI_ADMA is not set +# CONFIG_MMC_SDHCI_ADMA_FORCE_32BIT is not set +CONFIG_MMC_SDHCI_ADMA_64BIT=y  # CONFIG_MMC_SDHCI_BCMSTB is not set  # CONFIG_MMC_SDHCI_CADENCE is not set +# CONFIG_MMC_SDHCI_CV1800B is not set  # CONFIG_MMC_SDHCI_IPROC is not set  # CONFIG_MMC_SDHCI_F_SDH30 is not set  # CONFIG_MMC_SDHCI_KONA is not set @@ -1442,9 +1480,11 @@ CONFIG_MMC_SDHCI_ROCKCHIP=y  #  # MTD Support  # -# CONFIG_MTD is not set +CONFIG_MTD=y  # CONFIG_DM_MTD is not set  # CONFIG_MTD_NOR_FLASH is not set +# CONFIG_MTD_CONCAT is not set +# CONFIG_SYS_MTDPARTS_RUNTIME is not set  # CONFIG_FLASH_CFI_DRIVER is not set  # CONFIG_HBMC_AM654 is not set  # CONFIG_SAMSUNG_ONENAND is not set @@ -1464,20 +1504,24 @@ CONFIG_SPI_FLASH_SMART_HWCAPS=y  # CONFIG_SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT is not set  # CONFIG_SPI_FLASH_SOFT_RESET is not set  # CONFIG_SPI_FLASH_BAR is not set +CONFIG_SPI_FLASH_LOCK=y  CONFIG_SPI_FLASH_UNLOCK_ALL=y  # CONFIG_SPI_FLASH_ATMEL is not set  # CONFIG_SPI_FLASH_EON is not set  CONFIG_SPI_FLASH_GIGADEVICE=y  # CONFIG_SPI_FLASH_ISSI is not set  # CONFIG_SPI_FLASH_MACRONIX is not set +# CONFIG_SPI_FLASH_SILICONKAISER is not set  # CONFIG_SPI_FLASH_SPANSION is not set  # CONFIG_SPI_FLASH_STMICRO is not set  # CONFIG_SPI_FLASH_SST is not set  CONFIG_SPI_FLASH_WINBOND=y  # CONFIG_SPI_FLASH_XMC is not set  # CONFIG_SPI_FLASH_XTX is not set +# CONFIG_SPI_FLASH_ZBIT is not set  CONFIG_SPI_FLASH_USE_4K_SECTORS=y  # CONFIG_SPI_FLASH_DATAFLASH is not set +# CONFIG_SPI_FLASH_MTD is not set  #  # UBI support @@ -1538,7 +1582,7 @@ CONFIG_DM_ETH=y  # CONFIG_DM_MDIO is not set  # CONFIG_DM_ETH_PHY is not set  CONFIG_NETDEVICES=y -# CONFIG_PHY_GIGE is not set +CONFIG_PHY_GIGE=y  # CONFIG_ALTERA_TSE is not set  # CONFIG_BCM_SF2_ETH is not set  # CONFIG_BCMGENET is not set @@ -1557,7 +1601,6 @@ CONFIG_ETH_DESIGNWARE=y  # CONFIG_FTMAC100 is not set  # CONFIG_FTGMAC100 is not set  # CONFIG_MCFFEC is not set -# CONFIG_FSLDMAFEC is not set  # CONFIG_KS8851_MLL is not set  # CONFIG_LITEETH is not set  # CONFIG_MACB is not set @@ -1586,6 +1629,7 @@ CONFIG_GMAC_ROCKCHIP=y  # CONFIG_SYS_DPAA_QBMAN is not set  # CONFIG_TSEC_ENET is not set  # CONFIG_MEDIATEK_ETH is not set +# CONFIG_HIFEMAC_ETH is not set  # CONFIG_HIGMACV300_ETH is not set  # CONFIG_NVME is not set  # CONFIG_NVME_APPLE is not set @@ -1611,6 +1655,7 @@ CONFIG_PHY=y  # Rockchip PHY driver  #  # CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY is not set +# CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set  CONFIG_PHY_ROCKCHIP_INNO_USB2=y  # CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY is not set  # CONFIG_PHY_ROCKCHIP_PCIE is not set @@ -1649,6 +1694,8 @@ CONFIG_SPL_PINCONF_RECURSIVE=y  # CONFIG_PINCTRL_K210 is not set  CONFIG_PINCTRL_ROCKCHIP=y  CONFIG_SPL_PINCTRL_ROCKCHIP=y +# CONFIG_PINCTRL_TEGRA is not set +# CONFIG_SPL_PINCTRL_TEGRA is not set  CONFIG_POWER=y  # CONFIG_POWER_LEGACY is not set  # CONFIG_ACPI_PMC is not set @@ -1678,6 +1725,7 @@ CONFIG_SPL_PMIC_CHILDREN=y  # CONFIG_SPL_DM_PMIC_PCA9450 is not set  # CONFIG_DM_PMIC_PFUZE100 is not set  # CONFIG_SPL_DM_PMIC_PFUZE100 is not set +# CONFIG_DM_PMIC_MAX77663 is not set  # CONFIG_DM_PMIC_MAX77686 is not set  # CONFIG_DM_PMIC_MAX8998 is not set  # CONFIG_DM_PMIC_MC34708 is not set @@ -1695,12 +1743,14 @@ CONFIG_PMIC_RK8XX=y  # CONFIG_PMIC_LP873X is not set  # CONFIG_PMIC_LP87565 is not set  # CONFIG_DM_PMIC_TPS65910 is not set +# CONFIG_DM_PMIC_TPS80031 is not set  # CONFIG_PMIC_STPMIC1 is not set  # CONFIG_SPL_PMIC_PALMAS is not set  # CONFIG_SPL_PMIC_LP873X is not set  # CONFIG_SPL_PMIC_LP87565 is not set  # CONFIG_PMIC_TPS65941 is not set  # CONFIG_PMIC_TPS65219 is not set +# CONFIG_PMIC_RAA215300 is not set  # CONFIG_PMIC_TPS65217 is not set  # CONFIG_POWER_TPS65218 is not set  # CONFIG_POWER_TPS62362 is not set @@ -1758,6 +1808,7 @@ CONFIG_RAM_ROCKCHIP_DEBUG=y  #  # Remote Processor drivers  # +CONFIG_REMOTEPROC_MAX_FW_SIZE=0x10000  #  # Reset Controller Support @@ -1770,11 +1821,13 @@ CONFIG_RESET_ROCKCHIP=y  # CONFIG_RESET_SCMI is not set  # CONFIG_RESET_DRA7 is not set  CONFIG_DM_RNG=y +# CONFIG_SPL_DM_RNG is not set  # CONFIG_RNG_MSM is not set  # CONFIG_RNG_NPCM is not set  CONFIG_RNG_ROCKCHIP=y  # CONFIG_RNG_IPROC200 is not set  # CONFIG_RNG_SMCCC_TRNG is not set +# CONFIG_RNG_ARM_RNDR is not set  #  # Real Time Clock @@ -1794,9 +1847,9 @@ CONFIG_RNG_ROCKCHIP=y  # CONFIG_RTC_MC146818 is not set  # CONFIG_RTC_M41T62 is not set  # CONFIG_SCSI is not set -# CONFIG_DM_SCSI is not set  CONFIG_SERIAL=y  CONFIG_BAUDRATE=115200 +# CONFIG_DEFAULT_ENV_IS_RW is not set  CONFIG_REQUIRE_SERIAL_CONSOLE=y  # CONFIG_SPECIFY_CONSOLE_INDEX is not set  CONFIG_SERIAL_PRESENT=y @@ -1838,11 +1891,14 @@ CONFIG_SYS_NS16550_MEM32=y  # CONFIG_MSM_GENI_SERIAL is not set  # CONFIG_MXS_AUART_SERIAL is not set  # CONFIG_OMAP_SERIAL is not set +# CONFIG_HTIF_CONSOLE is not set  # CONFIG_SIFIVE_SERIAL is not set  # CONFIG_ZYNQ_SERIAL is not set  # CONFIG_MTK_SERIAL is not set  # CONFIG_MT7620_SERIAL is not set  # CONFIG_NPCM_SERIAL is not set +# CONFIG_SM is not set +# CONFIG_MESON_SM is not set  # CONFIG_SMEM is not set  # @@ -1854,6 +1910,7 @@ CONFIG_SYS_NS16550_MEM32=y  # SOC (System On Chip) specific Drivers  #  # CONFIG_SOC_DEVICE is not set +# CONFIG_SOC_SAMSUNG is not set  # CONFIG_SOC_TI is not set  CONFIG_SPI=y  CONFIG_DM_SPI=y @@ -1867,6 +1924,7 @@ CONFIG_SPI_MEM=y  # CONFIG_CORTINA_SFLASH is not set  # CONFIG_CADENCE_QSPI is not set  # CONFIG_CF_SPI is not set +# CONFIG_CV1800B_SPIF is not set  # CONFIG_DESIGNWARE_SPI is not set  # CONFIG_EXYNOS_SPI is not set  # CONFIG_FSL_DSPI is not set @@ -1919,7 +1977,8 @@ CONFIG_ROCKCHIP_SPI=y  CONFIG_SYSRESET=y  CONFIG_SPL_SYSRESET=y  CONFIG_SYSRESET_CMD_RESET=y -# CONFIG_SYSRESET_CMD_POWEROFF is not set +CONFIG_SYSRESET_CMD_POWEROFF=y +# CONFIG_SYSRESET_CV1800B is not set  # CONFIG_POWEROFF_GPIO is not set  # CONFIG_SYSRESET_GPIO is not set  # CONFIG_SYSRESET_PSCI is not set @@ -1950,9 +2009,8 @@ CONFIG_SPL_DM_USB=y  CONFIG_USB_HOST=y  # CONFIG_SPL_USB_HOST is not set  CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_DWC3=y -CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y -# CONFIG_USB_XHCI_PCI is not set +# CONFIG_USB_XHCI_DWC3 is not set +# CONFIG_USB_XHCI_DWC3_OF_SIMPLE is not set  # CONFIG_USB_XHCI_FSL is not set  # CONFIG_USB_XHCI_BRCM is not set  CONFIG_USB_EHCI_HCD=y @@ -1977,7 +2035,7 @@ CONFIG_USB_DWC3=y  # Platform Glue Driver Support  #  # CONFIG_USB_DWC3_OMAP is not set -# CONFIG_USB_DWC3_GENERIC is not set +CONFIG_USB_DWC3_GENERIC=y  # CONFIG_SPL_USB_DWC3_GENERIC is not set  # CONFIG_USB_DWC3_LAYERSCAPE is not set @@ -2046,7 +2104,7 @@ CONFIG_VIDEO=y  CONFIG_VIDEO_FONT_16X32=y  CONFIG_VIDEO_LOGO=y  CONFIG_BACKLIGHT=y -CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE=0 +CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE=0x0  # CONFIG_VIDEO_COPY is not set  CONFIG_VIDEO_DAMAGE=y  CONFIG_BACKLIGHT_PWM=y @@ -2077,9 +2135,11 @@ CONFIG_SIMPLE_PANEL=y  # CONFIG_VIDEO_LCD_ENDEAVORU is not set  # CONFIG_VIDEO_LCD_HIMAX_HX8394 is not set  # CONFIG_VIDEO_LCD_ORISETECH_OTM8009A is not set +# CONFIG_VIDEO_LCD_LG_LD070WX3 is not set  # CONFIG_VIDEO_LCD_RAYDIUM_RM68200 is not set  # CONFIG_VIDEO_LCD_RENESAS_R61307 is not set  # CONFIG_VIDEO_LCD_RENESAS_R69328 is not set +# CONFIG_VIDEO_LCD_SAMSUNG_LTL106HL02 is not set  # CONFIG_VIDEO_LCD_SSD2828 is not set  # CONFIG_VIDEO_LCD_TDO_TL070WSH30 is not set  # CONFIG_VIDEO_LCD_HITACHI_TX18D42VM is not set @@ -2106,7 +2166,9 @@ CONFIG_DISPLAY_ROCKCHIP_EDP=y  # CONFIG_VIDEO_TIDSS is not set  # CONFIG_VIDEO_TEGRA124 is not set  # CONFIG_VIDEO_BRIDGE is not set +# CONFIG_VIDEO_BRIDGE_PARADE_DP501 is not set  # CONFIG_VIDEO_BRIDGE_SOLOMON_SSD2825 is not set +# CONFIG_VIDEO_BRIDGE_TOSHIBA_TC358768 is not set  # CONFIG_VIDEO_TEGRA20 is not set  # CONFIG_VIDEO_DSI_TEGRA30 is not set  # CONFIG_TEGRA_BACKLIGHT_PWM is not set @@ -2119,6 +2181,7 @@ CONFIG_CONSOLE_SCROLL_LINES=1  # CONFIG_OSD is not set  # CONFIG_VIDEO_REMOVE is not set  # CONFIG_SPLASH_SCREEN is not set +# CONFIG_BMP is not set  CONFIG_VIDEO_LOGO_MAX_SIZE=0x100000  CONFIG_VIDEO_BMP_RLE8=y  # CONFIG_BMP_16BPP is not set @@ -2183,6 +2246,7 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=65536  CONFIG_CHARSET=y  # CONFIG_DYNAMIC_CRC_TABLE is not set  CONFIG_LIB_UUID=y +CONFIG_RANDOM_UUID=y  CONFIG_SPL_LIB_UUID=y  # CONFIG_SEMIHOSTING is not set  # CONFIG_SPL_SEMIHOSTING is not set @@ -2200,6 +2264,7 @@ CONFIG_LIB_RAND=y  # CONFIG_LIB_HW_RAND is not set  CONFIG_SUPPORT_ACPI=y  # CONFIG_ACPI is not set +# CONFIG_SPL_ACPI is not set  # CONFIG_SPL_TINY_MEMSET is not set  # CONFIG_BITREVERSE is not set  # CONFIG_TRACE is not set @@ -2238,6 +2303,7 @@ CONFIG_MD5=y  # CONFIG_SPL_MD5 is not set  CONFIG_CRC8=y  # CONFIG_SPL_CRC8 is not set +# CONFIG_SPL_CRC16 is not set  CONFIG_CRC32=y  # @@ -2262,7 +2328,7 @@ CONFIG_ERRNO_STR=y  # CONFIG_HEXDUMP is not set  CONFIG_GETOPT=y  CONFIG_OF_LIBFDT=y -CONFIG_OF_LIBFDT_ASSUME_MASK=0 +CONFIG_OF_LIBFDT_ASSUME_MASK=0x0  CONFIG_SYS_FDT_PAD=0x3000  CONFIG_SPL_OF_LIBFDT=y  CONFIG_SPL_OF_LIBFDT_ASSUME_MASK=0xff @@ -2273,13 +2339,15 @@ CONFIG_SPL_OF_LIBFDT_ASSUME_MASK=0xff  CONFIG_GENERATE_SMBIOS_TABLE=y  # CONFIG_LIB_RATIONAL is not set  # CONFIG_SPL_LIB_RATIONAL is not set +CONFIG_SMBIOS=y  # CONFIG_SMBIOS_PARSER is not set  CONFIG_EFI_LOADER=y -CONFIG_CMD_BOOTEFI_BOOTMGR=y +CONFIG_EFI_BINARY_EXEC=y +CONFIG_EFI_BOOTMGR=y  # CONFIG_EFI_VARIABLE_FILE_STORE is not set  CONFIG_EFI_VARIABLE_NO_STORE=y  # CONFIG_EFI_VARIABLES_PRESEED is not set -CONFIG_EFI_VAR_BUF_SIZE=65536 +CONFIG_EFI_VAR_BUF_SIZE=131072  # CONFIG_EFI_SCROLL_ON_CLEAR_SCREEN is not set  # CONFIG_EFI_RUNTIME_UPDATE_CAPSULE is not set  # CONFIG_EFI_CAPSULE_ON_DISK is not set @@ -2297,6 +2365,7 @@ CONFIG_EFI_RNG_PROTOCOL=y  CONFIG_EFI_LOAD_FILE2_INITRD=y  CONFIG_EFI_ECPT=y  CONFIG_EFI_EBBR_2_1_CONFORMANCE=y +# CONFIG_EFI_HTTP_BOOT is not set  # CONFIG_OPTEE_LIB is not set  # CONFIG_OPTEE_IMAGE is not set  # CONFIG_BOOTM_OPTEE is not set @@ -2308,15 +2377,11 @@ CONFIG_LMB_MAX_REGIONS=16  # CONFIG_PHANDLE_CHECK_SEQ is not set  # -# FWU Multi Bank Updates -# -# CONFIG_POST is not set - -# -# Unit tests +# Testing  #  # CONFIG_UNIT_TEST is not set  # CONFIG_SPL_UNIT_TEST is not set +# CONFIG_POST is not set  #  # Tools options @@ -2324,6 +2389,7 @@ CONFIG_LMB_MAX_REGIONS=16  CONFIG_MKIMAGE_DTC_PATH="dtc"  CONFIG_TOOLS_CRC32=y  CONFIG_TOOLS_LIBCRYPTO=y +CONFIG_TOOLS_KWBIMAGE=y  CONFIG_TOOLS_FIT=y  CONFIG_TOOLS_FIT_FULL_CHECK=y  CONFIG_TOOLS_FIT_PRINT=y diff --git a/config/u-boot/qemu_arm64_12mb/config/default b/config/u-boot/qemu_arm64_12mb/config/default index 83c90261..65c6e684 100644 --- a/config/u-boot/qemu_arm64_12mb/config/default +++ b/config/u-boot/qemu_arm64_12mb/config/default @@ -1,13 +1,14 @@  #  # Automatically generated file; DO NOT EDIT. -# U-Boot 2023.10 Configuration +# U-Boot 2024.07 Configuration  #  # -# Compiler: gcc (Debian 13.2.0-5) 13.2.0 +# Compiler: gcc (Debian 13.3.0-2) 13.3.0  #  CONFIG_CREATE_ARCH_SYMLINK=y  CONFIG_SYS_CACHE_SHIFT_6=y +CONFIG_64BIT=y  CONFIG_SYS_CACHELINE_SIZE=64  CONFIG_LINKER_LIST_ALIGN=8  # CONFIG_ARC is not set @@ -45,6 +46,7 @@ CONFIG_COUNTER_FREQUENCY=0  CONFIG_POSITION_INDEPENDENT=y  # CONFIG_INIT_SP_RELATIVE is not set  # CONFIG_GIC_V3_ITS is not set +# CONFIG_GICV3_SUPPORT_GIC600 is not set  CONFIG_STATIC_RELA=y  CONFIG_DMA_ADDR_T_64BIT=y  CONFIG_ARM_ASM_UNIFIED=y @@ -71,13 +73,11 @@ CONFIG_ARM64_SUPPORT_AARCH32=y  # CONFIG_ARCH_KIRKWOOD is not set  # CONFIG_ARCH_MVEBU is not set  # CONFIG_ARCH_ORION5X is not set -# CONFIG_TARGET_STV0991 is not set  # CONFIG_ARCH_BCM283X is not set  # CONFIG_ARCH_BCMSTB is not set  # CONFIG_ARCH_BCMBCA is not set  # CONFIG_TARGET_VEXPRESS_CA9X4 is not set  # CONFIG_TARGET_BCMNS is not set -# CONFIG_TARGET_BCMNS2 is not set  # CONFIG_TARGET_BCMNS3 is not set  # CONFIG_ARCH_EXYNOS is not set  # CONFIG_ARCH_S5PC1XX is not set @@ -107,7 +107,7 @@ CONFIG_ARM64_SUPPORT_AARCH32=y  # CONFIG_ARCH_APPLE is not set  # CONFIG_ARCH_OWL is not set  CONFIG_ARCH_QEMU=y -# CONFIG_ARCH_RMOBILE is not set +# CONFIG_ARCH_RENESAS is not set  # CONFIG_ARCH_SNAPDRAGON is not set  # CONFIG_ARCH_SOCFPGA is not set  # CONFIG_ARCH_SUNXI is not set @@ -166,6 +166,7 @@ CONFIG_ARCH_QEMU=y  # CONFIG_ARCH_ASPEED is not set  # CONFIG_TARGET_DURIAN is not set  # CONFIG_TARGET_POMELO is not set +# CONFIG_TARGET_PE2201 is not set  # CONFIG_TARGET_PRESIDIO_ASIC is not set  # CONFIG_TARGET_XENGUEST_ARM64 is not set  # CONFIG_ARCH_GXP is not set @@ -190,7 +191,7 @@ CONFIG_TARGET_QEMU_ARM_64BIT=y  CONFIG_ERR_PTR_OFFSET=0x0  CONFIG_PRE_CON_BUF_ADDR=0x40100000  CONFIG_PRE_CON_BUF_SZ=4096 -CONFIG_BOOTSTAGE_STASH_ADDR=0 +CONFIG_BOOTSTAGE_STASH_ADDR=0x0  CONFIG_DEBUG_UART_BASE=0x9000000  CONFIG_DEBUG_UART_CLOCK=0  # CONFIG_DEBUG_UART_BOARD_INIT is not set @@ -247,7 +248,7 @@ CONFIG_AHCI=y  CONFIG_LOCALVERSION=""  CONFIG_LOCALVERSION_AUTO=y  CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=130200 +CONFIG_GCC_VERSION=130300  CONFIG_CLANG_VERSION=0  CONFIG_CC_OPTIMIZE_FOR_SIZE=y  # CONFIG_CC_OPTIMIZE_FOR_SPEED is not set @@ -276,6 +277,12 @@ CONFIG_STACK_SIZE=0x1000000  CONFIG_SYS_SRAM_BASE=0x0  CONFIG_SYS_SRAM_SIZE=0x0  # CONFIG_MP is not set +CONFIG_HAVE_TEXT_BASE=y +# CONFIG_HAVE_SYS_UBOOT_START is not set +CONFIG_SYS_UBOOT_START=0x50000000 +CONFIG_HAVE_SYS_MONITOR_BASE=y +CONFIG_SYS_MONITOR_BASE=0x50000000 +# CONFIG_DYNAMIC_SYS_CLK_FREQ is not set  # CONFIG_API is not set  # @@ -286,8 +293,8 @@ CONFIG_SYS_SRAM_SIZE=0x0  # Boot images  #  # CONFIG_ANDROID_BOOT_IMAGE is not set -CONFIG_FIT=y  CONFIG_TIMESTAMP=y +CONFIG_FIT=y  CONFIG_FIT_EXTERNAL_OFFSET=0x0  CONFIG_FIT_FULL_CHECK=y  CONFIG_FIT_SIGNATURE=y @@ -299,15 +306,19 @@ CONFIG_FIT_BEST_MATCH=y  CONFIG_FIT_PRINT=y  # CONFIG_SPL_LOAD_FIT_FULL is not set  CONFIG_PXE_UTILS=y +CONFIG_BOOT_DEFAULTS_FEATURES=y +CONFIG_BOOT_DEFAULTS_CMDS=y  CONFIG_BOOT_DEFAULTS=y  CONFIG_BOOTSTD=y  CONFIG_BOOTSTD_FULL=y  CONFIG_BOOTSTD_DEFAULTS=y  CONFIG_BOOTSTD_BOOTCOMMAND=y  CONFIG_BOOTMETH_GLOBAL=y +# CONFIG_BOOTMETH_CROS is not set  CONFIG_BOOTMETH_EXTLINUX=y  CONFIG_BOOTMETH_EXTLINUX_PXE=y  CONFIG_BOOTMETH_EFILOADER=y +CONFIG_BOOTMETH_EFI_BOOTMGR=y  CONFIG_BOOTMETH_VBE=y  CONFIG_BOOTMETH_DISTRO=y  CONFIG_BOOTMETH_VBE_REQUEST=y @@ -316,15 +327,9 @@ CONFIG_BOOTMETH_VBE_SIMPLE_OS=y  CONFIG_EXPO=y  CONFIG_BOOTMETH_SCRIPT=y  CONFIG_LEGACY_IMAGE_FORMAT=y +# CONFIG_MEASURED_BOOT is not set +CONFIG_SYS_BOOTM_LEN=0x4000000  CONFIG_SUPPORT_RAW_INITRD=y -# CONFIG_OF_BOARD_SETUP is not set -# CONFIG_OF_SYSTEM_SETUP is not set -# CONFIG_OF_STDOUT_VIA_ALIAS is not set -CONFIG_HAVE_TEXT_BASE=y -CONFIG_HAVE_SYS_MONITOR_BASE=y -CONFIG_SYS_MONITOR_BASE=0x50000000 -# CONFIG_DYNAMIC_SYS_CLK_FREQ is not set -CONFIG_ARCH_FIXUP_FDT_MEMORY=y  # CONFIG_CHROMEOS is not set  # CONFIG_CHROMEOS_VBOOT is not set  # CONFIG_RAMBOOT_PBL is not set @@ -362,6 +367,17 @@ CONFIG_BOOTDELAY=2  # Image support  #  # CONFIG_IMAGE_PRE_LOAD is not set + +# +# Devicetree fixup +# +# CONFIG_OF_ENV_SETUP is not set +# CONFIG_OF_BOARD_SETUP is not set +# CONFIG_OF_SYSTEM_SETUP is not set +# CONFIG_OF_STDOUT_VIA_ALIAS is not set +# CONFIG_FDT_FIXUP_PARTITIONS is not set +# CONFIG_FDT_SIMPLEFB is not set +CONFIG_ARCH_FIXUP_FDT_MEMORY=y  # CONFIG_USE_BOOTARGS is not set  # CONFIG_BOOTARGS_SUBST is not set  CONFIG_USE_BOOTCOMMAND=y @@ -383,6 +399,8 @@ CONFIG_DEFAULT_FDT_FILE=""  #  CONFIG_MENU=y  # CONFIG_CONSOLE_RECORD is not set +CONFIG_SYS_CBSIZE=1024 +CONFIG_SYS_PBSIZE=1044  # CONFIG_DISABLE_CONSOLE is not set  CONFIG_LOGLEVEL=4  # CONFIG_SILENT_CONSOLE is not set @@ -390,6 +408,7 @@ CONFIG_LOGLEVEL=4  # CONFIG_TPL_SILENT_CONSOLE is not set  CONFIG_PRE_CONSOLE_BUFFER=y  CONFIG_CONSOLE_FLUSH_SUPPORT=y +# CONFIG_CONSOLE_FLUSH_ON_NEWLINE is not set  CONFIG_CONSOLE_MUX=y  CONFIG_SYS_CONSOLE_IS_IN_ENV=y  # CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE is not set @@ -426,7 +445,7 @@ CONFIG_EVENT_DYNAMIC=y  CONFIG_BOARD_LATE_INIT=y  # CONFIG_CLOCKS is not set  # CONFIG_HWCONFIG is not set -# CONFIG_LAST_STAGE_INIT is not set +CONFIG_LAST_STAGE_INIT=y  # CONFIG_MISC_INIT_R is not set  # CONFIG_SYS_MALLOC_BOOTPARAMS is not set  # CONFIG_ID_EEPROM is not set @@ -455,23 +474,21 @@ CONFIG_UPDATE_LOAD_ADDR=0x100000  #  # CONFIG_BLOBLIST is not set  CONFIG_IMAGE_SIGN_INFO=y -# CONFIG_FDT_SIMPLEFB is not set -# CONFIG_BMP is not set +CONFIG_CMDLINE=y +CONFIG_HUSH_PARSER=y  # -# Command line interface +# Hush flavor to use  # -CONFIG_CMDLINE=y -CONFIG_HUSH_PARSER=y +CONFIG_HUSH_OLD_PARSER=y +# CONFIG_HUSH_MODERN_PARSER is not set  CONFIG_CMDLINE_EDITING=y  # CONFIG_CMDLINE_PS_SUPPORT is not set  CONFIG_AUTO_COMPLETE=y  CONFIG_SYS_LONGHELP=y  CONFIG_SYS_PROMPT="=> "  CONFIG_SYS_PROMPT_HUSH_PS2="> " -CONFIG_SYS_MAXARGS=16 -CONFIG_SYS_CBSIZE=512 -CONFIG_SYS_PBSIZE=532 +CONFIG_SYS_MAXARGS=64  CONFIG_SYS_XTRACE=y  # @@ -485,8 +502,10 @@ CONFIG_CMD_BDI=y  # CONFIG_CMD_BDINFO_EXTRA is not set  # CONFIG_CMD_CONFIG is not set  CONFIG_CMD_CONSOLE=y +# CONFIG_CMD_HISTORY is not set  # CONFIG_CMD_LICENSE is not set  # CONFIG_CMD_PMC is not set +CONFIG_CMD_SMBIOS=y  #  # Boot commands @@ -508,23 +527,23 @@ CONFIG_BOOTM_PLAN9=y  CONFIG_BOOTM_RTEMS=y  CONFIG_CMD_VBE=y  CONFIG_BOOTM_VXWORKS=y -CONFIG_SYS_BOOTM_LEN=0x4000000  CONFIG_CMD_BOOTEFI=y +CONFIG_CMD_BOOTEFI_BINARY=y +CONFIG_CMD_BOOTEFI_BOOTMGR=y  CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y  CONFIG_CMD_BOOTEFI_HELLO=y  CONFIG_CMD_BOOTEFI_SELFTEST=y  # CONFIG_CMD_BOOTMENU is not set  # CONFIG_CMD_ADTIMG is not set  CONFIG_CMD_ELF=y +# CONFIG_CMD_ELF_FDT_SETUP is not set  CONFIG_CMD_FDT=y  CONFIG_CMD_GO=y  CONFIG_CMD_RUN=y  CONFIG_CMD_IMI=y  # CONFIG_CMD_IMLS is not set  CONFIG_CMD_XIMG=y -# CONFIG_CMD_XXD is not set -# CONFIG_CMD_THOR_DOWNLOAD is not set -# CONFIG_CMD_ZBOOT is not set +CONFIG_SYS_XIMG_LEN=0x800000  #  # Environment commands @@ -549,10 +568,8 @@ CONFIG_CMD_NVEDIT_EFI=y  # Memory commands  #  # CONFIG_CMD_BINOP is not set -# CONFIG_CMD_BLOBLIST is not set  CONFIG_CMD_CRC32=y  # CONFIG_CRC32_VERIFY is not set -# CONFIG_CMD_EEPROM is not set  # CONFIG_LOOPW is not set  # CONFIG_CMD_MD5SUM is not set  # CONFIG_CMD_MEMINFO is not set @@ -576,6 +593,7 @@ CONFIG_CMD_UNZIP=y  # Device access commands  #  # CONFIG_CMD_ARMFLASH is not set +# CONFIG_CMD_BCB is not set  # CONFIG_CMD_BIND is not set  # CONFIG_CMD_CLK is not set  # CONFIG_CMD_DEMO is not set @@ -586,7 +604,6 @@ CONFIG_CMD_FLASH=y  # CONFIG_CMD_FUSE is not set  # CONFIG_CMD_GPIO is not set  # CONFIG_CMD_GPT is not set -# CONFIG_RANDOM_UUID is not set  # CONFIG_CMD_IDE is not set  # CONFIG_CMD_IO is not set  # CONFIG_CMD_IOTRACE is not set @@ -602,6 +619,7 @@ CONFIG_CMD_LOADXY_TIMEOUT=90  # CONFIG_CMD_MBR is not set  # CONFIG_CMD_CLONE is not set  CONFIG_CMD_MTD=y +# CONFIG_CMD_MTD_OTP is not set  CONFIG_CMD_NVME=y  # CONFIG_CMD_ONENAND is not set  # CONFIG_CMD_OSD is not set @@ -617,6 +635,7 @@ CONFIG_CMD_SCSI=y  # CONFIG_CMD_UNIVERSE is not set  CONFIG_CMD_USB=y  # CONFIG_CMD_USB_SDP is not set +# CONFIG_CMD_RKMTD is not set  CONFIG_CMD_VIRTIO=y  # CONFIG_CMD_WRITE is not set @@ -629,6 +648,7 @@ CONFIG_CMD_ITEST=y  CONFIG_CMD_SOURCE=y  CONFIG_CMD_SETEXPR=y  # CONFIG_CMD_SETEXPR_FMT is not set +# CONFIG_CMD_XXD is not set  #  # Android support commands @@ -651,6 +671,7 @@ CONFIG_BOOTP_SUBNETMASK=y  # CONFIG_CMD_PCAP is not set  CONFIG_BOOTP_PXE=y  CONFIG_BOOTP_PXE_CLIENTARCH=0x16 +# CONFIG_BOOTP_PXE_DHCP_OPTION is not set  CONFIG_BOOTP_VCI_STRING="U-Boot.armv8"  CONFIG_CMD_TFTPBOOT=y  # CONFIG_CMD_TFTPPUT is not set @@ -704,7 +725,6 @@ CONFIG_CMD_VIDCONSOLE=y  #  # TI specific command line interface  # -# CONFIG_CMD_DDR3 is not set  #  # Power commands @@ -743,7 +763,6 @@ CONFIG_CMD_FS_GENERIC=y  CONFIG_CMD_MTDPARTS=y  # CONFIG_CMD_MTDPARTS_SPREAD is not set  # CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES is not set -# CONFIG_CMD_REISER is not set  # CONFIG_CMD_ZFS is not set  # @@ -775,6 +794,7 @@ CONFIG_SUPPORT_OF_CONTROL=y  CONFIG_OF_CONTROL=y  CONFIG_OF_REAL=y  # CONFIG_OF_LIVE is not set +# CONFIG_OF_UPSTREAM is not set  CONFIG_OF_SEPARATE=y  # CONFIG_OF_EMBED is not set  CONFIG_OF_BOARD=y @@ -854,7 +874,7 @@ CONFIG_SYS_RX_ETH_BUFFER=4  # Generic Driver Options  #  CONFIG_DM=y -CONFIG_DM_WARN=y +# CONFIG_DM_WARN is not set  # CONFIG_DM_DEBUG is not set  # CONFIG_DM_STATS is not set  CONFIG_DM_DEVICE_REMOVE=y @@ -872,11 +892,6 @@ CONFIG_DM_DEV_READ_INLINE=y  # CONFIG_OFNODE_MULTI_TREE is not set  # CONFIG_BOUNCE_BUFFER is not set  # CONFIG_ADC is not set -# CONFIG_ADC_EXYNOS is not set -# CONFIG_ADC_SANDBOX is not set -# CONFIG_SARADC_MESON is not set -# CONFIG_SARADC_ROCKCHIP is not set -# CONFIG_ADC_IMX93 is not set  # CONFIG_SATA is not set  CONFIG_LIBATA=y  CONFIG_SCSI_AHCI=y @@ -901,6 +916,7 @@ CONFIG_BLOCK_CACHE=y  # CONFIG_IDE is not set  # CONFIG_LBA48 is not set  # CONFIG_SYS_64BIT_LBA is not set +# CONFIG_RKMTD is not set  # CONFIG_BOOTCOUNT_LIMIT is not set  # @@ -913,9 +929,10 @@ CONFIG_BLOCK_CACHE=y  #  # CONFIG_CACHE is not set  # CONFIG_L2X0_CACHE is not set -# CONFIG_V5L2_CACHE is not set +# CONFIG_ANDES_L2_CACHE is not set  # CONFIG_NCORE_CACHE is not set  # CONFIG_SIFIVE_CCACHE is not set +# CONFIG_SIFIVE_PL2 is not set  #  # Clock @@ -955,11 +972,11 @@ CONFIG_DFU_TFTP=y  # CONFIG_DFU_TIMEOUT is not set  CONFIG_DFU_MTD=y  CONFIG_DFU_RAM=y -# CONFIG_DFU_SF is not set  # CONFIG_DFU_VIRT is not set  CONFIG_SET_DFU_ALT_INFO=y  CONFIG_SYS_DFU_DATA_BUF_SIZE=0x800000  CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000 +CONFIG_DFU_NAME_MAX_SIZE=32  #  # DMA Support @@ -1082,6 +1099,7 @@ CONFIG_DM_KEYBOARD=y  # CONFIG_WINBOND_W83627 is not set  CONFIG_QFW=y  CONFIG_QFW_MMIO=y +CONFIG_QFW_SMBIOS=y  # CONFIG_FS_LOADER is not set  # @@ -1177,7 +1195,6 @@ CONFIG_E1000=y  # CONFIG_FTMAC100 is not set  # CONFIG_FTGMAC100 is not set  # CONFIG_MCFFEC is not set -# CONFIG_FSLDMAFEC is not set  # CONFIG_KS8851_MLL is not set  # CONFIG_LITEETH is not set  # CONFIG_MACB is not set @@ -1206,6 +1223,7 @@ CONFIG_E1000=y  # CONFIG_SYS_DPAA_QBMAN is not set  # CONFIG_TSEC_ENET is not set  # CONFIG_MEDIATEK_ETH is not set +# CONFIG_HIFEMAC_ETH is not set  # CONFIG_HIGMACV300_ETH is not set  CONFIG_NVME=y  # CONFIG_NVME_APPLE is not set @@ -1219,6 +1237,7 @@ CONFIG_PCI_ENHANCED_ALLOCATION=y  # CONFIG_PCI_ARID is not set  CONFIG_PCIE_ECAM_GENERIC=y  # CONFIG_PCIE_ECAM_SYNQUACER is not set +# CONFIG_PCI_FTPCI100 is not set  # CONFIG_PCI_PHYTIUM is not set  # CONFIG_PCIE_FSL is not set  # CONFIG_PCI_MPC85XX is not set @@ -1253,6 +1272,7 @@ CONFIG_PCIE_ECAM_GENERIC=y  # Pin controllers  #  # CONFIG_PINCTRL is not set +# CONFIG_PINCTRL_TEGRA is not set  CONFIG_POWER=y  # CONFIG_POWER_LEGACY is not set  # CONFIG_ACPI_PMC is not set @@ -1282,6 +1302,7 @@ CONFIG_POWER=y  #  # Remote Processor drivers  # +CONFIG_REMOTEPROC_MAX_FW_SIZE=0x10000  #  # Reset Controller Support @@ -1292,6 +1313,7 @@ CONFIG_DM_RNG=y  # CONFIG_RNG_NPCM is not set  # CONFIG_RNG_IPROC200 is not set  # CONFIG_RNG_SMCCC_TRNG is not set +# CONFIG_RNG_ARM_RNDR is not set  CONFIG_TPM_RNG=y  # @@ -1305,6 +1327,7 @@ CONFIG_DM_RTC=y  # CONFIG_RTC_DS1338 is not set  # CONFIG_RTC_DS3231 is not set  # CONFIG_RTC_EMULATION is not set +# CONFIG_RTC_GOLDFISH is not set  # CONFIG_RTC_ISL1208 is not set  # CONFIG_RTC_PCF8563 is not set  # CONFIG_RTC_PT7C4338 is not set @@ -1321,9 +1344,9 @@ CONFIG_RTC_PL031=y  # CONFIG_RTC_STM32 is not set  # CONFIG_RTC_ABX80X is not set  CONFIG_SCSI=y -CONFIG_DM_SCSI=y  CONFIG_SERIAL=y  CONFIG_BAUDRATE=115200 +# CONFIG_DEFAULT_ENV_IS_RW is not set  CONFIG_REQUIRE_SERIAL_CONSOLE=y  # CONFIG_SPECIFY_CONSOLE_INDEX is not set  CONFIG_SERIAL_PRESENT=y @@ -1354,16 +1377,20 @@ CONFIG_DEBUG_UART_SHIFT=2  # CONFIG_SYS_NS16550 is not set  CONFIG_PL01X_SERIAL=y  # CONFIG_ROCKCHIP_SERIAL is not set +# CONFIG_SEMIHOSTING_SERIAL is not set  # CONFIG_XILINX_UARTLITE is not set  # CONFIG_MSM_SERIAL is not set  # CONFIG_MSM_GENI_SERIAL is not set  # CONFIG_MXS_AUART_SERIAL is not set  # CONFIG_OMAP_SERIAL is not set +# CONFIG_HTIF_CONSOLE is not set  # CONFIG_SIFIVE_SERIAL is not set  # CONFIG_ZYNQ_SERIAL is not set  # CONFIG_MTK_SERIAL is not set  # CONFIG_MT7620_SERIAL is not set  # CONFIG_NPCM_SERIAL is not set +# CONFIG_SM is not set +# CONFIG_MESON_SM is not set  # CONFIG_SMEM is not set  # @@ -1376,6 +1403,7 @@ CONFIG_PL01X_SERIAL=y  # SOC (System On Chip) specific Drivers  #  # CONFIG_SOC_DEVICE is not set +# CONFIG_SOC_SAMSUNG is not set  # CONFIG_SOC_TI is not set  # CONFIG_SPI is not set @@ -1391,6 +1419,7 @@ CONFIG_PL01X_SERIAL=y  CONFIG_SYSRESET=y  CONFIG_SYSRESET_CMD_RESET=y  CONFIG_SYSRESET_CMD_POWEROFF=y +# CONFIG_SYSRESET_CV1800B is not set  CONFIG_SYSRESET_PSCI=y  # CONFIG_SYSRESET_SYSCON is not set  # CONFIG_SYSRESET_WATCHDOG is not set @@ -1527,9 +1556,11 @@ CONFIG_VIDEO_BOCHS_SIZE_Y=1024  # CONFIG_VIDEO_LCD_ENDEAVORU is not set  # CONFIG_VIDEO_LCD_HIMAX_HX8394 is not set  # CONFIG_VIDEO_LCD_ORISETECH_OTM8009A is not set +# CONFIG_VIDEO_LCD_LG_LD070WX3 is not set  # CONFIG_VIDEO_LCD_RAYDIUM_RM68200 is not set  # CONFIG_VIDEO_LCD_RENESAS_R61307 is not set  # CONFIG_VIDEO_LCD_RENESAS_R69328 is not set +# CONFIG_VIDEO_LCD_SAMSUNG_LTL106HL02 is not set  # CONFIG_VIDEO_LCD_SSD2828 is not set  # CONFIG_VIDEO_LCD_TDO_TL070WSH30 is not set  # CONFIG_VIDEO_LCD_HITACHI_TX18D42VM is not set @@ -1557,6 +1588,7 @@ CONFIG_CONSOLE_SCROLL_LINES=1  # CONFIG_OSD is not set  # CONFIG_VIDEO_REMOVE is not set  # CONFIG_SPLASH_SCREEN is not set +# CONFIG_BMP is not set  CONFIG_VIDEO_LOGO_MAX_SIZE=0x100000  CONFIG_VIDEO_BMP_RLE8=y  # CONFIG_BMP_16BPP is not set @@ -1623,7 +1655,9 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=65536  CONFIG_CHARSET=y  # CONFIG_DYNAMIC_CRC_TABLE is not set  CONFIG_LIB_UUID=y -# CONFIG_SEMIHOSTING is not set +# CONFIG_RANDOM_UUID is not set +CONFIG_SEMIHOSTING=y +CONFIG_SEMIHOSTING_FALLBACK=y  CONFIG_PRINTF=y  CONFIG_SPRINTF=y  CONFIG_STRTO=y @@ -1685,22 +1719,24 @@ CONFIG_VPL_LZMA=y  CONFIG_HEXDUMP=y  # CONFIG_GETOPT is not set  CONFIG_OF_LIBFDT=y -CONFIG_OF_LIBFDT_ASSUME_MASK=0 +CONFIG_OF_LIBFDT_ASSUME_MASK=0x0  CONFIG_SYS_FDT_PAD=0x3000 -# CONFIG_FDT_FIXUP_PARTITIONS is not set  #  # System tables  #  CONFIG_GENERATE_SMBIOS_TABLE=y  # CONFIG_LIB_RATIONAL is not set +CONFIG_SMBIOS=y  CONFIG_SMBIOS_PARSER=y  CONFIG_EFI_LOADER=y -CONFIG_CMD_BOOTEFI_BOOTMGR=y +CONFIG_EFI_BINARY_EXEC=y +CONFIG_EFI_BOOTMGR=y  CONFIG_EFI_VARIABLE_FILE_STORE=y +# CONFIG_EFI_RT_VOLATILE_STORE is not set  # CONFIG_EFI_VARIABLE_NO_STORE is not set  # CONFIG_EFI_VARIABLES_PRESEED is not set -CONFIG_EFI_VAR_BUF_SIZE=65536 +CONFIG_EFI_VAR_BUF_SIZE=131072  CONFIG_EFI_GET_TIME=y  CONFIG_EFI_SET_TIME=y  # CONFIG_EFI_SCROLL_ON_CLEAR_SCREEN is not set @@ -1724,6 +1760,7 @@ CONFIG_EFI_LOAD_FILE2_INITRD=y  # CONFIG_EFI_SECURE_BOOT is not set  CONFIG_EFI_ECPT=y  CONFIG_EFI_EBBR_2_1_CONFORMANCE=y +# CONFIG_EFI_HTTP_BOOT is not set  # CONFIG_OPTEE_LIB is not set  # CONFIG_OPTEE_IMAGE is not set  # CONFIG_BOOTM_OPTEE is not set @@ -1736,14 +1773,10 @@ CONFIG_LMB_MAX_REGIONS=16  # CONFIG_PHANDLE_CHECK_SEQ is not set  # -# FWU Multi Bank Updates -# -# CONFIG_POST is not set - -# -# Unit tests +# Testing  #  # CONFIG_UNIT_TEST is not set +# CONFIG_POST is not set  #  # Tools options @@ -1751,6 +1784,7 @@ CONFIG_LMB_MAX_REGIONS=16  CONFIG_MKIMAGE_DTC_PATH="dtc"  CONFIG_TOOLS_CRC32=y  CONFIG_TOOLS_LIBCRYPTO=y +CONFIG_TOOLS_KWBIMAGE=y  CONFIG_TOOLS_FIT=y  CONFIG_TOOLS_FIT_FULL_CHECK=y  CONFIG_TOOLS_FIT_PRINT=y diff --git a/include/git.sh b/include/git.sh index b0acd7dc..f8441f33 100755..100644 --- a/include/git.sh +++ b/include/git.sh @@ -2,8 +2,8 @@  # Copyright (c) 2020-2021,2023-2024 Leah Rowe <leah@libreboot.org>  # Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> -eval `setvars "" loc url bkup_url subfile mdir subhash subrepo subrepo_bkup \ -    depend subfile_bkup` +eval `setvars "" loc url bkup_url subfile subhash subrepo subrepo_bkup \ +    depend subfile_bkup repofail`  fetch_targets()  { @@ -12,8 +12,8 @@ fetch_targets()  	e "src/$project/$tree" d && return 0  	printf "Creating %s tree %s\n" "$project" "$tree" -	git_prep "$loc" "$loc" "$PWD/$cfgsdir/$tree/patches" \ -	    "${loc%/*}/$tree" u; nuke "$project/$tree" "$project/$tree" +	git_prep "$loc" "$loc" "$PWD/$configdir/$tree/patches" \ +	    "src/$project/$tree" u; nuke "$project/$tree" "$project/$tree"  }  fetch_project() @@ -37,7 +37,8 @@ fetch_project()  clone_project()  { -	loc="src/$project/$project" && singletree "$project" && loc="${loc%/*}" +	loc="$XBMK_CACHE/repo/$project" && singletree "$project" && \ +	    loc="src/$project"  	printf "Downloading project '%s' to '%s'\n" "$project" "$loc"  	e "$loc" d && return 0 @@ -61,17 +62,15 @@ git_prep()  	[ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \  	    [ "$xtree" != "$tree" ] && link_crossgcc "$_loc" -	[ "$XBMK_RELEASE" = "y" ] && [ "$_loc" != "src/$project/$project" ] \ -	    && rmgit "$tmpgit" +	[ "$XBMK_RELEASE" = "y" ] && \ +	    [ "$_loc" != "$XBMK_CACHE/repo/$project" ] && \ +		rmgit "$tmpgit"  	move_repo "$_loc"  }  prep_submodules()  { -	mdir="$PWD/config/submodule/$project" -	[ -n "$tree" ] && mdir="$mdir/$tree" -  	[ -f "$mdir/module.list" ] && while read -r msrcdir; do  		fetch_submodule "$msrcdir"  	done < "$mdir/module.list"; return 0 @@ -103,9 +102,28 @@ fetch_submodule()  tmpclone()  { -	git clone $1 "$3" || git clone $2 "$3" || $err "!clone $1 $2 $3 $4 $5" +	[ "$repofail" = "y" ] && \ +	    printf "Cached clone failed; trying online.\n" 1>&2 +	repofail="n" + +	[ $# -lt 6 ] || rm -Rf "$3" || $err "git retry: !rm $3 ($1)" +	repodir="$XBMK_CACHE/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3" +	mkdir -p "$XBMK_CACHE/repo" || $err "!rmdir $XBMK_CACHE/repo" +	if [ -d "$repodir" ] && [ $# -lt 6 ]; then +		git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \ +		    || sleep 3 || git -C "$repodir" pull || : +	else +		git clone $1 "$repodir" || git clone $2 "$repodir" || \ +		    $err "!clone $1 $2 $repodir $4 $5" +	fi +	( +	[ $# -gt 5 ] || git clone "$repodir" "$3" || $err "!clone $repodir $3"  	git -C "$3" reset --hard "$4" || $err "!reset $1 $2 $3 $4 $5"  	git_am_patches "$3" "$5" +	) || repofail="y" + +	[ "$repofail" = "y" ] && [ $# -lt 6 ] && tmpclone $@ retry +	[ "$repofail" = "y" ] && $err "!clone $1 $2 $3 $4 $5"; :  }  git_am_patches() diff --git a/include/lib.sh b/include/lib.sh index e6a998d2..2cd8c0d7 100755..100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -10,7 +10,6 @@ _ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0"  kbnotice="Insert a .gkb file from config/data/grub/keymap/ as keymap.gkb \  if you want a custom keymap in GRUB; use cbfstool from elf/cbfstool." -cbelfdir="elf/.coreboot_nopayload_DO_NOT_FLASH"  ifdtool="elf/ifdtool/default/ifdtool"  cbfstool="elf/cbfstool/default/cbfstool"  tmpgit="$PWD/tmp/gitclone" @@ -38,7 +37,7 @@ chkvars()  }  eval `setvars "" _nogit board xbmk_parent versiondate projectsite projectname \ -    aur_notice cfgsdir datadir version relname` +    aur_notice configdir datadir version relname`  for fv in projectname projectsite version versiondate; do  	eval "[ ! -f "$fv" ] || read -r $fv < \"$fv\" || :" @@ -89,6 +88,14 @@ if [ -z "${TMPDIR+x}" ]; then  	xbmk_parent="y"  fi +# XBMK_CACHE is a directory, for caching downloads and git repositories +[ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$PWD/cache" +[ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$PWD/cache" +[ -L "$XBMK_CACHE" ] && [ "$XBMK_CACHE" = "$PWD/cache" ] && \ +    $err "cachedir is default, $PWD/cache, but it exists and is a symlink" +[ -L "$XBMK_CACHE" ] && export XBMK_CACHE="$PWD/cache" +[ -f "$XBMK_CACHE" ] && $err "cachedir '$XBMK_CACHE' exists but it's a file" +  # if "y": a coreboot target won't be built if target.cfg says release="n"  # (this is used to exclude certain build targets from releases)  [ -z "${XBMK_RELEASE+x}" ] && export XBMK_RELEASE="n" @@ -181,18 +188,21 @@ singletree()  download()  { -	dl_fail="y" # 1 url, 2 url backup, 3 destination, 4 checksum -	vendor_checksum "$4" "$3" 2>/dev/null || dl_fail="n" +	cached="$XBMK_CACHE/file/$4" +	dl_fail="n" # 1 url, 2 url backup, 3 destination, 4 checksum +	vendor_checksum "$4" "$cached" 2>/dev/null && dl_fail="y"  	[ "$dl_fail" = "n" ] && e "$3" f && return 0 -	x_ mkdir -p "${3%/*}" && for url in "$1" "$2"; do +	mkdir -p "${3%/*}" "$XBMK_CACHE/file" || \ +	    $err "!mkdir '$3' '$XBMK_CACHE/file'" +	for url in "$1" "$2"; do  		[ "$dl_fail" = "n" ] && break  		[ -z "$url" ] && continue -		x_ rm -f "$3" -		curl --location --retry 3 -A "$_ua" "$url" -o "$3" || \ -		    wget --tries 3 -U "$_ua" "$url" -O "$3" || continue -		vendor_checksum "$4" "$3" || dl_fail="n" -	done; -	[ "$dl_fail" = "y" ] && $err "$1 $2 $3 $4: not downloaded"; return 0 +		rm -f "$cached" || $err "!rm -f '$cached'" +		curl --location --retry 3 -A "$_ua" "$url" -o "$cached" || \ +		    wget --tries 3 -U "$_ua" "$url" -O "$cached" || continue +		vendor_checksum "$4" "$cached" || dl_fail="n" +	done; [ "$dl_fail" = "y" ] && $err "$1 $2 $3 $4: not downloaded" +	[ "$cached" = "$3" ] || cp "$cached" "$3" || $err "!d cp $cached $3"; :  }  vendor_checksum() diff --git a/include/mrc.sh b/include/mrc.sh index 2e00d9f9..2e00d9f9 100755..100644 --- a/include/mrc.sh +++ b/include/mrc.sh diff --git a/include/rom.sh b/include/rom.sh new file mode 100644 index 00000000..ed3dddf2 --- /dev/null +++ b/include/rom.sh @@ -0,0 +1,152 @@ +#!/usr/bin/env sh +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (c) 2014-2016,2020-2021,2023-2024 Leah Rowe <leah@libreboot.org> +# Copyright (c) 2021-2022 Ferass El Hafidi <vitali64pmemail@protonmail.com> +# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> +# Copyright (c) 2022-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com> +# Copyright (c) 2023 Riku Viitanen <riku.viitanen@protonmail.com> + +mkserprog() +{ +	[ "$_f" = "-d" ] && return 0 # dry run +	basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR" + +	while read -r sertarget; do +		[ "$1" = "rp2040" ] && x_ cmake -DPICO_BOARD="$sertarget" \ +		    -DPICO_SDK_PATH="$picosdk" -B "$sersrc/build" "$sersrc" \ +		    && x_ cmake --build "$sersrc/build" +		[ "$1" = "stm32" ] && x_ make -C "$sersrc" \ +		    libopencm3-just-make BOARD=$sertarget && x_ make -C \ +		    "$sersrc" BOARD=$sertarget; x_ mkdir -p "bin/serprog_$1" +		x_ mv "$serx" "bin/serprog_$1/serprog_$sertarget.${serx##*.}" +	done < "$TMPDIR/ser" + +	[ "$XBMK_RELEASE" = "y" ] && mkrom_tarball "bin/serprog_$1"; return 0 +} + +mkpayload_grub() +{ +	eval `setvars "" grub_modules grub_install_modules` +	$dry eval `setcfg "$grubdata/module/$tree"` + +	$dry x_ rm -f "$srcdir/grub.elf" + +	$dry "$srcdir/grub-mkstandalone" --grub-mkimage="$srcdir/grub-mkimage" \ +	    -O i386-coreboot -o "$srcdir/grub.elf" -d "${srcdir}/grub-core/" \ +	    --fonts= --themes= --locales=  --modules="$grub_modules" \ +	    --install-modules="$grub_install_modules" \ +	    "/boot/grub/grub_default.cfg=${srcdir}/.config" \ +	    "/boot/grub/grub.cfg=$grubdata/memdisk.cfg" \ +	    "/background.png=$grubdata/background/background1280x800.png" || \ +	    $err "$tree: cannot build grub.elf"; return 0 +} + +mkvendorfiles() +{ +	check_coreboot_utils "$tree" +	printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \ +	    $err "!mk $srcdir .coreboot-version" +	[ -z "$mode" ] && [ "$target" != "$tree" ] && \ +	    x_ ./vendor download $target; return 0 +} + +check_coreboot_utils() +{ +	for util in cbfstool ifdtool; do +		[ "$badhash" = "n" ] || rm -f "elf/$util/$1/$util" || \ +		    $err "!rm badelf elf/$util/$1/$util" +		e "elf/$util/$1/$util" f && continue + +		utilelfdir="elf/$util/$1" +		utilsrcdir="src/coreboot/$1/util/$util" + +		utilmode="" && [ -n "$mode" ] && utilmode="clean" +		x_ make -C "$utilsrcdir" $utilmode -j$XBMK_THREADS $makeargs +		[ -z "$mode" ] && [ ! -f "$utilelfdir/$util" ] && \ +			x_ mkdir -p "$utilelfdir" && \ +			x_ cp "$utilsrcdir/$util" "elf/$util/$1" +		[ -z "$mode" ] || x_ rm -Rf "$utilelfdir"; continue +	done; return 0 +} + +mkcorebootbin() +{ +	[ "$target" = "$tree" ] && return 0 + +	tmprom="$srcdir/build/coreboot.rom" +	initmode="${defconfig##*/}"; displaymode="${initmode##*_}" +	initmode="${initmode%%_*}" +	[ -n "$displaymode" ] && displaymode="_$displaymode" +	cbfstool="elf/cbfstool/$tree/cbfstool" + +	[ -n "$uboot_config" ] || uboot_config="default" +	[ "$payload_uboot" = "y" ] || payload_seabios="y" +	[ "$payload_grub" = "y" ] && payload_seabios="y" +	[ "$payload_seabios" = "y" ] && [ "$payload_uboot" = "y" ] && \ +	    $dry $err "$target: U-Boot and SeaBIOS/GRUB are both enabled." + +	[ -z "$grub_scan_disk" ] && grub_scan_disk="nvme ahci ata" + +	[ -n "$grubtree" ] || grubtree="default" +	grubelf="elf/grub/$grubtree/payload/grub.elf" + +	[ "$payload_memtest" = "y" ] || payload_memtest="n" +	[ "$(uname -m)" = "x86_64" ] || payload_memtest="n" +	if grep "CONFIG_PAYLOAD_NONE=y" "$defconfig"; then +		[ "$payload_seabios" = "y" ] && pname="seabios" && \ +		    $dry add_seabios +		[ "$payload_uboot" = "y" ] && pname="uboot" && $dry add_uboot +	else +		pname="custom" # coreboot's build system added payloads +	fi +	newrom="bin/$target/${pname}_${target}_$initmode$displaymode.rom" +	$dry x_ mkdir -p "${newrom%/*}"; $dry x_ mv "$tmprom" "$newrom" + +	[ "$XBMK_RELEASE" = "y" ] || return 0 +	$dry mksha512sum "$newrom" "vendorhashes"; $dry ./vendor inject \ +	    -r "$newrom" -b "$target" -n nuke || $err "!nuke $newrom" +} + +add_seabios() +{ +	_seabioself="elf/seabios/default/$initmode/bios.bin.elf" + +	cbfs "$tmprom" "$_seabioself" "fallback/payload" +	x_ "$cbfstool" "$tmprom" add-int -i 3000 -n etc/ps2-keyboard-spinup + +	_z="2"; [ "$initmode" = "vgarom" ] && _z="0" +	x_ "$cbfstool" "$tmprom" add-int -i $_z -n etc/pci-optionrom-exec +	x_ "$cbfstool" "$tmprom" add-int -i 0 -n etc/optionroms-checksum +	[ "$initmode" = "libgfxinit" ] && \ +	    cbfs "$tmprom" "$seavgabiosrom" vgaroms/seavgabios.bin raw + +	[ "$payload_memtest" = "y" ] && cbfs "$tmprom" \ +	    "elf/memtest86plus/memtest.bin" img/memtest + +	[ "$payload_grub" = "y" ] && pname="seagrub" && add_grub; return 0 +} + +add_grub() +{ +	cbfs "$tmprom" "$grubelf" "img/grub2" +	printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \ +	    > "$TMPDIR/tmpcfg" || $err "$target: !insert scandisk" +	cbfs "$tmprom" "$TMPDIR/tmpcfg" scan.cfg raw +	cbfs "$tmprom" "$grubdata/bootorder" bootorder raw +} + +add_uboot() +{ +	ubdir="elf/u-boot/$target/$uboot_config" +	ubootelf="$ubdir/u-boot.elf" && [ ! -f "$ubootelf" ] && \ +	    ubootelf="$ubdir/u-boot" +	[ -f "$ubootelf" ] || $err "cb/$target: Can't find u-boot" + +	cbfs "$tmprom" "$ubootelf" "fallback/payload" +} + +mkcoreboottar() +{ +	[ "$target" = "$tree" ] && return 0; [ "$XBMK_RELEASE" = "y" ] && \ +	    [ "$release" != "n" ] && $dry mkrom_tarball "bin/$target"; return 0 +} diff --git a/include/vendor.sh b/include/vendor.sh index e282eedd..ace3f7ce 100755..100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -56,7 +56,7 @@ bootstrap()  	[ -d "${kbc1126_ec_dump%/*}" ] && x_ make -C "$cbdir/util/kbc1126"  	[ -n "$MRC_refcode_cbtree" ] && \  	    cbfstoolref="elf/cbfstool/$MRC_refcode_cbtree/cbfstool" && \ -	    x_ ./update trees -b coreboot utils $MRC_refcode_cbtree; return 0 +	    x_ ./update trees -d coreboot $MRC_refcode_cbtree; return 0  }  getfiles() @@ -78,11 +78,12 @@ getfiles()  fetch()  {  	dl_type="$1"; dl="$2"; dl_bkup="$3"; dlsum="$4"; _dest="${5##*../}" -	[ "$5" = "/dev/null" ] && return 0; _dl="$vendir/cache/$dlsum" +	[ "$5" = "/dev/null" ] && return 0; _dl="$XBMK_CACHE/file/$dlsum"  	download "$dl" "$dl_bkup" "$_dl" "$dlsum" -	x_ rm -Rf "${_dl}_extracted" +	rm -Rf "${_dl}_extracted" || \ +	    $err "!rm -Rf ${_ul}_extracted"  	e "$_dest" f && return 0  	mkdir -p "${_dest%/*}" || $err "mkdirs: !mkdir -p ${_dest%/*}" @@ -248,7 +249,8 @@ detect_board()  	path="$1"  	filename="$(basename "$path")"  	case "$filename" in -	grub_*) board="$(echo "$filename" | cut -d '_' -f2-3)" ;; +	grub_*|seagrub_*|custom_*) +		board="$(echo "$filename" | cut -d '_' -f2-3)" ;;  	seabios_withgrub_*)  		board="$(echo "$filename" | cut -d '_' -f3-4)" ;;  	*.tar.xz) @@ -275,7 +277,7 @@ readcfg()  	cbfstool="elf/cbfstool/$tree/cbfstool"  	ifdtool="elf/ifdtool/$tree/ifdtool" -	x_ ./update trees -b coreboot utils $tree +	x_ ./update trees -d coreboot $tree  }  patch_release_roms() diff --git a/script/roms b/script/roms deleted file mode 100755 index 8a2cc796..00000000 --- a/script/roms +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env sh -# SPDX-License-Identifier: GPL-3.0-or-later -# Copyright (c) 2014-2016,2020-2021,2023-2024 Leah Rowe <leah@libreboot.org> -# Copyright (c) 2021-2022 Ferass El Hafidi <vitali64pmemail@protonmail.com> -# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com> -# Copyright (c) 2022-2023 Alper Nebi Yasak <alpernebiyasak@gmail.com> -# Copyright (c) 2023 Riku Viitanen <riku.viitanen@protonmail.com> - -set -u -e - -. "include/lib.sh" - -tmprom="$TMPDIR/rom" - -seavgabiosrom="elf/seabios/default/libgfxinit/vgabios.bin" -cfgsdir="config/coreboot" -rp2040src="src/pico-serprog" -rp2040x="$rp2040src/build/pico_serprog.uf2" -picosdk="src/pico-sdk" -rp2040dir="$picosdk/src/boards/include/boards" -stm32src="src/stm32-vserprog" -stm32x="$stm32src/stm32-vserprog.hex" -stm32dir="$stm32src/boards" - -# Disable all payloads by default. -# target.cfg files have to specifically enable [a] payload(s) -pv="payload_uboot payload_seabios payload_memtest payload_grub" -v="romdir initmode displaymode targetdir tree release ubootelf" -v="$v board grub_scan_disk uboot_config grubtree grubelf tmpmv" -eval `setvars "n" $pv` -eval `setvars "" $v boards targets serdir ser` - -main() -{ -	while [ $# -gt 0 ]; do -		if [ "$1" = "serprog" ]; then -			[ $# -lt 2 ] && $err "serprog type not set" -			[ "$2" != "rp2040" ] && [ "$2" != "stm32" ] && \ -			    $err "invalid serprog type" -			eval "x_ ./update trees -f \"\${${2}src##*/}\"" -			ser="$2" && shift 2 && continue -		fi -		[ "$1$ser" = "list" ] && x_ ls -1 config/coreboot && return 0 -		[ "$1" = "all" ] && shift 1 && continue -		boards="$1 $boards"; shift 1 -	done - -	[ -n "$boards" ] || [ -n "$ser" ] || boards="$(ls -1 \ -	    config/coreboot)" || $err "can't list coreboot boards" - -	[ -n "$ser" ] && \ -	    eval "serlist \"\$${ser}dir\" > \"\$TMPDIR/ser\" || $err \"!ser\"" -	[ -n "$ser" ] && [ -z "$boards" ] && boards="$(cat "$TMPDIR/ser")" - -	for x in $boards; do -		[ -n "$ser" ] && mkserprogfw "$ser" "$x" -		[ -z "$ser" ] && [ -d "config/coreboot/$x/config" ] && \ -		    configure_target "$x" && build_roms && \ -		    [ -d "bin/$board" ] && targets="$targets, $x" && \ -		    [ "$XBMK_RELEASE" = "y" ] && mkrom_tarball "bin/$x" -	done - -	[ -n "$ser" ] && [ "$XBMK_RELEASE" = "y" ] && \ -	    mkrom_tarball "bin/serprog_$ser" && return 0 - -	[ -z "$ser" ] && [ -z "$targets" ] && $err "No images were compiled" -	[ -z "$ser" ] && printf "ROMs built in bin/ for: %s\n" "${targets#, }" -	[ -n "$ser" ] && printf "ROMs (serprog) built in bin/%s/\n" "$ser" -	printf "Please flash from bin/, NOT elf/ - ALSO:\n%s\n" "$kbnotice" -} - -mkserprogfw() -{ -	x_ mkdir -p "bin/serprog_$1" -	[ "$1" = "rp2040" ] && x_ cmake -DPICO_BOARD="$2" \ -	    -DPICO_SDK_PATH="$picosdk" -B "$rp2040src/build" "$rp2040src" && \ -	    x_ cmake --build "$rp2040src/build" -	[ "$1" = "stm32" ] && x_ make -C "$stm32src" libopencm3-just-make \ -	    BOARD=$2 && x_ make -C "$stm32src" BOARD=$2 -	eval "x_ mv \"\$${1}x\" \"bin/serprog_$1/serprog_$2.\${${1}x##*.}\"" -} - -serlist() -{ -	basename -a -s .h "$1/"*.h || $err "$1: can't list boards" -} - -configure_target() -{ -	eval `setvars "n" $pv` -	eval `setvars "" $v` - -	board="$1"; targetdir="$cfgsdir/$board"; romdir="bin/$board" - -	# Override the above defaults using target.cfg -	eval `setcfg "$targetdir/target.cfg"` - -	[ -z "$tree" ] && $err "$board: tree not defined" -	[ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1 -	[ "$board" = "$tree" ] && return 1 - -	x_ ./update trees -b coreboot $board - -	cbfstool="elf/cbfstool/$tree/cbfstool" -	x_ ./update trees -b coreboot utils $tree - -	[ -n "$uboot_config" ] || uboot_config="default" -	[ "$payload_uboot" = "y" ] || payload_seabios="y" -	[ "$payload_grub" = "y" ] && payload_seabios="y" -	[ "$payload_seabios" = "y" ] && [ "$payload_uboot" = "y" ] && \ -	    $err "$board: U-Boot and SeaBIOS/GRUB are both enabled." - -	[ -z "$grub_scan_disk" ] && grub_scan_disk="nvme ahci ata" - -	[ -n "$grubtree" ] || grubtree="default" -	grubelf="elf/grub/$grubtree/payload/grub.elf" - -	[ "$payload_memtest" = "y" ] || payload_memtest="n" -	[ "$(uname -m)" = "x86_64" ] || payload_memtest="n"; return 0 -} - -build_roms() -{ -	x_ rm -Rf "$romdir" - -	for cbcfg in "$targetdir/config/"*; do -		[ -f "$cbcfg" ] || continue; cn="${cbcfg##*/}"; dt="${cn#*_}" \ -		    && [ "$dt" = "$cn" ] && dt="txtmode"; displaymode="$dt" -		initmode="${cn%%_*}"; chkvars initmode displaymode -		e "$cbcfg" f not || add_payloads -	done; x_ rm -f "$tmprom" -} - -add_payloads() -{ -	cbuild="$cbelfdir/$board/${initmode}_$displaymode" -	[ "$initmode" = "normal" ] && cbuild="${cbuild%"_$displaymode"}" -	x_ cp "$cbuild/coreboot.rom" "$tmprom" - -	[ "$payload_seabios" = "y" ] && add_seabios_payload -	[ "$payload_uboot" = "y" ] || return 0 - -	# add u-boot payload -	x_ ./update trees -b u-boot $board -	ubdir="elf/u-boot/$board/$uboot_config"; ubootelf="$ubdir/u-boot.elf" \ -	    && [ ! -f "$ubootelf" ] && ubootelf="$ubdir/u-boot" -	[ -f "$ubootelf" ] || $err "$board: Can't find u-boot" - -	cbfs "$tmprom" "$ubootelf" "fallback/payload" -	cprom "$romdir/uboot_payload_${board}_${initmode}_$displaymode.rom" -} - -add_seabios_payload() -{ -	_seabioself="elf/seabios/default/$initmode/bios.bin.elf" -	x_ ./update trees -b seabios - -	pstr="seabios" && [ "$payload_grub" = "y" ] && pstr="seabios_withgrub" -	newrom="$romdir/${pstr}_${board}_$initmode.rom" -	[ "$initmode" = "normal" ] || newrom="${newrom%.rom}_$displaymode.rom" - -	cbfs "$tmprom" "$_seabioself" "fallback/payload" -	x_ "$cbfstool" "$tmprom" add-int -i 3000 -n etc/ps2-keyboard-spinup - -	z="2"; [ "$initmode" = "vgarom" ] && z="0" -	x_ "$cbfstool" "$tmprom" add-int -i $z -n etc/pci-optionrom-exec -	x_ "$cbfstool" "$tmprom" add-int -i 0 -n etc/optionroms-checksum -	[ "$initmode" = "libgfxinit" ] && cbfs "$tmprom" "$seavgabiosrom" \ -	    vgaroms/seavgabios.bin raw - -	if [ "$payload_grub" = "y" ]; then -		x_ ./update trees -b grub $grubtree -		cbfs "$tmprom" "$grubelf" "img/grub2" -		printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \ -		    > "$TMPDIR/tmpcfg" || $err "$board: !insert scandisk" -		cbfs "$tmprom" "$TMPDIR/tmpcfg" scan.cfg raw -	fi - -	[ "$payload_memtest" = "y" ] && x_ ./update trees -b memtest86plus && \ -	    cbfs "$tmprom" "elf/memtest86plus/memtest.bin" img/memtest - -	cprom "$newrom" && [ "$payload_grub" = "y" ] && \ -	    cbfs "$tmprom" "$grubdata/bootorder" bootorder raw && \ -	    cprom "${newrom%.rom}_grubfirst.rom"; return 0 -} - -cprom() -{ -	x_ mkdir -p "${1%/*}"; x_ cp "$tmprom" "$1" -	[ "$XBMK_RELEASE" = "y" ] && mksha512sum "$1" "vendorhashes" && \ -	    x_ ./vendor inject -r "$1" -b "$board" -n nuke; return 0 -} - -main $@ diff --git a/script/trees b/script/trees index 4ab0d406..ce6da422 100755 --- a/script/trees +++ b/script/trees @@ -9,17 +9,18 @@ set -u -e  . "include/lib.sh"  . "include/git.sh" -cbmakeargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" -eval `setvars "" xarch cdir defconfig cmakedir xlang mode makeargs elfdir cmd \ -    project target target_dir targets xtree _f target1 bootstrapargs mkhelper \ -    autoconfargs listfile autogenargs btype tree rev tree_depend` +eval `setvars "" xarch srcdir premake cmakedir xlang mode makeargs elfdir cmd \ +    project target target_dir targets xtree _f release bootstrapargs mkhelper \ +    autoconfargs listfile autogenargs btype tree rev tree_depend build_depend \ +    defconfig postmake mkhelpercfg dry dest_dir mdir badhash`  main()  { -	while getopts f:b:m:u:c:x:s:l:n: option; do +	while getopts f:b:m:u:c:x:s:l:n:d: option; do  		[ -n "$_f" ] && $err "only one flag is permitted" -		_f="$1" +		_f="$1" && [ "$_f" = "-d" ] && dry=":"  		case "$1" in +		-d) mode="" ;;  		-b) mode="" ;;  		-u) mode="oldconfig" ;;  		-m) mode="menuconfig" ;; @@ -36,123 +37,98 @@ main()  	done  	[ -z "$_f" ] && $err "missing flag (-m/-u/-b/-c/-x/-f/-s/-l/-n)"  	[ -z "$project" ] && for p in $(ls -1 config/git); do -		./update trees $_f "$p" || $err "!./update trees $_f $p" -		[ "$XBMK_RELEASE" != "y" ] || singletree "$p" || \ -		    x_ rm -Rf "src/$p/$p"; continue -	done && return 0 +		./update trees $_f "$p" || $err "!./update trees $_f $p"; : +	done && return 1  	[ -f "config/git/$project/pkg.cfg" ] || $err "'$project' not defined" -	elfdir="elf/$project" -	datadir="config/data/$project" -	cfgsdir="config/$project" -	listfile="$datadir/build.list" # needed on multi, optional on single +	for d in "elf" "config/data" "config" "src"; do +		eval "${d#*/}dir=\"$d/$project\"" +	done; dest_dir="$elfdir" +	listfile="$datadir/build.list" +	[ -f "$listfile" ] || listfile="" # optional on all projects -	remkdir "${tmpgit%/*}" - -	cmd="build_targets" && singletree "$project" && cmd="build_project" -	$cmd $@ +	mkhelpercfg="$datadir/mkhelper.cfg" +	e "$mkhelpercfg" f missing && mkhelpercfg="$TMPDIR/mkhelper.cfg" && \ +	    x_ touch "$mkhelpercfg" -	[ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && return 0 +	targets="$@" +	cmd="build_targets $targets" && singletree "$project" && \ +	    cmd="build_project" -	[ -f "$listfile" ] || return 0 -	[ -z "$mode" ] && printf "\n\nOK! Check %s/\n\n" "$elfdir"; return 0 +	remkdir "${tmpgit%/*}"  }  build_project()  { -	load_target_config "$cfgsdir" || return 0 -	[ -f "$listfile" ] || listfile="" # optional on single-tree - -	dest_dir="$elfdir" -	[ ! -f "$listfile" ] || elfcheck || return 0 - -	cdir="src/${project}" -	x_ ./update trees -f "$project" +	configure_project "$configdir" || return 0 +	[ ! -f "$listfile" ] || $dry elfcheck || return 0  	[ "$mode" = "distclean" ] && mode="clean"  	run_make_command || return 0 -	[ -n "$mode" ] || copy_elf; return 0 +	[ -n "$mode" ] || $dry copy_elf; return 0  }  build_targets()  { -	[ "$elfdir" = "elf/coreboot" ] && elfdir="$cbelfdir" - -	[ -d "$cfgsdir" ] || $err "directory, $cfgsdir, does not exist" -	[ -f "$listfile" ] || $err "list file, $listfile, does not exist" - -	# Build for all targets if no argument is given -	[ $# -gt 0 ] && target1="$1" -	[ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && shift 1 -	targets="$(ls -1 "$cfgsdir")" || $err "Can't get options for $cfgsdir" -	[ $# -gt 0 ] && targets=$@ +	[ -d "$configdir" ] || $err "directory, $configdir, does not exist" +	[ $# -gt 0 ] || targets="$(ls -1 "$configdir")" || $err "!o $configdir" -	handle_targets -} - -handle_targets() -{  	for x in $targets; do +		[ "$x" = "list" ] && x_ ls -1 "config/$project" && \ +		    listfile="" && break  		target="$x"  		printf "'make %s', '%s', '%s'\n" "$mode" "$project" "$target" -		[ "$project" != "coreboot" ] || [ -n "$mode" ] || \ -		    [ "$target1" = "utils" ] || x_ ./vendor download $target  		x_ handle_defconfig -	done -} - -handle_defconfig() -{ -	handle_src_tree "$target" || return 0 - -	[ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && \ -		eval "check_coreboot_utils \"$tree\"; return 0" - -	for y in "$target_dir/config"/*; do -		[ -f "$y" ] || continue -		defconfig="$y" - -		[ -n "$mode" ] || check_defconfig || continue -		handle_makefile -		[ -n "$mode" ] || copy_elf +		[ -n "$mode" ] || [ -z "$postmake" ] || $postmake || \ +		    $err "$project/$target: !postmake: $postmake"; continue  	done; return 0  } -handle_src_tree() +handle_defconfig()  { -	target_dir="$cfgsdir/$target" +	target_dir="$configdir/$target"  	[ -f "CHANGELOG" ] || fetch_project "$project" -	load_target_config "$target_dir" || return 1 +	configure_project "$target_dir" || return 0  	x_ mkdir -p "$elfdir/$target"  	chkvars tree -	cdir="src/$project/$tree" +	srcdir="src/$project/$tree"  	if [ "$mode" = "distclean" ] || [ "$mode" = "crossgcc-clean" ]; then -		[ -d "$cdir" ] || return 1 +		[ -d "$srcdir" ] || return 0  	fi -	x_ ./update trees -f "$project" "$target" +	[ -z "$mode" ] && $dry check_cross_compiler + +	for y in "$target_dir/config"/*; do +		[ "$_f" = "-d" ] || [ -f "$y" ] || continue +		[ "$_f" = "-d" ] || defconfig="$y" -	[ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && return 0 -	[ -z "$mode" ] && check_cross_compiler; return 0 +		[ -n "$mode" ] || check_defconfig || continue +		handle_makefile +		[ -n "$mode" ] || $dry copy_elf +	done; return 0  } -load_target_config() +configure_project()  { -	eval `setvars "" xarch xlang bootstrapargs autoconfargs xtree \ -	    tree_depend makeargs btype mkhelper` +	eval `setvars "" xarch xlang build_depend autoconfargs xtree postmake \ +	    tree_depend makeargs btype mkhelper bootstrapargs premake release \ +	    badhash` +  	[ -f "$1/target.cfg" ] || btype="auto"  	[ -f "$datadir/mkhelper.cfg" ] && eval `setcfg "$datadir/mkhelper.cfg"`  	_tcfg="$1/target.cfg" -	while [ -f "$_tcfg" ] || [ "$cmd" = "build_targets" ]; do +	while [ -f "$_tcfg" ] || [ "$cmd" != "build_project" ]; do  		eval `setvars "" rev tree`  		printf "Loading %s config: %s\n" "$project" "$_tcfg"  		eval `setcfg "$_tcfg"` + +		[ "$_f" = "-d" ] && build_depend="" # dry run  		[ "$cmd" = "build_project" ] && break  		[ "$mode" = "fetch" ] || break @@ -160,14 +136,75 @@ load_target_config()  		    && break; _tcfg="${_tcfg%/*/target.cfg}/$tree/target.cfg"  	done +	[ "$XBMK_RELEASE" = "y" ] && [ "$release" = "n" ] && return 1  	[ -z "$btype" ] || [ "${mode%config}" = "$mode" ] || return 1 +	[ -z "$mode" ] && build_dependencies + +	mdir="$PWD/config/submodule/$project" +	[ -n "$tree" ] && mdir="$mdir/$tree" + +	[ -f "CHANGELOG" ] || check_project_hashes + +	[ "$mode" = "fetch" ] || x_ ./update trees -f "$project" $target  	[ "$mode" = "fetch" ] || return 0 +  	[ -f "CHANGELOG" ] && return 1; fetch_${cmd#build_}; return 1  } +build_dependencies() +{ +	for bd in $build_depend; do +		bd_p="${bd%%/*}"; bd_t="${bd##*/}" +		[ -z "$bd_p" ] && $dry $err "$project/$tree: !bd '$bd'" +		[ "${bd##*/}" = "$bd" ] && bd_t="" +		[ -z "$bd_p" ] || $dry ./update trees -b $bd_p $bd_t \ +		    || $err "!mk $project/$tree $bd_p/$bd_t"; continue +	done; return 0 +} + +check_project_hashes() +{ +	mkdir -p "$XBMK_CACHE/hash" || $err "!mkdir '$XBMK_CACHE/hash'" + +	old_pjhash="" +	[ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \ +	    read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree" + +	x_ rm -f "$TMPDIR/project.list" "$TMPDIR/project.hash" \ +	    "$TMPDIR/project.tmp"; x_ touch "$TMPDIR/project.tmp" +	x_ touch "$TMPDIR/project.hash" + +	for delcheck in "$datadir" "$configdir/$tree" "$mdir"; do +		[ -d "$delcheck" ] || continue +		find "$delcheck" -type f -not -path "*/.git*/*" \ +		    >> "$TMPDIR/project.tmp" || \ +		    $err "!find $delcheck > project.tmp" +	done +	sort "$TMPDIR/project.tmp" > "$TMPDIR/project.list" || \ +	    $err "!sort project tmp/list" + +	while read -r delcheck; do +		[ -f "$delcheck" ] || continue +		sha512sum "$delcheck" | awk '{print $1}' >> \ +		    "$TMPDIR/project.hash" || $err "!findhash $delcheck" +	done < "$TMPDIR/project.list" + +	pjhash="$(sha512sum "$TMPDIR/project.hash" | awk '{print $1}')" || : +	badhash="y" && [ "$pjhash" = "$old_pjhash" ] && badhash="n" +	[ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y" + +	printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || \ +	    $err "!mk $XBMK_CACHE/hash/$project$tree" + +	[ "$badhash" = "n" ] || rm -Rf "src/$project/$tree" \ +	    "elf/$project/$tree" "elf/$project/$target" || \ +	    $err "!rmproject $project $tree"; : +} +  check_cross_compiler()  { +	xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"  	for _xarch in $xarch; do  		cbdir="src/coreboot/$tree"  		[ "$project" != "coreboot" ] && cbdir="src/coreboot/default" @@ -180,35 +217,19 @@ check_cross_compiler()  		[ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang"  		# sometimes buildgcc fails for like no reason. try twice. -		make -C "$cbdir" crossgcc-${_xarch%-*} $cbmakeargs || \ -		    make -C "$cbdir" crossgcc-${_xarch%-*} $cbmakeargs || \ -		    $err "!mkxgcc $project/$xtree '${_xarch%-*}' '$cbmakeargs'" -	done; return 0 -} - -check_coreboot_utils() -{ -	for util in cbfstool ifdtool; do -		utilelfdir="elf/$util/$1" -		utilsrcdir="src/coreboot/$1/util/$util" - -		utilmode="" && [ -n "$mode" ] && utilmode="clean" -		x_ make -C "$utilsrcdir" $utilmode -j$XBMK_THREADS $cbmakeargs -		[ -z "$mode" ] && [ ! -f "$utilelfdir/$util" ] && \ -			x_ mkdir -p "$utilelfdir" && \ -			x_ cp "$utilsrcdir/$util" "elf/$util/$1" -		[ -z "$mode" ] || x_ rm -Rf "$utilelfdir" +		make -C "$cbdir" crossgcc-${_xarch%-*} $xgccargs || \ +		    make -C "$cbdir" crossgcc-${_xarch%-*} $xgccargs || \ +		    $err "!mkxgcc $project/$xtree '${_xarch%-*}' '$xgccargs'"  	done; return 0  }  check_defconfig()  { -	[ -f "$defconfig" ] || $err "$project/$target: missing defconfig" - +	[ -f "$defconfig" ] || $dry $err "$project/$target: missing defconfig"  	dest_dir="$elfdir/$target/${defconfig#"$target_dir/config/"}" -	elfcheck || return 1 # skip build if a previous one exists -	x_ mkdir -p "$dest_dir" +	$dry elfcheck || return 1 # skip build if a previous one exists +	$dry x_ mkdir -p "$dest_dir"  }  elfcheck() @@ -221,41 +242,41 @@ elfcheck()  handle_makefile()  { -	check_makefile "$cdir" && x_ make clean -C "$cdir" -	x_ cp "$defconfig" "$cdir/.config" -	[ -n "$mode" ] || [ -n "$btype" ] || make -C "$cdir" \ -	    silentoldconfig || make -C "$cdir" oldconfig || : +	$dry check_makefile "$srcdir" && x_ make clean -C "$srcdir" +	[ -f "$defconfig" ] && x_ cp "$defconfig" "$srcdir/.config" +	[ -n "$mode" ] || [ -n "$btype" ] || $dry make -C \ +	    "$srcdir" silentoldconfig || make -C "$srcdir" oldconfig || : -	run_make_command || $err "handle_makefile $cdir: no makefile!" +	run_make_command || $err "handle_makefile $srcdir: no makefile!"  	_copy=".config" && [ "$mode" = "savedefconfig" ] && _copy="defconfig" -	[ "${mode%config}" = "$mode" ] || x_ cp "$cdir/$_copy" "$defconfig" +	[ "${mode%config}" = "$mode" ] || \ +	    $dry x_ cp "$srcdir/$_copy" "$defconfig" -	[ -e "$cdir/.git" ] && [ "$project" = "u-boot" ] && \ -	    [ "$mode" = "distclean" ] && x_ git -C "$cdir" clean -fdx; return 0 +	[ -e "$srcdir/.git" ] && [ "$project" = "u-boot" ] && \ +	    [ "$mode" = "distclean" ] && $dry x_ git -C "$srcdir" clean -fdx; :  }  run_make_command()  { -	check_cmake "$cdir" && [ -z "$mode" ] && check_autoconf "$cdir" -	check_makefile "$cdir" || return 1 +	[ -z "$premake" ] || [ -n "$mode" ] || $premake || $err "!$premake" -	[ "$project" = "coreboot" ] && [ -z "$mode" ] && x_ \ -		printf "%s\n" "${version%%-*}" > "$cdir/.coreboot-version" \ -		    && makeargs="$makeargs $cbmakeargs" +	$dry check_cmake "$srcdir" && [ -z "$mode" ] && $dry check_autoconf \ +	    "$srcdir"; $dry check_makefile "$srcdir" || return 1 -	make -C "$cdir" $mode -j$XBMK_THREADS $makeargs || $err "$cdir mk$mode" +	$dry make -C "$srcdir" $mode -j$XBMK_THREADS $makeargs || $err "!$mode"  	[ -z "$mkhelper" ] || [ -n "$mode" ] || $mkhelper || $err "!$mkhelper" -	[ "$mode" = "clean" ] && make -C "$cdir" distclean || :; return 0 +	[ "$mode" = "clean" ] && $dry make -C "$srcdir" distclean || :; :  }  check_cmake()  { -	[ -z "$cmakedir" ] || check_makefile "$1" || cmake -B "$1" \ -	    "$1/$cmakedir" || check_makefile "$1" || $err "$1: !cmk $cmakedir" -	[ -z "$cmakedir" ] || check_makefile "$1" || \ -		$err "check_cmake $1: can't generate Makefile"; return 0 +	[ -z "$cmakedir" ] || $dry check_makefile "$1" || cmake -B "$1" \ +	    "$1/$cmakedir" || $dry check_makefile "$1" || $err \ +	    "$1: !cmk $cmakedir" +	[ -z "$cmakedir" ] || $dry check_makefile "$1" || \ +	    $err "check_cmake $1: can't generate Makefile"; return 0  }  check_autoconf() @@ -274,28 +295,13 @@ check_makefile()  	    [ -f "$1/GNUmakefile" ] || return 1; return 0  } -mkpayload_grub() -{ -	eval `setvars "" grub_modules grub_install_modules` -	eval `setcfg "$grubdata/module/$tree"` - -	x_ rm -f "$cdir/grub.elf" - -	"${cdir}/grub-mkstandalone" --grub-mkimage="${cdir}/grub-mkimage" \ -	    -O i386-coreboot -o "${cdir}/grub.elf" -d "${cdir}/grub-core/" \ -	    --fonts= --themes= --locales=  --modules="$grub_modules" \ -	    --install-modules="$grub_install_modules" \ -	    "/boot/grub/grub_default.cfg=${cdir}/.config" \ -	    "/boot/grub/grub.cfg=$grubdata/memdisk.cfg" \ -	    "/background.png=$grubdata/background/background1280x800.png" || \ -	    $err "$tree: cannot build grub.elf"; return 0 -} -  copy_elf()  {  	[ -f "$listfile" ] && x_ mkdir -p "$dest_dir" && while read -r f; do -		[ -f "$cdir/$f" ] && x_ cp "$cdir/$f" "$dest_dir" -	done < "$listfile"; x_ make clean -C "$cdir" +		[ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir" +	done < "$listfile"; x_ make clean -C "$srcdir"  } -main $@ +main $@ || exit 0 +. "$mkhelpercfg" +$cmd diff --git a/util/autoport/azalia.go b/util/autoport/azalia.go deleted file mode 100644 index 6dd78b1e..00000000 --- a/util/autoport/azalia.go +++ /dev/null @@ -1,67 +0,0 @@ -package main - -import ( -	"fmt" -	"sort" -) - -type azalia struct { -} - -func (i azalia) Scan(ctx Context, addr PCIDevData) { -	az := Create(ctx, "hda_verb.c") -	defer az.Close() - -	Add_gpl(az) -	az.WriteString( -		`#include <device/azalia_device.h> - -const u32 cim_verb_data[] = { -`) - -	for _, codec := range ctx.InfoSource.GetAzaliaCodecs() { -		fmt.Fprintf(az, "\t0x%08x,\t/* Codec Vendor / Device ID: %s */\n", -			codec.VendorID, codec.Name) -		fmt.Fprintf(az, "\t0x%08x,\t/* Subsystem ID */\n", -			codec.SubsystemID) -		fmt.Fprintf(az, "\t%d,\t\t/* Number of 4 dword sets */\n", -			len(codec.PinConfig)+1) -		fmt.Fprintf(az, "\tAZALIA_SUBVENDOR(%d, 0x%08x),\n", -			codec.CodecNo, codec.SubsystemID) - -		keys := []int{} -		for nid, _ := range codec.PinConfig { -			keys = append(keys, nid) -		} - -		sort.Ints(keys) - -		for _, nid := range keys { -			fmt.Fprintf(az, "\tAZALIA_PIN_CFG(%d, 0x%02x, 0x%08x),\n", -				codec.CodecNo, nid, codec.PinConfig[nid]) -		} -		az.WriteString("\n"); -	} - -	az.WriteString( -		`}; - -const u32 pc_beep_verbs[0] = {}; - -AZALIA_ARRAY_SIZES; -`) - -	PutPCIDev(addr, "") -} - -func init() { -	/* I82801GX/I945 */ -	RegisterPCI(0x8086, 0x27d8, azalia{}) -	/* BD82X6X/sandybridge */ -	RegisterPCI(0x8086, 0x1c20, azalia{}) -	/* C216/ivybridge */ -	RegisterPCI(0x8086, 0x1e20, azalia{}) -	/* Lynx Point */ -	RegisterPCI(0x8086, 0x8c20, azalia{}) -	RegisterPCI(0x8086, 0x9c20, azalia{}) -} diff --git a/util/autoport/bd82x6x.go b/util/autoport/bd82x6x.go deleted file mode 100644 index 8c418e30..00000000 --- a/util/autoport/bd82x6x.go +++ /dev/null @@ -1,337 +0,0 @@ -package main - -import "fmt" - -type bd82x6x struct { -	variant string -	node    *DevTreeNode -} - -func IsPCIeHotplug(ctx Context, port int) bool { -	portDev, ok := PCIMap[PCIAddr{Bus: 0, Dev: 0x1c, Func: port}] -	if !ok { -		return false -	} -	return (portDev.ConfigDump[0xdb] & (1 << 6)) != 0 -} - -func ich9GetFlashSize(ctx Context) { -	inteltool := ctx.InfoSource.GetInteltool() -	switch (inteltool.RCBA[0x3410] >> 10) & 3 { -	/* SPI. All boards I've seen with sandy/ivy use SPI.  */ -	case 3: -		ROMProtocol = "SPI" -		highflkb := uint32(0) -		for reg := uint16(0); reg < 5; reg++ { -			fl := (inteltool.RCBA[0x3854+4*reg] >> 16) & 0x1fff -			flkb := (fl + 1) << 2 -			if flkb > highflkb { -				highflkb = flkb -			} -		} -		ROMSizeKB = int(highflkb) -		/* Shared with ME. Flashrom is unable to handle it.  */ -		FlashROMSupport = "n" -	} -} - -func (b bd82x6x) GetGPIOHeader() string { -	return "southbridge/intel/bd82x6x/pch.h" -} - -func (b bd82x6x) EnableGPE(in int) { -	b.node.Registers[fmt.Sprintf("gpi%d_routing", in)] = "2" -} - -func (b bd82x6x) EncodeGPE(in int) int { -	return in + 0x10 -} - -func (b bd82x6x) DecodeGPE(in int) int { -	return in - 0x10 -} - -func (b bd82x6x) NeedRouteGPIOManually() { -	b.node.Comment += ", FIXME: set gpiX_routing for EC support" -} - -func (b bd82x6x) Scan(ctx Context, addr PCIDevData) { - -	SouthBridge = &b - -	inteltool := ctx.InfoSource.GetInteltool() -	GPIO(ctx, inteltool) - -	KconfigBool["SOUTHBRIDGE_INTEL_"+b.variant] = true -	KconfigBool["SERIRQ_CONTINUOUS_MODE"] = true -	KconfigInt["USBDEBUG_HCD_INDEX"] = 2 -	KconfigComment["USBDEBUG_HCD_INDEX"] = "FIXME: check this" -	dmi := ctx.InfoSource.GetDMI() -	if dmi.Vendor == "LENOVO" { -		KconfigInt["DRAM_RESET_GATE_GPIO"] = 10 -	} else { -		KconfigInt["DRAM_RESET_GATE_GPIO"] = 60 -	} -	KconfigComment["DRAM_RESET_GATE_GPIO"] = "FIXME: check this" - -	ich9GetFlashSize(ctx) - -	DSDTDefines = append(DSDTDefines, -		DSDTDefine{ -			Key:   "BRIGHTNESS_UP", -			Value: "\\_SB.PCI0.GFX0.INCB", -		}, -		DSDTDefine{ -			Key:   "BRIGHTNESS_DOWN", -			Value: "\\_SB.PCI0.GFX0.DECB", -		}) - -	/* SPI init */ -	MainboardIncludes = append(MainboardIncludes, "southbridge/intel/bd82x6x/pch.h") - -	FADT := ctx.InfoSource.GetACPI()["FACP"] - -	pcieHotplugMap := "{ " - -	for port := 0; port < 7; port++ { -		if IsPCIeHotplug(ctx, port) { -			pcieHotplugMap += "1, " -		} else { -			pcieHotplugMap += "0, " -		} -	} - -	if IsPCIeHotplug(ctx, 7) { -		pcieHotplugMap += "1 }" -	} else { -		pcieHotplugMap += "0 }" -	} - -	cur := DevTreeNode{ -		Chip:    "southbridge/intel/bd82x6x", -		Comment: "Intel Series 6 Cougar Point PCH", - -		Registers: map[string]string{ -			"sata_interface_speed_support": "0x3", -			"gen1_dec":                     FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x84:0x88]), -			"gen2_dec":                     FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x88:0x8c]), -			"gen3_dec":                     FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x8c:0x90]), -			"gen4_dec":                     FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x90:0x94]), -			"pcie_port_coalesce":           "1", -			"pcie_hotplug_map":             pcieHotplugMap, - -			"sata_port_map": fmt.Sprintf("0x%x", PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 2}].ConfigDump[0x92]&0x3f), - -			"docking_supported": (FormatBool((FADT[113] & (1 << 1)) != 0)), -			"spi_uvscc":         fmt.Sprintf("0x%x", inteltool.RCBA[0x38c8]), -			"spi_lvscc":         fmt.Sprintf("0x%x", inteltool.RCBA[0x38c4]&^(1<<23)), -		}, -		PCISlots: []PCISlot{ -			PCISlot{PCIAddr: PCIAddr{Dev: 0x14, Func: 0}, writeEmpty: false, alias: "xhci", additionalComment: "USB 3.0 Controller"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 0}, writeEmpty: true, alias: "mei1", additionalComment: "Management Engine Interface 1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 1}, writeEmpty: true, alias: "mei2", additionalComment: "Management Engine Interface 2"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 2}, writeEmpty: true, alias: "me_ide_r", additionalComment: "Management Engine IDE-R"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 3}, writeEmpty: true, alias: "me_kt", additionalComment: "Management Engine KT"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x19, Func: 0}, writeEmpty: true, alias: "gbe", additionalComment: "Intel Gigabit Ethernet"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1a, Func: 0}, writeEmpty: true, alias: "ehci2", additionalComment: "USB2 EHCI #2"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1b, Func: 0}, writeEmpty: true, alias: "hda", additionalComment: "High Definition Audio"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 0}, writeEmpty: true, alias: "pcie_rp1", additionalComment: "PCIe Port #1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 1}, writeEmpty: true, alias: "pcie_rp2", additionalComment: "PCIe Port #2"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 2}, writeEmpty: true, alias: "pcie_rp3", additionalComment: "PCIe Port #3"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 3}, writeEmpty: true, alias: "pcie_rp4", additionalComment: "PCIe Port #4"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 4}, writeEmpty: true, alias: "pcie_rp5", additionalComment: "PCIe Port #5"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 5}, writeEmpty: true, alias: "pcie_rp6", additionalComment: "PCIe Port #6"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 6}, writeEmpty: true, alias: "pcie_rp7", additionalComment: "PCIe Port #7"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 7}, writeEmpty: true, alias: "pcie_rp8", additionalComment: "PCIe Port #8"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1d, Func: 0}, writeEmpty: true, alias: "ehci1", additionalComment: "USB2 EHCI #1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1e, Func: 0}, writeEmpty: true, alias: "pci_bridge", additionalComment: "PCI bridge"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 0}, writeEmpty: true, alias: "lpc", additionalComment: "LPC bridge"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 2}, writeEmpty: true, alias: "sata1", additionalComment: "SATA Controller 1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 3}, writeEmpty: true, alias: "smbus", additionalComment: "SMBus"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 5}, writeEmpty: true, alias: "sata2", additionalComment: "SATA Controller 2"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 6}, writeEmpty: true, alias: "thermal", additionalComment: "Thermal"}, -		}, -	} - -	b.node = &cur - -	xhciDev, ok := PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}] - -	if ok { -		cur.Registers["xhci_switchable_ports"] = FormatHexLE32(xhciDev.ConfigDump[0xd4:0xd8]) -		cur.Registers["superspeed_capable_ports"] = FormatHexLE32(xhciDev.ConfigDump[0xdc:0xe0]) -		cur.Registers["xhci_overcurrent_mapping"] = FormatHexLE32(xhciDev.ConfigDump[0xc0:0xc4]) -	} - -	PutPCIChip(addr, cur) -	PutPCIDevParent(addr, "", "lpc") - -	DSDTIncludes = append(DSDTIncludes, DSDTInclude{ -		File: "southbridge/intel/common/acpi/platform.asl", -	}) -	DSDTIncludes = append(DSDTIncludes, DSDTInclude{ -		File: "southbridge/intel/bd82x6x/acpi/globalnvs.asl", -	}) -	DSDTIncludes = append(DSDTIncludes, DSDTInclude{ -		File: "southbridge/intel/common/acpi/sleepstates.asl", -	}) -	DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{ -		File: "southbridge/intel/bd82x6x/acpi/pch.asl", -	}) - -	AddBootBlockFile("early_init.c", "") -	AddROMStageFile("early_init.c", "") - -	sb := Create(ctx, "early_init.c") -	defer sb.Close() -	Add_gpl(sb) - -	sb.WriteString(` -#include <bootblock_common.h> -#include <device/pci_ops.h> -#include <northbridge/intel/sandybridge/raminit_native.h> -#include <southbridge/intel/bd82x6x/pch.h> - -`) -	sb.WriteString("const struct southbridge_usb_port mainboard_usb_ports[] = {\n") - -	currentMap := map[uint32]int{ -		0x20000153: 0, -		0x20000f57: 1, -		0x2000055b: 2, -		0x20000f51: 3, -		0x2000094a: 4, -		0x2000035f: 5, -		0x20000f53: 6, -		0x20000357: 7, -		0x20000353: 8, -	} - -	for port := uint(0); port < 14; port++ { -		var pinmask uint32 -		OCPin := -1 -		if port < 8 { -			pinmask = inteltool.RCBA[0x35a0] -		} else { -			pinmask = inteltool.RCBA[0x35a4] -		} -		for pin := uint(0); pin < 4; pin++ { -			if ((pinmask >> ((port % 8) + 8*pin)) & 1) != 0 { -				OCPin = int(pin) -				if port >= 8 { -					OCPin += 4 -				} -			} -		} -		current, ok := currentMap[inteltool.RCBA[uint16(0x3500+4*port)]] -		comment := "" -		if !ok { -			comment = fmt.Sprintf("// FIXME: Unknown current: RCBA(0x%x)=0x%x", 0x3500+4*port, uint16(0x3500+4*port)) -		} -		fmt.Fprintf(sb, "\t{ %d, %d, %d }, %s\n", -			((inteltool.RCBA[0x359c]>>port)&1)^1, -			current, -			OCPin, -			comment) -	} -	sb.WriteString("};\n") - -	guessedMap := GuessSPDMap(ctx) - -	sb.WriteString(` -void bootblock_mainboard_early_init(void) -{ -`) -	RestorePCI16Simple(sb, addr, 0x82) - -	RestorePCI16Simple(sb, addr, 0x80) - -	sb.WriteString(`} - -/* FIXME: Put proper SPD map here. */ -void mainboard_get_spd(spd_raw_data *spd, bool id_only) -{ -`) -	for i, spd := range guessedMap { -		fmt.Fprintf(sb, "\tread_spd(&spd[%d], 0x%02x, id_only);\n", i, spd) -	} -	sb.WriteString("}\n") - -	gnvs := Create(ctx, "acpi_tables.c") -	defer gnvs.Close() - -	Add_gpl(gnvs) -	gnvs.WriteString(`#include <acpi/acpi_gnvs.h> -#include <soc/nvs.h> - -/* FIXME: check this function.  */ -void mainboard_fill_gnvs(struct global_nvs *gnvs) -{ -	/* The lid is open by default. */ -	gnvs->lids = 1; - -	/* Temperature at which OS will shutdown */ -	gnvs->tcrt = 100; -	/* Temperature at which OS will throttle CPU */ -	gnvs->tpsv = 90; -} -`) -} - -func init() { -	/* BD82X6X LPC */ -	for id := 0x1c40; id <= 0x1c5f; id++ { -		RegisterPCI(0x8086, uint16(id), bd82x6x{variant: "BD82X6X"}) -	} - -	/* C216 LPC */ -	for id := 0x1e41; id <= 0x1e5f; id++ { -		RegisterPCI(0x8086, uint16(id), bd82x6x{variant: "C216"}) -	} - -	/* PCIe bridge */ -	for _, id := range []uint16{ -		0x1c10, 0x1c12, 0x1c14, 0x1c16, -		0x1c18, 0x1c1a, 0x1c1c, 0x1c1e, -		0x1e10, 0x1e12, 0x1e14, 0x1e16, -		0x1e18, 0x1e1a, 0x1e1c, 0x1e1e, -		0x1e25, 0x244e, 0x2448, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} - -	/* SMBus controller  */ -	RegisterPCI(0x8086, 0x1c22, GenericPCI{MissingParent: "smbus"}) -	RegisterPCI(0x8086, 0x1e22, GenericPCI{MissingParent: "smbus"}) - -	/* SATA */ -	for _, id := range []uint16{ -		0x1c00, 0x1c01, 0x1c02, 0x1c03, -		0x1e00, 0x1e01, 0x1e02, 0x1e03, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} - -	/* EHCI */ -	for _, id := range []uint16{ -		0x1c26, 0x1c2d, 0x1e26, 0x1e2d, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} - -	/* XHCI */ -	RegisterPCI(0x8086, 0x1e31, GenericPCI{}) - -	/* ME and children */ -	for _, id := range []uint16{ -		0x1c3a, 0x1c3b, 0x1c3c, 0x1c3d, -		0x1e3a, 0x1e3b, 0x1e3c, 0x1e3d, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} - -	/* Ethernet */ -	RegisterPCI(0x8086, 0x1502, GenericPCI{}) -	RegisterPCI(0x8086, 0x1503, GenericPCI{}) - -} diff --git a/util/autoport/description.md b/util/autoport/description.md deleted file mode 100644 index 9a0e8d43..00000000 --- a/util/autoport/description.md +++ /dev/null @@ -1 +0,0 @@ -Automated porting coreboot to Sandy Bridge/Ivy Bridge platforms `Go` diff --git a/util/autoport/ec_fixme.go b/util/autoport/ec_fixme.go deleted file mode 100644 index 54f78ab4..00000000 --- a/util/autoport/ec_fixme.go +++ /dev/null @@ -1,91 +0,0 @@ -package main - -import "fmt" - -func FIXMEEC(ctx Context) { -	ap := Create(ctx, "acpi/platform.asl") -	defer ap.Close() - -	hasKeyboard := ctx.InfoSource.HasPS2() - -	sbGPE := GuessECGPE(ctx) -	var GPEUnsure bool -	if sbGPE < 0 { -		sbGPE = SouthBridge.EncodeGPE(1) -		GPEUnsure = true -		SouthBridge.NeedRouteGPIOManually() -	} else { -		GPEUnsure = false -		SouthBridge.EnableGPE(SouthBridge.DecodeGPE(sbGPE)) -	} - -	Add_gpl(ap) -	ap.WriteString( -		`Method(_WAK, 1) -{ -	/* FIXME: EC support  */ -	Return(Package() {0, 0}) -} - -Method(_PTS,1) -{ -	/* FIXME: EC support  */ -} -`) - -	ecs := ctx.InfoSource.GetEC() -	MainboardIncludes = append(MainboardIncludes, "ec/acpi/ec.h") -	MainboardIncludes = append(MainboardIncludes, "console/console.h") - -	MainboardInit += -		`	/* FIXME: trim this down or remove if necessary */ -	{ -		int i; -		const u8 dmp[256] = {` -	for i := 0; i < 0x100; i++ { -		if (i & 0xf) == 0 { -			MainboardInit += fmt.Sprintf("\n\t\t\t/* %02x */ ", i) -		} -		MainboardInit += fmt.Sprintf("0x%02x,", ecs[i]) -		if (i & 0xf) != 0xf { -			MainboardInit += " " -		} -	} -	MainboardInit += "\n\t\t};\n" -	MainboardInit += ` -		printk(BIOS_DEBUG, "Replaying EC dump ..."); -		for (i = 0; i < 256; i++) -			ec_write (i, dmp[i]); -		printk(BIOS_DEBUG, "done\n"); -	} -` - -	KconfigBool["EC_ACPI"] = true -	si := Create(ctx, "acpi/superio.asl") -	defer si.Close() - -	if hasKeyboard { -		Add_gpl(si) -		si.WriteString("#include <drivers/pc80/pc/ps2_controller.asl>\n") -		MainboardInit += fmt.Sprintf("\tpc_keyboard_init(NO_AUX_DEVICE);\n") -		MainboardIncludes = append(MainboardIncludes, "pc80/keyboard.h") -	} - -	ec := Create(ctx, "acpi/ec.asl") -	defer ec.Close() - -	Add_gpl(ec) -	ec.WriteString(`Device(EC) -{ -	Name (_HID, EISAID("PNP0C09")) -	Name (_UID, 0) -`) -	if GPEUnsure { -		ec.WriteString("\t/* FIXME: Set GPE  */\n") -		ec.WriteString("\t/* Name (_GPE, ?)  */\n") -	} else { -		fmt.Fprintf(ec, "\tName (_GPE, %d)\n", sbGPE) -	} -	ec.WriteString("/* FIXME: EC support */\n") -	ec.WriteString("}\n") -} diff --git a/util/autoport/ec_lenovo.go b/util/autoport/ec_lenovo.go deleted file mode 100644 index a34960ff..00000000 --- a/util/autoport/ec_lenovo.go +++ /dev/null @@ -1,245 +0,0 @@ -package main - -import "fmt" - -func LenovoEC(ctx Context) { -	ap := Create(ctx, "acpi/platform.asl") -	defer ap.Close() - -	wakeGPE := 13 - -	sbGPE := GuessECGPE(ctx) -	var GPE int -	var GPEUnsure bool -	if sbGPE < 0 { -		sbGPE = SouthBridge.EncodeGPE(1) -		GPE = 1 -		GPEUnsure = true -		SouthBridge.NeedRouteGPIOManually() -	} else { -		GPE = SouthBridge.DecodeGPE(sbGPE) -		GPEUnsure = false -	} - -	SouthBridge.EnableGPE(wakeGPE) -	SouthBridge.EnableGPE(GPE) - -	GPEDefine := DSDTDefine{ -		Key: "THINKPAD_EC_GPE", -	} - -	GPEDefine.Value = fmt.Sprintf("%d", sbGPE) -	if GPEUnsure { -		GPEDefine.Comment = "FIXME: Check this" -	} - -	DSDTDefines = append(DSDTDefines, -		DSDTDefine{ -			Key:   "EC_LENOVO_H8_ME_WORKAROUND", -			Value: "1", -		}, GPEDefine) - -	Add_gpl(ap) -	ap.WriteString( -		`Method(_WAK, 1) -{ -	/* ME may not be up yet. */ -	Store(0, \_TZ.MEB1) -	Store(0, \_TZ.MEB2) -	Return(Package() {0, 0}) -} - -Method(_PTS,1) -{ -	\_SB.PCI0.LPCB.EC.RADI(0) -} -`) - -	si := Create(ctx, "acpi/superio.asl") -	defer si.Close() - -	Add_gpl(si) -	si.WriteString("#include <drivers/pc80/pc/ps2_controller.asl>\n") - -	/* FIXME:XX Move this to ec/lenovo.  */ -	smi := Create(ctx, "smihandler.c") -	defer smi.Close() - -	AddSMMFile("smihandler.c", "") - -	Add_gpl(smi) -	smi.WriteString( -		`#include <arch/io.h> -#include <console/console.h> -#include <cpu/x86/smm.h> -#include <ec/acpi/ec.h> -#include <ec/lenovo/h8/h8.h> -#include <delay.h> -#include <` + SouthBridge.GetGPIOHeader() + ">\n\n") - -	if GPEUnsure { -		smi.WriteString("/* FIXME: check this */\n") -	} -	fmt.Fprintf(smi, "#define GPE_EC_SCI	%d\n", GPE) - -	smi.WriteString("/* FIXME: check this */\n") -	fmt.Fprintf(smi, "#define GPE_EC_WAKE	%d\n", wakeGPE) - -	smi.WriteString(` -static void mainboard_smi_handle_ec_sci(void) -{ -	u8 status = inb(EC_SC); -	u8 event; - -	if (!(status & EC_SCI_EVT)) -		return; - -	event = ec_query(); -	printk(BIOS_DEBUG, "EC event %#02x\n", event); -} - -void mainboard_smi_gpi(u32 gpi_sts) -{ -	if (gpi_sts & (1 << GPE_EC_SCI)) -		mainboard_smi_handle_ec_sci(); -} - -int mainboard_smi_apmc(u8 data) -{ -	switch (data) { -	case APM_CNT_ACPI_ENABLE: -		/* use 0x1600/0x1604 to prevent races with userspace */ -		ec_set_ports(0x1604, 0x1600); -		/* route EC_SCI to SCI */ -		gpi_route_interrupt(GPE_EC_SCI, GPI_IS_SCI); -		/* discard all events, and enable attention */ -		ec_write(0x80, 0x01); -		break; -	case APM_CNT_ACPI_DISABLE: -		/* we have to use port 0x62/0x66, as 0x1600/0x1604 doesn't -		   provide a EC query function */ -		ec_set_ports(0x66, 0x62); -		/* route EC_SCI to SMI */ -		gpi_route_interrupt(GPE_EC_SCI, GPI_IS_SMI); -		/* discard all events, and enable attention */ -		ec_write(0x80, 0x01); -		break; -	default: -		break; -	} -	return 0; -} - -void mainboard_smi_sleep(u8 slp_typ) -{ -	if (slp_typ == 3) { -		u8 ec_wake = ec_read(0x32); -		/* If EC wake events are enabled, enable wake on EC WAKE GPE. */ -		if (ec_wake & 0x14) { -			/* Redirect EC WAKE GPE to SCI. */ -			gpi_route_interrupt(GPE_EC_WAKE, GPI_IS_SCI); -		} -	} -} -`) - -	ec := Create(ctx, "acpi/ec.asl") -	defer ec.Close() - -	Add_gpl(ec) -	ec.WriteString("#include <ec/lenovo/h8/acpi/ec.asl>\n") - -	KconfigBool["EC_LENOVO_PMH7"] = true -	KconfigBool["EC_LENOVO_H8"] = true - -	pmh := DevTreeNode{ -		Chip: "ec/lenovo/pmh7", -		Registers: map[string]string{ -			"backlight_enable":  "true", -			"dock_event_enable": "true", -		}, -		Children: []DevTreeNode{ -			DevTreeNode{ -				Chip:    "pnp", -				Comment: "dummy", -				Dev:     0xff, -				Func:    1, -			}, -		}, -	} -	PutChip("lpc", pmh) - -	ecs := ctx.InfoSource.GetEC() -	h8 := DevTreeNode{ -		Chip: "ec/lenovo/h8", -		Children: []DevTreeNode{ -			DevTreeNode{ -				Chip:    "pnp", -				Comment: "dummy", -				Dev:     0xff, -				Func:    2, -				IOs: map[uint16]uint16{ -					0x60: 0x62, -					0x62: 0x66, -					0x64: 0x1600, -					0x66: 0x1604, -				}, -			}, -		}, -		Comment: "FIXME: has_keyboard_backlight, has_power_management_beeps, has_uwb", -		Registers: map[string]string{ -			"config0":   FormatHex8(ecs[0]), -			"config1":   FormatHex8(ecs[1]), -			"config2":   FormatHex8(ecs[2]), -			"config3":   FormatHex8(ecs[3]), -			"beepmask0": FormatHex8(ecs[4]), -			"beepmask1": FormatHex8(ecs[5]), -		}, -	} -	for i := 0; i < 0x10; i++ { -		if ecs[0x10+i] != 0 { -			h8.Registers[fmt.Sprintf("event%x_enable", i)] = FormatHex8(ecs[0x10+i]) -		} -	} -	PutChip("lpc", h8) - -	eeprom := DevTreeNode{ -		Chip:    "drivers/i2c/at24rf08c", -		Comment: "eeprom, 8 virtual devices, same chip", -		Children: []DevTreeNode{ -			DevTreeNode{ -				Chip: "i2c", -				Dev:  0x54, -			}, -			DevTreeNode{ -				Chip: "i2c", -				Dev:  0x55, -			}, -			DevTreeNode{ -				Chip: "i2c", -				Dev:  0x56, -			}, -			DevTreeNode{ -				Chip: "i2c", -				Dev:  0x57, -			}, -			DevTreeNode{ -				Chip: "i2c", -				Dev:  0x5c, -			}, -			DevTreeNode{ -				Chip: "i2c", -				Dev:  0x5d, -			}, -			DevTreeNode{ -				Chip: "i2c", -				Dev:  0x5e, -			}, -			DevTreeNode{ -				Chip: "i2c", -				Dev:  0x5f, -			}, -		}, -	} -	PutChip("smbus", eeprom) -} diff --git a/util/autoport/ec_none.go b/util/autoport/ec_none.go deleted file mode 100644 index bcb61bf0..00000000 --- a/util/autoport/ec_none.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -func NoEC(ctx Context) { -	ap := Create(ctx, "acpi/platform.asl") -	defer ap.Close() - -	Add_gpl(ap) -	ap.WriteString( -		`Method(_WAK, 1) -{ -	Return(Package() {0, 0}) -} - -Method(_PTS, 1) -{ -} -`) - -	si := Create(ctx, "acpi/superio.asl") -	defer si.Close() - -	ec := Create(ctx, "acpi/ec.asl") -	defer ec.Close() -} diff --git a/util/autoport/go.mod b/util/autoport/go.mod deleted file mode 100644 index 55a89cc9..00000000 --- a/util/autoport/go.mod +++ /dev/null @@ -1 +0,0 @@ -module autoport diff --git a/util/autoport/gpio_common.go b/util/autoport/gpio_common.go deleted file mode 100644 index a869dce4..00000000 --- a/util/autoport/gpio_common.go +++ /dev/null @@ -1,113 +0,0 @@ -/* code to generate common GPIO code for Intel 6/7/8 Series Chipset */ - -package main - -import ( -	"fmt" -	"os" -) - -func writeGPIOSet(ctx Context, sb *os.File, -	val uint32, set uint, partno int, constraint uint32) { - -	max := uint(32) -	if set == 3 { -		max = 12 -	} - -	bits := [6][2]string{ -		{"GPIO_MODE_NATIVE", "GPIO_MODE_GPIO"}, -		{"GPIO_DIR_OUTPUT", "GPIO_DIR_INPUT"}, -		{"GPIO_LEVEL_LOW", "GPIO_LEVEL_HIGH"}, -		{"GPIO_RESET_PWROK", "GPIO_RESET_RSMRST"}, -		{"GPIO_NO_INVERT", "GPIO_INVERT"}, -		{"GPIO_NO_BLINK", "GPIO_BLINK"}, -	} - -	for i := uint(0); i < max; i++ { -		if (constraint>>i)&1 == 1 { -			fmt.Fprintf(sb, "	.gpio%d = %s,\n", -				(set-1)*32+i, -				bits[partno][(val>>i)&1]) -		} -	} -} - -func GPIO(ctx Context, inteltool InteltoolData) { -	var constraint uint32 -	gpio := Create(ctx, "gpio.c") -	defer gpio.Close() - -	AddBootBlockFile("gpio.c", "") -	AddROMStageFile("gpio.c", "") - -	Add_gpl(gpio) -	gpio.WriteString("#include <southbridge/intel/common/gpio.h>\n\n") - -	addresses := [3][6]int{ -		{0x00, 0x04, 0x0c, 0x60, 0x2c, 0x18}, -		{0x30, 0x34, 0x38, 0x64, -1, -1}, -		{0x40, 0x44, 0x48, 0x68, -1, -1}, -	} - -	for set := 1; set <= 3; set++ { -		for partno, part := range []string{"mode", "direction", "level", "reset", "invert", "blink"} { -			addr := addresses[set-1][partno] -			if addr < 0 { -				continue -			} -			fmt.Fprintf(gpio, "static const struct pch_gpio_set%d pch_gpio_set%d_%s = {\n", -				set, set, part) - -			constraint = 0xffffffff -			switch part { -			case "direction": -				/* Ignored on native mode */ -				constraint = inteltool.GPIO[uint16(addresses[set-1][0])] -			case "level": -				/* Level doesn't matter for input */ -				constraint = inteltool.GPIO[uint16(addresses[set-1][0])] -				constraint &^= inteltool.GPIO[uint16(addresses[set-1][1])] -			case "reset": -				/* Only show reset */ -				constraint = inteltool.GPIO[uint16(addresses[set-1][3])] -			case "invert": -				/* Only on input and only show inverted GPIO */ -				constraint = inteltool.GPIO[uint16(addresses[set-1][0])] -				constraint &= inteltool.GPIO[uint16(addresses[set-1][1])] -				constraint &= inteltool.GPIO[uint16(addresses[set-1][4])] -			case "blink": -				/* Only on output and only show blinking GPIO */ -				constraint = inteltool.GPIO[uint16(addresses[set-1][0])] -				constraint &^= inteltool.GPIO[uint16(addresses[set-1][1])] -				constraint &= inteltool.GPIO[uint16(addresses[set-1][5])] -			} -			writeGPIOSet(ctx, gpio, inteltool.GPIO[uint16(addr)], uint(set), partno, constraint) -			gpio.WriteString("};\n\n") -		} -	} - -	gpio.WriteString(`const struct pch_gpio_map mainboard_gpio_map = { -	.set1 = { -		.mode		= &pch_gpio_set1_mode, -		.direction	= &pch_gpio_set1_direction, -		.level		= &pch_gpio_set1_level, -		.blink		= &pch_gpio_set1_blink, -		.invert		= &pch_gpio_set1_invert, -		.reset		= &pch_gpio_set1_reset, -	}, -	.set2 = { -		.mode		= &pch_gpio_set2_mode, -		.direction	= &pch_gpio_set2_direction, -		.level		= &pch_gpio_set2_level, -		.reset		= &pch_gpio_set2_reset, -	}, -	.set3 = { -		.mode		= &pch_gpio_set3_mode, -		.direction	= &pch_gpio_set3_direction, -		.level		= &pch_gpio_set3_level, -		.reset		= &pch_gpio_set3_reset, -	}, -}; -`) -} diff --git a/util/autoport/haswell.go b/util/autoport/haswell.go deleted file mode 100644 index 645b197a..00000000 --- a/util/autoport/haswell.go +++ /dev/null @@ -1,139 +0,0 @@ -package main - -import "fmt" - -type haswellmc struct { -	variant string -} - -func divceil(a uint32, b uint32) uint32 { -	return (a + b - 1) / b -} - -func getPanelCfg(inteltool InteltoolData, isULT bool) string { -	var refclk uint32 -	var pwm_hz uint32 - -	if isULT { -		refclk = 24000000 -	} else { -		refclk = 135000000 -	} -	if (inteltool.IGD[0xc8254] >> 16) != 0 { -		pwm_hz = refclk / 128 / (inteltool.IGD[0xc8254] >> 16) -	} else { -		pwm_hz = 0 -	} - -	gpu_panel_power_up_delay := (inteltool.IGD[0xc7208] >> 16) & 0x1fff -	gpu_panel_power_backlight_on_delay := inteltool.IGD[0xc7208] & 0x1fff -	gpu_panel_power_down_delay := (inteltool.IGD[0xc720c] >> 16) & 0x1fff -	gpu_panel_power_backlight_off_delay := inteltool.IGD[0xc720c] & 0x1fff -	gpu_panel_power_cycle_delay := inteltool.IGD[0xc7210] & 0x1f - -	return fmt.Sprintf(`{ -		.up_delay_ms		= %3d, -		.down_delay_ms		= %3d, -		.cycle_delay_ms		= %3d, -		.backlight_on_delay_ms	= %3d, -		.backlight_off_delay_ms	= %3d, -		.backlight_pwm_hz	= %3d, -	}`, -		divceil(gpu_panel_power_up_delay, 10), -		divceil(gpu_panel_power_down_delay, 10), -		(gpu_panel_power_cycle_delay-1)*100, -		divceil(gpu_panel_power_backlight_on_delay, 10), -		divceil(gpu_panel_power_backlight_off_delay, 10), -		pwm_hz) -} - -func (i haswellmc) Scan(ctx Context, addr PCIDevData) { -	inteltool := ctx.InfoSource.GetInteltool() - -	isULT := (i.variant == "ULT") -	DevTree = DevTreeNode{ -		Chip:          "northbridge/intel/haswell", -		MissingParent: "northbridge", -		Comment:       "FIXME: check ec_present, usb_xhci_on_resume, gfx", -		Registers: map[string]string{ -			"gpu_dp_b_hotplug":    FormatInt32((inteltool.IGD[0xc4030] >> 2) & 7), -			"gpu_dp_c_hotplug":    FormatInt32((inteltool.IGD[0xc4030] >> 10) & 7), -			"gpu_dp_d_hotplug":    FormatInt32((inteltool.IGD[0xc4030] >> 18) & 7), -			"panel_cfg":           getPanelCfg(inteltool, isULT), -			"gpu_ddi_e_connected": FormatBool(((inteltool.IGD[0x64000] >> 4) & 1) == 0), -			"ec_present":          "false", -			"usb_xhci_on_resume":  "false", -			/* FIXME:XX hardcoded.  */ -			"gfx": "GMA_STATIC_DISPLAYS(0)", -		}, -		Children: []DevTreeNode{ -			{ -				Chip: "cpu/intel/haswell", -				Children: []DevTreeNode{ -					{ -						Chip: "cpu_cluster", -						Dev:  0, -						Ops:  "haswell_cpu_bus_ops", -					}, -				}, -			}, - -			{ -				Chip:          "domain", -				Dev:           0, -				Ops:           "haswell_pci_domain_ops", -				PCIController: true, -				ChildPCIBus:   0, -				PCISlots: []PCISlot{ -					PCISlot{PCIAddr: PCIAddr{Dev: 0x0, Func: 0}, writeEmpty: true, additionalComment: i.variant}, -					PCISlot{PCIAddr: PCIAddr{Dev: 0x1, Func: 0}, writeEmpty: !isULT, additionalComment: "PCIe Bridge for discrete graphics"}, -					PCISlot{PCIAddr: PCIAddr{Dev: 0x2, Func: 0}, writeEmpty: true, additionalComment: "Internal graphics"}, -					PCISlot{PCIAddr: PCIAddr{Dev: 0x3, Func: 0}, writeEmpty: true, additionalComment: "Mini-HD audio"}, -				}, -			}, -		}, -	} - -	if isULT { -		DevTree.Registers["dq_pins_interleaved"] = FormatBool(((inteltool.MCHBAR[0x2008] >> 10) & 1) == 0) -	} - -	PutPCIDev(addr, "Host bridge") - -	KconfigBool["NORTHBRIDGE_INTEL_HASWELL"] = true -	KconfigBool["HAVE_ACPI_TABLES"] = true -	KconfigBool["HAVE_ACPI_RESUME"] = true - -	DSDTIncludes = append(DSDTIncludes, DSDTInclude{ -		File: "cpu/intel/common/acpi/cpu.asl", -	}) - -	DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{ -		File: "northbridge/intel/haswell/acpi/hostbridge.asl", -	}, DSDTInclude{ -		File:    "drivers/intel/gma/acpi/default_brightness_levels.asl", -		Comment: "FIXME: remove this if the board doesn't have backlight", -	}) -} - -func init() { -	RegisterPCI(0x8086, 0x0c00, haswellmc{variant: "Desktop"}) -	RegisterPCI(0x8086, 0x0c04, haswellmc{variant: "Mobile"}) -	RegisterPCI(0x8086, 0x0a04, haswellmc{variant: "ULT"}) -	RegisterPCI(0x8086, 0x0c08, haswellmc{variant: "Server"}) -	RegisterPCI(0x8086, 0x0d00, haswellmc{variant: "Crystal Well Desktop"}) -	RegisterPCI(0x8086, 0x0d04, haswellmc{variant: "Crystal Well Mobile"}) -	RegisterPCI(0x8086, 0x0d08, haswellmc{variant: "Crystal Well Server"}) -	for _, id := range []uint16{ -		0x0402, 0x0412, 0x0422, /* Desktop */ -		0x0406, 0x0416, 0x0426, /* Mobile */ -		0x040a, 0x041a, 0x042a, /* Server */ -		0x0a06, 0x0a16, 0x0a26, /* ULT */ -		0x0d16, 0x0d22, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */ -	} { -		RegisterPCI(0x8086, id, GenericVGA{GenericPCI{Comment: "VGA controller"}}) -	} -	/* CPU HD Audio */ -	RegisterPCI(0x8086, 0x0a0c, GenericPCI{}) -	RegisterPCI(0x8086, 0x0c0c, GenericPCI{}) -} diff --git a/util/autoport/log_maker.go b/util/autoport/log_maker.go deleted file mode 100644 index 2a524d38..00000000 --- a/util/autoport/log_maker.go +++ /dev/null @@ -1,190 +0,0 @@ -package main - -import ( -	"errors" -	"fmt" -	"io" -	"io/ioutil" -	"log" -	"os" -	"os/exec" -	"strings" -	"bytes" -) - -func TryRunAndSave(output string, name string, arg []string) error { -	cmd := exec.Command(name, arg...) - -	f, err := os.Create(output) -	if err != nil { -		log.Fatal(err) -	} - -	cmd.Stdout = f -	cmd.Stderr = f - -	err = cmd.Start() -	if err != nil { -		return err -	} -	cmd.Wait() -	return nil -} - -func RunAndSave(output string, name string, arg ...string) { -	err := TryRunAndSave(output, name, arg) -	if err == nil { -		return -	} -	idx := strings.LastIndex(name, "/") -	relname := name -	if idx >= 0 { -		relname = name[idx+1:] -	} -	relname = "./" + relname -	err = TryRunAndSave(output, relname, arg) -	if err != nil { -		log.Fatal(err) -	} -} - -const MAXPROMPTRETRY = 3 - -func PromptUser(prompt string, opts []string) (match string, err error) { -	for i := 1; i < MAXPROMPTRETRY; i++ { -		fmt.Printf("%s. (%s) Default:%s\n", prompt, -		           strings.Join(opts, "/"), opts[0]) -		var usrInput string -		fmt.Scanln(&usrInput) - -		// Check for default entry -		if usrInput == "" { -			match = opts[0] -			return -		} - -		for _, opt := range opts { -			if opt == usrInput { -				match = opt -				return -			} -		} -	} -	err = errors.New("max retries exceeded") -	fmt.Fprintln(os.Stderr, "ERROR: max retries exceeded") -	return -} - -func MakeHDALogs(outDir string, cardName string) { -	SysDir := "/sys/class/sound/" + cardName + "/" -	files, _ := ioutil.ReadDir(SysDir) -	for _, f := range files { -		if (strings.HasPrefix(f.Name(), "hw") || strings.HasPrefix(f.Name(), "hdaudio")) && f.IsDir() { -			in, err := os.Open(SysDir + f.Name() + "/init_pin_configs") -			defer in.Close() -			if err != nil { -				log.Fatal(err) -			} -			out, err := os.Create(outDir + "/pin_" + strings.Replace(f.Name(), "hdaudio", "hw", -1)) -			if err != nil { -				log.Fatal(err) -			} -			defer out.Close() -			io.Copy(out, in) -		} -	} - -	ProcDir := "/proc/asound/" + cardName + "/" -	files, _ = ioutil.ReadDir(ProcDir) -	for _, f := range files { -		if strings.HasPrefix(f.Name(), "codec#") && !f.IsDir() { -			in, err := os.Open(ProcDir + f.Name()) -			defer in.Close() -			if err != nil { -				log.Fatal(err) -			} -			out, err := os.Create(outDir + "/" + f.Name()) -			if err != nil { -				log.Fatal(err) -			} -			defer out.Close() -			io.Copy(out, in) -		} -	} -} - -func MakeLogs(outDir string) { -	os.MkdirAll(outDir, 0700) -	RunAndSave(outDir+"/lspci.log", "lspci", "-nnvvvxxxx") -	RunAndSave(outDir+"/dmidecode.log", "dmidecode") -	RunAndSave(outDir+"/acpidump.log", "acpidump") - -	inteltoolArgs := "-a" -	opt, err := PromptUser("WARNING: The following tool MAY cause your system to hang when it attempts "+ -		"to probe for graphics registers.  Having the graphics registers will help create a better port. "+ -		"Should autoport probe these registers?", -		[]string{"y", "yes", "n", "no"}) - -	// Continue even if there is an error - -	switch opt { -	case "y", "yes": -		inteltoolArgs += "f" -	} - -	RunAndSave(outDir+"/inteltool.log", "../inteltool/inteltool", inteltoolArgs) -	RunAndSave(outDir+"/ectool.log", "../ectool/ectool", "-pd") -	RunAndSave(outDir+"/superiotool.log", "../superiotool/superiotool", "-ade") - -	SysSound := "/sys/class/sound/" -	card := "" -	cards, _ := ioutil.ReadDir(SysSound) -	for _, f := range cards { -		if strings.HasPrefix(f.Name(), "card") { -			cid, err := ioutil.ReadFile(SysSound + f.Name() + "/id") -			if err == nil && bytes.Equal(cid, []byte("PCH\n")) { -				fmt.Fprintln(os.Stderr, "PCH sound card is", f.Name()) -				card = f.Name() -			} -		} -	} - -	if card != "" { -		MakeHDALogs(outDir, card) -	} else { -		fmt.Fprintln(os.Stderr, "HDAudio not found on PCH.") -	} - -	for _, fname := range []string{"cpuinfo", "ioports"} { -		in, err := os.Open("/proc/" + fname) -		defer in.Close() -		if err != nil { -			log.Fatal(err) -		} -		out, err := os.Create(outDir + "/" + fname + ".log") -		if err != nil { -			log.Fatal(err) -		} -		defer out.Close() -		io.Copy(out, in) -	} - -	out, err := os.Create(outDir + "/input_bustypes.log") -	if err != nil { -		log.Fatal(err) -	} -	defer out.Close() - -	ClassInputDir := "/sys/class/input/" -	files, _ := ioutil.ReadDir(ClassInputDir) -	for _, f := range files { -		if strings.HasPrefix(f.Name(), "input") && !f.Mode().IsRegular() { /* Allow both dirs and symlinks.  */ -			in, err := os.Open(ClassInputDir + f.Name() + "/id/bustype") -			defer in.Close() -			if err != nil { -				log.Fatal(err) -			} -			io.Copy(out, in) -		} -	} -} diff --git a/util/autoport/log_reader.go b/util/autoport/log_reader.go deleted file mode 100644 index b0518d25..00000000 --- a/util/autoport/log_reader.go +++ /dev/null @@ -1,417 +0,0 @@ -package main - -import ( -	"bufio" -	"flag" -	"fmt" -	"log" -	"os" -	"regexp" -	"strconv" -	"strings" -) - -type LogDevReader struct { -	InputDirectory string -	ACPITables     map[string][]byte -	EC             []byte -} - -func isXDigit(x uint8) bool { -	if x >= '0' && x <= '9' { -		return true -	} -	if x >= 'a' && x <= 'f' { -		return true -	} -	if x >= 'A' && x <= 'F' { -		return true -	} -	return false -} - -type HexLine struct { -	length uint -	values [16]byte -	start  uint -} - -func (l *LogDevReader) ReadHexLine(line string) (hex HexLine) { -	hex.start = 0 -	line = strings.Trim(line, " ") -	fmt.Sscanf(line, "%x:", &hex.start) -	ll, _ := fmt.Sscanf(line, "%x: %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x", &hex.start, -		&hex.values[0], &hex.values[1], &hex.values[2], -		&hex.values[3], &hex.values[4], &hex.values[5], -		&hex.values[6], &hex.values[7], &hex.values[8], -		&hex.values[9], &hex.values[10], &hex.values[11], -		&hex.values[12], &hex.values[13], &hex.values[14], -		&hex.values[15]) -	hex.length = uint(ll - 1) -	return -} - -func (l *LogDevReader) AssignHexLine(inp string, target []byte) []byte { -	hex := l.ReadHexLine(inp) -	if hex.start+hex.length > uint(len(target)) { -		target = target[0 : hex.start+hex.length] -	} -	copy(target[hex.start:hex.start+hex.length], hex.values[0:hex.length]) -	return target -} - -func (l *LogDevReader) GetEC() []byte { -	if l.EC != nil { -		return l.EC -	} -	l.EC = make([]byte, 0x100, 0x100) - -	file, err := os.Open(l.InputDirectory + "/ectool.log") -	if err != nil { -		log.Fatal(err) -	} -	defer file.Close() - -	scanner := bufio.NewScanner(file) - -	for scanner.Scan() { -		line := scanner.Text() -		if len(line) > 7 && isXDigit(line[0]) && isXDigit(line[1]) && line[2] == ':' { -			l.EC = l.AssignHexLine(line, l.EC) -		} -	} - -	if err := scanner.Err(); err != nil { -		log.Fatal(err) -	} - -	return l.EC -} - -func (l *LogDevReader) GetACPI() (Tables map[string][]byte) { -	if l.ACPITables != nil { -		return l.ACPITables -	} -	l.ACPITables = Tables - -	file, err := os.Open(l.InputDirectory + "/acpidump.log") -	if err != nil { -		log.Fatal(err) -	} -	defer file.Close() - -	scanner := bufio.NewScanner(file) - -	Tables = map[string][]byte{} - -	curTable := "" -	for scanner.Scan() { -		line := scanner.Text() -		/* Only supports ACPI tables up to 0x100000 in size, FIXME if needed */ -		is_hexline, _ := regexp.MatchString(" *[0-9A-Fa-f]{4,5}: ", line) -		switch { -		case len(line) >= 6 && line[5] == '@': -			curTable = line[0:4] -			Tables[curTable] = make([]byte, 0, 0x100000) -		case is_hexline: -			Tables[curTable] = l.AssignHexLine(line, Tables[curTable]) -		} -	} - -	if err := scanner.Err(); err != nil { -		log.Fatal(err) -	} - -	return -} - -func (l *LogDevReader) GetPCIList() (PCIList []PCIDevData) { -	file, err := os.Open(l.InputDirectory + "/lspci.log") -	if err != nil { -		log.Fatal(err) -	} -	defer file.Close() - -	scanner := bufio.NewScanner(file) - -	PCIList = []PCIDevData{} - -	for scanner.Scan() { -		line := scanner.Text() -		switch { -		case !(len(line) < 7 || !isXDigit(line[0]) || !isXDigit(line[1]) || line[2] != ':' || !isXDigit(line[3]) || !isXDigit(line[4]) || line[5] != '.' || !isXDigit(line[6])): -			cur := PCIDevData{} -			fmt.Sscanf(line, "%x:%x.%x", &cur.Bus, &cur.Dev, &cur.Func) -			lc := strings.LastIndex(line, ":") -			li := strings.LastIndex(line[0:lc], "[") -			if li < 0 { -				continue -			} -			ven := 0 -			dev := 0 -			fmt.Sscanf(line[li+1:], "%x:%x", &ven, &dev) -			cur.PCIDevID = uint16(dev) -			cur.PCIVenID = uint16(ven) -			cur.ConfigDump = make([]byte, 0x100, 0x1000) -			PCIList = append(PCIList, cur) -		case len(line) > 7 && isXDigit(line[0]) && line[1] == '0' && line[2] == ':': -			start := 0 -			fmt.Sscanf(line, "%x:", &start) -			cur := &PCIList[len(PCIList)-1] -			cur.ConfigDump = l.AssignHexLine(line, cur.ConfigDump) -		} -	} - -	if err := scanner.Err(); err != nil { -		log.Fatal(err) -	} - -	return -} - -func (l *LogDevReader) GetInteltool() (ret InteltoolData) { -	file, err := os.Open(l.InputDirectory + "/inteltool.log") -	if err != nil { -		log.Fatal(err) -	} -	defer file.Close() - -	scanner := bufio.NewScanner(file) -	paragraph := "" -	ret.GPIO = map[uint16]uint32{} -	ret.RCBA = map[uint16]uint32{} -	ret.IOBP = map[uint32]uint32{} -	ret.IGD = map[uint32]uint32{} -	ret.MCHBAR = map[uint16]uint32{} -	ret.PMBASE = map[uint16]uint32{} -	for scanner.Scan() { -		line := scanner.Text() -		switch { -		case len(line) > 7 && line[0] == '0' && line[1] == 'x' && line[6] == ':' && paragraph == "RCBA": -			addr, value := 0, 0 -			fmt.Sscanf(line, "0x%x: 0x%x", &addr, &value) -			ret.RCBA[uint16(addr)] = uint32(value) -		case len(line) > 11 && line[0] == '0' && line[1] == 'x' && line[10] == ':' && paragraph == "IOBP": -			addr, value := 0, 0 -			fmt.Sscanf(line, "0x%x: 0x%x", &addr, &value) -			ret.IOBP[uint32(addr)] = uint32(value) -		case len(line) > 9 && line[0] == '0' && line[1] == 'x' && line[8] == ':' && paragraph == "IGD": -			addr, value := 0, 0 -			fmt.Sscanf(line, "0x%x: 0x%x", &addr, &value) -			ret.IGD[uint32(addr)] = uint32(value) -		case len(line) > 7 && line[0] == '0' && line[1] == 'x' && line[6] == ':' && paragraph == "MCHBAR": -			addr, value := 0, 0 -			fmt.Sscanf(line, "0x%x: 0x%x", &addr, &value) -			ret.MCHBAR[uint16(addr)] = uint32(value) -		case strings.Contains(line, "DEFAULT"): -			continue -		case strings.Contains(line, "DIFF"): -			continue -		case strings.HasPrefix(line, "gpiobase"): -			addr, value := 0, 0 -			fmt.Sscanf(line, "gpiobase+0x%x: 0x%x", &addr, &value) -			ret.GPIO[uint16(addr)] = uint32(value) -		case strings.HasPrefix(line, "pmbase"): -			addr, value := 0, 0 -			fmt.Sscanf(line, "pmbase+0x%x: 0x%x", &addr, &value) -			ret.PMBASE[uint16(addr)] = uint32(value) -		case strings.HasPrefix(line, "============="): -			paragraph = strings.Trim(line, "= ") -		} -	} - -	if err := scanner.Err(); err != nil { -		log.Fatal(err) -	} -	return -} - -func (l *LogDevReader) GetDMI() (ret DMIData) { -	file, err := os.Open(l.InputDirectory + "/dmidecode.log") -	if err != nil { -		log.Fatal(err) -	} -	defer file.Close() - -	scanner := bufio.NewScanner(file) -	paragraph := "" -	for scanner.Scan() { -		line := scanner.Text() -		if !strings.HasPrefix(line, "\t") { -			paragraph = strings.TrimSpace(line) -			continue -		} -		idx := strings.Index(line, ":") -		if idx < 0 { -			continue -		} -		name := strings.TrimSpace(line[0:idx]) -		value := strings.TrimSpace(line[idx+1:]) -		switch paragraph + ":" + name { -		case "System Information:Manufacturer": -			ret.Vendor = value -		case "System Information:Product Name": -			ret.Model = value -		case "System Information:Version": -			ret.Version = value -		case "Chassis Information:Type": -			ret.IsLaptop = (value == "Notebook" || value == "Laptop") -		} -	} - -	if err := scanner.Err(); err != nil { -		log.Fatal(err) -	} -	return -} - -func (l *LogDevReader) GetAzaliaCodecs() (ret []AzaliaCodec) { -	cardno := -1 -	for i := 0; i < 10; i++ { -		pin, err := os.Open(l.InputDirectory + "/pin_hwC" + strconv.Itoa(i) + "D0") -		if err == nil { -			pin.Close() -			cardno = i -			break -		} -	} -	if cardno == -1 { -		return -	} -	for codecno := 0; codecno < 10; codecno++ { -		cur := AzaliaCodec{CodecNo: codecno, PinConfig: map[int]uint32{}} -		codec, err := os.Open(l.InputDirectory + "/codec#" + strconv.Itoa(codecno)) -		if err != nil { -			continue -		} -		defer codec.Close() -		pin, err := os.Open(l.InputDirectory + "/pin_hwC" + strconv.Itoa(cardno) + -			"D" + strconv.Itoa(codecno)) -		if err != nil { -			continue -		} -		defer pin.Close() - -		scanner := bufio.NewScanner(codec) -		for scanner.Scan() { -			line := scanner.Text() -			if strings.HasPrefix(line, "Codec:") { -				fmt.Sscanf(line, "Codec: %s", &cur.Name) -				continue -			} -			if strings.HasPrefix(line, "Vendor Id:") { -				fmt.Sscanf(line, "Vendor Id: 0x%x", &cur.VendorID) -				continue -			} -			if strings.HasPrefix(line, "Subsystem Id:") { -				fmt.Sscanf(line, "Subsystem Id: 0x%x", &cur.SubsystemID) -				continue -			} -		} - -		scanner = bufio.NewScanner(pin) -		for scanner.Scan() { -			line := scanner.Text() -			addr := 0 -			val := uint32(0) -			fmt.Sscanf(line, "0x%x 0x%x", &addr, &val) -			cur.PinConfig[addr] = val -		} -		ret = append(ret, cur) -	} -	return -} - -func (l *LogDevReader) GetIOPorts() []IOPorts { -	file, err := os.Open(l.InputDirectory + "/ioports.log") -	if err != nil { -		log.Fatal(err) -	} -	defer file.Close() -	scanner := bufio.NewScanner(file) -	ret := make([]IOPorts, 0, 100) -	for scanner.Scan() { -		line := scanner.Text() -		el := IOPorts{} -		fmt.Sscanf(line, " %x-%x : %s", &el.Start, &el.End, &el.Usage) -		ret = append(ret, el) -	} - -	if err := scanner.Err(); err != nil { -		log.Fatal(err) -	} -	return ret - -} - -func (l *LogDevReader) GetCPUModel() (ret []uint32) { -	file, err := os.Open(l.InputDirectory + "/cpuinfo.log") -	if err != nil { -		log.Fatal(err) -	} -	defer file.Close() - -	scanner := bufio.NewScanner(file) -	ret = make([]uint32, 0, 100) -	proc := 0 -	for scanner.Scan() { -		line := scanner.Text() -		sep := strings.Index(line, ":") -		if sep < 0 { -			continue -		} -		key := strings.TrimSpace(line[0:sep]) -		val := strings.TrimSpace(line[sep+1:]) - -		if key == "processor" { -			proc, _ := strconv.Atoi(val) -			if len(ret) <= proc { -				ret = ret[0 : proc+1] -			} -			continue -		} -		if key == "cpu family" { -			family, _ := strconv.Atoi(val) -			ret[proc] |= uint32(((family & 0xf) << 8) | ((family & 0xff0) << 16)) -		} -		if key == "model" { -			model, _ := strconv.Atoi(val) -			ret[proc] |= uint32(((model & 0xf) << 4) | ((model & 0xf0) << 12)) -		} -		if key == "stepping" { -			stepping, _ := strconv.Atoi(val) -			ret[proc] |= uint32(stepping & 0xf) -		} -	} - -	if err := scanner.Err(); err != nil { -		log.Fatal(err) -	} -	return -} - -func (l *LogDevReader) HasPS2() bool { -	file, err := os.Open(l.InputDirectory + "/input_bustypes.log") -	if err != nil { -		log.Fatal(err) -	} -	defer file.Close() -	scanner := bufio.NewScanner(file) -	for scanner.Scan() { -		line := scanner.Text() -		if strings.Index(line, "0011") >= 0 { -			return true -		} -	} -	return false -} - -var FlagLogInput = flag.String("input_log", ".", "Input log directory") -var FlagLogMkLogs = flag.Bool("make_logs", false, "Dump logs") - -func MakeLogReader() *LogDevReader { -	if *FlagLogMkLogs { -		MakeLogs(*FlagLogInput) -	} -	return &LogDevReader{InputDirectory: *FlagLogInput} -} diff --git a/util/autoport/lynxpoint.go b/util/autoport/lynxpoint.go deleted file mode 100644 index 98a1ca82..00000000 --- a/util/autoport/lynxpoint.go +++ /dev/null @@ -1,490 +0,0 @@ -package main - -import "fmt" - -type LPVariant int - -const ( -	LYNX_POINT_MOBILE LPVariant = iota -	LYNX_POINT_DESKTOP -	LYNX_POINT_SERVER -	LYNX_POINT_ULT -) - -type lynxpoint struct { -	variant LPVariant -	node    *DevTreeNode -} - -func lpPchGetFlashSize(ctx Context) { -	inteltool := ctx.InfoSource.GetInteltool() -	/* In LP PCH, Boot BIOS Straps field in GCS has only one bit.  */ -	switch (inteltool.RCBA[0x3410] >> 10) & 1 { -	case 0: -		ROMProtocol = "SPI" -		highflkb := uint32(0) -		for reg := uint16(0); reg < 5; reg++ { -			fl := (inteltool.RCBA[0x3854+4*reg] >> 16) & 0x1fff -			flkb := (fl + 1) << 2 -			if flkb > highflkb { -				highflkb = flkb -			} -		} -		ROMSizeKB = int(highflkb) -		FlashROMSupport = "y" -	} -} - -func (b lynxpoint) GetGPIOHeader() string { -	return "southbridge/intel/lynxpoint/pch.h" -} - -func (b lynxpoint) EnableGPE(in int) { -	if b.variant != LYNX_POINT_ULT { -		b.node.Registers[fmt.Sprintf("gpi%d_routing", in)] = "2" -	} -} - -func (b lynxpoint) EncodeGPE(in int) int { -	return in + 0x10 -} - -func (b lynxpoint) DecodeGPE(in int) int { -	return in - 0x10 -} - -func (b lynxpoint) NeedRouteGPIOManually() { -	b.node.Comment += ", FIXME: set gpiX_routing for EC support" -} - -func GetLptDesktopEHCISetting(loc_param uint32, txamp uint32) (string, int) { -	var port_pos string -	var port_length int - -	if loc_param == 4 { -		port_pos = "USB_PORT_BACK_PANEL" -		if txamp <= 2 { -			port_length = 0x40 -		} else if txamp >= 4 { -			port_length = 0x140 -		} else { -			port_length = 0x110 -		} -	} else { -		port_pos = "USB_PORT_FLEX" -		port_length = 0x40 -	} -	return port_pos, port_length -} - -func GetLptMobileEHCISetting(loc_param uint32, txamp uint32) (string, int) { -	var port_pos string -	var port_length int - -	if loc_param == 4 { -		port_pos = "USB_PORT_DOCK" -		if txamp <= 1 { -			port_length = 0x40 -		} else { -			port_length = 0x80 -		} -	} else if loc_param == 6 { -		/* not internal, not dock, port_length >= 0x70 */ -		port_pos = "USB_PORT_BACK_PANEL" -		if txamp <= 2 { -			port_length = 0x80 -		} else { -			port_length = 0x110 -		} -	} else { -		port_pos = "USB_PORT_BACK_PANEL" -		port_length = 0x40 -	} -	return port_pos, port_length -} - -func GetLptLPEHCISetting(loc_param uint32, txamp uint32) (string, int) { -	var port_pos string -	var port_length int - -	if loc_param == 6 { -		/* back panel or mini pcie, length >= 0x70 */ -		port_pos = "USB_PORT_MINI_PCIE" -		if txamp <= 2 { -			port_length = 0x80 -		} else { -			port_length = 0x110 -		} -	} else if loc_param == 4 { -		port_pos = "USB_PORT_DOCK" -		if txamp <= 1 { -			port_length = 0x40 -		} else { -			port_length = 0x80 -		} -	} else { -		port_pos = "USB_PORT_BACK_PANEL" -		port_length = 0x40 -	} -	return port_pos, port_length -} - -func (b lynxpoint) Scan(ctx Context, addr PCIDevData) { - -	SouthBridge = &b - -	inteltool := ctx.InfoSource.GetInteltool() - -	isULT := (b.variant == LYNX_POINT_ULT) - -	if isULT { -		Lynxpoint_LP_GPIO(ctx, inteltool) -	} else { -		GPIO(ctx, inteltool) -	} - -	KconfigBool["SOUTHBRIDGE_INTEL_LYNXPOINT"] = true -	if isULT { -		KconfigBool["INTEL_LYNXPOINT_LP"] = true -	} -	KconfigBool["SERIRQ_CONTINUOUS_MODE"] = true -	if isULT { -		KconfigInt["USBDEBUG_HCD_INDEX"] = 1 -	} else { -		KconfigInt["USBDEBUG_HCD_INDEX"] = 2 -		KconfigComment["USBDEBUG_HCD_INDEX"] = "FIXME: check this" -	} - -	if isULT { -		lpPchGetFlashSize(ctx) -	} else { -		ich9GetFlashSize(ctx) -	} - -	FADT := ctx.InfoSource.GetACPI()["FACP"] - -	sp0dtle_data := (inteltool.IOBP[0xea002750] >> 24) & 0xf -	sp0dtle_edge := (inteltool.IOBP[0xea002754] >> 16) & 0xf -	sp1dtle_data := (inteltool.IOBP[0xea002550] >> 24) & 0xf -	sp1dtle_edge := (inteltool.IOBP[0xea002554] >> 16) & 0xf - -	if sp0dtle_data != sp0dtle_edge { -		fmt.Printf("Different SATA Gen3 port0 DTLE data and edge values are used.\n") -	} - -	if sp1dtle_data != sp1dtle_edge { -		fmt.Printf("Different SATA Gen3 port1 DTLE data and edge values are used.\n") -	} - -	cur := DevTreeNode{ -		Chip:    "southbridge/intel/lynxpoint", -		Comment: "Intel Series 8 Lynx Point PCH", - -		/* alt_gp_smi_en is not generated because coreboot doesn't use SMI like OEM firmware */ -		Registers: map[string]string{ -			"gen1_dec":             FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x84:0x88]), -			"gen2_dec":             FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x88:0x8c]), -			"gen3_dec":             FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x8c:0x90]), -			"gen4_dec":             FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x90:0x94]), -			"sata_port_map":        fmt.Sprintf("0x%x", PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 2}].ConfigDump[0x92]&0x3f), -			"docking_supported":    (FormatBool((FADT[113] & (1 << 1)) != 0)), -			"sata_port0_gen3_dtle": fmt.Sprintf("0x%x", sp0dtle_data), -			"sata_port1_gen3_dtle": fmt.Sprintf("0x%x", sp1dtle_data), -		}, -		PCISlots: []PCISlot{ -			PCISlot{PCIAddr: PCIAddr{Dev: 0x13, Func: 0}, writeEmpty: isULT, additionalComment: "Smart Sound Audio DSP"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x14, Func: 0}, writeEmpty: true, additionalComment: "xHCI Controller"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 0}, writeEmpty: isULT, additionalComment: "Serial I/O DMA"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 1}, writeEmpty: isULT, additionalComment: "I2C0"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 2}, writeEmpty: isULT, additionalComment: "I2C1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 3}, writeEmpty: isULT, additionalComment: "GSPI0"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 4}, writeEmpty: isULT, additionalComment: "GSPI1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 5}, writeEmpty: isULT, additionalComment: "UART0"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 6}, writeEmpty: isULT, additionalComment: "UART1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 0}, writeEmpty: true, additionalComment: "Management Engine Interface 1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 1}, writeEmpty: true, additionalComment: "Management Engine Interface 2"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 2}, writeEmpty: true, additionalComment: "Management Engine IDE-R"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 3}, writeEmpty: true, additionalComment: "Management Engine KT"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x17, Func: 0}, writeEmpty: isULT, additionalComment: "SDIO"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x19, Func: 0}, writeEmpty: true, additionalComment: "Intel Gigabit Ethernet"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1a, Func: 0}, writeEmpty: !isULT, additionalComment: "USB2 EHCI #2"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1b, Func: 0}, writeEmpty: true, additionalComment: "High Definition Audio"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 0}, writeEmpty: true, additionalComment: "PCIe Port #1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 1}, writeEmpty: true, additionalComment: "PCIe Port #2"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 2}, writeEmpty: true, additionalComment: "PCIe Port #3"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 3}, writeEmpty: true, additionalComment: "PCIe Port #4"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 4}, writeEmpty: true, additionalComment: "PCIe Port #5"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 5}, writeEmpty: true, additionalComment: "PCIe Port #6"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 6}, writeEmpty: !isULT, additionalComment: "PCIe Port #7"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 7}, writeEmpty: !isULT, additionalComment: "PCIe Port #8"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1d, Func: 0}, writeEmpty: true, additionalComment: "USB2 EHCI #1"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 0}, writeEmpty: true, additionalComment: "LPC bridge"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 2}, writeEmpty: true, additionalComment: "SATA Controller (AHCI)"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 3}, writeEmpty: true, additionalComment: "SMBus"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 5}, writeEmpty: !isULT, additionalComment: "SATA Controller (Legacy)"}, -			PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 6}, writeEmpty: true, additionalComment: "Thermal"}, -		}, -	} - -	if isULT { -		cur.Registers["gpe0_en_1"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x90]) -		cur.Registers["gpe0_en_2"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x94]) -		cur.Registers["gpe0_en_3"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x98]) -		cur.Registers["gpe0_en_4"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x9c]) -	} else { -		cur.Registers["gpe0_en_1"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x28]) -		cur.Registers["gpe0_en_2"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x2c]) -	} - -	b.node = &cur - -	PutPCIChip(addr, cur) -	PutPCIDevParent(addr, "", "lpc") - -	DSDTIncludes = append(DSDTIncludes, DSDTInclude{ -		File: "southbridge/intel/common/acpi/platform.asl", -	}) -	DSDTIncludes = append(DSDTIncludes, DSDTInclude{ -		File:    "southbridge/intel/lynxpoint/acpi/globalnvs.asl", -		Comment: "global NVS and variables", -	}) -	DSDTIncludes = append(DSDTIncludes, DSDTInclude{ -		File: "southbridge/intel/common/acpi/sleepstates.asl", -	}) -	DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{ -		File: "southbridge/intel/lynxpoint/acpi/pch.asl", -	}) - -	AddBootBlockFile("bootblock.c", "") -	bb := Create(ctx, "bootblock.c") -	defer bb.Close() -	Add_gpl(bb) -	bb.WriteString(`#include <southbridge/intel/lynxpoint/pch.h> - -/* FIXME: remove this if not needed */ -void mainboard_config_superio(void) -{ -} -`) - -	sb := Create(ctx, "romstage.c") -	defer sb.Close() -	Add_gpl(sb) -	sb.WriteString(`#include <stdint.h> -#include <northbridge/intel/haswell/haswell.h> -#include <northbridge/intel/haswell/raminit.h> -#include <southbridge/intel/lynxpoint/pch.h> - -void mainboard_config_rcba(void) -{ -} - -/* FIXME: called after romstage_common, remove it if not used */ -void mb_late_romstage_setup(void) -{ -} - -void mb_get_spd_map(struct spd_info *spdi) -{ -	/* FIXME: check this */ -	spdi->addresses[0] = 0x50; -	spdi->addresses[1] = 0x51; -	spdi->addresses[2] = 0x52; -	spdi->addresses[3] = 0x53; -} - -const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS] = { -	/* FIXME: Length and Location are computed from IOBP values, may be inaccurate */ -	/* Length, Enable, OCn#, Location */ -`) - -	pdo1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x64] -	ocmap1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x74:0x78] - -	var pdo2 uint8 -	var ocmap2 []uint8 -	var nPorts uint -	if isULT { -		nPorts = 8 -	} else { -		pdo2 = PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x64] -		ocmap2 = PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x74:0x78] -		nPorts = 14 -	} - -	xusb2pr := GetLE16(PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}].ConfigDump[0xd0:0xd4]) - -	for port := uint(0); port < nPorts; port++ { -		var port_oc int = -1 -		var port_pos string -		var port_disable uint8 - -		if port < 8 { -			port_disable = ((pdo1 >> port) & (uint8(xusb2pr>>port) ^ 1)) & 1 -			for oc := 0; oc < 4; oc++ { -				if (ocmap1[oc] & (1 << port)) != 0 { -					port_oc = oc -					break -				} -			} -		} else { -			port_disable = ((pdo2 >> (port - 8)) & (uint8(xusb2pr>>port) ^ 1)) & 1 -			for oc := 0; oc < 4; oc++ { -				if (ocmap2[oc] & (1 << (port - 8))) != 0 { -					port_oc = oc + 4 -					break -				} -			} -		} - -		/* get USB2 port length and location from IOBP */ -		port_iobp := inteltool.IOBP[0xe5004100+uint32(port)*0x100] -		loc_param := (port_iobp >> 8) & 7 -		txamp := (port_iobp >> 11) & 7 -		var port_length int - -		if isULT { -			port_pos, port_length = GetLptLPEHCISetting(loc_param, txamp) -		} else if b.variant == LYNX_POINT_MOBILE { -			port_pos, port_length = GetLptMobileEHCISetting(loc_param, txamp) -		} else { /* desktop or server */ -			port_pos, port_length = GetLptDesktopEHCISetting(loc_param, txamp) -		} - -		if port_disable == 1 { -			port_pos = "USB_PORT_SKIP" -		} - -		if port_oc == -1 { -			fmt.Fprintf(sb, "\t{ 0x%04x, %d, USB_OC_PIN_SKIP, %s },\n", -				port_length, (port_disable ^ 1), port_pos) -		} else { -			fmt.Fprintf(sb, "\t{ 0x%04x, %d, %d, %s },\n", -				port_length, (port_disable ^ 1), port_oc, port_pos) -		} -	} - -	sb.WriteString(`}; - -const struct usb3_port_config mainboard_usb3_ports[MAX_USB3_PORTS] = { -`) - -	xpdo := PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}].ConfigDump[0xe8] -	u3ocm := PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}].ConfigDump[0xc8:0xd0] - -	if !isULT { -		nPorts = 6 -	} else { -		nPorts = 4 -	} - -	for port := uint(0); port < nPorts; port++ { -		var port_oc int = -1 -		port_disable := (xpdo >> port) & 1 -		for oc := 0; oc < 8; oc++ { -			if (u3ocm[oc] & (1 << port)) != 0 { -				port_oc = oc -				break -			} -		} -		if port_oc == -1 { -			fmt.Fprintf(sb, "\t{ %d, USB_OC_PIN_SKIP },\n", -				(port_disable ^ 1)) -		} else { -			fmt.Fprintf(sb, "\t{ %d, %d },\n", -				(port_disable ^ 1), port_oc) -		} -	} - -	sb.WriteString(`}; -`) - -} - -func init() { -	for _, id := range []uint16{ -		0x8c41, 0x8c49, 0x8c4b, 0x8c4f, -	} { -		RegisterPCI(0x8086, uint16(id), lynxpoint{variant: LYNX_POINT_MOBILE}) -	} - -	for _, id := range []uint16{ -		0x8c42, 0x8c44, 0x8c46, 0x8c4a, -		0x8c4c, 0x8c4e, 0x8c50, 0x8c5c, -	} { -		RegisterPCI(0x8086, uint16(id), lynxpoint{variant: LYNX_POINT_DESKTOP}) -	} - -	for _, id := range []uint16{ -		0x8c52, 0x8c54, 0x8c56, -	} { -		RegisterPCI(0x8086, uint16(id), lynxpoint{variant: LYNX_POINT_SERVER}) -	} - -	for _, id := range []uint16{ -		0x9c41, 0x9c43, 0x9c45, -	} { -		RegisterPCI(0x8086, uint16(id), lynxpoint{variant: LYNX_POINT_ULT}) -	} - -	/* PCIe bridge */ -	for _, id := range []uint16{ -		0x8c10, 0x8c12, 0x8c14, 0x8c16, 0x8c18, 0x8c1a, 0x8c1c, 0x8c1e, -		0x9c10, 0x9c12, 0x9c14, 0x9c16, 0x9c18, 0x9c1a, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} - -	/* SMBus controller  */ -	RegisterPCI(0x8086, 0x8c22, GenericPCI{MissingParent: "smbus"}) -	RegisterPCI(0x8086, 0x9c22, GenericPCI{MissingParent: "smbus"}) - -	/* SATA */ -	for _, id := range []uint16{ -		0x8c00, 0x8c02, 0x8c04, 0x8c06, 0x8c08, 0x8c0e, -		0x8c01, 0x8c03, 0x8c05, 0x8c07, 0x8c09, 0x8c0f, -		0x9c03, 0x9c05, 0x9c07, 0x9c0f, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} - -	/* EHCI */ -	for _, id := range []uint16{ -		0x9c26, 0x8c26, 0x8c2d, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} - -	/* XHCI */ -	RegisterPCI(0x8086, 0x8c31, GenericPCI{}) -	RegisterPCI(0x8086, 0x9c31, GenericPCI{}) - -	/* ME and children */ -	for _, id := range []uint16{ -		0x8c3a, 0x8c3b, 0x8c3c, 0x8c3d, -		0x9c3a, 0x9c3b, 0x9c3c, 0x9c3d, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} - -	/* Ethernet */ -	RegisterPCI(0x8086, 0x8c33, GenericPCI{}) - -	/* Thermal */ -	RegisterPCI(0x8086, 0x8c24, GenericPCI{}) -	RegisterPCI(0x8086, 0x9c24, GenericPCI{}) - -	/* LAN Controller on LP PCH (if EEPROM has 0x0000/0xffff in DID) */ -	RegisterPCI(0x8086, 0x155a, GenericPCI{}) - -	/* SDIO */ -	RegisterPCI(0x8086, 0x9c35, GenericPCI{}) - -	/* Smart Sound Technology Controller */ -	RegisterPCI(0x8086, 0x9c36, GenericPCI{}) - -	/* Serial I/O */ -	for id := uint16(0x9c60); id <= 0x9c66; id++ { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} -} diff --git a/util/autoport/lynxpoint_lp_gpio.go b/util/autoport/lynxpoint_lp_gpio.go deleted file mode 100644 index fbc1686a..00000000 --- a/util/autoport/lynxpoint_lp_gpio.go +++ /dev/null @@ -1,252 +0,0 @@ -package main - -import ( -	"fmt" -	"os" -	"strings" -) - -const ( -	PIRQI = 0 -	PIRQJ = 1 -	PIRQK = 2 -	PIRQL = 3 -	PIRQM = 4 -	PIRQN = 5 -	PIRQO = 6 -	PIRQP = 7 -	PIRQQ = 8 -	PIRQR = 9 -	PIRQS = 10 -	PIRQT = 11 -	PIRQU = 12 -	PIRQV = 13 -	PIRQW = 14 -	PIRQX = 15 -) - -/* from sb/intel/lynxpoint/lp_gpio.c */ -func lp_gpio_to_pirq(gpioNum uint16) int { -	switch gpioNum { -	case 8: -		return PIRQI -	case 9: -		return PIRQJ -	case 10: -		return PIRQK -	case 13: -		return PIRQL -	case 14: -		return PIRQM -	case 45: -		return PIRQN -	case 46: -		return PIRQO -	case 47: -		return PIRQP -	case 48: -		return PIRQQ -	case 49: -		return PIRQR -	case 50: -		return PIRQS -	case 51: -		return PIRQT -	case 52: -		return PIRQU -	case 53: -		return PIRQV -	case 54: -		return PIRQW -	case 55: -		return PIRQX -	default: -		return -1 -	} -} - -func conf0str(conf0 uint32) string { -	if (conf0 & 1) == 0 { -		return "GPIO_MODE_NATIVE" -	} else { -		s := []string{"GPIO_MODE_GPIO"} -		var gpio_output bool -		if ((conf0 >> 2) & 1) == 1 { -			s = append(s, "GPIO_DIR_INPUT") -			gpio_output = false -		} else { -			s = append(s, "GPIO_DIR_OUTPUT") -			gpio_output = true -		} -		if ((conf0 >> 3) & 1) == 1 { -			s = append(s, "GPIO_INVERT") -		} -		if ((conf0 >> 4) & 1) == 1 { -			s = append(s, "GPIO_IRQ_LEVEL") -		} -		if gpio_output { -			if ((conf0 >> 31) & 1) == 1 { -				s = append(s, "GPO_LEVEL_HIGH") -			} else { -				s = append(s, "GPO_LEVEL_LOW") -			} -		} -		return strings.Join(s, " | ") -	} -} - -func lpgpio_preset(conf0 uint32, owner uint32, route uint32, irqen uint32, pirq uint32) string { -	if conf0 == 0xd { /* 0b1101: MODE_GPIO | INPUT | INVERT */ -		if owner == 0 { /* OWNER_ACPI */ -			if irqen == 0 && pirq == 0 { -				if route == 0 { /* SCI */ -					return "GPIO_ACPI_SCI" -				} else { -					return "GPIO_ACPI_SMI" -				} -			} -			return "" -		} else { /* OWNER_GPIO */ -			if route == 0 && irqen == 0 && pirq != 0 { -				return "GPIO_INPUT_INVERT" -			} -			return "" -		} -	} - -	if conf0 == 0x5 && owner == 1 { /* 0b101: MODE_GPIO | INPUT, OWNER_GPIO */ -		if route == 0 && irqen == 0 { -			if pirq == 1 { -				return "GPIO_PIRQ" -			} else { -				return "GPIO_INPUT" -			} -		} -		return "" -	} - -	if owner == 1 && irqen == 1 { -		if route == 0 && pirq == 0 { -			if conf0 == 0x5 { /* 0b00101 */ -				return "GPIO_IRQ_EDGE" -			} -			if conf0 == 0x15 { /* 0b10101 */ -				return "GPIO_IRQ_LEVEL" -			} -		} -		return "" -	} -	return "" -} - -func gpio_str(conf0 uint32, conf1 uint32, owner uint32, route uint32, irqen uint32, reset uint32, blink uint32, pirq uint32) string { -	s := []string{} -	s = append(s, fmt.Sprintf(".conf0 = %s", conf0str(conf0))) -	if conf1 != 0 { -		s = append(s, fmt.Sprintf(".conf1 = 0x%x", conf1)) -	} -	if owner != 0 { -		s = append(s, ".owner = GPIO_OWNER_GPIO") -	} -	if route != 0 { -		s = append(s, ".route = GPIO_ROUTE_SMI") -	} -	if irqen != 0 { -		s = append(s, ".irqen = GPIO_IRQ_ENABLE") -	} -	if reset != 0 { -		s = append(s, ".reset = GPIO_RESET_RSMRST") -	} -	if blink != 0 { -		s = append(s, ".blink = GPO_BLINK") -	} -	if pirq != 0 { -		s = append(s, ".pirq = GPIO_PIRQ_APIC_ROUTE") -	} -	return strings.Join(s, ", ") -} - -/* start addresses of GPIO registers */ -const ( -	GPIO_OWN        = 0x0 -	GPIPIRQ2IOXAPIC = 0x10 -	GPO_BLINK       = 0x18 -	GPI_ROUT        = 0x30 -	GP_RST_SEL      = 0x60 -	GPI_IE          = 0x90 -	GPnCONFIGA      = 0x100 -	GPnCONFIGB      = 0x104 -) - -func PrintLPGPIO(gpio *os.File, inteltool InteltoolData) { -	for gpioNum := uint16(0); gpioNum <= 94; gpioNum++ { -		if gpioNum < 10 { -			fmt.Fprintf(gpio, "\t[%d]  = ", gpioNum) -		} else { -			fmt.Fprintf(gpio, "\t[%d] = ", gpioNum) -		} -		conf0 := inteltool.GPIO[GPnCONFIGA+gpioNum*8] -		conf1 := inteltool.GPIO[GPnCONFIGB+gpioNum*8] -		set := gpioNum / 32 -		bit := gpioNum % 32 -		/* owner only effective in GPIO mode */ -		owner := (inteltool.GPIO[GPIO_OWN+set*4] >> bit) & 1 -		route := (inteltool.GPIO[GPI_ROUT+set*4] >> bit) & 1 -		irqen := (inteltool.GPIO[GPI_IE+set*4] >> bit) & 1 -		reset := (inteltool.GPIO[GP_RST_SEL+set*4] >> bit) & 1 -		var blink, pirq uint32 -		/* blink only effective in GPIO output mode */ -		if set == 0 { -			blink = (inteltool.GPIO[GPO_BLINK] >> bit) & 1 -		} else { -			blink = 0 -		} -		irqset := lp_gpio_to_pirq(gpioNum) -		if irqset >= 0 { -			pirq = (inteltool.GPIO[GPIPIRQ2IOXAPIC] >> uint(irqset)) & 1 -		} else { -			pirq = 0 -		} - -		if (conf0 & 1) == 0 { -			fmt.Fprintf(gpio, "LP_GPIO_NATIVE,\n") -		} else if (conf0 & 4) == 0 { -			/* configured as output */ -			if ((conf0 >> 31) & 1) == 0 { -				fmt.Fprintf(gpio, "LP_GPIO_OUT_LOW,\n") -			} else { -				fmt.Fprintf(gpio, "LP_GPIO_OUT_HIGH,\n") -			} -		} else if (conf1 & 4) != 0 { -			/* configured as input and sensing disabled */ -			fmt.Fprintf(gpio, "LP_GPIO_UNUSED,\n") -		} else { -			is_preset := false -			if conf1 == 0 && reset == 0 && blink == 0 { -				preset := lpgpio_preset(conf0, owner, route, irqen, pirq) -				if preset != "" { -					fmt.Fprintf(gpio, "LP_%s,\n", preset) -					is_preset = true -				} -			} -			if !is_preset { -				fmt.Fprintf(gpio, "{ %s },\n", gpio_str(conf0, conf1, owner, route, irqen, reset, blink, pirq)) -			} -		} -	} -} - -func Lynxpoint_LP_GPIO(ctx Context, inteltool InteltoolData) { -	gpio := Create(ctx, "gpio.c") -	defer gpio.Close() - -	AddROMStageFile("gpio.c", "") - -	Add_gpl(gpio) -	gpio.WriteString(`#include <southbridge/intel/lynxpoint/lp_gpio.h> - -const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { -`) -	PrintLPGPIO(gpio, inteltool) -	gpio.WriteString("\tLP_GPIO_END\n};\n") -} diff --git a/util/autoport/main.go b/util/autoport/main.go deleted file mode 100644 index 3a2f0617..00000000 --- a/util/autoport/main.go +++ /dev/null @@ -1,915 +0,0 @@ -/* This is just an experiment. Full automatic porting -   is probably not possible but a lot can be automated. */ -package main - -import ( -	"bytes" -	"flag" -	"fmt" -	"log" -	"os" -	"sort" -	"strings" -) - -type PCIAddr struct { -	Bus  int -	Dev  int -	Func int -} - -type PCIDevData struct { -	PCIAddr -	PCIVenID   uint16 -	PCIDevID   uint16 -	ConfigDump []uint8 -} - -type PCIDevice interface { -	Scan(ctx Context, addr PCIDevData) -} - -type InteltoolData struct { -	GPIO   map[uint16]uint32 -	RCBA   map[uint16]uint32 -	IOBP   map[uint32]uint32 -	IGD    map[uint32]uint32 -	MCHBAR map[uint16]uint32 -	PMBASE map[uint16]uint32 -} - -type DMIData struct { -	Vendor   string -	Model    string -	Version  string -	IsLaptop bool -} - -type AzaliaCodec struct { -	Name        string -	VendorID    uint32 -	SubsystemID uint32 -	CodecNo     int -	PinConfig   map[int]uint32 -} - -type DevReader interface { -	GetPCIList() []PCIDevData -	GetDMI() DMIData -	GetInteltool() InteltoolData -	GetAzaliaCodecs() []AzaliaCodec -	GetACPI() map[string][]byte -	GetCPUModel() []uint32 -	GetEC() []byte -	GetIOPorts() []IOPorts -	HasPS2() bool -} - -type IOPorts struct { -	Start uint16 -	End   uint16 -	Usage string -} - -type SouthBridger interface { -	GetGPIOHeader() string -	EncodeGPE(int) int -	DecodeGPE(int) int -	EnableGPE(int) -	NeedRouteGPIOManually() -} - -var SouthBridge SouthBridger -var BootBlockFiles map[string]string = map[string]string{} -var ROMStageFiles map[string]string = map[string]string{} -var RAMStageFiles map[string]string = map[string]string{} -var SMMFiles map[string]string = map[string]string{} -var MainboardInit string -var MainboardEnable string -var MainboardIncludes []string - -type Context struct { -	MoboID        string -	KconfigName   string -	Vendor        string -	Model         string -	BaseDirectory string -	InfoSource    DevReader -	SaneVendor    string -} - -type IOAPICIRQ struct { -	APICID int -	IRQNO  [4]int -} - -var IOAPICIRQs map[PCIAddr]IOAPICIRQ = map[PCIAddr]IOAPICIRQ{} -var KconfigBool map[string]bool = map[string]bool{} -var KconfigComment map[string]string = map[string]string{} -var KconfigString map[string]string = map[string]string{} -var KconfigHex map[string]uint32 = map[string]uint32{} -var KconfigInt map[string]int = map[string]int{} -var ROMSizeKB = 0 -var ROMProtocol = "" -var FlashROMSupport = "" - -func GetLE16(inp []byte) uint16 { -	return uint16(inp[0]) | (uint16(inp[1]) << 8) -} - -func FormatHexLE16(inp []byte) string { -	return fmt.Sprintf("0x%04x", GetLE16(inp)) -} - -func FormatHex32(u uint32) string { -	return fmt.Sprintf("0x%08x", u) -} - -func FormatHex8(u uint8) string { -	return fmt.Sprintf("0x%02x", u) -} - -func FormatInt32(u uint32) string { -	return fmt.Sprintf("%d", u) -} - -func FormatHexLE32(d []uint8) string { -	u := uint32(d[0]) | (uint32(d[1]) << 8) | (uint32(d[2]) << 16) | (uint32(d[3]) << 24) -	return FormatHex32(u) -} - -func FormatBool(inp bool) string { -	if inp { -		return "1" -	} else { -		return "0" -	} -} - -func sanitize(inp string) string { -	result := strings.ToLower(inp) -	result = strings.Replace(result, " ", "_", -1) -	result = strings.Replace(result, ",", "_", -1) -	result = strings.Replace(result, "-", "_", -1) -	for strings.HasSuffix(result, ".") { -		result = result[0 : len(result)-1] -	} -	return result -} - -func AddBootBlockFile(Name string, Condition string) { -	BootBlockFiles[Name] = Condition -} - -func AddROMStageFile(Name string, Condition string) { -	ROMStageFiles[Name] = Condition -} - -func AddRAMStageFile(Name string, Condition string) { -	RAMStageFiles[Name] = Condition -} - -func AddSMMFile(Name string, Condition string) { -	SMMFiles[Name] = Condition -} - -func IsIOPortUsedBy(ctx Context, port uint16, name string) bool { -	for _, io := range ctx.InfoSource.GetIOPorts() { -		if io.Start <= port && port <= io.End && io.Usage == name { -			return true -		} -	} -	return false -} - -var FlagOutDir = flag.String("coreboot_dir", ".", "Resulting coreboot directory") - -func writeMF(mf *os.File, files map[string]string, category string) { -	keys := []string{} -	for file, _ := range files { -		keys = append(keys, file) -	} - -	sort.Strings(keys) - -	for _, file := range keys { -		condition := files[file] -		if condition == "" { -			fmt.Fprintf(mf, "%s-y += %s\n", category, file) -		} else { -			fmt.Fprintf(mf, "%s-$(%s) += %s\n", category, condition, file) -		} -	} -} - -func Create(ctx Context, name string) *os.File { -	li := strings.LastIndex(name, "/") -	if li > 0 { -		os.MkdirAll(ctx.BaseDirectory+"/"+name[0:li], 0700) -	} -	mf, err := os.Create(ctx.BaseDirectory + "/" + name) -	if err != nil { -		log.Fatal(err) -	} -	return mf -} - -func Add_gpl(f *os.File) { -	fmt.Fprintln(f, "/* SPDX-License-Identifier: GPL-2.0-only */") -	fmt.Fprintln(f) -} - -func RestorePCI16Simple(f *os.File, pcidev PCIDevData, addr uint16) { -	fmt.Fprintf(f, "	pci_write_config16(PCI_DEV(%d, 0x%02x, %d), 0x%02x, 0x%02x%02x);\n", -		pcidev.Bus, pcidev.Dev, pcidev.Func, addr, -		pcidev.ConfigDump[addr+1], -		pcidev.ConfigDump[addr]) -} - -func RestorePCI32Simple(f *os.File, pcidev PCIDevData, addr uint16) { -	fmt.Fprintf(f, "	pci_write_config32(PCI_DEV(%d, 0x%02x, %d), 0x%02x, 0x%02x%02x%02x%02x);\n", -		pcidev.Bus, pcidev.Dev, pcidev.Func, addr, -		pcidev.ConfigDump[addr+3], -		pcidev.ConfigDump[addr+2], -		pcidev.ConfigDump[addr+1], -		pcidev.ConfigDump[addr]) -} - -func RestoreRCBA32(f *os.File, inteltool InteltoolData, addr uint16) { -	fmt.Fprintf(f, "\tRCBA32(0x%04x) = 0x%08x;\n", addr, inteltool.RCBA[addr]) -} - -type PCISlot struct { -	PCIAddr -	alias             string -	additionalComment string -	writeEmpty        bool -} - -type DevTreeNode struct { -	Bus           int -	Dev           int -	Func          int -	Disabled      bool -	Registers     map[string]string -	IOs           map[uint16]uint16 -	Children      []DevTreeNode -	PCISlots      []PCISlot -	PCIController bool -	ChildPCIBus   int -	MissingParent string -	SubVendor     uint16 -	SubSystem     uint16 -	Chip          string -	Ops           string -	Comment       string -} - -var DevTree DevTreeNode -var MissingChildren map[string][]DevTreeNode = map[string][]DevTreeNode{} -var unmatchedPCIChips map[PCIAddr]DevTreeNode = map[PCIAddr]DevTreeNode{} -var unmatchedPCIDevices map[PCIAddr]DevTreeNode = map[PCIAddr]DevTreeNode{} - -func Offset(dt *os.File, offset int) { -	for i := 0; i < offset; i++ { -		fmt.Fprintf(dt, "\t") -	} -} - -func MatchDev(dev *DevTreeNode) { -	for idx := range dev.Children { -		MatchDev(&dev.Children[idx]) -	} - -	for _, slot := range dev.PCISlots { -		slotChip, ok := unmatchedPCIChips[slot.PCIAddr] - -		if !ok { -			continue -		} - -		if slot.additionalComment != "" && slotChip.Comment != "" { -			slotChip.Comment = slot.additionalComment + " " + slotChip.Comment -		} else { -			slotChip.Comment = slot.additionalComment + slotChip.Comment -		} - -		delete(unmatchedPCIChips, slot.PCIAddr) -		MatchDev(&slotChip) -		dev.Children = append(dev.Children, slotChip) -	} - -	if dev.PCIController { -		for slot, slotDev := range unmatchedPCIChips { -			if slot.Bus == dev.ChildPCIBus { -				delete(unmatchedPCIChips, slot) -				MatchDev(&slotDev) -				dev.Children = append(dev.Children, slotDev) -			} -		} -	} - -	for _, slot := range dev.PCISlots { -		slotDev, ok := unmatchedPCIDevices[slot.PCIAddr] -		if !ok { -			if slot.writeEmpty { -				dev.Children = append(dev.Children, -					DevTreeNode{ -						Registers: map[string]string{}, -						Chip:      "pci", -						Bus:       slot.Bus, -						Dev:       slot.Dev, -						Func:      slot.Func, -						Comment:   slot.additionalComment, -						Disabled:  true, -					}, -				) -			} -			continue -		} - -		if slot.additionalComment != "" && slotDev.Comment != "" { -			slotDev.Comment = slot.additionalComment + " " + slotDev.Comment -		} else { -			slotDev.Comment = slot.additionalComment + slotDev.Comment -		} - -		MatchDev(&slotDev) -		dev.Children = append(dev.Children, slotDev) -		delete(unmatchedPCIDevices, slot.PCIAddr) -	} - -	if dev.MissingParent != "" { -		for _, child := range MissingChildren[dev.MissingParent] { -			MatchDev(&child) -			dev.Children = append(dev.Children, child) -		} -		delete(MissingChildren, dev.MissingParent) -	} - -	if dev.PCIController { -		for slot, slotDev := range unmatchedPCIDevices { -			if slot.Bus == dev.ChildPCIBus { -				MatchDev(&slotDev) -				dev.Children = append(dev.Children, slotDev) -				delete(unmatchedPCIDevices, slot) -			} -		} -	} -} - -func writeOn(dt *os.File, dev DevTreeNode) { -	if dev.Disabled { -		fmt.Fprintf(dt, "off") -	} else { -		fmt.Fprintf(dt, "on") -	} -} - -func WriteDev(dt *os.File, offset int, alias string, dev DevTreeNode) { -	Offset(dt, offset) -	switch dev.Chip { -	case "cpu_cluster", "lapic", "domain", "ioapic": -		fmt.Fprintf(dt, "device %s 0x%x ", dev.Chip, dev.Dev) -		writeOn(dt, dev) -	case "pci", "pnp": -		if alias != "" { -			fmt.Fprintf(dt, "device ref %s ", alias) -		} else { -			fmt.Fprintf(dt, "device %s %02x.%x ", dev.Chip, dev.Dev, dev.Func) -		} -		writeOn(dt, dev) -	case "i2c": -		fmt.Fprintf(dt, "device %s %02x ", dev.Chip, dev.Dev) -		writeOn(dt, dev) -	default: -		fmt.Fprintf(dt, "chip %s", dev.Chip) -	} -	if dev.Comment != "" { -		fmt.Fprintf(dt, " # %s", dev.Comment) -	} -	fmt.Fprintf(dt, "\n") -	if dev.Ops != "" { -		Offset(dt, offset+1) -		fmt.Fprintf(dt, "ops %s\n", dev.Ops) -	} -	if dev.Chip == "pci" && dev.SubSystem != 0 && dev.SubVendor != 0 { -		Offset(dt, offset+1) -		fmt.Fprintf(dt, "subsystemid 0x%04x 0x%04x\n", dev.SubVendor, dev.SubSystem) -	} - -	ioapic, ok := IOAPICIRQs[PCIAddr{Bus: dev.Bus, Dev: dev.Dev, Func: dev.Func}] -	if dev.Chip == "pci" && ok { -		for pin, irq := range ioapic.IRQNO { -			if irq != 0 { -				Offset(dt, offset+1) -				fmt.Fprintf(dt, "ioapic_irq %d INT%c 0x%x\n", ioapic.APICID, 'A'+pin, irq) -			} -		} -	} - -	keys := []string{} -	for reg, _ := range dev.Registers { -		keys = append(keys, reg) -	} - -	sort.Strings(keys) - -	for _, reg := range keys { -		val := dev.Registers[reg] -		Offset(dt, offset+1) -		fmt.Fprintf(dt, "register \"%s\" = \"%s\"\n", reg, val) -	} - -	ios := []int{} -	for reg, _ := range dev.IOs { -		ios = append(ios, int(reg)) -	} - -	sort.Ints(ios) - -	for _, reg := range ios { -		val := dev.IOs[uint16(reg)] -		Offset(dt, offset+1) -		fmt.Fprintf(dt, "io 0x%x = 0x%x\n", reg, val) -	} - -	for _, child := range dev.Children { -		alias = "" -		for _, slot := range dev.PCISlots { -			if slot.PCIAddr.Bus == child.Bus && -				slot.PCIAddr.Dev == child.Dev && slot.PCIAddr.Func == child.Func { -				alias = slot.alias -			} -		} -		WriteDev(dt, offset+1, alias, child) -	} - -	Offset(dt, offset) -	fmt.Fprintf(dt, "end\n") -} - -func PutChip(domain string, cur DevTreeNode) { -	MissingChildren[domain] = append(MissingChildren[domain], cur) -} - -func PutPCIChip(addr PCIDevData, cur DevTreeNode) { -	unmatchedPCIChips[addr.PCIAddr] = cur -} - -func PutPCIDevParent(addr PCIDevData, comment string, parent string) { -	cur := DevTreeNode{ -		Registers:     map[string]string{}, -		Chip:          "pci", -		Bus:           addr.Bus, -		Dev:           addr.Dev, -		Func:          addr.Func, -		MissingParent: parent, -		Comment:       comment, -	} -	if addr.ConfigDump[0xa] == 0x04 && addr.ConfigDump[0xb] == 0x06 { -		cur.PCIController = true -		cur.ChildPCIBus = int(addr.ConfigDump[0x19]) - -		loopCtr := 0 -		for capPtr := addr.ConfigDump[0x34]; capPtr != 0; capPtr = addr.ConfigDump[capPtr+1] { -			/* Avoid hangs. There are only 0x100 different possible values for capPtr. -			   If we iterate longer than that, we're in endless loop. */ -			loopCtr++ -			if loopCtr > 0x100 { -				break -			} -			if addr.ConfigDump[capPtr] == 0x0d { -				cur.SubVendor = GetLE16(addr.ConfigDump[capPtr+4 : capPtr+6]) -				cur.SubSystem = GetLE16(addr.ConfigDump[capPtr+6 : capPtr+8]) -			} -		} -	} else { -		cur.SubVendor = GetLE16(addr.ConfigDump[0x2c:0x2e]) -		cur.SubSystem = GetLE16(addr.ConfigDump[0x2e:0x30]) -	} -	unmatchedPCIDevices[addr.PCIAddr] = cur -} - -func PutPCIDev(addr PCIDevData, comment string) { -	PutPCIDevParent(addr, comment, "") -} - -type GenericPCI struct { -	Comment       string -	Bus0Subdiv    string -	MissingParent string -} - -type GenericVGA struct { -	GenericPCI -} - -type DSDTInclude struct { -	Comment string -	File    string -} - -type DSDTDefine struct { -	Key     string -	Comment string -	Value   string -} - -var DSDTIncludes []DSDTInclude -var DSDTPCI0Includes []DSDTInclude -var DSDTDefines []DSDTDefine - -func (g GenericPCI) Scan(ctx Context, addr PCIDevData) { -	PutPCIDevParent(addr, g.Comment, g.MissingParent) -} - -var IGDEnabled bool = false - -func (g GenericVGA) Scan(ctx Context, addr PCIDevData) { -	KconfigString["VGA_BIOS_ID"] = fmt.Sprintf("%04x,%04x", -		addr.PCIVenID, -		addr.PCIDevID) -	PutPCIDevParent(addr, g.Comment, g.MissingParent) -	IGDEnabled = true -} - -func makeKconfigName(ctx Context) { -	kn := Create(ctx, "Kconfig.name") -	defer kn.Close() - -	fmt.Fprintf(kn, "config %s\n\tbool \"%s\"\n", ctx.KconfigName, ctx.Model) -} - -func makeComment(name string) string { -	cmt, ok := KconfigComment[name] -	if !ok { -		return "" -	} -	return " # " + cmt -} - -func makeKconfig(ctx Context) { -	kc := Create(ctx, "Kconfig") -	defer kc.Close() - -	fmt.Fprintf(kc, "if %s\n\n", ctx.KconfigName) - -	fmt.Fprintf(kc, "config BOARD_SPECIFIC_OPTIONS\n\tdef_bool y\n") -	keys := []string{} -	for name, val := range KconfigBool { -		if val { -			keys = append(keys, name) -		} -	} - -	sort.Strings(keys) - -	for _, name := range keys { -		fmt.Fprintf(kc, "\tselect %s%s\n", name, makeComment(name)) -	} - -	keys = nil -	for name, val := range KconfigBool { -		if !val { -			keys = append(keys, name) -		} -	} - -	sort.Strings(keys) - -	for _, name := range keys { -		fmt.Fprintf(kc, ` -config %s%s -	bool -	default n -`, name, makeComment(name)) -	} - -	keys = nil -	for name, _ := range KconfigString { -		keys = append(keys, name) -	} - -	sort.Strings(keys) - -	for _, name := range keys { -		fmt.Fprintf(kc, ` -config %s%s -	string -	default "%s" -`, name, makeComment(name), KconfigString[name]) -	} - -	keys = nil -	for name, _ := range KconfigHex { -		keys = append(keys, name) -	} - -	sort.Strings(keys) - -	for _, name := range keys { -		fmt.Fprintf(kc, ` -config %s%s -	hex -	default 0x%x -`, name, makeComment(name), KconfigHex[name]) -	} - -	keys = nil -	for name, _ := range KconfigInt { -		keys = append(keys, name) -	} - -	sort.Strings(keys) - -	for _, name := range keys { -		fmt.Fprintf(kc, ` -config %s%s -	int -	default %d -`, name, makeComment(name), KconfigInt[name]) -	} - -	fmt.Fprintf(kc, "endif\n") -} - -const MoboDir = "/src/mainboard/" - -func makeVendor(ctx Context) { -	vendor := ctx.Vendor -	vendorSane := ctx.SaneVendor -	vendorDir := *FlagOutDir + MoboDir + vendorSane -	vendorUpper := strings.ToUpper(vendorSane) -	kconfig := vendorDir + "/Kconfig" -	if _, err := os.Stat(kconfig); os.IsNotExist(err) { -		f, err := os.Create(kconfig) -		if err != nil { -			log.Fatal(err) -		} -		defer f.Close() -		f.WriteString(`if VENDOR_` + vendorUpper + ` - -choice -	prompt "Mainboard model" - -source "src/mainboard/` + vendorSane + `/*/Kconfig.name" - -endchoice - -source "src/mainboard/` + vendorSane + `/*/Kconfig" - -config MAINBOARD_VENDOR -	string -	default "` + vendor + `" - -endif # VENDOR_` + vendorUpper + "\n") -	} -	kconfigName := vendorDir + "/Kconfig.name" -	if _, err := os.Stat(kconfigName); os.IsNotExist(err) { -		f, err := os.Create(kconfigName) -		if err != nil { -			log.Fatal(err) -		} -		defer f.Close() -		f.WriteString(`config VENDOR_` + vendorUpper + ` -	bool "` + vendor + `" -`) -	} - -} - -func GuessECGPE(ctx Context) int { -	/* FIXME:XX Use iasl -d and/or better parsing  */ -	dsdt := ctx.InfoSource.GetACPI()["DSDT"] -	idx := bytes.Index(dsdt, []byte{0x08, '_', 'G', 'P', 'E', 0x0a}) /* Name (_GPE, byte).  */ -	if idx > 0 { -		return int(dsdt[idx+6]) -	} -	return -1 -} - -func GuessSPDMap(ctx Context) []uint8 { -	dmi := ctx.InfoSource.GetDMI() - -	if dmi.Vendor == "LENOVO" { -		return []uint8{0x50, 0x52, 0x51, 0x53} -	} -	return []uint8{0x50, 0x51, 0x52, 0x53} -} - -func main() { -	flag.Parse() - -	ctx := Context{} - -	ctx.InfoSource = MakeLogReader() - -	dmi := ctx.InfoSource.GetDMI() - -	ctx.Vendor = dmi.Vendor - -	if dmi.Vendor == "LENOVO" { -		ctx.Model = dmi.Version -	} else { -		ctx.Model = dmi.Model -	} - -	if dmi.IsLaptop { -		KconfigBool["SYSTEM_TYPE_LAPTOP"] = true -	} -	ctx.SaneVendor = sanitize(ctx.Vendor) -	for { -		last := ctx.SaneVendor -		for _, suf := range []string{"_inc", "_co", "_corp"} { -			ctx.SaneVendor = strings.TrimSuffix(ctx.SaneVendor, suf) -		} -		if last == ctx.SaneVendor { -			break -		} -	} -	ctx.MoboID = ctx.SaneVendor + "/" + sanitize(ctx.Model) -	ctx.KconfigName = "BOARD_" + strings.ToUpper(ctx.SaneVendor+"_"+sanitize(ctx.Model)) -	ctx.BaseDirectory = *FlagOutDir + MoboDir + ctx.MoboID -	KconfigString["MAINBOARD_DIR"] = ctx.MoboID -	KconfigString["MAINBOARD_PART_NUMBER"] = ctx.Model - -	os.MkdirAll(ctx.BaseDirectory, 0700) - -	makeVendor(ctx) - -	ScanRoot(ctx) - -	if IGDEnabled { -		KconfigBool["MAINBOARD_HAS_LIBGFXINIT"] = true -		KconfigComment["MAINBOARD_HAS_LIBGFXINIT"] = "FIXME: check this" -		AddRAMStageFile("gma-mainboard.ads", "CONFIG_MAINBOARD_USE_LIBGFXINIT") -	} - -	if len(BootBlockFiles) > 0 || len(ROMStageFiles) > 0 || len(RAMStageFiles) > 0 || len(SMMFiles) > 0 { -		mf := Create(ctx, "Makefile.mk") -		defer mf.Close() -		writeMF(mf, BootBlockFiles, "bootblock") -		writeMF(mf, ROMStageFiles, "romstage") -		writeMF(mf, RAMStageFiles, "ramstage") -		writeMF(mf, SMMFiles, "smm") -	} - -	devtree := Create(ctx, "devicetree.cb") -	defer devtree.Close() - -	MatchDev(&DevTree) -	WriteDev(devtree, 0, "", DevTree) - -	if MainboardInit != "" || MainboardEnable != "" || MainboardIncludes != nil { -		mainboard := Create(ctx, "mainboard.c") -		defer mainboard.Close() -		Add_gpl(mainboard) -		mainboard.WriteString("#include <device/device.h>\n") -		for _, include := range MainboardIncludes { -			mainboard.WriteString("#include <" + include + ">\n") -		} -		mainboard.WriteString("\n") -		if MainboardInit != "" { -			mainboard.WriteString(`static void mainboard_init(struct device *dev) -{ -` + MainboardInit + "}\n\n") -		} -		if MainboardInit != "" || MainboardEnable != "" { -			mainboard.WriteString("static void mainboard_enable(struct device *dev)\n{\n") -			if MainboardInit != "" { -				mainboard.WriteString("\tdev->ops->init = mainboard_init;\n\n") -			} -			mainboard.WriteString(MainboardEnable) -			mainboard.WriteString("}\n\n") -			mainboard.WriteString(`struct chip_operations mainboard_ops = { -	.enable_dev = mainboard_enable, -}; -`) -		} -	} - -	bi := Create(ctx, "board_info.txt") -	defer bi.Close() - -	fixme := "" - -	if dmi.IsLaptop { -		bi.WriteString("Category: laptop\n") -	} else { -		bi.WriteString("Category: desktop\n") -		fixme += "check category, " -	} - -	missing := "ROM package, ROM socketed" - -	if ROMProtocol != "" { -		fmt.Fprintf(bi, "ROM protocol: %s\n", ROMProtocol) -	} else { -		missing += ", ROM protocol" -	} - -	if FlashROMSupport != "" { -		fmt.Fprintf(bi, "Flashrom support: %s\n", FlashROMSupport) -	} else { -		missing += ", Flashrom support" -	} - -	missing += ", Release year" - -	if fixme != "" { -		fmt.Fprintf(bi, "FIXME: %s, put %s\n", fixme, missing) -	} else { -		fmt.Fprintf(bi, "FIXME: put %s\n", missing) -	} - -	if ROMSizeKB == 0 { -		KconfigBool["BOARD_ROMSIZE_KB_2048"] = true -		KconfigComment["BOARD_ROMSIZE_KB_2048"] = "FIXME: correct this" -	} else { -		KconfigBool[fmt.Sprintf("BOARD_ROMSIZE_KB_%d", ROMSizeKB)] = true -	} - -	makeKconfig(ctx) -	makeKconfigName(ctx) - -	dsdt := Create(ctx, "dsdt.asl") -	defer dsdt.Close() - -	for _, define := range DSDTDefines { -		if define.Comment != "" { -			fmt.Fprintf(dsdt, "\t/* %s. */\n", define.Comment) -		} -		dsdt.WriteString("#define " + define.Key + " " + define.Value + "\n") -	} - -	Add_gpl(dsdt) -	dsdt.WriteString( -		` -#include <acpi/acpi.h> - -DefinitionBlock( -	"dsdt.aml", -	"DSDT", -	ACPI_DSDT_REV_2, -	OEM_ID, -	ACPI_TABLE_CREATOR, -	0x20141018	/* OEM revision */ -) -{ -	#include <acpi/dsdt_top.asl> -	#include "acpi/platform.asl" -`) - -	for _, x := range DSDTIncludes { -		if x.Comment != "" { -			fmt.Fprintf(dsdt, "\t/* %s. */\n", x.Comment) -		} -		fmt.Fprintf(dsdt, "\t#include <%s>\n", x.File) -	} - -	dsdt.WriteString(` -	Device (\_SB.PCI0) -	{ -`) -	for _, x := range DSDTPCI0Includes { -		if x.Comment != "" { -			fmt.Fprintf(dsdt, "\t/* %s. */\n", x.Comment) -		} -		fmt.Fprintf(dsdt, "\t\t#include <%s>\n", x.File) -	} -	dsdt.WriteString( -		`	} -} -`) - -	if IGDEnabled { -		gma := Create(ctx, "gma-mainboard.ads") -		defer gma.Close() - -		gma.WriteString(`-- SPDX-License-Identifier: GPL-2.0-or-later - -with HW.GFX.GMA; -with HW.GFX.GMA.Display_Probing; - -use HW.GFX.GMA; -use HW.GFX.GMA.Display_Probing; - -private package GMA.Mainboard is - -   -- FIXME: check this -   ports : constant Port_List := -     (DP1, -      DP2, -      DP3, -      HDMI1, -      HDMI2, -      HDMI3, -      Analog, -      LVDS, -      eDP); - -end GMA.Mainboard; -`) -	} -} diff --git a/util/autoport/rce823.go b/util/autoport/rce823.go deleted file mode 100644 index 7c921093..00000000 --- a/util/autoport/rce823.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import "fmt" - -type rce823 struct { -	variant string -} - -func (r rce823) Scan(ctx Context, addr PCIDevData) { -	if addr.Dev == 0 && addr.Func == 0 { -		cur := DevTreeNode{ -			Chip:    "drivers/ricoh/rce822", -			Comment: "Ricoh cardreader", -			Registers: map[string]string{ - -				"sdwppol":      fmt.Sprintf("%d", (addr.ConfigDump[0xfb]&2)>>1), -				"disable_mask": fmt.Sprintf("0x%x", addr.ConfigDump[0xcb]), -			}, -			PCISlots: []PCISlot{ -				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 0}, writeEmpty: false}, -				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 1}, writeEmpty: false}, -				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 2}, writeEmpty: false}, -				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 3}, writeEmpty: false}, -				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 4}, writeEmpty: false}, -				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 5}, writeEmpty: false}, -				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 6}, writeEmpty: false}, -				PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 7}, writeEmpty: false}, -			}, -		} -		PutPCIChip(addr, cur) -	} -	PutPCIDev(addr, "Ricoh SD card reader") -	KconfigBool["DRIVERS_RICOH_RCE822"] = true -} - -func init() { -	RegisterPCI(0x1180, 0xe822, rce823{}) -	RegisterPCI(0x1180, 0xe823, rce823{}) -} diff --git a/util/autoport/readme.md b/util/autoport/readme.md deleted file mode 100644 index b546120f..00000000 --- a/util/autoport/readme.md +++ /dev/null @@ -1,457 +0,0 @@ -# Porting coreboot using autoport - -## Supported platforms - -### Chipset -For any Sandy Bridge or Ivy Bridge platform the generated result should -be bootable, possibly with minor fixes. - -### EC / SuperIO -EC support is likely to work on Intel-based thinkpads. Other laptops are -likely to miss EC support. SuperIO support on desktops is more likely to -work out of the box than any EC. - -## How to use autoport - -Enable as many devices as possible in the firmware setup of your system. -This is useful to detect as many devices as possible and make the port -more complete, as disabled devices cannot be detected. - -Boot into target machine under any Linux-based distribution and install -the following tools on it: -* `gcc` -* `golang` -* `lspci` -* `dmidecode` -* `acpidump` (part of `acpica` on some distros) - -Clone the coreboot tree and `cd` into it. For more detailed steps, refer -to Rookie Guide, Lesson 1. Afterwards, run these commands: - -		cd util/ectool -		make -		cd ../inteltool -		make -		cd ../superiotool -		make -		cd ../autoport -		go build -		sudo ./autoport --input_log=logs --make_logs --coreboot_dir=../.. - -	Note: in case you have problems getting gcc and golang on the target -	machine, you can compile the utilities on another computer and copy -	the binaries to the target machine. You will still need the other -	listed programs on the target machine, but you may place them in the -	same directory as autoport. - -Check for unknown detected PCI devices, e.g.: - -		Unknown PCI device 8086:0085, assuming removable - -If autoport says `assuming removable`, you are fine. If it doesn't, -you may want to add the relevant PCI IDs to autoport. Run `lspci -nn` -and check which device this is using the PCI ID. Devices which are not -part of the chipset, such as GPUs or network cards, can be considered -removable, whereas devices inside the CPU or the PCH such as integrated -GPUs and bus controllers (SATA, USB, LPC, SMBus...) are non-removable. - -Your board has now been added to the tree. However, do not flash it -in its current state. It can brick your machine. Instead, keep this -new port and the logs from `util/autoport/logs` somewhere safe. The -following steps will back up your current firmware, which is always -recommended, since coreboot may not boot on the first try. - -Disassemble your computer and find the flash chip(s). Since there could be -more than one, this guide will refer to "flash chips" as one or more chips. -Refer to <https://flashrom.org/Technology> as a reference. The flash chip is -usually in a `SOIC-8` (2x4 pins, 200mil) or `SOIC-16` (2x8 pins) package. As -it can be seen on flashrom's wiki, the former package is like any other 8-pin -chip on the mainboard, but it is slightly larger. The latter package is much -easier to locate. Always make sure it is a flash chip by looking up what its -model, printed on it, refers to. - -There may be a smaller flash chip for the EC on some laptops, and other chips -such as network cards may use similar flash chips. These should be left as-is. -If in doubt, ask! - -Once located, use an external flasher to read the flash chips with `flashrom -r`. -Verify with `flashrom -v` several times that reading is consistent. If it is not, -troubleshoot your flashing setup. Save the results somewhere safe, preferably on -media that cannot be easily overwritten and on several devices. You may need this -later. The write process erases the flash chips first, and erased data on a flash -chip is lost for a very long time, usually forever! - -Compile coreboot for your ported mainboard with some console enabled. The most -common ones are EHCI debug, serial port and SPI flash console as a last resort. -If your system is a laptop and has a dedicated video card, you may need to add -a video BIOS (VBIOS) to coreboot to be able to see any video output. Desktop -video cards, as well as some MXM video cards, have this VBIOS on a flash chip -on the card's PCB, so this step is not necessary for them. - -Flash coreboot on the machine. On recent Intel chipsets, the flash space is split -in several regions. Only the one known as "BIOS region" should be flashed. If -there is only one flash chip present, this is best done by adding the `--ifd` -and `-i bios` parameters flashrom has (from v1.0 onwards) to specify what flash -descriptor region it should operate on. If the ME (Management Engine) region is -not readable, which is the case on most systems, use the `--noverify-all` -parameter as well. - -For systems with two flash chips, this is not so easy. It is probably better to -ask in coreboot or flashrom communication channels, such as via IRC or on the -mailing lists. - -Once flashed, try to boot. Anything is possible. If a log is generated, save it -and use it to address any issues. See the next section for useful information. -Find all the sections marked with `FIXME` and correct them. - -Send your work to review.coreboot.org. I mean it, your effort is very appreciated. -Refer to Rookie Guide, Lesson 2 for instructions on how to submit a patch. - -## Manual fixes -### SPD -In order to initialize the RAM memory, coreboot needs to know its timings, which vary between -modules. Socketed RAM has a small EEPROM chip, which is accessible via SMBus and contains the -timing data. This data is usually known as SPD. Unfortunately, the SMBus addresses may not -correlate with the RAM slots and cannot always be detected automatically. The address map is -encoded in function `mainboard_get_spd` in `romstage.c`. By default, autoport uses the most -common map `0x50, 0x51, 0x52, 0x53` on everything except for Lenovo systems, which are known -to use `0x50, 0x52, 0x51, 0x53`. To detect the correct memory map, the easiest way is to boot -on the vendor firmware with just one module in channel 0, slot 0, and check the SMBus address -the EEPROM has. Under Linux, you can use these commands to see what is on SMBus: - -	$ sudo modprobe i2c-dev -	$ sudo modprobe i2c-i801 -	$ sudo i2cdetect -l -	i2c-0	i2c		i915 gmbus ssc				I2C adapter -	i2c-1	i2c		i915 gmbus vga				I2C adapter -	i2c-2	i2c		i915 gmbus panel			I2C adapter -	i2c-3	i2c		i915 gmbus dpc				I2C adapter -	i2c-4	i2c		i915 gmbus dpb				I2C adapter -	i2c-5	i2c		i915 gmbus dpd				I2C adapter -	i2c-6	i2c		DPDDC-B					I2C adapter -	i2c-7	i2c		DPDDC-C					I2C adapter -	i2c-8	i2c		DPDDC-D					I2C adapter -	i2c-9	smbus		SMBus I801 adapter at 0400		SMBus adapter - -	$ sudo i2cdetect 9 -	WARNING! This program can confuse your I2C bus, cause data loss and worse! -	I will probe file /dev/i2c-9. -	I will probe address range 0x03-0x77. -	Continue? [Y/n] y -	     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f -	00:          -- -- -- -- -- 08 -- -- -- -- -- -- -- -	10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -	20: -- -- -- -- 24 -- -- -- -- -- -- -- -- -- -- -- -	30: 30 31 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -	40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -	50: 50 -- -- -- 54 55 56 57 -- -- -- -- 5c 5d 5e 5f -	60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -	70: -- -- -- -- -- -- -- -- - -Make sure to replace the `9` on the last command with the bus number for SMBus on -your system. Here, there is a module at address `0x50`. Since only one module was -installed on the first slot of the first channel, we know the first position of -the SPD array must be `0x50`. After testing all the slots, your `mainboard_get_spd` -should look similar to this: - -	void mainboard_get_spd(spd_raw_data *spd) { -		read_spd(&spd[0], 0x50); -		read_spd(&spd[1], 0x51); -		read_spd(&spd[2], 0x52); -		read_spd(&spd[3], 0x53); -	} - -Note that there should be one line per memory slot on the mainboard. - -Note: slot labelling may be missing or unreliable. Use `inteltool` to see -which slots have modules in them. - -This procedure is ideal, if your RAM is socketed. If you have soldered RAM, -remove any socketed memory modules and check if any EEPROM appears on SMBus. -If this is the case, you can proceed as if the RAM was socketed. However, -you may have to guess some entries if there multiple EEPROMs appear. - -Most of the time, soldered RAM does not have an EEPROM. Instead, the SPD data is -inside the main flash chip where the firmware is. If this is the case, you need -to generate the SPD data to use with coreboot. Look at `inteltool.log`. There -should be something like this: - -	/* SPD matching current mode:  */ -	/* CH0S0  */ -	00: 92 11 0b 03 04 00 00 09 03 52 01 08 0a 00 80 00 -	10: 6e 78 6e 32 6e 11 18 81 20 08 3c 3c 00 f0 00 00 -	20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 00 -	40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6d 17 -	80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	/* CH1S0  */ -	00: 92 11 0b 03 04 00 00 09 03 52 01 08 0a 00 80 00 -	10: 6e 78 6e 32 6e 11 18 81 20 08 3c 3c 00 f0 00 00 -	20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 00 -	40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6d 17 -	80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - -This is not a full-fledged SPD dump, as it only lists -the currently-used speed configuration, and lacks info -such as a serial number, vendor and model. Use `xxd` -to create a binary file with this SPD data: - -	$ cat | xxd -r > spd.bin  <<EOF -	00: 92 11 0b 03 04 00 00 09 03 52 01 08 0a 00 80 00 -	10: 6e 78 6e 32 6e 11 18 81 20 08 3c 3c 00 f0 00 00 -	20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 00 -	40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6d 17 -	80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -	EOF (press Ctrl + D) - -Then, move the generated file into your mainboard's directory -and hook it up to the build system by adding the following -lines to `Makefile.mk`: - -	cbfs-files-y += spd.bin -	spd.bin-file := spd.bin -	spd.bin-type := raw - -Now we need coreboot to use this SPD file. The following example -shows a hybrid configuration, in which one module is soldered and -the other one is socketed: - -	void mainboard_get_spd(spd_raw_data *spd) -	{ -		void *spd_file; -		size_t spd_file_len = 0; -		/* C0S0 is a soldered RAM with no real SPD. Use stored SPD. */ -		spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_RAW, -						 &spd_file_len); -		if (spd_file && spd_file_len >= 128) -			memcpy(&spd[0], spd_file, 128); - -		/* C1S0 is a physical slot. */ -		read_spd(&spd[2], 0x52); -	} - -If several slots are soldered there are two ways to handle them: - -* If all use the same SPD data, use the same file for all the slots. Do -  not forget to copy the data on all the array elements that need it. -* If they use different data, use several files. - -If memory initialization is not working, in particular write training (timB) -on DIMM's second rank fails, try enabling rank 1 mirroring, which can't be -detected by inteltool. It is described by SPD field "Address Mapping from Edge -Connector to DRAM", byte `63` (`0x3f`). Bit 0 describes Rank 1 Mapping, -0 = standard, 1 = mirrored; set it to 1. Bits 1-7 are reserved. - -### `board_info.txt` - -`board_info.txt` is a text file used in the board status page to list all -the supported boards and their specifications. Most of the information -cannot be detected by autoport. Common entries are: - -* `ROM package`, `ROM protocol` and `ROM socketed`: -  These refer to the flash chips you found earlier. You can visit -  <https://flashrom.org/Technology> for more information. - -* `Release year`: Use the power of Internet to find that information. -* `Category`: This describes the type of mainboard you have. -  Valid categories are: -  * `desktop`. Desktops and workstations. -  * `server`. Servers. -  * `laptop`. Laptops, notebooks and netbooks. -  * `half`. Embedded / PC/104 / Half-size boards. -  * `mini`. Mini-ITX / Micro-ITX / Nano-ITX -  * `settop`. Set-top-boxes / Thin clients. -  * `eval`. Development / Evaluation Boards. -  * `sbc`. Single-Board computer. -  * `emulation`: Virtual machines and emulators. May require especial care -                 as they often behave differently from real counterparts. -  * `misc`. Anything not fitting the categories above. Not recommended. - -* `Flashrom support`: This means whether the internal programmer is usable. -  If flashing coreboot internally works, this should be set to `y`. Else, -  feel free to investigate why it is not working. - -### `USBDEBUG_HCD_INDEX` - -Which controller the most easily accessible USB debug port is. On Intel, -1 is for `00:1d.0` and 2 is for `00:1a.0` (yes, it's reversed). Refer to -<https://www.coreboot.org/EHCI_Debug_Port> for more info. - -If you are able to use EHCI debug without setting the HCD index manually, -this is correct. - -### `BOARD_ROMSIZE_KB_2048` - -This parameter refers to the total size of the flash chips coreboot will be in. -This value must be correct for S3 resume to work properly. This parameter also -defines the size of the generated coreboot image, but that is not a major issue -since tools like `dd` can be used to cut fragments of a coreboot image to flash -on smaller chips. - -This should be detected automatically, but it may not be detected properly in -some cases. If it was not detected, put the correct total size here to serve -as a sane default when configuring coreboot. - -### `DRAM_RESET_GATE_GPIO` - -When the computer is suspended to RAM (ACPI S3), the RAM reset signal must not -reach the RAM modules. Otherwise, the computer will not resume and any opened -programs will be lost. This is done by powering down a MOSFET, which disconnects -the reset signal from the RAM modules. Most manufacturers put this gate on GPIO -60 but Lenovo is known to put it on GPIO 10. If suspending and resuming works, -this value is correct. This can also be determined from the board's schematics. - -## GNVS - -`mainboard_fill_gnvs` sets values in GNVS, which then ACPI makes use of for -various power-related functions. Normally, there is no need to modify it -on laptops (desktops have no "lid"!) but it makes sense to proofread it. - -## `gfx.ndid` and `gfx.did` - -Those describe which video outputs are declared in ACPI tables. -Normally, there is no need to have these values, but if you miss some -non-standard video output, you can declare it there. Bit 31 is set to -indicate the presence of the output. Byte 1 is the type and byte 0 is -used for disambigution so that ID composed of byte 1 and 0 is unique. - -Types are: -* 1 = VGA -* 2 = TV -* 3 = DVI -* 4 = LCD - -## `c*_acpower` and `c*_battery` - -Which mwait states to match to which ACPI levels. Normally, there is no -need to modify anything unless your device has very special power saving -requirements. - -## `install_intel_vga_int15_handler` - -This is used with the Intel VGA BIOS, which is not the default option. -It is more error-prone than open-source graphics initialization, so do -not bother with this until your mainboard boots. This is a function -which takes four parameters: -1.  Which type of LCD panel is connected. -2.  Panel fit. -3.  Boot display. -4.  Display type. - -Refer to `src/drivers/intel/gma/int15.h` to see which values can be used. -For desktops, there is no LCD panel directly connected to the Intel GPU, -so the first parameter should be `GMA_INT15_ACTIVE_LFP_NONE`. On other -mainboards, it depends. - -## CMOS options - -Due to the poor state of CMOS support in coreboot, autoport does not -support it and this probably won't change until the format in the tree -improves. If you really care about CMOS options: - -* Create files `cmos.layout` and `cmos.default` -* Enable `HAVE_OPTION_TABLE` and `HAVE_CMOS_DEFAULT` in `Kconfig` - -## EC (lenovo) - -You need to set `has_keyboard_backlight` (backlit keyboard like X230), -`has_power_management_beeps` (optional beeps when e.g. plugging the cord -in) and `has_uwb` (third MiniPCIe slot) in accordance to functions available -on your machine - -In rare cases autoport is unable to detect GPE. You can detect it from -dmesg or ACPI tables. Look for line in dmesg like - -	ACPI: EC: GPE = 0x11, I/O: command/status = 0x66, data = 0x62 - -This means that GPE is `0x11` in ACPI notation. This is the correct -value for `THINKPAD_EC_GPE`. To get the correct value for `GPE_EC_SCI` -you need to substract `0x10`, so value for it is `1`. - -The pin used to wake the machine from EC is guessed. If your machine doesn't -wake on lid open and pressing of Fn, change `GPE_EC_WAKE`. - -Keep `GPE_EC_WAKE` and `GPE_EC_SCI` in sync with `gpi*_routing`. -`gpi*_routing` matching `GPE_EC_WAKE` or `GPE_EC_SCI` is set to `2` -and all others are absent. - -If your dock has LPC wires or needs some special treatement you may -need to add codes to initialize the dock and support code to -DSDT. See the `init_dock()` for `x60`, `x200` or `x201`. - -## EC (generic laptop) - -Almost any laptop has an embedded controller. In a nutshell, it's a -small, low-powered computer designed to be used on laptops. Exact -functionality differs between machines. Its main functions include: - -* Control of power and rfkill to different component -* Keyboard (PS/2) interface implementation -* Battery, AC, LID and thermal information exporting -* Hotkey support - -autoport automatically attempts to restore the dumped config but it -may or may not work and may even lead to a hang or powerdown. If your -machine stops at `Replaying EC dump ...` try commenting EC replay out - -autoport tries to detect if machine has PS/2 interface and if so calls -`pc_keyboard_init` and exports relevant ACPI objects. If detection fails -you may have to add them yourself - -ACPI methods `_PTS` (prepare to sleep) and `_WAK` (wake) are executed -when transitioning to sleep or wake state respectively. You may need to -add power-related calls there to either shutdown some components or to -add a workaround to stop giving OS thermal info until next refresh. - -For exporting the battery/AC/LID/hotkey/thermal info you need to write -`acpi/ec.asl`. For an easy example look into `apple/macbook21` or -`packardbell/ms2290`. For information about needed methods consult -relevant ACPI specs. Tracing which EC events can be done using -[dynamic debug](https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips) - -EC GPE needs to be routed to SCI in order for OS in order to receive -EC events like "hotkey X pressed" or "AC plugged". autoport attempts -to detect GPE but in rare cases may fail. You can detect it from -dmesg or ACPI tables. Look for line in dmesg like - -	ACPI: EC: GPE = 0x11, I/O: command/status = 0x66, data = 0x62 - -This means that GPE is `0x11` in ACPI notation. This is the correct -value for `_GPE`. - -Keep GPE in sync with `gpi*_routing`. -`gpi*_routing` matching `GPE - 0x10` is set to `2` -and all others are absent. If EC has separate wake pin -then this GPE needs to be routed as well diff --git a/util/autoport/root.go b/util/autoport/root.go deleted file mode 100644 index 7e9e8145..00000000 --- a/util/autoport/root.go +++ /dev/null @@ -1,47 +0,0 @@ -package main - -import "fmt" -import "os" - -var supportedPCIDevices map[uint32]PCIDevice = map[uint32]PCIDevice{} -var PCIMap map[PCIAddr]PCIDevData = map[PCIAddr]PCIDevData{} - -func ScanRoot(ctx Context) { -	for _, pciDev := range ctx.InfoSource.GetPCIList() { -		PCIMap[pciDev.PCIAddr] = pciDev -	} -	for _, pciDev := range ctx.InfoSource.GetPCIList() { -		vendevid := (uint32(pciDev.PCIDevID) << 16) | uint32(pciDev.PCIVenID) - -		dev, ok := supportedPCIDevices[vendevid] -		if !ok { -			if pciDev.PCIAddr.Bus != 0 { -				fmt.Printf("Unknown PCI device %04x:%04x, assuming removable\n", -					pciDev.PCIVenID, pciDev.PCIDevID) -				continue -			} -			fmt.Printf("Unsupported PCI device %04x:%04x\n", -				pciDev.PCIVenID, pciDev.PCIDevID) -			dev = GenericPCI{Comment: fmt.Sprintf("Unsupported PCI device %04x:%04x", -				pciDev.PCIVenID, pciDev.PCIDevID)} -		} -		dev.Scan(ctx, pciDev) -	} -	if SouthBridge == nil { -		fmt.Println("Could not detect southbridge. Aborting!") -		os.Exit(1) -	} -	dmi := ctx.InfoSource.GetDMI() -	if !dmi.IsLaptop { -		NoEC(ctx) -	} else if dmi.Vendor == "LENOVO" { -		LenovoEC(ctx) -	} else { -		FIXMEEC(ctx) -	} -} - -func RegisterPCI(VenID uint16, DevID uint16, dev PCIDevice) { -	vendevid := (uint32(DevID) << 16) | uint32(VenID) -	supportedPCIDevices[vendevid] = dev -} diff --git a/util/autoport/sandybridge.go b/util/autoport/sandybridge.go deleted file mode 100644 index bd7f0f0c..00000000 --- a/util/autoport/sandybridge.go +++ /dev/null @@ -1,93 +0,0 @@ -package main - -import "fmt" - -type sandybridgemc struct { -} - -func (i sandybridgemc) Scan(ctx Context, addr PCIDevData) { -	inteltool := ctx.InfoSource.GetInteltool() - -	/* FIXME:XX Move this somewhere else.  */ -	MainboardIncludes = append(MainboardIncludes, "drivers/intel/gma/int15.h") -	MainboardEnable += (`	/* FIXME: fix these values. */ -	install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, -					GMA_INT15_PANEL_FIT_DEFAULT, -					GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); -`) - -	DevTree = DevTreeNode{ -		Chip:          "northbridge/intel/sandybridge", -		MissingParent: "northbridge", -		Comment:       "FIXME: GPU registers may not always apply.", -		Registers: map[string]string{ -			"gpu_dp_b_hotplug":                    FormatInt32((inteltool.IGD[0xc4030] >> 2) & 7), -			"gpu_dp_c_hotplug":                    FormatInt32((inteltool.IGD[0xc4030] >> 10) & 7), -			"gpu_dp_d_hotplug":                    FormatInt32((inteltool.IGD[0xc4030] >> 18) & 7), -			"gpu_panel_port_select":               FormatInt32((inteltool.IGD[0xc7208] >> 30) & 3), -			"gpu_panel_power_up_delay":            FormatInt32((inteltool.IGD[0xc7208] >> 16) & 0x1fff), -			"gpu_panel_power_backlight_on_delay":  FormatInt32(inteltool.IGD[0xc7208] & 0x1fff), -			"gpu_panel_power_down_delay":          FormatInt32((inteltool.IGD[0xc720c] >> 16) & 0x1fff), -			"gpu_panel_power_backlight_off_delay": FormatInt32(inteltool.IGD[0xc720c] & 0x1fff), -			"gpu_panel_power_cycle_delay":         FormatInt32(inteltool.IGD[0xc7210] & 0xff), -			"gpu_cpu_backlight":                   FormatHex32(inteltool.IGD[0x48254]), -			"gpu_pch_backlight":                   FormatHex32((inteltool.IGD[0xc8254] >> 16) * 0x10001), -			"gfx": fmt.Sprintf("GMA_STATIC_DISPLAYS(%d)", (inteltool.IGD[0xc6200] >> 12) & 1), -		}, -		Children: []DevTreeNode{ -			{ -				Chip:          "domain", -				Dev:           0, -				PCIController: true, -				ChildPCIBus:   0, -				PCISlots: []PCISlot{ -					PCISlot{PCIAddr: PCIAddr{Dev: 0x0, Func: 0}, writeEmpty: true, alias: "host_bridge", additionalComment: "Host bridge"}, -					PCISlot{PCIAddr: PCIAddr{Dev: 0x1, Func: 0}, writeEmpty: true, alias: "peg10", additionalComment: "PEG"}, -					PCISlot{PCIAddr: PCIAddr{Dev: 0x2, Func: 0}, writeEmpty: true, alias: "igd", additionalComment: "iGPU"}, -				}, -			}, -		}, -	} - -	PutPCIDev(addr, "Host bridge") - -	/* FIXME:XX some configs are unsupported.  */ -	KconfigBool["NORTHBRIDGE_INTEL_SANDYBRIDGE"] = true -	KconfigBool["USE_NATIVE_RAMINIT"] = true -	KconfigBool["INTEL_INT15"] = true -	KconfigBool["HAVE_ACPI_TABLES"] = true -	KconfigBool["HAVE_ACPI_RESUME"] = true - -	DSDTIncludes = append(DSDTIncludes, DSDTInclude{ -		File: "cpu/intel/common/acpi/cpu.asl", -	}) - -	DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{ -		File: "northbridge/intel/sandybridge/acpi/sandybridge.asl", -	}, DSDTInclude{ -		File: "drivers/intel/gma/acpi/default_brightness_levels.asl", -	}) -} - -func init() { -	RegisterPCI(0x8086, 0x0100, sandybridgemc{}) -	RegisterPCI(0x8086, 0x0104, sandybridgemc{}) -	RegisterPCI(0x8086, 0x0150, sandybridgemc{}) -	RegisterPCI(0x8086, 0x0154, sandybridgemc{}) -	RegisterPCI(0x8086, 0x0158, sandybridgemc{}) -	for _, id := range []uint16{ -		0x0102, 0x0106, 0x010a, -		0x0112, 0x0116, 0x0122, 0x0126, -		0x0152, 0x0156, 0x0162, 0x0166, -	} { -		RegisterPCI(0x8086, id, GenericVGA{GenericPCI{}}) -	} - -	/* PCIe bridge */ -	for _, id := range []uint16{ -		0x0101, 0x0105, 0x0109, 0x010d, -		0x0151, 0x0155, 0x0159, 0x015d, -	} { -		RegisterPCI(0x8086, id, GenericPCI{}) -	} -} | 
