Re: [beagleboard] How to enable USB power with u-boot?

2017-07-20 Thread Sergey Manucharian
I've found the problem: the USB flash drive I used was USB-3!
Everything works as expected with USB-2 devices.

On Saturday, July 1, 2017 at 2:42:30 PM UTC-6, RobertCNelson wrote:
>
> Exactly, 'it' knows... USB should be enabled and powered up by default for 
> us.. like I said.. u-boot bug...
>
> On Jul 1, 2017 1:24 PM, "Sergey Manucharian"  > wrote:
>
> Most likely you're right assuming that u-boot must be aware of what 
> particular CPU it's dealing with (otherwise it's not possible since there 
> is no standard API for such things as USB power).
>
>
> On Saturday, July 1, 2017 at 9:19:42 AM UTC-6, RobertCNelson wrote:
>>
>> Then that's a u-boot bug, usb should be on after USB start.
>>
> -- 
> For more options, visit http://beagleboard.org/discuss
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to beagleboard...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/beagleboard/5ac39192-d913-4ec9-9c11-9fa0459ed499%40googlegroups.com
>  
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/c31624dc-cfb0-4ed7-a4ad-87305cc91827%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-07-01 Thread Robert Nelson
Exactly, 'it' knows... USB should be enabled and powered up by default for
us.. like I said.. u-boot bug...

On Jul 1, 2017 1:24 PM, "Sergey Manucharian"  wrote:

Most likely you're right assuming that u-boot must be aware of what
particular CPU it's dealing with (otherwise it's not possible since there
is no standard API for such things as USB power).


On Saturday, July 1, 2017 at 9:19:42 AM UTC-6, RobertCNelson wrote:
>
> Then that's a u-boot bug, usb should be on after USB start.
>
-- 
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/beagleboard/5ac39192-d913-4ec9-9c11-9fa0459ed499%40googlegroups.com

.

For more options, visit https://groups.google.com/d/optout.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYjKK0KQx6swuq7zHifcUc_RV2Ru9RqL34e9MnCeMaE%2BAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-07-01 Thread Sergey Manucharian
Robert is right, it must be a u-boot bug, these treads below are evidences 
of a proper (more or less) work in the past, in particular, the register 
mentioned above, is defined.

http://u-boot.10912.n7.nabble.com/PATCH-v3-0-3-AM335x-Add-USB-support-in-u-boot-td127575.html
http://u-boot.10912.n7.nabble.com/USB-Host-not-enumerating-properly-on-AM335x-based-board-td196920.html

Since I'll be traveling the next 10 days, will not be able to try different 
versions or look into u-boot's code...
Will report the results later.

On Saturday, July 1, 2017 at 12:24:23 PM UTC-6, Sergey Manucharian wrote:
>
> Most likely you're right assuming that u-boot must be aware of what 
> particular CPU it's dealing with (otherwise it's not possible since there 
> is no standard API for such things as USB power).
>
> On Saturday, July 1, 2017 at 9:19:42 AM UTC-6, RobertCNelson wrote:
>>
>> Then that's a u-boot bug, usb should be on after USB start.
>>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/973910ef-a463-403e-a66d-e7c93af00948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-07-01 Thread Robert Nelson
Then that's a u-boot bug, usb should be on after USB start.

On Jul 1, 2017 10:03 AM, "Sergey Manucharian"  wrote:

