diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c
index e23ec55..bf5a4cb 100644
--- a/board/esd/cpci405/cpci405.c
+++ b/board/esd/cpci405/cpci405.c
@@ -24,13 +24,7 @@
 const unsigned char fpgadata[] =
 {
 #if defined(CONFIG_CPCI405_VER2)
-# if defined(CONFIG_CPCI405AB)
-#  include "fpgadata_cpci405ab.c"
-# else
-#  include "fpgadata_cpci4052.c"
-# endif
-#else
-# include "fpgadata_cpci405.c"
+# include "fpgadata_cpci4052.c"
 #endif
 };
 
@@ -38,37 +32,6 @@
  * include common fpga code (for esd boards)
  */
 #include "../common/fpga.c"
-#include "../common/auto_update.h"
-
-#if defined(CONFIG_CPCI405AB)
-au_image_t au_image[] = {
-	{"cpci405ab/preinst.img", 0, -1, AU_SCRIPT},
-	{"cpci405ab/pImage", 0xffc00000, 0x000c0000, AU_NOR},
-	{"cpci405ab/pImage.initrd", 0xffcc0000, 0x00300000, AU_NOR},
-	{"cpci405ab/u-boot.img", 0xfffc0000, 0x00040000, AU_FIRMWARE},
-	{"cpci405ab/postinst.img", 0, 0, AU_SCRIPT},
-};
-#else
-#if defined(CONFIG_CPCI405_VER2)
-au_image_t au_image[] = {
-	{"cpci4052/preinst.img", 0, -1, AU_SCRIPT},
-	{"cpci4052/pImage", 0xffc00000, 0x000c0000, AU_NOR},
-	{"cpci4052/pImage.initrd", 0xffcc0000, 0x00300000, AU_NOR},
-	{"cpci4052/u-boot.img", 0xfffc0000, 0x00040000, AU_FIRMWARE},
-	{"cpci4052/postinst.img", 0, 0, AU_SCRIPT},
-};
-#else
-au_image_t au_image[] = {
-	{"cpci405/preinst.img", 0, -1, AU_SCRIPT},
-	{"cpci405/pImage", 0xffc00000, 0x000c0000, AU_NOR},
-	{"cpci405/pImage.initrd", 0xffcc0000, 0x00310000, AU_NOR},
-	{"cpci405/u-boot.img", 0xfffd0000, 0x00030000, AU_FIRMWARE},
-	{"cpci405/postinst.img", 0, 0, AU_SCRIPT},
-};
-#endif
-#endif
-
-int N_AU_IMAGES = (sizeof(au_image) / sizeof(au_image[0]));
 
 /* Prototypes */
 int cpci405_version(void);
