Commit 5665ef35 authored by Joerg Fischer's avatar Joerg Fischer Committed by Carl-Daniel Hailfinger
Browse files

Support for Realtek RTL8139 network card flashing


Corresponding to flashrom svn r1002.
Signed-off-by: default avatarJoerg Fischer <turboj@gmx.de>
Acked-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
parent 6d1dea1f
......@@ -110,6 +110,9 @@ CONFIG_DUMMY ?= yes
# Always enable Dr. Kaiser for now.
CONFIG_DRKAISER ?= yes
# Always enable Realtek NICs for now.
CONFIG_NICREALTEK ?= yes
# Always enable Bus Pirate SPI for now.
CONFIG_BUSPIRATESPI ?= yes
......@@ -181,6 +184,12 @@ PROGRAMMER_OBJS += drkaiser.o
NEED_PCI := yes
endif
ifeq ($(CONFIG_NICREALTEK), yes)
FEATURE_CFLAGS += -D'NICREALTEK_SUPPORT=1'
PROGRAMMER_OBJS += nicrealtek.o
NEED_PCI := yes
endif
ifeq ($(CONFIG_BUSPIRATESPI), yes)
FEATURE_CFLAGS += -D'BUSPIRATE_SPI_SUPPORT=1'
PROGRAMMER_OBJS += buspirate_spi.o
......
......@@ -46,6 +46,10 @@ enum programmer {
#if NIC3COM_SUPPORT == 1
PROGRAMMER_NIC3COM,
#endif
#if NICREALTEK_SUPPORT == 1
PROGRAMMER_NICREALTEK,
PROGRAMMER_NICREALTEK2,
#endif
#if GFXNVIDIA_SUPPORT == 1
PROGRAMMER_GFXNVIDIA,
#endif
......@@ -330,7 +334,7 @@ uint32_t pcidev_init(uint16_t vendor_id, uint32_t bar, struct pcidev_status *dev
/* print.c */
char *flashbuses_to_text(enum chipbustype bustype);
void print_supported(void);
#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) || (ATAHPT_SUPPORT == 1)
#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) || (ATAHPT_SUPPORT == 1) || (NICREALTEK_SUPPORT == 1)
void print_supported_pcidevs(struct pcidev_status *devs);
#endif
void print_supported_wiki(void);
......@@ -462,6 +466,18 @@ uint8_t drkaiser_chip_readb(const chipaddr addr);
extern struct pcidev_status drkaiser_pcidev[];
#endif
/* nicrealtek.c */
#if NICREALTEK_SUPPORT == 1
int nicrealtek_init(void);
int nicsmc1211_init(void);
int nicrealtek_shutdown(void);
void nicrealtek_chip_writeb(uint8_t val, chipaddr addr);
uint8_t nicrealtek_chip_readb(const chipaddr addr);
extern struct pcidev_status nics_realtek[];
extern struct pcidev_status nics_realteksmc1211[];
#endif
/* satasii.c */
#if SATASII_SUPPORT == 1
int satasii_init(void);
......
......@@ -47,13 +47,17 @@ enum programmer programmer = PROGRAMMER_DUMMY;
* if more than one of them is selected. If only one is selected, it is clear
* that the user wants that one to become the default.
*/
#if NIC3COM_SUPPORT+GFXNVIDIA_SUPPORT+DRKAISER_SUPPORT+SATASII_SUPPORT+ATAHPT_SUPPORT+FT2232_SPI_SUPPORT+SERPROG_SUPPORT+BUSPIRATE_SPI_SUPPORT+DEDIPROG_SUPPORT > 1
#if NIC3COM_SUPPORT+GFXNVIDIA_SUPPORT+DRKAISER_SUPPORT+SATASII_SUPPORT+ATAHPT_SUPPORT+FT2232_SPI_SUPPORT+SERPROG_SUPPORT+BUSPIRATE_SPI_SUPPORT+DEDIPROG_SUPPORT+NICREALTEK_SUPPORT > 1
#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all external programmers except one.
#endif
enum programmer programmer =
#if NIC3COM_SUPPORT == 1
PROGRAMMER_NIC3COM
#endif
#if NICREALTEK_SUPPORT == 1
PROGRAMMER_NICREALTEK
PROGRAMMER_NICREALTEK2
#endif
#if GFXNVIDIA_SUPPORT == 1
PROGRAMMER_GFXNVIDIA
#endif
......@@ -159,6 +163,42 @@ const struct programmer_entry programmer_table[] = {
},
#endif
#if NICREALTEK_SUPPORT == 1
{
.name = "nicrealtek",
.init = nicrealtek_init,
.shutdown = nicrealtek_shutdown,
.map_flash_region = fallback_map,
.unmap_flash_region = fallback_unmap,
.chip_readb = nicrealtek_chip_readb,
.chip_readw = fallback_chip_readw,
.chip_readl = fallback_chip_readl,
.chip_readn = fallback_chip_readn,
.chip_writeb = nicrealtek_chip_writeb,
.chip_writew = fallback_chip_writew,
.chip_writel = fallback_chip_writel,
.chip_writen = fallback_chip_writen,
.delay = internal_delay,
},
{
.name = "nicsmc1211",
.init = nicsmc1211_init,
.shutdown = nicrealtek_shutdown,
.map_flash_region = fallback_map,
.unmap_flash_region = fallback_unmap,
.chip_readb = nicrealtek_chip_readb,
.chip_readw = fallback_chip_readw,
.chip_readl = fallback_chip_readl,
.chip_readn = fallback_chip_readn,
.chip_writeb = nicrealtek_chip_writeb,
.chip_writew = fallback_chip_writew,
.chip_writel = fallback_chip_writel,
.chip_writen = fallback_chip_writen,
.delay = internal_delay,
},
#endif
#if GFXNVIDIA_SUPPORT == 1
{
.name = "gfxnvidia",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment