* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
/*
{
struct mxc_nf_controller *mxc_nf_info;
int hwecc_needed;
- int x;
mxc_nf_info = malloc(sizeof(struct mxc_nf_controller));
if (mxc_nf_info == NULL) {
mxc_nf_info->flags.biswap_enabled = 1;
}
- /*
- * testing host endianness
- */
- x = 1;
- if (*(char *) &x == 1)
- mxc_nf_info->flags.host_little_endian = 1;
- else
- mxc_nf_info->flags.host_little_endian = 0;
return ERROR_OK;
}
static const struct command_registration mxc_sub_command_handlers[] = {
{
.name = "biswap",
+ .mode = COMMAND_EXEC,
.handler = handle_mxc_biswap_command,
.help = "Turns on/off bad block information swaping from main area, "
"without parameter query status.",
.name = "mxc",
.mode = COMMAND_ANY,
.help = "MXC NAND flash controller commands",
- .chain = mxc_sub_command_handlers
+ .chain = mxc_sub_command_handlers,
+ .usage = "",
},
COMMAND_REGISTRATION_DONE
};
swap2 = (swap1 << 8) | (swap2 & 0xFF);
target_write_u16(target, MXC_NF_MAIN_BUFFER3 + 464, new_swap1);
if (nfc_is_v1())
- target_write_u16(target, MXC_NF_V1_SPARE_BUFFER3, swap2);
+ target_write_u16(target, MXC_NF_V1_SPARE_BUFFER3 + 4, swap2);
else
target_write_u16(target, MXC_NF_V2_SPARE_BUFFER3, swap2);
}
/* BI-swap - work-around of mxc NFC for NAND device with page == 2k */
target_read_u16(target, MXC_NF_MAIN_BUFFER3 + 464, &swap1);
if (nfc_is_v1())
- SPARE_BUFFER3 = MXC_NF_V1_SPARE_BUFFER3;
+ SPARE_BUFFER3 = MXC_NF_V1_SPARE_BUFFER3 + 4;
else
SPARE_BUFFER3 = MXC_NF_V2_SPARE_BUFFER3;
target_read_u16(target, SPARE_BUFFER3, &swap2);