diff --git a/chipdrivers.h b/chipdrivers.h
index e3eb978b1de18aeb89e2a5dd53ae91696167f21b..1569bf3af4406c5d282d46fda1e40cbcf9b44642 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -149,6 +149,7 @@ int printlock_w39v080fa(struct flashctx *flash);
 int printlock_w39v080fa_dual(struct flashctx *flash);
 int unlock_w39v040fb(struct flashctx *flash);
 int unlock_w39v080fa(struct flashctx *flash);
+int printlock_at49f(struct flashctx *flash);
 
 /* w29ee011.c */
 int probe_w29ee011(struct flashctx *flash);
diff --git a/flashchips.c b/flashchips.c
index 6d997be99fb5305889ea643b96ff9df7cf836006..09daa0a77a1b02f2d5a05f0c7aae22848f2f51a6 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -2226,19 +2226,27 @@ const struct flashchip flashchips[] = {
 
 	{
 		.vendor		= "Atmel",
-		.name		= "AT49F020",
+		.name		= "AT49F002(N)",
 		.bustype	= BUS_PARALLEL,
 		.manufacture_id	= ATMEL_ID,
-		.model_id	= ATMEL_AT49F020,
+		.model_id	= ATMEL_AT49F002N,
 		.total_size	= 256,
 		.page_size	= 256,
 		.feature_bits	= FEATURE_EITHER_RESET,
-		.tested		= TEST_OK_PRE,
+		.tested		= TEST_UNTESTED,
 		.probe		= probe_jedec,
 		.probe_timing	= TIMING_ZERO,	/* Datasheet has no timing info specified */
 		.block_erasers	=
 		{
 			{
+				.eraseblocks = {
+					{16 * 1024, 1},
+					{8 * 1024, 2},
+					{96 * 1024, 1},
+					{128 * 1024, 1},
+				},
+				.block_erase = erase_sector_jedec,
+			}, {
 				.eraseblocks = { {256 * 1024, 1} },
 				.block_erase = erase_chip_block_jedec,
 			}
@@ -2250,24 +2258,24 @@ const struct flashchip flashchips[] = {
 
 	{
 		.vendor		= "Atmel",
-		.name		= "AT49F002(N)",
+		.name		= "AT49F002(N)T",
 		.bustype	= BUS_PARALLEL,
 		.manufacture_id	= ATMEL_ID,
-		.model_id	= ATMEL_AT49F002N,
+		.model_id	= ATMEL_AT49F002NT,
 		.total_size	= 256,
 		.page_size	= 256,
 		.feature_bits	= FEATURE_EITHER_RESET,
-		.tested		= TEST_UNTESTED,
+		.tested		= TEST_OK_PR,
 		.probe		= probe_jedec,
 		.probe_timing	= TIMING_ZERO,	/* Datasheet has no timing info specified */
 		.block_erasers	=
 		{
 			{
 				.eraseblocks = {
-					{16 * 1024, 1},
-					{8 * 1024, 2},
-					{96 * 1024, 1},
 					{128 * 1024, 1},
+					{96 * 1024, 1},
+					{8 * 1024, 2},
+					{16 * 1024, 1},
 				},
 				.block_erase = erase_sector_jedec,
 			}, {
@@ -2282,31 +2290,61 @@ const struct flashchip flashchips[] = {
 
 	{
 		.vendor		= "Atmel",
-		.name		= "AT49F002(N)T",
+		.name		= "AT49F020",
 		.bustype	= BUS_PARALLEL,
 		.manufacture_id	= ATMEL_ID,
-		.model_id	= ATMEL_AT49F002NT,
+		.model_id	= ATMEL_AT49F020,
 		.total_size	= 256,
 		.page_size	= 256,
 		.feature_bits	= FEATURE_EITHER_RESET,
-		.tested		= TEST_OK_PR,
+		.tested		= TEST_OK_PRE,
 		.probe		= probe_jedec,
 		.probe_timing	= TIMING_ZERO,	/* Datasheet has no timing info specified */
 		.block_erasers	=
 		{
 			{
-				.eraseblocks = {
-					{128 * 1024, 1},
-					{96 * 1024, 1},
-					{8 * 1024, 2},
-					{16 * 1024, 1},
-				},
-				.block_erase = erase_sector_jedec,
-			}, {
 				.eraseblocks = { {256 * 1024, 1} },
 				.block_erase = erase_chip_block_jedec,
 			}
+			/* Chip features an optional permanent write protection
+			 * of the first 8 kB. The erase function is the same as
+			 * above, but 00000H to 01FFFH will not be erased.
+			 * FIXME: add another eraser when partial erasers are
+			 * supported.
+			 */
+		},
+		.printlock	= printlock_at49f,
+		.write		= write_jedec_1,
+		.read		= read_memmapped,
+		.voltage	= {4500, 5500},
+	},
+
+	{
+		.vendor		= "Atmel",
+		.name		= "AT49F040",
+		.bustype	= BUS_PARALLEL,
+		.manufacture_id	= ATMEL_ID,
+		.model_id	= ATMEL_AT49F040,
+		.total_size	= 512,
+		.page_size	= 512,
+		.feature_bits	= FEATURE_EITHER_RESET,
+		.tested		= TEST_UNTESTED,
+		.probe		= probe_jedec,
+		.probe_timing	= TIMING_ZERO,  /* Datasheet has no timing info specified */
+		.block_erasers	=
+		{
+			{
+				.eraseblocks = { {512 * 1024, 1} },
+				.block_erase = erase_chip_block_jedec,
+			}
+			/* Chip features an optional permanent write protection
+			 * of the first 16 kB. The erase function is the same as
+			 * above, but 00000H to 03FFFH will not be erased.
+			 * FIXME: add another eraser when partial erasers are
+			 * supported.
+			 */
 		},
+		.printlock	= printlock_at49f,
 		.write		= write_jedec_1,
 		.read		= read_memmapped,
 		.voltage	= {4500, 5500},
diff --git a/flashchips.h b/flashchips.h
index d6cf7577213587d36de13544e22d35168b9ed82a..29bd5bef379ed930f3a931f1c9df170f43d1951a 100644
--- a/flashchips.h
+++ b/flashchips.h
@@ -184,10 +184,11 @@
 #define ATMEL_AT45DB642		/* No ID available */
 #define ATMEL_AT45DB642D	0x2800
 #define ATMEL_AT49BV512		0x03
-#define ATMEL_AT49F020		0x0B
 #define ATMEL_AT49F002N		0x07	/* for AT49F002(N)  */
-#define ATMEL_AT49F002NT		0x08	/* for AT49F002(N)T */
 #define ATMEL_AT49LH002		0xE9
+#define ATMEL_AT49F002NT	0x08	/* for AT49F002(N)T */
+#define ATMEL_AT49F020		0x0B
+#define ATMEL_AT49F040		0x13
 
 /* Bright Microelectronics has the same manufacturer ID as Hyundai... */
 #define BRIGHT_ID		0xAD	/* Bright Microelectronics */
diff --git a/w39.c b/w39.c
index e6dc8deeaf9de24064852aa827fb44dfe19b34f1..5f0c347de2fcbf92b0ea03c388c1f64da1e9da97 100644
--- a/w39.c
+++ b/w39.c
@@ -278,3 +278,11 @@ int unlock_w39v080fa(struct flashctx *flash)
 
 	return 0;
 }
+
+int printlock_at49f(struct flashctx *flash)
+{
+	uint8_t lock = w39_idmode_readb(flash, 0x00002);
+	msg_cdbg("Hardware bootblock lockout is %sactive.\n",
+		 (lock & 0x01) ? "" : "not ");
+	return 0;
+}