coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
stmicro.c File Reference
#include <commonlib/helpers.h>
#include <spi_flash.h>
#include <spi-generic.h>
#include "spi_flash_internal.h"
Include dependency graph for stmicro.c:

Go to the source code of this file.

Macros

#define CMD_M25PXX_WREN   0x06 /* Write Enable */
 
#define CMD_M25PXX_WRDI   0x04 /* Write Disable */
 
#define CMD_M25PXX_RDSR   0x05 /* Read Status Register */
 
#define CMD_M25PXX_WRSR   0x01 /* Write Status Register */
 
#define CMD_M25PXX_READ   0x03 /* Read Data Bytes */
 
#define CMD_M25PXX_FAST_READ   0x0b /* Read Data Bytes at Higher Speed */
 
#define CMD_M25PXX_PP   0x02 /* Page Program */
 
#define CMD_M25PXX_SSE   0x20 /* Subsector Erase */
 
#define CMD_M25PXX_SE   0xd8 /* Sector Erase */
 
#define CMD_M25PXX_BE   0xc7 /* Bulk Erase */
 
#define CMD_M25PXX_DP   0xb9 /* Deep Power-down */
 
#define CMD_M25PXX_RES   0xab /* Release from DP, and Read Signature */
 
#define STM_ID_M25P10   0x2011
 
#define STM_ID_M25P20   0x2012
 
#define STM_ID_M25P40   0x2013
 
#define STM_ID_M25P80   0x2014
 
#define STM_ID_M25P16   0x2015
 
#define STM_ID_M25P32   0x2016
 
#define STM_ID_M25P64   0x2017
 
#define STM_ID_M25P128   0x2018
 
#define STM_ID_M25PX80   0x7114
 
#define STM_ID_M25PX16   0x7115
 
#define STM_ID_M25PX32   0x7116
 
#define STM_ID_M25PX64   0x7117
 
#define STM_ID_M25PE80   0x8014
 
#define STM_ID_M25PE16   0x8015
 
#define STM_ID_M25PE32   0x8016
 
#define STM_ID_M25PE64   0x8017
 
#define STM_ID_N25Q016__3E   0xba15
 
#define STM_ID_N25Q032__3E   0xba16
 
#define STM_ID_N25Q064__3E   0xba17
 
#define STM_ID_N25Q128__3E   0xba18
 
#define STM_ID_N25Q256__3E   0xba19
 
#define STM_ID_N25Q016__1E   0xbb15
 
#define STM_ID_N25Q032__1E   0xbb16
 
#define STM_ID_N25Q064__1E   0xbb17
 
#define STM_ID_N25Q128__1E   0xbb18
 
#define STM_ID_N25Q256__1E   0xbb19
 

Functions

int stmicro_release_deep_sleep_identify (const struct spi_slave *spi, u8 *idcode)
 

Variables

static const struct spi_flash_part_id flash_table_se32k []
 
static const struct spi_flash_part_id flash_table_se64k []
 
static const struct spi_flash_part_id flash_table_se256k []
 
static const struct spi_flash_part_id flash_table_sse []
 
const struct spi_flash_vendor_info spi_flash_stmicro1_vi
 
const struct spi_flash_vendor_info spi_flash_stmicro2_vi
 
const struct spi_flash_vendor_info spi_flash_stmicro3_vi
 
const struct spi_flash_vendor_info spi_flash_stmicro4_vi
 

Macro Definition Documentation

◆ CMD_M25PXX_BE

#define CMD_M25PXX_BE   0xc7 /* Bulk Erase */

Definition at line 19 of file stmicro.c.

◆ CMD_M25PXX_DP

#define CMD_M25PXX_DP   0xb9 /* Deep Power-down */

Definition at line 20 of file stmicro.c.

◆ CMD_M25PXX_FAST_READ

#define CMD_M25PXX_FAST_READ   0x0b /* Read Data Bytes at Higher Speed */

Definition at line 15 of file stmicro.c.

◆ CMD_M25PXX_PP

#define CMD_M25PXX_PP   0x02 /* Page Program */

Definition at line 16 of file stmicro.c.

◆ CMD_M25PXX_RDSR

