Date   

Re: [error-report-web][PATCH V2] Add local.conf and auto.conf into error details

Richard Purdie
 

On Mon, 2021-03-22 at 15:32 +0000, Richard Purdie via lists.yoctoproject.org wrote:
Sorry about the delay on this, we do really need to get this resolved.
I'm wondering if we should replace the angled brackets test with
https://github.com/mozilla/bleach which would then remove the need
for these workarounds.

Would you be able to update the patch for the others issues please
and then we can look at this one separately?
I just sent out an as yet untested patch which may fix some of the quoting
issues by using bleach. I'd still need to add it to the requirements file...

Cheers,

Richard


[error-report-web] [PATCH] Post/parser: Use bleach to sanitse XSS input

Richard Purdie
 

Instead of searching for "<", use bleach to sanity input to avoid
any XSS issues.

Signed-off-by: Richard Purdie <richard.purdie@...>
---
Post/parser.py | 26 +++++++++-----------------
1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/Post/parser.py b/Post/parser.py
index f411e02..536e872 100644
--- a/Post/parser.py
+++ b/Post/parser.py
@@ -9,6 +9,7 @@
# Licensed under the MIT license, see COPYING.MIT for details

import json, re
+import bleach
from Post.models import Build, BuildFailure, ErrorType
from django.conf import settings
from django.utils import timezone
@@ -19,21 +20,6 @@ class Parser:
def __init__(self, data):
self.data = data.decode('utf-8')

- # returns true if the values contain '<' char
- # Ignore the failures field (which is an array anyway)
- # Ignore any non-str fields too [YOCTO #14208]
- def contains_tags (self, data):
- for key,val in data.items():
- if key == 'failures':
- continue
-
- if not isinstance(val, str):
- continue
-
- if '<' in val:
- return True
- return False
-
def parse(self, request):
build_fails_logged = []

@@ -42,8 +28,14 @@ class Parser:
except:
return { 'error' : 'Invalid json' }

- if self.contains_tags(jsondata) == True:
- return { 'error' : 'Invalid characters in json' }
+ # Bleach data going directly into the database so that
+ # displaying in any of the graphing doesn't introduce XSS
+ for key,val in jsondata.items():
+ if key == 'failures':
+ continue
+ if not isinstance(val, str):
+ continue
+ jsondata[key] = bleach.clean(val)

b = Build.objects.create()
try:
--
2.30.2


Re: Enabling Serial console via uart1(serial1) in cm3(rpi3) kernel 5.4. #cm3 #dunfell

Zoran
 

Why am I (only, seems) always answering NON YOCTO issues in the YOCTO
thread??? ;-)
_______

OK. The good sign about what U R talking is shown here:
[ 0.000885] printk: console [tty1] enabled

But now another issue I'm facing when I'm enabling console
via this ttsS0 port i.e.
[ 13.280639] ttyS ttyS0: 2 input overrun(s)
It is on the several places:
[ 6.480654] ttyS ttyS0: 2 input overrun(s)
[ 7.962826] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex,
lpa 0xCDE1
[ 7.973416] ttyS ttyS0: 2 input overrun(s)
[ 11.883822] Installing knfsd (copyright (C) 1996 okir@...).
[ 11.893705] ttyS ttyS0: 2 input overrun(s)
[ 13.268076] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state
recovery directory
[ 13.280639] ttyS ttyS0: 2 input overrun(s)

It seems that the solution for this problem is:
https://www.linuxquestions.org/questions/linux-kernel-70/tty-usb-input-overruns-4175512707/

Namely:
https://www.linuxquestions.org/questions/linux-kernel-70/tty-usb-input-overruns-4175512707/#post5215591

I fixed the problem with increasing the N_TTY_BUF_SIZE from 4096 to 131072
(file /include/linux/tty.h) and recompiled the linux kernel. I'm getting no more tty
input overrun(s).
Please, let us know.

Zee
_______





On Mon, Mar 22, 2021 at 10:19 AM <prashantsingh@...> wrote:

Hi Zoran,
here is the cat /proc/cmdline output of my cm3-

coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:AD:85:CA vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait kgdboc=ttyAMA0,115200

Earlier my issue was that I was no getting /dev/ttyS0 terminal in my yocto image for cm3.
But going through the web I got that setting 1 to CONFIG_SERIAL_8250_RUNTIME_UARTS solved that issue and now I'm getting ttyS0 in my /dev directory.

But now another issue I'm facing when I'm enabling cosole via this ttsS0 port i.e.
[ 13.280639] ttyS ttyS0: 2 input overrun(s)

