4.104.114.84.95
Last change
on this file since 19ca797 was
19ca797,
checked in by Joel Sherrill <joel.sherrill@…>, on 10/04/99 at 20:41:28
|
Motorola MVME2307 BSP submitted by Jay Kulpinski <jskulpin@…>.
No modifications made.
|
-
Property mode set to
100644
|
File size:
628 bytes
|
Line | |
---|
1 | #include <bsp.h> |
---|
2 | |
---|
3 | #define ram_addr_low (* (volatile char *) IO_TO_LOCAL(0x0074)) |
---|
4 | #define ram_addr_high (* (volatile char *) IO_TO_LOCAL(0x0075)) |
---|
5 | #define ram_data (* (volatile char *) IO_TO_LOCAL(0x0077)) |
---|
6 | #define ram_end_addr 0x1ff8 |
---|
7 | |
---|
8 | int read_nvram(char *buff, int offset, int len) { |
---|
9 | int i; |
---|
10 | |
---|
11 | if (offset < 0 || offset >= ram_end_addr) { |
---|
12 | return 0; |
---|
13 | } |
---|
14 | if (offset + len > ram_end_addr) { |
---|
15 | len = ram_end_addr - offset; |
---|
16 | } |
---|
17 | for (i = 0; i < len; i++) { |
---|
18 | ram_addr_high = offset >> 8; |
---|
19 | ram_addr_low = offset; |
---|
20 | *buff++ = ram_data; |
---|
21 | offset++; |
---|
22 | } |
---|
23 | return len; |
---|
24 | } |
---|
25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.