mbox series

[0/2] omap4: panda: convert to device model

Message ID 20200602111909.29772-1-t-kristo@ti.com
Headers show
Series omap4: panda: convert to device model | expand

Message

Tero Kristo June 2, 2020, 11:19 a.m. UTC
Hi,

As there is looming death to OMAP4 Panda board u-boot support, I decided
to take a shot and convert it to device model myself. With these patches
it boots up fine, and there are no DM_SPL conversion complaints during
compile time anymore. I think USB ethernet does not work anymore with
this, but its better than dropping the support for the board completely.
USB itself appears working, so it should be relatively easy for someone
to fix the networking support if they need it.

-Tero


--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Comments

Jonathan Gray June 6, 2020, 7:49 a.m. UTC | #1
On Tue, Jun 02, 2020 at 02:19:07PM +0300, Tero Kristo wrote:
> Hi,
> 
> As there is looming death to OMAP4 Panda board u-boot support, I decided
> to take a shot and convert it to device model myself. With these patches
> it boots up fine, and there are no DM_SPL conversion complaints during
> compile time anymore. I think USB ethernet does not work anymore with
> this, but its better than dropping the support for the board completely.
> USB itself appears working, so it should be relatively easy for someone
> to fix the networking support if they need it.
> 
> -Tero

Thanks, OpenBSD still boots on PandaBoard ES with these changes.

USB Ethernet does not seem to work before your patches on 2020.04
"Net:   No ethernet found."

-U-Boot SPL 2020.04 (May 26 2020 - 09:37:17 -0600)
+U-Boot SPL 2020.07-rc3-00212-g83e9328144 (Jun 06 2020 - 17:18:39 +1000)
 OMAP4460-GP ES1.1
 Trying to boot from MMC1
-SPL: Please implement spl_start_uboot() for your board
-SPL: Direct Linux boot not active!
+spl_load_image_fat_os: error reading image args, err - -2
 
 
-U-Boot 2020.04 (May 26 2020 - 09:37:17 -0600)
+U-Boot 2020.07-rc3-00212-g83e9328144 (Jun 06 2020 - 17:18:39 +1000)
 
 CPU  : OMAP4460-GP ES1.1
+Model: TI OMAP4 PandaBoard
 Board: OMAP4 Panda
 I2C:   ready
 DRAM:  1 GiB
@@ -23,67 +23,58 @@ SD/MMC found on device 0
 switch to partitions #0, OK
 mmc0 is current device
 Scanning mmc 0:1...
-83524 bytes read in 6 ms (13.3 MiB/s)
+83524 bytes read in 32 ms (2.5 MiB/s)
 Found EFI removable media binary efi/boot/bootarm.efi
-Scanning disks on usb...
-Disk usb0 not ready
-Disk usb1 not ready
-Disk usb2 not ready
-Disk usb3 not ready
-Scanning disks on mmc...
+Scanning disk mmc at 0.blk...
 ** Unrecognized filesystem type **
-MMC Device 1 not found
-MMC Device 2 not found
-MMC Device 3 not found
-Found 3 disks
 BootOrder not defined
 EFI boot manager: Cannot load any image
-105448 bytes read in 11 ms (9.1 MiB/s)
+105448 bytes read in 45 ms (2.2 MiB/s)
 disks: sd0*
 >> OpenBSD/armv7 BOOTARM 1.15
 boot>
-booting sd0a:/bsd: 4689044+688008+252268+562848-[254389+120+324848+288747]=0x0
+booting sd0a:/bsd: 4695860+688940+255424+565064\[254202+120+324848+288747]=0x0
 
 OpenBSD/armv7 booting ...


U-Boot SPL 2020.07-rc3-00212-g83e9328144 (Jun 06 2020 - 17:18:39 +1000)
OMAP4460-GP ES1.1
Trying to boot from MMC1
spl_load_image_fat_os: error reading image args, err - -2


U-Boot 2020.07-rc3-00212-g83e9328144 (Jun 06 2020 - 17:18:39 +1000)

