Enable GMac in lwip

Signed-off-by: Hongpeng Huo <hongpeng.huo@hpmicro.com>
This commit is contained in:
Hongpeng Huo
2022-09-27 16:03:32 +08:00
parent 3bb2b429b2
commit 93cca888fe
2 changed files with 12 additions and 12 deletions
@@ -16,6 +16,7 @@
#define HPM_LITTLEFS_DRV_H
#include <stdint.h>
#include <hpm_soc.h>
#include <hpm_romapi.h>
#include <los_fs.h>
@@ -38,4 +39,4 @@ int HpmLittlefsProg(int partition, UINT32 *offset, const void *buf, UINT32 size)
int HpmLittlefsErase(int partition, UINT32 offset, UINT32 size);
int HpmLittlefsDriverInit(struct HpmLittlefsCfg *cfg);
#endif
#endif
+10 -11
View File
@@ -48,14 +48,14 @@ __RW uint8_t txBuff1[ENET_TX_BUFF_COUNT][ENET_TX_BUFF_SIZE]; /* Ethernet Transmi
struct HpmEnetDevice enetDev[2] = {
[0] = {
.isEnable = 0,
.isDefault = 0,
.isEnable = 1,
.isDefault = 1,
.name = "geth",
.base = BOARD_ENET_RGMII,
.irqNum = IRQn_ENET0,
.infType = enet_inf_rgmii,
.macAddr = {0x98, 0x2C, 0xBC, 0xB1, 0x9F, 0x15},
.ip = {192, 168, 1, 35},
.ip = {192, 168, 2, 35},
.netmask = {255, 255, 255, 0},
.gw = {192, 168, 1, 1},
.desc = {
@@ -76,7 +76,7 @@ struct HpmEnetDevice enetDev[2] = {
},
[1] = {
.isEnable = 1,
.isDefault = 1,
.isDefault = 0,
.name = "eth",
.base = BOARD_ENET_RMII,
.irqNum = IRQn_ENET1,
@@ -137,15 +137,14 @@ void enetDevInit(struct HpmEnetDevice *dev)
macCfg.mac_addr_low[0] |= dev->macAddr[0];
macCfg.valid_max_count = 1;
uint32_t dmaIntEnable = 0;
dmaIntEnable = ENET_DMA_INTR_EN_NIE_SET(1) /* Enable normal interrupt summary */
uint32_t dmaIntEnable = ENET_DMA_INTR_EN_NIE_SET(1) /* Enable normal interrupt summary */
| ENET_DMA_INTR_EN_RIE_SET(1); /* Enable receive interrupt */
enet_controller_init(dev->base, dev->infType, &dev->desc, &macCfg, dmaIntEnable);
dev->base->INTR_MASK |= 0xFFFFFFFF;
dev->base->MMC_INTR_MASK_RX |= 0xFFFFFFFF;
dev->base->MMC_INTR_MASK_TX |= 0xFFFFFFFF;
dev->base->MMC_IPC_INTR_MASK_RX |= 0xFFFFFFFF;
enet_disable_lpi_interrupt(dev->base);
if (dev->infType == enet_inf_rgmii) {
rtl8211_config_t phyConfig;