AD102P开关机电路使用说明
一 原理
供电相关原理图如下:
开机逻辑:按下POWER_KEY,系统上电,上电后在代码层控制IO/PWR_ON输出高电平,保留系统供电使能
关机逻辑:系统保留环境后控制IO/PWR_ON输出低电平,系统掉电
二 配置
以ad102p_apus_v10_album_quickstart_nand_defconfig配置文件为例
2.1 uboot配置
修改文件ad100_gpio.c, 目录为bootloader/uboot-x2000/drivers/gpio/jz_gpio/ad100_gpio.c
末尾添加一句, 让pb21默认为高电平
2.2 kernel配置
保存后记得覆盖下原有kernel配置文件ad102p_module_base_album_nand_defconfig
bhu@bhu-PC:~/ad100/kernel/kernel$ cp .config arch/mips/configs/ad102p_module_base_album_nand_defconfig
2.3 dts配置
配置文件kernel配置ad102p_module_base_album_nand_defconfig,配置文件搜索dts文件为ad102p_module_base_album_nand.dts,修改该文件 , 控制poweroff时, pb21 拉低 .
修改后,重新编译系统
bhu@bhu-PC:~/ad100/build$ make ad102p_apus_v10_album_quickstart_nand_defconfig
bhu@bhu-PC:~/ad100/build$ make
三 验证
U-Boot SPL 2013.07-00324-g54ff6128e-dirty (Feb 19 2025 - 17:27:16) //长按POWER_KEY上电
V1.0.0 <2024/06/25>
ERROR EPC 3a3d0e73
CPA_CPAPCR:0300490d
CPM_CPMPCR:04b0490d
CPM_CPEPCR:0190510d
CPM_CPCCR:9a0b5410
DDR clk rate 900000000
DDR: W631GU6NG type is : DDR3
DDR_PAR of eFuse: 00000000 00000000
AD100 InnoPhy skew Settings...
451, VID=0x000000c8, PID=0x00000091
Uncompressing Linux...
Ok, booting the kernel.
[ 0.000000] Linux version 5.10.186+ (bhu@bhu-PC) (mips-linux-gnu-gcc (Ingenic Linux-Release5.1.9.sr02-Default_xburst2_glibc2.29 Fix: uclibc0.9.33.2 e6b2efb7a460ae93975997edb4fb1658230c5bec 2023.12-21 04:08:14)5
[ 0.000000] CPU0 RESET ERROR PC:3A3D0E73
[ 0.000000] printk: bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00132000 (Ingenic XBurst II)
[ 0.000000] FPU revision is: 00f32000
[ 0.000000] MSA revision is: 00002000
[ 0.000000] ddr_size: 128 MBytes
[ 0.000000] OF: fdt: No chosen node found, continuing without
[ 0.000000] MIPS: machine is ingenic,ad100
[ 0.000000] ingenic-dma 13660000.dma: IRQ pdmam not found
[ 0.000000] ingenic-dma 13420000.dma: IRQ pdmam not found
mount: mounting devpts on /dev/pts failed: No such device
Starting mdev... OK
/
UBI device number 1, total 128 LEBs (16252928 bytes, 15.5 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
Starting network: OK
#
#
#
#
#
# poweoff //执行关机
-/bin/sh: poweoff: not found
# poweroff
# Stopping network: OK
Stopping mdev... stopped process in pidfile '/var/run/mdev.pid' (pid 405)
OK
umount: tmpfs busy - remounted read-only
umount: devtmpfs busy - remounted read-only
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system poweroff
[ 12.761926] reboot: Power down //断电
U-Boot SPL 2013.07-00324-g54ff6128e-dirty (Feb 19 2025 - 17:27:16) //再次长按POWER_KEY上电,系统起来
V1.0.0 <2024/06/25>
ERROR EPC 383d0e33
CPA_CPAPCR:0300490d
CPM_CPMPCR:04b0490d
CPM_CPEPCR:0190510d
CPM_CPCCR:9a0b5410
DDR clk rate 900000000
DDR: W631GU6NG type is : DDR3
DDR_PAR of eFuse: 00000000 00000000
AD100 InnoPhy skew Settings...
451, VID=0x000000c8, PID=0x00000091
Uncompressing Linux...
Ok, booting the kernel.
[ 0.000000] Linux version 5.10.186+ (bhu@bhu-PC) (mips-linux-gnu-gcc (Ingenic Linux-Release5.1.9.sr02-Default_xburst2_glibc2.29 Fix: uclibc0.9.33.2 e6b2efb7a460ae93975997edb4fb1658230c5bec 2023.12-21 04:08:14)5
[ 0.000000] CPU0 RESET ERROR PC:383D0E33
[ 0.000000] printk: bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00132000 (Ingenic XBurst II)
[ 0.000000] FPU revision is: 00f32000
[ 0.000000] MSA revision is: 00002000
[ 0.000000] ddr_size: 128 MBytes
[ 0.000000] OF: fdt: No chosen node found, continuing without
[ 0.000000] MIPS: machine is ingenic,ad100
[ 0.000000] ingenic-dma 13660000.dma: IRQ pdmam not found
[ 0.000000] ingenic-dma 13420000.dma: