raspberrypi / firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5.18k stars 1.68k forks source link

gpu_mem not effective when not placed in config.txt but included extraconfig.txt #1332

Open gvolt opened 4 years ago

gvolt commented 4 years ago

Describe the bug

As stated in the documentation (https://www.raspberrypi.org/documentation/configuration/config-txt/misc.md) the include option "Causes the content of the specified file to be inserted into the current file.".

This currently does not work for the gpu_mem* options: Setting gpu_mem not in /boot/config.txt but in a file that is "linked" by the include option in /boot/config.txt has no effect.

To reproduce

  1. Remove any gpu_mem* settings from /boot/config.txt.
  2. Add include extraconfig.txt to /boot/config.txt.
  3. Create /boot/extraconfig.txt.
  4. Add gpu_mem=32 to /boot/extraconfig.txt.

Expected behaviour GPU memory should be set to the value given by the gpu_mem option in the file referenced by the include option in /boot/config.txt.

In the example GPU memory should be: 32MB

Actual behaviour The gpu_mem setting is not obeyed if it is placed in a file that is referenced by the include option in /boot/config.txt.

In the example on a RPi3B+ vcgencmg get_mem gpu shows a GPU memory of 76MB instead of 32MB.

System Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:

Which model of Raspberry Pi?
  Pi3B+ v1.3

Which OS and version (cat /etc/rpi-issue)?
  Raspbian GNU/Linux 9 \n \l

  => 2019-04-08-raspbian-stretch-lite

Which firmware version (vcgencmd version)?
  Aug 15 2019 12:06:42
  Copyright (c) 2012 Broadcom
  version 0e6daa5106dd4164474616408e0dc24f997ffcf3 (clean) (release) (start)

Which kernel version (uname -a)?
  Linux xxxx 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

Logs sudo vcdbg log msg 001138.687: brfs: File read: /mfs/sd/config.txt 001138.840: brfs: File read: 1625 bytes 001139.534: brfs: File read: /mfs/sd/extraconfig.txt 001140.422: brfs: File read: 11 bytes 001150.945: HDMI:EDID error reading EDID block 0 attempt 0 001152.251: HDMI:EDID error reading EDID block 0 attempt 1 001153.549: HDMI:EDID error reading EDID block 0 attempt 2 001154.847: HDMI:EDID error reading EDID block 0 attempt 3 001156.145: HDMI:EDID error reading EDID block 0 attempt 4 001157.443: HDMI:EDID error reading EDID block 0 attempt 5 001158.741: HDMI:EDID error reading EDID block 0 attempt 6 001160.039: HDMI:EDID error reading EDID block 0 attempt 7 001161.337: HDMI:EDID error reading EDID block 0 attempt 8 001162.635: HDMI:EDID error reading EDID block 0 attempt 9 001163.697: HDMI:EDID giving up on reading EDID block 0 001164.058: HDMI:EDID error reading EDID block 0 attempt 0 001165.353: HDMI:EDID error reading EDID block 0 attempt 1 001166.646: HDMI:EDID error reading EDID block 0 attempt 2 001167.941: HDMI:EDID error reading EDID block 0 attempt 3 001169.234: HDMI:EDID error reading EDID block 0 attempt 4 001170.529: HDMI:EDID error reading EDID block 0 attempt 5 001171.823: HDMI:EDID error reading EDID block 0 attempt 6 001173.117: HDMI:EDID error reading EDID block 0 attempt 7 001174.410: HDMI:EDID error reading EDID block 0 attempt 8 001175.705: HDMI:EDID error reading EDID block 0 attempt 9 001176.762: HDMI:EDID giving up on reading EDID block 0 001194.943: brfs: File read: /mfs/sd/config.txt 001195.103: brfs: File read: 1625 bytes 001195.795: brfs: File read: /mfs/sd/extraconfig.txt 001416.598: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined 001418.688: *** Restart logging 001418.754: brfs: File read: 11 bytes 001419.505: hdmi: HDMI:EDID error reading EDID block 0 attempt 0 001420.814: hdmi: HDMI:EDID error reading EDID block 0 attempt 1 001422.117: hdmi: HDMI:EDID error reading EDID block 0 attempt 2 001423.420: hdmi: HDMI:EDID error reading EDID block 0 attempt 3 001424.723: hdmi: HDMI:EDID error reading EDID block 0 attempt 4 001426.026: hdmi: HDMI:EDID error reading EDID block 0 attempt 5 001427.329: hdmi: HDMI:EDID error reading EDID block 0 attempt 6 001428.632: hdmi: HDMI:EDID error reading EDID block 0 attempt 7 001429.935: hdmi: HDMI:EDID error reading EDID block 0 attempt 8 001431.238: hdmi: HDMI:EDID error reading EDID block 0 attempt 9 001432.304: hdmi: HDMI:EDID giving up on reading EDID block 0 001432.668: hdmi: HDMI:EDID error reading EDID block 0 attempt 0 001433.968: hdmi: HDMI:EDID error reading EDID block 0 attempt 1 001435.267: hdmi: HDMI:EDID error reading EDID block 0 attempt 2 001436.566: hdmi: HDMI:EDID error reading EDID block 0 attempt 3 001437.865: hdmi: HDMI:EDID error reading EDID block 0 attempt 4 001439.164: hdmi: HDMI:EDID error reading EDID block 0 attempt 5 001440.463: hdmi: HDMI:EDID error reading EDID block 0 attempt 6 001441.764: hdmi: HDMI:EDID error reading EDID block 0 attempt 7 001443.063: hdmi: HDMI:EDID error reading EDID block 0 attempt 8 001444.362: hdmi: HDMI:EDID error reading EDID block 0 attempt 9 001445.424: hdmi: HDMI:EDID giving up on reading EDID block 0 001445.506: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead 001445.578: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead 001450.522: brfs: File read: /mfs/sd/cmdline.txt 001450.619: Read command line from file 'cmdline.txt': 001450.682: 'dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=643d83d6-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait' 001450.996: brfs: File read: 142 bytes 001804.740: brfs: File read: /mfs/sd/kernel7.img 001804.801: Loading 'kernel7.img' to 0x8000 size 0x510950 001809.197: No kernel trailer - assuming DT-capable 001809.276: Trying Device Tree file 'bcm2710-rpi-3-b-plus.dtb' 001809.338: brfs: File read: 5310800 bytes 001812.925: brfs: File read: /mfs/sd/bcm2710-rpi-3-b-plus.dtb 001812.987: Loading 'bcm2710-rpi-3-b-plus.dtb' to 0x518950 size 0x69ca 001831.873: dtdebug: delete_node(/local_fixups__) 001842.390: dtdebug: /aliases:i2c_vc=i2c0 001852.906: dtdebug: /symbols:i2c_vc=i2c0 001860.808: dtdebug: /overrides:i2c_vc=i2c0 001875.947: dtdebug: /overrides:i2c_vc_baudrate=i2c0_baudrate 001880.728: dtdebug: /aliases:i2c=i2c1 001891.416: dtdebug: /symbols:i2c=i2c1 001899.434: dtdebug: /overrides:i2c=i2c1 001904.235: dtdebug: /aliases:i2c_arm=i2c1 001914.985: dtdebug: /symbols:i2c_arm=i2c1 001923.021: dtdebug: /overrides:i2c_arm=i2c1 001938.348: dtdebug: /overrides:i2c_baudrate=i2c1_baudrate 001953.716: dtdebug: /overrides:i2c_arm_baudrate=i2c1_baudrate 001961.088: dtparam: uart0_clkrate=48000000 001966.791: dtdebug: /overrides__ has no uart0_clkrate property 001966.806: Unknown dtparam 'uart0_clkrate' - ignored 001966.866: brfs: File read: 27082 bytes 001972.500: brfs: File read: /mfs/sd/config.txt 001972.648: brfs: File read: 1625 bytes 001974.085: brfs: File read: /mfs/sd/extraconfig.txt 001974.728: dtparam: audio=on 001980.213: dtdebug: Found override audio 001980.248: dtdebug: override audio: string target 'status' 002012.082: dtparam: uart1=off 002017.472: dtdebug: Found override uart1 002017.506: dtdebug: override uart1: string target 'status' 003860.721: dtparam: cam0-pwdn-ctrl=49 003866.128: dtdebug: Found override cam0-pwdn-ctrl 003866.151: dtparam: cam0-pwdn=5 003871.537: dtdebug: Found override cam0-pwdn 003883.596: dtparam: cam0-led-ctrl=49 003888.998: dtdebug: Found override cam0-led-ctrl 003889.020: dtparam: cam0-led=6 003894.502: dtdebug: Found override cam0-led 003894.525: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined 003894.609: dtparam: arm_freq=1400000000 003900.043: dtdebug: Found override arm_freq 003900.094: dtdebug: override arm_freq: cell target clock-frequency @ offset 0 (size 4) 003916.119: dtdebug: override arm_freq: cell target clock-frequency @ offset 0 (size 4) 003932.213: dtdebug: override arm_freq: cell target clock-frequency @ offset 0 (size 4) 003948.410: dtdebug: override arm_freq: cell target clock-frequency @ offset 0 (size 4) 003964.725: dtparam: core_freq=400000000 003970.489: dtdebug: /overrides has no core_freq property 003970.503: Unknown dtparam 'core_freq' - ignored 003983.489: dtdebug: delete_node(/hat) 003997.872: Device tree loaded to 0x2eff9200 (size 0x6df5) 004000.090: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined 005390.799: vchiq_core: vchiq_init_state: slot_zero = 0xfad80000, is_master = 1 008664.955: brfs: File read: 11 bytes

dmesg [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.19.66-v7+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1253 SMP Thu Aug 15 11:49:46 BST 2019 [ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d [ 0.000000] CPU: div instructions available: patching division code [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Plus Rev 1.3 [ 0.000000] Memory policy: Data cache writealloc [ 0.000000] cma: Reserved 8 MiB at 0x3ac00000 [ 0.000000] On node 0 totalpages: 242688 [ 0.000000] Normal zone: 2133 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 242688 pages, LIFO batch:63 [ 0.000000] random: get_random_bytes called from start_kernel+0xac/0x4b4 with crng_init=0 [ 0.000000] percpu: Embedded 17 pages/cpu s39488 r8192 d21952 u69632 [ 0.000000] pcpu-alloc: s39488 r8192 d21952 u69632 alloc=17*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 240555 [ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=643d83d6-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) [ 0.000000] Memory: 939088K/970752K available (8192K kernel code, 629K rwdata, 2176K rodata, 1024K init, 821K bss, 23472K reserved, 8192K cma-reserved) [ 0.000000] Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xbb800000 - 0xff800000 (1088 MB) lowmem : 0x80000000 - 0xbb400000 ( 948 MB) modules : 0x7f000000 - 0x80000000 ( 16 MB) .text : 0x(ptrval) - 0x(ptrval) (9184 kB) .init : 0x(ptrval) - 0x(ptrval) (1024 kB) .data : 0x(ptrval) - 0x(ptrval) ( 630 kB) .bss : 0x(ptrval) - 0x(ptrval) ( 822 kB) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] ftrace: allocating 26394 entries in 78 pages [ 0.000000] rcu: Hierarchical RCU implementation. [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns [ 0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns [ 0.000023] Switching to timer-based delay loop, resolution 52ns [ 0.000290] Console: colour dummy device 80x30 [ 0.000914] console [tty1] enabled [ 0.000971] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) [ 0.001016] pid_max: default: 32768 minimum: 301 [ 0.001373] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.001410] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.002347] CPU: Testing write buffer coherency: ok [ 0.002831] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 [ 0.003498] Setting up static identity map for 0x100000 - 0x10003c [ 0.003665] rcu: Hierarchical SRCU implementation. [ 0.004478] smp: Bringing up secondary CPUs ... [ 0.005343] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 [ 0.006271] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002 [ 0.007135] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003 [ 0.007256] smp: Brought up 1 node, 4 CPUs [ 0.007338] SMP: Total of 4 processors activated (153.60 BogoMIPS). [ 0.007362] CPU: All CPU(s) started in HYP mode. [ 0.007382] CPU: Virtualization extensions available. [ 0.008374] devtmpfs: initialized [ 0.021397] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4 [ 0.021673] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.021721] futex hash table entries: 1024 (order: 4, 65536 bytes) [ 0.022328] pinctrl core: initialized pinctrl subsystem [ 0.023203] NET: Registered protocol family 16 [ 0.026149] DMA: preallocated 1024 KiB pool for atomic coherent allocations [ 0.031846] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers. [ 0.031882] hw-breakpoint: maximum watchpoint size is 8 bytes. [ 0.032103] Serial: AMBA PL011 UART driver [ 0.034420] bcm2835-mbox 3f00b880.mailbox: mailbox enabled [ 0.069300] bcm2835-dma 3f007000.dma: DMA legacy API manager at (ptrval), dmachans=0x1 [ 0.071236] SCSI subsystem initialized [ 0.071481] usbcore: registered new interface driver usbfs [ 0.071564] usbcore: registered new interface driver hub [ 0.071677] usbcore: registered new device driver usb [ 0.090306] raspberrypi-firmware soc:firmware: Attached to firmware from 2019-08-15 12:06, variant start [ 0.100133] raspberrypi-firmware soc:firmware: Firmware hash is 0e6daa5106dd4164474616408e0dc24f997ffcf3 [ 0.111759] clocksource: Switched to clocksource arch_sys_counter [ 0.200928] VFS: Disk quotas dquot_6.6.0 [ 0.201037] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 0.201216] FS-Cache: Loaded [ 0.201442] CacheFiles: Loaded [ 0.211470] NET: Registered protocol family 2 [ 0.212294] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes) [ 0.212358] TCP established hash table entries: 8192 (order: 3, 32768 bytes) [ 0.212489] TCP bind hash table entries: 8192 (order: 4, 65536 bytes) [ 0.212693] TCP: Hash tables configured (established 8192 bind 8192) [ 0.212852] UDP hash table entries: 512 (order: 2, 16384 bytes) [ 0.212918] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes) [ 0.213246] NET: Registered protocol family 1 [ 0.213815] RPC: Registered named UNIX socket transport module. [ 0.213842] RPC: Registered udp transport module. [ 0.213865] RPC: Registered tcp transport module. [ 0.213886] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.215595] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available [ 0.218625] Initialise system trusted keyrings [ 0.218838] workingset: timestamp_bits=14 max_order=18 bucket_order=4 [ 0.228827] FS-Cache: Netfs 'nfs' registered for caching [ 0.229428] NFS: Registering the id_resolver key type [ 0.229475] Key type id_resolver registered [ 0.229497] Key type id_legacy registered [ 0.229528] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 0.231862] Key type asymmetric registered [ 0.231893] Asymmetric key parser 'x509' registered [ 0.231962] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250) [ 0.232144] io scheduler noop registered [ 0.232168] io scheduler deadline registered (default) [ 0.232363] io scheduler cfq registered [ 0.232387] io scheduler mq-deadline registered (default) [ 0.232411] io scheduler kyber registered [ 0.234605] bcm2708_fb soc:fb: FB found 1 display(s) [ 0.244107] Console: switching to colour frame buffer device 82x26 [ 0.250926] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 656x416 [ 0.257650] bcm2835-rng 3f104000.rng: hwrng registered [ 0.260326] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB) [ 0.265649] vc-sm: Videocore shared memory driver [ 0.268399] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000 [ 0.284283] brd: module loaded [ 0.296960] loop: module loaded [ 0.300001] Loading iSCSI transport class v2.0-870. [ 0.303186] libphy: Fixed MDIO Bus: probed [ 0.305695] usbcore: registered new interface driver lan78xx [ 0.308156] usbcore: registered new interface driver smsc95xx [ 0.310511] dwc_otg: version 3.00a 10-AUG-2012 (platform bus) [ 0.340797] dwc_otg 3f980000.usb: base=(ptrval) [ 0.543456] Core Release: 2.80a [ 0.545838] Setting default values for core params [ 0.548283] Finished setting default values for core params [ 0.751017] Using Buffer DMA mode [ 0.753425] Periodic Transfer Interrupt Enhancement - disabled [ 0.755852] Multiprocessor Interrupt Enhancement - disabled [ 0.758225] OTG VER PARAM: 0, OTG VER FLAG: 0 [ 0.760571] Dedicated Tx FIFOs mode [ 0.763305] WARN::dwc_otg_hcd_init:1045: FIQ DMA bounce buffers: virt = bad14000 dma = 0xfad14000 len=9024 [ 0.767886] FIQ FSM acceleration enabled for : Non-periodic Split Transactions Periodic Split Transactions High-Speed Isochronous Endpoints Interrupt/Control Split Transaction hack enabled [ 0.778818] dwc_otg: Microframe scheduler enabled [ 0.778878] WARN::hcd_init_fiq:457: FIQ on core 1 [ 0.781107] WARN::hcd_init_fiq:458: FIQ ASM at 80654f4c length 36 [ 0.783323] WARN::hcd_init_fiq:497: MPHI regs_base at bb810000 [ 0.785585] dwc_otg 3f980000.usb: DWC OTG Controller [ 0.787850] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1 [ 0.790174] dwc_otg 3f980000.usb: irq 56, io mem 0x00000000 [ 0.792503] Init: Port Power? op_state=1 [ 0.794746] Init: Power Port (0) [ 0.797161] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19 [ 0.801670] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.804105] usb usb1: Product: DWC OTG Controller [ 0.806476] usb usb1: Manufacturer: Linux 4.19.66-v7+ dwc_otg_hcd [ 0.808897] usb usb1: SerialNumber: 3f980000.usb [ 0.811873] hub 1-0:1.0: USB hub found [ 0.814155] hub 1-0:1.0: 1 port detected [ 0.816902] dwc_otg: FIQ enabled [ 0.816908] dwc_otg: NAK holdoff enabled [ 0.816913] dwc_otg: FIQ split-transaction FSM enabled [ 0.816924] Module dwc_common_port init [ 0.817196] usbcore: registered new interface driver usb-storage [ 0.819656] mousedev: PS/2 mouse device common for all mice [ 0.822825] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer [ 0.825450] bcm2835-cpufreq: min=600000 max=1400000 [ 0.828267] sdhci: Secure Digital Host Controller Interface driver [ 0.830676] sdhci: Copyright(c) Pierre Ossman [ 0.833473] mmc-bcm2835 3f300000.mmcnr: could not get clk, deferring probe [ 0.836376] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe [ 0.839049] sdhci-pltfm: SDHCI platform and OF driver helper [ 0.843173] ledtrig-cpu: registered to indicate activity on CPUs [ 0.845902] hidraw: raw HID events driver (C) Jiri Kosina [ 0.848668] usbcore: registered new interface driver usbhid [ 0.851296] usbhid: USB HID core driver [ 0.854633] vchiq: vchiq_init_state: slot_zero = (ptrval), is_master = 0