@@ -530,240 +493,3 @@
 	return 0;
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
-
-#if defined(CONFIG_CPCI405AB)
-#define ONE_WIRE_CLEAR	 out_be16((void*)(CONFIG_SYS_FPGA_BASE_ADDR +	\
-					  CONFIG_SYS_FPGA_MODE),	\
-				  in_be16((void*)(CONFIG_SYS_FPGA_BASE_ADDR + \
-						  CONFIG_SYS_FPGA_MODE)) | \
-					  CONFIG_SYS_FPGA_MODE_1WIRE_DIR)
-
-#define ONE_WIRE_SET	 out_be16((void*)(CONFIG_SYS_FPGA_BASE_ADDR +	\
-					  CONFIG_SYS_FPGA_MODE),	\
-				  in_be16((void*)(CONFIG_SYS_FPGA_BASE_ADDR + \
-						  CONFIG_SYS_FPGA_MODE)) & \
-					  ~CONFIG_SYS_FPGA_MODE_1WIRE_DIR)
-
-#define ONE_WIRE_GET	 (in_be16((void*)(CONFIG_SYS_FPGA_BASE_ADDR + \
-					  CONFIG_SYS_FPGA_STATUS)) &  \
-			  CONFIG_SYS_FPGA_MODE_1WIRE)
-
-/*
- * Generate a 1-wire reset, return 1 if no presence detect was found,
- * return 0 otherwise.
- * (NOTE: Does not handle alarm presence from DS2404/DS1994)
- */
-int OWTouchReset(void)
-{
-	int result;
-
-	ONE_WIRE_CLEAR;
-	udelay(480);
-	ONE_WIRE_SET;
-	udelay(70);
-
-	result = ONE_WIRE_GET;
-
-	udelay(410);
-	return result;
-}
-
-/*
- * Send 1 a 1-wire write bit.
- * Provide 10us recovery time.
- */
-void OWWriteBit(int bit)
-{
-	if (bit) {
-		/*
-		 * write '1' bit
-		 */
-		ONE_WIRE_CLEAR;
-		udelay(6);
-		ONE_WIRE_SET;
-		udelay(64);
-	} else {
-		/*
-		 * write '0' bit
-		 */
-		ONE_WIRE_CLEAR;
-		udelay(60);
-		ONE_WIRE_SET;
-		udelay(10);
-	}
-}
-
-/*
- * Read a bit from the 1-wire bus and return it.
- * Provide 10us recovery time.
- */
-int OWReadBit(void)
-{
-	int result;
-
-	ONE_WIRE_CLEAR;
-	udelay(6);
-	ONE_WIRE_SET;
-	udelay(9);
-
-	result = ONE_WIRE_GET;
-
-	udelay(55);
-	return result;
-}
-
-void OWWriteByte(int data)
-{
-	int loop;
-
-	for (loop = 0; loop < 8; loop++) {
-		OWWriteBit(data & 0x01);
-		data >>= 1;
-	}
-}
-
-int OWReadByte(void)
-{
-	int loop, result = 0;
-
-	for (loop = 0; loop < 8; loop++) {
-		result >>= 1;
-		if (OWReadBit())
-			result |= 0x80;
-	}
-
-	return result;
-}
-
-int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	unsigned short val;
-	int result;
-	int i;
-	unsigned char ow_id[6];
-	char str[32];
-
-	/*
-	 * Clear 1-wire bit (open drain with pull-up)
-	 */
-	val = in_be16((void*)(CONFIG_SYS_FPGA_BASE_ADDR +
-			      CONFIG_SYS_FPGA_MODE));
-	val &= ~CONFIG_SYS_FPGA_MODE_1WIRE; /* clear 1-wire bit */
-	out_be16((void*)(CONFIG_SYS_FPGA_BASE_ADDR +
-			 CONFIG_SYS_FPGA_MODE), val);
-
-	result = OWTouchReset();
-	if (result != 0)
-		puts("No 1-wire device detected!\n");
-
-	OWWriteByte(0x33); /* send read rom command */
-	OWReadByte(); /* skip family code ( == 0x01) */
-	for (i = 0; i < 6; i++)
-		ow_id[i] = OWReadByte();
-	OWReadByte(); /* read crc */
-
-	sprintf(str, "%02X%02X%02X%02X%02X%02X",
-		ow_id[0], ow_id[1], ow_id[2], ow_id[3], ow_id[4], ow_id[5]);
-	printf("Setting environment variable 'ow_id' to %s\n", str);
-	setenv("ow_id", str);
-
-	return 0;
-}
-U_BOOT_CMD(
-	onewire,	1,	1,	do_onewire,
-	"Read 1-write ID",
-	""
-);
-
-#define CONFIG_SYS_I2C_EEPROM_ADDR_2 0x51 /* EEPROM CAT24WC32 */
-#define CONFIG_ENV_SIZE_2 0x800 /* 2048 bytes may be used for env vars */
-
-/*
- * Write backplane ip-address...
- */
-int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	char *buf;
-	ulong crc;
-	char str[32];
-	char *ptr;
-	IPaddr_t ipaddr;
-
-	buf = malloc(CONFIG_ENV_SIZE_2);
-	if (eeprom_read(CONFIG_SYS_I2C_EEPROM_ADDR_2, 0,
-			(uchar *)buf, CONFIG_ENV_SIZE_2))
-		puts("\nError reading backplane EEPROM!\n");
-	else {
-		crc = crc32(0, (uchar *)(buf+4), CONFIG_ENV_SIZE_2 - 4);
-		if (crc != *(ulong *)buf) {
-			printf("ERROR: crc mismatch %08lx %08lx\n",
-			       crc, *(ulong *)buf);
-			return -1;
-		}
-
-		/*
-		 * Find bp_ip
-		 */
-		ptr = strstr(buf+4, "bp_ip=");
-		if (ptr == NULL) {
-			printf("ERROR: bp_ip not found!\n");
-			return -1;
-		}
-		ptr += 6;
-		ipaddr = string_to_ip(ptr);
-
-		/*
-		 * Update whole ip-addr
-		 */
-		sprintf(str, "%pI4", &ipaddr);
-		setenv("ipaddr", str);
-		printf("Updated ip_addr from bp_eeprom to %s!\n", str);
-	}
-
-	free(buf);
-
-	return 0;
-}
-U_BOOT_CMD(
-	getbpip,	1,	1,	do_get_bpip,
-	"Update IP-Address with Backplane IP-Address",
-	""
-);
-
-/*
- * Set and print backplane ip...
- */
-int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	char *buf;
-	char str[32];
-	ulong crc;
-
-	if (argc < 2) {
-		puts("ERROR!\n");
-		return -1;
-	}
-
-	printf("Setting bp_ip to %s\n", argv[1]);
-	buf = malloc(CONFIG_ENV_SIZE_2);
-	memset(buf, 0, CONFIG_ENV_SIZE_2);
-	sprintf(str, "bp_ip=%s", argv[1]);
-	strcpy(buf+4, str);
-	crc = crc32(0, (uchar *)(buf+4), CONFIG_ENV_SIZE_2 - 4);
-	*(ulong *)buf = crc;
-
-	if (eeprom_write(CONFIG_SYS_I2C_EEPROM_ADDR_2,
-			 0, (uchar *)buf, CONFIG_ENV_SIZE_2))
-		puts("\nError writing backplane EEPROM!\n");
-
-	free(buf);
-
-	return 0;
-}
-U_BOOT_CMD(
-	setbpip,	2,	1,	do_set_bpip,
-	"Write Backplane IP-Address",
-	""
-);
-
-#endif /* CONFIG_CPCI405AB */
