device tree overlay does not load while booting up

1,211 views
Skip to first unread message

Mrigendra Chaubey

unread,
May 13, 2018, 5:06:55 PM5/13/18
to BeagleBoard
root@arm:~# /opt/scripts/tools/version.sh
git:/opt/scripts/:[ef2c5982e3788e07d9ec4a3d23089dc5e5a3f9cd]
eeprom:[A335BNLT00C05315BBBK054D]
model:[TI_AM335x_BeagleBone_Black]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-dirty]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2015.01-00001-gb2412df]
kernel:[4.4.127-bone22]
device-tree-override:[loadxfdt=load mmc 0:1 ${fdtaddr} /boot/dtbs/${uname_r}/${fdtfile}]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-I2C2-ADXL-00A0.dtbo ]
pkg:[bb-cape-overlays]:[4.4.20171207.0-0rcnee1~stretch+20171207]

OVERLAY FILE

compiled overlay as
dtc -I dts -O dtb -o BB-I2C2-ADXL-00A0.dtbo -b 0 -@ BB-I2C2-ADXL-00A0.dts

kconfig file changes

DRIVER FILE
adxl34x-i2c.c

adxl34x.c

uEnv.txt

##This will work with: Angstrom's 2013.06.20 u-boot.
  
loadaddr=0x82000000
fdtaddr=0x88000000
rdaddr=0x88080000
  
initrd_high=0xffffffff
fdt_high=0xffffffff

#for single partitions:
mmcroot=/dev/mmcblk0p1
  
loadximage=load mmc 0:1 ${loadaddr} /boot/vmlinuz-${uname_r}
loadxfdt=load mmc 0:1 ${fdtaddr} /boot/dtbs/${uname_r}/${fdtfile}
loadxrd=load mmc 0:1 ${rdaddr} /boot/initrd.img-${uname_r}; setenv rdsize ${filesize}
loaduEnvtxt=load mmc 0:1 ${loadaddr} /boot/uEnv.txt ; env import -t ${loadaddr} ${filesize};
loadall=run loaduEnvtxt; run loadximage; run loadxfdt;
enable_uboot_overlays=1
uboot_overlay_addr0=/lib/firmware/BB-I2C2-ADXL-00A0.dtbo 
mmcargs=setenv bootargs console=tty0 console=${console} ${optargs} ${cape_disable} ${cape_enable} root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}
  
uenvcmd=run loadall; run mmcargs; bootz ${loadaddr} - ${fdtaddr}

KERNEL LOGS

I had this impression that cat slots will not work, because it was removed from kernel, but if my dtbo is working but its working ny compatible string match via of_ mechanism.
My objective was to strip down the i2c driver to bare minimum and make it load at boot time using device tree overlay.
I do not see my driver loaded after doing lsmod. Nor the probe print I have put in adxl34x.c probe.

Where am I wrong here? What did I miss.
I am only following this 




Mrigendra Chaubey

unread,
May 14, 2018, 8:53:10 AM5/14/18
to BeagleBoard
# cat /boot/uEnv.txt

uname_r=4.4.127-bone22
#uuid=
#dtb=

##BeagleBone Black/Green dtb's for v4.1.x (BeagleBone White just works..)

##BeagleBone Black: HDMI (Audio/Video) disabled:
#dtb=am335x-boneblack-emmc-overlay.dtb

##BeagleBone Black: eMMC disabled:
#dtb=am335x-boneblack-hdmi-overlay.dtb

##BeagleBone Black: HDMI Audio/eMMC disabled:
#dtb=am335x-boneblack-nhdmi-overlay.dtb

##BeagleBone Black: HDMI (Audio/Video)/eMMC disabled:
#dtb=am335x-boneblack-overlay.dtb

##BeagleBone Black: wl1835
#dtb=am335x-boneblack-wl1835mod.dtb

##BeagleBone Green: eMMC disabled
#dtb=am335x-bonegreen-overlay.dtb


###U-Boot Overlays###
###Master Enable
enable_uboot_overlays=1
###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/BB-I2C2-ADXL-00A0.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###Custom Cape
#dtb_overlay=/lib/firmware/<file4>.dtbo
###Disable auto loading of virtual capes (emmc/video/wireless)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
###Cape Universal Enable
#enable_uboot_cape_universal=1
###U-Boot fdt tweaks...
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable video=HDMI-A-1:1024x768@60e

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

Used below uEnv.txt instead and overlay is added while booting

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

Robert Nelson

unread,
May 14, 2018, 10:59:23 AM5/14/18
to Beagle Board, Mrigendra Chaubey
On Sun, May 13, 2018 at 4:06 PM, Mrigendra Chaubey
<mrigendr...@gmail.com> wrote:
> root@arm:~# /opt/scripts/tools/version.sh
> git:/opt/scripts/:[ef2c5982e3788e07d9ec4a3d23089dc5e5a3f9cd]
> eeprom:[A335BNLT00C05315BBBK054D]
> model:[TI_AM335x_BeagleBone_Black]
> bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-dirty]
> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2015.01-00001-gb2412df]

eMMC bootloader is too old, nuke that..

> kernel:[4.4.127-bone22]
> device-tree-override:[loadxfdt=load mmc 0:1 ${fdtaddr}
> /boot/dtbs/${uname_r}/${fdtfile}]
> uboot_overlay_options:[enable_uboot_overlays=1]
> uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-I2C2-ADXL-00A0.dtbo
> ]
> pkg:[bb-cape-overlays]:[4.4.20171207.0-0rcnee1~stretch+20171207]
>
> OVERLAY FILE
> https://pastebin.com/CsicZ046
>
> compiled overlay as
> dtc -I dts -O dtb -o BB-I2C2-ADXL-00A0.dtbo -b 0 -@ BB-I2C2-ADXL-00A0.dts
>
> kconfig file changes
> https://pastebin.com/e4hqXgmJ
>
> DRIVER FILE
> adxl34x-i2c.c
> https://pastebin.com/ef8Uh06D
>
> adxl34x.c
> https://pastebin.com/agcF9muC
>
> uEnv.txt

Nuke this file, it disables the u-boot overlay path..

Regards,

--
Robert Nelson
https://rcn-ee.com/

Mrigendra Chaubey

unread,
May 14, 2018, 11:28:31 AM5/14/18
to BeagleBoard
Hi Robert,

Yes I have removed this uEnv.txt and used another one that is here,


Now I am able to load overlay at boot and my driver also gets loaded. 
Just one thing I only see error logs in kernel boot up.
Reply all
Reply to author
Forward
0 new messages