-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2020.02 net cmds #1
base: v2020.02/develop
Are you sure you want to change the base?
Conversation
gcc 10 will default to -fno-common, which causes this error at link time: (.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here This is because both dtc-lexer as well as dtc-parser define the same global symbol yyloc. Before with -fcommon those were merged into one defintion. The proper solution would be to to mark this as "extern", however that leads to: dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls] 26 | extern YYLTYPE yylloc; | ^~~~~~ In file included from dtc-lexer.l:24: dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here 127 | extern YYLTYPE yylloc; | ^~~~~~ cc1: all warnings being treated as errors which means the declaration is completely redundant and can just be dropped. Signed-off-by: Dirk Mueller <[email protected]> Signed-off-by: David Gibson <[email protected]> [robh: cherry-pick from upstream] Cc: [email protected] Signed-off-by: Rob Herring <[email protected]>
net/Makefile
Outdated
@@ -28,6 +28,7 @@ obj-$(CONFIG_CMD_SNTP) += sntp.o | |||
obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o | |||
obj-$(CONFIG_UDP_FUNCTION_FASTBOOT) += fastboot.o | |||
obj-$(CONFIG_CMD_WOL) += wol.o | |||
obj-$(CONFIG_CMD_WOL) += swu.o |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be CONFIG_CMD_SWU
?
net/net.c
Outdated
@@ -526,6 +529,11 @@ int net_loop(enum proto_t protocol) | |||
link_local_start(); | |||
break; | |||
#endif | |||
#if defined(CONFIG_CMD_SWU) | |||
case WOL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be SWU
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx, you caught more typos than I did, and now it's at least what it was supposed to be...
if (argc < 2) | ||
return CMD_RET_USAGE; | ||
swu_set_timeout(simple_strtol(argv[1], NULL, 10) * 1000); | ||
if (net_loop(SWU) < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see timeout stay in msec, instead of user specifying seconds and converting here from sec to msec
cmd/swu.c
Outdated
U_BOOT_CMD( | ||
swu, 2, 1, do_swu, | ||
"wait for an incoming swupdate trigger packet", | ||
"Timeout" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If timeout is changed to msec, that should be mentioned here (sec seems to be default time unit for u-boot, think they don't explicitly mention seconds)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right, the default time units for console commands must be seconds, but the #define default values are millisec. Why do we want to be different than other u-boot cmds for console values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to waste less than a second pausing to listen, if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, but looks like a few copy-modify errors
a913211
to
4bd2373
Compare
0343890
to
6d922a0
Compare
* define a custom ether type and corresponding swu command to trigger a rescue boot for in-field software upgrades; the expected software upgrade framework is currently swupdate (but this is not a hard requirement) * add do_rescue to default u-boot env and set to 0. This fixes an env quirk (bug) where test <undefined> -eq N returns true * check for custom ethertype (0xb990) in main net loop and set do_rescue equal 1 in u-boot environment if detected. The full packet definition and a test tool can be found in radar-test-gui repo; see python code in protocols/radar_packet_proto.py for packet classes and the corresponding wiki docs for packet formats) https://github.com/goletastar/pcr-data-app/wiki Signed-off-by: Stephen L Arnold <[email protected]>
6d922a0
to
700a1ee
Compare
Add scaffolding to detect a custom ethernet protocol (pkt) type for triggering swupdate/rescue boot instead of normal rootfs.