#define CMD_M25PXX_RDSR   0x05 /* Read Status Register */

Definition at line 12 of file stmicro.c.

◆ CMD_M25PXX_READ

#define CMD_M25PXX_READ   0x03 /* Read Data Bytes */

Definition at line 14 of file stmicro.c.

◆ CMD_M25PXX_RES

#define CMD_M25PXX_RES   0xab /* Release from DP, and Read Signature */

Definition at line 21 of file stmicro.c.

◆ CMD_M25PXX_SE

#define CMD_M25PXX_SE   0xd8 /* Sector Erase */

Definition at line 18 of file stmicro.c.

◆ CMD_M25PXX_SSE

#define CMD_M25PXX_SSE   0x20 /* Subsector Erase */

Definition at line 17 of file stmicro.c.

◆ CMD_M25PXX_WRDI

#define CMD_M25PXX_WRDI   0x04 /* Write Disable */

Definition at line 11 of file stmicro.c.

◆ CMD_M25PXX_WREN

#define CMD_M25PXX_WREN   0x06 /* Write Enable */

Definition at line 10 of file stmicro.c.

◆ CMD_M25PXX_WRSR

#define CMD_M25PXX_WRSR   0x01 /* Write Status Register */

Definition at line 13 of file stmicro.c.

◆ STM_ID_M25P10

#define STM_ID_M25P10   0x2011

Definition at line 26 of file stmicro.c.

◆ STM_ID_M25P128

#define STM_ID_M25P128   0x2018

Definition at line 33 of file stmicro.c.

◆ STM_ID_M25P16

#define STM_ID_M25P16   0x2015

Definition at line 30 of file stmicro.c.

◆ STM_ID_M25P20

#define STM_ID_M25P20   0x2012

Definition at line 27 of file stmicro.c.

◆ STM_ID_M25P32

#define STM_ID_M25P32   0x2016

Definition at line 31 of file stmicro.c.

◆ STM_ID_M25P40

#define STM_ID_M25P40   0x2013

Definition at line 28 of file stmicro.c.

◆ STM_ID_M25P64

#define STM_ID_M25P64   0x2017

Definition at line 32 of file stmicro.c.

◆ STM_ID_M25P80

#define STM_ID_M25P80   0x2014

Definition at line 29 of file stmicro.c.

◆ STM_ID_M25PE16

#define STM_ID_M25PE16   0x8015

Definition at line 39 of file stmicro.c.

◆ STM_ID_M25PE32

#define STM_ID_M25PE32   0x8016

Definition at line 40 of file stmicro.c.

◆ STM_ID_M25PE64

#define STM_ID_M25PE64   0x8017

Definition at line 41 of file stmicro.c.

◆ STM_ID_M25PE80

#define STM_ID_M25PE80   0x8014

Definition at line 38 of file stmicro.c.

◆ STM_ID_M25PX16

#define STM_ID_M25PX16   0x7115

Definition at line 35 of file stmicro.c.

◆ STM_ID_M25PX32

#define STM_ID_M25PX32   0x7116

Definition at line 36 of file stmicro.c.

◆ STM_ID_M25PX64

#define STM_ID_M25PX64   0x7117

Definition at line 37 of file stmicro.c.

◆ STM_ID_M25PX80

#define STM_ID_M25PX80   0x7114

Definition at line 34 of file stmicro.c.

◆ STM_ID_N25Q016__1E

#define STM_ID_N25Q016__1E   0xbb15

Definition at line 47 of file stmicro.c.

◆ STM_ID_N25Q016__3E

#define STM_ID_N25Q016__3E   0xba15

Definition at line 42 of file stmicro.c.

◆ STM_ID_N25Q032__1E

#define STM_ID_N25Q032__1E   0xbb16

Definition at line 48 of file stmicro.c.

◆ STM_ID_N25Q032__3E

#define STM_ID_N25Q032__3E   0xba16

Definition at line 43 of file stmicro.c.

◆ STM_ID_N25Q064__1E

#define STM_ID_N25Q064__1E   0xbb17

Definition at line 49 of file stmicro.c.

◆ STM_ID_N25Q064__3E

