source: rtems/c/src/lib/libbsp/arm/nds/block/block.c @ ef4c461

4.115
Last change on this file since ef4c461 was ef4c461, checked in by Joel Sherrill <joel.sherrill@…>, on 10/09/14 at 20:35:10

arm/nds: Warning clean up

This patch eliminates most of the warnings in this BSP but attempts
very little clean up. This BSP includes copies of a lot of code
from free NDS libraries and modifications should be kept to a minimum.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 * RTEMS for Nintendo DS flash driver.
3 */
4
5/*
6 * Copyright (c) 2008 by Matthieu Bucchianeri <mbucchia@gmail.com>
7 *
8 * The license and distribution terms for this file may be
9 * found in the file LICENSE in this distribution or at
10 *
11 * http://www.rtems.org/license/LICENSE
12 */
13
14#include <rtems.h>
15#include <bsp.h>
16#include <libchip/ide_ctrl.h>
17#include <libchip/ide_ctrl_cfg.h>
18#include <libchip/ide_ctrl_io.h>
19
20#include <disc.h>
21
22static bool
23nds_flash_probe (int minor)
24{
25  return true;
26}
27
28static void
29nds_flash_initialize (int minor)
30{
31  const IO_INTERFACE *flash;
32
33  printk ("[+] flash started\n");
34
35  flash = _FAT_disc_dsSlotFindInterface ();
36  if (flash == NULL) {
37    printk ("[!] error getting device\n");
38    rtems_fatal_error_occurred (0);
39  }
40
41  if (_FAT_disc_isInserted (flash)) {
42    printk ("[#] flash inserted\n");
43  } else {
44    printk ("[!] flash not inserted\n");
45  }
46}
47
48static void
49nds_flash_read_reg (int minor, int reg, uint16_t * value)
50{
51  printk ("nds_flash_read_reg\n");
52}
53
54static void
55nds_flash_write_reg (int minor, int reg, uint16_t value)
56{
57  printk ("nds_flash_write_reg\n");
58}
59
60static void
61nds_flash_read_block (int minor, uint32_t block_size,
62                      rtems_blkdev_sg_buffer * bufs,
63                      uint32_t * cbuf, uint32_t * pos)
64{
65  printk ("nds_flash_read_block\n");
66}
67
68static void
69nds_flash_write_block (int minor, uint32_t block_size,
70                       rtems_blkdev_sg_buffer * bufs,
71                       uint32_t * cbuf, uint32_t * pos)
72{
73  printk ("nds_flash_write_block\n");
74}
75
76static int
77nds_flash_control (int minor, uint32_t cmd, void *arg)
78{
79  printk ("nds_flash_control\n");
80  return 0;
81}
82
83static rtems_status_code
84nds_flash_io_speed (int minor, uint16_t mode)
85{
86  return RTEMS_SUCCESSFUL;
87}
88
89ide_ctrl_fns_t nds_flash_ctrl_fns = {
90  nds_flash_probe,
91  nds_flash_initialize,
92  nds_flash_control,
93  nds_flash_read_reg,
94  nds_flash_write_reg,
95  nds_flash_read_block,
96  nds_flash_write_block,
97  nds_flash_io_speed
98};
99
100/* IDE controllers Table */
101ide_controller_bsp_table_t IDE_Controller_Table[] = {
102  {
103   "/dev/flash",
104   IDE_CUSTOM,                  /* standard IDE controller */
105   &nds_flash_ctrl_fns,
106   NULL,                        /* probe for IDE standard registers */
107   FALSE,                       /* not (yet) initialized */
108   0x0,                         /* base I/O address for first IDE controller */
109   FALSE, 0,                    /* not (yet) interrupt driven */
110   NULL
111  }
112};
113
114/* Number of rows in IDE_Controller_Table */
115unsigned long IDE_Controller_Count = 1;
Note: See TracBrowser for help on using the repository browser.