here is my dmesg output:

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.64-v7 (oe-user@oe-host) (gcc version 9.3.0 (GCC)) #1 SMP Fri Sep 11 12:57:30 UTC 2020
[ 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 Compute Module 3 Rev 1.0
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x37400000, size 64 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 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] percpu: Embedded 20 pages/cpu s50060 r8192 d23668 u81920
[ 0.000000] pcpu-alloc: s50060 r8192 d23668 u81920 alloc=20*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 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:AD:85:CA vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait kgdboc=ttyAMA0,115200
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 880444K/970752K available (9216K kernel code, 716K rwdata, 2684K rodata, 1024K init, 849K bss, 24772K reserved, 65536K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] ftrace: allocating 29805 entries in 59 pages
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x328/0x508 with crng_init=0
[ 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.000006] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[ 0.000020] Switching to timer-based delay loop, resolution 52ns
[ 0.000288] Console: colour dummy device 80x30
[ 0.000885] printk: console [tty1] enabled
[ 0.000960] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[ 0.001009] pid_max: default: 32768 minimum: 301
[ 0.001232] LSM: Security Framework initializing
[ 0.001477] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.001524] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.002936] Disabling memory control group subsystem
[ 0.003081] CPU: Testing write buffer coherency: ok
[ 0.003674] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004651] Setting up static identity map for 0x100000 - 0x100060
[ 0.004873] rcu: Hierarchical SRCU implementation.
[ 0.005586] smp: Bringing up secondary CPUs ...
[ 0.006748] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.008417] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[ 0.009943] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[ 0.010479] smp: Brought up 1 node, 4 CPUs
[ 0.010528] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[ 0.010557] CPU: All CPU(s) started in HYP mode.
[ 0.010582] CPU: Virtualization extensions available.
[ 0.011597] devtmpfs: initialized
[ 0.027564] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[ 0.028074] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.028132] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.031459] pinctrl core: initialized pinctrl subsystem
[ 0.032650] NET: Registered protocol family 16
[ 0.036992] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.041879] audit: initializing netlink subsys (disabled)
[ 0.042183] audit: type=2000 audit(0.040:1): state=initialized audit_enabled=0 res=1
[ 0.043730] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.043770] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.044019] Serial: AMBA PL011 UART driver
[ 0.046056] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[ 0.070160] raspberrypi-firmware soc:firmware: Attached to firmware from 2020-09-11 14:25, variant start
[ 0.080196] raspberrypi-firmware soc:firmware: Firmware hash is ecd571f7947fb751a266d8591b0573d4d975fbe6
[ 0.132933] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1
[ 0.135178] SCSI subsystem initialized
[ 0.135460] usbcore: registered new interface driver usbfs
[ 0.135556] usbcore: registered new interface driver hub
[ 0.135703] usbcore: registered new device driver usb
[ 0.137691] clocksource: Switched to clocksource arch_sys_counter
[ 1.382483] VFS: Disk quotas dquot_6.6.0
[ 1.382646] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 1.382869] FS-Cache: Loaded
[ 1.383168] CacheFiles: Loaded
[ 1.394807] thermal_sys: Registered thermal governor 'step_wise'
[ 1.395207] NET: Registered protocol family 2
[ 1.396283] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 1.396360] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 1.396501] TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 1.396713] TCP: Hash tables configured (established 8192 bind 8192)
[ 1.396898] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[ 1.396973] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[ 1.397287] NET: Registered protocol family 1
[ 1.398427] RPC: Registered named UNIX socket transport module.
[ 1.398462] RPC: Registered udp transport module.
[ 1.398488] RPC: Registered tcp transport module.
[ 1.398515] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.400297] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[ 1.404004] Initialise system trusted keyrings
[ 1.404281] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[ 1.416225] FS-Cache: Netfs 'nfs' registered for caching
[ 1.416897] NFS: Registering the id_resolver key type
[ 1.416978] Key type id_resolver registered
[ 1.417005] Key type id_legacy registered
[ 1.417043] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 1.418451] Key type asymmetric registered
[ 1.418482] Asymmetric key parser 'x509' registered
[ 1.418551] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 1.418590] io scheduler mq-deadline registered
[ 1.418618] io scheduler kyber registered
[ 1.423548] bcm2708_fb soc:fb: FB found 1 display(s)
[ 1.437559] Console: switching to colour frame buffer device 90x30
[ 1.446253] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 720x480
[ 1.452896] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[ 1.458395] bcm2835-rng 3f104000.rng: hwrng registered
[ 1.461812] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[ 1.468540] vc-sm: Videocore shared memory driver
[ 1.472180] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 1.489107] brd: module loaded
[ 1.505307] loop: module loaded
[ 1.509860] Loading iSCSI transport class v2.0-870.
[ 1.513862] libphy: Fixed MDIO Bus: probed
[ 1.517035] usbcore: registered new interface driver lan78xx
[ 1.520267] usbcore: registered new interface driver smsc95xx
[ 1.523303] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 2.254610] Core Release: 2.80a
[ 2.257707] Setting default values for core params
[ 2.260769] Finished setting default values for core params
[ 2.464194] Using Buffer DMA mode
[ 2.467200] Periodic Transfer Interrupt Enhancement - disabled
[ 2.470261] Multiprocessor Interrupt Enhancement - disabled
[ 2.473253] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 2.476233] Dedicated Tx FIFOs mode
[ 2.479874] WARN::dwc_otg_hcd_init:1072: FIQ DMA bounce buffers: virt = b7504000 dma = 0xf7504000 len=9024
[ 2.486063] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[ 2.500574] dwc_otg: Microframe scheduler enabled
[ 2.500642] WARN::hcd_init_fiq:457: FIQ on core 1
[ 2.503411] WARN::hcd_init_fiq:458: FIQ ASM at 80728fa4 length 36
[ 2.506123] WARN::hcd_init_fiq:496: MPHI regs_base at bb810000
[ 2.508797] dwc_otg 3f980000.usb: DWC OTG Controller
[ 2.511499] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[ 2.514279] dwc_otg 3f980000.usb: irq 56, io mem 0x00000000
[ 2.517028] Init: Port Power? op_state=1
[ 2.519717] Init: Power Port (0)
[ 2.522754] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[ 2.528327] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.531293] usb usb1: Product: DWC OTG Controller
[ 2.534211] usb usb1: Manufacturer: Linux 5.4.64-v7 dwc_otg_hcd
[ 2.537146] usb usb1: SerialNumber: 3f980000.usb
[ 2.540771] hub 1-0:1.0: USB hub found
[ 2.543657] hub 1-0:1.0: 1 port detected
[ 2.547238] dwc_otg: FIQ enabled
[ 2.547248] dwc_otg: NAK holdoff enabled
[ 2.547258] dwc_otg: FIQ split-transaction FSM enabled
[ 2.547274] Module dwc_common_port init
[ 2.547609] usbcore: registered new interface driver usb-storage
[ 2.550721] mousedev: PS/2 mouse device common for all mice
[ 2.554936] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[ 2.560496] sdhci: Secure Digital Host Controller Interface driver
[ 2.563302] sdhci: Copyright(c) Pierre Ossman
[ 2.566769] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[ 2.570026] sdhci-pltfm: SDHCI platform and OF driver helper
[ 2.573709] ledtrig-cpu: registered to indicate activity on CPUs
[ 2.576947] hidraw: raw HID events driver (C) Jiri Kosina
[ 2.580129] usbcore: registered new interface driver usbhid
[ 2.583142] usbhid: USB HID core driver
[ 2.586528] ashmem: initialized
[ 2.590509] vchiq: vchiq_init_state: slot_zero = (ptrval)
[ 2.595277] [vc_sm_connected_init]: start
[ 2.605012] [vc_sm_connected_init]: end - returning 0
[ 2.610026] Initializing XFRM netlink socket
[ 2.613006] NET: Registered protocol family 17
[ 2.616003] Key type dns_resolver registered
[ 2.619492] Registering SWP/SWPB emulation handler
[ 2.622506] registered taskstats version 1
[ 2.625154] Loading compiled-in X.509 certificates
[ 2.628349] Key type ._fscrypt registered
[ 2.630977] Key type .fscrypt registered
[ 2.644359] uart-pl011 3f201000.serial: cts_event_workaround enabled
[ 2.647220] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
[ 2.655430] printk: console [ttyS0] disabled
[ 2.658305] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550
[ 3.678083] printk: console [ttyS0] enabled
[ 3.685731] KGDB: Registered I/O driver kgdboc
[ 3.693806] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[ 3.705593] sdhost: log_buf @ (ptrval) (f7507000)
[ 3.761622] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 3.772680] of_cfs_init
[ 3.778301] of_cfs_init: OK
[ 3.785362] Waiting for root device /dev/mmcblk0p2...
[ 3.797847] Indeed it is in host mode hprt0 = 00021501
[ 3.891131] random: fast init done
[ 3.936402] mmc0: new high speed MMC card at address 0001
[ 3.946012] mmcblk0: mmc0:0001 4FTE4R 3.64 GiB
[ 3.953973] mmcblk0boot0: mmc0:0001 4FTE4R partition 1 4.00 MiB
[ 3.963473] mmcblk0boot1: mmc0:0001 4FTE4R partition 2 4.00 MiB
[ 3.972635] mmcblk0rpmb: mmc0:0001 4FTE4R partition 3 512 KiB, chardev (245:0)
[ 3.985330] mmcblk0: p1 p2
[ 4.007759] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 4.011189] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 4.017529] Indeed it is in host mode hprt0 = 00001101
[ 4.031809] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 4.050759] devtmpfs: mounted
[ 4.102220] Freeing unused kernel memory: 1024K
[ 4.128140] Run /sbin/init as init process
[ 4.278133] usb 1-1: New USB device found, idVendor=0424, idProduct=9514, bcdDevice= 2.00
[ 4.292686] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4.303966] hub 1-1:1.0: USB hub found
[ 4.311058] hub 1-1:1.0: 5 ports detected
[ 4.647797] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 4.730514] udevd[115]: starting version 3.2.9
[ 4.745524] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.756762] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.766616] random: udevd: uninitialized urandom read (16 bytes read)
[ 4.788165] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00, bcdDevice= 2.00
[ 4.802823] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4.814602] udevd[117]: starting eudev-3.2.9
[ 4.818138] smsc95xx v1.0.6
[ 4.923876] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ad:85:ca
[ 5.161891] i2c /dev entries driver
[ 5.216319] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 5.972781] random: crng init done
[ 5.979289] random: 2 urandom warning(s) missed due to ratelimiting
[ 6.470391] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 6.480654] ttyS ttyS0: 2 input overrun(s)
[ 7.962826] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[ 7.973416] ttyS ttyS0: 2 input overrun(s)
[ 11.883822] Installing knfsd (copyright (C) 1996 okir@...).
[ 11.893705] ttyS ttyS0: 2 input overrun(s)
[ 13.268076] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[ 13.280639] ttyS ttyS0: 2 input overrun(s)
[ 13.294215] NFSD: Using legacy client tracking operations.
[ 13.304013] NFSD: starting 90-second grace period (net f00004c1)
[ 1014.267771] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[ 1014.399220] usb 1-1.2: New USB device found, idVendor=0b95, idProduct=772b, bcdDevice= 0.02
[ 1014.408345] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1014.416278] usb 1-1.2: Product: AX88772B
[ 1014.420431] usb 1-1.2: Manufacturer: ASIX Elec. Corp.
[ 1014.425889] usb 1-1.2: SerialNumber: 000001



Please assist me if you have some clue regarding this issue.

Thanks and Regards.


Re: [meta-rockchip][PATCH] Add machine definitions for NanoPi-M4 boards

Trevor Woerner
 

On Mon, Mar 22, 2021 at 11:00 AM Yann Dirson
<yann.dirson@...> wrote:
Wouldn't it be useful to have a standard way to specify such hardware
variants, that
would be recognized as such by the layer index ?
Sure it would! But then you'd have to get all the BSP layer
maintainers to agree on that format and use it… :-/


Re: [meta-rockchip][PATCH] Add machine definitions for NanoPi-M4 boards

Trevor Woerner
 

Hi Yann,

Thanks for the patch updates. I'll look at them soon.

On Mon 2021-03-22 @ 04:31:01 PM, Yann Dirson wrote:
BTW, I'm also unclear on what to do next to better support those
boards: with the default
kernel config only a subset of the hardware is supported, and for
state-of-the-art hw
support we'll also need patches not yet in upstream kernel (from eg.
armbian and libreelec).

I feel it would be good to provide defconfig files for those machines,
but then there are
several options to handle that. Would a minimal hw-focused defconfig
suitable for
`KCONFIG_MODE = "--allnoconfig"` be a good option ?
I feel exactly the same way.

By default all arm64 kernels are configured with the one, in-kernel, generic
arm64 defconfig. That gives me a kernel that is over 11MB in size, and
includes all sorts of useless drivers.

I've been working off-and-on on a mechanism for meta-rockchip that would allow
users to decide between the default in-kernel arm64 defconfig (which would
be selected by doing nothing) or using a leaner defconfig that I have been
tweaking specifically for each board. Currently I only have a lean defconfig
for rock-pi-4b, but it was my hope to generate defconfigs for all supported
boards.

Ideally I had wanted to leverage the linux-yocto kmeta mechanism to generate
defconfigs dynamically based on the specific machine and specific user
preferences, but that didn't go as smoothly as I was hoping, then I got
distracted by other things.

I had created a spreadsheet with a comparison between the various boards that
would have been a basis for the individual kmeta pieces. Maybe I'll find some
more time to poke at it later this week. I could also push my WIP stuff to
somewhere if you'd like to take a look.

In any case, my point is, I'm very interested in something better than what
currently exists :-)

