Hi there ,
I am trying to reproduce [Solved] Swconfig router and switch gl.inet ar150 . Setting both RJ45 Ethernet plugs working under the switch present in the minirouter: AR-150 Gl.Inet. (I guess it was OpenWRT 18.x.x).
First step with thev new Device Tree (DT) system is adding to ar9330_glinet_gl-ar150.dts (openwrt-main\target\linux\ath79\dts)
a line that says switch-only-mode = <1>; somewhere near where the device is descripted:
ð1 {
status = "okay";
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
gmac-config {
device = <&gmac>;
switch-phy-addr-swap = <0>;
switch-phy-swap = <0>;
switch-only-mode = <1>;
};
};
I don't know if it will work or not, but before that I have to add :
ag71xx_of_bit(np, "switch-only-mode", &val, AR933X_ETH_CFG_SW_ONLY_MODE);
into static void ag71xx_setup_gmac_933x(.........)
of ag71xx_gmac.c (\openwrt-main\target\linux\ath79\files\drivers\net\ethernet\atheros\ag71xx)
and #define AR933X_ETH_CFG_SW_ONLY_MODE BIT(6) into the * AR933X GMAC interface block of ag71xx_regs.h (\openwrt-main\target\linux\ath79\files\drivers\net\ethernet\atheros\ag71xx).
My problem so far is that using this approach will raise an [error: AR933X_ETH_CFG_SW_ONLY_MODE ‘undeclared' (first use in this function)] during compile/build; Function being ag71xx_setup_gmac_933x of ag71xx_gmac.c
while all the others #define don't throw any error at all.
I can get the Build process to terminate without error, adding #define AR933X_ETH_CFG_SW_ONLY_MODE BIT(6) into
ag71xx_gmac.c (\openwrt-main\target\linux\ath79\files\drivers\net\ethernet\atheros\ag71xx)
directly, but this makes me feel uneasy.
What am I getting wrong? Why is that?
ag71xx_gmac.c has a line with #include "ag71xx.h"
and ag71xx.h (openwrt-main\target\linux\ath79\files\drivers\net\ethernet\atheros\ag71xx) has a line that says #include <asm/mach-ath79/ar71xx_regs.h>
Why do I get the undecleared error ?
And what does #include <asm/mach-ath79/ar71xx_regs.h>, actually do ?
