Page MenuHomeFreeBSD

Add support for us to power on the USB on the bcm283x
ClosedPublic

Authored by andrew on Feb 22 2015, 12:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 7:52 AM
Unknown Object (File)
Dec 20 2023, 12:05 AM
Unknown Object (File)
Nov 6 2023, 8:43 AM
Unknown Object (File)
Oct 5 2023, 7:41 AM
Unknown Object (File)
Sep 25 2023, 3:51 PM
Unknown Object (File)
Aug 27 2023, 1:56 AM
Unknown Object (File)
Jul 6 2023, 1:46 PM
Unknown Object (File)
Jun 27 2023, 8:20 PM

Details

Summary

U-Boot may not have run so we need to ask the firmware to power on the
hardware.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

andrew retitled this revision from to Add support for us to power on the USB on the bcm283x.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: ARM, hselasky.
sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
118 ↗(On Diff #3910)

You should forward detach and shutdown methods too.

rpaulo added a reviewer: rpaulo.
rpaulo added a subscriber: rpaulo.

Should probably be approved by one more person.

sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
83 ↗(On Diff #3910)

Shouldn't the __aligned() come after "msg" ?

118 ↗(On Diff #3910)

Shutdown is just bus_generic_shutdown, right? It doesn't look like it needs to be forwarded.

This revision is now accepted and ready to land.Feb 22 2015, 9:00 PM
imp edited edge metadata.

Despite my catty comments, this looks good to me, assuming a decent answer for the why 16 and not 32, 64 or 8.

sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
83 ↗(On Diff #3910)

and why 16?

sys/dev/usb/controller/dwc_otg_fdt.c
81 ↗(On Diff #3910)

Now that's a mouthful :)

But also correct.

mmel requested changes to this revision.Feb 23 2015, 3:57 AM
mmel added a reviewer: mmel.
mmel added a subscriber: mmel.

This patch breaks coherency for multicore ARMs.

sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
104 ↗(On Diff #3910)

cpu_dcache_wbinv_all() is not SMP coherent and cannot be used outside init/shutdown code. Please, use range based cache operations here.

This revision now requires changes to proceed.Feb 23 2015, 3:57 AM
sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
118 ↗(On Diff #3910)

Just ensure it looks something like this:

DEVMETHOD(device_detach, dwc_otg_detach),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
DEVMETHOD(device_shutdown, bus_generic_shutdown),

--HPS

sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
83 ↗(On Diff #3910)

I got it from somewhere, but don't remember the details.

118 ↗(On Diff #3910)

Anything missing from here will call into the dwc_otg_fdt driver. We don't need shutdown as it's not implemented here. This is why I'm subclassing the existing bus, so I don't need to handle all of these.

ian added inline comments.
sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
104 ↗(On Diff #3910)

Even better, use busdma to allocate and sync the buffer. (Hmmm, I wonder what happened to jhb's proposed change to make it easier to allocate busdma buffers for stuff like this? Probably got sidetracked when I asked for changes and didn't offer a patch.)

andrew edited edge metadata.

Update to use busdma

imp edited edge metadata.
mmel edited edge metadata.

Please see inline comment.
I'm fine with this patch, if missing bus_dmamap_sync() will be included.

sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
154 ↗(On Diff #4049)

bus_dmamap_sync(msg_tag, msg_map, BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);

This revision is now accepted and ready to land.Mar 1 2015, 4:48 PM
sys/arm/broadcom/bcm2835/bcm283x_dwc_fdt.c
110 ↗(On Diff #4049)

doesn't the alignment need to be 16? it looks like the mailbox interface uses the low 4 bits for the channel number.

154 ↗(On Diff #4049)

maybe along with a comment that says it's only because we need to match PRE ops with corresponding POST ops (since we don't actually read any data coming back via the mailbox).

andrew updated this revision to Diff 4149.

Closed by commit rS279778 (authored by @andrew).