source: rtems/bsps/arm/lpc32xx/nand/nand-select.c @ ba619b7f

Last change on this file since ba619b7f was ba619b7f, checked in by Joel Sherrill <joel@…>, on 03/01/22 at 21:38:20

bsps/arm/: Scripted embedded brains header file clean up

Updates #4625.

  • Property mode set to 100644
File size: 967 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSBSPsARMLPC32XX
5 *
6 * @brief NAND controller selection.
7 */
8
9/*
10 * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
11 *
12 * The license and distribution terms for this file may be
13 * found in the file LICENSE in this distribution or at
14 * http://www.rtems.org/license/LICENSE.
15 */
16
17#include <bsp.h>
18#include <bsp/lpc32xx.h>
19#include <bsp/nand-mlc.h>
20
21void lpc32xx_select_nand_controller(lpc32xx_nand_controller nand_controller)
22{
23  uint32_t flashclk_ctrl = LPC32XX_FLASHCLK_CTRL & ~(FLASHCLK_IRQ_MLC
24    | FLASHCLK_SELECT_SLC | FLASHCLK_MLC_CLK_ENABLE | FLASHCLK_SLC_CLK_ENABLE);
25
26  switch (nand_controller) {
27    case LPC32XX_NAND_CONTROLLER_MLC:
28      flashclk_ctrl |= FLASHCLK_IRQ_MLC | FLASHCLK_MLC_CLK_ENABLE;
29      break;
30    case LPC32XX_NAND_CONTROLLER_SLC:
31      flashclk_ctrl |= FLASHCLK_SELECT_SLC | FLASHCLK_SLC_CLK_ENABLE;
32      break;
33    default:
34      break;
35  }
36
37  LPC32XX_FLASHCLK_CTRL = flashclk_ctrl;
38}
Note: See TracBrowser for help on using the repository browser.