warp7定位为IOT设备,相对其他嵌入式设备手机和pda等电源管理尤为重要,毕竟IOT的设备体积要求更小,电池容量自然更小。我们将从待机功能的理论,调试手段,源代码实现逻辑和实际电流测试数值,还有系统运行log几个方面来分析一下。- 待机功能理论
Linux电源管理_Generic PowerManager涉及的内容非常多,我们这里只是对我们要使用的待机功能实现逻辑进入分析,其他部分的内容暂时认为是黑盒即可。
任何一个版本的linux kernel都有一些相关文档待机功能也不另外。Documentation/power/state.txt就是待机功能的说明文档,相对比较简单。
简单总结如下表,但是需要注意的是这些状态是所有的状态的概括,尤其对于嵌入式设备它未必都支持,例如我们的warp7就支持三种。cat /sys/power/state 输出:freeze standby mem 操作接口 | ACPI state:S0 | ACPI state:S1 | ACPI state:S3 | ACPI state:S4 | /sys/power/state | Suspend-To-Idle | Standby / Power-On Suspend | Suspend-to-RAM | Suspend-to-disk | | freeze | standby | mem | disk |
- 调试方法
理论说完我们来看看调试的方法。printk是linux kernel开发中最佳的调试手段,但是suspend和resume时默认是关闭的,需要手动打开。将bool console_suspend_enabled变量设置为false,然后重新编译内核,则printk函数打印信息就可以输出到串口中。
- static int fxos8700_suspend(struct device *dev)
- {
- struct i2c_client *client = to_i2c_client(dev);
- struct fxos8700_data *pdata = i2c_get_clientdata(client);
- printk("fxos8700_suspendn");
- if (atomic_read(&pdata->acc_active) || atomic_read(&pdata->mag_active))
- fxos8700_device_stop(client);
- return 0;
- }
- static int fxos8700_resume(struct device *dev)
- {
- int ret = 0;
- struct i2c_client *client = to_i2c_client(dev);
- struct fxos8700_data *pdata = i2c_get_clientdata(client);
- printk("fxos8700_resumen");
- if (atomic_read(&pdata->acc_active))
- fxos8700_change_mode(client, FXOS8700_TYPE_ACC, FXOS8700_ACTIVED);
- if (atomic_read(&pdata->mag_active))
- fxos8700_change_mode(client, FXOS8700_TYPE_MAG, FXOS8700_ACTIVED);
- return ret;
- }
复制代码
- 源代码实现逻辑
a./sys/power/state操作接口初始化
文件:kernel/kernel/power/main.c
入口函数:core_initcall(pm_init);core_init的加载顺序需要注意要比一般的驱动要早。
kobject_create_and_add创建设备节点,sysfs_create_group创建设备节点下面的子设备节点。attr_group里面包含很多设备节点,比较源代码和下面设备节点的名字和个数是一一对应。
b.echo mem > /sys/power/state处理逻辑
echo mem > /sys/power/state-->state_store函数-->1.decode_state函数判断系统状态;2.pm_suspend才是关键处理逻辑-->pm_suspend函数-->enter_state函数-->
1.sys_sync函数;缓存同步
2.suspend_prepare函数;冻结所以进程,(fasync_helper,控制台子系统和freeze用户空间进程和一些内核线程)
3.suspend_devices_and_enter函数;调用每个设备驱动suspend函数
c.cat /sys/power/state处理逻辑
cat /sys/power/state -->state_show函数,即pm_states数组所以数值显示出来。
pm_states数组,有一组默认初始化数值:const char *pm_labels[] = { "mem", "standby", "freeze", NULL };
对于每个嵌入式平台来说,都有一些自己的处理逻辑,arch/arm/mach-imx/pm-imax7.c中 imx7_pm_valid函数,代码非常简单。
- static int imx7_pm_valid(suspend_state_t state)
- {
- printk("imx7_pm_validn");
- return state == PM_SUSPEND_STANDBY || state == PM_SUSPEND_MEM;
- }
复制代码
c.其他PM core等函数这里就不在涉及。 - 各种不同状态待机测试电流数值,值得注意的是standby的待机电流小于mem时的待机电流,后面找到设备确认一下测试结果正确性。不同的测试设备待机电流很可能不一样,但是总的趋势是一致的。
操作命令 | mem待机电流 | standby待机电流 | freeze待机电流 | echo xxx>/sys/power/state | 71.3mA | 50mA | 92mA |
- 系统运行log
- U-Boot 2016.07+fslc+ge6b4241 (Aug 19 2017 - 03:19:53 +0800)
- CPU: Freescale i.MX7S rev1.2 at 792MHz
- CPU: Extended Commercial temperature grade (-20C to 105C) at 42C
- Reset cause: POR
- Board: WARP7
- DRAM: 512 MiB
- MMC: FSL_SDHC: 0
- *** Warning - bad CRC, using default environment
- In: serial
- Out: serial
- Err: serial
- Net: CPU Net Initialization Failed
- No ethernet found.
- Hit any key to stop autoboot: 0
- switch to partitions #0, OK
- mmc0(part 0) is current device
- switch to partitions #0, OK
- mmc0(part 0) is current device
- reading boot.scr
- ** Unable to read file boot.scr **
- reading zImage
- 6270656 bytes read in 94 ms (63.6 MiB/s)
- Booting from mmc ...
- reading imx7s-warp.dtb
- 37585 bytes read in 12 ms (3 MiB/s)
- Kernel image @ 0x80800000 [ 0x000000 - 0x5faec0 ]
- ## Flattened Device Tree blob at 83000000
- Booting using the fdt blob at 0x83000000
- Using Device Tree in place at 83000000, end 8300c2d0
- Starting kernel ...
- Booting Linux on physical CPU 0x0
- Linux version 4.1.32-4.1-1.0.x-imx-warp7+g511f37a (gaozh@T430) (gcc version 5.3.0 (GCC) ) #2 SMP PREEMPT Wed Sep 13 22:27:17 CST 2017
- CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
- CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
- Machine model: Warp i.MX7S Board
- Reserved memory: created CMA memory pool at 0x8c000000, size 320 MiB
- Reserved memory: initialized node linux,cma, compatible id shared-dma-pool
- Memory policy: Data cache writealloc
- PERCPU: Embedded 12 pages/cpu @8bb23000 s16908 r8192 d24052 u49152
- Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
- Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk2p2 rootwait rw
- PID hash table entries: 2048 (order: 1, 8192 bytes)
- Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
- Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
- Memory: 179216K/524288K available (7816K kernel code, 455K rwdata, 2788K rodata, 424K init, 473K bss, 17392K reserved, 327680K cma-reserved, 0K highmem)
- Virtual kernel memory layout:
- vector : 0xffff0000 - 0xffff1000 ( 4 kB)
- fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
- vmalloc : 0xa0800000 - 0xff000000 (1512 MB)
- lowmem : 0x80000000 - 0xa0000000 ( 512 MB)
- pkmap : 0x7fe00000 - 0x80000000 ( 2 MB)
- modules : 0x7f000000 - 0x7fe00000 ( 14 MB)
- .text : 0x80008000 - 0x80a6349c (10606 kB)
- .init : 0x80a64000 - 0x80ace000 ( 424 kB)
- .data : 0x80ace000 - 0x80b3ffe0 ( 456 kB)
- .bss : 0x80b42000 - 0x80bb8640 ( 474 kB)
- SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
- Preemptible hierarchical RCU implementation.
- Additional per-CPU info printed with stalls.
- RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
- RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
- NR_IRQS:16 nr_irqs:16 16
- Architected cp15 timer(s) running at 8.00MHz (phys).
- clocksource arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
- sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
- Switching to timer-based delay loop, resolution 125ns
- mxc_clocksource_init 3000000
- Ignoring duplicate/late registration of read_current_timer delay
- clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
- Console: colour dummy device 80x30
- Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=80000)
- pid_max: default: 32768 minimum: 301
- Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
- Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
- CPU: Testing write buffer coherency: ok
- /cpus/cpu@0 missing clock-frequency property
- /cpus/cpu@1 missing clock-frequency property
- CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
- Setting up static identity map for 0x80008280 - 0x800082d8
- CPU1: failed to come online
- Brought up 1 CPUs
- SMP: Total of 1 processors activated (16.00 BogoMIPS).
- CPU: All CPU(s) started in SVC mode.
- devtmpfs: initialized
- device-tree: Duplicate name in lcdif@30730000, renamed to "display#1"
- VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
- =2=CONFIG_PM_TRACE=1=CONFIG_PM_SLEEP=2=CONFIG_PM_AUTOSLEEP=2=CONFIG_PM_WAKELOCKS=1=CONFIG_PM_DEBUG=1=CONFIG_PM_SLEEP_DEBUG=1=CONFIG_FREEZER
- clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
- pinctrl core: initialized pinctrl subsystem
- NET: Registered protocol family 16
- DMA: preallocated 256 KiB pool for atomic coherent allocations
- cpuidle: using governor ladder
- cpuidle: using governor menu
- DDR type is LPDDR3!
- imx7_pm_valid
- pm_states[i]=memimx7_pm_valid
- pm_states[i]=standby
- hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
- hw-breakpoint: maximum watchpoint size is 8 bytes.
- imx7d-pinctrl 302c0000.iomuxc-lpsr: initialized IMX pinctrl driver
- imx7d-pinctrl 30330000.iomuxc: initialized IMX pinctrl driver
- gpio-reset mipi-dsi-reset: reset-gpios property missing, or not a single gpio
- gpio-reset: probe of mipi-dsi-reset failed with error -22
- MU is ready for cross core communication!
- mxs-dma 33000000.dma-apbh: initialized
- SCSI subsystem initialized
- u***core: registered new interface driver u***fs
- u***core: registered new interface driver hub
- u***core: registered new device driver u***
- 30800000.aips-bus:u***phy_nop1 supply vcc not found, using dummy regulator
- 30800000.aips-bus:u***phy_nop2 supply vcc not found, using dummy regulator
- i2c i2c-0: IMX I2C adapter registered
- i2c i2c-0: can't use DMA
- i2c i2c-1: IMX I2C adapter registered
- i2c i2c-1: can't use DMA
- i2c i2c-2: IMX I2C adapter registered
- i2c i2c-2: can't use DMA
- i2c i2c-3: IMX I2C adapter registered
- i2c i2c-3: can't use DMA
- Linux video capture interface: v2.00
- pps_core: LinuxPPS API ver. 1 registered
- pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti
- PTP clock support registered
- MIPI CSI2 driver module loaded
- Advanced Linux Sound Architecture Driver Initialized.
- Bluetooth: Core ver 2.20
- NET: Registered protocol family 31
- Bluetooth: HCI device and connection manager initialized
- Bluetooth: HCI socket layer initialized
- Bluetooth: L2CAP socket layer initialized
- Bluetooth: SCO socket layer initialized
- Switched to clocksource arch_sys_counter
- NET: Registered protocol family 2
- TCP established hash table entries: 4096 (order: 2, 16384 bytes)
- TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
- TCP: Hash tables configured (established 4096 bind 4096)
- UDP hash table entries: 256 (order: 1, 8192 bytes)
- UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
- NET: Registered protocol family 1
- RPC: Registered named UNIX socket transport module.
- RPC: Registered udp transport module.
- RPC: Registered tcp transport module.
- RPC: Registered tcp NFSv4.1 backchannel transport module.
- imx rpmsg driver is registered.
- Bus freq driver module loaded
- futex hash table entries: 512 (order: 3, 32768 bytes)
- VFS: Disk quotas dquot_6.6.0
- VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
- NFS: Registering the id_resolver key type
- Key type id_resolver registered
- Key type id_legacy registered
- jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
- fuse init (API version 7.23)
- io scheduler noop registered
- io scheduler deadline registered
- io scheduler cfq registered (default)
- backlight supply power not found, using dummy regulator
- MIPI DSI driver module loaded
- 30760000.mipi-dsi supply disp-power-on not found, using dummy regulator
- mxc_mipi_dsi_samsung 30760000.mipi-dsi: i.MX MIPI DSI driver probed
- MIPI DSI driver module loaded
- 30730000.lcdif supply lcd not found, using dummy regulator
- mxc_mipi_dsi_samsung 30760000.mipi-dsi: MIPI DSI dispdrv inited!
- mxsfb 30730000.lcdif: registered mxc display driver mipi_dsi_samsung
- Console: switching to colour frame buffer device 40x40
- mxsfb 30730000.lcdif: initialized
- imx-sdma 30bd0000.sdma: no event needs to be remapped
- imx-sdma 30bd0000.sdma: loaded firmware 4.2
- imx-sdma 30bd0000.sdma: initialized
- pfuze100-regulator 0-0008: Full layer: 1, Metal layer: 1
- pfuze100-regulator 0-0008: FAB: 0, FIN: 0
- pfuze100-regulator 0-0008: pfuze3000 found.
- 30860000.serial: ttymxc0 at MMIO 0x30860000 (irq = 272, base_baud = 1500000) is a IMX
- console [ttymxc0] enabled
- 30880000.serial: ttymxc2 at MMIO 0x30880000 (irq = 273, base_baud = 5000000) is a IMX
- imx sema4 driver is registered.
- [drm] Initialized drm 1.1.0 20060810
- [drm] Initialized vivante 1.0.0 20120216 on minor 0
- brd: module loaded
- loop: module loaded
- input: fxos8700 as /devices/platform/soc/30800000.aips-bus/30a50000.i2c/i2c-3/3-001e/input/input0
- fxos8700 device driver probe successfully
- input: fxas2100x as /devices/platform/soc/30800000.aips-bus/30a50000.i2c/i2c-3/3-0020/input/input1
- fxas2100x 3-0020: fxas2100x device driver probe successfully
- CAN device driver interface
- ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
- ehci-mxc: Freescale On-Chip EHCI Host driver
- u***core: registered new interface driver u***-storage
- u***core: registered new interface driver u***_ehset_test
- 30b10200.u***misc supply vbus-wakeup not found, using dummy regulator
- 30b20200.u***misc supply vbus-wakeup not found, using dummy regulator
- 30b30200.u***misc supply vbus-wakeup not found, using dummy regulator
- mousedev: PS/2 mouse device common for all mice
- input: 30370000.snvs:snvs-powerkey as /devices/platform/soc/30000000.aips-bus/30370000.snvs/30370000.snvs:snvs-powerkey/input/input2
- [HXTP] Himax 852xES touch panel driver init
- [HXTP] himax852xes_init_async:Enter
- [HXTP] DT-himax_parse_dt:panel-coords = 0, 320, 0, 320
- [HXTP] DT-himax_parse_dt:display-coords = (320, 320)
- read mpl3115 chip id 0xc4
- input: mpl3115 as /devices/virtual/input/input3
- [HXTP] DT:gpio_rst value is not valid
- [HXTP] DT:gpio_3v3_en value is not valid
- [HXTP] DT:gpio_irq=1, gpio_rst=-2, gpio_3v3_en=-2[HXTP] DT:protocol_type=1[HXTP] DT-No vk info in DT
- mpl3115 device driver probe successfullysnvs_rtc 30370000.snvs:snvs-rtc-lp: rtc core: registered 30370000.snvs:snvs- as rtc0
- i2c /dev entries driver
- IR NEC protocol handler initialized
- IR RC5(x/sz) protocol handler initialized
- IR RC6 protocol handler initialized
- [HXTP][ERROR] i2c_himax_read:write reg error:reg=1
- [HXTP][ERROR] Himax chip doesn NOT EXIST
- IR JVC protocol handler initialized
- IR Sony protocol handler initialized
- IR SANYO protocol handler initialized
- IR Sharp protocol handler initialized
- IR MCE Keyboard/mouse protocol handler initialized
- IR XMP protocol handler initialized
- imx2-wdt 30280000.wdog: timeout 60 sec (nowayout=0)
- Bluetooth: HCI UART driver ver 2.3
- Bluetooth: HCI UART protocol H4 registered
- u***core: registered new interface driver bcm203x
- sdhci: Secure Digital Host Controller Interface driver
- sdhci: Copyright(c) Pierre Ossman
- sdhci-pltfm: SDHCI platform and OF driver helper
- /soc/aips-bus@30800000/usdhc@30b40000: voltage-ranges unspecified
- sdhci-esdhc-imx 30b40000.usdhc: assigned as wifi host
- sdhci-esdhc-imx 30b40000.usdhc: No vmmc regulator found
- sdhci-esdhc-imx 30b40000.usdhc: No vqmmc regulator found
- mmc0: SDHCI controller on 30b40000.usdhc [30b40000.usdhc] using ADMA
- /soc/aips-bus@30800000/usdhc@30b60000: voltage-ranges unspecified
- sdhci-esdhc-imx 30b60000.usdhc: No vmmc regulator found
- sdhci-esdhc-imx 30b60000.usdhc: No vqmmc regulator found
- mmc2: SDHCI controller on 30b60000.usdhc [30b60000.usdhc] using ADMA
- caam 30900000.caam: Entropy delay = 3200
- caam 30900000.caam: Instantiated RNG4 SH0
- caam 30900000.caam: Instantiated RNG4 SH1
- caam 30900000.caam: device ID = 0x0a16030000000000 (Era -524)
- caam 30900000.caam: job rings = 3, qi = 0
- caam algorithms registered in /proc/crypto
- caam_jr 30901000.jr0: registering rng-caam
- platform caam_sm: blkkey_ex: 8 keystore units available
- platform caam_sm: 64-bit clear key:
- platform caam_sm: [0000] 00 01 02 03 04 0f 06 07
- platform caam_sm: 64-bit black key:
- platform caam_sm: [0000] b1 af 72 32 7b 68 af de
- platform caam_sm: [0008] 34 da f0 30 7d 23 c0 a8
- platform caam_sm: 128-bit clear key:
- platform caam_sm: [0000] 00 01 02 03 04 0f 06 07
- platform caam_sm: [0008] 08 09 0a 0b 0c 0d 0e 0f
- platform caam_sm: 128-bit black key:
- mmc2: MAN_BKOPS_EN bit is not set
- platform caam_sm: [0000] 7f f4 4c 90 63 24 c2 5b
- platform caam_sm: [0008] 63 ed 7f 20 12 8f 16 9f
- platform caam_sm: 192-bit clear key:
- platform caam_sm: [0000] 00 01 02 03 04 0f 06 07
- platform caam_sm: [0008] 08 09 0a 0b 0c 0d 0e 0f
- platform caam_sm: [0016] 10 11 12 13 14 15 16 17
- platform caam_sm: 192-bit black key:
- mmc2: mmc_select_hs200 failed, error -74
- : switch to mmc2 failed
- platform caam_sm: [0000] 45 bc e2 7d c6 61 34 6b
- platform caam_sm: [0008] d3 7d 88 4a 85 ea 57 c7
- mmc2: new MMC card at address 0001
- platform caam_sm: [0016] 3a d5 8c 2b e0 e9 39 8c
- mmcblk2: mmc2:0001 V10008 7.05 GiB
- platform caam_sm: [0024] a2 b4 fc 61 ea 3a b1 83
- platform caam_sm: 256-bit clear key:
- mmcblk2boot0: mmc2:0001 V10008 partition 1 4.00 MiB
- mmcblk2boot1: mmc2:0001 V10008 partition 2 4.00 MiB
- platform caam_sm: [0000] 00 01 02 03 04 0f 06 07
- platform caam_sm: [0008] 08 09 0a 0b 0c 0d 0e 0f
- mmcblk2rpmb: mmc2:0001 V10008 partition 3 4.00 MiB
- platform caam_sm: [0016] 10 11 12 13 14 15 16 17
- mmcblk2: p1 p2
- platform caam_sm: [0024] 18 19 1a 1b 1c 1d 1e 1f
- platform caam_sm: 256-bit black key:
- platform caam_sm: [0000] da 12 33 aa 0f 2f c3 2b
- platform caam_sm: [0008] d2 00 7b 9f 22 db 19 62
- platform caam_sm: [0016] 50 93 e7 01 eb e5 06 1a
- platform caam_sm: [0024] 52 70 89 17 de 5e 59 a1
- platform caam_sm: 64-bit unwritten blob:
- platform caam_sm: [0000] 00 00 00 00 00 00 00 00
- platform caam_sm: [0008] 00 00 00 00 00 00 00 00
- platform caam_sm: [0016] 00 00 00 00 00 00 00 00
- platform caam_sm: [0024] 00 00 00 00 00 00 00 00
- platform caam_sm: [0032] 00 00 00 00 00 00 00 00
- platform caam_sm: [0040] 00 00 00 00 00 00 00 00
- platform caam_sm: [0048] 00 00 00 00 00 00 00 00
- platform caam_sm: [0056] 00 00 00 00 00 00 00 00
- platform caam_sm: [0064] 00 00 00 00 00 00 00 00
- platform caam_sm: [0072] 00 00 00 00 00 00 00 00
- platform caam_sm: [0080] 00 00 00 00 00 00 00 00
- platform caam_sm: [0088] 00 00 00 00 00 00 00 00
- platform caam_sm: 128-bit unwritten blob:
- platform caam_sm: [0000] 00 00 00 00 00 00 00 00
- platform caam_sm: [0008] 00 00 00 00 00 00 00 00
- platform caam_sm: [0016] 00 00 00 00 00 00 00 00
- platform caam_sm: [0024] 00 00 00 00 00 00 00 00
- platform caam_sm: [0032] 00 00 00 00 00 00 00 00
- platform caam_sm: [0040] 00 00 00 00 00 00 00 00
- platform caam_sm: [0048] 00 00 00 00 00 00 00 00
- platform caam_sm: [0056] 00 00 00 00 00 00 00 00
- platform caam_sm: [0064] 00 00 00 00 00 00 00 00
- platform caam_sm: [0072] 00 00 00 00 00 00 00 00
- platform caam_sm: [0080] 00 00 00 00 00 00 00 00
- platform caam_sm: [0088] 00 00 00 00 00 00 00 00
- platform caam_sm: 196-bit unwritten blob:
- platform caam_sm: [0000] 00 00 00 00 00 00 00 00
- platform caam_sm: [0008] 00 00 00 00 00 00 00 00
- platform caam_sm: [0016] 00 00 00 00 00 00 00 00
- platform caam_sm: [0024] 00 00 00 00 00 00 00 00
- platform caam_sm: [0032] 00 00 00 00 00 00 00 00
- platform caam_sm: [0040] 00 00 00 00 00 00 00 00
- platform caam_sm: [0048] 00 00 00 00 00 00 00 00
- platform caam_sm: [0056] 00 00 00 00 00 00 00 00
- platform caam_sm: [0064] 00 00 00 00 00 00 00 00
- platform caam_sm: [0072] 00 00 00 00 00 00 00 00
- platform caam_sm: [0080] 00 00 00 00 00 00 00 00
- platform caam_sm: [0088] 00 00 00 00 00 00 00 00
- platform caam_sm: 256-bit unwritten blob:
- platform caam_sm: [0000] 00 00 00 00 00 00 00 00
- platform caam_sm: [0008] 00 00 00 00 00 00 00 00
- platform caam_sm: [0016] 00 00 00 00 00 00 00 00
- platform caam_sm: [0024] 00 00 00 00 00 00 00 00
- platform caam_sm: [0032] 00 00 00 00 00 00 00 00
- platform caam_sm: [0040] 00 00 00 00 00 00 00 00
- platform caam_sm: [0048] 00 00 00 00 00 00 00 00
- platform caam_sm: [0056] 00 00 00 00 00 00 00 00
- platform caam_sm: [0064] 00 00 00 00 00 00 00 00
- platform caam_sm: [0072] 00 00 00 00 00 00 00 00
- platform caam_sm: [0080] 00 00 00 00 00 00 00 00
- platform caam_sm: [0088] 00 00 00 00 00 00 00 00
- platform caam_sm: 64-bit black key in blob:
- platform caam_sm: [0000] c4 18 13 b8 8a 86 a9 b5
- platform caam_sm: [0008] 11 c2 63 60 69 e8 09 a9
- platform caam_sm: [0016] c6 88 4f 21 ef f8 04 47
- platform caam_sm: [0024] 52 2e 27 3a 46 b8 18 6b
- platform caam_sm: [0032] fb fd 67 09 85 0f ce e4
- platform caam_sm: [0040] e3 f4 50 1a 44 39 a6 47
- platform caam_sm: [0048] c1 b5 ff b7 58 a7 76 4c
- platform caam_sm: [0056] 00 00 00 00 00 00 00 00
- platform caam_sm: [0064] 00 00 00 00 00 00 00 00
- platform caam_sm: [0072] 00 00 00 00 00 00 00 00
- platform caam_sm: [0080] 00 00 00 00 00 00 00 00
- platform caam_sm: [0088] 00 00 00 00 00 00 00 00
- platform caam_sm: 128-bit black key in blob:
- platform caam_sm: [0000] b1 22 06 95 79 04 99 10
- platform caam_sm: [0008] 11 74 59 e5 01 78 76 e3
- platform caam_sm: [0016] c6 8c dc f0 80 dc 77 b0
- platform caam_sm: [0024] b5 13 c4 6e 52 6c 1a 66
- platform caam_sm: [0032] f3 4e 21 66 ae b4 52 9a
- platform caam_sm: [0040] ef 80 2b ec 4a 47 b4 3d
- platform caam_sm: [0048] 19 d8 0d e7 03 a1 66 5e
- platform caam_sm: [0056] 4b 14 cc cf 32 b4 a7 bb
- platform caam_sm: [0064] 00 00 00 00 00 00 00 00
- platform caam_sm: [0072] 00 00 00 00 00 00 00 00
- platform caam_sm: [0080] 00 00 00 00 00 00 00 00
- platform caam_sm: [0088] 00 00 00 00 00 00 00 00
- platform caam_sm: 192-bit black key in blob:
- platform caam_sm: [0000] 1b e1 f7 7d 63 d8 7d 2f
- platform caam_sm: [0008] 61 51 d3 d2 72 2f ef bf
- platform caam_sm: [0016] 48 1d 3a 30 94 f6 76 75
- platform caam_sm: [0024] 6a f8 76 5f c4 e3 94 cd
- platform caam_sm: [0032] d5 61 e4 ba 76 72 6d 68
- platform caam_sm: [0040] a4 c1 58 55 05 1e 95 2c
- platform caam_sm: [0048] c9 bb fd ad 55 35 7e b6
- platform caam_sm: [0056] b3 34 93 77 f5 3e 54 bd
- platform caam_sm: [0064] 91 a1 b5 92 5c 5b e3 e7
- platform caam_sm: [0072] 00 00 00 00 00 00 00 00
- platform caam_sm: [0080] 00 00 00 00 00 00 00 00
- platform caam_sm: [0088] 00 00 00 00 00 00 00 00
- platform caam_sm: 256-bit black key in blob:
- platform caam_sm: [0000] 41 a6 7f a1 e9 b6 78 fe
- platform caam_sm: [0008] 65 ae a1 56 c8 7d 7a 8f
- platform caam_sm: [0016] 07 30 3f 63 3a da 57 0f
- platform caam_sm: [0024] a7 fd a7 2d a1 2d 87 13
- platform caam_sm: [0032] 5c 78 5f 76 dc c8 6f 6f
- platform caam_sm: [0040] 55 8b 23 fa 30 e4 36 2c
- platform caam_sm: [0048] ee 56 e1 6b cb 8a 3a 7c
- platform caam_sm: [0056] b1 c2 8c a0 c8 e1 4f 1e
- platform caam_sm: [0064] 0f 02 e4 08 1f c4 ec 4c
- platform caam_sm: [0072] 09 86 06 33 c7 ef a6 3f
- platform caam_sm: [0080] 00 00 00 00 00 00 00 00
- platform caam_sm: [0088] 00 00 00 00 00 00 00 00
- platform caam_sm: restored 64-bit black key:
- platform caam_sm: [0000] 3c b3 13 1e 1e 08 f1 30
- platform caam_sm: [0008] 9f 60 5c 48 3f dc 9e 6a
- platform caam_sm: restored 128-bit black key:
- platform caam_sm: [0000] 7f f4 4c 90 63 24 c2 5b
- platform caam_sm: [0008] 63 ed 7f 20 12 8f 16 9f
- platform caam_sm: restored 192-bit black key:
- platform caam_sm: [0000] 45 bc e2 7d c6 61 34 6b
- platform caam_sm: [0008] d3 7d 88 4a 85 ea 57 c7
- platform caam_sm: [0016] 43 e1 e4 63 a3 9d 3c 37
- platform caam_sm: [0024] 53 3a 5e b5 35 be 33 42
- platform caam_sm: restored 256-bit black key:
- platform caam_sm: [0000] da 12 33 aa 0f 2f c3 2b
- platform caam_sm: [0008] d2 00 7b 9f 22 db 19 62
- platform caam_sm: [0016] 50 93 e7 01 eb e5 06 1a
- platform caam_sm: [0024] 52 70 89 17 de 5e 59 a1
- snvs-secvio 30370000.caam-snvs: can't get snvs clock
- snvs-secvio 30370000.caam-snvs: violation handlers armed - non-secure state
- u***core: registered new interface driver u***hid
- u***hid: USB HID core driver
- NET: Registered protocol family 26
- NET: Registered protocol family 10
- sit: IPv6 over IPv4 tunneling driver
- NET: Registered protocol family 17
- can: controller area network core (rev 20120528 abi 9)
- NET: Registered protocol family 29
- can: raw protocol (rev 20120528)
- can: broadcast manager protocol (rev 20120528 t)
- can: netlink gateway (rev 20130117) max_hops=1
- Bluetooth: RFCOMM TTY layer initialized
- Bluetooth: RFCOMM socket layer initialized
- Bluetooth: RFCOMM ver 1.11
- Bluetooth: BNEP (Ethernet Emulation) ver 1.3
- Bluetooth: BNEP filters: protocol multicast
- Bluetooth: BNEP socket layer initialized
- Bluetooth: HIDP (Human Interface Emulation) ver 1.2
- Bluetooth: HIDP socket layer initialized
- 8021q: 802.1Q VLAN Support v1.8
- Key type dns_resolver registered
- cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
- backlight supply power not found, using dummy regulator
- sgtl5000 3-000a: sgtl5000 revision 0x11
- sgtl5000 3-000a: Using internal LDO instead of VDDD
- asoc-simple-card sound: sgtl5000 <-> 308a0000.sai mapping ok
- backlight supply power not found, using dummy regulator
- input: gpio-keys as /devices/platform/gpio-keys/input/input4
- backlight supply power not found, using dummy regulator
- snvs_rtc 30370000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:01 UTC (1)
- wlreg_on: disabling
- ALSA device list:
- #0: imx7s-sgtl5000
- EXT3-fs (mmcblk2p2): error: couldn't mount because of unsupported optional features (240)
- EXT2-fs (mmcblk2p2): error: couldn't mount because of unsupported optional features (240)
- EXT4-fs (mmcblk2p2): mounted filesystem with ordered data mode. Opts: (null)
- VFS: Mounted root (ext4 filesystem) on device 179:2.
- devtmpfs: mounted
- Freeing unused kernel memory: 424K (80a64000 - 80ace000)
- INIT: version 2.88 booting
- Starting udev
- udevd[168]: starting version 3.1.5
- random: udevd urandom read with 14 bits of entropy available
- EXT4-fs (mmcblk2p2): re-mounted. Opts: data=ordered
- bootlogd: cannot allocate pseudo tty: No such file or directory
- Populating dev cache
- ALSA: Restoring mixer settings...
- No state is present for card imx7ssgtl5000
- Found hardware: "imx7s-sgtl5000" "" "" "" ""
- Hardware is initialized using a generic method
- No state is present for card imx7ssgtl5000
- Wed Sep 13 14:30:52 UTC 2017
- INIT: Entering runlevel: 5
- Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
- Starting Xserver
- Starting system message bus: dbus.
- Starting Connection Manager
- Starting OpenBSD Secure Shell server: sshd
- generating ssh RSA key...
- generating ssh ECDSA key...
- generating ssh DSA key...
- generating ssh ED25519 key...
- done.
- Starting rPCBind daemon...done.
- Starting bluetooth
- bluetoothd
- Starting syslogd/klogd: done
- * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
- ...done.
- Starting Telephony daemon
- Starting Linux NFC daemon
- qft Running local boot scripts (/etc/rc.local)dhd_module_init in
- Power-up adapter 'DHD generic adapter'
- wifi_platform_bus_enumerate device present 1
- mmc0: queuing unknown CIS tuple 0x80 (2 bytes)
- mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
- mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
- mmc0: queuing unknown CIS tuple 0x80 (7 bytes)
- mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
- mmc0: queuing unknown CIS tuple 0x80 (6 bytes)
- mmc0: new high speed SDIO card at address 0001
- backlight supply power not found, using dummy regulator
- backlight supply power not found, using dummy regulator
- backlight supply power not found, using dummy regulator
- F1 signature OK, socitype:0x1 chip:0xa9a6 rev:0x1 pkg:0x3
- DHD: dongle ram size is set to 524288(orig 524288) at 0x0
- wifi_platform_get_mac_addr
- CFG80211-ERROR) wl_setup_wiphy : Registering Vendor80211)
- wl_create_event_handler(): thread:wl_event_handler:2da started
- CFG80211-ERROR) wl_event_handler : tsk Enter, tsk = 0x88dc143c
- dhd_attach(): thread:dhd_watchdog_thread:2db started
- dhd_attach(): thread:dhd_dpc:2dc started
- dhd_deferred_work_init: work queue initialized
- Dongle Host Driver, version 1.141.88 (r)
- Compiled from
- Register interface [wlan0] MAC: 00:90:4c:11:22:33
- CFG80211-ERROR) wl_event_handler : was terminated
- wl_destroy_event_handler(): thread:wl_event_handler:2da terminated OK
- dhd_prot_ioctl : bus is down. we have nothing to do
- backlight supply power not found, using dummy regulator
- backlight supply power not found, using dummy regulator
- Dongle Host Driver, version 1.141.88 (r)
- Compiled from
- wl_android_wifi_on in
- mmc0: queuing unknown CIS tuple 0x80 (2 bytes)
- mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
- mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
- mmc0: queuing unknown CIS tuple 0x80 (7 bytes)
- F1 signature OK, socitype:0x1 chip:0xa9a6 rev:0x1 pkg:0x3
- DHD: dongle ram size is set to 524288(orig 524288) at 0x0
- dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
- dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
- wifi_platform_get_mac_addr
- Firmware up: op_mode=0x0005, MAC=60:f1:89:45:5c:4d
- Firmware version = wl0: Dec 11 2014 04:20:45 version 7.10.323.34 (r520360) FWID 01-ea2beeba
- dhd_wlfc_init(): successfully enabled bdcv2 tlv signaling, 79
- dhd_wlfc_init: query wlfc_mode succeed, fw_caps=0x1c
- dhd_wlfc_init(): wlfc_mode=0x1c, ret=0
- CFG80211-ERROR) wl_update_wiphybands : error reading vhtmode (-23)
- wl_create_event_handler(): thread:wl_event_handler:2e0 started
- CFG80211-ERROR) wl_event_handler : tsk Enter, tsk = 0x88dc143c
- Enter the network name (SSID)= CU_5CuJ
- Type the passphrase for the network and hit enter PSW= ydhfcnfx
- cat: can't open '/etc/wpasupplicant.conf': No such file or directory
- Successfully initialized wpa_supplicant
- rfkill: Cannot open RFKILL control device
- random: nonblocking pool is initialized
- udhcpc (v1.24.1) started
- Sending discover...
- CFG80211-ERROR) wl_notify_scan_status : scan is not ready
- CFG80211-ERROR) wl_cfg80211_connect : Connecting with68:8a:f0:4a:64:b8 channel (11) ssid "CU_5CuJ", len (7)
- wl_bss_connect_done succeeded with 68:8a:f0:4a:64:b8
- wl_bss_connect_done succeeded with 68:8a:f0:4a:64:b8
- Sending discover...
- Sending select for 192.168.1.6...
- Lease of 192.168.1.6 obtained, lease time 86400
- /etc/udhcpc.d/50default: Adding DNS 192.168.1.1
- You can now use the ping command to test your connection
- .
- Poky (Yocto Project Reference Distro) 2.1.3 imx7s-warp /dev/ttymxc0
- imx7s-warp login: root
- root@imx7s-warp:~#
- root@imx7s-warp:~#
- root@imx7s-warp:~#
- root@imx7s-warp:~# cat /sys/power/state
- freeze standby mem
- root@imx7s-warp:~# echo mem > /sys/power/state
- state_store call pm_suspend
- imx7_pm_valid
- PM: Syncing filesystems ... done.
- Freezing user space processes ... (elapsed 0.001 seconds) done.
- Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
- enter_state call suspend_devices_and_enter
- fxos8700_suspend
- [HXTP] himax852xes_suspend: Driver probe fail.
- PM: suspend of devices complete after 156.476 msecs
- PM: suspend devices took 0.160 seconds
- suspend_devices_and_enter call suspend_enter
- PM: late suspend of devices complete after 0.788 msecs
- PM: noirq suspend of devices complete after 0.754 msecs
- Disabling non-boot CPUs ...
- suspend_enter suspend_ops->enter(state)
- Turn off Mega/Fast mix in DSM
复制代码
warp7使用BC3370电池,其datasheet很容易从nxp的网站上下载。我认为应该从下面几个方面来分析电池:1)电池的容量,充电电压和电流范围,充放电保护机制;2)电池与CPU连接方法,充放电标志;3)CPU对电池电量,电压和电流检测机制。4)电池充放电曲线。
对于1和4来说主要是电池datasheet的研读,其实最好的方法是询问技术支持。对于2和3来说需要编程来实现具体功能。而对于BC3770来说我们可做的比较少。
- 在warp7上确定BC3770连接方式和充放电标志,见下图:这里需要注意的是原理图上显示i2c1,而实际编程中要使用i2c0。
|