Delete .gdbinit.

This is specific to openocd; it shouldn't be here.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Add build support for targeting multiple STM32 series.

Add an MCU_SERIES variable to each of the files under
support/make/board-includes, which declares the series as "stm32f1" in
each case.

Use this in target-config.mk when determining LD_SERIES_PATH (with a
hack since we only support performance line) and
LIBMAPLE_MODULE_SERIES.  We must move support/ld/stm32/series/f1 to
.../series/stm32f1 as a side-effect.

Adding support for other series (e.g. "stm32f2") should now be a
matter of filling in the contents of libmaple/<series>/ and
support/ld/stm32/<series>/ appropriately (along with moving the rest
of the nonportable code out of the libmaple core and into the STM32F1
series submodule).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Make BKP support STM32F1-only.

- libmaple/bkp.h: Mark availability restriction.

- Move libmaple/bkp.c to libmaple/stm32f1; adjust rules.mk files
  accordingly.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
support/ld: Add STM32F2 vector symbols.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Add skeleton libmaple/stm32f2/rules.mk.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
STM32F2: Add vector table and weak ISR definitions.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
STM32F2 NVIC support.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
libmaple_types.h: Add offsetof().

Rather than rely on newlib's stddef.h, define our own offsetof() in
terms of GCC's __builtin_offsetof(). Don't override an existing
offsetof() definition, in case the user already has one they prefer.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Initial STM32F2 RCC support.

Largely untested.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Initial STM32F2 GPIO support.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Initial STM32F2 series/stm32.h.

This still has some FIXMEs, but it's enough to get going.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
[UNDO] Rip out everything but libmaple and Wirish startup code.

We'll need to bring all this functionality back online piecemeal as we
add F2 support.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
[UNDO] Rip out a bunch of F1-only bits from libmaple proper

We'll need to bring this functionality back online piecemeal as we add
F2 support.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
ld/make: Add support for STM3220G-EVAL board.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
stm32f2/stm32.h: Add support for STM32F207IG.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
[WIP] boards: Add st_stm3220g_eval.

This supports ST's STM3220G-EVAL, the standard "kitchen-sink"
evaluation board for the STM32F2 series.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
STM32F2 Flash support.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Clean up Flash interface; add flash_enable_features().

Make a single function, flash_enable_features(), to control the access
characteristics of Flash memory (i.e. to write to the non-latency bits
of ACR).

In so doing, make everybody pretend to allow instruction and data
caching. On STM32F1, trying to turn these on simply has no
effect. This allows unconditionally trying to turn them on, which will
simplify users' lives.

This has the ancillary benefit of making the stm32f2- and
stm32f1-specific flash.c files unnecessary; delete these.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
RCC: Clean up and sanitize interfaces across F1, F2 series.

Additions:

- rcc_switch_sysclk():

  For changing the clock used as SYSCLK's source.

- enum rcc_clk:

  One for each system and secondary clock source (e.g. HSE,
  LSE). These are defined on a per-series basis in each of the
  <series/rcc.h>.

- rcc_turn_on_clk(),
  rcc_turn_off_clk(),
  rcc_is_clk_ready():

  For turning on system and secondary clock sources, and checking
  whether or not they're ready. Uses enum rcc_clk.

Removals:

- rcc_clk_init(): There's no way to port this to F2. Move it to the F1
  header. This also means we can remove the empty implementation and
  enum rcc_pll_multiplier from the F2 RCC header, where it doesn't
  make any sense.

Also fix up some includes, and rewrite rcc_clk_init() in terms of the
new clock source management functions.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
libmaple_types.h: Add __deprecated.

This is a define for __attribute__((deprecated)).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>