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

Last change on this file since 43250167 was 43250167, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 25, 2018 at 8:36:52 AM

bsp/lpc32xx: Move source files to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

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