Commit 881e1ee4 authored by Alessandro Rubini's avatar Alessandro Rubini

rename WITH_ETHERBONE to CONFIG_ETHERBONE, ready for Kconfig

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent ab30804f
# choose your board here.
BOARD = spec
# 1 enables Etherbone support
WITH_ETHERBONE=0
# Uncomment to enable Etherbone support (will soon be a Kconfig variable)
# CONFIG_ETHERBONE=y
# and don't touch the rest unless you know what you're doing.
......@@ -24,7 +24,10 @@ INCLUDE_DIRS = -I$(PTP_NOPOSIX)/wrsw_hal \
-I$(PTP_NOPOSIX)/softpll \
-Iinclude
CFLAGS_EB = -DWITH_ETHERBONE=$(WITH_ETHERBONE)
# Will soon be managed by Kconfig
ifdef CONFIG_ETHERBONE
CFLAGS_EB = -DCONFIG_ETHERBONE=1
endif
CFLAGS_PTPD = -ffreestanding \
-DPTPD_FREESTANDING \
......
......@@ -228,7 +228,7 @@ void pfilter_init_default()
pfilter_new();
pfilter_nop();
#if WITH_ETHERBONE != 0
#ifdef CONFIG_ETHERBONE
pfilter_cmp(0, 0xffff, 0xffff, MOV, 1);
pfilter_cmp(1, 0xffff, 0xffff, AND, 1);
pfilter_cmp(2, 0xffff, 0xffff, AND, 1); /* r1 = 1 when dst mac is broadcast */
......@@ -264,7 +264,7 @@ void pfilter_init_default()
pfilter_logic2(R_CLASS(0), 15, MOV, 0); /* class 0: ICMP/IP(unicast) or ARP(broadcast) or PTPv2 => PTP LM32 core */
pfilter_load();
#else
#else /* not etherbone */
pfilter_new();
pfilter_nop();
pfilter_cmp(0, 0xffff, 0xffff, MOV, 1);
......@@ -281,6 +281,6 @@ void pfilter_init_default()
pfilter_logic2(R_CLASS(7), 6, NOT, 0); /* class 7: not PTP => external fabric */
pfilter_logic2(R_CLASS(0), 6, MOV, 0); /* class 0: PTPv2 => PTP LM32 core */
pfilter_load();
#endif
#endif /* CONFIG_ETHERBONE */
}
......@@ -340,8 +340,8 @@ later during the software compilation:
Now you have everything that is needed to build the software for WRPC. Before
compilation the decision can be made whether to turn on or not the software
support for Etherbone core that is integrated inside WRPC gateware for SPEC
board. By default it is disabled but can be turned on by setting the value of
@i{WITH_ETHERBONE} variable inside the Makefile. The compilation is made by
board. By default it is disabled but can be turned on by setting the
@i{CONFIG_ETHERBONE} variable to @i{y} inside the Makefile. The compilation is made by
a simple command without any additional parameters:
@example
......
OBJS_LIB= lib/mprintf.o \
lib/util.o
ifneq ($(WITH_ETHERBONE), 0)
ifdef CONFIG_ETHERBONE
OBJS_LIB += lib/arp.o lib/icmp.o lib/ipv4.o lib/bootp.o
......
......@@ -46,7 +46,7 @@ static const struct shell_cmd cmds_list[] = {
{"time", cmd_time},
{"sfp", cmd_sfp},
{"init", cmd_init},
#if WITH_ETHERBONE
#ifdef CONFIG_ETHERBONE
{"ip", cmd_ip},
#endif
{"mac", cmd_mac},
......
......@@ -13,6 +13,6 @@ OBJS_SHELL = shell/shell.o \
shell/cmd_mac.o \
shell/cmd_init.o
ifneq ($(WITH_ETHERBONE), 0)
ifdef CONFIG_ETHERBONE
OBJS_SHELL += shell/cmd_ip.o
endif
......@@ -68,7 +68,7 @@ void wrc_initialize()
pps_gen_init();
wrc_ptp_init();
#if WITH_ETHERBONE
#ifdef CONFIG_ETHERBONE
ipv4_init("wru1");
arp_init("wru1");
#endif
......@@ -159,7 +159,7 @@ int main(void)
int l_status = wrc_check_link();
switch (l_status) {
#if WITH_ETHERBONE
#ifdef CONFIG_ETHERBONE
case LINK_WENT_UP:
needIP = 1;
break;
......@@ -167,7 +167,7 @@ int main(void)
case LINK_UP:
update_rx_queues();
#if WITH_ETHERBONE
#ifdef CONFIG_ETHERBONE
ipv4_poll();
arp_poll();
#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