简体   繁体   中英

How to add GPIO to U-Boot SDK source?

I am tying to build u-boot but get this error:

LDS     u-boot.lds
LD      u-boot
common/built-in.o: In function `do_gpio':
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:186: undefined reference to `gpio_request'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:194: undefined reference to `gpio_direction_input'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:195: undefined reference to `gpio_get_value'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:200: undefined reference to `gpio_get_value'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:203: undefined reference to `gpio_direction_output'
/media/saleh/NEWVOLUME/SDK/n-amlogic/uboot/build/../common/cmd_gpio.c:209: undefined reference to `gpio_free'
Segmentation fault (core dumped)
make[1]: *** [u-boot] Error 139
make: *** [sub-make] Error 2

I searched the issue and the guide was as :

GPIO is part of minimum configuration of your soc system, trying to add it in your system and rebuild.

But HOW I can add GPIO to the SDK? I am using arm64 architecture with p212 reference board. Thanks.

This is all it takes me to compile U-Boot for the P212 board:

sudo apt-get install gcc-aarch64-linux-gnu
git clone http://git.denx.de/u-boot.git
cd u-boot
git checkout v2018.05
export CROSS_COMPILE=aarch64-linux-gnu-
make mrproper
make p212_defconfig
make

For verified boot you need a FIT image. Enable CONFIG_FIT using

make menuconfig

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM