diff loadtools/fldevs.c @ 523:9a478d33b3ca

fc-loadtool: added Samsung K5L33xx_A flash support for GTM900
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 09 Jun 2019 21:51:27 +0000
parents 0dd2c87c1b63
children 3886a8a40809
line wrap: on
line diff
--- a/loadtools/fldevs.c	Thu Jun 06 06:56:32 2019 +0000
+++ b/loadtools/fldevs.c	Sun Jun 09 21:51:27 2019 +0000
@@ -31,6 +31,13 @@
 	.total_sectors	= 71,
 };
 
+static struct flash_geom geom_4M_bothends = {
+	.total_size	= 0x400000,
+	.nregions	= 3,
+	.regions	= {0x2000, 8, 0x10000, 62, 0x2000, 8},
+	.total_sectors	= 78,
+};
+
 static struct flash_geom geom_8M_topboot = {
 	.total_size	= 0x800000,
 	.nregions	= 2,
@@ -300,3 +307,44 @@
 	.bank_geom		= {&geom_4M_topboot, 0},
 	.cmdset			= &flash_cmdset_amd,
 };
+
+/* a different 4 MiB Samsung flash chip used in Huawei GTM900 */
+
+static struct cfi_check samsung_4M_bothends_cfi[] = {
+	{0x10, 'Q'},
+	{0x11, 'R'},
+	{0x12, 'Y'},
+	{0x13, 0x02},
+	{0x14, 0x00},
+	{0x15, 0x40},
+	{0x16, 0x00},
+	{0x27, 0x16},
+	{0x2C, 0x03},
+	{0x2D, 0x07},
+	{0x2E, 0x00},
+	{0x2F, 0x20},
+	{0x30, 0x00},
+	{0x31, 0x3D},
+	{0x32, 0x00},
+	{0x33, 0x00},
+	{0x34, 0x01},
+	{0x35, 0x07},
+	{0x36, 0x00},
+	{0x37, 0x20},
+	{0x38, 0x00},
+	{0x40, 'P'},
+	{0x41, 'R'},
+	{0x42, 'I'},
+	{0x43, '0'},
+	{0x44, '0'},
+	{0x4F, 0x04},
+	{-1,   0}
+};
+
+struct flash_device flashdev_K5L33xx_A = {
+	.name			= "Samsung K5L33xx_A",
+	.cfi_table		= samsung_4M_bothends_cfi,
+	.required_global_config	= FLASH_GLOBAL_CFG_SINGLE_4M,
+	.bank_geom		= {&geom_4M_bothends, 0},
+	.cmdset			= &flash_cmdset_amd,
+};