CPU  : OMAP4460-GP ES1.1
Model: TI OMAP4 PandaBoard
Board: OMAP4 Panda
I2C:   ready
DRAM:  1 GiB
MMC:   OMAP SD/MMC: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

Net:   No ethernet found.
Hit any key to stop autoboot:  0
## Error: "init_console" not defined
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
83524 bytes read in 32 ms (2.5 MiB/s)
Found EFI removable media binary efi/boot/bootarm.efi
Scanning disk mmc at 0.blk...
** Unrecognized filesystem type **
BootOrder not defined
EFI boot manager: Cannot load any image
105448 bytes read in 45 ms (2.2 MiB/s)
disks: sd0*
>> OpenBSD/armv7 BOOTARM 1.15
boot>
booting sd0a:/bsd: 4695860+688940+255424+565064\[254202+120+324848+288747]=0x0

OpenBSD/armv7 booting ...
Lokesh Vutla June 14, 2020, 1:49 p.m. UTC | #2
Hi Tero,

On 02/06/20 4:49 pm, Tero Kristo wrote:
> Hi,
> 
> As there is looming death to OMAP4 Panda board u-boot support, I decided
> to take a shot and convert it to device model myself. With these patches
> it boots up fine, and there are no DM_SPL conversion complaints during
> compile time anymore. I think USB ethernet does not work anymore with
> this, but its better than dropping the support for the board completely.
> USB itself appears working, so it should be relatively easy for someone
> to fix the networking support if they need it.

I see the below warning with these patches:

board/ti/panda/panda.c:329:35: warning: ?struct ehci_hcor? declared inside parameter list will not be visible outside of this definition or declaration
  329 |   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
      |                                   ^~~~~~~~~
board/ti/panda/panda.c:329:10: warning: ?struct ehci_hccr? declared inside parameter list will not be visible outside of this definition or declaration
  329 |   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
      |          ^~~~~~~~~
board/ti/panda/panda.c: In function ?ehci_hcd_init?:
board/ti/panda/panda.c:339:8: warning: implicit declaration of function ?omap_ehci_hcd_init?; did you mean ?ehci_hcd_init?? [-Wimplicit-function-declaration]
  339 |  ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
      |        ^~~~~~~~~~~~~~~~~~
      |        ehci_hcd_init
board/ti/panda/panda.c: In function ?ehci_hcd_stop?:
board/ti/panda/panda.c:348:9: warning: implicit declaration of function ?omap_ehci_hcd_stop?; did you mean ?ehci_hcd_stop?? [-Wimplicit-function-declaration]
  348 |  return omap_ehci_hcd_stop();
      |         ^~~~~~~~~~~~~~~~~~
      |         ehci_hcd_stop


Thanks and regards,
Lokesh


> 
> -Tero
> 
> 
> --
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>
Tero Kristo June 15, 2020, 6:19 a.m. UTC | #3
On 14/06/2020 16:49, Lokesh Vutla wrote:
> Hi Tero,
> 
> On 02/06/20 4:49 pm, Tero Kristo wrote:
>> Hi,
>>
>> As there is looming death to OMAP4 Panda board u-boot support, I decided
>> to take a shot and convert it to device model myself. With these patches
>> it boots up fine, and there are no DM_SPL conversion complaints during
>> compile time anymore. I think USB ethernet does not work anymore with
>> this, but its better than dropping the support for the board completely.
>> USB itself appears working, so it should be relatively easy for someone
>> to fix the networking support if they need it.
> 
> I see the below warning with these patches:
> 
> board/ti/panda/panda.c:329:35: warning: ?struct ehci_hcor? declared inside parameter list will not be visible outside of this definition or declaration
>    329 |   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>        |                                   ^~~~~~~~~
> board/ti/panda/panda.c:329:10: warning: ?struct ehci_hccr? declared inside parameter list will not be visible outside of this definition or declaration
>    329 |   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>        |          ^~~~~~~~~
> board/ti/panda/panda.c: In function ?ehci_hcd_init?:
> board/ti/panda/panda.c:339:8: warning: implicit declaration of function ?omap_ehci_hcd_init?; did you mean ?ehci_hcd_init?? [-Wimplicit-function-declaration]
>    339 |  ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
>        |        ^~~~~~~~~~~~~~~~~~
>        |        ehci_hcd_init
> board/ti/panda/panda.c: In function ?ehci_hcd_stop?:
> board/ti/panda/panda.c:348:9: warning: implicit declaration of function ?omap_ehci_hcd_stop?; did you mean ?ehci_hcd_stop?? [-Wimplicit-function-declaration]
>    348 |  return omap_ehci_hcd_stop();
>        |         ^~~~~~~~~~~~~~~~~~
>        |         ehci_hcd_stop

Yeah, I actually see these also. I think we could maybe drop all the 
offending code as I did later with the omap5-uevm. On omap5, USB seemed 
to work even without these.

Maybe some USB expert can comment on these (Vignesh)?

-Tero

> 
> 
> Thanks and regards,
> Lokesh
> 
> 
>>
>> -Tero
>>
>>
>> --
>>

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Raghavendra, Vignesh June 15, 2020, 2:48 p.m. UTC | #4
On 15/06/20 11:49 am, Tero Kristo wrote:
> On 14/06/2020 16:49, Lokesh Vutla wrote:
>> Hi Tero,
>>
>> On 02/06/20 4:49 pm, Tero Kristo wrote:
>>> Hi,
>>>
>>> As there is looming death to OMAP4 Panda board u-boot support, I decided
>>> to take a shot and convert it to device model myself. With these patches
>>> it boots up fine, and there are no DM_SPL conversion complaints during
>>> compile time anymore. I think USB ethernet does not work anymore with
>>> this, but its better than dropping the support for the board completely.
>>> USB itself appears working, so it should be relatively easy for someone
>>> to fix the networking support if they need it.
>>
>> I see the below warning with these patches:
>>
>> board/ti/panda/panda.c:329:35: warning: ?struct ehci_hcor? declared
>> inside parameter list will not be visible outside of this definition
>> or declaration
>> ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>> ?????? |?????????????????????????????????? ^~~~~~~~~
>> board/ti/panda/panda.c:329:10: warning: ?struct ehci_hccr? declared
>> inside parameter list will not be visible outside of this definition
>> or declaration
>> ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>> ?????? |????????? ^~~~~~~~~
>> board/ti/panda/panda.c: In function ?ehci_hcd_init?:
>> board/ti/panda/panda.c:339:8: warning: implicit declaration of
>> function ?omap_ehci_hcd_init?; did you mean ?ehci_hcd_init??
>> [-Wimplicit-function-declaration]
>> ?? 339 |? ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
>> ?????? |??????? ^~~~~~~~~~~~~~~~~~
>> ?????? |??????? ehci_hcd_init
>> board/ti/panda/panda.c: In function ?ehci_hcd_stop?:
>> board/ti/panda/panda.c:348:9: warning: implicit declaration of
>> function ?omap_ehci_hcd_stop?; did you mean ?ehci_hcd_stop??
>> [-Wimplicit-function-declaration]
>> ?? 348 |? return omap_ehci_hcd_stop();
>> ?????? |???????? ^~~~~~~~~~~~~~~~~~
>> ?????? |???????? ehci_hcd_stop
> 
> Yeah, I actually see these also. I think we could maybe drop all the
> offending code as I did later with the omap5-uevm. On omap5, USB seemed
> to work even without these.
> 
> Maybe some USB expert can comment on these (Vignesh)?
> 


Offending code won't compile with DM_USB enabled. I suggest to drop them
for now in order to avoid entire board support from being dropped. USB
can be added back later if needed...

Or you would have to disable DM_USB give this a try..

Regards
Vignesh

> -Tero
> 
>>
>>
>> Thanks and regards,
>> Lokesh
>>
>>
>>>
>>> -Tero
>>>
>>>
>>> -- 
>>>
> 
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Tero Kristo June 15, 2020, 2:53 p.m. UTC | #5
On 15/06/2020 17:48, Vignesh Raghavendra wrote:
> 
> 
> On 15/06/20 11:49 am, Tero Kristo wrote:
>> On 14/06/2020 16:49, Lokesh Vutla wrote:
>>> Hi Tero,
>>>
>>> On 02/06/20 4:49 pm, Tero Kristo wrote:
>>>> Hi,
>>>>
>>>> As there is looming death to OMAP4 Panda board u-boot support, I decided
>>>> to take a shot and convert it to device model myself. With these patches
>>>> it boots up fine, and there are no DM_SPL conversion complaints during
>>>> compile time anymore. I think USB ethernet does not work anymore with
>>>> this, but its better than dropping the support for the board completely.
>>>> USB itself appears working, so it should be relatively easy for someone
>>>> to fix the networking support if they need it.
>>>
>>> I see the below warning with these patches:
>>>
>>> board/ti/panda/panda.c:329:35: warning: ?struct ehci_hcor? declared
>>> inside parameter list will not be visible outside of this definition
>>> or declaration
>>>  ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>>>  ?????? |?????????????????????????????????? ^~~~~~~~~
>>> board/ti/panda/panda.c:329:10: warning: ?struct ehci_hccr? declared
>>> inside parameter list will not be visible outside of this definition
>>> or declaration
>>>  ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>>>  ?????? |????????? ^~~~~~~~~
>>> board/ti/panda/panda.c: In function ?ehci_hcd_init?:
>>> board/ti/panda/panda.c:339:8: warning: implicit declaration of
>>> function ?omap_ehci_hcd_init?; did you mean ?ehci_hcd_init??
>>> [-Wimplicit-function-declaration]
>>>  ?? 339 |? ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
>>>  ?????? |??????? ^~~~~~~~~~~~~~~~~~
>>>  ?????? |??????? ehci_hcd_init
>>> board/ti/panda/panda.c: In function ?ehci_hcd_stop?:
>>> board/ti/panda/panda.c:348:9: warning: implicit declaration of
>>> function ?omap_ehci_hcd_stop?; did you mean ?ehci_hcd_stop??
>>> [-Wimplicit-function-declaration]
>>>  ?? 348 |? return omap_ehci_hcd_stop();
>>>  ?????? |???????? ^~~~~~~~~~~~~~~~~~
>>>  ?????? |???????? ehci_hcd_stop
>>
>> Yeah, I actually see these also. I think we could maybe drop all the
>> offending code as I did later with the omap5-uevm. On omap5, USB seemed
>> to work even without these.
>>
>> Maybe some USB expert can comment on these (Vignesh)?
>>
> 
> 
> Offending code won't compile with DM_USB enabled. I suggest to drop them
> for now in order to avoid entire board support from being dropped. USB
> can be added back later if needed...
> 
> Or you would have to disable DM_USB give this a try..

Yeah, dropping DM_USB USB stops working completely I believe. And, USB 
appears working (at least partially: usb start, usb info provides some 
sane data) with these two patches, just the compiler warnings are there.

However, I eliminated the offending code in v2 I posted today, and USB 
still appears functional as far as I can see. Trying to compile mass 
storage support in to test USB mass storage devices causes a mayhem so I 
left that for someone more experienced with USB.

-Tero

