Note that in each subdirectory, the U-Boot build system will link everything that gets compiled into a "lump" it calls built-in.o. I suppose that is as good a name as any. At any event, seeing this doesn't tell you much other than something else somewhere actually got compiled and then linked with other things (if there are any) to produce this. In other words you can ignore these.
gmac:ethernet@c0060000 { compatible = "nexell,nexell-gmac"; reg = <0xc0060000 0x8000>; phy-mode = "rgmii"; pinctrl-names = "default"; pinctrl-0 = <&gmac_txd>, <&gmac_rxd>, <&gmac_txen>, <&gmac_mdc>, <&gmac_mdio>, <&gmac_rxclk>, <&gmac_txclk>; status = "disabled"; };
board/s5p6818/nanopi3/board.c has code for extracting the ethernet address.
The designware.c driver catches our attention because grep finds the string "nexell" in it. Taking a look at designware.h, the register layout matches what is in chapter 17 of the S5P6818 user manual. This is very promising.
In addition, here are some code snippets:
static const struct udevice_id designware_eth_ids[] = { { .compatible = "allwinner,sun7i-a20-gmac" }, { .compatible = "altr,socfpga-stmmac" }, { .compatible = "nexell,nexell-gmac" }, { } };Note that the "nexell" strings here match those in the s5p6818.dtsi file.
#ifdef CONFIG_DM_ETH #if defined(CONFIG_ARCH_NEXELL) static int nexell_gmac_initialize(void) { struct clk *clk; unsigned int rate; /* Clock control */ clk = clk_get("nx-gmac.0"); if (!clk) return 0; clk_disable(clk); rate = clk_set_rate(clk, 125000000); clk_enable(clk); debug("rate: %u\n", rate); /* Reset control */ nx_rstcon_setrst(RESET_ID_DWC_GMAC, 0); nx_rstcon_setrst(RESET_ID_DWC_GMAC, 1); return 0; } #endif /* CONFIG_ARCH_NEXELL */
Before doing anything else, spend some time looking at the top level README in the U-Boot distribution. The "doc" directory includes a collection of more specific README files, but I don't see anything for Nexell or 6818.
Now, take a look at u-boot/drivers/net/Makefile -- it has a bunch of lines that look like the following.obj-$(CONFIG_ETH_DESIGNWARE) += designware.oHow does this work? Well, if the option is turned on, the value of the variable will be "y" and we will add the object file to "obj-y". Otherwise I guess it gets added to the variable "obj-" which just gets ignored. So the big question is how and where does CONFIG_ETH_DESIGNWARE get set? Fundamentally in some file like u-boot/configs/Orangepi_defconfig
Also worth noting is that my board has an RTL 8211E chip to handle the ethernet physical layer. None of the defconfig files seem to mention it.
make distclean make V=1 s5p6818_nanopi3_defconfig make -f ./scripts/Makefile.build obj=scripts/basic cc -Wp,-MD,scripts/basic/.fixdep.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/basic/fixdep scripts/basic/fixdep.c rm -f .tmp_quiet_recordmcount make -f ./scripts/Makefile.build obj=scripts/kconfig s5p6818_nanopi3_defconfig cc -Wp,-MD,scripts/kconfig/.conf.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -D_GNU_SOURCE -D_DEFAULT_SOURCE -DCURSES_LOC="This does not cut it. The setting for CONFIG_ETH_DESIGNWARE does not make it into the .config file for some reason." -DNCURSES_WIDECHAR=1 -DLOCALE -c -o scripts/kconfig/conf.o scripts/kconfig/conf.c cat scripts/kconfig/zconf.tab.c_shipped > scripts/kconfig/zconf.tab.c cat scripts/kconfig/zconf.lex.c_shipped > scripts/kconfig/zconf.lex.c cat scripts/kconfig/zconf.hash.c_shipped > scripts/kconfig/zconf.hash.c cc -Wp,-MD,scripts/kconfig/.zconf.tab.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -D_GNU_SOURCE -D_DEFAULT_SOURCE -DCURSES_LOC=" " -DNCURSES_WIDECHAR=1 -DLOCALE -Iscripts/kconfig -c -o scripts/kconfig/zconf.tab.o scripts/kconfig/zconf.tab.c cc -o scripts/kconfig/conf scripts/kconfig/conf.o scripts/kconfig/zconf.tab.o scripts/kconfig/conf --defconfig=arch/../configs/s5p6818_nanopi3_defconfig Kconfig # # configuration written to .config #
Tom's electronics pages / [email protected]