> Thanks, Robert!
>
> However, those "loads" just copy kernel/dtb into RAM for subsequent use,
> they are not going to change the CPU configuration at u-boot level. They
> cannot turn on the USB power until the control is passed to the kernel.
> That way works: I load kernel and dtbs from eMMC, but tell them
> "root=/dev/sda1 rootwait" (i.e. USB drive), so the kernel enables the USB
> power, then mount the USB stick. With this approach you cannot load a
> kernel *from* USB drive.
>
> On Saturday, July 1, 2017 at 8:50:01 AM UTC-6, RobertCNelson wrote:
>>
>> On Fri, Jun 30, 2017 at 11:04 PM, Sergey Manucharian 
>> wrote:
>> > Oh, thanks, William, I was inspired doing this by your post!
>> >
>> > The problem is that "usb start" starts u-boot's USB subsystem, it
>> (probably)
>> > has nothing to do with the CPU.
>> > You explicitly mentioned that used a USB HDD with external power
>> supply, but
>> > I'm trying to boot off a USB flash drive. The CPU doesn't provide USB
>> power
>> > at early stage. If I provide power from an external source, everything
>> works
>> > fine.
>> >
>> > The latest u-boot supports loading overlays, I'm not sure whether it's
>> > possible to load an overlays with the correct configuration of that pin
>> and
>> > then load kernel and stuff from USB flash drive.
>>
>> Why not?
>>
>> zImage:
>>
>> "loadimage=load ${devtype} ${bootpart} ${loadaddr}
>> ${bootdir}/${bootfile}\0" \
>>
>> https://github.com/eewiki/u-boot-patches/blob/master/v2017.
>> 07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L507
>>
>> overlay:
>>
>> "load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay}; " \
>>
>> https://github.com/eewiki/u-boot-patches/blob/master/v2017.
>> 07-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch#L800
>>
>> both use the devtype & bootpart references..  Thus if the kernel/dtb
>> are on the same partition of the usb flash drive as the overlays,
>> everything just works..
>>
>> But, you'll need to add the usb options here:
>>
>> https://github.com/eewiki/u-boot-patches/blob/master/v2017.
>> 07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L277
>>
>> Regards,
>>
>> --
>> Robert Nelson
>> https://rcn-ee.com/
>>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beagleboard/8fe903c1-9d73-42b5-888a-9b49653aaa56%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYi%3DNOU%2BOEQ_0KOoj_pVAHJWcjCggJipm_amzsZTbpJ49A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-07-01 Thread Sergey Manucharian
Thanks, Robert!

However, those "loads" just copy kernel/dtb into RAM for subsequent use, 
they are not going to change the CPU configuration at u-boot level. They 
cannot turn on the USB power until the control is passed to the kernel. 
That way works: I load kernel and dtbs from eMMC, but tell them 
"root=/dev/sda1 rootwait" (i.e. USB drive), so the kernel enables the USB 
power, then mount the USB stick. With this approach you cannot load a 
kernel *from* USB drive.

On Saturday, July 1, 2017 at 8:50:01 AM UTC-6, RobertCNelson wrote:
>
> On Fri, Jun 30, 2017 at 11:04 PM, Sergey Manucharian  > wrote: 
> > Oh, thanks, William, I was inspired doing this by your post! 
> > 
> > The problem is that "usb start" starts u-boot's USB subsystem, it 
> (probably) 
> > has nothing to do with the CPU. 
> > You explicitly mentioned that used a USB HDD with external power supply, 
> but 
> > I'm trying to boot off a USB flash drive. The CPU doesn't provide USB 
> power 
> > at early stage. If I provide power from an external source, everything 
> works 
> > fine. 
> > 
> > The latest u-boot supports loading overlays, I'm not sure whether it's 
> > possible to load an overlays with the correct configuration of that pin 
> and 
> > then load kernel and stuff from USB flash drive. 
>
> Why not? 
>
> zImage: 
>
> "loadimage=load ${devtype} ${bootpart} ${loadaddr} 
> ${bootdir}/${bootfile}\0" \ 
>
>
> https://github.com/eewiki/u-boot-patches/blob/master/v2017.07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L507
>  
>
> overlay: 
>
> "load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay}; " \ 
>
>
> https://github.com/eewiki/u-boot-patches/blob/master/v2017.07-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch#L800
>  
>
> both use the devtype & bootpart references..  Thus if the kernel/dtb 
> are on the same partition of the usb flash drive as the overlays, 
> everything just works.. 
>
> But, you'll need to add the usb options here: 
>
>
> https://github.com/eewiki/u-boot-patches/blob/master/v2017.07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L277
>  
>
> Regards, 
>
> -- 
> Robert Nelson 
> https://rcn-ee.com/ 
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/8fe903c1-9d73-42b5-888a-9b49653aaa56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-07-01 Thread Robert Nelson
On Fri, Jun 30, 2017 at 11:04 PM, Sergey Manucharian  wrote:
> Oh, thanks, William, I was inspired doing this by your post!
>
> The problem is that "usb start" starts u-boot's USB subsystem, it (probably)
> has nothing to do with the CPU.
> You explicitly mentioned that used a USB HDD with external power supply, but
> I'm trying to boot off a USB flash drive. The CPU doesn't provide USB power
> at early stage. If I provide power from an external source, everything works
> fine.
>
> The latest u-boot supports loading overlays, I'm not sure whether it's
> possible to load an overlays with the correct configuration of that pin and
> then load kernel and stuff from USB flash drive.