One thing that I'd like to keep clear in meta-rockchip is to always allow the
user to choose between upstream and "extras". My feeling is: the simplest
build, if the user does nothing explicit, will always pull from pure upstream
with no out-of-tree patches or vendor pieces. But I'm not opposed to having
a mechanism whereby if the user does something explicit, they can choose to
use a vendor tree or make use of out-of-tree patches for various things.

Best regards,
Trevor


Re: [error-report-web][PATCH V2] Add local.conf and auto.conf into error details

Richard Purdie
 

On Fri, 2020-02-14 at 10:42 +0800, Changqing Li wrote:
On 12/11/19 1:45 PM, Changqing Li wrote:
On 11/13/19 6:36 PM, Paul Eggleton wrote:
Hi Changqing,

Some comments below.

On Tuesday, 12 November 2019 9:32:53 PM NZDT
changqing.li@... wrote:
From: Changqing Li <changqing.li@...>

+        {% if detail.BUILD.LOCAL_CONF != "" %}
+        <dt></a>Local Conf:</dt>
+        <dd style="white-space: pre-wrap;">{{
detail.BUILD.LOCAL_CONF | safe }}</dd>
+        {% endif %}
+
+        {% if detail.BUILD.AUTO_CONF != "" %}
+        <dt></a>Auto Conf:</dt>
+        <dd style="white-space: pre-wrap;">{{
detail.BUILD.AUTO_CONF | safe }}</dd>
+        {% endif %}
We cannot use the safe filter here - doing so could open up an XSS
vulnerability, since anyone can upload anything to the error-report
application and the content could include links or other malicious
HTML data. We should allow it to be auto-escaped. Is there a
particular issue you were using this to solve?
This is for resolve a problem when there is angle brackets in
local.conf/auto.conf.

I have a patch in oe-core [OE-core] [PATCH] report-error.bbclass:
replace angle brackets with &lt; and &gt;]

when we have below content in local.conf or auto.conf:
BUILDHISTORY_COMMIT_AUTHOR ?= "Khem Raj<raj.khem@...>"
send-error-report will fail with "HTTP Error 500: OK"

error-report-web do rudimentary check on all fields that are
passed to the graphs page to avoid any XSS happening, if contains
'<', the server will return error(Invalid characters in json).
fixed by use escape of <> to replace it.

NOTE: with this change, error-report-web need to add filter 'safe'
for the string wanted to display to avoid further HTML escaping
prior to output. Below is how the content displayed on webpage:
with the filter 'safe':
BUILDHISTORY_COMMIT_AUTHOR ?= "Khem Raj<raj.khem@...>"
without the filter 'safe':
BUILDHISTORY_COMMIT_AUTHOR ?= "Khem Raj &lt;raj.khem@...&gt;"

Do you have good idea to resolve this? Thanks.
Sorry about the delay on this, we do really need to get this resolved.
I'm wondering if we should replace the angled brackets test with
https://github.com/mozilla/bleach which would then remove the need
for these workarounds.

Would you be able to update the patch for the others issues please
and then we can look at this one separately?

Thanks,

Richard


Re: [meta-rockchip][PATCH] Add machine definitions for NanoPi-M4 boards

Yann Dirson
 

BTW, I'm also unclear on what to do next to better support those
boards: with the default
kernel config only a subset of the hardware is supported, and for
state-of-the-art hw
support we'll also need patches not yet in upstream kernel (from eg.
armbian and libreelec).

I feel it would be good to provide defconfig files for those machines,
but then there are
several options to handle that. Would a minimal hw-focused defconfig
suitable for
`KCONFIG_MODE = "--allnoconfig"` be a good option ?

Le lun. 22 mars 2021 à 16:00, Yann Dirson via lists.yoctoproject.org
<yann.dirson=blade-group.com@...> a écrit :

Hi Trevor,

Le lun. 22 mars 2021 à 15:47, Trevor Woerner <twoerner@...> a écrit :
On Mon 2021-03-22 @ 02:42:12 PM, yann.dirson@... wrote:
This supports both the 2GB and 4GB versions of the board. This is not
done with 2 different machine definitions since only u-boot has to
change between those two configurations, but with a NANOPIM4_HW variable
to set in local.conf.
Traditionally in meta-rockchip this is done using two separate machine files
with all the common things factored into a common include file. See
tinker-board and tinker-board-s as well as all the rock-pi-4* definitions for
examples.

