/* This is different than the linux version. Switching between chips is done via board_nand_select_device(). The Linux select_chip function used here in U-Boot has only 2 valid chip numbers: 0 select -1 deselect Implement it as a weak default, so that boards with a specific chip-select routine can use their own function.  */
void __mpc5121_nfc_select_chip(struct mtd_info *mtd, int chip)
/* This is different than the linux version. Switching between chips is done via board_nand_select_device(). The Linux select_chip function used here in U-Boot has only 2 valid chip numbers: 0 select -1 deselect Implement it as a weak default, so that boards with a specific chip-select routine can use their own function.  */
void __mpc5121_nfc_select_chip(struct mtd_info *mtd, int chip)
{
	if (chip < 0) {
		nfc_clear(mtd, NFC_CONFIG1, NFC_CE);
		return;
	}
	nfc_clear(mtd, NFC_BUF_ADDR, NFC_ACTIVE_CS_MASK);
	nfc_set(mtd, NFC_BUF_ADDR, (chip << NFC_ACTIVE_CS_SHIFT) &
		NFC_ACTIVE_CS_MASK);
	nfc_set(mtd, NFC_CONFIG1, NFC_CE);
}