Files
OpenCellular/include
Shawn Nematbakhsh 746debdf20 spi_flash: Rework protection translation functions
Previously we defined separate functions to map registers to protect
ranges for each supported SPI ROM. This change instead adds a protect range
table + flags for each supported SPI ROM and adds common functions for
translation between ranges + registers. This makes supporting new parts
easier. Since we will never use most supported protection ranges, we can
even simplfy the tables.

The implementation is now similar to flashrom.

BUG=chrome-os-partner:37688
TEST=Manual on Glower.
flashwp disable  + spi_flash_rsr --> 0
flashinfo --> shows no protection
spi_flash_prot 0 0x10000 + spi_flash_rsr --> 0x24
flashinfo --> shows 64KB protected
spi_flash_prot 0 0x20000 + spi_flash_rsr --> 0x28
flashinfo --> shows all 96KB protected
spi_flash_prot 0 0x40000 + spi_flash_rsr --> 0x2c
spi_flash_prot 0 0x80000 + spi_flash_rsr --> 0x10
spi_flash_prot 0 0 + spi_flash_rsr --> 0x00
spi_flash_prot 0 0x1000 --> error
spi_flash_prot 0x10000 0x10000 --> error
BRANCH=None

Change-Id: Ie5908ce687b7ff207b09794c7b001a4fbd9e0f5a
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/259310
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-03-17 01:42:30 +00:00
..
2013-12-17 21:27:53 +00:00
2013-04-05 14:28:42 -07:00
2014-02-08 00:14:48 +00:00
2013-10-25 20:12:49 +00:00
2012-10-26 09:49:38 -07:00
2014-10-29 22:23:43 +00:00
2013-06-26 09:08:23 -07:00
2013-10-21 23:59:38 +00:00
2013-10-30 23:10:13 +00:00
2013-08-07 12:43:48 -07:00
2011-12-07 19:10:02 +00:00
2015-03-06 08:48:39 +00:00
2012-10-25 14:12:11 -07:00
2014-03-06 23:14:07 +00:00
2012-10-25 14:12:10 -07:00
2013-10-30 23:10:10 +00:00
2012-10-25 17:03:44 -07:00
2012-08-09 17:40:37 -07:00
2014-06-26 06:48:37 +00:00
2014-01-06 12:40:45 +00:00
2015-02-12 06:44:04 +00:00
2014-03-01 20:15:59 +00:00
2013-11-21 00:09:09 +00:00
2014-06-19 03:28:43 +00:00
2015-01-20 20:56:43 +00:00