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