diff options
author | Kyle Moffett <Kyle.D.Moffett@boeing.com> | 2011-10-18 11:05:28 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-10-28 00:35:26 +0200 |
commit | 2326a94db10d9b6c0bf322c6536cafcac8e85522 (patch) | |
tree | cc64789e742b2cc61b7cff7e15060727dbee8781 /drivers/net/e1000.h | |
parent | 114d7fc053470d900b406711ba8cb69cf9131316 (diff) | |
download | u-boot-imx-2326a94db10d9b6c0bf322c6536cafcac8e85522.zip u-boot-imx-2326a94db10d9b6c0bf322c6536cafcac8e85522.tar.gz u-boot-imx-2326a94db10d9b6c0bf322c6536cafcac8e85522.tar.bz2 |
e1000: Export core EEPROM access functions for SPI support
A followup patch will be adding a configurable feature to enable
programming of E1000 EEPROMs from the command line or via the generic
U-Boot SPI interface.
In order for it to work it needs access to certain E1000-internal
functions, so export those in the e1000.h header file.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net/e1000.h')
-rw-r--r-- | drivers/net/e1000.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/e1000.h b/drivers/net/e1000.h index b4e9cf2..fc5ed57 100644 --- a/drivers/net/e1000.h +++ b/drivers/net/e1000.h @@ -55,10 +55,29 @@ #define DEBUGOUT(fmt, args...) do { } while (0) #endif +/* I/O wrapper functions */ +#define E1000_WRITE_REG(a, reg, value) \ + (writel((value), ((a)->hw_addr + E1000_##reg))) +#define E1000_READ_REG(a, reg) \ + (readl((a)->hw_addr + E1000_##reg)) +#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) \ + (writel((value), ((a)->hw_addr + E1000_##reg + ((offset) << 2)))) +#define E1000_READ_REG_ARRAY(a, reg, offset) \ + (readl((a)->hw_addr + E1000_##reg + ((offset) << 2))) +#define E1000_WRITE_FLUSH(a) \ + do { uint32_t x = E1000_READ_REG(a, STATUS); } while (0) + /* Forward declarations of structures used by the shared code */ struct e1000_hw; struct e1000_hw_stats; +/* Internal E1000 helper functions */ +int32_t e1000_acquire_eeprom(struct e1000_hw *hw); +void e1000_standby_eeprom(struct e1000_hw *hw); +void e1000_release_eeprom(struct e1000_hw *hw); +void e1000_raise_ee_clk(struct e1000_hw *hw, uint32_t *eecd); +void e1000_lower_ee_clk(struct e1000_hw *hw, uint32_t *eecd); + typedef enum { FALSE = 0, TRUE = 1 |