I would prefer if the same thing was done here.
Damned that was how I did my first patch, I just felt it was much
better this way :(

Digging up that original commit re rerolling.


Wouldn't it be useful to have a standard way to specify such hardware
variants, that
would be recognized as such by the layer index ?



--
Yann Dirson <yann@...>
Blade / Shadow -- http://shadow.tech



--
Yann Dirson <yann@...>
Blade / Shadow -- http://shadow.tech


[meta-rockchip][PATCH v2] Add machine definitions for NanoPi-M4 boards, 2GB and 4GB variants

Yann Dirson
 

From: Yann Dirson <yann@...>

---

Changes from v1: split in two distinct machines: nanopi-m4 and nanopi-m4-=
2gb

conf/machine/include/nanopi-m4.inc | 22 +++++++++++++++++++
conf/machine/nanopi-m4-2gb.conf | 8 +++++++
conf/machine/nanopi-m4.conf | 8 +++++++
recipes-kernel/linux/linux-yocto-dev.bbappend | 2 ++
.../linux/linux-yocto-rt_%.bbappend | 2 ++
.../linux/linux-yocto-tiny_%.bbappend | 2 ++
recipes-kernel/linux/linux-yocto_%.bbappend | 2 ++
7 files changed, 46 insertions(+)
create mode 100644 conf/machine/include/nanopi-m4.inc
create mode 100644 conf/machine/nanopi-m4-2gb.conf
create mode 100644 conf/machine/nanopi-m4.conf

diff --git a/conf/machine/include/nanopi-m4.inc b/conf/machine/include/na=
nopi-m4.inc
new file mode 100644
index 0000000..f6d9c11
--- /dev/null
+++ b/conf/machine/include/nanopi-m4.inc
@@ -0,0 +1,22 @@
+# Copyright (C) 2021 Blade SAS
+# Common definitions for all NanoPi M4 RK3399 board variants
+
+require rk3399.inc
+
+KERNEL_DEVICETREE =3D "rockchip/rk3399-nanopi-m4.dtb"
+
+RK_BOOT_DEVICE =3D "mmcblk1"
+WKS_FILE ?=3D "rock-pi-4.wks"
+IMAGE_FSTYPES +=3D "wic"
+
+WKS_FILE_DEPENDS ?=3D " \
+ mtools-native \
+ dosfstools-native \
+ virtual/bootloader \
+ virtual/kernel \
+ "
+IMAGE_BOOT_FILES ?=3D "\
+ ${KERNEL_IMAGETYPE} \
+ "
+
+SERIAL_CONSOLES =3D "1500000;ttyS2"
diff --git a/conf/machine/nanopi-m4-2gb.conf b/conf/machine/nanopi-m4-2gb=
.conf
new file mode 100644
index 0000000..9fd7279
--- /dev/null
+++ b/conf/machine/nanopi-m4-2gb.conf
@@ -0,0 +1,8 @@
+# Copyright (C) 2021 Blade SAS
+
+#@TYPE: Machine
+#@NAME: NanoPi M4
+#@DESCRIPTION: NanoPi M4 RK3399 board from FriendlyElec, 2GB variant
+
+require include/nanopi-m4.inc
+UBOOT_MACHINE =3D "nanopi-m4-2gb-rk3399_defconfig"
diff --git a/conf/machine/nanopi-m4.conf b/conf/machine/nanopi-m4.conf
new file mode 100644
index 0000000..648fc75
--- /dev/null
+++ b/conf/machine/nanopi-m4.conf
@@ -0,0 +1,8 @@
+# Copyright (C) 2021 Blade SAS
+
+#@TYPE: Machine
+#@NAME: NanoPi M4
+#@DESCRIPTION: NanoPi M4 RK3399 board from FriendlyElec, 4GB variant
+
+require include/nanopi-m4.inc
+UBOOT_MACHINE =3D "nanopi-m4-rk3399_defconfig"
diff --git a/recipes-kernel/linux/linux-yocto-dev.bbappend b/recipes-kern=
el/linux/linux-yocto-dev.bbappend
index e5ea197..7702e3f 100644
--- a/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -6,3 +6,5 @@ COMPATIBLE_MACHINE_vyasa-rk3288 =3D "vyasa-rk3288"
COMPATIBLE_MACHINE_tinker-board =3D "tinker-board"
COMPATIBLE_MACHINE_tinker-board-s =3D "tinker-board-s"
COMPATIBLE_MACHINE_rock-pi-4 =3D "rock-pi-4"
+COMPATIBLE_MACHINE_nanopi-m4 =3D "nanopi-m4"
+COMPATIBLE_MACHINE_nanopi-m4-2gb =3D "nanopi-m4-2gb"
diff --git a/recipes-kernel/linux/linux-yocto-rt_%.bbappend b/recipes-ker=
nel/linux/linux-yocto-rt_%.bbappend
index e5ea197..7702e3f 100644
--- a/recipes-kernel/linux/linux-yocto-rt_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto-rt_%.bbappend
@@ -6,3 +6,5 @@ COMPATIBLE_MACHINE_vyasa-rk3288 =3D "vyasa-rk3288"
COMPATIBLE_MACHINE_tinker-board =3D "tinker-board"
COMPATIBLE_MACHINE_tinker-board-s =3D "tinker-board-s"
COMPATIBLE_MACHINE_rock-pi-4 =3D "rock-pi-4"
+COMPATIBLE_MACHINE_nanopi-m4 =3D "nanopi-m4"
+COMPATIBLE_MACHINE_nanopi-m4-2gb =3D "nanopi-m4-2gb"
diff --git a/recipes-kernel/linux/linux-yocto-tiny_%.bbappend b/recipes-k=
ernel/linux/linux-yocto-tiny_%.bbappend
index e5ea197..7702e3f 100644
--- a/recipes-kernel/linux/linux-yocto-tiny_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto-tiny_%.bbappend
@@ -6,3 +6,5 @@ COMPATIBLE_MACHINE_vyasa-rk3288 =3D "vyasa-rk3288"
COMPATIBLE_MACHINE_tinker-board =3D "tinker-board"
COMPATIBLE_MACHINE_tinker-board-s =3D "tinker-board-s"
COMPATIBLE_MACHINE_rock-pi-4 =3D "rock-pi-4"
+COMPATIBLE_MACHINE_nanopi-m4 =3D "nanopi-m4"
+COMPATIBLE_MACHINE_nanopi-m4-2gb =3D "nanopi-m4-2gb"
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend b/recipes-kernel=
/linux/linux-yocto_%.bbappend
index e5ea197..7702e3f 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -6,3 +6,5 @@ COMPATIBLE_MACHINE_vyasa-rk3288 =3D "vyasa-rk3288"
COMPATIBLE_MACHINE_tinker-board =3D "tinker-board"
COMPATIBLE_MACHINE_tinker-board-s =3D "tinker-board-s"
COMPATIBLE_MACHINE_rock-pi-4 =3D "rock-pi-4"
+COMPATIBLE_MACHINE_nanopi-m4 =3D "nanopi-m4"
+COMPATIBLE_MACHINE_nanopi-m4-2gb =3D "nanopi-m4-2gb"
--=20
2.30.2


Re: [meta-rockchip][PATCH] Add machine definitions for NanoPi-M4 boards

Yann Dirson
 

Hi Trevor,

Le lun. 22 mars 2021 à 15:47, Trevor Woerner <twoerner@...> a écrit :
On Mon 2021-03-22 @ 02:42:12 PM, yann.dirson@... wrote:
This supports both the 2GB and 4GB versions of the board. This is not
done with 2 different machine definitions since only u-boot has to
change between those two configurations, but with a NANOPIM4_HW variable
to set in local.conf.
Traditionally in meta-rockchip this is done using two separate machine files
with all the common things factored into a common include file. See
tinker-board and tinker-board-s as well as all the rock-pi-4* definitions for
examples.

I would prefer if the same thing was done here.
Damned that was how I did my first patch, I just felt it was much
better this way :(

Digging up that original commit re rerolling.


Wouldn't it be useful to have a standard way to specify such hardware
variants, that
would be recognized as such by the layer index ?



--
Yann Dirson <yann@...>
Blade / Shadow -- http://shadow.tech


Re: [meta-rockchip][PATCH] Add machine definitions for NanoPi-M4 boards

Trevor Woerner
 

Hi Yann,

Thanks for your contribution! :-)

On Mon 2021-03-22 @ 02:42:12 PM, yann.dirson@... wrote:
This supports both the 2GB and 4GB versions of the board. This is not
done with 2 different machine definitions since only u-boot has to
change between those two configurations, but with a NANOPIM4_HW variable
to set in local.conf.
Traditionally in meta-rockchip this is done using two separate machine files
with all the common things factored into a common include file. See
tinker-board and tinker-board-s as well as all the rock-pi-4* definitions for
examples.

I would prefer if the same thing was done here.

That way it shows up as distinct machines in the layer index (for example) and
makes it easier for users to determine whether or not their specific board is
supported. Otherwise the full list of supported boards ends up getting
buried and people have to dig around in the config files to find support
information.

Would you have time to re-spin the commit to add 2 boards (or just add the one
you can test)? I see there's also a nanopi-m4b, but I can't find a simple
comparison between the various nanopi-m4's. If you do, please add an entry in
the README file as well.

Otherwise I can take a look later today.

Best regards,
Trevor


[meta-zephyr][PATCH] layer.conf: add hardknott compatibility

Jon Mason
 

Signed-off-by: Jon Mason <jon.mason@...>
---
conf/layer.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conf/layer.conf b/conf/layer.conf
index f9de654ad9f4..8e6b15d18d52 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -15,4 +15,4 @@ LAYERVERSION_zephyr = "1"

LAYERDEPENDS_zephyr = "core meta-python"

-LAYERSERIES_COMPAT_zephyr = "dunfell gatesgarth"
+LAYERSERIES_COMPAT_zephyr = "dunfell gatesgarth hardknott"
--
2.20.1


[meta-rockchip][PATCH] Add machine definitions for NanoPi-M4 boards

Yann Dirson
 

From: Yann Dirson <yann@...>

This supports both the 2GB and 4GB versions of the board. This is not
done with 2 different machine definitions since only u-boot has to
change between those two configurations, but with a NANOPIM4_HW variable
to set in local.conf.

Note I could only test the 2GB version.

---

conf/machine/nanopi-m4.conf | 29 +++++++++++++++++++
recipes-kernel/linux/linux-yocto-dev.bbappend | 1 +
.../linux/linux-yocto-rt_%.bbappend | 1 +
.../linux/linux-yocto-tiny_%.bbappend | 1 +
recipes-kernel/linux/linux-yocto_%.bbappend | 1 +
5 files changed, 33 insertions(+)
create mode 100644 conf/machine/nanopi-m4.conf

diff --git a/conf/machine/nanopi-m4.conf b/conf/machine/nanopi-m4.conf
new file mode 100644
index 0000000..64a962e
--- /dev/null
+++ b/conf/machine/nanopi-m4.conf
@@ -0,0 +1,29 @@
+# Copyright (C) 2021 Blade SAS
+
+#@TYPE: Machine
+#@NAME: NanoPi M4
+#@DESCRIPTION: NanoPi M4 RK3399 board from FriendlyElec, 2GB and 4GB var=
iants
+
+# specify NANOPIM4_HW=3D"" in local.conf for the 4GB version
+NANOPIM4_HW ?=3D "-2gb"
+
+require include/rk3399.inc
+
+KERNEL_DEVICETREE =3D "rockchip/rk3399-nanopi-m4.dtb"
+UBOOT_MACHINE =3D "nanopi-m4${NANOPIM4_HW}-rk3399_defconfig"
+
+RK_BOOT_DEVICE =3D "mmcblk1"
+WKS_FILE ?=3D "rock-pi-4.wks"
+IMAGE_FSTYPES +=3D "wic"
+
+WKS_FILE_DEPENDS ?=3D " \
+ mtools-native \
+ dosfstools-native \
+ virtual/bootloader \
+ virtual/kernel \
+ "
+IMAGE_BOOT_FILES ?=3D "\
+ ${KERNEL_IMAGETYPE} \
+ "
+
+SERIAL_CONSOLES =3D "1500000;ttyS2"
diff --git a/recipes-kernel/linux/linux-yocto-dev.bbappend b/recipes-kern=
el/linux/linux-yocto-dev.bbappend
index e5ea197..3eca360 100644
--- a/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -6,3 +6,4 @@ COMPATIBLE_MACHINE_vyasa-rk3288 =3D "vyasa-rk3288"
COMPATIBLE_MACHINE_tinker-board =3D "tinker-board"
COMPATIBLE_MACHINE_tinker-board-s =3D "tinker-board-s"
COMPATIBLE_MACHINE_rock-pi-4 =3D "rock-pi-4"
+COMPATIBLE_MACHINE_nanopi-m4 =3D "nanopi-m4"
diff --git a/recipes-kernel/linux/linux-yocto-rt_%.bbappend b/recipes-ker=
nel/linux/linux-yocto-rt_%.bbappend
index e5ea197..3eca360 100644
--- a/recipes-kernel/linux/linux-yocto-rt_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto-rt_%.bbappend
@@ -6,3 +6,4 @@ COMPATIBLE_MACHINE_vyasa-rk3288 =3D "vyasa-rk3288"
COMPATIBLE_MACHINE_tinker-board =3D "tinker-board"
COMPATIBLE_MACHINE_tinker-board-s =3D "tinker-board-s"
COMPATIBLE_MACHINE_rock-pi-4 =3D "rock-pi-4"
+COMPATIBLE_MACHINE_nanopi-m4 =3D "nanopi-m4"
diff --git a/recipes-kernel/linux/linux-yocto-tiny_%.bbappend b/recipes-k=
ernel/linux/linux-yocto-tiny_%.bbappend
index e5ea197..3eca360 100644
--- a/recipes-kernel/linux/linux-yocto-tiny_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto-tiny_%.bbappend
@@ -6,3 +6,4 @@ COMPATIBLE_MACHINE_vyasa-rk3288 =3D "vyasa-rk3288"
COMPATIBLE_MACHINE_tinker-board =3D "tinker-board"
COMPATIBLE_MACHINE_tinker-board-s =3D "tinker-board-s"
COMPATIBLE_MACHINE_rock-pi-4 =3D "rock-pi-4"
+COMPATIBLE_MACHINE_nanopi-m4 =3D "nanopi-m4"
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend b/recipes-kernel=
/linux/linux-yocto_%.bbappend
index e5ea197..3eca360 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -6,3 +6,4 @@ COMPATIBLE_MACHINE_vyasa-rk3288 =3D "vyasa-rk3288"
COMPATIBLE_MACHINE_tinker-board =3D "tinker-board"
COMPATIBLE_MACHINE_tinker-board-s =3D "tinker-board-s"
COMPATIBLE_MACHINE_rock-pi-4 =3D "rock-pi-4"
+COMPATIBLE_MACHINE_nanopi-m4 =3D "nanopi-m4"
--=20
2.30.2


Re: Which recipes put qtwebkit in my image?

Mauro Ziliani
 

Hello.
I find it.
Inside a software there two executables programs which need QtWebKit.
So yocto warn me to include QtWebKit in the imge.

MZ

Sent from Mailspring, the best free email app for work

On mar 16 2021, at 4:56 pm, Quentin Schulz <quentin.schulz@...> wrote:
Hi Mauro,

On Tue, Mar 16, 2021 at 04:50:44PM +0100, Mauro Ziliani wrote:
> Hi all.I need to find which recipe installs qtwebkit in my final image.
>
> I look in on every recipes I make but I don't find who put qtwebkit in my image.
> I have the same matter with *-dev packages
>
> I use bitbake -g but I don't find the "source" of qtwebkit.
>

oe-pkgdata-util lookup-recipe qtwebkit

could help. Or if you know which file you don't want in your fs and want
to know which package is installing it:

oe-pkgdata-util find-path '*qtwebkit*'
(provided the file you're looking for has qtwebkit in its filename)

Hope this helps,
Cheers,
Quentin


[meta-security][PATCH] meta: drop IMA_POLICY from policy recipes

Ming Liu <liu.ming50@...>
 

From: Ming Liu <liu.ming50@...>

IMA_POLICY is being referred as policy recipe name in some places and it
is also being referred as policy file in other places, they are
conflicting with each other which make it impossible to set a IMA_POLICY
global variable in config file.

Fix it by dropping IMA_POLICY definitions from policy recipes

Signed-off-by: Ming Liu <liu.ming50@...>
---
.../ima-policy-appraise-all_1.0.bb | 9 ++-------
.../ima_policy_hashed/ima-policy-hashed_1.0.bb | 9 ++-------
.../ima_policy_simple/ima-policy-simple_1.0.bb | 9 ++-------
3 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/meta-integrity/recipes-security/ima_policy_appraise_all/ima-=
policy-appraise-all_1.0.bb b/meta-integrity/recipes-security/ima_policy_a=
ppraise_all/ima-policy-appraise-all_1.0.bb
index da62a4c..84ea161 100644
--- a/meta-integrity/recipes-security/ima_policy_appraise_all/ima-policy-=
appraise-all_1.0.bb
+++ b/meta-integrity/recipes-security/ima_policy_appraise_all/ima-policy-=
appraise-all_1.0.bb
@@ -2,19 +2,14 @@ SUMMARY =3D "IMA sample simple appraise policy "
LICENSE =3D "MIT"
LIC_FILES_CHKSUM =3D "file://${COREBASE}/meta/COPYING.MIT;md5=3D3da9cfbc=
b788c80a0384361b4de20420"
=20
-# This policy file will get installed as /etc/ima/ima-policy.
-# It is located via the normal file search path, so a .bbappend
-# to this recipe can just point towards one of its own files.
-IMA_POLICY ?=3D "ima_policy_appraise_all"
-
-SRC_URI =3D " file://${IMA_POLICY}"
+SRC_URI =3D " file://ima_policy_appraise_all"
=20
inherit features_check
REQUIRED_DISTRO_FEATURES =3D "ima"
=20
do_install () {
install -d ${D}/${sysconfdir}/ima
- install ${WORKDIR}/${IMA_POLICY} ${D}/${sysconfdir}/ima/ima-policy
+ install ${WORKDIR}/ima_policy_appraise_all ${D}/${sysconfdir}/ima/im=
a-policy
}
=20
FILES_${PN} =3D "${sysconfdir}/ima"
diff --git a/meta-integrity/recipes-security/ima_policy_hashed/ima-policy=
-hashed_1.0.bb b/meta-integrity/recipes-security/ima_policy_hashed/ima-po=
licy-hashed_1.0.bb
index ebb0426..ff7169e 100644
--- a/meta-integrity/recipes-security/ima_policy_hashed/ima-policy-hashed=
_1.0.bb
+++ b/meta-integrity/recipes-security/ima_policy_hashed/ima-policy-hashed=
_1.0.bb
@@ -2,13 +2,8 @@ SUMMARY =3D "IMA sample hash policy"
LICENSE =3D "MIT"
LIC_FILES_CHKSUM =3D "file://${COREBASE}/meta/COPYING.MIT;md5=3D3da9cfbc=
b788c80a0384361b4de20420"
=20
-# This policy file will get installed as /etc/ima/ima-policy.
-# It is located via the normal file search path, so a .bbappend
-# to this recipe can just point towards one of its own files.
-IMA_POLICY ?=3D "ima_policy_hashed"
-
SRC_URI =3D " \
- file://${IMA_POLICY} \
+ file://ima_policy_hashed \
"
=20
inherit features_check
@@ -16,7 +11,7 @@ REQUIRED_DISTRO_FEATURES =3D "ima"
=20
do_install () {
install -d ${D}/${sysconfdir}/ima
- install ${WORKDIR}/${IMA_POLICY} ${D}/${sysconfdir}/ima/ima-policy
+ install ${WORKDIR}/ima_policy_hashed ${D}/${sysconfdir}/ima/ima-poli=
cy
}
=20
FILES_${PN} =3D "${sysconfdir}/ima"
diff --git a/meta-integrity/recipes-security/ima_policy_simple/ima-policy=
-simple_1.0.bb b/meta-integrity/recipes-security/ima_policy_simple/ima-po=
licy-simple_1.0.bb
index cb4b6b8..0e56aec 100644
--- a/meta-integrity/recipes-security/ima_policy_simple/ima-policy-simple=
_1.0.bb
+++ b/meta-integrity/recipes-security/ima_policy_simple/ima-policy-simple=
_1.0.bb
@@ -2,19 +2,14 @@ SUMMARY =3D "IMA sample simple policy"
LICENSE =3D "MIT"
LIC_FILES_CHKSUM =3D "file://${COREBASE}/meta/COPYING.MIT;md5=3D3da9cfbc=
b788c80a0384361b4de20420"
=20
-# This policy file will get installed as /etc/ima/ima-policy.
-# It is located via the normal file search path, so a .bbappend
-# to this recipe can just point towards one of its own files.
-IMA_POLICY ?=3D "ima_policy_simple"
-
-SRC_URI =3D " file://${IMA_POLICY}"
+SRC_URI =3D " file://ima_policy_simple"
=20
inherit features_check
REQUIRED_DISTRO_FEATURES =3D "ima"
=20
do_install () {
install -d ${D}/${sysconfdir}/ima
- install ${WORKDIR}/${IMA_POLICY} ${D}/${sysconfdir}/ima/ima-policy
+ install ${WORKDIR}/ima_policy_simple ${D}/${sysconfdir}/ima/ima-poli=
cy
}
=20
FILES_${PN} =3D "${sysconfdir}/ima"
--=20
2.29.0


Re: Enabling Serial console via uart1(serial1) in cm3(rpi3) kernel 5.4. #cm3 #dunfell

@prashant2314
 

Hi Zoran,
here is the cat /proc/cmdline output of my cm3-

coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:AD:85:CA vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait kgdboc=ttyAMA0,115200

Earlier my issue was that  I was no getting /dev/ttyS0 terminal in my yocto image for cm3.
But going through the web I got that setting 1 to CONFIG_SERIAL_8250_RUNTIME_UARTS  solved that issue and now I'm getting ttyS0 in my /dev directory.

But now another issue I'm facing when I'm enabling cosole via this ttsS0 port i.e.  
                                                                                                                  [   13.280639] ttyS ttyS0: 2 input overrun(s)

here is my dmesg output:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.64-v7 (oe-user@oe-host) (gcc version 9.3.0 (GCC)) #1 SMP Fri Sep 11 12:57:30 UTC 2020
[    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 Compute Module 3 Rev 1.0
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created CMA memory pool at 0x37400000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    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] percpu: Embedded 20 pages/cpu s50060 r8192 d23668 u81920
[    0.000000] pcpu-alloc: s50060 r8192 d23668 u81920 alloc=20*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 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:AD:85:CA vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait kgdboc=ttyAMA0,115200
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 880444K/970752K available (9216K kernel code, 716K rwdata, 2684K rodata, 1024K init, 849K bss, 24772K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 29805 entries in 59 pages
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x328/0x508 with crng_init=0
[    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.000006] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000020] Switching to timer-based delay loop, resolution 52ns
[    0.000288] Console: colour dummy device 80x30
[    0.000885] printk: console [tty1] enabled
[    0.000960] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.001009] pid_max: default: 32768 minimum: 301
[    0.001232] LSM: Security Framework initializing
[    0.001477] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.001524] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.002936] Disabling memory control group subsystem
[    0.003081] CPU: Testing write buffer coherency: ok
[    0.003674] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.004651] Setting up static identity map for 0x100000 - 0x100060
[    0.004873] rcu: Hierarchical SRCU implementation.
[    0.005586] smp: Bringing up secondary CPUs ...
[    0.006748] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.008417] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.009943] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.010479] smp: Brought up 1 node, 4 CPUs
[    0.010528] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.010557] CPU: All CPU(s) started in HYP mode.
[    0.010582] CPU: Virtualization extensions available.
[    0.011597] devtmpfs: initialized
[    0.027564] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.028074] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.028132] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.031459] pinctrl core: initialized pinctrl subsystem
[    0.032650] NET: Registered protocol family 16
[    0.036992] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.041879] audit: initializing netlink subsys (disabled)
[    0.042183] audit: type=2000 audit(0.040:1): state=initialized audit_enabled=0 res=1
[    0.043730] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.043770] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.044019] Serial: AMBA PL011 UART driver
[    0.046056] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.070160] raspberrypi-firmware soc:firmware: Attached to firmware from 2020-09-11 14:25, variant start
[    0.080196] raspberrypi-firmware soc:firmware: Firmware hash is ecd571f7947fb751a266d8591b0573d4d975fbe6
[    0.132933] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1
[    0.135178] SCSI subsystem initialized
[    0.135460] usbcore: registered new interface driver usbfs
[    0.135556] usbcore: registered new interface driver hub
[    0.135703] usbcore: registered new device driver usb
[    0.137691] clocksource: Switched to clocksource arch_sys_counter
[    1.382483] VFS: Disk quotas dquot_6.6.0
[    1.382646] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.382869] FS-Cache: Loaded
[    1.383168] CacheFiles: Loaded
[    1.394807] thermal_sys: Registered thermal governor 'step_wise'
[    1.395207] NET: Registered protocol family 2
[    1.396283] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    1.396360] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    1.396501] TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.396713] TCP: Hash tables configured (established 8192 bind 8192)
[    1.396898] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    1.396973] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    1.397287] NET: Registered protocol family 1
[    1.398427] RPC: Registered named UNIX socket transport module.
[    1.398462] RPC: Registered udp transport module.
[    1.398488] RPC: Registered tcp transport module.
[    1.398515] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.400297] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    1.404004] Initialise system trusted keyrings
[    1.404281] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    1.416225] FS-Cache: Netfs 'nfs' registered for caching
[    1.416897] NFS: Registering the id_resolver key type
[    1.416978] Key type id_resolver registered
[    1.417005] Key type id_legacy registered
[    1.417043] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.418451] Key type asymmetric registered
[    1.418482] Asymmetric key parser 'x509' registered
[    1.418551] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.418590] io scheduler mq-deadline registered
[    1.418618] io scheduler kyber registered
[    1.423548] bcm2708_fb soc:fb: FB found 1 display(s)
[    1.437559] Console: switching to colour frame buffer device 90x30
[    1.446253] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 720x480
[    1.452896] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    1.458395] bcm2835-rng 3f104000.rng: hwrng registered
[    1.461812] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    1.468540] vc-sm: Videocore shared memory driver
[    1.472180] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    1.489107] brd: module loaded
[    1.505307] loop: module loaded
[    1.509860] Loading iSCSI transport class v2.0-870.
[    1.513862] libphy: Fixed MDIO Bus: probed
[    1.517035] usbcore: registered new interface driver lan78xx
[    1.520267] usbcore: registered new interface driver smsc95xx
[    1.523303] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    2.254610] Core Release: 2.80a
[    2.257707] Setting default values for core params
[    2.260769] Finished setting default values for core params
[    2.464194] Using Buffer DMA mode
[    2.467200] Periodic Transfer Interrupt Enhancement - disabled
[    2.470261] Multiprocessor Interrupt Enhancement - disabled
[    2.473253] OTG VER PARAM: 0, OTG VER FLAG: 0
[    2.476233] Dedicated Tx FIFOs mode
[    2.479874] WARN::dwc_otg_hcd_init:1072: FIQ DMA bounce buffers: virt = b7504000 dma = 0xf7504000 len=9024
[    2.486063] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[    2.500574] dwc_otg: Microframe scheduler enabled
[    2.500642] WARN::hcd_init_fiq:457: FIQ on core 1
[    2.503411] WARN::hcd_init_fiq:458: FIQ ASM at 80728fa4 length 36
[    2.506123] WARN::hcd_init_fiq:496: MPHI regs_base at bb810000
[    2.508797] dwc_otg 3f980000.usb: DWC OTG Controller
[    2.511499] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    2.514279] dwc_otg 3f980000.usb: irq 56, io mem 0x00000000
[    2.517028] Init: Port Power? op_state=1
[    2.519717] Init: Power Port (0)
[    2.522754] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[    2.528327] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.531293] usb usb1: Product: DWC OTG Controller
[    2.534211] usb usb1: Manufacturer: Linux 5.4.64-v7 dwc_otg_hcd
[    2.537146] usb usb1: SerialNumber: 3f980000.usb
[    2.540771] hub 1-0:1.0: USB hub found
[    2.543657] hub 1-0:1.0: 1 port detected
[    2.547238] dwc_otg: FIQ enabled
[    2.547248] dwc_otg: NAK holdoff enabled
[    2.547258] dwc_otg: FIQ split-transaction FSM enabled
[    2.547274] Module dwc_common_port init
[    2.547609] usbcore: registered new interface driver usb-storage
[    2.550721] mousedev: PS/2 mouse device common for all mice
[    2.554936] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    2.560496] sdhci: Secure Digital Host Controller Interface driver
[    2.563302] sdhci: Copyright(c) Pierre Ossman
[    2.566769] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    2.570026] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.573709] ledtrig-cpu: registered to indicate activity on CPUs
[    2.576947] hidraw: raw HID events driver (C) Jiri Kosina
[    2.580129] usbcore: registered new interface driver usbhid
[    2.583142] usbhid: USB HID core driver
[    2.586528] ashmem: initialized
[    2.590509] vchiq: vchiq_init_state: slot_zero = (ptrval)
[    2.595277] [vc_sm_connected_init]: start
[    2.605012] [vc_sm_connected_init]: end - returning 0
[    2.610026] Initializing XFRM netlink socket
[    2.613006] NET: Registered protocol family 17
[    2.616003] Key type dns_resolver registered
[    2.619492] Registering SWP/SWPB emulation handler
[    2.622506] registered taskstats version 1
[    2.625154] Loading compiled-in X.509 certificates
[    2.628349] Key type ._fscrypt registered
[    2.630977] Key type .fscrypt registered
[    2.644359] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    2.647220] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 81, base_baud = 0) is a PL011 rev2
[    2.655430] printk: console [ttyS0] disabled
[    2.658305] 3f215040.serial: ttyS0 at MMIO 0x0 (irq = 53, base_baud = 31250000) is a 16550
[    3.678083] printk: console [ttyS0] enabled
[    3.685731] KGDB: Registered I/O driver kgdboc
[    3.693806] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    3.705593] sdhost: log_buf @ (ptrval) (f7507000)
[    3.761622] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    3.772680] of_cfs_init
[    3.778301] of_cfs_init: OK
[    3.785362] Waiting for root device /dev/mmcblk0p2...
[    3.797847] Indeed it is in host mode hprt0 = 00021501
[    3.891131] random: fast init done
[    3.936402] mmc0: new high speed MMC card at address 0001
[    3.946012] mmcblk0: mmc0:0001 4FTE4R 3.64 GiB
[    3.953973] mmcblk0boot0: mmc0:0001 4FTE4R partition 1 4.00 MiB
[    3.963473] mmcblk0boot1: mmc0:0001 4FTE4R partition 2 4.00 MiB
[    3.972635] mmcblk0rpmb: mmc0:0001 4FTE4R partition 3 512 KiB, chardev (245:0)
[    3.985330]  mmcblk0: p1 p2
[    4.007759] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    4.011189] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    4.017529] Indeed it is in host mode hprt0 = 00001101
[    4.031809] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    4.050759] devtmpfs: mounted
[    4.102220] Freeing unused kernel memory: 1024K
[    4.128140] Run /sbin/init as init process
[    4.278133] usb 1-1: New USB device found, idVendor=0424, idProduct=9514, bcdDevice= 2.00
[    4.292686] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    4.303966] hub 1-1:1.0: USB hub found
[    4.311058] hub 1-1:1.0: 5 ports detected
[    4.647797] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    4.730514] udevd[115]: starting version 3.2.9
[    4.745524] random: udevd: uninitialized urandom read (16 bytes read)
[    4.756762] random: udevd: uninitialized urandom read (16 bytes read)
[    4.766616] random: udevd: uninitialized urandom read (16 bytes read)
[    4.788165] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00, bcdDevice= 2.00
[    4.802823] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    4.814602] udevd[117]: starting eudev-3.2.9
[    4.818138] smsc95xx v1.0.6
[    4.923876] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ad:85:ca
[    5.161891] i2c /dev entries driver
[    5.216319] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    5.972781] random: crng init done
[    5.979289] random: 2 urandom warning(s) missed due to ratelimiting
[    6.470391] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[    6.480654] ttyS ttyS0: 2 input overrun(s)
[    7.962826] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[    7.973416] ttyS ttyS0: 2 input overrun(s)
[   11.883822] Installing knfsd (copyright (C) 1996 okir@...).
[   11.893705] ttyS ttyS0: 2 input overrun(s)
[   13.268076] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[   13.280639] ttyS ttyS0: 2 input overrun(s)
[   13.294215] NFSD: Using legacy client tracking operations.
[   13.304013] NFSD: starting 90-second grace period (net f00004c1)
[ 1014.267771] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[ 1014.399220] usb 1-1.2: New USB device found, idVendor=0b95, idProduct=772b, bcdDevice= 0.02
[ 1014.408345] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1014.416278] usb 1-1.2: Product: AX88772B
[ 1014.420431] usb 1-1.2: Manufacturer: ASIX Elec. Corp.
[ 1014.425889] usb 1-1.2: SerialNumber: 000001



