summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/lm32/shared/milkymist_flash/milkymist_flash.h
blob: f8d5532f849b84afaa6f5f90b0fe8ab3d7d9a66c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*  milkymist_flash.h
 *  
 *  Copyright (C) 2010 Sebastien Bourdeauducq
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 *
 *  $Id$
 *
 */

#ifndef __MILKYMIST_FLASH_H_
#define __MILKYMIST_FLASH_H_

/* Ioctls */
#define FLASH_GET_SIZE            0x4600
#define FLASH_GET_BLOCKSIZE       0x4601
#define FLASH_ERASE_BLOCK         0x4602

struct flash_partition {
	unsigned int start_address;
	unsigned int length;
};

rtems_device_driver flash_initialize(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

rtems_device_driver flash_read(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

rtems_device_driver flash_write(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

rtems_device_driver flash_control(
  rtems_device_major_number major,
  rtems_device_minor_number minor,
  void *arg
);

#define FLASH_DRIVER_TABLE_ENTRY {flash_initialize, \
NULL, NULL, flash_read, flash_write, flash_control}

#endif /* __MILKYMIST_FLASH_H_ */