NT4/private/ntos/nthals/hallx3/alpha/pflash.c
2020-09-30 17:12:29 +02:00

92 lines
1.4 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 1995 Digital Equipment Corporation
Module Name:
pflash.c
Abstract:
This module contains the platform dependent code to access the AMD
flash ROM part
Author:
Wim Colgate, 5/23/95
Environment:
Firmware/Kernel mode
Revision History:
--*/
#include "halp.h"
#include "arccodes.h"
#include <flash8k.h>
#include "flashbus.h"
#include "am29f400.h"
VOID pWriteFlashByte(
IN ULONG FlashOffset,
IN UCHAR Data
)
/*++
Routine Description:
This routine goes writes the flashbus using the hardware
specific access method.
Arguments:
FlashOffset - offset within the flash ROM.
Data - data to write
Return Value:
The value of the flash at the given location.
--*/
{
WRITE_EPIC_REGISTER(FLASH_ACCESS_ADDR,
(FlashOffset << FLASH_ADDR_SHIFT) | Data
| FLASH_WRITE_FLAG);
}
UCHAR pReadFlashByte(
IN ULONG FlashOffset
)
/*++
Routine Description:
This routine goes out and reads the flashbus using the hardware
specific access method.
Arguments:
FlashOffset - offset within the flash ROM.
Return Value:
The value of the flash at the given location.
--*/
{
ULONG ReturnVal;
WRITE_EPIC_REGISTER(FLASH_ACCESS_ADDR,
(FlashOffset << FLASH_ADDR_SHIFT));
ReturnVal = READ_EPIC_REGISTER(FLASH_ACCESS_ADDR);
return (UCHAR)ReturnVal;
}