Commit 62d60bf4 authored by hongming's avatar hongming

Add etherbone module.

parent 228c1ac0
......@@ -18,6 +18,7 @@ unsigned char *BASE_PPS_GEN;
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 */
......@@ -72,6 +73,7 @@ struct wrc_device devs[] = {
{&BASE_UART, VID_CERN, 0xe2d13d04},
{&BASE_ONEWIRE, VID_CERN, 0x779c5443},
{&BASE_EXT_CFG, VID_THU, 0xc0413599},
{&BASE_ETHERBONE_CFG, VID_GSI, 0x68202b22},
};
void sdb_find_devices(void)
......
......@@ -15,6 +15,7 @@ extern unsigned char *BASE_PPS_GEN;
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
......
......@@ -200,8 +200,16 @@ DEFINE_WRC_TASK(ipv4) = {
void setIP(unsigned char *IP)
{
volatile unsigned int *eb_ip =
(unsigned int *)(BASE_ETHERBONE_CFG + EB_IPV4);
unsigned int ip;
memcpy(myIP, IP, 4);
ip = (myIP[0] << 24) | (myIP[1] << 16) | (myIP[2] << 8) | (myIP[3]);
while (*eb_ip != ip)
*eb_ip = ip;
ext_config(IP);
bootp_retry = 0;
......
......@@ -224,6 +224,7 @@ enum pf_symbolic_regs {
FRAME_UDP,
FRAME_TCP,
PORT_UDP_HOST,
PORT_UDP_ETHERBONE,
R_TMP,
/* These are results of logic over the previous bits */
......@@ -419,13 +420,16 @@ void pfilter_init_novlan(char *fname)
pfilter_logic2(FRAME_UDP, FRAME_UDP, AND, FRAME_IP_OK);
pfilter_cmp(18, 0x0000, 0xff00, MOV, PORT_UDP_HOST); /* ports 0-255 */
pfilter_cmp(18, 0x0100, 0xff00, OR, PORT_UDP_HOST); /* ports 256-511 */
pfilter_cmp(18, 0xebd0, 0xffff, MOV, PORT_UDP_ETHERBONE); /* ports 60368 */
/* The CPU gets those ports in a proper UDP frame, plus the previous selections */
pfilter_logic2(R_CLASS(1), FRAME_UDP, AND, PORT_UDP_HOST);
/* and now copy out fabric selections: 7 etherbone, 6 for anything else */
pfilter_logic3(R_CLASS(5), PORT_UDP_HOST, NOT, R_ZERO, AND, FRAME_UDP);
pfilter_logic2(R_CLASS(6), FRAME_TCP, AND, FRAME_IP_OK);
/* and now copy out fabric selections: 4 etherbone, 6 for anything else */
pfilter_logic2(R_CLASS(4), FRAME_UDP, AND, PORT_UDP_ETHERBONE);
pfilter_logic3(R_CLASS(6), PORT_UDP_HOST, OR, PORT_UDP_ETHERBONE, NAND, FRAME_UDP);
pfilter_logic2(R_CLASS(7), FRAME_TCP, AND, FRAME_IP_OK);
/*
* Note that earlier we used to be more strict in ptp ethtype (only proper multicast),
* but since we want to accept peer-delay sooner than later, we'd better avoid the checks
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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