#define STM_ID_N25Q064__3E   0xba17

Definition at line 44 of file stmicro.c.

◆ STM_ID_N25Q128__1E

#define STM_ID_N25Q128__1E   0xbb18

Definition at line 50 of file stmicro.c.

◆ STM_ID_N25Q128__3E

#define STM_ID_N25Q128__3E   0xba18

Definition at line 45 of file stmicro.c.

◆ STM_ID_N25Q256__1E

#define STM_ID_N25Q256__1E   0xbb19

Definition at line 51 of file stmicro.c.

◆ STM_ID_N25Q256__3E

#define STM_ID_N25Q256__3E   0xba19

Definition at line 46 of file stmicro.c.

Function Documentation

◆ stmicro_release_deep_sleep_identify()

int stmicro_release_deep_sleep_identify ( const struct spi_slave spi,
u8 idcode 
)

Definition at line 195 of file stmicro.c.

Referenced by spi_flash_generic_probe().

Here is the caller graph for this function:

Variable Documentation

◆ flash_table_se256k

const struct spi_flash_part_id flash_table_se256k[]
static
Initial value:
= {
{
.id[0] = STM_ID_M25P128,
.nr_sectors_shift = 6,
},
}
#define STM_ID_M25P128
Definition: stmicro.c:33

Definition at line 1 of file stmicro.c.

◆ flash_table_se32k

const struct spi_flash_part_id flash_table_se32k[]
static
Initial value:
= {
{
.id[0] = STM_ID_M25P10,
.nr_sectors_shift = 2,
},
}
#define STM_ID_M25P10
Definition: stmicro.c:26

Definition at line 1 of file stmicro.c.

◆ flash_table_se64k

const struct spi_flash_part_id flash_table_se64k[]
static

Definition at line 1 of file stmicro.c.

◆ flash_table_sse

const struct spi_flash_part_id flash_table_sse[]
static

Definition at line 1 of file stmicro.c.

◆ spi_flash_stmicro1_vi

const struct spi_flash_vendor_info spi_flash_stmicro1_vi
Initial value:
= {
.page_size_shift = 8,
.sector_size_kib_shift = 5,
.match_id_mask[0] = 0xffff,
.nr_part_ids = ARRAY_SIZE(flash_table_se32k),
}
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define VENDOR_ID_STMICRO
Definition: spi-generic.h:26
const struct spi_flash_ops_descriptor spi_flash_pp_0xd8_sector_desc
Definition: spi_flash.c:806
static const struct spi_flash_part_id flash_table_se32k[]
Definition: stmicro.c:53

Definition at line 195 of file stmicro.c.

◆ spi_flash_stmicro2_vi

const struct spi_flash_vendor_info spi_flash_stmicro2_vi
Initial value:
= {
.page_size_shift = 8,
.sector_size_kib_shift = 6,
.match_id_mask[0] = 0xffff,
.nr_part_ids = ARRAY_SIZE(flash_table_se64k),
}
static const struct spi_flash_part_id flash_table_se64k[]
Definition: stmicro.c:61

Definition at line 195 of file stmicro.c.

◆ spi_flash_stmicro3_vi

const struct spi_flash_vendor_info spi_flash_stmicro3_vi
Initial value:
= {
.page_size_shift = 8,
.sector_size_kib_shift = 8,
.match_id_mask[0] = 0xffff,
.nr_part_ids = ARRAY_SIZE(flash_table_se256k),
}
static const struct spi_flash_part_id flash_table_se256k[]
Definition: stmicro.c:134

Definition at line 195 of file stmicro.c.

◆ spi_flash_stmicro4_vi

const struct spi_flash_vendor_info spi_flash_stmicro4_vi
Initial value:
= {
.page_size_shift = 8,
.sector_size_kib_shift = 2,
.match_id_mask[0] = 0xffff,
.nr_part_ids = ARRAY_SIZE(flash_table_sse),
}
const struct spi_flash_ops_descriptor spi_flash_pp_0x20_sector_desc
Definition: spi_flash.c:793
static const struct spi_flash_part_id flash_table_sse[]
Definition: stmicro.c:142

Definition at line 195 of file stmicro.c.