Please assist me if you have some clue regarding this issue.

Thanks and Regards.


Re: spidev.c ?

Zoran
 

// interrupt-parent = <&intc>;
// interrupts = <0 24 IRQ_TYPE_EDGE_FALLING>;
Not sure if you did represent these values correctly?!

I have for enc28j60:something like this:
interrupt-parent = <&gpio2>;
interrupts = <1 IRQ_TYPE_EDGE_FALLING>;

Where <&gpio2> is gpio chip name (the gpio port 2),
and <1 IRQ_TYPE_EDGE_FALLING>;is pin 1 of port 2 (32 pins for ports
from port 0).

<&intc> should be an INT controller.
Since <0 24 IRQ_TYPE_EDGE_FALLING>; you are trying to represent 0 as
port #, 24 as pin #...

I have no idea how many pins you have per gpio port? 16? 32?

You should carefully analyse and try to understand if you wrote this
device tree sequence correctly.

But I am just guessing now...

Zee
_______

On Sat, Mar 20, 2021 at 11:02 PM jchludzinski <jchludzinski@...> wrote:

Using 'make nconfig' I selected the following options:
(Keep in mind I using an Altera/Intel Arria 10 SoC which uses DesignWare hard SPI controllers. BUT the SPI controllers I'm concerned with now are soft controllers defined in the FPGA code).

.config - Linux/arm 5.4.74 Kernel Configuration
┌── SPI support ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ --- SPI support │
│ [*] Debug support for SPI drivers │
│ -*- SPI memory extension │
│ *** SPI Master Controller Drivers *** │
│ <M> Altera SPI Controller

...

│ <*> Utilities for Bitbanging SPI masters │
│ < > Cadence SPI controller │
│ < > CLPS711X host SPI controller │
│ <*> DesignWare SPI controller core support │
│ <*> PCI interface driver for DW SPI core │
│ <*> Memory-mapped io interface driver for DW SPI core │

...

│ *** SPI Protocol Masters *** │
│ <M> User mode SPI device driver support │
│ <M> spi loopback test framework support │
│ < > Infineon TLE62X0 (for power switching) │
│ [*] SPI slave protocol handlers │
│ <M> SPI slave handler reporting boot up time │
│ <M> SPI slave handler controlling system state │

This got the SPI nodes to show up in /sys/firmware/devicetree/ but there were no udev files (/dev/spidevXX). So I commented out the 'interrupts' in the DTSI file and the udev files appeared?

spi2: spi@0xc00c0800 { // hps_spi_1553_int
address-cells = <0x1>;
#size-cells = <0x0>;
reg = <0xc00c0800 0x20>;
// interrupt-parent = <&intc>;
// interrupts = <0 24 IRQ_TYPE_EDGE_FALLING>;
num-cs = <0x1>;
status = "okay";

spidev@0 {
compatible = "rohm,dh2228fv";
#address-cells = <0x1>;
#size-cells = <0x0>;
reg = <0x0>;
spi-max-frequency = <0x1f400>;
// enable-dma = <0x1>;
};
};

BUT I need those interrupts. Thoughts and/or suggestions?

---John



On 2021-03-19 01:10, Zoran wrote:

Hello John,

It seems that your target is configured correctly. Since you have all
the components you should and must have as SPI framework.

Namely I was looking for /sys/bus (since you must have an SPI bus
driver), and then /sys/class (since as my best understanding is that
SPI is a master/slave device), you must have class/). Others are
assumed, you added debug directories.

When I separately build spidev.c as an .ko and try
loading it, I get: "Device or resource busy"


This is understandable, since you already have included spidev.ko as
menuconfig value Y, so it is already present in the kernel, but as a
built-in part of the kernel (my best guess).

root@arria10:~# lsmod
Module Size Used by
spi_altera 16384 0
spidev 20480 0


I see that you did change the menuconfig, and made spidev to be M.

What I also see is that there are no dependencies between spidev and
spi_altera. This is what you really wanted?

But there are NO udev files for the SPI devices
defined in the DTSI file.


Could you, please, better explain this sentence? In more details (as
much as you can)?

Thank you,
Zee
_______


On Thu, Mar 18, 2021 at 10:07 PM jchludzinski <jchludzinski@...> wrote:


root@arria10:~# find /sys/ -name 'spi*'

/sys/kernel/debug/clk/spi_m_clk
/sys/kernel/debug/tracing/events/spi
/sys/kernel/debug/tracing/events/spi/spi_controller_idle
/sys/kernel/debug/tracing/events/spi/spi_controller_busy

...

/sys/bus/spi/devices/spi0.0
/sys/bus/spi/drivers/spi-nor
/sys/bus/spi/drivers/altr_a10sr/spi0.0
/sys/bus/spi/drivers/spidev
/sys/module/spidev
/sys/module/spidev/drivers/spi:spidev
/sys/module/spi_altera