Why not?

zImage:

"loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \

https://github.com/eewiki/u-boot-patches/blob/master/v2017.07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L507

overlay:

"load ${devtype} ${bootpart} ${rdaddr} ${uboot_overlay}; " \

https://github.com/eewiki/u-boot-patches/blob/master/v2017.07-rc2/0002-U-Boot-BeagleBone-Cape-Manager.patch#L800

both use the devtype & bootpart references..  Thus if the kernel/dtb
are on the same partition of the usb flash drive as the overlays,
everything just works..

But, you'll need to add the usb options here:

https://github.com/eewiki/u-boot-patches/blob/master/v2017.07-rc2/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch#L277

Regards,

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

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYj57u-peKX_BgFJJYTzhbVgRkWDbZ7TU4Dw39UoMOxFsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-06-30 Thread William Hermans
On Fri, Jun 30, 2017 at 9:04 PM, Sergey Manucharian  wrote:

> Oh, thanks, William, I was inspired doing this by your post!
>

Oh, cool ! Glad someone reads my stuff now and then ;)

>
> The problem is that "usb start" starts *u-boot*'s USB subsystem, it
> (probably) has nothing to do with the CPU.
> You explicitly mentioned that used a USB HDD with external power supply,
> but I'm trying to boot off a USB flash drive. The CPU doesn't provide USB
> power at early stage. If I provide power from an external source,
> everything works fine.
>

Right so in that case, I explicitly mentioned using external power for a
hard drive. As many hard drives need at least 1-3A when spinning up, then
typically for a 3.5" HDD 1A after that. I just assumed that flash stick
would / should work, because most of them are pulling less than 500mA, or
is what I'd guess at any rate. However, you tested it seems, where I did
not.

>
> The latest u-boot supports loading overlays, I'm not sure whether it's
> possible to load an overlays with the correct configuration of that pin and
> *then* load kernel and stuff from USB flash drive.
>

So I do not know all the specifics, and quite honestly Robert would
probably know better than I. But *maybe* there is a way you can create a
new overlay, based on the board file, to get the USB power up. A lot of
overlays are already set in the board file by default, or more specifically
references to hardware are in the board file, and in some cases all you
need to do is write an overlay that targets the hardware in question, and
provide status="okay". With that said. . . I'm not 100% sure how soon the
overlays get loaded. As in if they're actually loaded in uboot, or if
they're somehow loaded just prior, or simotaneously when the kernel is
loaded via cmdline options.

It's a really interesting problem to solve, one that I'd like to figure out
myself - even.  If only I were not already busy with a ton of things at
work :/ Which, yeah, I'll probably be spending part of my weekend doing too
. . .

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORpS-ATaFN8Dx-Gytn-RWF9oiyXUoHkx_8prmt2Ajt607g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-06-30 Thread Sergey Manucharian
Oh, thanks, William, I was inspired doing this by your post!

The problem is that "usb start" starts *u-boot*'s USB subsystem, it 
(probably) has nothing to do with the CPU.
You explicitly mentioned that used a USB HDD with external power supply, 
but I'm trying to boot off a USB flash drive. The CPU doesn't provide USB 
power at early stage. If I provide power from an external source, 
everything works fine.

The latest u-boot supports loading overlays, I'm not sure whether it's 
possible to load an overlays with the correct configuration of that pin and 
*then* load kernel and stuff from USB flash drive.

On Friday, June 30, 2017 at 9:46:27 PM UTC-6, William Hermans wrote:
>
>
>
> On Fri, Jun 30, 2017 at 7:50 PM, Sergey Manucharian  > wrote:
>
>> From this thread https://e2e.ti.com/support/arm/sitara_arm/f/791/t/270060
>> :
>> Modifying bit 0 of 8 bit register address 0x47401C60 it switch on/off 
>> USB1_DRVVBUS pin
>>
>
> But I don't think you have to do all that. Read my post from nearly 4 
> years ago here: 
> http://www.embeddedhobbyist.com/2013/07/beaglebone-black-usb-boot/
>
> Scroll down where I talk about uEnv.txt. "usb start" should initiate 
> power, and the driver. Note that I'm calling it first before loading files 
> over USB. If you require in depth details, you'll have to read through the 
> source code. But I might be able to answer *some* questions. I'm by no 
> means a uboot expert.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/cbb243a0-bb18-4fec-b9b9-d407aae15166%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-06-30 Thread William Hermans
On Fri, Jun 30, 2017 at 7:50 PM, Sergey Manucharian  wrote:

> From this thread https://e2e.ti.com/support/arm/sitara_arm/f/791/t/270060:
> Modifying bit 0 of 8 bit register address 0x47401C60 it switch on/off
> USB1_DRVVBUS pin
>

But I don't think you have to do all that. Read my post from nearly 4 years
ago here: http://www.embeddedhobbyist.com/2013/07/beaglebone-black-usb-boot/

Scroll down where I talk about uEnv.txt. "usb start" should initiate power,
and the driver. Note that I'm calling it first before loading files over
USB. If you require in depth details, you'll have to read through the
source code. But I might be able to answer *some* questions. I'm by no
means a uboot expert.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORr9Me_7hnr%2BU%3Dmciv-RUi-Qu4YVG-MatjZJwAiYPsKGmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-06-30 Thread Sergey Manucharian
>From this thread https://e2e.ti.com/support/arm/sitara_arm/f/791/t/270060:
Modifying bit 0 of 8 bit register address 0x47401C60 it switch on/off 
USB1_DRVVBUS pin

Is it possible to do from u-boot environment or I'll need to modify u-boot 
source code?

On Friday, June 30, 2017 at 1:19:54 PM UTC-6, Sergey Manucharian wrote:
>
> That's exactly what I do, it works fine, the problem is that the USB has 
> no power at that time, I have to use an external power supply.
>
> On Friday, June 30, 2017 at 1:16:08 PM UTC-6, RobertCNelson wrote:
>>
>>
>> Once you boot into "U-Boot" from the microSD/eMMC, load the files from 
>> the USB flash drive and jump into that rootfs.. 
>>
>> Regards, 
>>
>> -- 
>> Robert Nelson 
>> https://rcn-ee.com/ 
>>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/8d48e174-6fd4-43b0-89eb-282e22670622%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-06-30 Thread Sergey Manucharian
That's exactly what I do, it works fine, the problem is that the USB has no 
power at that time, I have to use an external power supply.

On Friday, June 30, 2017 at 1:16:08 PM UTC-6, RobertCNelson wrote:
>
>
> Once you boot into "U-Boot" from the microSD/eMMC, load the files from 
> the USB flash drive and jump into that rootfs.. 
>
> Regards, 
>
> -- 
> Robert Nelson 
> https://rcn-ee.com/ 
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/c0aa0f4d-b52a-464b-8433-2f344274b268%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [beagleboard] How to enable USB power with u-boot?

2017-06-30 Thread Robert Nelson
On Fri, Jun 30, 2017 at 1:21 PM, Sergey Manucharian  wrote:
> I'd like to use uboot's USB subsystem to boot off a USB flash drive.
> However, the USB power is disabled at boot/reset. When I provide external
> power everything works as expected,
>
> So, how to enable USB power at CPU power-up/reset or with u-boot itself?
> Thanks for advises!

Once you boot into "U-Boot" from the microSD/eMMC, load the files from
the USB flash drive and jump into that rootfs..

Regards,

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

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYgxUsJj3o6kov96Op2N2P6%2BU-4aTBpHNBOJf%2BeQJxLYvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] How to enable USB power with u-boot?

2017-06-30 Thread Sergey Manucharian
I'd like to use uboot's USB subsystem to boot off a USB flash drive.
However, the USB power is disabled at boot/reset. When I provide external 
power everything works as expected,

So, how to enable USB power at CPU power-up/reset or with u-boot itself?
Thanks for advises!

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/552eb732-1d94-478c-9b7d-7787bdbe9020%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.