Drop remainders of the removed Totalimpact board. Fix typos.
[coreboot.git] / src / mainboard / motorola / sandpoint / nvram / bsp_nvram.c
1 /*
2  * (C) Copyright 2001
3  * Humboldt Solutions Ltd, adrian@humboldt.co.uk.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
18  * MA 02110-1301 USA
19  */
20
21 #include <arch/io.h>
22 #include "../nvram.h"
23
24 static unsigned bsp_size(struct nvram_device *data)
25 {
26     return 8 * 1024;   
27 }
28
29 static int bsp_read_block(struct nvram_device *dev, unsigned offset,
30             unsigned char *data, unsigned length)
31 {
32     unsigned i;
33     
34     for(i = 0; i < length; i++)
35     {
36         outb(((offset + i) >> 8) & 0xff, 0x74);
37         outb((offset + i) & 0xff, 0x75);
38         data[i] = inb(0x76);
39     }
40     return length;
41 }
42    
43 static int bsp_write_byte(struct nvram_device *data, unsigned offset, unsigned char byte)
44 {
45     outb((offset >> 8) & 0xff, 0x74);
46     outb(offset & 0xff, 0x75);
47     outb(byte, 0x76);
48     return 1;
49 }
50
51 nvram_device bsp_nvram = {
52     bsp_size, bsp_read_block, bsp_write_byte, 0, 0   
53 };
54