stm32lx: refactor and add support for STM32L0xx
commit3751214b9cecf69d729985c05361b5bd5441d24a
authorAndrey Yurovsky <yurovsky@gmail.com>
Thu, 10 Jul 2014 21:24:18 +0000 (10 14:24 -0700)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Tue, 19 Aug 2014 20:32:07 +0000 (19 20:32 +0000)
treec527033adc2ebe4541eb29c4de0c2fca5e02f8e1
parentd50cc1bfea61b161deca9af20d6871dc53bca93b
stm32lx: refactor and add support for STM32L0xx

This adds initial support for the STM32L0 family, specifically the ID
code 417 variant.  The 'L0 has 128B rather than 256B pages as well as a
different number of pages per sector.  It also has several key registers
and register sets in different locations from the STM32L1xx parts.

This change therefore takes the opportunity to reorganize part information into
a const table (it was previously determined by a set of control statements) and
abstracts away some of the low-level details to make them generic for L1 and
L0 parts.

We also include the first bank's size (for dual bank parts) in the new
device information table (and correct that size for the 0x437 variant
which is 256 rather than 192KB).

The 'L0 parts will not use the built-in loader/helper for Flash writing.

Tested on STM32L053 (dicovery board and Nucleo board) and STM32L152
(discovery board).

Change-Id: I57f7a8ab02caee266de71b31ae82a50d85728a0b
Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Reviewed-on: http://openocd.zylin.com/2200
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
src/flash/nor/stm32lx.c