linux - Using GPIO-Poweroff on a Raspberry Pi Compute Module with DAS U-Boot to turn off the PSU -
i've been trying gpio-poweroff switch off board psu using gpio no matter try, never seems work. if manually toggle gpio pin, device shuts down. if take stock raspbian-lite , add following line config.txt works. u-boot seems ignoring it. using raspbian lite 2017-07-5 latest mainline u-boot: git://git.denx.de/u-boot.git compiled rpi_defconfig.
dtoverlay=gpio-poweroff,gpiopin=6,active_low=1
with u-boot raspberry pi boots , works normally, shuts down never toggles gpio6. leaves psu running , way fix holding down power button @ least 5 seconds. know dt-blob.bin loaded , applied board has camera works correct dt-blob.bin.
at point out of ideas. have tried:
- updating linux kernel using rpi-update
- decompiling both gpio-poweroff.dtbo , dt-blob.bin. changing 0x1a 0x06 , 0x0 0x1 inside gpio -poweroff.dtbo, concatenating them , doesn't work.
- manually doing above , intertwining decompiled code.
- using
fdt addr
, ,fdt apply
inside boot.scr apply manually, didn't work because fdt_overlay_apply fdt_err_nospace , couldn't seem past this. - cloning linux , trying make dtsb, target doesn't exist.
- cloning linux/arch/arm/boot/dts, writing makefile , compiling them changes results in u-boot loading, raspbian loading gpio-poweroff not working.
- other attempts barely worth mentioning.
nothing try seems work, , i'm not sure go forward.
for reference, here of files in use:
boot.cmd:
#setting default bootargs setenv original_bootargs console=ttys0 console=tty1 rootfstype=ext4 fsck.repair=yes hdmi.audio=0 disp.screen0_output_mode=1920x1080p60:1280x720p60:800x600p60:edid rootwait panic=10 # console must ttys0 or not boot! # identify if using partition 2 or 3 if fatload mmc 0:1 ${loadaddr} swap; echo "using partition 3"; setenv partition 3; else echo "using partition 2"; setenv partition 2; fi # check recovery if fatload mmc 0:1 ${loadaddr} recovery; echo "using recovery partition"; setenv partition 4; fi #if gpio input 32 || fatload mmc 0:1 ${loadaddr} recovery; echo "using recovery partition"; setenv partition 4; fi # create empty file detect boot failures fatwrite mmc 0:1 ${kernel_addr_r} recovery 0 # set bootargs setenv bootargs "${original_bootargs} root=/dev/mmcblk0p${partition}" # load existing linux kernel ram echo loading partition ${partition} ext4load mmc 0:${partition} ${kernel_addr_r} kernel.img # boot kernel have loaded bootz ${kernel_addr_r} - ${fdt_addr}
not sure why, boots red , blue swapped, , @ low resolution. compiled mkimage -a arm -o linux -t script -c none -a 0x00000000 -e 0x00000000 -n "boot script" -d boot.cmd boot.scr
config.txt:
# more options , information see # http://rpf.io/configtxt # settings may impact device functionality. see link above details # uncomment if no picture on hdmi default "safe" mode #hdmi_safe=1 # uncomment if display has black border of unused pixels visible # , display can output without overscan disable_overscan=1 # uncomment following adjust overscan. use positive numbers if console # goes off screen, , negative if there border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment force console size. default display's size minus # overscan. #framebuffer_width=1280 #framebuffer_height=720 # uncomment if hdmi display not detected , composite being output #hdmi_force_hotplug=1 # uncomment force specific hdmi mode (this force vga) #hdmi_group=1 #hdmi_mode=1 # uncomment force hdmi mode rather dvi. can make audio work in # dmt (computer monitor) modes #hdmi_drive=2 # uncomment increase signal hdmi, if have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment composite pal #sdtv_mode=2 #uncomment overclock arm. 700 mhz default. #arm_freq=800 # uncomment or of these enable optional hardware interfaces dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on # uncomment enable lirc-rpi module #dtoverlay=lirc-rpi # additional overlays , parameters documented /boot/overlays/readme # enable audio (loads snd_bcm2835) #dtparam=audio=on gpu_mem=128 start_x=1 dtoverlay=gpio-poweroff,gpiopin=6,active_low=1 dtdebug=1
so, i've fixed compiling own bcm27***.dtb files following concatenated after original content:
/ { compatible = "brcm,bcm2709"; power_ctrl: power_ctrl { compatible = "gpio-poweroff"; gpios = <&gpio 6 1>; }; };
however, has broken gpio , i2c. isn't complete solution. next step restore original files, , try adding end of dt-blob.bin
Comments
Post a Comment