> 
> Regards
> Vignesh
> 
>> -Tero
>>
>>>
>>>
>>> Thanks and regards,
>>> Lokesh
>>>
>>>
>>>>
>>>> -Tero
>>>>
>>>>
>>>> -- 
>>>>
>>
>> -- 

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Tom Rini June 15, 2020, 2:57 p.m. UTC | #6
On Mon, Jun 15, 2020 at 05:53:39PM +0300, Tero Kristo wrote:
> On 15/06/2020 17:48, Vignesh Raghavendra wrote:
> > 
> > 
> > On 15/06/20 11:49 am, Tero Kristo wrote:
> > > On 14/06/2020 16:49, Lokesh Vutla wrote:
> > > > Hi Tero,
> > > > 
> > > > On 02/06/20 4:49 pm, Tero Kristo wrote:
> > > > > Hi,
> > > > > 
> > > > > As there is looming death to OMAP4 Panda board u-boot support, I decided
> > > > > to take a shot and convert it to device model myself. With these patches
> > > > > it boots up fine, and there are no DM_SPL conversion complaints during
> > > > > compile time anymore. I think USB ethernet does not work anymore with
> > > > > this, but its better than dropping the support for the board completely.
> > > > > USB itself appears working, so it should be relatively easy for someone
> > > > > to fix the networking support if they need it.
> > > > 
> > > > I see the below warning with these patches:
> > > > 
> > > > board/ti/panda/panda.c:329:35: warning: ?struct ehci_hcor? declared
> > > > inside parameter list will not be visible outside of this definition
> > > > or declaration
> > > >  ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> > > >  ?????? |?????????????????????????????????? ^~~~~~~~~
> > > > board/ti/panda/panda.c:329:10: warning: ?struct ehci_hccr? declared
> > > > inside parameter list will not be visible outside of this definition
> > > > or declaration
> > > >  ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> > > >  ?????? |????????? ^~~~~~~~~
> > > > board/ti/panda/panda.c: In function ?ehci_hcd_init?:
> > > > board/ti/panda/panda.c:339:8: warning: implicit declaration of
> > > > function ?omap_ehci_hcd_init?; did you mean ?ehci_hcd_init??
> > > > [-Wimplicit-function-declaration]
> > > >  ?? 339 |? ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
> > > >  ?????? |??????? ^~~~~~~~~~~~~~~~~~
> > > >  ?????? |??????? ehci_hcd_init
> > > > board/ti/panda/panda.c: In function ?ehci_hcd_stop?:
> > > > board/ti/panda/panda.c:348:9: warning: implicit declaration of
> > > > function ?omap_ehci_hcd_stop?; did you mean ?ehci_hcd_stop??
> > > > [-Wimplicit-function-declaration]
> > > >  ?? 348 |? return omap_ehci_hcd_stop();
> > > >  ?????? |???????? ^~~~~~~~~~~~~~~~~~
> > > >  ?????? |???????? ehci_hcd_stop
> > > 
> > > Yeah, I actually see these also. I think we could maybe drop all the
> > > offending code as I did later with the omap5-uevm. On omap5, USB seemed
> > > to work even without these.
> > > 
> > > Maybe some USB expert can comment on these (Vignesh)?
> > > 
> > 
> > 
> > Offending code won't compile with DM_USB enabled. I suggest to drop them
> > for now in order to avoid entire board support from being dropped. USB
> > can be added back later if needed...
> > 
> > Or you would have to disable DM_USB give this a try..
> 
> Yeah, dropping DM_USB USB stops working completely I believe. And, USB
> appears working (at least partially: usb start, usb info provides some sane
> data) with these two patches, just the compiler warnings are there.
> 
> However, I eliminated the offending code in v2 I posted today, and USB still
> appears functional as far as I can see. Trying to compile mass storage
> support in to test USB mass storage devices causes a mayhem so I left that
> for someone more experienced with USB.

Please note that DM_USB migration also has a deadline of almost a year
ago so this is another area to fix or remove-now-readd-later.  Thanks!
Tero Kristo June 15, 2020, 3:01 p.m. UTC | #7
On 15/06/2020 17:57, Tom Rini wrote:
> On Mon, Jun 15, 2020 at 05:53:39PM +0300, Tero Kristo wrote:
>> On 15/06/2020 17:48, Vignesh Raghavendra wrote:
>>>
>>>
>>> On 15/06/20 11:49 am, Tero Kristo wrote:
>>>> On 14/06/2020 16:49, Lokesh Vutla wrote:
>>>>> Hi Tero,
>>>>>
>>>>> On 02/06/20 4:49 pm, Tero Kristo wrote:
>>>>>> Hi,
>>>>>>
>>>>>> As there is looming death to OMAP4 Panda board u-boot support, I decided
>>>>>> to take a shot and convert it to device model myself. With these patches
>>>>>> it boots up fine, and there are no DM_SPL conversion complaints during
>>>>>> compile time anymore. I think USB ethernet does not work anymore with
>>>>>> this, but its better than dropping the support for the board completely.
>>>>>> USB itself appears working, so it should be relatively easy for someone
>>>>>> to fix the networking support if they need it.
>>>>>
>>>>> I see the below warning with these patches:
>>>>>
>>>>> board/ti/panda/panda.c:329:35: warning: ?struct ehci_hcor? declared
>>>>> inside parameter list will not be visible outside of this definition
>>>>> or declaration
>>>>>   ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>>>>>   ?????? |?????????????????????????????????? ^~~~~~~~~
>>>>> board/ti/panda/panda.c:329:10: warning: ?struct ehci_hccr? declared
>>>>> inside parameter list will not be visible outside of this definition
>>>>> or declaration
>>>>>   ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>>>>>   ?????? |????????? ^~~~~~~~~
>>>>> board/ti/panda/panda.c: In function ?ehci_hcd_init?:
>>>>> board/ti/panda/panda.c:339:8: warning: implicit declaration of
>>>>> function ?omap_ehci_hcd_init?; did you mean ?ehci_hcd_init??
>>>>> [-Wimplicit-function-declaration]
>>>>>   ?? 339 |? ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
>>>>>   ?????? |??????? ^~~~~~~~~~~~~~~~~~
>>>>>   ?????? |??????? ehci_hcd_init
>>>>> board/ti/panda/panda.c: In function ?ehci_hcd_stop?:
>>>>> board/ti/panda/panda.c:348:9: warning: implicit declaration of
>>>>> function ?omap_ehci_hcd_stop?; did you mean ?ehci_hcd_stop??
>>>>> [-Wimplicit-function-declaration]
>>>>>   ?? 348 |? return omap_ehci_hcd_stop();
>>>>>   ?????? |???????? ^~~~~~~~~~~~~~~~~~
>>>>>   ?????? |???????? ehci_hcd_stop
>>>>
>>>> Yeah, I actually see these also. I think we could maybe drop all the
>>>> offending code as I did later with the omap5-uevm. On omap5, USB seemed
>>>> to work even without these.
>>>>
>>>> Maybe some USB expert can comment on these (Vignesh)?
>>>>
>>>
>>>
>>> Offending code won't compile with DM_USB enabled. I suggest to drop them
>>> for now in order to avoid entire board support from being dropped. USB
>>> can be added back later if needed...
>>>
>>> Or you would have to disable DM_USB give this a try..
>>
>> Yeah, dropping DM_USB USB stops working completely I believe. And, USB
>> appears working (at least partially: usb start, usb info provides some sane
>> data) with these two patches, just the compiler warnings are there.
>>
>> However, I eliminated the offending code in v2 I posted today, and USB still
>> appears functional as far as I can see. Trying to compile mass storage
>> support in to test USB mass storage devices causes a mayhem so I left that
>> for someone more experienced with USB.
> 
> Please note that DM_USB migration also has a deadline of almost a year
> ago so this is another area to fix or remove-now-readd-later.  Thanks!
> 

Yeah, so with these patches, building u-boot for omap4 panda does not 
complain about any DM_xyz conversion deadlines anymore, does it mean we 
are clean? :)

