Commit e6d28724 authored by hm's avatar hm

Add the ip config module for ext module(com5402 or other udp core).

parent 062885f2
......@@ -19,6 +19,7 @@ unsigned char *BASE_SYSCON;
unsigned char *BASE_UART;
unsigned char *BASE_ONEWIRE;
unsigned char *BASE_ETHERBONE_CFG;
unsigned char *BASE_EXT_CFG;
/* The sdb filesystem itself */
static struct sdbfs wrc_fpga_sdb = {
......@@ -55,6 +56,7 @@ void sdb_print_devices(void)
/* To save a little size, we enumerate our vendors */
#define VID_CERN 0x0000ce42LL
#define VID_GSI 0x00000651LL
#define VID_THU 0x00001103LL
struct wrc_device {
unsigned char **base;
......@@ -71,6 +73,7 @@ struct wrc_device devs[] = {
{&BASE_UART, VID_CERN, 0xe2d13d04},
{&BASE_ONEWIRE, VID_CERN, 0x779c5443},
{&BASE_ETHERBONE_CFG, VID_GSI, 0x68202b22},
{&BASE_EXT_CFG, VID_THU, 0xc0413599},
};
void sdb_find_devices(void)
......
......@@ -16,6 +16,7 @@ extern unsigned char *BASE_SYSCON;
extern unsigned char *BASE_UART;
extern unsigned char *BASE_ONEWIRE;
extern unsigned char *BASE_ETHERBONE_CFG;
extern unsigned char *BASE_EXT_CFG;
#define FMC_EEPROM_ADR 0x50
......
......@@ -13,6 +13,7 @@
#include "ptpd_netif.h"
#include "hw/memlayout.h"
#include "hw/etherbone-config.h"
#include "hw/ext-config.h"
#ifndef htons
#define htons(x) x
......@@ -91,6 +92,9 @@ void setIP(unsigned char *IP)
{
volatile unsigned int *eb_ip =
(unsigned int *)(BASE_ETHERBONE_CFG + EB_IPV4);
volatile unsigned int *ext_ip =
(unsigned int *)(BASE_EXT_CFG + EXT_IPV4);
unsigned int ip;
memcpy(myIP, IP, 4);
......@@ -98,6 +102,8 @@ void setIP(unsigned char *IP)
ip = (myIP[0] << 24) | (myIP[1] << 16) | (myIP[2] << 8) | (myIP[3]);
while (*eb_ip != ip)
*eb_ip = ip;
while (*ext_ip != ip)
*ext_ip = ip;
needIP = (ip == 0);
if (!needIP) {
......
......@@ -351,7 +351,7 @@ void pfilter_init(int mode, char *fname)
if (mode & MODE_NIC_PFILTER) {
pfilter_cmp(18,0xebd0,0xffff,MOV, FRAME_PORT_ETHERBONE);
pfilter_cmp(18,0xebc0,0xffff,MOV, FRAME_PORT_ETHERBONE);
/* Here we had a commented-out check for magic (offset 21, value 0x4e6f) */
......
......@@ -188,7 +188,7 @@ int main(void)
switch (l_status) {
#ifdef CONFIG_ETHERBONE
case LINK_WENT_UP:
//needIP = 1;
needIP = 0;
break;
#endif
......
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