Commit b5b49b2e authored by Zhang Bo's avatar Zhang Bo Committed by Jason Liu

MA-10477[Android] Remove NAND partition definitions and operations in bcb

Remove NAND partitions definitions in .h file.
Remove NAND related bcb operations.

Change-Id: I38774732e80f0402d63ea6d3f862e385f3e01e31
Signed-off-by: default avatarZhang Bo <bo.zhang@nxp.com>
parent b275a005
......@@ -6,12 +6,8 @@
#include <common.h>
#include <g_dnl.h>
#ifdef CONFIG_FASTBOOT_STORAGE_NAND
#include <nand.h>
#endif
#include "bcb.h"
#ifndef CONFIG_FASTBOOT_STORAGE_NAND
int bcb_read_command(char *command)
{
int ret = 0;
......@@ -64,57 +60,3 @@ int bcb_write_command(char *bcb_command)
free(p_block);
return 0;
}
#else
#define ALIGN_BYTES 64
#define MISC_PAGES 3
int bcb_read_command(char *command)
{
char read_cmd[128];
char *addr_str;
char *nand_str;
ulong misc_info_size;
struct mtd_info *nand = nand_info[0];
if (command == NULL)
return -1;
memset(read_cmd, 0, 128);
misc_info_size = MISC_PAGES * nand->writesize;
nand_str = (char *)memalign(ALIGN_BYTES, misc_info_size);
sprintf(read_cmd, "nand read 0x%x ${misc_nand_offset} \
0x%x", nand_str, misc_info_size);
run_command(read_cmd, 0);
/* The offset of bootloader_message is 1 PAGE.
* The offset of bootloader_message and the size of misc info
* need align with user space and recovery.
*/
addr_str = nand_str + nand->writesize;
memcpy(command, (char *)addr_str, 32);
free(nand_str);
return 0;
}
int bcb_write_command(char *command)
{
char cmd[128];
char *addr_str;
char *nand_str;
ulong misc_info_size;
struct mtd_info *nand = nand_info[0];
if (command == NULL)
return -1;
memset(cmd, 0, 128);
misc_info_size = MISC_PAGES * nand->writesize;
nand_str = (char *)memalign(ALIGN_BYTES, misc_info_size);
sprintf(cmd, "nand read 0x%x ${misc_nand_offset} \
0x%x", nand_str, misc_info_size);
run_command(cmd, 0);
/* the offset of bootloader_message is 1 PAGE*/
addr_str = nand_str + nand->writesize;
memcpy((char *)addr_str, command, 32);
/* erase 3 pages which hold BCB struct.*/
sprintf(cmd, "nand erase ${misc_nand_offset} 0x%x",nand->erasesize);
run_command(cmd, 0);
sprintf(cmd, "nand write 0x%x ${misc_nand_offset} 0x%x",nand_str, misc_info_size);
run_command(cmd, 0);
free(nand_str);
return 0;
}
#endif
......@@ -23,19 +23,13 @@
#define CONFIG_FSL_FASTBOOT
#define CONFIG_ANDROID_RECOVERY
#if defined CONFIG_NAND_BOOT
#define CONFIG_FASTBOOT_STORAGE_NAND
#elif defined CONFIG_SYS_BOOT_SATA
#if defined CONFIG_SYS_BOOT_SATA
#define CONFIG_FASTBOOT_STORAGE_SATA
#define CONFIG_FASTBOOT_SATA_NO 0
#else
#define CONFIG_FASTBOOT_STORAGE_MMC
#endif
#if defined(CONFIG_FASTBOOT_STORAGE_NAND)
#define ANDROID_FASTBOOT_NAND_PARTS "16m@64m(boot) 16m@80m(recovery) 1m@96m(misc) 810m@97m(android_root)ubifs"
#endif
#define CONFIG_CMD_BOOTA
#define CONFIG_SUPPORT_RAW_INITRD
#define CONFIG_SERIAL_TAG
......
......@@ -23,19 +23,13 @@
#define CONFIG_FSL_FASTBOOT
#define CONFIG_ANDROID_RECOVERY
#if defined CONFIG_NAND_BOOT
#define CONFIG_FASTBOOT_STORAGE_NAND
#elif defined CONFIG_SYS_BOOT_SATA
#if defined CONFIG_SYS_BOOT_SATA
#define CONFIG_FASTBOOT_STORAGE_SATA
#define CONFIG_FASTBOOT_SATA_NO 0
#else
#define CONFIG_FASTBOOT_STORAGE_MMC
#endif
#if defined(CONFIG_FASTBOOT_STORAGE_NAND)
#define ANDROID_FASTBOOT_NAND_PARTS "16m@64m(boot) 16m@80m(recovery) 1m@96m(misc) 810m@97m(android_root)ubifs"
#endif
#define CONFIG_CMD_BOOTA
#define CONFIG_SUPPORT_RAW_INITRD
#define CONFIG_SERIAL_TAG
......
......@@ -24,19 +24,13 @@
#define CONFIG_FSL_FASTBOOT
#define CONFIG_ANDROID_RECOVERY
#if defined CONFIG_NAND_BOOT
#define CONFIG_FASTBOOT_STORAGE_NAND
#elif defined CONFIG_SYS_BOOT_SATA
#if defined CONFIG_SYS_BOOT_SATA
#define CONFIG_FASTBOOT_STORAGE_SATA
#define CONFIG_FASTBOOT_SATA_NO 0
#else
#define CONFIG_FASTBOOT_STORAGE_MMC
#endif
#if defined(CONFIG_FASTBOOT_STORAGE_NAND)
#define ANDROID_FASTBOOT_NAND_PARTS "16m@64m(boot) 16m@80m(recovery) 1m@96m(misc) 810m@97m(android_root)ubifs"
#endif
#define CONFIG_CMD_BOOTA
#define CONFIG_SUPPORT_RAW_INITRD
#define CONFIG_SERIAL_TAG
......
......@@ -8,8 +8,7 @@
#ifndef MX6_SABRE_ANDROID_COMMON_H
#define MX6_SABRE_ANDROID_COMMON_H
#include "mx_android_common.h"
/* For NAND we don't support lock/unlock */
#ifndef CONFIG_NAND_BOOT
#define CONFIG_FASTBOOT_LOCK
#define FSL_FASTBOOT_FB_DEV "mmc"
#define FASTBOOT_ENCRYPT_LOCK
......@@ -17,10 +16,5 @@
#define CONFIG_CMD_FSL_CAAM_KB
#define CONFIG_SHA1
#define CONFIG_SHA256
#endif
#if defined(CONFIG_NAND_BOOT)
#define ANDROID_FASTBOOT_NAND_PARTS "16m@64m(boot) 16m@80m(recovery) 1m@96m(misc) 810m@97m(android_root)ubifs"
#endif
#endif /* MX6_SABRE_ANDROID_COMMON_H */
......@@ -10,8 +10,6 @@
#define __MX6SX_SABREAUTO_ANDROID_H
#include "mx_android_common.h"
/* For NAND we don't support lock/unlock */
#ifndef CONFIG_NAND_BOOT
#define CONFIG_FASTBOOT_LOCK
#define FSL_FASTBOOT_FB_DEV "mmc"
#define FASTBOOT_ENCRYPT_LOCK
......@@ -19,11 +17,5 @@
#define CONFIG_CMD_FSL_CAAM_KB
#define CONFIG_SHA1
#define CONFIG_SHA256
#endif
#if defined(CONFIG_FASTBOOT_STORAGE_NAND)
#define ANDROID_FASTBOOT_NAND_PARTS "16m@64m(boot) 16m@80m(recovery) 1m@96m(misc) 810m@97m(android_root)ubifs"
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment