/* Note that, when this function is called, it doesn't know whether it's swapping the block mark, or swapping it  */
static void mxs_nand_swap_block_mark(struct bch_geometry *geo, uint8_t *data_buf, uint8_t *oob_buf)
/* Note that, when this function is called, it doesn't know whether it's swapping the block mark, or swapping it  */
static void mxs_nand_swap_block_mark(struct bch_geometry *geo, uint8_t *data_buf, uint8_t *oob_buf)
{
	uint32_t bit_offset = geo->block_mark_bit_offset;
	uint32_t buf_offset = geo->block_mark_byte_offset;
	uint32_t src;
	uint32_t dst;
	src = data_buf[buf_offset] >> bit_offset;
	src |= data_buf[buf_offset + 1] << (8 - bit_offset);
	dst = oob_buf[0];
	oob_buf[0] = src;
	data_buf[buf_offset] &= ~(0xff << bit_offset);
	data_buf[buf_offset + 1] &= 0xff << bit_offset;
	data_buf[buf_offset] |= dst << bit_offset;
	data_buf[buf_offset + 1] |= dst >> (8 - bit_offset);
}