The big bit of unfinished work is supporting multiple queue'd requests
and queueing a request against an endpoint where requests are in progress
(neither work yet, both will result in things getting messed up).
This borrows liberally from the old LK MSM72xx UDC driver that existed
back in 2008. Turns out the MSM72xx and LPC43xx use the same UDC IP
block.
Code has been tidied up a bit, uses a hw header I threw together
before finding the old driver, and some udc common code has been
broken out into a separate file, but not yet a library.
Still needs some locking code and other cleanup, but enumeration
and bulk transfers are working.
Use the reserved cortex-m vectors 8 and 9 for a magic cookie and
pointer to a debugger info structure. This structure contains
pointers to the threadlist, the current thread pointer, and
offsets to important members of the thread structure. With
this information, an attached debugger can walk the threadlist
and obtain state, name, registers, etc for each thread.
Use global define WITH_DEBUGGER_INFO to enable this.
LWIP has a lot of knobs and creating a generic configuration that works
everywhere (or even most places) is hard. So if you add WITH_TARGET_LWIPOPTS
to the configuration, pull options from <target/lwipopts.h> instead of
the defaults in lib/lwip/include/lwipopts.h
Modify the existing ptable code to pay attention to bio device erase
geometry if present. Significant changes include...
+ Partitions must be allocated on both program and erase block
boundaries.
+ Partitions lengths must be multiples of both program and erase block
sizes.
+ Partitions may not span non-homogeneous regions of erase geometry.
+ ptable_allocate as been made private.
+ Users may no longer explicitly select a position for partitions to
be added, they may only ask for the partition to be allocated at the
begining or the end of the block device.
+ A bio subdevice will be registered for each active partition in the
system. Users are encouraged to add their partition using
ptable_add, and then open a handle to the subdevice using bio_open.
The bio subdevice will prevent accidental scribbling outside of the
partition lines, and also advertise the partition erase size.
Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I09bf9038d210ff8be42d44166ab92c789872e036
Extend the block i/o system to allow registered devices to advertise
an erase geometry. Devices which do not need to be explicitly erased
may skip this. Extent the Zynq spiflash code to publish the erase
geometry as read from the flash device.
Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I42e16fbe9a0fcf8334c317f16dea1c551c203eb2
Add a version of hexdump8 which lets the user specify the displayed offset
rather than always using the in-memory offset.
Signed-off-by: John Grossman <johngro@google.com>
Change-Id: Iad0ee36294d1e0a82f3a086b8b4fa856438764af
- no lwip callers pay attention to the return value
(they all create long lived, never exiting threads)
- using TLS requires reserving a slot in every thread
which is overkill for something that needs no per
thread data
Since TLS slot numbers are reserved at compile time, use a static assert
to ensure bogus ones are not used, leading to thread name corruption or
general heap corruption, depending on the number.