[OpenBIOS] [PATCH 5/6] pci: add SUN hme network device
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Wed Sep 6 21:21:40 CEST 2017
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
drivers/pci.c | 9 +++++++++
drivers/pci_database.c | 6 ++++++
drivers/pci_database.h | 1 +
include/drivers/pci.h | 1 +
4 files changed, 17 insertions(+)
diff --git a/drivers/pci.c b/drivers/pci.c
index cf6d50c..184dfcd 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -674,6 +674,15 @@ int eth_config_cb (const pci_config_t *config)
return 0;
}
+int sunhme_config_cb(const pci_config_t *config)
+{
+ phandle_t ph = get_cur_dev();
+
+ set_int_property(ph, "hm-rev", 0x21);
+
+ return eth_config_cb(config);
+}
+
int rtl8139_config_cb(const pci_config_t *config)
{
#ifdef CONFIG_PPC
diff --git a/drivers/pci_database.c b/drivers/pci_database.c
index c685540..432a63d 100644
--- a/drivers/pci_database.c
+++ b/drivers/pci_database.c
@@ -141,6 +141,12 @@ static const pci_dev_t eth_devices[] = {
sungem_config_cb, "ethernet",
},
{
+ PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HME,
+ NULL, "sunhme", NULL, "SUNW,hme\0",
+ 0, 0, 0,
+ sunhme_config_cb, "ethernet",
+ },
+ {
/* Virtio-network controller */
PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_NET,
NULL, "virtio-net", NULL,
diff --git a/drivers/pci_database.h b/drivers/pci_database.h
index 53eadbd..ac72284 100644
--- a/drivers/pci_database.h
+++ b/drivers/pci_database.h
@@ -42,6 +42,7 @@ extern int i82378_config_cb(const pci_config_t *config);
extern int usb_ohci_config_cb(const pci_config_t *config);
extern int rtl8139_config_cb(const pci_config_t *config);
extern int sungem_config_cb (const pci_config_t *config);
+extern int sunhme_config_cb(const pci_config_t *config);
static inline int pci_compat_len(const pci_dev_t *dev)
{
diff --git a/include/drivers/pci.h b/include/drivers/pci.h
index c03268c..0fd6e39 100644
--- a/include/drivers/pci.h
+++ b/include/drivers/pci.h
@@ -209,6 +209,7 @@ extern const pci_arch_t *arch;
#define PCI_VENDOR_ID_SUN 0x108e
#define PCI_DEVICE_ID_SUN_EBUS 0x1000
+#define PCI_DEVICE_ID_SUN_HME 0x1001
#define PCI_DEVICE_ID_SUN_SIMBA 0x5000
#define PCI_DEVICE_ID_SUN_PBM 0x8000
#define PCI_DEVICE_ID_SUN_SABRE 0xa000
--
1.7.10.4
More information about the OpenBIOS
mailing list