On 2021-03-18 03:44, Zoran wrote:

I am guessing here.... But what do you have while executing the
following command being in /sys
as root?

root@arm:/sys# find . -name spi*

Zee
_______

On Wed, Mar 17, 2021 at 5:41 PM jchludzinski via
lists.yoctoproject.org
<jchludzinski=vivaldi.net@...> wrote:


In the YOCTO/Linux source tree there's drivers/spi/ which has all the source for SPI drivers. There's only 1 file, spidev.c, which has:

static int __init spidev_init(void)
{
int status;

/* Claim our 256 reserved device numbers. Then register a class
* that will key udev/mdev to add/remove /dev nodes. Last, register
* the driver which manages those device numbers.
*/
BUILD_BUG_ON(N_SPI_MINORS > 256);
status = register_chrdev(SPIDEV_MAJOR, "spi", &spidev_fops);
if (status < 0)
return status;

spidev_class = class_create(THIS_MODULE, "spidev");
if (IS_ERR(spidev_class)) {
unregister_chrdev(SPIDEV_MAJOR, spidev_spi_driver.driver.name);
return PTR_ERR(spidev_class);
}

status = spi_register_driver(&spidev_spi_driver);
if (status < 0) {
class_destroy(spidev_class);
unregister_chrdev(SPIDEV_MAJOR, spidev_spi_driver.driver.name);
}
return status;
}
module_init(spidev_init);

... for creating device files in udev.

So when I use 'make nconfig' to specifiy that I want a loadable module for the ALTERA SPI driver, why don't I see a spidev.o file in drivers/spi/ ?

How does spi-altera.ko create device files without a call to register_chrdev(...).

How is it a loadable module without module_init(...)?

When I separately build spidev.c as an .ko and try loading it, I get: "Device or resourse busy"

---John


Re: How is it possible to build a loadable module from spi-altera.c ...?

jchludzinski
 

My problem is I have an 1553 chip (an avionic data bus) connected to the HPS master (an ARM processor) via an FPGA (soft) SPI controller. This is where the spi-altera.c comes in. It provides the driver/interface to the soft SPI controller on the Arria 10 SoC.
 
I need an interface now to communicate between the SPI slave (the 1553 chip) and the SPI master (the Arria 10 HPS/ARM).

When I load spi-altera.ko I get the udev files (/dev/spidevXX) but not when I load spidev.ko. Why? spi-altera.c doesn't have an init routine and consequently no call to register_chrdev(..) but spidev.c does. What's the relationship between spi-altera and spidev? What's the purpose of spi.c?


On 2021-03-20 18:14, jchludzinski wrote:
How is it possible to build a loadable module from _spi-altera.c_ when
it has no code for creating _udev_ files (i.e., _/dev/spidevXX_); it
has no:

static int __init spidev_init(void)
{
    int status;

    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__,
__LINE__);

    /* Claim our 256 reserved device numbers.  Then register a class
     * that will key udev/mdev to add/remove /dev nodes.  Last,
register
     * the driver which manages those device numbers.
     */
    BUILD_BUG_ON(N_SPI_MINORS > 256);
    status = register_chrdev(SPIDEV_MAJOR, "spi", &spidev_fops);

    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__,
__LINE__);

    if (status < 0)
        return status;

    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__,
__LINE__);

    spidev_class = class_create(THIS_MODULE, "spidev");
    if (IS_ERR(spidev_class)) {
        unregister_chrdev(SPIDEV_MAJOR,
spidev_spi_driver.driver.name);
        return PTR_ERR(spidev_class);
    }

    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__,
