Topic: my uboot compilation experience

/me wraps novena in green sweater and stuffs in yellow backpack && hops on bicycle and pedals to hills

-my discovery-

upon returning home, unstuffing and unwrapping the system, it was found to have booted but was unresponsive to input

-my goal-

prevent system from booting when wrapped and stuffed

-my options-

parsing through my brain, i pondered what a good method of determining "is wrapped and stuffed"
thinking of the magnetic switch (lidsense), i decided it was reasonable to prevent my machine from booting in the case that the lid is closed
learning that the power supply (senoko) is not wired up directly to the magnetic sensor, i researched my options
upon contemplation and investigation, novena's bootloader (uboot) was selected for implementation

-my idea-

use magentic switch on lidsense_v1 to determine at boot if init or poweroff
looked at schematics ;schematics bunniefoo.com/novena/pvt2_release/SCH-novena_pvt2.PDF (page 16)
    found front panel
        found magnetic sensor
            got 'key_col3'
looked at translation instructions ;wiki kosagi.com/w/index.php?title=Definitive_GPIO_guide
    found mapping: KEY_COL3 => GPIO4_IO12
        found formula: (+ (* (- GPIO_BANK 1) 32) GPIO_BIT)
            calculated: (+ (* (- 4 1) 32) 12) => 108
                export gpio pin: echo 108 > /sys/class/gpio/export; => echo: write error: Device or resource busy
add to booting sequence (uboot) to check gpio pin 108 and if _high_ send poweroff signal to senoko over i2c, else continue booting sequence

-my steps-

git clone https://github.com/xobs/u-boot-novena
cd u-boot-novena
#edit include/configs/novena.h
make novena_config
make
cp u-boot.img /boot/u-boot.img
cp SPL /boot/u-boot.spl
novena-install-spl

-----------------------------------------------
|git clone #see url above|
-----------------------------------------------
^ clone xobs's repository for novena uboot
----------------
|cd u-boot-novena|
----------------
^ change current path to u-boot-novena directory
------------------------------
|#edit include/configs/novena.h|
------------------------------
^ check gpio 108 if high at boot && send kill signal over i2c
------------------
|make novena_config|
------------------
^ generate .config for novena system ;do not know how to grab from current bootloader
----
|make|
----
^ compile all the things
------------------------------
|cp u-boot.img /boot/u-boot.img|
------------------------------
^ install uboot image
-----------------------
|cp SPL /boot/u-boot.spl|
-----------------------
^ install uboot spl
------------------
|novena-install-spl|
------------------
^ no seriously, install uboot spl ;writes to master boot record on internal microsd card

-my reboot-

successful boot with lid open, however also successful boot with lid closed

-my summary-

learned to rummage schematics and compile uboot, such is bonus.
unable to prevent system boot if lid is closed- contemplating open moves.
yet again to help those whom may have interest in reconfiguration, this time of their bootloader

-my postscript-

xobs actually solved this riddle;

Re: my uboot compilation experience

Hello,
Did you compile on the novena itself or you cross compiled from a x86_64 host?
Thanks

Re: my uboot compilation experience

Most likely on the novena itself.
Otherwise he would have had to specify the cross-compiler to use in the make commandline which he didn't.

Native compilation (what he did):

make novena_config
make

Cross-compilation:

make CROSS_COMPILE=arm-none-linux-gnueabi- novena_config
make CROSS_COMPILE=arm-none-linux-gnueabi-