aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/motorola/sandpoint/nvram
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2009-10-02 03:36:30 +0000
committerRonald G. Minnich <rminnich@gmail.com>2009-10-02 03:36:30 +0000
commit4703bf16190f1a54faa6697b514ae9cce56c19ea (patch)
treed3cf8b7bf86e6c085990081e3a857f33565a684b /src/mainboard/motorola/sandpoint/nvram
parent5bf864e353036535551f97dbeaf2c069ba60d79d (diff)
Remove motorola PPC boards. These have lain untouched and unused by anyone
for years. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4708 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/mainboard/motorola/sandpoint/nvram')
-rw-r--r--src/mainboard/motorola/sandpoint/nvram/Config.lb2
-rw-r--r--src/mainboard/motorola/sandpoint/nvram/bsp_nvram.c54
-rw-r--r--src/mainboard/motorola/sandpoint/nvram/nvram.c117
3 files changed, 0 insertions, 173 deletions
diff --git a/src/mainboard/motorola/sandpoint/nvram/Config.lb b/src/mainboard/motorola/sandpoint/nvram/Config.lb
deleted file mode 100644
index b4ce01bfd0..0000000000
--- a/src/mainboard/motorola/sandpoint/nvram/Config.lb
+++ /dev/null
@@ -1,2 +0,0 @@
-object bsp_nvram.o
-object nvram.o
diff --git a/src/mainboard/motorola/sandpoint/nvram/bsp_nvram.c b/src/mainboard/motorola/sandpoint/nvram/bsp_nvram.c
deleted file mode 100644
index 79c28b8701..0000000000
--- a/src/mainboard/motorola/sandpoint/nvram/bsp_nvram.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * (C) Copyright 2001
- * Humboldt Solutions Ltd, adrian@humboldt.co.uk.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#include <arch/io.h>
-#include "../nvram.h"
-
-static unsigned bsp_size(struct nvram_device *data)
-{
- return 8 * 1024;
-}
-
-static int bsp_read_block(struct nvram_device *dev, unsigned offset,
- unsigned char *data, unsigned length)
-{
- unsigned i;
-
- for(i = 0; i < length; i++)
- {
- outb(((offset + i) >> 8) & 0xff, 0x74);
- outb((offset + i) & 0xff, 0x75);
- data[i] = inb(0x76);
- }
- return length;
-}
-
-static int bsp_write_byte(struct nvram_device *data, unsigned offset, unsigned char byte)
-{
- outb((offset >> 8) & 0xff, 0x74);
- outb(offset & 0xff, 0x75);
- outb(byte, 0x76);
- return 1;
-}
-
-nvram_device bsp_nvram = {
- bsp_size, bsp_read_block, bsp_write_byte, 0, 0
-};
-
diff --git a/src/mainboard/motorola/sandpoint/nvram/nvram.c b/src/mainboard/motorola/sandpoint/nvram/nvram.c
deleted file mode 100644
index 93e0eec572..0000000000
--- a/src/mainboard/motorola/sandpoint/nvram/nvram.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2000 AG Electronics Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <console/console.h>
-#include <stdlib.h>
-#include "../nvram.h"
-
-/* NVRAM layout
- *
- * Environment variable record runs:
- * [length]NAME=value[length]NAME=value[0]\0
- * A deleted variable is:
- * [length]\0AME=value
- *
- * When memory is full, we compact.
- *
- */
-static nvram_device *nvram_dev = 0;
-static unsigned char *nvram_buffer = 0;
-static unsigned nvram_size = 0;
-static uint8_t nvram_csum = 0;
-#define NVRAM_INVALID (! nvram_dev)
-
-static void update_device(unsigned i, unsigned char data)
-{
- if (i < nvram_size)
- {
- nvram_csum -= nvram_buffer[i];
- nvram_buffer[i] = data;
- nvram_dev->write_byte(nvram_dev, i, data);
- nvram_csum += data;
- }
- else
- printk_info("Offset %d out of range in nvram\n", i);
-}
-
-static void update_csum(void)
-{
- nvram_dev->write_byte(nvram_dev, nvram_size, nvram_csum);
- if (nvram_dev->commit)
- nvram_dev->commit(nvram_dev);
-}
-
-static void update_string_device(unsigned i, const unsigned char *data,
- unsigned len)
-{
- if (i + len < nvram_size)
- {
- unsigned j;
- for(j = 0; j < len; j++)
- {
- nvram_csum -= nvram_buffer[i];
- nvram_buffer[i] = *data;
- nvram_dev->write_byte(nvram_dev, i, *data);
- nvram_csum += *data;
- data++;
- i++;
- }
- }
- else
- printk_info("Offset %d out of range in nvram\n", i + len);
-}
-
-int nvram_init (struct nvram_device *dev)
-{
- nvram_dev = dev;
-
- if (! nvram_size)
- nvram_size = dev->size(dev) - 1;
- printk_info("NVRAM size is %d\n", nvram_size);
- if (!nvram_buffer)
- {
- unsigned i;
-
- nvram_buffer = malloc (nvram_size);
- if (!nvram_buffer)
- return -1;
-
- nvram_csum = 0;
- dev->read_block(dev, 0, nvram_buffer, nvram_size+1);
- for(i = 0; i < nvram_size; i++)
- nvram_csum += nvram_buffer[i];
-
- if (nvram_csum != nvram_buffer[nvram_size])
- {
- printk_info("NVRAM checksum invalid - erasing\n");
- //update_device(0, 0);
- //update_csum();
- }
- }
- printk_info("Initialised nvram\n");
- return 0;
-}
-
-void nvram_clear(void)
-{
- printk_info("Erasing NVRAM\n");
- update_device(0, 0);
- update_csum();
-}
-