annotate packages/hal/powerpc/adder/current/src/adder_flash.c @ 2631:13376f3cfc60 jifl-post-flashv2-merge-20081118

Merge flashv2 branch to trunk, with eCosCentric additions
author jlarmour
date Tue, 18 Nov 2008 01:28:11 +0000
parents
children 74dbf4c3f2e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2631
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
1 //==========================================================================
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
2 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
3 // adder_flash.c
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
4 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
5 // Support for the external AMD flash device on Adder boards
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
6 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
7 //==========================================================================
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
8 //####ECOSGPLCOPYRIGHTBEGIN####
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
9 // -------------------------------------------
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
10 // This file is part of eCos, the Embedded Configurable Operating System.
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
11 // Copyright (C) 2004, 2006, 2008 eCosCentric Limited
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
12 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
13 // eCos is free software; you can redistribute it and/or modify it under
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
14 // the terms of the GNU General Public License as published by the Free
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
15 // Software Foundation; either version 2 or (at your option) any later version.
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
16 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
17 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
18 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
19 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
20 // for more details.
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
21 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
22 // You should have received a copy of the GNU General Public License along
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
23 // with eCos; if not, write to the Free Software Foundation, Inc.,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
24 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
25 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
26 // As a special exception, if other files instantiate templates or use macros
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
27 // or inline functions from this file, or you compile this file and link it
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
28 // with other works to produce a work based on this file, this file does not
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
29 // by itself cause the resulting work to be covered by the GNU General Public
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
30 // License. However the source code for this file must still be made available
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
31 // in accordance with section (3) of the GNU General Public License.
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
32 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
33 // This exception does not invalidate any other reasons why a work based on
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
34 // this file might be covered by the GNU General Public License.
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
35 // -------------------------------------------
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
36 //####ECOSGPLCOPYRIGHTEND####
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
37 //==========================================================================
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
38 //#####DESCRIPTIONBEGIN####
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
39 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
40 // Author(s): bartv
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
41 // Date: 2004-11-25
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
42 //
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
43 //####DESCRIPTIONEND####
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
44 //=============================================================================
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
45
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
46 // There is a single AMD AM29LV320D device. DevId 22F6, 4MB, 63*64K,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
47 // 8*8K.
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
48
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
49 #include <pkgconf/system.h>
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
50 #ifdef CYGPKG_IO_FLASH
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
51 #include <cyg/io/flash.h>
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
52 #include <cyg/io/flash_dev.h>
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
53 #include <cyg/io/am29xxxxx_dev.h>
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
54
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
55 static const CYG_FLASH_FUNS(hal_adder_flash_amd_funs,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
56 &cyg_am29xxxxx_init_cfi_16,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
57 &cyg_flash_devfn_query_nop,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
58 &cyg_am29xxxxx_erase_16,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
59 &cyg_am29xxxxx_program_16,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
60 (int (*)(struct cyg_flash_dev*, const cyg_flashaddr_t, void*, size_t))0,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
61 &cyg_flash_devfn_lock_nop,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
62 &cyg_flash_devfn_unlock_nop);
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
63
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
64 static cyg_am29xxxxx_dev hal_adder_flash_priv = {
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
65 .devid = 0x22F6,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
66 .block_info = {
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
67 { 0, 0 },
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
68 { 0, 0 },
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
69 { 0, 0 },
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
70 { 0, 0 }
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
71 }
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
72 };
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
73
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
74 CYG_FLASH_DRIVER(hal_adder_flash,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
75 &hal_adder_flash_amd_funs,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
76 0,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
77 0xFE000000,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
78 0xFE3FFFFF,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
79 4,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
80 hal_adder_flash_priv.block_info,
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
81 &hal_adder_flash_priv
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
82 );
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
83 #endif // CYGPKG_IO_FLASH
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
84
13376f3cfc60 Merge flashv2 branch to trunk, with eCosCentric additions
jlarmour
parents:
diff changeset
85 // EOF adder_flash.c