eewiki / u-boot-patches

44 stars 28 forks source link

Only looks in one place for cape dtb #5

Closed dlech closed 8 years ago

dlech commented 8 years ago

I have a cape that I would like to use with capemanager disabled. I have the appropriate am335x-boneblack-evb.dtb file working the way I want. I would like to be able to just set cape=evb in /uEnv.txt. This worked on 2015.01 if the file was at /dtbs/am335x-boneblack-evb.dtb. On 2016.01, fdtdir is no longer set to a default value, so the file has to be at /am335x-boneblack-evb.dtb. So, question 1: Was this change intentional?

Later on, in uname_boot, it looks for fdtfile in about 7 different places. It seems like the search for ${fdtbase}-${cape}.dtb ought to be looking in all of these same places instead of just one place.

Question 2: Is this a reasonable thing to do or am I going about this all wrong?

RobertCNelson commented 8 years ago

Use

dtb=am335x-boneblack-evb.dtb

The "cape=xyz" was a quick hack in the 3.14.x days, it quickly multiplied exponentially once clone boards started arriving. Besides we have a pretty solid cape_manager in 4.1.x -> 4.5.x right now..

Regards,

dlech commented 8 years ago

I'm hoping to make an image for public distribution that works on Black/Green without intervention. I maintain similar images for RPi and LEGO MINDSTORMS EV3 that don't use cape_manager, so I'm trying to keep them as similar as possible which is why I opted to not use cape_manager. Sounds like I should avoid using cape= though.

RobertCNelson commented 8 years ago

darn it, now your giving me a good reason to bring it back. ;)

dlech commented 8 years ago

Good enough that I should submit a patch?

RobertCNelson commented 8 years ago

Give this a test:

http://rcn-ee.homeip.net:81/farm/testing/MLO-am335x_evm-v2016.01-r6
http://rcn-ee.homeip.net:81/farm/testing/u-boot-am335x_evm-v2016.01-r6.img

https://github.com/RobertCNelson/Bootloader-Builder/commit/fa8eb61d803c200ec8db652ee666ace1a120772c

edit: wrong "u-boot.img, the x15 wouldn't boot" ;)

RobertCNelson commented 8 years ago

btw, if that works fine, i'll probally just revere the order, so "dtb=${dtb}" get's set last so it can be the master override.. and add an echo 'debug cape=xyz overide' message..

dlech commented 8 years ago

hmm...

U-Boot SPL 2016.01-00001-gda39f84 (Jan 25 2016 - 18:31:54)
Trying to boot from MMC
bad magic

Was ...beagle_x15_ti-v2015.07-r24.img on purpose?

dlech commented 8 years ago

Awesome. That did the job. I'll let you close the issue when you have switched the order.

Here's the full output of u-boot just for the record.

U-Boot 2016.01-00001-gda39f84 (Jan 25 2016 - 18:31:54 -0600)

       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
Reset Source: Power-on reset has occurred.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
reading uEnv.txt
50 bytes read in 3 ms (15.6 KiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from uEnv.txt
Importing environment from mmc ...
using: am335x-boneblack.dtb...
Checking if uenvcmd is set ...
Checking if client_ip is set ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
123 bytes read in 20 ms (5.9 KiB/s)
Loaded environment from /boot/uEnv.txt
using: dtb=am335x-boneblack-evb.dtb ...
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-4.1.13-ti-r38-10-rc1-ev3dev-bb.org ...
8321632 bytes read in 468 ms (17 MiB/s)
loading /usr/lib/linux-image-4.1.13-ti-r38-10-rc1-ev3dev-bb.org/am335x-boneblack-evb.dtb ...
63418 bytes read in 157 ms (393.6 KiB/s)
loading /boot/initrd.img-4.1.13-ti-r38-10-rc1-ev3dev-bb.org ...
4110823 bytes read in 242 ms (16.2 MiB/s)
debug: [console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait] ...
debug: [bootz 0x82000000 0x88080000:3eb9e7 0x88000000] ...
Kernel image @ 0x82000000 [ 0x000000 - 0x7efa60 ]
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Ramdisk to 8fc14000, end 8ffff9e7 ... OK
   Loading Device Tree to 8fc01000, end 8fc137b9 ... OK

Starting kernel ...