From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Mon, 7 May 2012 11:14:50 -0500 Subject: [U-Boot] nand_get_device() and nand_release_device() Message-ID: <4FA7F4FA.1080900@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Scott, As you know, the P1022 has this weird LBC/DIU muxing problem. I'd like to add support for the 'nand' command while the DIU is active. Looking at the NAND code, I see functions nand_get_device() and nand_release_device(). What is the idea behind these functions? Would it make sense to do something like this: static int __board_start_nand(void) { return 0; } int board_start_nand(void) __attribute__((weak, alias("__board_start_nand"))); static void __board_finish_nand(void) { } void board_finish_nand(void) __attribute__((weak, alias("__board_finish_nand"))); static int nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state) { chip->state = new_state; return board_start_nand(); } static void nand_release_device(struct mtd_info *mtd) { struct nand_chip *chip = mtd->priv; board_finish_nand(); /* De-select the NAND device */ chip->select_chip(mtd, -1); } -- Timur Tabi Linux kernel developer at Freescale