__LINE__);

    status = spi_register_driver(&spidev_spi_driver);
    if (status < 0) {
        class_destroy(spidev_class);
        unregister_chrdev(SPIDEV_MAJOR,
spidev_spi_driver.driver.name);
    }

    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__,
__LINE__);

    return status;
}
module_init(spidev_init);

The _printk_'s are of course mine.

---John


How is it possible to build a loadable module from spi-altera.c ...?

jchludzinski
 

How is it possible to build a loadable module from spi-altera.c when it has no code for creating udev files (i.e., /dev/spidevXX); it has no: 

static int __init spidev_init(void)
{
    int status;

    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__, __LINE__);

    /* Claim our 256 reserved device numbers.  Then register a class
     * that will key udev/mdev to add/remove /dev nodes.  Last, register
     * the driver which manages those device numbers.
     */
    BUILD_BUG_ON(N_SPI_MINORS > 256);
    status = register_chrdev(SPIDEV_MAJOR, "spi", &spidev_fops);
    
    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__, __LINE__);

    if (status < 0)
        return status;

    
    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__, __LINE__);

    spidev_class = class_create(THIS_MODULE, "spidev");
    if (IS_ERR(spidev_class)) {
        unregister_chrdev(SPIDEV_MAJOR, spidev_spi_driver.driver.name);
        return PTR_ERR(spidev_class);
    }
    
    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__, __LINE__);

    status = spi_register_driver(&spidev_spi_driver);
    if (status < 0) {
        class_destroy(spidev_class);
        unregister_chrdev(SPIDEV_MAJOR, spidev_spi_driver.driver.name);
    }
    
    printk(KERN_ALERT "DEBUG: Passed %s %d \n", __FUNCTION__, __LINE__);
    
    return status;
}
module_init(spidev_init);

The printk's are of course mine.
 
---John


Re: spidev.c ?

jchludzinski
 

Using 'make nconfig' I selected the following options:
(Keep in mind I using an Altera/Intel Arria 10 SoC which uses DesignWare hard SPI controllers. BUT the SPI controllers I'm concerned with now are soft controllers defined in the FPGA code).

                     .config - Linux/arm 5.4.74 Kernel Configuration
 ┌── SPI support ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
                                                                                                                                     
                             --- SPI support                                                                                         
                             [*]   Debug support for SPI drivers                                                                     
                             -*-   SPI memory extension                                                                              
                                   *** SPI Master Controller Drivers ***                                                             
                             <M>   Altera SPI Controller                                             
...
                             <*>   Utilities for Bitbanging SPI masters                                                              
                             < >   Cadence SPI controller                                                                            
                             < >   CLPS711X host SPI controller                                                                      
                             <*>   DesignWare SPI controller core support                                                            
                             <*>     PCI interface driver for DW SPI core                                                            
                             <*>     Memory-mapped io interface driver for DW SPI core                                               
...
                                   *** SPI Protocol Masters ***                                                                      
                             <M>   User mode SPI device driver support                                                               
                             <M>   spi loopback test framework support                                                               
                             < >   Infineon TLE62X0 (for power switching)                                                            
                             [*]   SPI slave protocol handlers                                                                       
                             <M>     SPI slave handler reporting boot up time                                                        │
 │                            <M>     SPI slave handler controlling system state                                                      │
This got the SPI nodes to show up in /sys/firmware/devicetree/ but there were no udev files (/dev/spidevXX). So I commented out the 'interrupts' in the DTSI file and the udev files appeared?
 
spi2: spi@0xc00c0800 { // hps_spi_1553_int
   address-cells = <0x1>;
   #size-cells = <0x0>;
   reg = <0xc00c0800 0x20>;
   // interrupt-parent = <&intc>;
   // interrupts = <0 24 IRQ_TYPE_EDGE_FALLING>;
   num-cs = <0x1>;
   status = "okay";

   spidev@0 {
      compatible = "rohm,dh2228fv";
      #address-cells = <0x1>;
      #size-cells = <0x0>;
      reg = <0x0>;
      spi-max-frequency = <0x1f400>;
      // enable-dma = <0x1>;
   };
};
 
BUT I need those interrupts. Thoughts and/or suggestions?
 
---John
 


On 2021-03-19 01:10, Zoran wrote:
Hello John,

It seems that your target is configured correctly. Since you have all
the components you should and must have as SPI framework.

Namely I was looking for /sys/bus (since you must have an SPI bus
driver), and then /sys/class (since as my best understanding is that
SPI is a master/slave device), you must have class/). Others are
assumed, you added debug directories.

When I separately build spidev.c as an .ko and try
loading it, I get: "Device or resource busy"

This is understandable, since you already have included spidev.ko as
menuconfig value Y, so it is already present in the kernel, but as a
built-in part of the kernel (my best guess).

root@arria10:~# lsmod
Module                  Size  Used by
spi_altera             16384  0
spidev                 20480  0

I see that you did change the menuconfig, and made spidev to be M.

What I also see is that there are no dependencies between spidev and
spi_altera. This is what you really wanted?

But there are NO udev files for the SPI devices
defined in the DTSI file.

Could you, please, better explain this sentence? In more details (as
much as you can)?

Thank you,
Zee
_______


On Thu, Mar 18, 2021 at 10:07 PM jchludzinski <jchludzinski@...> wrote:

root@arria10:~# find /sys/ -name 'spi*'

/sys/kernel/debug/clk/spi_m_clk
/sys/kernel/debug/tracing/events/spi
/sys/kernel/debug/tracing/events/spi/spi_controller_idle
/sys/kernel/debug/tracing/events/spi/spi_controller_busy
...
/sys/bus/spi/devices/spi0.0
/sys/bus/spi/drivers/spi-nor
/sys/bus/spi/drivers/altr_a10sr/spi0.0
/sys/bus/spi/drivers/spidev
/sys/module/spidev
/sys/module/spidev/drivers/spi:spidev
/sys/module/spi_altera




On 2021-03-18 03:44, Zoran wrote:

I am guessing here.... But what do you have while executing the
following command being in /sys
 as root?

root@arm:/sys# find . -name spi*

Zee
_______

On Wed, Mar 17, 2021 at 5:41 PM jchludzinski via
lists.yoctoproject.org
<jchludzinski=vivaldi.net@...> wrote:


In the YOCTO/Linux source tree there's drivers/spi/ which has all the source for SPI drivers. There's only 1 file, spidev.c, which has:

static int __init spidev_init(void)
{
        int status;

        /* Claim our 256 reserved device numbers.  Then register a class
         * that will key udev/mdev to add/remove /dev nodes.  Last, register
         * the driver which manages those device numbers.
         */
        BUILD_BUG_ON(N_SPI_MINORS > 256);
        status = register_chrdev(SPIDEV_MAJOR, "spi", &spidev_fops);
        if (status < 0)
                return status;

        spidev_class = class_create(THIS_MODULE, "spidev");
        if (IS_ERR(spidev_class)) {
                unregister_chrdev(SPIDEV_MAJOR, spidev_spi_driver.driver.name);
                return PTR_ERR(spidev_class);
        }

        status = spi_register_driver(&spidev_spi_driver);
        if (status < 0) {
                class_destroy(spidev_class);
                unregister_chrdev(SPIDEV_MAJOR, spidev_spi_driver.driver.name);
        }
        return status;
}
module_init(spidev_init);

... for creating device files in udev.

So when I use 'make nconfig' to specifiy that I want a loadable module for the ALTERA SPI driver, why don't I see a spidev.o file in drivers/spi/ ?

How does spi-altera.ko create device files without a call to register_chrdev(...).

How is it a loadable module without module_init(...)?

When I separately build spidev.c as an .ko and try loading it, I get: "Device or resourse busy"

---John


Re: is there a recent explanation of tricks you can play with MACHINEOVERRIDES?

Robert P. J. Day
 

On Sat, 20 Mar 2021, Quentin Schulz wrote:

Hi Robert,

On March 19, 2021 9:54:34 AM UTC, "Robert P. J. Day" <rpjday@...> wrote:

years ago, i asked about how to support a small set of
closely-related targets using MACHINEOVERRIDES to define how to apply
patches in a (somewhat) hierarchical fashion:

https://www.yoctoproject.org/pipermail/yocto/2016-March/028922.html

is there any current BSP that does something like that? and is this
sort of thing worth expanding on and adding to one of the manuals?
Don't use _prepend but =. BEFORE the other includes in your machine
configuration files otherwise the order in MACHINEOVERRIDES is
incorrect. Do NOT use append, or .=, they result in incorrect order
too.
i did write that a while back while i was still figuring it out. :-)

I do use this mechanism because we kind of use Yocto machines the
wrong way (basically using machines instead of distros or more
complex images).

I think NXP is making extensive use of this variable by defining a
MACHINEOVERRIDES per SoC families (e.g. imx:imx8:imx8mm).

I'm not sure we need to explain all possible uses of OVERRIDES
variables, just how to set it and how it works.
i agree that it would be inappropriate in the *regular* sections of
the docs, but i'm convinced it would be worth explaining in some sort
of "advanced features" section. after all, you just admitted that
*you* use it, and that NXP uses it. that should be enough to justify
explaining it *somewhere*, no?

rday

4621 - 4640 of 57387