[ 0.867493] [vc_sm_connected_init]: end - returning 0 [ 0.871035] Initializing XFRM netlink socket [ 0.873490] NET: Registered protocol family 17 [ 0.875998] Key type dns_resolver registered [ 0.878834] Registering SWP/SWPB emulation handler [ 0.881974] registered taskstats version 1 [ 0.884377] Loading compiled-in X.509 certificates [ 0.894019] uart-pl011 3f201000.serial: cts_event_workaround enabled [ 0.896546] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2 [ 0.903344] mmc-bcm2835 3f300000.mmcnr: mmc_debug:0 mmc_debug2:0 [ 0.905878] mmc-bcm2835 3f300000.mmcnr: DMA channel allocated [ 0.934497] sdhost: log_buf @ (ptrval) (fad13000) [ 0.972931] mmc1: queuing unknown CIS tuple 0x80 (2 bytes) [ 0.976894] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 0.980748] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 0.982984] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1) [ 0.986456] of_cfs_init [ 0.988699] of_cfs_init: OK [ 0.991306] Waiting for root device PARTUUID=643d83d6-02... [ 1.007554] mmc1: queuing unknown CIS tuple 0x80 (7 bytes) [ 1.031882] Indeed it is in host mode hprt0 = 00021501 [ 1.102666] random: fast init done [ 1.131604] mmc0: host does not support reading read-only switch, assuming write-enable [ 1.139589] mmc0: new high speed SDHC card at address aaaa [ 1.144670] mmcblk0: mmc0:aaaa SL32G 29.7 GiB [ 1.148594] mmc1: new high speed SDIO card at address 0001 [ 1.153634] mmcblk0: p1 p2 [ 1.187371] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) [ 1.191937] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. [ 1.205915] devtmpfs: mounted [ 1.213606] Freeing unused kernel memory: 1024K [ 1.241802] usb 1-1: new high-speed USB device number 2 using dwc_otg [ 1.244694] Run /sbin/init as init process [ 1.244785] Indeed it is in host mode hprt0 = 00001101 [ 1.482099] usb 1-1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3 [ 1.487478] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.491002] hub 1-1:1.0: USB hub found [ 1.493963] hub 1-1:1.0: 4 ports detected [ 1.702413] systemd[1]: System time before build time, advancing clock. [ 1.811816] usb 1-1.1: new high-speed USB device number 3 using dwc_otg [ 1.841557] NET: Registered protocol family 10 [ 1.845646] Segment Routing with IPv6 [ 1.880348] random: systemd: uninitialized urandom read (16 bytes read) [ 1.885749] random: systemd: uninitialized urandom read (16 bytes read) [ 1.894580] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN) [ 1.903461] systemd[1]: Detected architecture arm. [ 1.929761] systemd[1]: Set hostname to . [ 1.942128] usb 1-1.1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3 [ 1.947389] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.950587] hub 1-1.1:1.0: USB hub found [ 1.953329] hub 1-1.1:1.0: 3 ports detected [ 2.001169] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read) [ 2.308977] dwc_otg_handle_wakeup_detected_intr lxstate = 2 [ 2.465998] systemd[1]: Listening on udev Kernel Socket. [ 2.472305] systemd[1]: Reached target Swap. [ 2.478955] systemd[1]: Created slice User and Session Slice. [ 2.485267] systemd[1]: Listening on udev Control Socket. [ 2.491226] systemd[1]: Listening on fsck to fsckd communication Socket. [ 2.498097] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point. [ 2.507548] systemd[1]: Listening on Syslog Socket. [ 2.821819] usb 1-1.1.1: new high-speed USB device number 4 using dwc_otg [ 2.952342] usb 1-1.1.1: New USB device found, idVendor=0424, idProduct=7800, bcdDevice= 3.00 [ 2.952360] usb 1-1.1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 3.216912] lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): No External EEPROM. Setting MAC Speed [ 3.217860] libphy: lan78xx-mdiobus: probed [ 3.229589] lan78xx 1-1.1.1:1.0 (unnamed net_device) (uninitialized): int urb period 64 [ 3.328122] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) [ 3.499774] systemd-journald[114]: Received request to flush runtime journal from PID 1 [ 3.889070] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned. [ 3.894438] bcm2835_vc_sm_cma_probe: Videocore shared memory driver

[ 3.899447] [vc_sm_connected_init]: installed successfully [ 3.914928] media: Linux media interface: v0.10 [ 4.009064] videodev: Linux video capture interface: v2.00 [ 4.093926] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned. [ 4.095617] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned. [ 4.108957] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned. [ 4.114091] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned. [ 4.128508] bcm2835-codec bcm2835-codec: Device registered as /dev/video10 [ 4.128528] bcm2835-codec bcm2835-codec: Loaded V4L2 decode [ 4.144125] bcm2835_audio soc:audio: card created with 8 channels [ 4.144274] bcm2835-codec bcm2835-codec: Device registered as /dev/video11 [ 4.144284] bcm2835-codec bcm2835-codec: Loaded V4L2 encode [ 4.154318] bcm2835-codec bcm2835-codec: Device registered as /dev/video12 [ 4.154332] bcm2835-codec bcm2835-codec: Loaded V4L2 isp [ 4.190117] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 4.261391] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 4.343636] brcmfmac: F1 signature read @0x18000000=0x15264345 [ 4.374526] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 [ 4.374957] usbcore: registered new interface driver brcmfmac [ 4.587624] random: crng init done [ 4.587639] random: 7 urandom warning(s) missed due to ratelimiting [ 4.603526] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 [ 4.650221] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04 [ 5.484005] tun: Universal TUN/TAP device driver, 1.6 [ 5.743103] uart-pl011 3f201000.serial: no DMA platform data [ 6.154113] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SSFS [ 6.165255] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 6.166076] brcmfmac: power management disabled [ 6.415864] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 12.183256] Bluetooth: Core ver 2.22 [ 12.183351] NET: Registered protocol family 31 [ 12.183358] Bluetooth: HCI device and connection manager initialized [ 12.183379] Bluetooth: HCI socket layer initialized [ 12.183393] Bluetooth: L2CAP socket layer initialized [ 12.183434] Bluetooth: SCO socket layer initialized [ 12.202773] Bluetooth: HCI UART driver ver 2.3 [ 12.202787] Bluetooth: HCI UART protocol H4 registered [ 12.202918] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 12.203152] Bluetooth: HCI UART protocol Broadcom registered [ 12.408452] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 12.408460] Bluetooth: BNEP filters: protocol multicast [ 12.408474] Bluetooth: BNEP socket layer initialized [ 12.559220] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