-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Adam Ford June 15, 2020, 3:02 p.m. UTC | #8
On Mon, Jun 15, 2020 at 9:53 AM Tero Kristo <t-kristo at ti.com> wrote:
>
> On 15/06/2020 17:48, Vignesh Raghavendra wrote:
> >
> >
> > On 15/06/20 11:49 am, Tero Kristo wrote:
> >> On 14/06/2020 16:49, Lokesh Vutla wrote:
> >>> Hi Tero,
> >>>
> >>> On 02/06/20 4:49 pm, Tero Kristo wrote:
> >>>> Hi,
> >>>>
> >>>> As there is looming death to OMAP4 Panda board u-boot support, I decided
> >>>> to take a shot and convert it to device model myself. With these patches
> >>>> it boots up fine, and there are no DM_SPL conversion complaints during
> >>>> compile time anymore. I think USB ethernet does not work anymore with
> >>>> this, but its better than dropping the support for the board completely.
> >>>> USB itself appears working, so it should be relatively easy for someone
> >>>> to fix the networking support if they need it.
> >>>
> >>> I see the below warning with these patches:
> >>>
> >>> board/ti/panda/panda.c:329:35: warning: ?struct ehci_hcor? declared
> >>> inside parameter list will not be visible outside of this definition
> >>> or declaration
> >>>     329 |   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> >>>         |                                   ^~~~~~~~~
> >>> board/ti/panda/panda.c:329:10: warning: ?struct ehci_hccr? declared
> >>> inside parameter list will not be visible outside of this definition
> >>> or declaration
> >>>     329 |   struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> >>>         |          ^~~~~~~~~
> >>> board/ti/panda/panda.c: In function ?ehci_hcd_init?:
> >>> board/ti/panda/panda.c:339:8: warning: implicit declaration of
> >>> function ?omap_ehci_hcd_init?; did you mean ?ehci_hcd_init??
> >>> [-Wimplicit-function-declaration]
> >>>     339 |  ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
> >>>         |        ^~~~~~~~~~~~~~~~~~
> >>>         |        ehci_hcd_init
> >>> board/ti/panda/panda.c: In function ?ehci_hcd_stop?:
> >>> board/ti/panda/panda.c:348:9: warning: implicit declaration of
> >>> function ?omap_ehci_hcd_stop?; did you mean ?ehci_hcd_stop??
> >>> [-Wimplicit-function-declaration]
> >>>     348 |  return omap_ehci_hcd_stop();
> >>>         |         ^~~~~~~~~~~~~~~~~~
> >>>         |         ehci_hcd_stop
> >>
> >> Yeah, I actually see these also. I think we could maybe drop all the
> >> offending code as I did later with the omap5-uevm. On omap5, USB seemed
> >> to work even without these.
> >>
> >> Maybe some USB expert can comment on these (Vignesh)?
> >>
> >
> >
> > Offending code won't compile with DM_USB enabled. I suggest to drop them
> > for now in order to avoid entire board support from being dropped. USB
> > can be added back later if needed...
> >
> > Or you would have to disable DM_USB give this a try..
>
> Yeah, dropping DM_USB USB stops working completely I believe. And, USB
> appears working (at least partially: usb start, usb info provides some
> sane data) with these two patches, just the compiler warnings are there.
>
> However, I eliminated the offending code in v2 I posted today, and USB
> still appears functional as far as I can see. Trying to compile mass
> storage support in to test USB mass storage devices causes a mayhem so I
> left that for someone more experienced with USB.

I am not an expert at USB by any stretch of the imagination, but spent
a fair amount of time trying to port the omap-ehci and usbhs-host
drivers to work on the am3517-evm and the omap3_logic_somlv boards.  I
don't know how different omap3 and omap4 ehci and ushhs-host drivers
are, but their device tree notes are similar.  If you poke around the
code for the am3517-evm, or have one laying around somewhere, I would
expect the EHCI controller to be able to enumerate and mount a mass
storage device.  Using the aM3517 might help getting the omap4 USB
stuff working.

