[cm3/sync] Add mutex_trylock()

Allows non-blocking use in user code.
[cm3/sync] mutex_lock now calls mutex_trylock repeatedly
ethernet: corrected typo in ethernet/phy_ksz8051mll.c to include setting the speed to 100M in case of 100M Half Duplex
Rename rcc_ppre1_frequency and rcc_ppre2_frequency

Rename rcc_ppre1_frequency and rcc_ppre2_frequency to rcc_apb1_frequency and rcc_apb2_frequency
Also add rcc_ahb_frequency (although it is not set correctly in all cases) which will be fixed by
the rcc commits later. Also fixup the only use in the library of these variables, the USART code.

And fix the typos that resulted
Make l1 generic too
Audit RTCPRE Shift and Mask Values

L0 - RTC Prescaler appears in RCC_CR, bit 20, 2 bits wide (RM0367 Rev 2)
L1 - RTC Prescaler appears in RCC_CR, bit 29, 2 bits wide (RM0038 Rev 10)
F0 - no prescaler setting (RM0091 Rev 7)
F1 - no prescaler setting (RM0041 Rev 4)
F2 - RTC Prescaler appears at RCC_CFGR, bit 16, 4 bits wide (RM0033 Rev 6)
F3 - no prescaler setting (RM0316 Rev 3)
F4 - RTC Prescaler appears at RCC_CFGR, bit 16, 4 bits wide (RM0090 Rev 8)
stm32: f4: Add FLASH_OPTCR1 definition

This is required for stm32f42xx and stm32f43xx with second bank options.
[ETH] Phy ID configurable as parameter
[ETH] Make support of ethernet for F1 family
[fix] after phyid addition, the init function should init correct phy.
ethernet: mac stm32fxx7: Fix style and docs

Rushed commits are bad mkay :)
[STM32F0] add support of autotrimming HSI to USB SOF frames

Signed-off-by: Frantisek Burian <BuFran@seznam.cz>
[STM32F0] Add support functions for USB clock setup in F072 chips.

There is remaining an issue with PREDIV connected just after clock multiplexer (only F072). This should be fixed in another commit.
usb: Prevent memcpy() being called with NULL arguments

If there is no additional iface data then iface->extra is NULL and
iface->extralen is zero. Passing NULL to memcpy is undefined behaviour
even if the length of data to copy is zero. In other words a conforming
(debug) memcpy implementation is permitted to assert(dst && src) without
checking the value of n.

Add an extra branch to avoid this.
usb: Support for class specific endpoint descriptors.

Extends struct usb_endpoint_descriptor to make it possible to provide
the USB host with class-specific extensions to endpoint descriptors.

The approach taken, based on extra and extralen and removing the sizeof()
from USB_DT_ENDPOINT_SIZE, is identical to the approach used to add
class-specific extensions to interface descriptors. All libopencm3-examples
use the USB_DT_ENDPOINT_SIZE (rather than directly using sizeof) so there
should be no compatibility problems resulting from this change.
usb: Support for MIDI class devices

Provides all of the config descriptors for MIDI class devices together
with a sub-set of the audio class sufficient to put together a full
fledged MIDI device.
stm32: f4: flash: support extended sector ranges

F42xx and F43xx have extended sector ranges.

Reported-by: H2OBrain@irc
[usb] fix user_callback_set_config

USB using control callbacks was broken since d6bad27735a77b8daa90ce72b843cf08ba78697d
Properly check if user usb control callback are registered,
while here make sure user_callback_set_config callback pointers are initialized to NULL.
stm32: f1: fix missing ahb_freq