Additional context The issue has been mentioned some time ago for Alpine Linux (look for keyword "Update 3"): https://www.raspberrypi.org/forums/viewtopic.php?f=56&t=60569&p=765924&hilit=gpu_mem+config.txt+include#p764210

timg236 commented 4 years ago

Include directives are not supported in the second stage bootloader on either Pi3 or Pi4

pelwell commented 4 years ago

To expand a bit on @timg236's comment, the gpu_mem setting is used by bootcode.bin (on Pi 3 and earlier) and by the SPI EEPROM (Pi 4) to determine where to load the main start*.elf firmware to. The config parsing done at that time is a restricted version of the full parser and is missing the include feature.

gvolt commented 4 years ago

Thank you very much for your very fast replies.

Is there any other possibility to set gpu_mem from outside config.txt?

pelwell commented 4 years ago

The answer is likely to be "No", but a bit of background on your use case would help.

gvolt commented 4 years ago

The question originally arose on a Volumio (audio player) system whose system updates overwrite the config.txt. The config.txt provided by Volumio already contains an include option pointing to a file called userconfig.txt. Its purpose is to give the user the ability to save customized boot configuration parameters to a file that does not get overwritten on system updates. After first discovering the issue regarding gpu_mem on that kind of system I tested on the Stretch based Rasbian system to verify.

Out of interest: When (on what bootloader) does the include option get processed?

pelwell commented 4 years ago

include is only expanded by the main firmware, i.e. start*.elf.

gvolt commented 4 years ago

Good to know.

Is there a list which of the options from the documentation do / don't work when placed in an included file?

pelwell commented 4 years ago

The following are supported by bootcode.bin (and probably the EEPROM as well):

  1. These settings:
    gpu_mem
    gpu_mem_256
    gpu_mem_512
    gpu_mem_1024
    total_mem
    require_total_mem
    startx
    start_x
    start_debug
    boot_partition
    legacy_mapping
    bootcode_delay
    force_pvt
    uart_2ndstage
    start_file
    fixup_file
  2. Filtering my model ([pi3])
  3. Filtering by serial number
  4. Filtering by gpio levels ([gpio4=0])

Of those, only the filters are supported by the main firmware, so they are the only ones which will work in an included file (plus all of the other config settings).

timg236 commented 4 years ago

Force_pvt and legacy_mapping aren't supported in the EEPROM but the others are. The Pi4 bootloader should probably have a dedicated page for config.txt, Something to do next time I update https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md

gvolt commented 4 years ago

Ok, that's very helpful to know. Thanks a lot!

Regarding the options from the list above (and especially gpu_mem) would there be another way to achieve the same result like setting them in config.txt (well, I know that's what config.txt is for...)?

pelwell commented 4 years ago

would there be another way to achieve the same result like setting them in config.txt (well, I know that's what config.txt is for...)?

No, sorry. Would putting the user configuration options in the included file work (after some user retraining), or is there another case where the user setting comes from the restricted list above? It feels like there shouldn't be - they are all very low-level settings.

gvolt commented 4 years ago

In my case the users would not have to edit system files manually. They can install a plugin to the Volumio system which allows them to adjust e.g. the setting for gpu_mem through a GUI.

The plugin can easily work on the config.txt, but settings put in there would be overwritten each time the system gets updated whereas the included file does not get touched. So the plan was to use the include option for gpu_mem (amongst others but not from the listed ones). If there would be another way to set gpu_mem in the boot process this would / should also be handled not directly by the user who only accesses the GUI.

pelwell commented 4 years ago

The various "official" update methods - apt, rpi-update - never overwrite config.txt. You only get a new one by installing a new image.

Can the Volumio devs not be encouraged to put "system" settings in an included file that they are free to overwrite as they wish? Or split the file with a recognised separator so that user settings are preserved by an update?

gvolt commented 4 years ago

Yes, system updates come as new images ;)

It might be worth a tought to flip the concept where "vanillla" settings brought by system updates are being placed. I will put that up for discussion.

Appreciate your help and thoughts very much.