adam
>
> -Tero
>
> >
> > Regards
> > Vignesh
> >
> >> -Tero
> >>
> >>>
> >>>
> >>> Thanks and regards,
> >>> Lokesh
> >>>
> >>>
> >>>>
> >>>> -Tero
> >>>>
> >>>>
> >>>> --
> >>>>
> >>
> >> --
>
> --
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Tom Rini June 15, 2020, 3:06 p.m. UTC | #9
On Mon, Jun 15, 2020 at 06:01:00PM +0300, Tero Kristo wrote:
> On 15/06/2020 17:57, Tom Rini wrote:
> > On Mon, Jun 15, 2020 at 05:53:39PM +0300, Tero Kristo wrote:
> > > On 15/06/2020 17:48, Vignesh Raghavendra wrote:
> > > > 
> > > > 
> > > > On 15/06/20 11:49 am, Tero Kristo wrote:
> > > > > On 14/06/2020 16:49, Lokesh Vutla wrote:
> > > > > > Hi Tero,
> > > > > > 
> > > > > > On 02/06/20 4:49 pm, Tero Kristo wrote:
> > > > > > > Hi,
> > > > > > > 
> > > > > > > As there is looming death to OMAP4 Panda board u-boot support, I decided
> > > > > > > to take a shot and convert it to device model myself. With these patches
> > > > > > > it boots up fine, and there are no DM_SPL conversion complaints during
> > > > > > > compile time anymore. I think USB ethernet does not work anymore with
> > > > > > > this, but its better than dropping the support for the board completely.
> > > > > > > USB itself appears working, so it should be relatively easy for someone
> > > > > > > to fix the networking support if they need it.
> > > > > > 
> > > > > > I see the below warning with these patches:
> > > > > > 
> > > > > > board/ti/panda/panda.c:329:35: warning: ?struct ehci_hcor? declared
> > > > > > inside parameter list will not be visible outside of this definition
> > > > > > or declaration
> > > > > >   ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> > > > > >   ?????? |?????????????????????????????????? ^~~~~~~~~
> > > > > > board/ti/panda/panda.c:329:10: warning: ?struct ehci_hccr? declared
> > > > > > inside parameter list will not be visible outside of this definition
> > > > > > or declaration
> > > > > >   ?? 329 |?? struct ehci_hccr **hccr, struct ehci_hcor **hcor)
> > > > > >   ?????? |????????? ^~~~~~~~~
> > > > > > board/ti/panda/panda.c: In function ?ehci_hcd_init?:
> > > > > > board/ti/panda/panda.c:339:8: warning: implicit declaration of
> > > > > > function ?omap_ehci_hcd_init?; did you mean ?ehci_hcd_init??
> > > > > > [-Wimplicit-function-declaration]
> > > > > >   ?? 339 |? ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
> > > > > >   ?????? |??????? ^~~~~~~~~~~~~~~~~~
> > > > > >   ?????? |??????? ehci_hcd_init
> > > > > > board/ti/panda/panda.c: In function ?ehci_hcd_stop?:
> > > > > > board/ti/panda/panda.c:348:9: warning: implicit declaration of
> > > > > > function ?omap_ehci_hcd_stop?; did you mean ?ehci_hcd_stop??
> > > > > > [-Wimplicit-function-declaration]
> > > > > >   ?? 348 |? return omap_ehci_hcd_stop();
> > > > > >   ?????? |???????? ^~~~~~~~~~~~~~~~~~
> > > > > >   ?????? |???????? ehci_hcd_stop
> > > > > 
> > > > > Yeah, I actually see these also. I think we could maybe drop all the
> > > > > offending code as I did later with the omap5-uevm. On omap5, USB seemed
> > > > > to work even without these.
> > > > > 
> > > > > Maybe some USB expert can comment on these (Vignesh)?
> > > > > 
> > > > 
> > > > 
> > > > Offending code won't compile with DM_USB enabled. I suggest to drop them
> > > > for now in order to avoid entire board support from being dropped. USB
> > > > can be added back later if needed...
> > > > 
> > > > Or you would have to disable DM_USB give this a try..
> > > 
> > > Yeah, dropping DM_USB USB stops working completely I believe. And, USB
> > > appears working (at least partially: usb start, usb info provides some sane
> > > data) with these two patches, just the compiler warnings are there.
> > > 
> > > However, I eliminated the offending code in v2 I posted today, and USB still
> > > appears functional as far as I can see. Trying to compile mass storage
> > > support in to test USB mass storage devices causes a mayhem so I left that
> > > for someone more experienced with USB.
> > 
> > Please note that DM_USB migration also has a deadline of almost a year
> > ago so this is another area to fix or remove-now-readd-later.  Thanks!
> > 
> 
> Yeah, so with these patches, building u-boot for omap4 panda does not
> complain about any DM_xyz conversion deadlines anymore, does it mean we are
> clean? :)

Not quite as you're not dealing with DM_SPI but that's calling make's
warning and not echo'ing like everything else so it's easier to miss.