I have ported U-boot on my Waveshare coreH7 stm32h743 board. I have used stm32h743-disco files and device trees as a template for porting. my onboard SDRAM is IS42S16400J that is 8MBytes. I have calculate the parameters of my sdram and I put them in my board device tree file as shown as below:
/*
* Memory configuration from sdram datasheet IS42S32800G-6BLI
* firsct bank is bank#0
* second bank is bank#1
*/
bank2: bank#1 {
st,sdram-control = /bits/ 8 <NO_COL_8
NO_ROW_12
MWIDTH_16
BANKS_4
CAS_3
SDCLK_2
RD_BURST_EN
RD_PIPE_DL_0>;
st,sdram-timing = /bits/ 8 <TMRD_1
TXSR_1
TRAS_1
TRC_6
TRP_2
TWR_1
TRCD_1>;
st,sdram-refcount = <300>;
};
also, I have been configured the rcc values to feed the dram with 100MHz.
but when uboot starts initialization, it goes to hard fault interrupt.
this is the log:
lib/fdtdec.c:fdtdec_setup_mem_size_base_fdt() fdtdec_setup_mem_size_base_fdt: Initial DRAM size 2000000
include/initcall.h:initcall_run_list() initcall: 08008a89
common/board_f.c:setup_dest_addr() Monitor len: 00039F80
common/board_f.c:setup_dest_addr() Ram size: 02000000
common/board_f.c:setup_dest_addr() Ram top: D2000000
include/initcall.h:initcall_run_list() initcall: 08008665
include/initcall.h:initcall_run_list() initcall: 0800117d
arch/arm/lib/cache.c:arm_reserve_mmu() TLB table from d1ff0000 to d1ff4000
include/initcall.h:initcall_run_list() initcall: 080088c3
include/initcall.h:initcall_run_list() initcall: 080088c7
include/initcall.h:initcall_run_list() initcall: 080086b1
common/board_f.c:reserve_uboot() Reserving 231k for U-Boot at: d1fb6000
include/initcall.h:initcall_run_list() initcall: 080088ed
common/board_f.c:reserve_malloc() Reserving 1032k for malloc() at: d1eb4000
include/initcall.h:initcall_run_list() initcall: 08008821
Hard fault
pc : 0800087e lr : 00000000 xPSR : 21000000
r12 : d1eb3ff0 r3 : 00000000 r2 : 00000010
r1 : 00000000 r0 : d1eb3fb0
Resetting CPU ...
what is the problem? is ram initialized unsuccessfully? why? maybe wrong parameters? how Can I know that ram is initialized successfully?
this is normal info log of u-boot:
U-Boot 2020.07-00610-g610e1487c8-dirty (Aug 04 2020 - 00:34:13 +0430)
Model: Waveshare STM32H743i-Coreh7 board
DRAM: Hard fault
pc : 0800087e lr : 00000000 xPSR : 21000000
r12 : d1eb3ff0 r3 : 00000000 r2 : 00000010
r1 : 00000000 r0 : d1eb3fb0
Resetting CPU ...
your ram size is wrong. as you mentioned, the actual ram size is 8MB that is 0x7A1200 in hexadecimal number. but in U-boot log is "Initial DRAM size 2000000". you should change it in the device tree of your board.
memory {
device_type = "memory";
reg = <0xd0000000 0x7A1200>;
};
I am compiling C++ source code on Nvidia Jetson nano. Some details of the processor are as follows:
cat /proc/cpuinfo
processor : 0
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1
processor : 1
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1
processor : 2
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1
processor : 3
model name : ARMv8 Processor rev 1 (v8l)
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd07
CPU revision : 1
I get the following error when compiling the code;
c++: error: unrecognized command line option _-mfpu=neon_
c++: error: unrecognized command line option _-mfpu=neon_
I want to know based on the above following specifications; what flags should I set for mfpu?
For ARMv8-A profile processors the FPU and NEON are mandatory parts of the architecture (unlike ARMv7-A) so you shouldn't need a -mfpu flag to enable it.
So I need some guidance on how to make spidev run at the very beginning of the kernel init. I am using an ILI9341 display connected to the pocketbeagle that is being driven using SPI. Thing is, I need to "send" an image to the display during boot. For that, I need to start spidev at the very beginning of the boot process, and I am not really sure what process starts spidev. I am not sure if it's something started by a systemd process or elsewhere.
Here is my device tree declaration of spidev (original: am335x-pocketbeagle.dts):
&spi0 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel#0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "spidev";
reg = <0>;
spi-max-frequency = <100000000>;
};
channel#1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "spidev";
reg = <1>;
spi-max-frequency = <100000000>;
status = "disabled";
};
};
&spi1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel#0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "spidev";
reg = <0>;
spi-max-frequency = <100000000>;
};
channel#1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "spidev";
reg = <1>;
spi-max-frequency = <100000000>;
};
};
Here is the beginning of the boot process (just the first few secs is shown here):
U-Boot SPL 2018.01-dirty (May 06 2018 - 17:12:35)
Trying to boot from MMC1
U-Boot 2018.01-dirty (May 06 2018 - 17:12:35 -0400)
CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment
Model: BeagleBoard.org PocketBeagle
<ethaddr> not set. Validating first E-fuse MAC
Net: usb_ether
Press SPACE to abort autoboot in 2 seconds
board_name=[A335PBGL] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Bad device 0:2 0x82000000 **
** Bad device 0:2 0x82000000 **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
24 bytes read in 15 ms (1000 Bytes/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.4.113-ti-r149 ...
9431560 bytes read in 612 ms (14.7 MiB/s)
loading /boot/dtbs/4.4.113-ti-r149/am335x-pocketbeagle.dtb ...
130113 bytes read in 84 ms (1.5 MiB/s)
uboot_overlays: add [enable_uboot_overlays=1] to /boot/uEnv.txt to enable...
debug: [console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait] ...
debug: [bootz 0x82000000 - 0x88000000] ...
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8ffdd000, end 8ffffc40 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.113-ti-r149 (luis#luis) (gcc version 5.5.0 (Lin aro GCC 5.5-2017.10) ) #2 SMP Fri Jun 29 16:50:45 EDT 2018
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instructio n cache
[ 0.000000] Machine model: TI AM335x PocketBeagle
[ 0.000000] cma: Reserved 48 MiB at 0x9c800000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM335X ES2.1 (sgx neon )
[ 0.000000] PERCPU: Embedded 13 pages/cpu #df8f2000 s24192 r8192 d20864 u5324 8
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pag es: 129408
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p1 r o rootfstype=ext4 rootwait
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 448072K/522240K available (12533K kernel code, 1016K rwda ta, 4064K rodata, 824K init, 857K bss, 25016K reserved, 49152K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc103d760 (16598 kB)
[ 0.000000] .init : 0xc103e000 - 0xc110c000 ( 824 kB)
[ 0.000000] .data : 0xc110c000 - 0xc120a0e8 (1017 kB)
[ 0.000000] .bss : 0xc120d000 - 0xc12e355c ( 858 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrup ts
[ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[ 0.000022] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478 484971ns
[ 0.000048] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max _idle_ns: 79635851949 ns
[ 0.000061] OMAP clocksource: timer1 at 24000000 Hz
[ 0.001914] clocksource_probe: no matching clocksources found
[ 0.002223] Console: colour dummy device 80x30
[ 0.002254] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[ 0.002262] This ensures that you still see kernel messages. Please
[ 0.002268] update your kernel commandline.
[ 0.002289] Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
[ 0.021215] pid_max: default: 32768 minimum: 301
[ 0.021365] Security Framework initialized
[ 0.021380] Yama: becoming mindful.
[ 0.021418] AppArmor: AppArmor disabled by boot time parameter
[ 0.021590] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.021603] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.022464] Initializing cgroup subsys io
[ 0.022497] Initializing cgroup subsys memory
[ 0.022543] Initializing cgroup subsys devices
[ 0.022561] Initializing cgroup subsys freezer
[ 0.022578] Initializing cgroup subsys net_cls
[ 0.022592] Initializing cgroup subsys perf_event
[ 0.022607] Initializing cgroup subsys net_prio
[ 0.022630] Initializing cgroup subsys pids
[ 0.022688] CPU: Testing write buffer coherency: ok
[ 0.022747] ftrace: allocating 37522 entries in 111 pages
[ 0.128715] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[ 0.128838] Setting up static identity map for 0x80008280 - 0x800082e0
[ 0.133343] Brought up 1 CPUs
[ 0.133369] SMP: Total of 1 processors activated (995.32 BogoMIPS).
[ 0.133377] CPU: All CPU(s) started in SVC mode.
[ 0.134975] devtmpfs: initialized
[ 0.172782] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 0.223366] omap_hwmod: debugss: _wait_target_disable failed
[ 0.277491] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, ma x_idle_ns: 7645041785100000 ns
[ 0.277527] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.281782] xor: measuring software checksum speed
[ 0.321202] arm4regs : 1219.000 MB/sec
[ 0.361191] 8regs : 957.000 MB/sec
[ 0.401188] 32regs : 1089.000 MB/sec
[ 0.441187] neon : 1725.000 MB/sec
[ 0.441195] xor: using function: neon (1725.000 MB/sec)
[ 0.441228] pinctrl core: initialized pinctrl subsystem
[ 0.442711] NET: Registered protocol family 16
[ 0.445513] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.446456] cpuidle: using governor ladder
[ 0.446477] cpuidle: using governor menu
[ 0.452463] OMAP GPIO hardware version 0.1
[ 0.475562] No ATAGs?
[ 0.475601] hw-breakpoint: debug architecture 0x4 unsupported.
[ 0.476766] omap4_sram_init:Unable to allocate sram needed to handle errata I 688
[ 0.476789] omap4_sram_init:Unable to get sram pool needed to handle errata I 688
[ 0.557214] raid6: neonx2 gen() 1887 MB/s
[ 0.625198] raid6: neonx2 xor() 1161 MB/s
[ 0.625207] raid6: using algorithm neonx2 gen() 1887 MB/s
[ 0.625214] raid6: .... xor() 1161 MB/s, rmw enabled
[ 0.625221] raid6: using intx1 recovery algorithm
[ 0.635476] edma 49000000.edma: TI EDMA DMA engine driver
[ 0.640859] vgaarb: loaded
[ 0.641610] SCSI subsystem initialized
[ 0.642367] usbcore: registered new interface driver usbfs
[ 0.642449] usbcore: registered new interface driver hub
[ 0.642560] usbcore: registered new device driver usb
[ 0.643413] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wk up#44c00000/scm#210000/pinmux#800/pinmux_i2c0_pins, deferring probe
[ 0.644286] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz
[ 0.644967] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 400 kHz
[ 0.645404] media: Linux media interface: v0.10
[ 0.645482] Linux video capture interface: v2.00
[ 0.645611] pps_core: LinuxPPS API ver. 1 registered
[ 0.645620] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giome tti <giometti#linux.it>
[ 0.645655] PTP clock support registered
[ 0.646615] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[ 0.648938] NetLabel: Initializing
[ 0.648955] NetLabel: domain hash size = 128
[ 0.648961] NetLabel: protocols = UNLABELED CIPSOv4
[ 0.649029] NetLabel: unlabeled traffic allowed by default
[ 0.649769] clocksource: Switched to clocksource timer1
[ 0.773340] NET: Registered protocol family 2
[ 0.774347] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.774397] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.774456] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.774539] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.774560] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.774925] NET: Registered protocol family 1
[ 0.775551] RPC: Registered named UNIX socket transport module.
[ 0.775567] RPC: Registered udp transport module.
[ 0.775574] RPC: Registered tcp transport module.
[ 0.775580] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.776750] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counter s available
[ 0.780201] audit: initializing netlink subsys (disabled)
[ 0.780300] audit: type=2000 audit(0.712:1): initialized
[ 0.790964] zbud: loaded
[ 0.791713] VFS: Disk quotas dquot_6.6.0
[ 0.791995] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.795073] NFS: Registering the id_resolver key type
[ 0.795149] Key type id_resolver registered
[ 0.795157] Key type id_legacy registered
[ 0.795187] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.795579] fuse init (API version 7.23)
[ 0.796227] SGI XFS with ACLs, security attributes, realtime, no debug enable d
[ 0.805645] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 2 47)
[ 0.806079] io scheduler noop registered
[ 0.806100] io scheduler deadline registered
[ 0.806175] io scheduler cfq registered (default)
[ 0.808070] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 0.809173] gpio-of-helper ocp:cape-universal: Allocated GPIO id=0
[ 0.809332] gpio-of-helper ocp:cape-universal: Allocated GPIO id=1
[ 0.809521] gpio-of-helper ocp:cape-universal: Allocated GPIO id=2
[ 0.809670] gpio-of-helper ocp:cape-universal: Allocated GPIO id=3
[ 0.810219] gpio-of-helper ocp:cape-universal: Allocated GPIO id=4
[ 0.810400] gpio-of-helper ocp:cape-universal: Allocated GPIO id=5
[ 0.810547] gpio-of-helper ocp:cape-universal: Allocated GPIO id=6
[ 0.810691] gpio-of-helper ocp:cape-universal: Allocated GPIO id=7
[ 0.810844] gpio-of-helper ocp:cape-universal: Allocated GPIO id=8
[ 0.811050] gpio-of-helper ocp:cape-universal: Allocated GPIO id=9
[ 0.811224] gpio-of-helper ocp:cape-universal: Allocated GPIO id=10
[ 0.811392] gpio-of-helper ocp:cape-universal: Allocated GPIO id=11
[ 0.811539] gpio-of-helper ocp:cape-universal: Allocated GPIO id=12
[ 0.811692] gpio-of-helper ocp:cape-universal: Allocated GPIO id=13
[ 0.811838] gpio-of-helper ocp:cape-universal: Allocated GPIO id=14
[ 0.811988] gpio-of-helper ocp:cape-universal: Allocated GPIO id=15
[ 0.812144] gpio-of-helper ocp:cape-universal: Allocated GPIO id=16
[ 0.812293] gpio-of-helper ocp:cape-universal: Allocated GPIO id=17
[ 0.812445] gpio-of-helper ocp:cape-universal: Allocated GPIO id=18
[ 0.812598] gpio-of-helper ocp:cape-universal: Allocated GPIO id=19
[ 0.812752] gpio-of-helper ocp:cape-universal: Allocated GPIO id=20
[ 0.812907] gpio-of-helper ocp:cape-universal: Allocated GPIO id=21
[ 0.813055] gpio-of-helper ocp:cape-universal: Allocated GPIO id=22
[ 0.813189] gpio-of-helper ocp:cape-universal: Allocated GPIO id=23
[ 0.813332] gpio-of-helper ocp:cape-universal: Allocated GPIO id=24
[ 0.813467] gpio-of-helper ocp:cape-universal: Allocated GPIO id=25
[ 0.813602] gpio-of-helper ocp:cape-universal: Allocated GPIO id=26
[ 0.813842] gpio-of-helper ocp:cape-universal: Allocated GPIO id=27
[ 0.814192] gpio-of-helper ocp:cape-universal: Allocated GPIO id=28
[ 0.814350] gpio-of-helper ocp:cape-universal: Allocated GPIO id=29
[ 0.814491] gpio-of-helper ocp:cape-universal: Allocated GPIO id=30
[ 0.814629] gpio-of-helper ocp:cape-universal: Allocated GPIO id=31
[ 0.814774] gpio-of-helper ocp:cape-universal: Allocated GPIO id=32
[ 0.814911] gpio-of-helper ocp:cape-universal: Allocated GPIO id=33
[ 0.815048] gpio-of-helper ocp:cape-universal: Allocated GPIO id=34
[ 0.815196] gpio-of-helper ocp:cape-universal: Allocated GPIO id=35
[ 0.815338] gpio-of-helper ocp:cape-universal: Allocated GPIO id=36
[ 0.815485] gpio-of-helper ocp:cape-universal: Allocated GPIO id=37
[ 0.815624] gpio-of-helper ocp:cape-universal: Allocated GPIO id=38
[ 0.815762] gpio-of-helper ocp:cape-universal: Allocated GPIO id=39
[ 0.815909] gpio-of-helper ocp:cape-universal: Allocated GPIO id=40
[ 0.816053] gpio-of-helper ocp:cape-universal: Allocated GPIO id=41
[ 0.816194] gpio-of-helper ocp:cape-universal: Allocated GPIO id=42
[ 0.816343] gpio-of-helper ocp:cape-universal: Allocated GPIO id=43
[ 0.816354] gpio-of-helper ocp:cape-universal: ready
[ 0.822156] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle
[ 0.824170] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[ 0.827881] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158, base_baud = 3000000) is a 8250
[ 1.921701] console [ttyS0] enabled
"Important" things like GPIOs and I2C appear to be running at the very beginning of the boot process. How could I do the same thing with spidev?
I am a little unclear where in the boot process is the pocketbeagle's device tree being "declared"? Where in the boot process does /dev/spidev becomes available? And how can I make it start earlier?
Summarizing #sawdust and my comments into an answer:
Don't use SPIdev for this
Use the Linux Framebuffer drivers for small TFT LCD display modules
Set bootdelay to 0 or -2 in U-Boot Env
Don't worry about the warning, you can recover and modify the Env file by booting from SD card or if on SD, by modifying its contents on a computer.
Add a systemd service to render your splash screen early during boot
Simple and has some good pointers
Quite verbose, not everything applies (e.g. console), but might contain some good bits to selectively pick out
Goal
Measure the CPU temperature of my Linux Box.
Work done till now
I have installed lm-sensors to detect the temperature and below is the output of the command sensor:
root#XXXX-XX :# sensors
acpitz-virtual-0
Adapter: Virtual device
temp1: +66.0°C (crit = +255.0°C)
k10temp-pci-00c3
Adapter: PCI adapter
temp1: +65.4°C (high = +70.0°C)
(crit = +100.0°C, hyst = +99.0°C)
radeon-pci-0008
Adapter: PCI adapter
temp1: +64.0°C (crit = +120.0°C, hyst = +90.0°C)
radeon-pci-0100
Adapter: PCI adapter
temp1: N/A (crit = +120.0°C, hyst = +90.0°C)
The output of the cat /proc/cpuinfo is:
processor : 0
vendor_id : AuthenticAMD
cpu family : 21
model : 16
model name : AMD A8-4500M APU with Radeon(tm) HD Graphics
stepping : 1
microcode : 0x6001116
cpu MHz : 1400.000
cache size : 2048 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 16
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
.
.
.
processor : 1
vendor_id : AuthenticAMD
cpu family : 21
model : 16
model name : AMD A8-4500M APU with Radeon(tm) HD Graphics
stepping : 1
microcode : 0x6001116
cpu MHz : 1400.000
cache size : 2048 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
apicid : 17
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
processor : 2
vendor_id : AuthenticAMD
cpu family : 21
model : 16
model name : AMD A8-4500M APU with Radeon(tm) HD Graphics
stepping : 1
microcode : 0x6001116
cpu MHz : 1400.000
cache size : 2048 KB
physical id : 0
siblings : 4
core id : 2
cpu cores : 2
apicid : 18
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
processor : 3
vendor_id : AuthenticAMD
cpu family : 21
model : 16
model name : AMD A8-4500M APU with Radeon(tm) HD Graphics
stepping : 1
microcode : 0x6001116
cpu MHz : 1400.000
cache size : 2048 KB
physical id : 0
siblings : 4
core id : 3
cpu cores : 2
apicid : 19
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
Question
Out of the above readings from command sensor and cat /proc/cpuinfo, I am not sure which is exactly my cpu temperature in the output of sensors and what is the one to one relation between the output of both the commands (ie: which field (ie:output of sensor) matches with the field of cat /proc/cpuinfo).
Your cpu temperature is shown by the k10 sensor, but beware it is assumed to be inaccurate.
https://www.kernel.org/doc/Documentation/hwmon/k10temp
This was only observed in Linux virtual machines. In /proc/cpuinfo, the physical id could be very large, exceeding the number of cpus.
For below example, 4 core systems but the physical id is 13. Also had another virtual machine, only 2 cores, but one physical id is 2.
Anyone has idea how virtual machine defines the linux physical ID?
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2690 0 # 2.90GHz
stepping : 7
microcode : 1808
cpu MHz : 2900.040
cache size : 20480 KB
physical id : 13
siblings : 1
core id : 0
cpu cores : 1
apicid : 13
initial apicid : 13
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes hypervisor lahf_lm arat epb pln pts dts
bogomips : 5800.08
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2690 0 # 2.90GHz
stepping : 7
microcode : 1808
cpu MHz : 2900.040
cache size : 20480 KB
physical id : 13
siblings : 1
core id : 0
cpu cores : 1
apicid : 13
initial apicid : 13
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes hypervisor lahf_lm arat epb pln pts dts
bogomips : 5800.08
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2690 0 # 2.90GHz
stepping : 7
microcode : 1808
cpu MHz : 2900.040
cache size : 20480 KB
physical id : 13
siblings : 1
core id : 0
cpu cores : 1
apicid : 13
initial apicid : 13
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes hypervisor lahf_lm arat epb pln pts dts
bogomips : 5800.08
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2690 0 # 2.90GHz
stepping : 7
microcode : 1808
cpu MHz : 2900.040
cache size : 20480 KB
physical id : 13
siblings : 1
core id : 0
cpu cores : 1
apicid : 13
initial apicid : 13
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes hypervisor lahf_lm arat epb pln pts dts
bogomips : 5800.08
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management: